d3 / d3-scale

Encodings that map abstract data to visual representation.

Home Page:https://d3js.org/d3-scale

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Difficult debugging on invalid scale.range arguments

Stan-Stani opened this issue · comments

commented

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?