diff --git a/js/tsne_vis.js b/js/tsne_vis.js index 05e7b30..b4c41a1 100755 --- a/js/tsne_vis.js +++ b/js/tsne_vis.js @@ -12,7 +12,7 @@ var final_dataset; var points = []; var cost = []; var cost_each; var beta_all = var ArrayContainsDataFeaturesCleared = []; var ArrayContainsDataFeaturesClearedwithoutNull = []; var ArrayContainsDataFeaturesClearedwithoutNullKeys = []; var flagAnalysis = false; // The distances in the high dimensional space and in the 2D space. All the labels that were found in the selected data set. -var dists; var dists2d; var all_labels; var dist_list = []; var dist_list2d = []; var InitialFormDists = []; var InitialFormDists2D = []; +var dists; var dists2d; var all_labels; var dist_list = []; var dist_list2d = []; var InitialFormDists = []; var InitialFormDists2D = []; // These are the dimensions for the Overview view and the Main view var dim = document.getElementById('tSNEcanvas').offsetWidth; var dimensions = document.getElementById('modtSNEcanvas').offsetWidth; @@ -28,7 +28,7 @@ var returnVal = false; // svgClick = Click a left mouse click in order to add a point. // prevRightClick = When right click is pressed prevent any other action. Lock the current schema. // if flagForSchema is false then send a message to the user that he/she has to: "Please, draw a schema first!"); -var svgClick; var prevRightClick; var flagForSchema = false; +var svgClick; var prevRightClick; var flagForSchema = false; var PreComputFlagCorrelation = true; var maxminTotal = []; // Save the parameters for the current analysis, save the overallCost, and store in the "input" variable all the points and points2D. var ParametersSet = []; var overallCost; var input; @@ -40,7 +40,8 @@ var ringNotes = []; var gAnnotationsAll = []; var AnnotationsAll = []; var dragg var MainCanvas; var Child; var renderer; var fov = 21; var near = 10; var far = 7000; var camera; var scene; // Initialize the Schema Investigation variables. -var Arrayx = []; var Arrayy = []; var XYDistId = []; var Arrayxy = []; var DistanceDrawing1D = []; var allTransformPoints = []; var p; var pFinal = []; var paths; var path; var ArrayLimit = []; var minimum; var correlationResults = []; var ArrayContainsDataFeaturesLimit = []; +var Arrayx = []; var Arrayy = []; var XYDistId = []; var Arrayxy = []; var DistanceDrawing1D = []; var allTransformPoints = []; var p; var pFinal = []; var paths; var path; var ArrayLimit = []; +var minimum; var correlationResults = []; var correlationResultsFinal = []; var ArrayContainsDataFeaturesLimit = []; // This function is executed when the factory button is pressed in order to bring the visualization in the initial state. function FactoryReset(){ @@ -78,6 +79,7 @@ function fetchVal(callback) { // Parse the analysis folder if requested or the csv file if we run a new execution. var getData = function() { + PreComputFlagCorrelation = true; let format; let value; if (typeof window.FileReader !== 'function') { @@ -1377,7 +1379,7 @@ function click(){ // This is the click of the Schema Investigation scenario } function CalculateCorrel(){ // Calculate the correlation is a function which has all the computations for the schema ordering (investigation). - + if (flagForSchema == false){ alert("Please, draw a schema first!"); // If no Schema is drawn then ask the user! } else{ @@ -1436,14 +1438,12 @@ function CalculateCorrel(){ // Calculate the correlation is a function which has } ArrayLimit = []; - for (var i=0; i *").remove(); d3.selectAll("#modtSNEcanvas_svg > *").remove(); @@ -1593,7 +1593,33 @@ function CalculateCorrel(){ // Calculate the correlation is a function which has } } } + + function getMinMaxOf2DIndex (arr, idx) { + return { + min: Math.min.apply(null, arr.map(function (e) { return e[idx]})), + max: Math.max.apply(null, arr.map(function (e) { return e[idx]})) + } + } + + var maxminArea = []; + for (var i=0; i