Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

EMPTY_POINT

EMPTY_POINT: Point = ...

allowEval

allowEval: boolean = false

Specifies if string values in cell styles should be evaluated using {@link eval}. This will only be used if the string values can't be mapped to objects using StyleRegistry. Default is false. NOTE: Enabling this switch carries a possible security risk.

backgroundImage

backgroundImage: null | ImageShape = null

backgroundPageShape

backgroundPageShape: null | Shape = null

backgroundPane

backgroundPane: HTMLElement | SVGElement

canvas

canvas: HTMLElement | SVGElement

captureDocumentGesture

captureDocumentGesture: boolean = true

Specifies if a gesture should be captured when it goes outside of the graph container. Default is true.

currentRoot

currentRoot: null | Cell = null

Cell that acts as the root of the displayed cell hierarchy.

decoratorPane

decoratorPane: HTMLElement | SVGElement

doneResource

doneResource: string = ...

Specifies the resource key for the status message after a long operation. If the resource for this key does not exist then the value is used as the status message. Default is 'done'.

drawPane

drawPane: HTMLElement | SVGElement

endHandler

endHandler: null | MouseEventListener = null

eventListeners

eventListeners: EventListenerObject[] = []

Holds the event names and associated listeners in an array. The array contains the event name followed by the respective listener for each registered listener.

eventSource

eventSource: null | EventTarget = null

Optional source for events. Default is null.

eventsEnabled

eventsEnabled: boolean = true

Specifies if events can be fired. Default is true.

graph

graph: Graph

Reference to the enclosing graph.

graphBounds

graphBounds: Rectangle = ...

lastForegroundHtmlNode

lastForegroundHtmlNode: null | HTMLElement | SVGElement = null

During validation, this contains the last edge HTML DOM node that was processed.

lastForegroundNode

lastForegroundNode: null | HTMLElement | SVGElement = null

During validation, this contains the last edge's DOM node that was processed.

lastHtmlNode

lastHtmlNode: null | HTMLElement | SVGElement = null

During validation, this contains the last HTML DOM node that was processed.

lastNode

lastNode: null | HTMLElement | SVGElement = null

During validation, this contains the last DOM node that was processed.

moveHandler

moveHandler: null | MouseEventListener = null

overlayPane

overlayPane: HTMLElement | SVGElement

rendering

rendering: boolean = true

Specifies if shapes should be created, updated and destroyed using the methods of cellRenderer in graph. Default is true.

scale

scale: number = 1

states

states: Dictionary<Cell, CellState> = ...

translate

translate: Point = ...

Point that specifies the current translation. Default is a new empty Point.

updateStyle

updateStyle: boolean = false

Specifies if the style should be updated in each validation step. If this is false then the style is only updated if the state is created or if the style of the cell was changed. Default is false.

updatingDocumentResource

updatingDocumentResource: string = ...

Specifies the resource key for the status message while the document is being updated. If the resource for this key does not exist then the value is used as the status message. Default is 'updatingDocument'.

Methods

addListener

  • addListener(name: string, funct: Function): void
  • Binds the specified function to the given event name. If no event name is given, then the listener is registered for all events.

    The parameters of the listener are the sender and an EventObject.

    Parameters

    • name: string
    • funct: Function

    Returns void

clear

  • clear(cell?: null | Cell, force?: boolean, recurse?: boolean): void
  • Removes the state of the given cell and all descendants if the given cell is not the current root.

    Parameters

    • Optional cell: null | Cell

      Optional Cell for which the state should be removed. Default is the root of the model.

    • force: boolean = false

      Boolean indicating if the current root should be ignored for recursion.

    • recurse: boolean = true

    Returns void

createBackgroundPageShape

createHtml

  • createHtml(): void
  • Function: createHtml

    Creates the DOM nodes for the HTML display.

    Returns void

createHtmlPane

  • createHtmlPane(width: string, height: string): HTMLElement
  • Function: createHtmlPane

    Creates and returns a drawing pane in HTML (DIV).

    Parameters

    • width: string
    • height: string

    Returns HTMLElement

createState

createSvg

  • createSvg(): void

destroy

  • destroy(): void

fireEvent

  • fireEvent(evt: EventObject, sender?: null | EventTarget): void
  • Dispatches the given event to the listeners which are registered for the event. The sender argument is optional. The current execution scope ("this") is used for the listener invocation (see {@link Utils#bind}).

    Example:

    fireEvent(new mxEventObject("eventName", key1, val1, .., keyN, valN))
    

    Parameters

    • evt: EventObject

      EventObject that represents the event.

    • sender: null | EventTarget = null

      Optional sender to be passed to the listener. Default value is the return value of .

    Returns void

getBackgroundPageBounds

getBackgroundPane

  • getBackgroundPane(): HTMLElement | SVGElement
  • Returns the DOM node that represents the background layer.

    Returns HTMLElement | SVGElement

getBoundingBox

  • Returns the bounding box of the shape and the label for the given CellState and its children if recurse is true.

    Parameters

    • state: null | CellState = null

      CellState whose bounding box should be returned.

    • recurse: boolean = true

      Optional boolean indicating if the children should be included. Default is true.

    Returns null | Rectangle

getBounds

getCanvas

  • getCanvas(): HTMLElement | SVGElement
  • Returns the DOM node that contains the background-, draw- and overlay- and decoratorpanes.

    Returns HTMLElement | SVGElement

getCellStates

  • Returns the {@link mxCellStates} for the given array of Cell. The array contains all states that are not null, that is, the returned array may have less elements than the given array. If no argument is given, then this returns states.

    Parameters

    Returns CellState[]

getDecoratorPane

  • getDecoratorPane(): HTMLElement | SVGElement
  • Returns the DOM node that represents the topmost drawing layer.

    Returns HTMLElement | SVGElement

getDrawPane

  • getDrawPane(): HTMLElement | SVGElement
  • Returns the DOM node that represents the main drawing layer.

    Returns HTMLElement | SVGElement

getEdgeStyle

getEmptyBounds

getEventSource

  • getEventSource(): null | EventTarget

getFixedTerminalPoint

getFloatingTerminalPoint

  • Returns the floating terminal point for the given edge, start and end state, where start is the source if source is true.

    Parameters

    • edge: CellState

      CellState whose terminal point should be returned.

    • start: CellState

      CellState for the terminal on "this" side of the edge.

    • end: null | CellState

      CellState for the terminal on the other side of the edge.

    • source: boolean

      Boolean indicating if start is the source terminal state.

    Returns Point

getGraphBounds

getNextPoint

  • Returns the nearest point in the list of absolute points or the center of the opposite terminal.

    Parameters

    • edge: CellState

      CellState that represents the edge.

    • opposite: null | CellState

      CellState that represents the opposite terminal.

    • source: boolean = false

      Boolean indicating if the next point for the source or target should be returned.

    Returns Point

getOverlayPane

  • getOverlayPane(): HTMLElement | SVGElement
  • Returns the DOM node that represents the layer above the drawing layer.

    Returns HTMLElement | SVGElement

getPerimeterBounds

  • Returns the perimeter bounds for the given terminal, edge pair as an Rectangle.

    If you have a model where each terminal has a relative child that should act as the graphical endpoint for a connection from/to the terminal, then this method can be replaced as follows:

    example
    var oldGetPerimeterBounds = getPerimeterBounds;
    getPerimeterBounds(terminal, edge, isSource)
    {
    var model = this.graph.getDataModel();
    var childCount = model.getChildCount(terminal.cell);

    if (childCount > 0)
    {
    var child = model.getChildAt(terminal.cell, 0);
    var geo = model.getGeometry(child);

    if (geo != null &&
    geo.relative)
    {
    var state = this.getState(child);

    if (state != null)
    {
    terminal = state;
    }
    }
    }

    return oldGetPerimeterBounds.apply(this, arguments);
    };

    Parameters

    • terminal: null | CellState = null

      CellState that represents the terminal.

    • border: number = 0

      Number that adds a border between the shape and the perimeter.

    Returns null | Rectangle

getPerimeterFunction

  • getPerimeterFunction(state: CellState): null | Function

getPerimeterPoint

  • getPerimeterPoint(terminal: CellState, next: Point, orthogonal: boolean, border?: number): Point
  • Returns an Point that defines the location of the intersection point between the perimeter and the line between the center of the shape and the given point.

    Parameters

    • terminal: CellState

      CellState for the source or target terminal.

    • next: Point

      {@link mxPoint} that lies outside of the given terminal.

    • orthogonal: boolean

      Boolean that specifies if the orthogonal projection onto the perimeter should be returned. If this is false then the intersection of the perimeter and the line between the next and the center point is returned.

    • border: number = 0

      Optional border between the perimeter and the shape.

    Returns Point

getPoint

getRelativePoint

  • Gets the relative point that describes the given, absolute label position for the given edge state.

    Parameters

    • edgeState: CellState
    • x: number

      Specifies the x-coordinate of the absolute label location.

    • y: number

      Specifies the y-coordinate of the absolute label location.

    Returns Point

getRoutingCenterX

getRoutingCenterY

getScale

  • getScale(): number

getState

  • Returns the CellState for the given cell. If create is true, then the state is created if it does not yet exist.

    Parameters

    • cell: Cell

      {@link mxCell} for which the CellState should be returned.

    • create: boolean = false

      Optional boolean indicating if a new state should be created if it does not yet exist. Default is false.

    Returns null | CellState

getStates

getTerminalPort

getTranslate

getVisibleTerminal

  • getVisibleTerminal(edge: Cell, source: boolean): null | Cell
  • Returns the nearest ancestor terminal that is visible. The edge appears to be connected to this terminal on the display. The result of this method is cached in CellState.getVisibleTerminalState.

    Parameters

    • edge: Cell

      {@link mxCell} whose visible terminal should be returned.

    • source: boolean

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

    Returns null | Cell

init

  • init(): void
  • Initializes the graph event dispatch loop for the specified container and invokes {@link create} to create the required DOM nodes for the display.

    Returns void

installListeners

  • installListeners(): void

invalidate

  • invalidate(cell?: null | Cell, recurse?: boolean, includeEdges?: boolean): void
  • Invalidates the state of the given cell, all its descendants and connected edges.

    Parameters

    • cell: null | Cell = null

      Optional Cell to be invalidated. Default is the root of the model.

    • recurse: boolean = true
    • includeEdges: boolean = true

    Returns void

isAllowEval

  • isAllowEval(): boolean

isContainerEvent

  • isContainerEvent(evt: MouseEvent): any
  • Returns true if the event origin is one of the drawing panes or containers of the view.

    Parameters

    • evt: MouseEvent

    Returns any

isEventsEnabled

  • isEventsEnabled(): boolean

isLoopStyleEnabled

  • Returns true if the given edge should be routed with {@link graph.defaultLoopStyle} or the {@link mxConstants.STYLE_LOOP} defined for the given edge. This implementation returns true if the given edge is a loop and does not

    Parameters

    Returns boolean

isRendering

  • isRendering(): boolean

isScrollEvent

  • isScrollEvent(evt: MouseEvent): boolean
  • Returns true if the event origin is one of the scrollbars of the container in IE. Such events are ignored.

    Parameters

    • evt: MouseEvent

    Returns boolean

redrawBackgroundImage

  • Updates the bounds and redraws the background image.

    Example:

    If the background image should not be scaled, this can be replaced with the following.

    example
    redrawBackground(backgroundImage, bg)
    {
    backgroundImage.bounds.x = this.translate.x;
    backgroundImage.bounds.y = this.translate.y;
    backgroundImage.bounds.width = bg.width;
    backgroundImage.bounds.height = bg.height;

    backgroundImage.redraw();
    };

    Parameters

    • backgroundImage: ImageShape

      {@link mxImageShape} that represents the background image.

    • bg: ImageBox

      {@link mxImage} that specifies the image and its dimensions.

    Returns void

refresh

  • refresh(): void

removeListener

  • removeListener(funct: Function): void

removeState

resetValidationState

  • resetValidationState(): void

revalidate

  • revalidate(): void

scaleAndTranslate

  • scaleAndTranslate(scale: number, dx: number, dy: number): void
  • Sets the scale and translation and fires a scale and translate event before calling revalidate followed by {@link graph.sizeDidChange}.

    Parameters

    • scale: number

      Decimal value that specifies the new scale (1 is 100%).

    • dx: number

      X-coordinate of the translation.

    • dy: number

      Y-coordinate of the translation.

    Returns void

setAllowEval

  • setAllowEval(value: boolean): void

setCurrentRoot

  • setCurrentRoot(root: null | Cell): null | Cell
  • Sets and returns the current root and fires an undo event before calling {@link graph.sizeDidChange}.

    Parameters

    • root: null | Cell

      {@link mxCell} that specifies the root of the displayed cell hierarchy.

    Returns null | Cell

setEventSource

  • setEventSource(value: null | EventTarget): void

setEventsEnabled

  • setEventsEnabled(value: boolean): void

setGraphBounds

setRendering

  • setRendering(value: boolean): void

setScale

  • setScale(value: number): void
  • Sets the scale and fires a scale event before calling revalidate followed by {@link graph.sizeDidChange}.

    Parameters

    • value: number

      Decimal value that specifies the new scale (1 is 100%).

    Returns void

setStates

setTranslate

  • setTranslate(dx: number, dy: number): void
  • Sets the translation and fires a translate event before calling revalidate followed by {@link graph.sizeDidChange}. The translation is the negative of the origin.

    Parameters

    • dx: number

      X-coordinate of the translation.

    • dy: number

      Y-coordinate of the translation.

    Returns void

stateValidated

  • Invoked when a state has been processed in {@link validatePoints}. This is used to update the order of the DOM nodes of the shape.

    Parameters

    Returns void

transformControlPoint

updateBoundsFromStencil

  • Updates the bounds of the given cell state to reflect the bounds of the stencil if it has a fixed aspect and returns the previous bounds as an Rectangle if the bounds have been modified or null otherwise.

    Parameters

    Returns null | Rectangle

updateCellState

updateContainerStyle

  • updateContainerStyle(container: HTMLElement): void
  • Updates the style of the container after installing the SVG DOM elements.

    Parameters

    • container: HTMLElement

    Returns void

updateEdgeBounds

updateEdgeLabelOffset

  • updateEdgeLabelOffset(state: CellState): void
  • Updates CellState.absoluteOffset for the given state. The absolute offset is normally used for the position of the edge label. Is is calculated from the geometry as an absolute offset from the center between the two endpoints if the geometry is absolute, or as the relative distance between the center along the line and the absolute orthogonal distance if the geometry is relative.

    Parameters

    Returns void

updateEdgeState

updateFixedTerminalPoint

updateFixedTerminalPoints

updateFloatingTerminalPoint

  • Updates the absolute terminal point in the given state for the given start and end state, where start is the source if source is true.

    Parameters

    • edge: CellState

      CellState whose terminal point should be updated.

    • start: CellState

      CellState for the terminal on "this" side of the edge.

    • end: null | CellState

      CellState for the terminal on the other side of the edge.

    • source: boolean

      Boolean indicating if start is the source terminal state.

    Returns void

updateFloatingTerminalPoints

updateHtmlCanvasSize

  • updateHtmlCanvasSize(width: number, height: number): void
  • Function: updateHtmlCanvasSize

    Updates the size of the HTML canvas.

    Parameters

    • width: number
    • height: number

    Returns void

updatePoints

updateVertexLabelOffset

  • updateVertexLabelOffset(state: CellState): void
  • Updates the absoluteOffset of the given vertex cell state. This takes into account the label position styles.

    Parameters

    Returns void

updateVertexState

validate

  • validate(cell?: null | Cell): void

validateBackground

  • validateBackground(): void

validateBackgroundImage

  • validateBackgroundImage(): void

validateBackgroundPage

  • validateBackgroundPage(): void

validateCell

  • validateCell(cell: Cell, visible?: boolean): Cell
  • Recursively creates the cell state for the given cell if visible is true and the given cell is visible. If the cell is not visible but the state exists then it is removed using removeState.

    Parameters

    • cell: Cell

      {@link mxCell} whose CellState should be created.

    • visible: boolean = true

      Optional boolean indicating if the cell should be visible. Default is true.

    Returns Cell

validateCellState

  • validateCellState(cell: null | Cell, recurse?: boolean): null | CellState
  • Validates and repaints the CellState for the given Cell.

    Parameters

    • cell: null | Cell

      {@link mxCell} whose CellState should be validated.

    • recurse: boolean = true

      Optional boolean indicating if the children of the cell should be validated. Default is true.

    Returns null | CellState

viewStateChanged

  • viewStateChanged(): void

Generated using TypeDoc