Canvas area charts zoom on click using d3.interpolateString
This example shows two time-series area charts for energy data (PV and TBL kilowatts) rendered on a Canvas layer, with an SVG layer for axes and a clickable zoom button. Clicking the button triggers a smooth zoom animation into a specific date range using `d3.interpolateString` to interpolate between domain values. The code uses d3.v4, `d3.area`, `d3.zoom`, and `d3.scaleTime`, drawing to a scaled Canvas context (for retina displays) while keeping the SVG for interactive elements. The data is loaded from a CSV file containing hourly readings.
AI-generated descriptionBuilt with blockbuilder.org
forked from <a href='http://bl.ocks.org/interwebjill/'>interwebjill</a>'s block: <a href='http://bl.ocks.org/interwebjill/cc5361ca1d1c5538fab19999785c6d01'>Combining Canvas + SVG for Retina</a>
Zoom technique thanks to Andrew Reid: <a href='https://bl.ocks.org/Andrew-Reid/0d9a717117b4224b6abd3122717985a7'>Combining Canvas + SVG for Retina</a> and <a href='https://stackoverflow.com/questions/51014832/reversing-order-of-d3-zoom-scale-and-translate'>his thorough StackOverflow answer</a>
forked from <a href='http://bl.ocks.org/interwebjill/'>interwebjill</a>'s block: <a href='http://bl.ocks.org/interwebjill/55f1c93864afa661524fb7c63ddd2d70'>Canvas area charts zoom on click using d3.interpolateString</a>