From 6df8f7521527c37bb761fb330ff731ed2ace45f4 Mon Sep 17 00:00:00 2001 From: Angelos Chatzimparmpas Date: Sun, 10 Nov 2019 11:19:04 +0100 Subject: [PATCH] fixed reset Former-commit-id: 738a0da510fad5b9886d20416641635c84047e87 --- __pycache__/tsneGrid.cpython-37.pyc | Bin 9632 -> 9935 bytes js/tsne_vis.js | 14 ++++++++ tsneGrid.py | 50 ++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+) diff --git a/__pycache__/tsneGrid.cpython-37.pyc b/__pycache__/tsneGrid.cpython-37.pyc index 4fc405686e7e246e8a15c382ba4217218166ed48..62d069990f3f2a552028cea2afc9024ad05c884b 100644 GIT binary patch delta 2814 zcmai0Yitx%6rQ`&-A?z_vTe5yC~RBWvb406g7v{epa`O^MHF-qmtpTsJ9KwuIWtRn z7^^~}F)@la!M9S00zWV&{jZ6CjE}?^6OH2!HEN>quZfAjJm(Gpx7N6u^WA&TeD~aQ z&OP_eT)gLt@#Ky~BC6r<*B?JVJUDtj*~&gT-}mR7=sniQ>v_WzBQT8{8-iv)aJHL*i zC4{1*)S!e>A}F;e21*@D6eWfdM@gV0c?j3iCvxFZ*_si4_kQKj@7s)qYT(N9-tf?24)szDD%4?XfP{oxU4#{LRQ zNd`gF4ZY^S{~^Ve*Fqn$HL|SRY@PgGZ`pd?9!`f|1i!%+*3|S-2c{i|W9Z&}sC82a zS}4lmEXktGU@4S#1{>sSkMAqGb?RvISiHJk3;_sJ4%`(7+zG za8Ry{<<~EoyR1|xdR87Pc77Jja#_IZWTFN^!)cI{*J2kE6hSr&1~$+yC*!kY&_Vr0 z#uDTOZNG5us@U_$aMK7Ht3gvF4H!v0l){LN5IicI55qB?VV7$kiJ^(D)Odx?2S?n-7Fjwt?2NpQ#FE_BFBvZtxqQ+Nb9 z@5}d+9re^xw@^V?c%m16PhP2MQf06KpG=|P?}u&BCoeZ{!Ses5@z@X*gFNqs8qnW(Kp>>}asUPAu6)@_to}i|9L%zOI^{yiT7M<(&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`d%{+af2zO{{&v2&Wi&`Jk+uHORYV+gOYIyKG;3D|!TlHtcy-E)*Si)&}%y z3CGdo^N~)rRT|-M<)LyuUrX}!gbsujfllgo5jGGS2uVUWVIx69Xff!aelMYg&`0Pe z3=jqhDZ&t87~!!Ku$jJWA*dMZ7bC66+LmirMZ-P6TLrmY&Qy#Zq1f(ogyvVlcmb!F z$Nu8#D|WobvLUaV#+=|8#|7N;akO^)2p@wT??y$n+B74dWnRD(7IezlXkXo`F6Ece z_PS@ugQ`OoXO-#$yX5cDx7moiQ29*LiV!LaAPQh-aqWz}U)jV)Whj=3E>TH4R$nzu zUV{i9t6(rD-;2E;qtLVvM6iJdxh+0B;Z+Qf19ttd5u9GHPO-uH)0=XgFx2m=+hA$re<>jM7qq> zCxz)`U>#1T!#JKdEO?xh2M}6$y23H?hN%M{Ub=Fzf9MDtCX>iaUU1vs4jlCP(S`BTG4+bBxY z5w5%X5jyp9^0$-5LIrL(uFM9KTVaGo%LsHfULda*V2pZkER|`Ibq(8co-|D_lr?Qf zc)@Agu;kUi&?HQd6`qhU9mC6r*>?}BgZIjXRm=;}UE#&|WlVeaXhF}4gSe&_9v7l8 z?s#F>Ht{=bB_G=fI|#cF6vH_LF7r>IzANnDYb3ZTGA~xzwlksQd7aY+VGmjDlRq|o z6IIWOdMkz(7S_JRHmi(iu%h7w9Q5iX3)XZU6((FD%?1J;oR?TuFDQ^-bhP!WqIsF-gQjg4;1cOy zCA>y>o$vzH4&=*C}0`UU{|i47(+xU1Q1X=t~Qf3g|;} zev_cmwTL!(zN@9TNLlmav@Zm=kzOQ|$?Jxd$;_3d2GoB#xFwZJXz>% diff --git a/js/tsne_vis.js b/js/tsne_vis.js index 392fe4c..4e9409a 100755 --- a/js/tsne_vis.js +++ b/js/tsne_vis.js @@ -63,6 +63,10 @@ var results_all_global = [] // This function is executed when the factory button is pressed in order to bring the visualization in the initial state. function FactoryReset(){ + var graphDiv = 'ProjectionsVisual' + + Plotly.purge(graphDiv); + location.reload(); } @@ -768,6 +772,12 @@ var getData = function() { // Parse the data set with the use of PapaParse. function parseData(url) { + + var graphDiv = 'gridVisual' + Plotly.purge(graphDiv); + + document.getElementById("loader").style.display = "block"; + Papa.parse(url, { download: true, header: true, @@ -820,6 +830,8 @@ function parseData(url) { init(results.data, results_all, results.meta.fields); // Call the init() function that starts everything! } else { // ajax the JSON to the server + $.post("http://127.0.0.1:5000/resetAll", JSON.stringify(''), function(){ + }); $.post("http://127.0.0.1:5000/receiver", JSON.stringify(results_all), function(){ $.get("http://127.0.0.1:5000/sender", function( data ) { dataReceivedFromServer = data @@ -2471,6 +2483,8 @@ function setReset(){ // Reset only the filters which were applied into the data ArrayContainsDataFeaturesLimit = []; prevRightClick = false; + + //pcpInitialize(); // Reset the points into their initial state diff --git a/tsneGrid.py b/tsneGrid.py index 98b5bbe..835a938 100644 --- a/tsneGrid.py +++ b/tsneGrid.py @@ -25,6 +25,56 @@ import bhtsne app = Flask(__name__) CORS(app) +@app.route('/resetAll', methods = ['POST']) +def Reset(): + + print('mpike') + + global dataProc + dataProc = [] + + global D_highSpace + D_highSpace = [] + + global overalProjectionsNumber + overalProjectionsNumber = [] + + global projectionsAll + projectionsAll = [] + + global SelectedListofParams + SelectedListofParams = [] + + global SelectedProjectionsReturn + SelectedProjectionsReturn = [] + + global clusterIndex + clusterIndex = [] + + global convertLabels + convertLabels = [] + + global D_lowSpaceList + D_lowSpaceList = [] + + global KeepKs + KeepKs = [] + + global metricsMatrixEntire + metricsMatrixEntire = [] + + global metricsMatrix + metricsMatrix = [] + + global metricsMatrixSel + metricsMatrixSel = [] + + global metricsMatrixEntireSel + metricsMatrixEntireSel = [] + + return 'Reset' + + # NOTE: Only works with labeled data def neighborhood_hit(X, y, k):