diff --git a/css/style.css b/css/style.css index 49fd740..b40dad7 100755 --- a/css/style.css +++ b/css/style.css @@ -173,12 +173,12 @@ cursor: default; /* Number of Points font-size */ text.legendtitle { - font-size: 12px; + font-size: 15px; } /* Number of Points font-size */ text.label { - font-size: 10px; + font-size: 12px; } /* Styling of the ShepardHeatmap */ @@ -343,6 +343,7 @@ rect { #starPlot{ border: 1px solid grey; margin-left:10px; + margin-top:10px; } .parent-row{ @@ -353,10 +354,10 @@ rect { } #extra-information { - margin-top: 25px; + margin-top: 40px; margin-left: 10px; } #kNNInfo { - margin-top: 40px; -} + margin-top: 35px; +} \ No newline at end of file diff --git a/data/Frogs_MFCCs_s.csv b/data/Frogs_MFCCs_s.csv index 0fce6c1..b2c419b 100644 --- a/data/Frogs_MFCCs_s.csv +++ b/data/Frogs_MFCCs_s.csv @@ -1,4 +1,4 @@ -MFCCs_ 1,MFCCs_ 2,MFCCs_ 3,MFCCs_ 4,MFCCs_ 5,MFCCs_ 6,MFCCs_ 7,MFCCs_ 8,MFCCs_ 9,MFCCs_10,MFCCs_11,MFCCs_12,MFCCs_13,MFCCs_14,MFCCs_15,MFCCs_16,MFCCs_17,MFCCs_18,MFCCs_19,MFCCs_20,MFCCs_21,MFCCs_22,Family,Genus,name,RecordID +MFCCs_ 1,MFCCs_ 2,MFCCs_ 3,MFCCs_ 4,MFCCs_ 5,MFCCs_ 6,MFCCs_ 7,MFCCs_ 8,MFCCs_ 9,MFCCs_10,MFCCs_11,MFCCs_12,MFCCs_13,MFCCs_14,MFCCs_15,MFCCs_16,MFCCs_17,MFCCs_18,MFCCs_19,MFCCs_20,MFCCs_21,MFCCs_22,Family,Genus,Species*,RecordID 1,0.666108754271193,0.731362010250012,0.425793611387935,-0.0923903533560614,0.0753933653354942,-0.0494833973257411,0.170614714842396,0.168954621377821,-0.314493168745296,0.0619854239467194,0.516799990257242,-0.133507530774317,-0.176176752468337,0.331092083947996,0.12857630021297,-0.0992389242138077,0.0386145965840293,0.0214557656923758,-0.00986113692290599,-0.0117793910208448,-0.179735670710639,Hylidae,Hypsiboas,HypsiboasCinerascens,36 1,0.0760281160308934,0.144443042939295,0.576311051440182,0.29390383880401,0.0922434101031376,-0.182238996214759,-0.0942232472071347,0.194344811989589,0.0462358570164354,-0.166049600331633,0.245487673567843,0.269489272912798,-0.241274927740399,-0.171701734508546,0.290623995847323,0.241672194740575,-0.10567666108919,-0.186795953907457,-0.0945262400639609,0.157150935997087,0.160444712738068,Leptodactylidae,Adenomera,AdenomeraHylaedactylus,24 1,0.741352655534938,0.699044230343737,0.373693368543064,-0.0259796735805141,0.0930768239776094,-0.0281500078164973,0.163415651291332,0.181305522630704,-0.222794036190088,-0.0650675375330755,0.333053821268184,-0.113786884104537,-0.216811134295506,0.219330115203743,0.0920761821844276,-0.165208098247927,-0.0467622097447633,-0.0535053024932768,0.00381257743781609,0.0229461938607687,-0.183302045259707,Hylidae,Hypsiboas,HypsiboasCinerascens,36 diff --git a/data/iris.csv b/data/iris.csv index 33e42ad..2411102 100755 --- a/data/iris.csv +++ b/data/iris.csv @@ -1,4 +1,4 @@ -"sepalLength","sepalWidth","petalLength","petalWidth","name" +"sepalLen","sepalWid","petalLen","petalWid","name*" 5.1,3.5,1.4,.2,"Setosa" 4.9,3,1.4,.2,"Setosa" 4.7,3.2,1.3,.2,"Setosa" diff --git a/data/mnist.csv b/data/mnist.csv index ca10549..798976d 100644 --- a/data/mnist.csv +++ b/data/mnist.csv @@ -1,4 +1,4 @@ -name,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41,72,193,254,213,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,183,203,243,253,252,253,252,142,0,0,82,102,20,0,0,0,0,0,0,0,0,0,0,0,0,0,82,254,253,254,253,254,253,254,253,234,30,92,253,255,50,0,0,0,0,0,0,0,0,0,0,0,0,0,203,253,252,253,212,131,50,50,212,233,112,253,252,233,30,0,0,0,0,0,0,0,0,0,0,0,0,52,253,254,192,41,0,0,0,0,203,254,253,254,253,41,0,0,0,0,0,0,0,0,0,0,0,0,0,10,212,253,192,41,0,0,0,0,203,253,252,253,130,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,82,234,253,132,10,0,0,31,213,254,253,123,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51,232,253,131,0,0,193,252,253,171,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41,193,253,132,213,254,253,203,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,71,252,253,252,253,212,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,173,254,253,254,50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,92,252,253,252,253,172,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,152,253,244,162,254,253,173,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41,233,212,122,0,172,252,253,91,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,102,254,151,0,0,0,203,254,172,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,102,253,151,0,0,0,81,253,252,82,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,102,254,213,82,0,0,0,214,253,203,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,213,252,243,162,203,162,253,252,203,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,82,223,254,253,254,253,254,192,82,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,172,171,253,252,253,111,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41,72,193,254,213,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,183,203,243,253,252,253,252,142,0,0,82,102,20,0,0,0,0,0,0,0,0,0,0,0,0,0,82,254,253,254,253,254,253,254,253,234,30,92,253,255,50,0,0,0,0,0,0,0,0,0,0,0,0,0,203,253,252,253,212,131,50,50,212,233,112,253,252,233,30,0,0,0,0,0,0,0,0,0,0,0,0,52,253,254,192,41,0,0,0,0,203,254,253,254,253,41,0,0,0,0,0,0,0,0,0,0,0,0,0,10,212,253,192,41,0,0,0,0,203,253,252,253,130,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,82,234,253,132,10,0,0,31,213,254,253,123,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51,232,253,131,0,0,193,252,253,171,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41,193,253,132,213,254,253,203,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,71,252,253,252,253,212,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,173,254,253,254,50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,92,252,253,252,253,172,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,152,253,244,162,254,253,173,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41,233,212,122,0,172,252,253,91,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,102,254,151,0,0,0,203,254,172,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,102,253,151,0,0,0,81,253,252,82,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,102,254,213,82,0,0,0,214,253,203,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,213,252,243,162,203,162,253,252,203,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,82,223,254,253,254,253,254,192,82,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,172,171,253,252,253,111,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,160,202,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,104,253,232,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26,222,253,190,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,123,253,253,148,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,77,253,253,211,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,254,254,99,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,254,253,135,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,254,232,38,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,77,249,254,162,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,219,253,244,60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,49,234,254,169,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30,197,253,253,95,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,110,253,253,190,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,195,253,253,75,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,66,212,253,211,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,254,254,99,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,75,213,253,222,25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,168,255,253,150,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,168,254,253,90,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,116,254,158,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,92,196,224,192,176,124,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44,251,254,254,254,254,254,201,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,205,205,205,205,127,213,254,89,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41,246,236,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,197,250,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,219,215,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,182,254,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,120,240,254,243,26,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42,247,254,254,253,171,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,210,225,215,254,254,206,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,6,120,246,254,98,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,139,254,195,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,194,254,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,170,254,112,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,222,254,112,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30,216,254,240,25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,84,214,254,254,96,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,148,117,200,232,254,254,245,139,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,254,254,254,254,254,238,65,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,137,253,254,239,123,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,111,143,143,191,143,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,162,220,252,252,252,252,252,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,166,241,252,253,252,252,252,252,252,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,229,252,252,252,226,121,128,248,252,245,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,252,252,252,156,39,0,171,252,252,140,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44,241,252,252,187,21,0,91,243,252,233,36,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,252,247,73,6,0,36,246,252,251,140,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,200,252,235,60,0,162,252,252,163,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,212,252,232,187,253,252,222,36,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21,209,252,252,253,252,58,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,59,253,253,255,253,58,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,223,252,252,224,252,222,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,252,252,161,52,252,252,102,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47,238,252,246,34,16,212,252,121,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,113,252,252,104,0,8,193,252,121,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44,241,252,237,43,0,34,252,252,121,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,160,252,252,229,122,122,235,252,252,116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,237,252,252,252,252,252,253,252,235,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,165,252,252,252,252,252,253,252,72,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,94,180,156,185,142,190,81,33,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/data/winequality-red.csv b/data/winequality-red.csv index 2cceebf..629bfd2 100644 --- a/data/winequality-red.csv +++ b/data/winequality-red.csv @@ -1,4 +1,4 @@ -"fixed acidity";"volatile acidity";"citric acid";"residual sugar";"chlorides";"free sulfur diox";"total sulfur diox";"density";"pH";"sulphates";"alcohol";"name" +"fixed acidity";"volatile acidity";"citric acid";"residual sugar";"chlorides";"free sulfur diox";"total sulfur diox";"density";"pH";"sulphates";"alcohol";"quality*" 7.4;0.7;0;1.9;0.076;11;34;0.9978;3.51;0.56;9.4;5 7.8;0.88;0;2.6;0.098;25;67;0.9968;3.2;0.68;9.8;5 7.8;0.76;0.04;2.3;0.092;15;54;0.997;3.26;0.65;9.8;5 diff --git a/index.html b/index.html index cdf1f61..439d62d 100755 --- a/index.html +++ b/index.html @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@ - + @@ -35,7 +35,7 @@ - + @@ -150,8 +150,8 @@
- - 10 + + 500
diff --git a/js/tsne_vis.js b/js/tsne_vis.js index 132f462..0c29925 100755 --- a/js/tsne_vis.js +++ b/js/tsne_vis.js @@ -3,7 +3,7 @@ var k; var points = []; var all_fields; var pointsbeta = []; var KNNEnabled = true; // These are the dimensions for the square shape of the main panel\ var dimensions = document.getElementById('modtSNEcanvas').offsetWidth; -var prevRightClick; +var prevRightClick; var ColorsCategorical; var Category; // These are the dimensions for the overview panel var dim = document.getElementById('tSNEcanvas').offsetWidth; @@ -133,6 +133,18 @@ function setLayerSche(){ d3.select("#modtSNEcanvas_svg_Schema").style("z-index", 2); d3.select("#modtSNEcanvas").style("z-index", 1); d3.select("#modtSNEcanvas_svg").style("z-index", 1); + let c = 0; + for (var i=0; i < points.length; i++){ + points[i].selected = true; + if (points[i].starplot == true){ + c = c + 1; + if (c == 1){ + alert("The starplot visualization will be lost!"); + } + points[i].starplot = false; + } + } + redraw(points); click(); } @@ -250,9 +262,58 @@ function setAnnotator(){ ); animate(); + 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 = []; // function that executes after data is successfully loaded function init(data, results_all, fields) { + + d3.selectAll("#correlation > *").remove(); + d3.selectAll("#modtSNEcanvas_svg > *").remove(); + d3.selectAll("#modtSNEcanvas_svg_Schema > *").remove(); + d3.selectAll("#SvgAnnotator > *").remove(); + d3.selectAll("#sheparheat > *").remove(); + + var oldcanvOver = document.getElementById('tSNEcanvas'); + var contxOver = oldcanvOver.getContext('experimental-webgl'); + contxOver.clear(contxOver.COLOR_BUFFER_BIT); + + scene = new THREE.Scene(); + scene.background = new THREE.Color(0xffffff); + + d3.selectAll("#legend1 > *").remove(); + d3.selectAll("#legend3 > *").remove(); + d3.selectAll("#legend4 > *").remove(); + + lassoEnable(); + + Arrayx = []; + Arrayy = []; + XYDistId = []; + Arrayxy = []; + DistanceDrawing1D = []; + allTransformPoints = []; + p; + pFinal = []; + paths; + path; + ArrayLimit = []; + minimum; + correlationResults = []; + ArrayContainsDataFeaturesLimit = []; + prevRightClick = false; step_counter = 0; max_counter = document.getElementById("param-maxiter-value").value; @@ -277,14 +338,35 @@ function init(data, results_all, fields) { }); ArrayContainsDataFeaturesCleared.push(object); } + + all_labels = []; + dataFeatures.filter(function(obj) { + + var temp = []; + temp.push(Object.keys(obj)); + for (var object in temp[0]){ + if(temp[0][object].indexOf("*") != -1){ + Category = temp[0][object]; + return Category; + } + } + + }); - $("#datasetDetails").html("Number of Dimensions: " + (ArrayContainsDataFeatures[0].length - 1) + ", Number of Samples: " + final_dataset.length); + var valCategExists = 0; + for (var i=0; i *").remove(); - d3.selectAll("#modtSNEcanvas_svg > *").remove(); - lassoEnable(); - d3.selectAll("#modtSNEcanvas_svg_Schema > *").remove(); - d3.selectAll("#SvgAnnotator > *").remove(); - Arrayx = []; - Arrayy = []; - XYDistId = []; - Arrayxy = []; - DistanceDrawing1D = []; - allTransformPoints = []; - p; - pFinal = []; - paths; - path; - ArrayLimit = []; - minimum; - correlationResults = []; - ArrayContainsDataFeaturesLimit = []; + var canvas = document.getElementById('tSNEcanvas'); gl = canvas.getContext('experimental-webgl'); @@ -700,11 +749,14 @@ function OverviewtSNE(points){ alert('Unable to initialize WebGL. Your browser or machine may not support it.'); return; } + + ColorsCategorical = ['#a6cee3','#fb9a99','#b2df8a','#33a02c','#1f78b4','#e31a1c','#fdbf6f','#ff7f00','#cab2d6','#6a3d9a']; + if (all_labels[0] == undefined){ - var colorScale = d3.scaleOrdinal(d3.schemeCategory10).domain(["No Category"]).range(["#0000ff"]); + var colorScale = d3.scaleOrdinal().domain(["No Category"]).range(["#C0C0C0"]); } else{ - var colorScale = d3.scaleOrdinal(d3.schemeCategory10).domain(all_labels); + var colorScale = d3.scaleOrdinal().domain(all_labels).range(ColorsCategorical); } d3.select("#legend3").select("svg").remove(); var svg = d3.select("#legend3").append("svg"); @@ -755,7 +807,7 @@ function OverviewtSNE(points){ singleCol = colval.b/255; colors.push(singleCol); }else{ - let colval = d3.rgb(colorScale(points[i].name)); + let colval = d3.rgb(colorScale(points[i][Category])); singleCol = colval.r/255; colors.push(singleCol); singleCol = colval.g/255; @@ -1172,6 +1224,7 @@ function CalculateCorrel(){ var SignStore = []; correlationResults = []; + const arrayColumn = (arr, n) => arr.map(x => x[n]); for (var temp = 0; temp < ArrayContainsDataFeaturesLimit[0].length - 2; temp++) { var tempData = new Array( @@ -1181,7 +1234,7 @@ function CalculateCorrel(){ if (isNaN(pearsonCorrelation(tempData, 0, 1))) { } else{ SignStore.push([temp, pearsonCorrelation(tempData, 0, 1)]); - correlationResults.push(["Dimension "+temp, Math.abs(pearsonCorrelation(tempData, 0, 1))]); + correlationResults.push([Object.keys(dataFeatures[0])[temp] + " (" + temp + ")", Math.abs(pearsonCorrelation(tempData, 0, 1))]); } } correlationResults = correlationResults.sort( @@ -1265,6 +1318,8 @@ function drawBarChart(){ .tickSize(0) .outerTickSize(0); + + //Add group for the y axis mainGroup.append("g") .attr("class", "y axis") @@ -1658,7 +1713,6 @@ function mapOrder(array, order, key) { .on('mousemove', function() { x = d3.event.pageX; y = d3.event.pageY; - console.log( d3.event.pageX, d3.event.pageY ) // log the mouse x,y position }); @@ -1736,7 +1790,7 @@ height = Math.min(width, window.innerHeight - margin.top - margin.bottom); RadarChart("#starPlot", wrapData, colors, IDS, radarChartOptions); function BetatSNE(points){ - + selectedPoints = []; var findNearestTable = []; for (let m=0; m 0){ var FeatureWise = []; @@ -1925,32 +1982,60 @@ function BetatSNE(points){ } } } - - var sum = new Array(Object.values(dataFeatures[0]).length).fill(0); - + + var max = []; + var min = []; + var vectors = []; + var FeatureWiseSlicedArray = []; for (var j=0; j FeatureWiseSliced[i]){ + min[j] = FeatureWiseSliced[i]; + } } } - + + var vectors = PCA.getEigenVectors(ArrayContainsDataFeaturesCleared); + var PCAResults = PCA.computeAdjustedData(ArrayContainsDataFeaturesCleared,vectors[0]); + var PCASelVec = []; + PCASelVec = PCAResults.selectedVectors[0]; + + var len = PCASelVec.length; + var indices = new Array(len); + for (var i = 0; i < len; ++i) indices[i] = i; + indices = indices.sort(function (a, b) { return PCASelVec[a] < PCASelVec[b] ? -1 : PCASelVec[a] > PCASelVec[b] ? 1 : 0; }); + //const list = dataFeatures.sort((a,b) => a.index - b.index).map((dataFeatures, index, array) => dataFeatures[Category]) + var wrapData = []; var IDS = []; for (var i=0; i b) + return a * Math.sqrt(1.0 + (b * b / a / a)) + else if (b == 0.0) + return a + return b * Math.sqrt(1.0 + (a * a / b / b)) + } + + //rep function + function rep(s, v, k) { + if (typeof k === "undefined") { + k = 0; + } + var n = s[k], + ret = Array(n), + i; + if (k === s.length - 1) { + for (i = n - 2; i >= 0; i -= 2) { + ret[i + 1] = v; + ret[i] = v; + } + if (i === -1) { + ret[0] = v; + } + return ret; + } + for (i = n - 1; i >= 0; i--) { + ret[i] = rep(s, v, k + 1); + } + return ret; + } + + //Householder's reduction to bidiagonal form + + var f = 0.0; + var g = 0.0; + var h = 0.0; + var x = 0.0; + var y = 0.0; + var z = 0.0; + var s = 0.0; + + for (i = 0; i < n; i++) { + e[i] = g; //vector + s = 0.0; //sum + l = i + 1; //stays i+1 + for (j = i; j < m; j++) + s += (u[j][i] * u[j][i]); + if (s <= tolerance) + g = 0.0; + else { + f = u[i][i]; + g = Math.sqrt(s); + if (f >= 0.0) g = -g; + h = f * g - s + u[i][i] = f - g; + for (j = l; j < n; j++) { + s = 0.0 + for (k = i; k < m; k++) + s += u[k][i] * u[k][j] + f = s / h + for (k = i; k < m; k++) + u[k][j] += f * u[k][i] + } + } + q[i] = g + s = 0.0 + for (j = l; j < n; j++) + s = s + u[i][j] * u[i][j] + if (s <= tolerance) + g = 0.0 + else { + f = u[i][i + 1] + g = Math.sqrt(s) + if (f >= 0.0) g = -g + h = f * g - s + u[i][i + 1] = f - g; + for (j = l; j < n; j++) e[j] = u[i][j] / h + for (j = l; j < m; j++) { + s = 0.0 + for (k = l; k < n; k++) + s += (u[j][k] * u[i][k]) + for (k = l; k < n; k++) + u[j][k] += s * e[k] + } + } + y = Math.abs(q[i]) + Math.abs(e[i]) + if (y > x) + x = y + } + + // accumulation of right hand transformations + for (i = n - 1; i != -1; i += -1) { + if (g != 0.0) { + h = g * u[i][i + 1] + for (j = l; j < n; j++) + v[j][i] = u[i][j] / h //u is array, v is square of columns + for (j = l; j < n; j++) { + s = 0.0 + for (k = l; k < n; k++) + s += u[i][k] * v[k][j] + for (k = l; k < n; k++) + v[k][j] += (s * v[k][i]) + } + } + for (j = l; j < n; j++) { + v[i][j] = 0; + v[j][i] = 0; + } + v[i][i] = 1; + g = e[i] + l = i + } + + // accumulation of left hand transformations + for (i = n - 1; i != -1; i += -1) { + l = i + 1 + g = q[i] + for (j = l; j < n; j++) + u[i][j] = 0; + if (g != 0.0) { + h = u[i][i] * g + for (j = l; j < n; j++) { + s = 0.0 + for (k = l; k < m; k++) s += u[k][i] * u[k][j]; + f = s / h + for (k = i; k < m; k++) u[k][j] += f * u[k][i]; + } + for (j = i; j < m; j++) u[j][i] = u[j][i] / g; + } else + for (j = i; j < m; j++) u[j][i] = 0; + u[i][i] += 1; + } + + // diagonalization of the bidiagonal form + prec = prec * x + for (k = n - 1; k != -1; k += -1) { + for (var iteration = 0; iteration < itmax; iteration++) { // test f splitting + var test_convergence = false + for (l = k; l != -1; l += -1) { + if (Math.abs(e[l]) <= prec) { + test_convergence = true + break + } + if (Math.abs(q[l - 1]) <= prec) + break + } + if (!test_convergence) { // cancellation of e[l] if l>0 + c = 0.0 + s = 1.0 + var l1 = l - 1 + for (i = l; i < k + 1; i++) { + f = s * e[i] + e[i] = c * e[i] + if (Math.abs(f) <= prec) + break + g = q[i] + h = pythag(f, g) + q[i] = h + c = g / h + s = -f / h + for (j = 0; j < m; j++) { + y = u[j][l1] + z = u[j][i] + u[j][l1] = y * c + (z * s) + u[j][i] = -y * s + (z * c) + } + } + } + // test f convergence + z = q[k] + if (l == k) { //convergence + if (z < 0.0) { //q[k] is made non-negative + q[k] = -z + for (j = 0; j < n; j++) + v[j][k] = -v[j][k] + } + break //break out of iteration loop and move on to next k value + } + if (iteration >= itmax - 1) + throw 'Error: no convergence.' + // shift from bottom 2x2 minor + x = q[l] + y = q[k - 1] + g = e[k - 1] + h = e[k] + f = ((y - z) * (y + z) + (g - h) * (g + h)) / (2.0 * h * y) + g = pythag(f, 1.0) + if (f < 0.0) + f = ((x - z) * (x + z) + h * (y / (f - g) - h)) / x + else + f = ((x - z) * (x + z) + h * (y / (f + g) - h)) / x + // next QR transformation + c = 1.0 + s = 1.0 + for (i = l + 1; i < k + 1; i++) { + g = e[i] + y = q[i] + h = s * g + g = c * g + z = pythag(f, h) + e[i - 1] = z + c = f / z + s = h / z + f = x * c + g * s + g = -x * s + g * c + h = y * s + y = y * c + for (j = 0; j < n; j++) { + x = v[j][i - 1] + z = v[j][i] + v[j][i - 1] = x * c + z * s + v[j][i] = -x * s + z * c + } + z = pythag(f, h) + q[i - 1] = z + c = f / z + s = h / z + f = c * g + s * y + x = -s * g + c * y + for (j = 0; j < m; j++) { + y = u[j][i - 1] + z = u[j][i] + u[j][i - 1] = y * c + z * s + u[j][i] = -y * s + z * c + } + } + e[l] = 0.0 + e[k] = f + q[k] = x + } + } + + for (i = 0; i < q.length; i++) + if (q[i] < prec) q[i] = 0 + + //sort eigenvalues + for (i = 0; i < n; i++) { + for (j = i - 1; j >= 0; j--) { + if (q[j] < q[i]) { + c = q[j] + q[j] = q[i] + q[i] = c + for (k = 0; k < u.length; k++) { + temp = u[k][i]; + u[k][i] = u[k][j]; + u[k][j] = temp; + } + for (k = 0; k < v.length; k++) { + temp = v[k][i]; + v[k][i] = v[k][j]; + v[k][j] = temp; + } + i = j + } + } + } + + return { + U: u, + S: q, + V: v + } + } + + return { + computeDeviationScores: computeDeviationScores, + computeDeviationMatrix: computeDeviationMatrix, + computeSVD: computeSVD, + computePercentageExplained: computePercentageExplained, + computeOriginalData: computeOriginalData, + computeVarianceCovariance: computeVarianceCovariance, + computeAdjustedData: computeAdjustedData, + getEigenVectors: getEigenVectors, + analyseTopResult: analyseTopResult, + transpose: transpose, + multiply: multiply, + clone: clone, + scale: scale + } +})(); + +if(typeof module !== 'undefined') +module.exports = PCA; \ No newline at end of file diff --git a/modules/savage.toggle-switch.js b/modules/savage.toggle-switch.js deleted file mode 100755 index 469a926..0000000 --- a/modules/savage.toggle-switch.js +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (C) 2015 Jose F. Maldonado - * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - * If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -// Verify if the namespace is not already defined. -if(typeof SaVaGe !== 'object') SaVaGe = {}; - -/** - * Creates a SVG element representing a toggle switch. - * - * The parameter must be an object with the following attributes: - * 'container' (a selector of the element where the element must be appended), - * 'value' (a boolean indicating the initial value of the switch, by default 'false'), - * 'height' (a number indicating the height, in pixels, of the element, by default 50), - * 'width' (a number indicating the width, in pixels, of the element, by default 80), - * 'radius' (a number indicating the radius of the lever), - * 'border' (a number indicating the width, in pixels, the distance between the element background and the switch's button, by default 5), - * 'duration' (a number indicating the number of milliseconds that the toggle animation must last, by default 250), - * 'colors' (an object with the attributes 'backLeft', 'foreLeft', 'backRight' and 'foreRight' indicating the colors of the element in each state) and - * 'onChange' (a callback function which is invoked every time that the element is clicked). - * - * The object returned by this function contains the methods: - * 'svg', and instance of the SVG object created with D3.js, - * 'getValue()', for get the current state of the switch, - * 'serValue(newVal)', for change the state of the switch and - * 'remove()', for remove the element from the document. - * - * @param {object} params An collection of values for customize the element. - * @returns {object} An object with methods for manipulate the element. - */ -SaVaGe.ToggleSwitch = function(params) { - // Verify parameters. - if(typeof params !== 'object') params = {}; - if(typeof params.container !== 'string') params.container = "body"; - if(typeof params.value !== 'boolean') params.value = false; - if(typeof params.height !== 'number') params.height = 50; - if(typeof params.width !== 'number' || params.width < params.height) params.width = parseInt(params.height*1.6, 10); - if(typeof params.radius !== 'number') params.radius = params.height/2 - 4; - if(typeof params.duration !== 'number') params.duration = 250; - if(typeof params.colors !== 'object') params.colors = {}; - if(params.colors.backLeft === undefined) params.colors.backLeft = "lightgray"; - if(params.colors.foreLeft === undefined) params.colors.foreLeft = "white"; - if(params.colors.backRight === undefined) params.colors.backRight = "#88f"; - if(params.colors.foreRight === undefined) params.colors.foreRight = "white"; - - // Define internal variables. - var atRight = params.value; - - // Calculate SVG dimensions and position offset. - var svgHeight = params.height; - var svgWidth = params.width; - var offsetX = 0; - var offsetY = 0; - if(params.radius*2 > params.height) { - svgHeight = params.radius*2; - svgWidth = parseInt(params.width + (params.radius*2 - params.height), 10); - offsetX = parseInt((svgWidth - params.width)/2, 10); - offsetY = parseInt((svgWidth - params.width)/2, 10); - } - - // Create widget. - var svg = d3.select(params.container).append("svg") - .attr("width", svgWidth) - .attr("height", svgHeight) - .style("cursor", "pointer"); - var rect = svg.append("rect") - .attr("x", offsetX) - .attr("y", offsetY) - .attr("rx", params.height/2) - .attr("ry", params.height/2) - .style("fill", atRight? params.colors.backRight : params.colors.backLeft) - .attr("width", params.width) - .attr("height", params.height); - var circle = svg.append("circle") - .attr("cx", (atRight? (params.width-params.height/2) : (params.height/2)) + offsetX) - .attr("cy", params.height/2 + offsetY) - .attr("r", params.radius) - .style("fill", atRight? params.colors.foreRight : params.colors.foreLeft); - - // Define internal functions. - var setAtRight = function(newValue) { - atRight = newValue; - circle.transition().duration(params.duration) - .attr("cx", (atRight? (params.width-params.height/2) : (params.height/2)) + offsetX) - .style("fill", atRight? params.colors.foreRight : params.colors.foreLeft); - rect.transition().duration(params.duration).style("fill", atRight? params.colors.backRight : params.colors.backLeft); - - }; - - // Define result's object. - var res = { - 'svg' : svg, - 'getValue': function() { return atRight; }, - 'setValue': setAtRight, - 'remove': function() { svg.remove(); } - }; - - // Define click listener. - svg.on('click', function(data, index){ - setAtRight(!atRight); - if(typeof params.onChange === 'function') params.onChange(res); - }); - - return res; -};