Commit 8989b10e authored by Marc Duez's avatar Marc Duez
Browse files

browser : merge antonin/dbscan/graph

- debug some undefined element
- hide dbscan/graph menu
parent e2cb9928
......@@ -137,7 +137,7 @@
k-->
<a class="buttonSelector" onclick="sp.changeSplitMethod('gene_v', 'Size')">V / abundance at selected timepoint</a>
<a class="buttonSelector" onclick="sp.changeSplitMethod('gene_v', 'bar')">V distribution</a>
<a class="buttonSelector" onclick="sp.changeSplitMethod('dbscan', 'dbscan')">Graph</a>
<!--<a class="buttonSelector" onclick="sp.changeSplitMethod('dbscan', 'dbscan')">Graph</a>-->
<!--<a class="buttonSelector" onclick="sp.changeSplitMethod('graph','graph')">Edit distance distribution</a>
<a class="buttonSelector" onclick="sp.changeSplitMethod('dbscan','dbscan')">DBSCAN algorithm</a>-->
</div>
......@@ -153,7 +153,7 @@
<a class="buttonSelector" onclick="m.changeColorMethod('system');"
id="color_system_button" style="display:none">by system</a>
<a class="buttonSelector" onclick="m.changeColorMethod('abundance');">by abundance at selected timepoint</a>
<a class="buttonSelector" onclick="m.changeColorMethod('dbscan');">by the DBSCAN algorithm</a>
<!--<a class="buttonSelector" onclick="m.changeColorMethod('dbscan');">by the DBSCAN algorithm</a>-->
</div></div>
</div>
......@@ -171,32 +171,6 @@
</div></div>
</div>
<!--
<div class="submenu">
<div class="menu_box">
<div id="DBSCANEpsSlider">
<input id="changeEps" type="range" min="0" max="40" step="1" value="0" onchange="m.changeEps(this.value)" />
</div>
</div>
<div class="menu_box">
<div id="DBSCANNbrSlider">
<input id="changeNbr" type="range" min="0" max="100" step="1" value="0" onchange="m.changeNbr(this.value)" />
</div>
</div>
<div class="menu_box">
<div id="EditDistanceSlider">
</br>
<input id="displayMax_slider" type="range" min="1" max="20" step="1" value="10" onchange="sp.displayDistanceMax(this.value)" style="display:none"/>
</div>
</div>
-->
<div class="menu" onmouseover="showSelector('settingsSelector');" > settings
<div id="settingsSelector" class="selector"><div>
<div class="menu_box">
......@@ -225,6 +199,31 @@
</div>
</div>
<!--menu graph/dbscan -->
<div class="submenu" style="display:none">
<div class="menu_box">
<div id="DBSCANEpsSlider">
<input id="changeEps" type="range" min="0" max="40" step="1" value="0" onchange="m.changeEps(this.value)" />
</div>
</div>
<div class="menu_box">
<div id="DBSCANNbrSlider">
<input id="changeNbr" type="range" min="0" max="100" step="1" value="0" onchange="m.changeNbr(this.value)" />
</div>
</div>
<div class="menu_box">
<div id="EditDistanceSlider">
</br>
<input id="displayMax_slider" type="range" min="1" max="20" step="1" value="10" onchange="sp.displayDistanceMax(this.value)" style="display:none"/>
</div>
</div>
</div>
</div></div>
</div>
......
......@@ -68,10 +68,12 @@ function addTabOfEdges(nbrNodes, allEdges) {
for (var i = 0; i < tabOfEdges.length; i++)
tabOfEdges[i] = new Array(nbrNodes);
//End of the creation of the double-entries edges array
for (var i = 0; i < allEdges.length; i++) {
//Added length/distance
tabOfEdges[allEdges[i].source][allEdges[i].target] = allEdges[i].len;
tabOfEdges[allEdges[i].target][allEdges[i].source] = allEdges[i].len;
if (typeof allEdges != 'undefined'){
for (var i = 0; i < allEdges.length; i++) {
//Added length/distance
tabOfEdges[allEdges[i].source][allEdges[i].target] = allEdges[i].len;
tabOfEdges[allEdges[i].target][allEdges[i].source] = allEdges[i].len;
}
}
return tabOfEdges;
};
......
......@@ -481,9 +481,11 @@ ScatterPlot.prototype = {
*/
keepUsefullEdgesForDBSCANGraph: function(tmp) {
var returnedTab = [];
for (var i = 0; i < tmp.length; i++){
if (this.m.windows[tmp[i].source].cluster == this.m.windows[tmp[i].target].cluster) {
returnedTab.push(tmp[i]);
if (typeof tmp != 'undefined'){
for (var i = 0; i < tmp.length; i++){
if (this.m.windows[tmp[i].source].cluster == this.m.windows[tmp[i].target].cluster) {
returnedTab.push(tmp[i]);
}
}
}
return returnedTab;
......@@ -494,15 +496,17 @@ ScatterPlot.prototype = {
*/
keepUsefullEdgesForEditDistanceGraph: function(tmp) {
var returnedTab = [];
//Sorted array, according to growing edges length
tmp.sort(function(a,b) {if (a.len < b.len) return -1; if (a.len > b.len) return 1; return 0});
for (var i = 0; i < tmp.length; i++) {
//Keep only edges lower or equals than distanceMax
if (tmp[i].len <= this.distanceMax)
returnedTab.push(tmp[i]);
else
break;
}
if (typeof tmp != 'undefined'){
//Sorted array, according to growing edges length
tmp.sort(function(a,b) {if (a.len < b.len) return -1; if (a.len > b.len) return 1; return 0});
for (var i = 0; i < tmp.length; i++) {
//Keep only edges lower or equals than distanceMax
if (tmp[i].len <= this.distanceMax)
returnedTab.push(tmp[i]);
else
break;
}
}
return returnedTab
},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment