documentationfor yFiles for HTML 2.6

GenericLabeling

A generic labeling algorithm for placing the labels of a graph.

Inheritance Hierarchy
Implemented Interfaces

Remarks

Node labels and edge labels placed by the labeling algorithm

This algorithm can switch between two internal implementations. By default, it generates high quality label placements even for difficult instances. This especially holds if the label models allow a large number of different LabelCandidates, i.e., there is a high potential for optimizations.

If the duration of the calculation is of utmost importance, the internal algorithm can be changed to a simpler implementation by setting maximumDuration to 0. On the downside, the results will not be as good as the ones of the default mode.

In default mode, this algorithm reduces the labeling problem to the maximum independent set (MIS) problem and solves the problem using simulated annealing. It is inspired by the article from Christensen, Marks and Shieber: A General Cartographic Labelling Algorithm.

It is recommended to use IEdgeLabelLayoutModels and INodeLabelLayoutModels which allow free positioning of labels to achieve best results with this generic labeling algorithm.

Note that when used standalone and in conjunction with a PartitionGrid, care has to be taken to supply the correct cell positions. If a previous layout run has modified the partition grid, the originalPosition and originalHeight, may be out of date. In this case computedPosition and computedHeight need to be written back to the original values as this algorithm relies on them being correct. Likewise for the ColumnDescriptors.

This algorithm works according to the general labeling concept defined by LabelingBase.

Default Values of Properties

affectedLabelsDpKeynullAll labels are considered to be selected.
customProfitModelRatio0.1The profit determined by the optimization strategy is more important than the currently specified profit model.
deterministictrueLabeling results are deterministic.
edgeGroupOverlapAllowedfalseEdge labels are not allowed to overlap with edges of the same edge group.
maximumDuration<code>0x7FFFFFFF</code>There is no time limit.
optimizationStrategyBALANCED
placeEdgeLabelstrueEdge labels will be placed.
placeNodeLabelstrueNode labels will be placed.
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.GenericLabeling

See Also

Constructors

Properties

Methods

Fields