Commit f3169cf6 authored by Marc Duez's avatar Marc Duez

qunit : adapt some code for axis.js test

parent 71e9f386
...@@ -947,7 +947,7 @@ span.alert { ...@@ -947,7 +947,7 @@ span.alert {
background: #000000; background: #000000;
color: #839496; color: #839496;
height: 16px; height: 16px;
width: 110px; width: 90px;
-webkit-appearance: none; -webkit-appearance: none;
border: solid; border: solid;
border-width: 1px; border-width: 1px;
......
...@@ -947,7 +947,7 @@ span.alert { ...@@ -947,7 +947,7 @@ span.alert {
background: #ffffff; background: #ffffff;
color: #657b83; color: #657b83;
height: 16px; height: 16px;
width: 110px; width: 90px;
-webkit-appearance: none; -webkit-appearance: none;
border: solid; border: solid;
border-width: 1px; border-width: 1px;
......
...@@ -1089,7 +1089,7 @@ span.alert { color: red; } ...@@ -1089,7 +1089,7 @@ span.alert { color: red; }
background: @background; background: @background;
color: @default; color: @default;
height: 16px; height: 16px;
width: 110px; width: 90px;
-webkit-appearance: none; -webkit-appearance: none;
border: solid; border: solid;
border-width: 1px border-width: 1px
......
...@@ -128,7 +128,7 @@ Axis.prototype = { ...@@ -128,7 +128,7 @@ Axis.prototype = {
for (var i = 0; i < 10; i++) { for (var i = 0; i < 10; i++) {
var pos = this.sizeScale(h); var pos = this.sizeScale(h);
var text = this.m.formatSize(h, false) var text = this.m.formatSize(h, false)
if (pos > 0 && pos < 1) if (pos >= 0 && pos <= 1)
this.labels.push(this.label("line", pos, text)); this.labels.push(this.label("line", pos, text));
h = h / 10; h = h / 10;
} }
...@@ -150,7 +150,7 @@ Axis.prototype = { ...@@ -150,7 +150,7 @@ Axis.prototype = {
} }
this.sizeScale = d3.scale.linear() this.sizeScale = d3.scale.linear()
.domain([0, n_max]) .domain([0, n_max+1])
.range([0, 1]); .range([0, 1]);
//clone position //clone position
...@@ -170,12 +170,12 @@ Axis.prototype = { ...@@ -170,12 +170,12 @@ Axis.prototype = {
/* /*
* TODO linear/log percent/value parameter * TODO linear/log percent/value parameter
* */ * */
customLabels: function(min, max, reverse, percent, linear){ custom: function(min, max, reverse, percent, linear){
this.labels = []; this.labels = [];
var h = (max-min)/5 var h = (max-min)/5
var delta = (max-min) var delta = (max-min)
for (var i = 0; i < 5; i++) { for (var i = 0; i <= 5; i++) {
var pos = 0; var pos = 0;
if (reverse){ if (reverse){
pos = 1 - (h*i)*(1/delta); pos = 1 - (h*i)*(1/delta);
...@@ -183,7 +183,7 @@ Axis.prototype = { ...@@ -183,7 +183,7 @@ Axis.prototype = {
pos = (h*i)*(1/delta); pos = (h*i)*(1/delta);
} }
var text = Math.round(min+(h*i) * 100) + " %" var text = Math.round(min+(h*i))
this.labels.push(this.label("line", pos, text)); this.labels.push(this.label("line", pos, text));
} }
}, },
......
...@@ -39,9 +39,9 @@ json_data = { ...@@ -39,9 +39,9 @@ json_data = {
"top" : 1, "top" : 1,
"germline" : "TRG", "germline" : "TRG",
"seg" : { "seg" : {
"3" : "TRGV4*01", "5" : "TRGV4*01",
"5" : "TRGJ2*03", "3" : "TRGJ2*03",
"3start" : 15, "3start" : 6,
"5end" : 5 "5end" : 5
} }
}, },
...@@ -53,8 +53,8 @@ json_data = { ...@@ -53,8 +53,8 @@ json_data = {
"top" : 2, "top" : 2,
"germline" : "TRG", "germline" : "TRG",
"seg" : { "seg" : {
"3" : "TRGV5*01", "5" : "TRGV5*01",
"5" : "TRGJ2*03", "3" : "TRGJ2*04",
"3start" : 15, "3start" : 15,
"5end" : 5 "5end" : 5
} }
...@@ -67,9 +67,9 @@ json_data = { ...@@ -67,9 +67,9 @@ json_data = {
"top" : 3, "top" : 3,
"germline" : "IGH", "germline" : "IGH",
"seg" : { "seg" : {
"3" : "IGHV4*01", "5" : "IGHV4*01",
"4" : "IGHD2*03", "4" : "IGHD2*03",
"5" : "IGHJ8*01", "3" : "IGHJ8*01",
"3start" : 15, "3start" : 15,
"5end" : 5 "5end" : 5
} }
......
...@@ -67,5 +67,6 @@ ...@@ -67,5 +67,6 @@
<script src="./testFiles/model_test.js"></script> <script src="./testFiles/model_test.js"></script>
<script src="./testFiles/clone_test.js"></script> <script src="./testFiles/clone_test.js"></script>
<script src="./testFiles/scatterPlot_test.js"></script> <script src="./testFiles/scatterPlot_test.js"></script>
<script src="./testFiles/axis_test.js"></script>
</body> </body>
</html> </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