I was wondering if it is possible to use functions within d3.js functions. To clarify my question, let's assume you have a colorscale
var colorScale = d3.scale.quantile()
.domain([0,8])
.range(["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"]);
Is there a way to make the following work?
var colorScale = d3.scale.quantile()
.domain([0,8])
.range(function(){return ["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"]});
so returning the entire argument from a function?
many thanks to anyone who knows!