Skip to main content
100%

Text Along a Path

✓ Published0🌍 Public
Mmbostock
Last edited Feb 9, 2016
Created on May 1, 2012

This example shows how to place text along a curved path using SVG’s `textPath` element. A visible gray curve is defined in the SVG `<defs>` section, and the sentence "We go up, then we go down, then up again." follows that path via an `xlink:href` reference. The code uses D3 v3 to build the SVG structure, appending a `<path>`, a `<text>` with a `<textPath>`, and a `<use>` element to display the curve.

AI-generated description

A demonstration of SVG’s textPath element.

gpl-3.0 Licensed

Similar vizzes