Represents the current state of a cell in a given GraphView.

For edges, the edge label position is stored in .

The size for oversize labels can be retrieved using the boundingBox property of the field as shown below.

let bbox = (state.text != null) ? state.text.boundingBox : null;

Hierarchy (view full)

Constructors

Properties

_height: number = 0

Holds the height of the rectangle.

0
_width: number = 0

Holds the width of the rectangle.

0
_x: number = 0

Holds the x-coordinate of the point. Default is 0.

_y: number = 0

Holds the y-coordinate of the point. Default is 0.

absoluteOffset: Point

Point that holds the absolute offset. For edges, this is the absolute coordinates of the label position. For vertices, this is the offset of the label relative to the top, left corner of the vertex.

absolutePoints: (null | Point)[] = []

Holds an array of that represent the absolute points of an edge.

boundingBox: null | Rectangle = null
cell: Cell

Reference to the Cell that is represented by this state.

cellBounds: null | Rectangle = null
control: null | Shape = null
invalid: boolean = true

Specifies if the state is invalid. Default is true.

invalidStyle: boolean = false

Specifies if the style is invalid. Default is false.

length: number = 0

Caches the length of an edge.

node: null | HTMLElement = null
origin: Point

Point that holds the origin for all child cells. Default is a new empty Point.

overlays: Dictionary<CellOverlay, Shape> = ...
paintBounds: null | Rectangle = null
parentHighlight: null | RectangleShape = null
point: null | Point = null
segments: number[] = []

Array of numbers that represent the cached length of each segment of the edge.

shape: null | Shape = null

Holds the Shape that represents the cell graphically.

The style of the Cell.

terminalDistance: number = 0

Caches the distance between the end points for an edge.

text: null | TextShape = null

Holds the Text that represents the label of the cell. Thi smay be null if the cell has no label.

unscaledHeight: number = 0

Holds the unscaled height of the state.

unscaledWidth: number = 0

Holds the unscaled width of the state.

view: GraphView

Reference to the enclosing GraphView.

visibleSourceState: null | CellState = null

Caches the visible source terminal state.

visibleTargetState: null | CellState = null

Caches the visible target terminal state.

Accessors

Methods

  • Destructor: destroy

    Destroys the state and all associated resources.

    Returns void

  • Returns the unscaled, untranslated paint bounds. This is the same as but with a 90 degree rotation if the shape's isPaintBoundsInverted returns true.

    Returns null | Rectangle

  • Returns the visible source or target terminal cell.

    Parameters

    • source: boolean = false

      Boolean that specifies if the source or target cell should be returned.

    Returns null | Cell

  • Returns the visible source or target terminal state.

    Parameters

    • source: boolean = false

      Boolean that specifies if the source or target state should be returned.

    Returns null | CellState

  • Grows the rectangle by the given amount, that is, this method subtracts the given amount from the x- and y-coordinates and adds twice the amount to the width and height.

    Parameters

    • amount: number

    Returns void

  • Returns true if the given state has no stroke, no fill color and no image.

    Returns boolean

  • Sets the first or last point in depending on isSource.

    Parameters

    • point: null | Point

      Point that represents the terminal point.

    • isSource: boolean = false

      Boolean that specifies if the first or last point should be assigned.

    Returns void

  • Sets the given cursor on the shape and text shape.

    Parameters

    • cursor: string

    Returns void

  • Sets the visible source or target terminal state.

    Parameters

    • terminalState: null | CellState

      that represents the terminal.

    • source: boolean = false

      Boolean that specifies if the source or target state should be set.

    Returns void