v4 curve interpolation comparison
This example compares ten different curve interpolation methods from D3 v4, displaying them as colored lines over the same time-series data points from a CSV file. Clicking a legend label toggles the visibility of its corresponding line by adjusting opacity with a transition. The visualization uses `d3.line()` with specified curve functions like `d3.curveBundle`, `d3.curveNatural`, and `d3.curveMonotoneX`, rendered as SVG paths. The axes are drawn with `d3.axisBottom` and `d3.axisLeft`, and the legend uses an ordinal color scale from `d3-scale-chromatic`.
AI-generated descriptionThis bl.ock demonstrates the range of interpolation curves available in v4 of d3.js.
You can click on any of the legend labels to toggle visibility of the lines.
Details of the curve can be found on the D3 wiki.
forked from <a href='http://bl.ocks.org/tomshanley/'>Tom Shanley</a>'s block: <a href='http://bl.ocks.org/tomshanley/3bcf041284792acf27dfd77e8d807960'>v4 curve interpolation comparison</a>. Added Bundle and Natural as interpolation examples. Reverted to opacity of zero when deselected.
This graph is part of the code samples for the update to the book D3 Tips and Tricks to version 4 of d3.js.
forked from <a href='http://bl.ocks.org/d3noob/'>d3noob</a>'s block: <a href='http://bl.ocks.org/d3noob/ced1b9b18bd8192d2c898884033b5529'>v4 curve interpolation comparison</a> to change the legend behaviour fade if line's faded, and added css pointer.
forked from <a href='http://bl.ocks.org/tomshanley/'>tomshanley</a>'s block: <a href='http://bl.ocks.org/tomshanley/3bcf041284792acf27dfd77e8d807960'>v4 curve interpolation comparison</a>
forked from <a href='http://bl.ocks.org/bill-kidwell/'>bill-kidwell</a>'s block: <a href='http://bl.ocks.org/bill-kidwell/9e550945410a684c5eecfd25f2e19793'>v4 curve interpolation comparison</a>