v7 curve interpolation comparison
The visualization compares eight D3 curve interpolation functions—linear, step, step-before, step-after, basis, cardinal, monotone-X, and Catmull-Rom—by plotting the same time-series dataset of stock closing prices with each curve as a separate colored line. Built with D3 v7, it uses `d3.line` with a `.curve()` method to generate the SVG paths and includes an interactive legend where clicking a label toggles the opacity of the corresponding line via `transition().duration(100)`. The data comes from the included CSV file, and the chart also renders the original data points as circles along with axes.
AI-generated descriptionThis bl.ock demonstrates the range of interpolation curves available in v7 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.
This graph is part of the code samples for the update to the book D3 Tips and Tricks to version 7 of d3.js.