@ -369,8 +370,8 @@ function setAnnotator(){ // Set a new annotation on top of the main visualizatio
.draggable(true);
varsvgAnnotator=d3v3.select("#SvgAnnotator")
.attr("width",vw2*0.5)
.attr("height",vh2*0.888)
.attr("width",vw2)
.attr("height",vh2)
.style("z-index",3);
vargAnnotations=svgAnnotator.append("g")
.attr("class","annotations")
@ -565,9 +566,8 @@ function init(data, results_all, fields) {
}
}
$("#datasetDetails").html("Number of Dimensions: "+(Object.keys(dataFeatures[0]).length-valCategExists)+", Number of Samples: "+final_dataset.length);// Print on the screen the number of dimensions and samples of the data set, which is being analyzed.
$("#datasetDetails").html("Number of Features: "+(Object.keys(dataFeatures[0]).length-valCategExists)+", Number of Instances: "+final_dataset.length);// Print on the screen the number of features and instances of the data set, which is being analyzed.
if(Category==undefined){
console.log("mpike");
$("#CategoryName").html("Classification label: No category");// Print on the screen the classification label.
}else{
$("#CategoryName").html("Classification label: "+Category.replace('*',''));// Print on the screen the classification label.
@ -793,6 +793,8 @@ function updateEmbedding(AnalysisResults) {
@ -1271,12 +1277,20 @@ function handleLassoEnd(lassoPolygon) { // This is for the lasso interaction
points[i].starplot=false;
}
}
redraw(points);// Redraw the points according to the new specifications.
redraw(points);
}
functionhandleLassoStart(lassoPolygon){// Empty we do not need to reset anything.
KNNEnabled=false;
for(vari=0;i<points.length;i++){
points[i].selected=true;
points[i].starplot=false;
points2d[i].selected=true;
}
redraw(points);
}
// Initialize the horizontal (correlations) barchart's variables
@ -2100,131 +2114,98 @@ if (points.length) { // If points exist (at least 1 point)
varindices2d=newArray(selectedPoints.length);
varfindNearest;
varcounter1;
varcounter2;
vartemp=[];
vartemp2=[];
varviewport=getViewport();// Get the main viewport width height
varvw=viewport[0]*0.5;
varvh=viewport[1]*0.042;
varfactor=Math.log10(points.length)*4;// This is a factor which a programmer sets
if(factor==0){
factor=1;
}
varmaxKNN=Math.ceil(points.length/factor);// Specify the amount of k neighborhoods that we are going to calculate.
if(maxKNN>150){
maxKNN=150;
}
varmaxKNN=document.getElementById("param-perplexity-value").value;// Specify the amount of k neighborhoods that we are going to calculate. According to "perplexity."
selectedPoints.sort(function(a,b){// Sort the points according to ID.
returnparseFloat(a.id)-parseFloat(b.id);
});
$("#kNNDetails").html("Purity of the cluster was checked for k values starting from "+(1)+" to "+maxKNN+".");// Print on the screen the number of k values of kNN which we present!
if(selectedPoints.length==1){
alert("You have selected only one point. We cannot compute the purity of one point. Please, consider selecting at least two points.")
}
for(k=maxKNN;k>1;k--){// Start from the maximum k value and go to the minimum (k=2).
for(k=maxKNN;k>0;k--){// Start from the maximum k value and go to the minimum (k=2).
findNearest=0;// If kNN is fully uncorrelated then we say that the value is 0.
}
findNearestTable.push(findNearest*vh*2);// These values are multiplied by the height of the viewport because we need to draw the bins of the barchart representation
if(isNaN(findNearest)){
findNearest=0;// If kNN is fully uncorrelated then we say that the value is 0.
}
findNearestTable.push(findNearest*vh*2);// These values are multiplied by the height of the viewport because we need to draw the bins of the barchart representation
}
findNearestTable.reverse();
varbarPadding=5;// Leave some space between the bars
@ -2258,13 +2239,15 @@ if (points.length) { // If points exist (at least 1 point)
for(vari=0;i<selectedPoints.length;i++){
if(selectedPoints[i].starplot==true){// Count the selected points
coun=coun+1;
console.log(coun);
}
}
if(selectedPoints.length<=10&&coun>0){// If points > 10 then do not draw! If points = 0 then do not draw!
varFeatureWise=[];
for(varj=0;j<Object.values(dataFeatures[0]).length;j++){// Get the features of the data set.
for(vari=0;i<dataFeatures.length;i++){
if(!isNaN(Object.values(dataFeatures[i])[j])){
@ -2446,15 +2429,6 @@ if (points.length) { // If points exist (at least 1 point)
})
}
// Here we start with the Three.js (zoom and drag functions!)