Proposal for an API to get the list of color schemes and ranges of acceptable color numbers.
Built with blockbuilder.org
xxxxxxxxxx
<meta charset="utf-8">
<script src="//d3js.org/d3.v4.0.0-alpha.44.min.js"></script>
<script src="d3-scale-chromatic.v0.0.js"></script>
<body>
<script>
d3_scale_chromatic.schemes.forEach(function(scheme) {
var sch = scheme.replace(/scheme/, '');
d3.select('body').append('h4').text('d3.'+scheme);
d3.select('body').append('div').text('Returns the '+sch+' color scheme with n colors; n must be in the range ['+ d3_scale_chromatic[scheme].range() + '].')
});
</script>
</body>
https://d3js.org/d3.v4.0.0-alpha.44.min.js