Commit 728effde authored by Marc Duez's avatar Marc Duez

Qunit : graph.js path constructor test and init test

parent 797e976c
......@@ -30,6 +30,10 @@ json_data = {
" ==> segmented 448435 reads (48.2%)\n ==> found 43444 40-windows in 418595 segments (45%) inside 929901 sequences\n "
]
},
"data": {
"dataTest1" : [45,60,52,60],
"dataTest2" : [2,1,2,20]
},
"clones": [
{
"sequence" : "aaaaaaaaaaaaaaaaaaaaa",
......
var myConsole = new Com("flash_container", "log_container", "popup-container", "data-container")
test("graph: svg path builder", function() {
var m = new Model(m);
m.parseJsonData(json_data,100)
m.loadGermline()
m.initClones()
var graph = new Graph("visu",m)
graph.init()
equal(graph.constructPath(0), " M 83.2,295.74364485223595 L 103,295.74364485223595 L 301,234.25635514776397 L 499,259.7758861041419 L 697,198.2885963996698 L 716.8,198.2885963996698", "path curve clone 0")
equal(graph.constructPathR(5), " M 70,547 L 70,357.23093455670795 L 103,357.23093455670795 L 301,295.74364485223595 L 499,357.23093455670795 L 697,295.74364485223595 L 730,295.74364485223595 L 730,547 Z ", "resolution curve 5 reads")
var stack = new Stack(m)
stack.compute();
equal(graph.constructStack(1, stack), " M 103,476.5 L 301,453 L 499,464.75 L 697,429.5 L 697,382.5 L 499,441.25 L 301,359 L 103,429.5 Z", "path stack clone 1")
});
test("graph: init", function() {
var m = new Model(m);
m.parseJsonData(json_data,100)
m.loadGermline()
m.initClones()
var graph = new Graph("visu",m)
graph.init()
graph.initData()
deepEqual(graph.data_data[0], {"active": false,
"color": "#cb4b16",
"name": "dataTest1",
"tab": [45,60,52,60]},
"initData")
graph.initClones()
deepEqual(graph.data_clone[0], {
"id": 0,
"name": "line0",
"path": " M 83.2,295.74364485223595 L 103,295.74364485223595 L 301,234.25635514776397 L 499,259.7758861041419 L 697,198.2885963996698 L 716.8,198.2885963996698"
},
"initClones")
graph.initRes()
deepEqual(graph.data_res[0], {
"id": 4,
"name": "resolution1",
"path": " M 70,547 L 70,500 L 103,500 L 301,438.512710295528 L 499,500 L 697,438.512710295528 L 730,438.512710295528 L 730,547 Z "
},
"initRes")
graph.initAxis()
deepEqual(graph.data_axis[0], {
"orientation": "vert",
"pos": 0.05,
"text": "Leu+0_BCD",
"time": 0,
"type": "axis_v"
},
"initAxis")
});
\ No newline at end of file
var myConsole = new Com("flash_container", "log_container", "popup-container", "data-container")
test("scatterplot : grid", function() {
var m = new Model(m);
m.parseJsonData(json_data,100)
......
......@@ -43,12 +43,13 @@
<script type="text/javascript" src="./testFiles/data_test.js"></script>
</head>
<body>
<div style="display:none">
<div style="opacity:0%; position:absolute; z-index:-5">
<div id="flash_container" ></div>
<div id="log_container" ></div>
<div id="popup-container" ><div></div></div>
<div id="data-container" ></div>
<div id="visu"></div>
<div id="visu" style="width:800px; height:500px;"></div>
</div>
<div id="qunit"></div>
......@@ -68,5 +69,6 @@
<script src="./testFiles/clone_test.js"></script>
<script src="./testFiles/scatterPlot_test.js"></script>
<script src="./testFiles/axis_test.js"></script>
<script src="./testFiles/graph_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