documentationfor yFiles for HTML 2.6

LabelingBase

An abstract base class for generic labeling algorithms which place labels of graphs.

Inheritance Hierarchy
Implemented Interfaces

Remarks

Labeling algorithms compute positions for labels in a given graph. The main goal is to place labels such that they do not overlap with other graph elements. Labeling algorithms do not modify positions of nodes and edges.

Concept

Generic labeling algorithms use the model associated with a label (i.e. node label model for nodes and edge label model for edges). The models are necessary to compute a set of LabelCandidates, i.e., candidate positions for a label. Then, one best matching candidate from the set will be selected. This selection depends on several preferences, e.g., if overlaps with nodes are not allowed, candidates encoding overlapping positions will be ignored.

After one LabelCandidate has been chosen, the label model's parameter is used for encoding the label position. Therefore, the result of a generic labeling algorithm is one model parameter per label. The parameter is stored with the label and expresses the label position with respect to the underlying label model.

Features

This class provides a general frame, offering functionality which can be shared by other generic labeling algorithms.

To only place labels or a subset of labels, the main labeling methods label, label and label are offered.

As this class represents an LayoutStageBase, it allows usage as a generic labeling stage. By combining it with a core layouter, the labeling will take place after the core layouter was executed (applyLayout). This is especially useful if the core layouter does not support label handling.

Default Values of Properties

affectedLabelsDpKeynullAll labels are considered to be selected.
autoFlippingfalseEdge labels being upside-down keep their orientation.
edgeGroupOverlapAllowedfalseEdge labels are not allowed to overlap with edges of the same edge group.
placeEdgeLabelstrueEdge labels will be placed.
placeNodeLabelstrueNode labels will be placed.
profitModelSimpleProfitModel
removeEdgeOverlapsfalseCandidates overlapping with edges are allowed.
removeNodeOverlapsfalseCandidates overlapping with nodes are allowed.

Type Details

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

Constructors

Properties

Methods

Constants