Commit 5fe50dae authored by Tejesh's avatar Tejesh 🖖

fix failing scales test

parent 58c2751e
Pipeline #93683 passed with stage
in 2 minutes and 31 seconds
......@@ -236,7 +236,7 @@
tape('Test scale with new spec', function(t) {
tape('Test scale with new spec', function (t) {
var data = [];
for (var i = 1; i <= 100; i++) {
......@@ -290,13 +290,14 @@
scale: 'Quantize',
range: { scheme: 'Purples', count: 3 }
})
// 0 - 33
// min_number is probably close to 0, max_number is probably close to 100
// [min_number, min_number + (min_number+difference)/3]
t.equal(quantize_scale(15), d3.schemePurples[3][0])
t.equal(quantize_scale(25), d3.schemePurples[3][0])
// 33.3 - 66
// [ min_number + (min_number+difference)/3, min_number + 2*(min_number+difference)/3]
t.equal(quantize_scale(40), d3.schemePurples[3][1])
t.equal(quantize_scale(65), d3.schemePurples[3][1])
// 66 - 100
t.equal(quantize_scale(45), d3.schemePurples[3][1])
// [2*(min_number+difference)/3, max_number]
t.equal(quantize_scale(70), d3.schemePurples[3][2])
......@@ -310,13 +311,14 @@
reverse: true
}
})
// 0 - 33
// min_number is probably close to 0, max_number is probably close to 100
// [min_number, min_number + (min_number+difference)/3]
t.equal(quantize_scale(15), d3.schemePurples[3][2])
t.equal(quantize_scale(25), d3.schemePurples[3][2])
// 33.3 - 66
// [ min_number + (min_number+difference)/3, min_number + 2*(min_number+difference)/3]
t.equal(quantize_scale(40), d3.schemePurples[3][1])
t.equal(quantize_scale(65), d3.schemePurples[3][1])
// 66 - 100
// [2*(min_number+difference)/3, max_number]
t.equal(quantize_scale(70), d3.schemePurples[3][0])
......
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