Commit c4c99d8f authored by S Anand's avatar S Anand
Browse files

BUG: update scales test case, remove unused dev dependency

@tejesh.p
parent 58c2751e
...@@ -6,7 +6,7 @@ import babel from 'rollup-plugin-babel' ...@@ -6,7 +6,7 @@ import babel from 'rollup-plugin-babel'
import babelrc from 'babelrc-rollup' import babelrc from 'babelrc-rollup'
const babelConfig = { const babelConfig = {
'presets': ['es2015'] presets: ['es2015']
} }
export default [ export default [
...@@ -162,7 +162,7 @@ export default [ ...@@ -162,7 +162,7 @@ export default [
commonjs(), commonjs(),
babel(babelrc({ babel(babelrc({
config: { config: {
'presets': ['env'] presets: ['env']
}, exclude: 'node_modules/**' })), }, exclude: 'node_modules/**' })),
process.env.npm_lifecycle_event == 'dev' ? '' : uglify({ sourcemap: true }) process.env.npm_lifecycle_event == 'dev' ? '' : uglify({ sourcemap: true })
], ],
......
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
tape('Test scale with new spec', function(t) { tape('Test scale with new spec', function (t) {
var data = []; var data = [];
for (var i = 1; i <= 100; i++) { for (var i = 1; i <= 100; i++) {
...@@ -290,13 +290,14 @@ ...@@ -290,13 +290,14 @@
scale: 'Quantize', scale: 'Quantize',
range: { scheme: 'Purples', count: 3 } 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(15), d3.schemePurples[3][0])
t.equal(quantize_scale(25), 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(40), d3.schemePurples[3][1])
t.equal(quantize_scale(65), d3.schemePurples[3][1]) t.equal(quantize_scale(45), d3.schemePurples[3][1])
// 66 - 100 // [2*(min_number+difference)/3, max_number]
t.equal(quantize_scale(70), d3.schemePurples[3][2]) t.equal(quantize_scale(70), d3.schemePurples[3][2])
...@@ -310,13 +311,14 @@ ...@@ -310,13 +311,14 @@
reverse: true 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(15), d3.schemePurples[3][2])
t.equal(quantize_scale(25), 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(40), d3.schemePurples[3][1])
t.equal(quantize_scale(65), 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]) t.equal(quantize_scale(70), d3.schemePurples[3][0])
......
This diff is collapsed.
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