Commit 6c6bc356 authored by Marc Duez's avatar Marc Duez
Browse files

builder.js / Qunit : make "scatterplot" independent of "builder.js" but more...

builder.js / Qunit : make "scatterplot" independent of "builder.js" but more dependent of "builder.js"
-and this solve problem with phentomJS
parent f8f54eb7
......@@ -722,7 +722,7 @@ Builder.prototype = {
m.update_selected_system()
}
var span_system = this.build_systemBox(key)
var span_system = this.m.systemBox(key)
span_system.className = "systemBoxMenu";
var span = document.createElement('span');
......@@ -745,23 +745,6 @@ Builder.prototype = {
return div
},
build_systemBox: function (system){
var span = document.createElement('span')
span.className = "systemBox";
if ((typeof system != 'undefined')){
span.appendChild(document.createTextNode(this.m.germlineList.getShortcut(system)));
if (this.m.system_selected.indexOf(system) != -1)
span.style.background = this.m.germlineList.getColor(system)
span.title = system
}else{
span.appendChild(document.createTextNode("?"));
if (typeof system != 'undefined')
span.title = system ;
}
return span
},
build_info_line: function (id, name, value, className) {
var span1 = document.createElement('span');
span1.appendChild(document.createTextNode(name + " : "));
......
......@@ -342,7 +342,7 @@ List.prototype = {
div_elem.appendChild(span_cluster);
if (this.m.system=="multi") {
var system = this.m.clone(cloneID).getSystem()
div_elem.appendChild(builder.build_systemBox(system));
div_elem.appendChild(this.m.systemBox(system));
}
div_elem.appendChild(span_name);
div_elem.appendChild(span_info);
......
......@@ -1583,7 +1583,22 @@ Model.prototype = {
saveAs(textFileAsBlob, filename + ".csv");
},
systemBox: function (system){
var span = document.createElement('span')
span.className = "systemBox";
if ((typeof system != 'undefined')){
span.appendChild(document.createTextNode(this.germlineList.getShortcut(system)));
if (this.system_selected.indexOf(system) != -1)
span.style.background = this.germlineList.getColor(system)
span.title = system
}else{
span.appendChild(document.createTextNode("?"));
if (typeof system != 'undefined')
span.title = system ;
}
return span
},
......
......@@ -1521,7 +1521,7 @@ ScatterPlot.prototype = {
return ""+(d.y*self.resizeH+self.marge_top)+"px"
})
.html(function (d) {
return "<div class='sp_system'>"+builder.build_systemBox(d.text).outerHTML+" "+d.text+"</div>"
return "<div class='sp_system'>"+self.m.systemBox(d.text).outerHTML+" "+d.text+"</div>"
})
.on("click", function (d) {
self.m.changeGermline(d.text)
......
......@@ -2,19 +2,15 @@
var myConsole = new Com("flash_container", "log_container", "popup-container", "data-container")
var m = new Model(m);
m.parseJsonData(json_data,100)
m.loadGermline()
m.initClones()
var builder = new Builder(m);
builder.init = function(){}
builder.update = function(){}
var sp = new ScatterPlot("visu",m);
sp.init()
test("scatterplot : grid", function() {
var m = new Model(m);
m.parseJsonData(json_data,100)
m.loadGermline()
m.initClones()
var sp = new ScatterPlot("visu",m);
equal(sp.returnActiveclones(), 3, "returnActiveClones -> 3");
......
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