Update and revert graph data
Two line charts share a common set of axes, displaying date-based stock closing values. Clicking the "Update" button loads alternate data (`data-alt.csv`) and animates the line and axis ranges over 750 ms using D3 transitions, while "Revert" returns to the original `data.csv` dataset. The visualization uses D3's `d3.time.scale`, `d3.scale.linear`, `d3.svg.line`, and `d3.svg.axis` to render the SVG line and axes, with `.transition()` on the `d3.select("body")` selection to smoothly interpolate the path and axis scales.
AI-generated descriptionThis is a follow on from the update data graph used as an example in the book D3 Tips and Tricks.
It demonstrates the loading and reverting of data and updating a graph on button presses. It should be taken in context with the text of the book which can be downloaded for free from Leanpub.