I would like to get the text to wrap on the following D3 tree so that instead of
Foo is not a long word
each line is wrapped to
If you're using React, a library you can use for this is @visx/text. It exposes a more powerful SVG text element that supports a width parameter.
width
import { Text } from '@visx/text'; const App = () => ( Foo is not a long word );