Commit 19344d67 authored by Marc Duez's avatar Marc Duez

qunit : adapt some code for scatterplot.js test

parent de79ac2a
function Builder(model) {
this.m = model; //Model utilisé
this.m.view.push(this); //synchronisation au Model
if (typeof model != "undefined"){
this.m = model; //Model utilisé
this.m.view.push(this); //synchronisation au Model
}
this.colorMethod = "";
this.width_left_container = $("#left-container")
.css("width")
this.drag_separator = false
}
......
......@@ -74,7 +74,7 @@ window.onresize = function () { m.resize(); };
*/
var graph = new Graph("visu2",m);
var list = new List("list", "data", m);
var sp = new ScatterPlot("visu",m, graph, stats);
var sp = new ScatterPlot("visu", m);
var segment = new Segment("bot-container",m, CGI_ADDRESS);
var builder = new Builder(m);
var pdf = new PDF(m, "visu2_svg")
......
......@@ -17,10 +17,9 @@
* along with "Vidjil". If not, see <http://www.gnu.org/licenses/>
*/
function ScatterPlot(id, model, graph) {
function ScatterPlot(id, model) {
this.id = id; //ID of the scatterPlot div
this.m = model; //Model object
this.graph = graph; //Graph object
//size ( computed value -> resize() function)
this.resizeCoef = 1; //Multiplifying factor, application to nodes radius
......@@ -408,7 +407,7 @@ ScatterPlot.prototype = {
//Reloading of physic engine
this.force.start();
//Reloading of graph distribution axis
this.graph.update();
this.m.update();
//Edit Distance slider disabled
this.activeSliderDistanceMax(false);
}
......@@ -942,7 +941,7 @@ ScatterPlot.prototype = {
//Calcul d'une frame (image / seconde)
this.time1 = Date.now();
if (this.fpsqueue.length === 10) {
document.getElementById("fps")
$("#fps")
.innerHTML = d3.mean(this.fpsqueue)
.toFixed(3);
this.fpsqueue = [];
......
......@@ -38,6 +38,12 @@ json_data = {
"reads" : [10,10,15,15] ,
"top" : 1,
"germline" : "TRG",
"seg" : {
"3" : "TRGV4*01",
"5" : "TRGJ2*03",
"3start" : 15,
"5end" : 5
}
},
{
"sequence" : "bbbbbbbbbbbbbbb",
......@@ -46,6 +52,12 @@ json_data = {
"reads" : [20,20,10,10] ,
"top" : 2,
"germline" : "TRG",
"seg" : {
"3" : "TRGV5*01",
"5" : "TRGJ2*03",
"3start" : 15,
"5end" : 5
}
},
{
"sequence" : "cccccccccccccccccccc",
......@@ -54,6 +66,13 @@ json_data = {
"reads" : [25,25,50,50] ,
"top" : 3,
"germline" : "IGH",
"seg" : {
"3" : "IGHV4*01",
"4" : "IGHD2*03",
"5" : "IGHJ8*01",
"3start" : 15,
"5end" : 5
}
}
]
}
\ No newline at end of file
......@@ -48,6 +48,7 @@
<div id="log_container" ></div>
<div id="popup-container" ><div></div></div>
<div id="data-container" ></div>
<div id="visu"></div>
</div>
<div id="qunit"></div>
......@@ -65,5 +66,6 @@
<script src="./testFiles/dbscan_test.js"></script>
<script src="./testFiles/model_test.js"></script>
<script src="./testFiles/clone_test.js"></script>
<script src="./testFiles/scatterPlot_test.js"></script>
</body>
</html>
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