d3 / d3-shape

Graphical primitives for visualization, such as lines and areas.
https://d3js.org/d3-shape
ISC License
2.47k stars 305 forks source link

Division of roles #108

Closed isaomatsunami closed 7 years ago

isaomatsunami commented 7 years ago

This is just a question. Value() method does not play a role of "value" but just an accessor. Transform to numerical value is done by "+" inside main function. Isn't it a little confusing? I know good boys must preprocess data before feeding stack().

mbostock commented 7 years ago

The value accessor returns the value for the corresponding datum and key, so I think it’s named accurately. The + is there just to coerce the value to a number in case the value accessor doesn’t return a number; a well-behaved value accessor should return a number, so in the normal case the + does nothing.

If you have a question about D3’s behavior and want to discuss it with other users, also consider the d3-js Google Group or joining the d3-js Slack.

Thank you! 🤗