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

how to have a `d3.lineRadial()` as closed path? #123

Closed zzeligg closed 5 years ago

zzeligg commented 6 years ago

with d3 v4, how can I do the equivalent of:

d3.svg.line.radial().interpolate("linear-closed")

I tried following how lineRadial was instantiated and I suspect I might have to pass a parameter or call some method on it (instead of interpolate).

Thanks for helping!

mlimon commented 5 years ago

try this: radarLine.curve(d3.curveCardinalClosed); // in D3 v4

mbostock commented 5 years ago

Yep, or d3.curveLinearClosed.

Please use Stack Overflow tag d3.js to ask for help. Stack Overflow provides a better collaborative forum: thousands of D3-related questions have been asked there, and some answers may be relevant to you.

When asking for help, please include a link to demonstrate the issue, preferably as an Observable notebook. It is often impossible to debug from code snippets alone. Isolate the issue and reduce your code as much as possible before asking for help. The less code you post, the easier it is for someone to debug, and the more likely you are to get a helpful response.

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! 🤗