https://github.com/pbeshai/d3-scale-interactive
Interactively play with your scales in any vis, just by replacing your initialization of the scales from
const colorScale = d3.scaleSequential(...);with
const colorScale = d3.scaleInteractive('color', updateChart).scaleSequential(...);This way it's easy to develop with/turn on and off. Maybe there could even be a check to see if we're in dev otherwise just return the scale as it is and do nothing.
color = d3.scaleInteractive('color', updateChart) .scaleSequential(d3.interpolateMagma) .domain(d3.extent(data, d => d.v));