documentationfor yFiles for HTML 2.6

LabelLayoutTranslator

LabelLayoutTranslator automatically translates label layout information provided by the standard label layout classes IEdgeLabelLayout and INodeLabelLayout to layout data of type LabelLayoutData that is accessible by the keys defined in class LabelLayoutKeys.

Inheritance Hierarchy
LabelLayoutTranslator
Implemented Interfaces

Remarks

One can use this ILayoutStage as label layout algorithm of a label-aware layout algorithm like HierarchicLayout. This can be done by assigning the stage by an appropriate call to setLabelLayouter.

When writing the LabelLayoutData, the boxes are set relative. In case of a node label, the box's anchor is relative to the center of the owning node. In case of an edge label the box's anchor is relative to the center of the source node of the owning edge.

If writing back node labels and/or writing back edge labels is enabled, the LabelLayoutData is transferred back to the INodeLabelLayouts and/or IEdgeLabelLayouts.

By default, the boxes are now interpreted absolute but by activating writeBackRelativeNodeLabelLocation and/or writeBackRelativeEdgeLabelLocation this can be changed to interpret them relative as explained above.

Note that care must be taken on the choice of the label model that is used by the classes IEdgeLabelLayout and INodeLabelLayout. The calculated label positions must be consistent with the label positions allowed by the label model. The best label layout results are achieved by choosing FreeEdgeLabelLayoutModel for edge layouts and FreeNodeLabelLayoutModel for node layouts.

Default Values of Properties

autoFlippingtrueLabels are automatically flipped if they are upside down.
coreLayoutnull
resettingEdgeLabelOrientationtrueThe orientation of edge labels is reset.
resettingNodeLabelOrientationfalseThe orientation of node labels is kept.
translateEdgeLabelsfalseThe label information is not translated for edge labels.
translateNodeLabelsfalseThe label information is not translated for node labels.
writeBackEdgeLabelstrueEdge label information is transferred back to the label model.
writeBackNodeLabelstrueNode label information is transferred back to the label model.

Type Details

yfiles module
layout-core
yfiles-umd modules
All layout modules, view-layout-bridge
Legacy UMD name
yfiles.layout.LabelLayoutTranslator

Constructors

Properties

Methods