Skip to main content
100%

Update-Only Transition

✓ Published0🌍 Public
Mmbostock
Last edited Feb 9, 2016
Created on Oct 16, 2012

This example demonstrates how to apply a transition exclusively to updating nodes in a D3.js visualization, leaving newly entering nodes unaffected. Initially, two circles appear at ordinal x-positions. After a delay, the data binding updates to shift one circle and add a new one. The transition—changing radius and fill color to orange—is defined before the `.enter().append()` call, so it only animates the existing circle, while the new circle appears green without transitioning. D3.v3’s selection and transition API, including `.transition().attr()`, `.style()`, and `.remove()`, coordinates the update, entry, and exit phases in SVG.

AI-generated description

Demonstrating how to apply a transition to only updating nodes, and not entering nodes.

gpl-3.0 Licensed

Similar vizzes