SVG Text Wrapping of long labels inside SVG figures like Neo4j. Currently only for circles.
An example is also added to the project.
- Clone the repository
npm install
oryarn
.- Run the server.
npm run serve
oryarn serve
- Open
localhost:8080/example/
in browser
window.SVGTextWrap('long label to be wrapped'[, settings])
splitter
- text splitting method, default: splits byspace
radius
- radius of circle, default: 40fontName
- default:sans-serif
fontSize
- in pixels (px), default: 10lineHeight
- default, 12
Array of objects:
rule
-y
value inside circle'sxy
spaceremainingWidth
- width of rule remaining after text added to the ruletext
- part of original label that can be fit into the rule
You can add more labels to test by modifying the labels.js
file in the
example
directory.
- Support rectangles / squares
- Support triangles