d3 / d3-shape

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

bundle curve throws error with area #70

Closed jharris4 closed 8 years ago

jharris4 commented 8 years ago

While trying out the various curves with an area shape generator I noticed that I get the following error when using the bundle curve:

Uncaught TypeError: output.areaStart is not a function

which occurs at this line of area.js

It works fine with the line generator, and I see that bundle-test.js doesn't have any tests for areas.

I guess this means bundle curves are only designed to work with lines?

In case you want a quick way to reproduce, I've attached a short example index_html.txt

mbostock commented 8 years ago

Correct, d3.curveBundle is only intended to work with d3.line. It’s for hierarchical edge bundling, not for rendering areas. I’ll update the documentation accordingly.

jharris4 commented 8 years ago

awesome, thanks for clearing that up!

fabswt commented 6 years ago

Was there any particular reason for reserving d3.curveBundle to the interpolation of lines to the exclusion of areas, starting in v4?

Back in D3 v3, I could use it on areas as well (e.g.: .interpolate("bundle").tension(0)).

FYI, I needed it in v4/v5 as well, so created a custom curve for it with some help from StackOverflow.