Skip to main content
100%

Arc Tween

✓ Published0🌍 Public
SSpaceActuary
Last edited Jun 9, 2017
Created on Jun 9, 2017

The visualization demonstrates smooth animated transitions of arc segments using D3 v4’s `transition.attrTween`. It shows a circular foreground arc that repeatedly updates its angle, while a secondary set of colored arcs animates inward and outward between paired data values. The `d3.arc` generator builds SVG path strings with bound start/end angles, and the tween interpolates the endAngle over 750 milliseconds for the main arc and 1750 milliseconds for the colored segments. Random angle targets drive the main arc, while paired arrays (e.g., `[0, 0.25, 0.4, 0.65, 0.9, 1]`) control the secondary arcs’ expansion and contraction.

AI-generated description

A commented example of tweening arcs; see Pie Chart Update, II and Arc Tween (Clock) for older examples. (There’s also The Amazing Pie and Donut Transitions if you want to get fancy.) See the API reference for transition.attrTween and my tutorial Working with Transitions for more.

forked from <a href='http://bl.ocks.org/mbostock/'>mbostock</a>'s block: <a href='http://bl.ocks.org/mbostock/5100636'>Arc Tween</a>

gpl-3.0 Licensed

Similar vizzes