d3plus / d3plus-text

A smart SVG text box with line wrapping and automatic font size scaling.
MIT License
105 stars 19 forks source link

support text wrapping inside of circles #5

Open davelandry opened 8 years ago

JonathanTR commented 6 years ago

Any progress on this? I'm stuck on a project for work that could really use this feature and don't want to reinvent the wheel. What would be needed to get it out the door?

davelandry commented 6 years ago

No specific updates on this, but it shouldn't be too hard to implement.

The width in this if statement needs to be determined based on the current line of text that is being flowed, because the lines towards the top and the bottom of a circle are naturally shorter.

I'm sure there will be some weird edge cases, but that's basically it. Pull requests are welcome, but if not, these notes will serve as my starting point once I get the time to do it 😏

grozadanut commented 6 years ago

Was there any progress made on this feature? I have a project that really relies on this wrapping of text inside circles as well. The old version of d3plus(version 1) supported wrapping inside circle with the textwrap and shape:'circle' attribute, but I don't find this feature in the new version neither on TextBox or textWrap.

davelandry commented 6 years ago

@gdany95 no specific progress here, but a naive approach has been added to d3plus-shape to display labels in Circles. It currently wraps the text within a square that fits within the bounds of the circle: https://github.com/d3plus/d3plus-shape/commit/8445daca6c7c8893b633ef22e572b092355f3e49

antonkatz commented 3 years ago

So this used to be possible, but I can't find a way in the current version! What happened?

https://gist.github.com/markvital/f06695481347c004a20af5a5db0a9da8