d3-scale icon indicating copy to clipboard operation
d3-scale copied to clipboard

Difficult debugging on invalid scale.range arguments

Open Stan-Stani opened this issue 2 years ago • 0 comments

I accidentally wrote

yScale.range([height - padding, padding]); as yScale.range([height - padding], padding);

No error was thrown and it took me a long time to figure out why my yScale was returning undefined on all inputs.

Could we make scale.range throw an error when more than one argument is present and/or when a scale can't be generated from the given 1st parameter?

Stan-Stani avatar Sep 08 '22 21:09 Stan-Stani