play with the colors
This commit is contained in:
parent
ff98b172c4
commit
785d439605
@ -32,13 +32,14 @@
|
|||||||
var fillOpacity = 0.35;
|
var fillOpacity = 0.35;
|
||||||
|
|
||||||
var colorKeys = {};
|
var colorKeys = {};
|
||||||
|
var colorScale = chroma.bezier(['red', 'blue', 'green']).scale();
|
||||||
var getColor = function(id){
|
var getColor = function(id){
|
||||||
if (!id) return "#000000";
|
if (!id) return "#000000";
|
||||||
if (!colorKeys[id]) {
|
if (!colorKeys[id]) {
|
||||||
var keys = Object.keys(colorKeys);
|
var keys = Object.keys(colorKeys);
|
||||||
keys.push(id);
|
keys.push(id);
|
||||||
keys.sort();
|
keys.sort();
|
||||||
var colors = chroma.scale(['#FF0000', '#0000FF']).colors(keys.length);
|
var colors = colorScale.colors(keys.length);
|
||||||
colorKeys = {};
|
colorKeys = {};
|
||||||
keys.forEach(function(key, index) {
|
keys.forEach(function(key, index) {
|
||||||
colorKeys[key] = colors[index];
|
colorKeys[key] = colors[index];
|
||||||
|
Loading…
Reference in New Issue
Block a user