Tell us what’s happening:
On this lesson:
I’m just not understanding how this:
const xScale = d3.scaleLinear() .domain([0, d3.max(dataset, (d) => d)]) .range([padding, w - padding]);
can be used like this:
.attr("cx", (d) => xScale(d))
I can see where the information is flowing through, but I can’t understand what makes it connect.
How does it know to pass
d3.max when its called like
It’s not the variable name is it, that could be anything, but how does it map?
Where can I learn what’s happening here?
**Your browser information:**
User Agent is:
Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36.
Challenge: Use a Pre-Defined Scale to Place Elements
Link to the challenge: