Application Features Tutorial

Label Text Wrapping

This demo shows how to enable the text wrapping and trimming feature provided by the DefaultLabelStyle class. The options include wrapping at character or at word bounds, both with or without ellipsis.

Aside from wrapping in rectangular shapes, the textWrappingShape property allows for wrapping in many more shapes like triangle, hexagon or ellipse. This can be combined with padding and insets to fine-tune the wrapping.

Things to Try

  • Select and resize the nodes to see how the different wrapping types behave.
  • New interactively added labels use word wrapping with ellipsis.
  • Try the right to left text direction. This will rebuild the graph with Hebrew text labels.

See the sources for details.