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 installoryarn.- Run the server.
npm run serveoryarn serve - Open
localhost:8080/example/in browser
window.SVGTextWrap('long label to be wrapped'[, settings])splitter- text splitting method, default: splits byspaceradius- radius of circle, default: 40fontName- default:sans-seriffontSize- in pixels (px), default: 10lineHeight- default, 12
Array of objects:
rule-yvalue inside circle'sxyspaceremainingWidth- 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
