chevron_right Demos chevron_right Organic Layout with Edge Labeling
Related demos
Book a live Demo

Live Demo — yFiles in Action

30–45 min | Online | No install required

For Developers, Product Mangers & Executives

  • Interactive graph visualization in real time
  • Integration example
  • Live Q&A and next step recommendations

30–45 minutes | 1:1 or team session | Online (Zoom / Teams)

No install required | We show live code

Book a free live demo

Live Demo — yFiles in Action

30–45 min | Online | No install required

For Developers, Product Mangers & Executives

30–45 minutes | 1:1 or team session | Online (Zoom / Teams)

No install required | We show live code

Book a free live demo

Organic Layout with Edge Labeling

This demo shows how to configure the OrganicLayout for automatic edge label placement.

Label Placement

Label models and their parameters control where labels appear. For manuel placements, it's common to use models that limit possible positions. However, for automatic layout, it's best to use unrestricted models like FreeEdgeLabelModel for maximum flexibility.

You can further guide label placement using EdgeLabelPreferredPlacement, which specifies preferences such as placing labels near the edge's source or target, on a particular side, or with a specific rotation. For better results when using organic layout, both the side and angle of the labels relative to the edge path should be specified.

Note that self-loops and parallel edges are handled by SelfLoopRouter and ParallelEdgeRouter respectively. Thus, labels of such edges are not considered by the organic layout algorithm. To place the labels of these edges, a GenericLabeling algorithm has to be applied as a post-processing step.

Things to Try

Demos

Documentation