Skip to main content
100%

Animated Clipped textPath

✓ Published0🌍 Public
Mmbostock
Last edited Feb 9, 2016
Created on Jul 20, 2012

This example animates an SVG path while simultaneously clipping curved text against it, so the text appears to draw itself along the arc. A blue arc path transitions over five seconds using `transition.attrTween` with a `d3.svg.arc` generator, while a `<textPath>` references a static hidden path and a `clipPath` uses the animated path via a `<use>` element. The code relies on D3 v3, SVG, and a 960×500 viewport, with the text “Hello, curved textPath!” clipped to the moving path’s shape.

AI-generated description

This example demonstrates how to animate a path and a clipped textPath at the same time.

See related Stack Overflow question.

gpl-3.0 Licensed

Similar vizzes