Commit 113352fc authored by Tejesh's avatar Tejesh 🖖

fix bld errs

parent e5874fbc
Pipeline #91116 failed with stage
in 2 minutes and 15 seconds
......@@ -85,7 +85,7 @@ function scale(data, config) {
// Quantize/Quantile/Threshold scales sorts the domain by ascending order
// So, no point in reversing domain. Instead reverse color scheme range
if (discretizing_scales.indexOf(scale.toLowerCase()) >= 0 && config_scheme) {
config.range = (config.range && config.range.slice().reverse()) || chromatic.slice().reverse()
config.range = (config.range && config.range.slice().reverse()) || chromatic.slice().reverse()
} else {
domain = domain.slice().reverse()
}
......@@ -96,8 +96,6 @@ function scale(data, config) {
}
// TODO PERF: concat is too slow?
console.log(config)
console.log(config.range)
if (discretizing_scales.indexOf(scale.toLowerCase()) < 0 && config_scheme) {
result = d3['scale' + scale](chromatic).domain(domain)
} else if (config.range) {
......
......@@ -194,53 +194,46 @@
t.equal(quantize_scale({ age: 55 }), d3.schemePurples[3][1], 'reverse quantize scale 2 [0-33, 33-66, 66-100] ')
t.equal(quantize_scale({ age: 70 }), d3.schemePurples[3][0], 'reverse quantize scale 3 [0-33, 33-66, 66-100] ')
t.end()
})
t.equal(quantize_scale({ age: 20 }), '#ffffff')
t.equal(quantize_scale({ age: 50 }), '#000000')
t.equal(quantize_scale({ age: 100 }), '#000000')
quantize_scale = g1.scale(data, {
metric: 'age',
domain: [0, 100],
scale: 'Quantize',
scheme: 'schemeBlues',
count: 4,
range: ['#ffffff', '#000000'],
reverse: true
})
quantize_scale = g1.scale(data, {
metric: 'age',
domain: [0, 100],
scale: 'Quantize',
scheme: 'schemeBlues',
count: 4,
range: ['#ffffff', '#000000'],
reverse: true
})
t.equal(quantize_scale({ age: 20 }), '#000000')
t.equal(quantize_scale({ age: 50 }), '#ffffff')
t.equal(quantize_scale({ age: 100 }), '#ffffff')
t.equal(quantize_scale({ age: 20 }), '#000000')
t.equal(quantize_scale({ age: 50 }), '#ffffff')
t.equal(quantize_scale({ age: 100 }), '#ffffff')
quantize_scale = g1.scale(data, {
metric: 'age',
domain: [0, 100],
scale: 'Quantize',
scheme: 'schemeCategory10',
range: ['#ffffff', '#000000'],
reverse: true
})
quantize_scale = g1.scale(data, {
metric: 'age',
domain: [0, 100],
scale: 'Quantize',
scheme: 'schemeCategory10',
range: ['#ffffff', '#000000'],
reverse: true
})
linear_scale = g1.scale([{ age: 1 }, { age: 70 }, { age: 100 }], {
metric: 'age',
//scale: 'linear',
scheme: 'Blues'
})
t.equal(linear_scale({ age: 1 }), 'rgb(247, 251, 255)')
t.equal(linear_scale({ age: 100 }), 'rgb(8, 48, 107)')
ordinal_default_domain = g1.scale([{ fruit: 1 }, { fruit: 10 }, { fruit: 30 }], {
metric: 'fruit',
scale: 'ordinal',
scheme: 'Blues'
linear_scale = g1.scale([{ age: 1 }, { age: 70 }, { age: 100 }], {
metric: 'age',
//scale: 'linear',
scheme: 'Blues'
})
t.equal(linear_scale({ age: 1 }), 'rgb(247, 251, 255)')
t.equal(linear_scale({ age: 100 }), 'rgb(8, 48, 107)')
ordinal_default_domain = g1.scale([{ fruit: 1 }, { fruit: 10 }, { fruit: 30 }], {
metric: 'fruit',
scale: 'ordinal',
scheme: 'Blues'
})
t.equal(ordinal_default_domain({ fruit: 1 }), '#ffffff')
t.end()
})
t.equal(ordinal_default_domain({ fruit: 1 }), '#ffffff')
t.end()
})
</script>
</body>
</html>
\ No newline at end of file
</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