d3 / d3-scale

Encodings that map abstract data to visual representation.
https://d3js.org/d3-scale
ISC License
1.59k stars 286 forks source link

Difficult debugging on invalid scale.range arguments #267

Open Stan-Stani opened 2 years ago

Stan-Stani commented 2 years ago

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?