Wrapping Text in D3

后端 未结 4 1716
礼貌的吻别
礼貌的吻别 2020-12-09 16:50

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



        
4条回答
  •  不知归路
    2020-12-09 17:22

    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.

    import { Text } from '@visx/text';
    
    const App = () => (
      
        Foo is not a long word
      
    );
    

提交回复
热议问题