@maxgraph/core
    Preparing search index...

    Class CellState

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

    For edges, the edge label position is stored in absoluteOffset.

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

    const bbox = state.text?.boundingBox ?? null;
    

    Hierarchy (View Summary)

    Index

    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.

    true
    
    invalidStyle: boolean = false

    Specifies if the style is invalid.

    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.

    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. This may 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

    • 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 this rectangle to the specified values

      Parameters

      • x: number
      • y: number
      • width: number
      • height: number

      Returns void

    • Sets the visible source or target terminal state.

      Parameters

      • terminalState: null | CellState

        CellState that represents the terminal.

      • source: boolean = false

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

      Returns void