documentationfor yFiles for HTML 3.0.0.3

LabelPositionHandler

An implementation of IPositionHandler that shows the various label position candidates and lets the user move a label to one of those candidate positions.

Inheritance Hierarchy
LabelPositionHandler
Implemented Interfaces

Remarks

Instances of this class can be used to change the visualization of labels while moving them.

The candidate positions rendered by the candidateRenderer provide the following CSS classes:

  • yfiles-label-position-candidate-template for all possible positions
  • yfiles-label-position-highlight-template for the position that would currently be taken

Examples

Setting the visualization mode for labels
graph.decorator.labels.positionHandler.addFactory((label) => {
  const positionHandler = new LabelPositionHandler(label)
  positionHandler.visualization = 'live'
  return positionHandler
})

Related Reading in the Developer's Guide

An example for the CSS styling of the candidates is given in CSS Styling of the Label Position Suggestions .

Type Details

yFiles module
view

Constructors

Properties

Methods