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