Chained Transitions
A small multiples chart compares daily temperatures in New York and San Francisco as a smooth line. Clicking a radio button switches the displayed city, triggering a three-stage chained transition: first the shared y-axis rescales to encompass both datasets, then the line and label morph to the new city with a color change, and finally the y-axis narrows to the new city’s range. Built with D3 v4, the visualization uses `transition()`, `axisBottom`, `axisLeft`, and `line()` to sequence these state changes smoothly.
AI-generated descriptionThis variation of a line chart demonstrates a sequence of chained transitions. Clicking on the radio buttons changes the displayed metric. First, the line transitions to the new values. Then, the axes rescale to fit the new data.
forked from <a href='http://bl.ocks.org/mbostock/'>mbostock</a>'s block: <a href='http://bl.ocks.org/mbostock/3903818'>Chained Transitions</a>