Implements the alignment of selection cells to other cells in the graph.

Constructor: mxGuide

Constructs a new guide object.

Constructors

Properties

graph: Graph

Reference to the enclosing Graph instance.

guideX: null | Shape = null

Holds the Shape for the horizontal guide.

guideY: null | Shape = null

Holds the Shape for the vertical guide.

horizontal: boolean = true

Specifies if horizontal guides are enabled. Default is true.

rounded: boolean = false

Specifies if rounded coordinates should be used. Default is false.

states: CellState[] = []

Contains the CellStates that are used for alignment.

tolerance: number = 2

Default tolerance in px if grid is disabled. Default is 2.

vertical: boolean = true

Specifies if vertical guides are enabled. Default is true.

Methods

  • Returns the tolerance for the guides. Default value is gridSize / 2.

    Parameters

    • gridEnabled: boolean = false

    Returns number

  • Returns true if the guide should be enabled for the given native event. This implementation always returns true.

    Parameters

    • evt: MouseEvent

    Returns boolean

  • Shows or hides the current guides.

    Parameters

    • visible: boolean

    Returns void