documentationfor yFiles for HTML 3.0.0.3

GridConstraintProvider<T>

A simple integer-based implementation of IGridConstraintProvider<T>.

Inheritance Hierarchy
GridConstraintProvider
Implemented Interfaces

Examples

Enabling grid snapping

const snapContext = new GraphSnapContext()

const gridInfo = new GridInfo(50, 50)
snapContext.nodeGridConstraintProvider = new GridConstraintProvider(
  gridInfo,
)
snapContext.bendGridConstraintProvider = new GridConstraintProvider(
  gridInfo,
)
snapContext.portGridConstraintProvider = new GridConstraintProvider(
  gridInfo,
)
snapContext.gridSnapType = GridSnapTypes.GRID_POINTS

graphEditorInputMode.snapContext = snapContext

Note that the grid visualization has to be enabled separately

graphComponent.renderTree.createElement(
  graphComponent.renderTree.backgroundGroup,
  gridInfo,
  new GridRenderer(),
)

Type Parameters

T
The type of the items.

Type Details

yFiles module
view

Constructors

Properties

Methods