yaph / d3-geomap

A library for creating geographical maps based on D3.js
https://d3-geomap.github.io/
MIT License
133 stars 45 forks source link

Try using d3.scale.threshold() for color scales #22

Closed yaph closed 9 years ago

yaph commented 10 years ago

http://bl.ocks.org/mbostock/5144735

var color = d3.scale.threshold()
.domain([30, 60, 120, 360])
.range(["#ffffcc","#c2e699","#78c679","#31a354","#006837"]);

Automatically use it for range if domain is set and longer than 2 elements?

yaph commented 9 years ago

d3.scale.threshold() is now used when domain array has more than 2 elements.