diff --git a/__pycache__/tsneGrid.cpython-37.pyc b/__pycache__/tsneGrid.cpython-37.pyc index 4fc4056..62d0699 100644 Binary files a/__pycache__/tsneGrid.cpython-37.pyc and b/__pycache__/tsneGrid.cpython-37.pyc differ 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):