GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • @maxgraph/core

This view

  • Original page
  • New address

GeezerVison is showing maxgraph.github.io (truncated) — AbstractGraph | @maxgraph/core

  • AbstractGraph

Class AbstractGraphAbstract

Extends EventSource to implement a graph component for the browser. This is the entry point class of the package.

To activate panning and connections use setPanning and setConnectable. For rubberband selection you must create a new instance of rubberband.

The following listeners are added to mouseListeners by default:

  • tooltipHandler: TooltipHandler that displays tooltips
  • panningHandler: PanningHandler for panning and popup menus
  • connectionHandler: ConnectionHandler for creating connections
  • selectionHandler: SelectionHandler for moving and cloning cells

These listeners will be called in the above order if they are enabled.

Hierarchy (View Summary)

  • EventSource
    • AbstractGraph
      • BaseGraph
      • Graph
  • Defined in view/AbstractGraph.ts:77
  • Defined in view/mixin/CellsMixin.type.ts:30
  • Defined in view/mixin/ConnectionsMixin.type.ts:24
  • Defined in view/mixin/DragDropMixin.type.ts:20
  • Defined in view/mixin/EdgeMixin.type.ts:21
  • Defined in view/mixin/EditingMixin.type.ts:22
  • Defined in view/mixin/EventsMixin.type.ts:25
  • Defined in view/mixin/FoldingMixin.type.ts:23
  • Defined in view/mixin/GroupingMixin.type.ts:21
  • Defined in view/mixin/LabelMixin.type.ts:20
  • Defined in view/mixin/OverlaysMixin.type.ts:22
  • Defined in view/mixin/OrderMixin.type.ts:20
  • Defined in view/mixin/PageBreaksMixin.type.ts:20
  • Defined in view/mixin/PanningMixin.type.ts:21
  • Defined in view/mixin/PortsMixin.type.ts:20
  • Defined in view/mixin/SelectionMixin.type.ts:22
  • Defined in view/mixin/SnapMixin.type.ts:21
  • Defined in view/mixin/SwimlaneMixin.type.ts:22
  • Defined in view/mixin/TerminalMixin.type.ts:20
  • Defined in view/mixin/ValidationMixin.type.ts:21
  • Defined in view/mixin/VertexMixin.type.ts:22
  • Defined in view/mixin/ZoomMixin.type.ts:20
Index

Constructors

constructor

Properties

addAllEdges addCell addCellOverlay addCells addEdge addMouseListener addSelectionCell addSelectionCells alignCells allowAutoPanning allowDanglingEdges allowLoops allowNegativeCoordinates alreadyConnectedResource alternateEdgeStyle autoExtend autoScroll autoSizeCell autoSizeCells autoSizeCellsOnAdd backgroundImage border canExportCell canImportCell cellConnected cellLabelChanged cellRenderer cellResized cells cellsAdded cellsBendable cellsCloneable cellsDeletable cellsDisconnectable cellsEditable cellsFolded cellSizeUpdated cellsLocked cellsMovable cellsMoved cellsOrdered cellsRemoved cellsResizable cellsResized cellsSelectable cellsToggled centerZoom clearCellOverlays clearSelection click cloneCell cloneCells cloneInvalidEdges collapseExpandResource connectableEdges connectCell constrainChild constrainChildCells constrainChildren constrainRelativeChildren consumeMouseEvent container containsValidationErrorsResource createEdge createGroupCell dblClick defaultLoopStyle defaultOverlap defaultParent destroyed dialect disconnectGraph disconnectOnMove doneResource doubleClickCounter doubleTapEnabled doubleTapTimeout doubleTapTolerance dropEnabled edgeLabelsMovable enabled enterGroup enterStopsCellEditing escape escapeEnabled eventListeners eventsEnabled eventSource exitGroup exportEnabled extendParent extendParents extendParentsOnAdd extendParentsOnMove fireDoubleClick fireGestureEvent fireMouseEvent flipEdge foldCells getActualStartSize getAllConnectionConstraints getAllEdges getBoundingBox getBoundingBoxFromGeometry getBoundsForGroup getCellAt getCellBounds getCellContainmentArea getCellOverlays getCells getCellsBeyond getCellsForGroup getCellsForUngroup getCellStyle getCellValidationError getChildCells getChildEdges getChildVertices getCloneableCells getCollapseExpandResource getConnectionConstraint getConnectionPoint getConnections getCurrentCellStyle getCursorForCell getCursorForMouseEvent getDeletableCells getDropTarget getEdges getEdgesBetween getEdgeValidationError getEditingValue getEventState getEventTolerance getExportableCells getFoldableCells getFoldingImage getGridSize getImportableCells getIncomingEdges getLabel getMovableCells getOpposites getOutgoingEdges getOutlineConstraint getPanDx getPanDy getPointForEvent getPreferredSizeForCell getSelectionCell getSelectionCells getSelectionCellsForChanges getSelectionCount getSelectionModel getSnapTolerance getStartSize getStateForTouchEvent getSwimlane getSwimlaneAt getSwimlaneDirection getTerminalForPort graphModelChangeListener gridEnabled gridSize groupCells hitsSwimlaneContent horizontalPageBreaks htmlLabels ignoreMouseEvents ignoreScrollbars importCells importEnabled initialTouchX initialTouchY intersects invokesStopCellEditing isAllowAutoPanning isAllowDanglingEdges isAllowNegativeCoordinates isAutoExtend isAutoScroll isAutoSizeCell isAutoSizeCells isCellBendable isCellCloneable isCellDeletable isCellDisconnectable isCellEditable isCellFoldable isCellLocked isCellMovable isCellResizable isCellRotatable isCellsBendable isCellsCloneable isCellsDeletable isCellsDisconnectable isCellsEditable isCellSelectable isCellSelected isCellsLocked isCellsMovable isCellsResizable isCellsSelectable isCloneEvent isCloneInvalidEdges isConnectable isConnectableEdges isConstrainChild isConstrainChildren isConstrainedEvent isConstrainedMoving isConstrainRelativeChildren isDisconnectOnMove isDropEnabled isEdgeLabelsMovable isEdgeValid isEditing isEnterStopsCellEditing isEscapeEnabled isEventIgnored isEventSourceIgnored isExtendParent isExtendParents isExtendParentsOnAdd isExtendParentsOnMove isFoldingEnabled isGridEnabled isGridEnabledEvent isHtmlLabel isHtmlLabels isIgnoreTerminalEvent isInvokesStopCellEditing isLabelClipped isLabelMovable isLabelsVisible isMouseDown isMouseTrigger isNativeDblClickEnabled isPort isPortsEnabled isResetEdgesOnConnect isResetEdgesOnMove isResetEdgesOnResize isSelectionEmpty isSiblingSelected isSplitEnabled isSplitTarget isSwimlane isSwimlaneNesting isSwimlaneSelectionEnabled isSyntheticEventIgnored isTerminalPointMovable isTimerAutoScroll isToggleEvent isTransparentClickEvent isUseScrollbarsForPanning isValidAncestor isValidConnection isValidDropTarget isValidSource isValidTarget isVertexLabelsMovable isWrapping keepEdgesInBackground keepEdgesInForeground keepSelectionVisibleOnZoom labelChanged labelsVisible lastEvent lastMouseX lastMouseY lastTouchCell lastTouchEvent lastTouchTime lastTouchX lastTouchY maximumContainerSize maximumGraphBounds minimumContainerSize minimumGraphSize minPageBreakDist model mouseListeners mouseMoveRedirect mouseUpRedirect moveCells multigraph multiplicities nativeDblClickEnabled options orderCells pageBreakColor pageBreakDashed pageBreaksVisible pageFormat pageScale pageVisible paintBackground panDx panDy panGraph portsEnabled postProcessCellStyle preferPageSize recursiveResize removeCellOverlay removeCellOverlays removeCells removeCellsAfterUngroup removeCellsFromParent removeMouseListener removeSelectionCell removeSelectionCells removeStateForCell renderHint resetEdge resetEdges resetEdgesOnConnect resetEdgesOnMove resetEdgesOnResize resetViewOnRootChange resizeCell resizeCells resizeChildCells resizeContainer scaleCell scrollCellToVisible scrollRectToVisible selectAll selectCell selectCellForEvent selectCells selectCellsForEvent selectChildCell selectEdges selectionModel selectNextCell selectParentCell selectPreviousCell selectRegion selectVertices setAllowDanglingEdges setAllowNegativeCoordinates setAutoSizeCells setCellsBendable setCellsCloneable setCellsDeletable setCellsDisconnectable setCellsEditable setCellsLocked setCellsMovable setCellsResizable setCellsSelectable setCellStyle setCellStyleFlags setCellStyles setCellWarning setCloneInvalidEdges setConnectable setConnectableEdges setConnectionConstraint setConstrainChildren setConstrainRelativeChildren setDisconnectOnMove setDropEnabled setEdgeLabelsMovable setEnterStopsCellEditing setEscapeEnabled setEventTolerance setExtendParents setExtendParentsOnAdd setExtendParentsOnMove setGridEnabled setGridSize setHtmlLabels setInvokesStopCellEditing setPanDx setPanDy setPanning setPortsEnabled setSelectionCell setSelectionCells setSelectionModel setSplitEnabled setSwimlaneNesting setSwimlaneSelectionEnabled setVertexLabelsMovable shiftPreview1 shiftPreview2 singleSelection sizeDidChange snap snapDelta snapTolerance splitEdge splitEnabled startEditing startEditingAtCell stopEditing stylesheet swapBounds swimlaneIndicatorColorAttribute swimlaneNesting swimlaneSelectionEnabled tapAndHold tapAndHoldDelay tapAndHoldEnabled tapAndHoldInProgress tapAndHoldThread tapAndHoldValid timerAutoScroll toggleCells toggleCellStyle toggleCellStyleFlags toggleCellStyles tolerance translateCell translateToScrollPosition ungroupCells updateAlternateBounds updateCellSize updateGroupBounds updateMouseEvent updatePageBreaks updateSelection updatingSelectionResource useScrollbarsForPanning validateCell validateEdge validateGraph validationAlert vertexLabelsMovable verticalPageBreaks view warningImage zoom zoomActual zoomFactor zoomIn zoomOut zoomTo zoomToRect

Methods

addListener batchUpdate center convertValueToString createVertex destroy doResizeContainer fireEvent getAlreadyConnectedResource getBackgroundImage getBorder getBorderSizes getCellRenderer getChildOffsetForCell getContainer getContainsValidationErrorsResource getCurrentRoot getDataModel getDefaultParent getDialect getEventSource getGraphBounds getLinkForCell getMaximumGraphBounds getMinimumContainerSize getMinimumGraphSize getMinPageBreakDist getOverlap getPageBreakColor getPageFormat getPageScale getPlugin getPreferredPageSize getStylesheet getTranslateForRoot getView getWarningImage graphModelChanged home initializeCollaborators insertEdge insertVertex isAllowLoops isAllowOverlapParent isEnabled isEventsEnabled isExportEnabled isIgnoreScrollbars isImportEnabled isMultigraph isOrthogonal isPageBreakDashed isPageBreaksVisible isPageVisible isPreferPageSize isRecursiveResize isResizeContainer isTranslateToScrollPosition isValidRoot processChange refresh registerDefaults removeListener scrollPointToVisible setAllowLoops setBackgroundImage setBorder setDefaultParent setEnabled setEventsEnabled setEventSource setMinimumContainerSize setMinimumGraphSize setMultigraph setRecursiveResize setResizeContainer setStylesheet setTooltips

Constructors

constructor

  • new AbstractGraph(options?: GraphOptions): AbstractGraph

    Parameters

    • Optionaloptions: GraphOptions

    Returns AbstractGraph

    Overrides EventSource.constructor

    • Defined in view/AbstractGraph.ts:434

Properties

addAllEdges

addAllEdges: (cells: Cell[]) => Cell[]

Returns an array with the given cells and all edges that are connected to a cell or one of its descendants.

  • Defined in view/mixin/EdgeMixin.type.ts:238

addCell

addCell: (
    cell: Cell,
    parent?: Cell | null,
    index?: number | null,
    source?: Cell | null,
    target?: Cell | null,
) => Cell

Adds the cell to the parent and connects it to the given source and target terminals.

This is a shortcut method.

Type Declaration

    • (
          cell: Cell,
          parent?: Cell | null,
          index?: number | null,
          source?: Cell | null,
          target?: Cell | null,
      ): Cell
    • Parameters

      • cell: Cell

        Cell to be inserted into the given parent.

      • Optionalparent: Cell | null

        Cell that represents the new parent. If no parent is given then the default parent is used.

      • Optionalindex: number | null

        Optional index to insert the cells at. Default is 'to append'.

      • Optionalsource: Cell | null

        Optional Cell that represents the source terminal.

      • Optionaltarget: Cell | null

        Optional Cell that represents the target terminal.

      Returns Cell

      the cell that was added.

  • Defined in view/mixin/CellsMixin.type.ts:305

addCellOverlay

addCellOverlay: (cell: Cell, overlay: CellOverlay) => CellOverlay

Adds an CellOverlay for the specified cell.

This method fires an InternalEvent.ADD_OVERLAY event and returns the new CellOverlay.

Type Declaration

    • (cell: Cell, overlay: CellOverlay): CellOverlay
    • Parameters

      • cell: Cell

        Cell to add the overlay for.

      • overlay: CellOverlay

        CellOverlay to be added for the cell.

      Returns CellOverlay

  • Defined in view/mixin/OverlaysMixin.type.ts:31

addCells

addCells: (
    cells: Cell[],
    parent?: Cell | null,
    index?: number | null,
    source?: Cell | null,
    target?: Cell | null,
    absolute?: boolean,
) => Cell[]

Adds the cells to the parent at the given index, connecting each cell to the optional source and target terminal. The change is carried out using cellsAdded. This method fires InternalEvent.ADD_CELLS while the transaction is in progress. Returns the cells that were added.

Type Declaration

    • (
          cells: Cell[],
          parent?: Cell | null,
          index?: number | null,
          source?: Cell | null,
          target?: Cell | null,
          absolute?: boolean,
      ): Cell[]
    • Parameters

      • cells: Cell[]

        Array of Cells to be inserted.

      • Optionalparent: Cell | null

        Cell that represents the new parent. If no parent is given then the default parent is used. Default is null.

      • Optionalindex: number | null

        Optional index to insert the cells at. Default is null (append).

      • Optionalsource: Cell | null

        Optional source Cell for all inserted cells. Default is null.

      • Optionaltarget: Cell | null

        Optional target Cell for all inserted cells. Default is null.

      • Optionalabsolute: boolean

        Optional boolean indicating of cells should be kept at their absolute position. Default is false.

      Returns Cell[]

  • Defined in view/mixin/CellsMixin.type.ts:326

addEdge

addEdge: (
    edge: Cell,
    parent: Cell | null,
    source: Cell | null,
    target: Cell | null,
    index?: number | null,
) => Cell

Adds the edge to the parent and connects it to the given source and target terminals. This is a shortcut method.

Type Declaration

    • (
          edge: Cell,
          parent: Cell | null,
          source: Cell | null,
          target: Cell | null,
          index?: number | null,
      ): Cell
    • Parameters

      • edge: Cell

        Cell to be inserted into the given parent.

      • parent: Cell | null

        Cell that represents the new parent. If no parent is given then the default parent is used.

      • source: Cell | null

        Optional Cell that represents the source terminal.

      • target: Cell | null

        Optional Cell that represents the target terminal.

      • Optionalindex: number | null

        Optional index to insert the cells at. Default is 'to append'.

      Returns Cell

      The edge that was added.

  • Defined in view/mixin/EdgeMixin.type.ts:227

addMouseListener

addMouseListener: (listener: MouseListenerSet) => void

Adds a listener to the graph event dispatch loop.

The listener must implement the mouseDown, mouseMove and mouseUp methods as shown in the InternalMouseEvent class.

Type Declaration

    • (listener: MouseListenerSet): void
    • Parameters

      • listener: MouseListenerSet

        Listener to be added to the graph event listeners.

      Returns void

  • Defined in view/mixin/EventsMixin.type.ts:241

addSelectionCell

addSelectionCell: (cell: Cell) => void

Adds the given cell to the selection.

Type Declaration

    • (cell: Cell): void
    • Parameters

      • cell: Cell

        Cell to be add to the selection.

      Returns void

  • Defined in view/mixin/SelectionMixin.type.ts:90

addSelectionCells

addSelectionCells: (cells: Cell[]) => void

Adds the given cells to the selection.

Type Declaration

    • (cells: Cell[]): void
    • Parameters

      • cells: Cell[]

        Array of Cell to be added to the selection.

      Returns void

  • Defined in view/mixin/SelectionMixin.type.ts:97

alignCells

alignCells: (
    align: VAlignValue | AlignValue,
    cells?: Cell[],
    param?: number | null,
) => void

Aligns the given cells vertically or horizontally according to the given alignment using the optional parameter as the coordinate.

Type Declaration

    • (align: VAlignValue | AlignValue, cells?: Cell[], param?: number | null): void
    • Parameters

      • align: VAlignValue | AlignValue

        Specifies the alignment.

      • Optionalcells: Cell[]

        Array of Cell to be aligned.

      • Optionalparam: number | null

        Optional coordinate for the alignment.

      Returns void

  • Defined in view/mixin/CellsMixin.type.ts:255

allowAutoPanning

allowAutoPanning: boolean

Specifies if panning via panGraph should be allowed to implement autoscroll if no scrollbars are available in scrollPointToVisible.

To enable panning inside the container, near the edge, set PanningManager.border to a positive value.

Default

false
  • Defined in view/mixin/PanningMixin.type.ts:53

allowDanglingEdges

allowDanglingEdges: boolean

Specifies if edges with disconnected terminals are allowed in the graph.

Default

true
  • Defined in view/mixin/EdgeMixin.type.ts:50

allowLoops

allowLoops: boolean = false

Specifies if loops (aka self-references) are allowed.

Default

false
  • Defined in view/AbstractGraph.ts:372

allowNegativeCoordinates

allowNegativeCoordinates: boolean

Specifies if negative coordinates for vertices are allowed.

Default

true
  • Defined in view/mixin/VertexMixin.type.ts:32

alreadyConnectedResource

alreadyConnectedResource: string = ...

Specifies the resource key for the error message to be displayed in non-multigraphs when two vertices are already connected. If the resource for this key does not exist then the value is used as the error message.

Default

'alreadyConnected'
  • Defined in view/AbstractGraph.ts:395

alternateEdgeStyle

alternateEdgeStyle: CellStyle = {}

Specifies the alternate edge style to be used if the main control point on an edge is being double-clicked.

Default

{}
  • Defined in view/AbstractGraph.ts:102

autoExtend

autoExtend: boolean

Specifies if the size of the graph should be automatically extended if the mouse goes near the container edge while dragging.

This is only taken into account if the container has scrollbars.

See autoScroll.

Default

true
  • Defined in view/mixin/DragDropMixin.type.ts:58

autoScroll

autoScroll: boolean

Specifies if the graph should automatically scroll if the mouse goes near the container edge while dragging.

This is only taken into account if the container has scrollbars.

If you need this to work without scrollbars then set ignoreScrollbars to true. Please consult the ignoreScrollbars for details. In general, with no scrollbars, the use of allowAutoPanning is recommended.

Default

true
  • Defined in view/mixin/DragDropMixin.type.ts:47

autoSizeCell

autoSizeCell: (cell: Cell, recurse?: boolean) => void

Resizes the specified cell to just fit around its label and/or children.

Type Declaration

    • (cell: Cell, recurse?: boolean): void
    • Parameters

      • cell: Cell

        Cell to be resized.

      • Optionalrecurse: boolean

        Optional boolean which specifies if all descendants should be auto-sized. Default is true.

      Returns void

  • Defined in view/mixin/CellsMixin.type.ts:365

autoSizeCells

autoSizeCells: boolean

Specifies if the graph should automatically update the cell size after an edit. This is used in isAutoSizeCell.

Default

false
  • Defined in view/mixin/CellsMixin.type.ts:60

autoSizeCellsOnAdd

autoSizeCellsOnAdd: boolean

Specifies if autoSize style should be applied when cells are added.

Default

false
  • Defined in view/mixin/CellsMixin.type.ts:66

backgroundImage

backgroundImage: ImageBox | null = null

Specifies the Image to be returned by getBackgroundImage.

Default

null

Example

var img = new mxImage('http://www.example.com/maps/examplemap.jpg', 1024, 768);
graph.setBackgroundImage(img);
graph.view.validate();
  • Defined in view/AbstractGraph.ts:216

border

border: number = 0

Border to be added to the bottom and right side when the container is being resized after the graph has been changed.

Default

0
  • Defined in view/AbstractGraph.ts:337

canExportCell

canExportCell: (cell: Cell | null) => boolean

Returns true if the given cell may be exported to the clipboard.

This implementation returns exportEnabled for all cells.

Type Declaration

    • (cell: Cell | null): boolean
    • Parameters

      • cell: Cell | null

        Cell that represents the cell to be exported.

      Returns boolean

  • Defined in view/mixin/CellsMixin.type.ts:802

canImportCell

canImportCell: (cell: Cell | null) => boolean

Returns true if the given cell may be imported from the clipboard.

This implementation returns importEnabled for all cells.

Type Declaration

    • (cell: Cell | null): boolean
    • Parameters

      • cell: Cell | null

        Cell that represents the cell to be imported.

      Returns boolean

  • Defined in view/mixin/CellsMixin.type.ts:816

cellConnected

cellConnected: (
    edge: Cell,
    terminal: Cell | null,
    source: boolean,
    constraint?: ConnectionConstraint | null,
) => void

Sets the new terminal for the given edge and resets the edge points if resetEdgesOnConnect is true.

This method fires InternalEvent.CELL_CONNECTED while the transaction is in progress.

Type Declaration

    • (
          edge: Cell,
          terminal: Cell | null,
          source: boolean,
          constraint?: ConnectionConstraint | null,
      ): void
    • Parameters

      • edge: Cell

        Cell whose terminal should be updated.

      • terminal: Cell | null

        Cell that represents the new terminal to be used.

      • source: boolean

        Boolean indicating if the new terminal is the source or target. Default is false.

      • Optionalconstraint: ConnectionConstraint | null

        ConnectionConstraint to be used for this connection.

      Returns void

  • Defined in view/mixin/ConnectionsMixin.type.ts:138

cellLabelChanged

cellLabelChanged: (cell: Cell, value: any, autoSize: boolean) => void

Sets the new label for a cell. If autoSize is true, then cellSizeUpdated will be called.

In the following example, the function is extended to map changes to attributes in an XML node, as shown in convertValueToString. Alternatively, the handling of this can be implemented as shown in GraphDataModel.valueForCellChanged without the need to clone the user object.

const graphCellLabelChanged = graph.cellLabelChanged;
graph.cellLabelChanged = function(cell, newValue, autoSize) {
// Cloned for correct undo/redo
const elt = cell.value.cloneNode(true);
elt.setAttribute('label', newValue);

newValue = elt;
graphCellLabelChanged.apply(this, arguments);
};

Type Declaration

    • (cell: Cell, value: any, autoSize: boolean): void
    • Parameters

      • cell: Cell

        Cell whose label should be changed.

      • value: any

        New label to be assigned.

      • autoSize: boolean

        Boolean that specifies if cellSizeUpdated should be called.

      Returns void

  • Defined in view/mixin/EditingMixin.type.ts:96

cellRenderer

cellRenderer: CellRenderer

Holds the CellRenderer for rendering the cells in the graph.

  • Defined in view/AbstractGraph.ts:178

cellResized

cellResized: (
    cell: Cell,
    bounds: Rectangle,
    ignoreRelative: boolean,
    recurse: boolean,
) => Geometry | null

Resizes the parents recursively so that they contain the complete area of the resized child cell.

Type Declaration

    • (
          cell: Cell,
          bounds: Rectangle,
          ignoreRelative: boolean,
          recurse: boolean,
      ): Geometry | null
    • Parameters

      • cell: Cell

        Cell whose bounds should be changed.

      • bounds: Rectangle

        Rectangles that represent the new bounds.

      • ignoreRelative: boolean

        Boolean that indicates if relative cells should be ignored. Default is false.

      • recurse: boolean

        Optional boolean that specifies if the children should be resized. Default is false.

      Returns Geometry | null

  • Defined in view/mixin/CellsMixin.type.ts:518

cells

cells: Cell[] = []
  • Defined in view/AbstractGraph.ts:104

cellsAdded

cellsAdded: (
    cells: Cell[],
    parent: Cell,
    index: number,
    source: Cell | null,
    target: Cell | null,
    absolute: boolean,
    constrain?: boolean,
    extend?: boolean,
) => void

Adds the specified cells to the given parent. This method fires Event#CELLS_ADDED while the transaction is in progress.

Type Declaration

    • (
          cells: Cell[],
          parent: Cell,
          index: number,
          source: Cell | null,
          target: Cell | null,
          absolute: boolean,
          constrain?: boolean,
          extend?: boolean,
      ): void
    • Parameters

      • cells: Cell[]

        Array of Cells to be added.

      • parent: Cell

        Cell that represents the new parent.

      • index: number

        Index to insert the cells at.

      • source: Cell | null

        Source Cell for all added cells, or null to not connect them.

      • target: Cell | null

        Target Cell for all added cells, or null to not connect them.

      • absolute: boolean

        Boolean indicating if the cells should be kept at their absolute position.

      • Optionalconstrain: boolean

        Optional boolean indicating if constrainChild should be called for each added cell. Default is true.

      • Optionalextend: boolean

        Optional boolean indicating if extendParent should be called for each added cell. Only applies when isExtendParentsOnAdd and isExtendParent are enabled. Default is true.

      Returns void

  • Defined in view/mixin/CellsMixin.type.ts:348

cellsBendable

cellsBendable: boolean

Specifies the return value for isCellsBendable.

Default

true
  • Defined in view/mixin/CellsMixin.type.ts:41

cellsCloneable

cellsCloneable: boolean

Specifies the return value for isCellCloneable.

Default

true
  • Defined in view/mixin/CellsMixin.type.ts:78

cellsDeletable

cellsDeletable: boolean

Specifies the return value for isCellDeletable.

Default

true
  • Defined in view/mixin/CellsMixin.type.ts:84

cellsDisconnectable

cellsDisconnectable: boolean

Specifies the return value for isCellsDisconnectable.

Default

true
  • Defined in view/mixin/CellsMixin.type.ts:53
  • Defined in view/mixin/ConnectionsMixin.type.ts:43

cellsEditable

cellsEditable: boolean

Default

true
  • Defined in view/mixin/EditingMixin.type.ts:26

cellsFolded

cellsFolded: (
    cells: Cell[] | null,
    collapse: boolean,
    recurse: boolean,
    checkFoldable?: boolean,
) => void

Sets the collapsed state of the specified cells.

This method fires InternalEvent.CELLS_FOLDED while the transaction is in progress.

Returns the cells whose collapsed state was changed.

Type Declaration

    • (
          cells: Cell[] | null,
          collapse: boolean,
          recurse: boolean,
          checkFoldable?: boolean,
      ): void
    • Parameters

      • cells: Cell[] | null

        Array of Cell whose collapsed state should be set. Default is null.

      • collapse: boolean

        Boolean indicating the collapsed state to be assigned. Default is false.

      • recurse: boolean

        Boolean indicating if the collapsed state of all descendants should be set. Default is false.

      • OptionalcheckFoldable: boolean

        Optional boolean indicating of isCellFoldable should be checked. Default is false.

      Returns void

  • Defined in view/mixin/FoldingMixin.type.ts:92

cellSizeUpdated

cellSizeUpdated: (cell: Cell, ignoreChildren: boolean) => void

Updates the size of the given cell in the model using getPreferredSizeForCell to get the new size.

Type Declaration

    • (cell: Cell, ignoreChildren: boolean): void
    • Parameters

      • cell: Cell

        Cell for which the size should be changed.

      • ignoreChildren: boolean

        if true, ignore the children of the cell when computing the size of the cell. Default is false.

      Returns void

  • Defined in view/mixin/CellsMixin.type.ts:422

cellsLocked

cellsLocked: boolean

Specifies the return value for isCellLocked.

Default

false
  • Defined in view/mixin/CellsMixin.type.ts:72

cellsMovable

cellsMovable: boolean

Specifies the return value for isCellMovable.

Default

true
  • Defined in view/mixin/CellsMixin.type.ts:90

cellsMoved

cellsMoved: (
    cells: Cell[],
    dx: number,
    dy: number,
    disconnect: boolean,
    constrain: boolean,
    extend?: boolean | null,
) => void

Moves the specified cells by the given vector, disconnecting the cells using disconnectGraph is disconnect is true.

This method fires InternalEvent.CELLS_MOVED while the transaction is in progress.

  • Defined in view/mixin/CellsMixin.type.ts:613

cellsOrdered

cellsOrdered: (cells: Cell[], back: boolean) => void

Moves the given cells to the front or back.

This method fires InternalEvent.CELLS_ORDERED while the transaction is in progress.

Type Declaration

    • (cells: Cell[], back: boolean): void
    • Parameters

      • cells: Cell[]

        Array of Cell whose order should be changed.

      • back: boolean

        Boolean that specifies if the cells should be moved to back. Default is false.

      Returns void

  • Defined in view/mixin/OrderMixin.type.ts:39

cellsRemoved

cellsRemoved: (cells: Cell[]) => void

Removes the given cells from the model. This method fires InternalEvent.CELLS_REMOVED while the transaction is in progress.

Type Declaration

    • (cells: Cell[]): void
    • Parameters

      • cells: Cell[]

        Array of Cell to remove.

      Returns void

  • Defined in view/mixin/CellsMixin.type.ts:384

cellsResizable

cellsResizable: boolean

Specifies the return value for isCellsResizable.

Default

true
  • Defined in view/mixin/CellsMixin.type.ts:35

cellsResized

cellsResized: (cells: Cell[], bounds: Rectangle[], recurse: boolean) => void

Sets the bounds of the given cells and fires a InternalEvent.CELLS_RESIZED event. If extendParents is true, then the parent is extended if a child size is changed so that it overlaps with the parent.

The following example shows how to control group resizes to make sure that all child cells stay within the group.

graph.addListener(InternalEvent.CELLS_RESIZED, function(sender, evt) {
const cells = evt.getProperty('cells');

if (cells) {
for (const cell of cells) {
if (graph.getDataModel().getChildCount(cell) > 0) {
let geo = cell.getGeometry();

if (geo) {
const children = graph.getChildCells(cell, true, true);
const bounds = graph.getBoundingBoxFromGeometry(children, true);

geo = geo.clone();
geo.width = Math.max(geo.width, bounds.width);
geo.height = Math.max(geo.height, bounds.height);

graph.getDataModel().setGeometry(cell, geo);
}
}
}
}
});

Type Declaration

    • (cells: Cell[], bounds: Rectangle[], recurse: boolean): void
    • Parameters

      • cells: Cell[]

        Array of Cell whose bounds should be changed.

      • bounds: Rectangle[]

        Array of Rectangles that represent the new bounds.

      • recurse: boolean

        Optional boolean that specifies if the children should be resized. Default is false.

      Returns void

  • Defined in view/mixin/CellsMixin.type.ts:508

cellsSelectable

cellsSelectable: boolean

Specifies the return value for isCellsSelectable.

Default

true
  • Defined in view/mixin/CellsMixin.type.ts:47

cellsToggled

cellsToggled: (cells: Cell[], show: boolean) => void

Sets the visible state of the specified cells.

Type Declaration

    • (cells: Cell[], show: boolean): void
    • Parameters

      • cells: Cell[]

        Array of Cell whose visible state should be changed.

      • show: boolean

        Boolean that specifies the visible state to be assigned.

      Returns void

  • Defined in view/mixin/CellsMixin.type.ts:404

centerZoom

centerZoom: boolean

Specifies if the zoom operations should go into the center of the actual diagram rather than going from top, left.

Default

true
  • Defined in view/mixin/ZoomMixin.type.ts:38

clearCellOverlays

clearCellOverlays: (cell: Cell | null) => void

Removes all CellOverlays in the graph for the given cell and all its descendants.

If no cell is specified then all overlays are removed from the graph.

This implementation uses removeCellOverlays to remove the overlays from the individual cells.

Type Declaration

    • (cell: Cell | null): void
    • Parameters

      • cell: Cell | null

        Optional Cell that represents the root of the subtree to remove the overlays from. Default is the root in the model.

      Returns void

  • Defined in view/mixin/OverlaysMixin.type.ts:71

clearSelection

clearSelection: () => void

Clears the selection using GraphSelectionModel.clear.

  • Defined in view/mixin/SelectionMixin.type.ts:54

click

click: (me: InternalMouseEvent) => boolean

Processes a single click on an optional cell and fires a click event. The click event is fired initially. If the graph is enabled and the event has not been consumed, then the cell is selected using selectCellForEvent or the selection is cleared using clearSelection.

The events consumed state is set to true if the corresponding InternalMouseEvent has been consumed.

To handle a click event, use the following code.

graph.addListener(InternalEvent.CLICK, function(sender, evt) {
const e = evt.getProperty('event'); // mouse event
const cell = evt.getProperty('cell'); // cell may be null

if (cell) {
// Do something useful with cell and consume the event
evt.consume();
}
});

Type Declaration

    • (me: InternalMouseEvent): boolean
    • Parameters

      • me: InternalMouseEvent

        mxMouseEvent that represents the single click.

      Returns boolean

  • Defined in view/mixin/EventsMixin.type.ts:190

cloneCell

cloneCell: (
    cell: Cell,
    allowInvalidEdges?: boolean,
    mapping?: any,
    keepPosition?: boolean,
) => Cell

Returns the clone for the given cell. Uses cloneCells.

Type Declaration

    • (
          cell: Cell,
          allowInvalidEdges?: boolean,
          mapping?: any,
          keepPosition?: boolean,
      ): Cell
    • Parameters

      • cell: Cell

        Cell to be cloned.

      • OptionalallowInvalidEdges: boolean

        Optional boolean that specifies if invalid edges should be cloned. Default is true.

      • Optionalmapping: any

        Optional mapping for existing clones.

      • OptionalkeepPosition: boolean

        Optional boolean indicating if the position of the cells should be updated to reflect the lost parent cell. Default is false.

      Returns Cell

  • Defined in view/mixin/CellsMixin.type.ts:269

cloneCells

cloneCells: (
    cells: Cell[],
    allowInvalidEdges?: boolean,
    mapping?: any,
    keepPosition?: boolean,
) => Cell[]

Returns the clones for the given cells. The clones are created recursively using cloneCells.

If the terminal of an edge is not in the given array, then the respective end is assigned a terminal point and the terminal is removed.

Type Declaration

    • (
          cells: Cell[],
          allowInvalidEdges?: boolean,
          mapping?: any,
          keepPosition?: boolean,
      ): Cell[]
    • Parameters

      • cells: Cell[]

        Array of Cell to be cloned.

      • OptionalallowInvalidEdges: boolean

        Optional boolean that specifies if invalid edges should be cloned. Default is true.

      • Optionalmapping: any

        Optional mapping for existing clones.

      • OptionalkeepPosition: boolean

        Optional boolean indicating if the position of the cells should be updated to reflect the lost parent cell. Default is false.

      Returns Cell[]

  • Defined in view/mixin/CellsMixin.type.ts:286

cloneInvalidEdges

cloneInvalidEdges: boolean

Specifies if edges that are cloned should be validated and only inserted if they are valid.

Default

false
  • Defined in view/mixin/EdgeMixin.type.ts:57

collapseExpandResource

collapseExpandResource: string

Specifies the resource key for the tooltip on the collapse/expand icon. If the resource for this key does not exist then the value is used as the tooltip.

Default

'collapse-expand' is Client.language is not 'none'. Else, it is an empty string.

  • Defined in view/mixin/FoldingMixin.type.ts:30

connectableEdges

connectableEdges: boolean

Specifies if edges are connectable. This overrides the connectable field in edges.

Default

false
  • Defined in view/mixin/EdgeMixin.type.ts:44

connectCell

connectCell: (
    edge: Cell,
    terminal: Cell | null,
    source: boolean,
    constraint?: ConnectionConstraint | null,
) => Cell

Connects the specified end of the given edge to the given terminal using cellConnected and fires InternalEvent.CONNECT_CELL while the transaction is in progress.

Type Declaration

    • (
          edge: Cell,
          terminal: Cell | null,
          source: boolean,
          constraint?: ConnectionConstraint | null,
      ): Cell
    • Parameters

      • edge: Cell

        Cell whose terminal should be updated.

      • terminal: Cell | null

        Cell that represents the new terminal to be used.

      • source: boolean

        Boolean indicating if the new terminal is the source or target. Default is false.

      • Optionalconstraint: ConnectionConstraint | null

        Optional ConnectionConstraint to be used for this connection.

      Returns Cell

      the updated edge.

  • Defined in view/mixin/ConnectionsMixin.type.ts:121

constrainChild

constrainChild: (cell: Cell, sizeFirst?: boolean) => void

Keeps the given cell inside the bounds returned by getCellContainmentArea for its parent, according to the rules defined by getOverlap and isConstrainChild.

This modifies the cell's geometry in-place and does not clone it.

Type Declaration

    • (cell: Cell, sizeFirst?: boolean): void
    • Parameters

      • cell: Cell

        Cell which should be constrained.

      • OptionalsizeFirst: boolean

        Specifies if the size should be changed first. Default is true.

      Returns void

  • Defined in view/mixin/CellsMixin.type.ts:643

constrainChildCells

constrainChildCells: (cell: Cell) => void

Constrains the children of the given cell using constrainChild.

Type Declaration

    • (cell: Cell): void
    • Parameters

      • cell: Cell

        Cell that has been resized.

      Returns void

  • Defined in view/mixin/CellsMixin.type.ts:538

constrainChildren

constrainChildren: boolean

Specifies if a child should be constrained inside the parent bounds after a move or resize of the child.

Default

true
  • Defined in view/mixin/ConnectionsMixin.type.ts:29

constrainRelativeChildren

constrainRelativeChildren: boolean

Specifies if child cells with relative geometries should be constrained inside the parent bounds, if constrainChildren is true, and/or the maximumGraphBounds.

Default

false
  • Defined in view/mixin/ConnectionsMixin.type.ts:35

consumeMouseEvent

consumeMouseEvent: (
    evtName: string,
    me: InternalMouseEvent,
    sender: EventSource,
) => void

Consumes the given InternalMouseEvent if it's a touchStart event.

  • Defined in view/mixin/EventsMixin.type.ts:322

container

container: HTMLElement
  • Defined in view/AbstractGraph.ts:78

containsValidationErrorsResource

containsValidationErrorsResource: string = ...

Specifies the resource key for the warning message to be displayed when a collapsed cell contains validation errors. If the resource for this key does not exist then the value is used as the warning message.

Default

'containsValidationErrors'
  • Defined in view/AbstractGraph.ts:403

createEdge

createEdge: (
    parent?: Cell | null,
    id?: string,
    value?: any,
    source?: Cell | null,
    target?: Cell | null,
    style?: CellStyle,
) => Cell

Hook method that creates the new edge for insertEdge.

This implementation does not set the source and target of the edge, these are set when the edge is added to the model.

Type Declaration

    • (
          parent?: Cell | null,
          id?: string,
          value?: any,
          source?: Cell | null,
          target?: Cell | null,
          style?: CellStyle,
      ): Cell
    • Parameters

      • Optionalparent: Cell | null

        Cell that specifies the parent of the new edge. If not set, use the default parent.

      • Optionalid: string

        Optional string that defines the Id of the new edge. If not set, the id is auto-generated when creating the vertex.

      • Optionalvalue: any

        Object to be used as the user object which is generally used to display the label of the edge. The default implementation handles string object.

      • Optionalsource: Cell | null

        Cell that defines the source of the edge.

      • Optionaltarget: Cell | null

        Cell that defines the target of the edge.

      • Optionalstyle: CellStyle

        Optional object that defines the cell style.

      Returns Cell

  • Defined in view/mixin/EdgeMixin.type.ts:208

createGroupCell

createGroupCell: (cells: Cell[]) => Cell

Hook for creating the group cell to hold the given array of Cell if no group cell was given to the group function.

The following code can be used to set the style of new group cells.

const graphCreateGroupCell = graph.createGroupCell;
graph.createGroupCell = function(cells) {
const group = graphCreateGroupCell.apply(this, arguments);
group.setStyle('group');

return group;
  • Defined in view/mixin/GroupingMixin.type.ts:63

dblClick

dblClick: (evt: MouseEvent, cell?: Cell | null) => void

Processes a double click on an optional cell and fires a dblclick event. The event is fired initially.

If the graph is enabled and the event has not been consumed, then edit is called with the given cell. The event is ignored if no cell was specified.

Example for overriding this method.

graph.dblClick = function(evt, cell) {
const mxe = new EventObject(InternalEvent.DOUBLE_CLICK, 'event', evt, 'cell', cell);
this.fireEvent(mxe);

if (this.isEnabled() && !InternalEvent.isConsumed(evt) && !mxe.isConsumed()) {
alert('Hello, World!');
mxe.consume();
}
}

Example listener for this event.

graph.addListener(InternalEvent.DOUBLE_CLICK, function(sender, evt) {
const cell = evt.getProperty('cell');
// do something with the cell and consume the
// event to prevent in-place editing from start
});

Type Declaration

    • (evt: MouseEvent, cell?: Cell | null): void
    • Parameters

      • evt: MouseEvent

        Mouseevent that represents the double click.

      • Optionalcell: Cell | null

        Optional Cell under the mouse pointer.

      Returns void

  • Defined in view/mixin/EventsMixin.type.ts:225

defaultLoopStyle

defaultLoopStyle: EdgeStyleFunction = EdgeStyle.Loop

EdgeStyle to be used for loops.

This is a fallback for loops if the CellStateStyle.loopStyle is undefined.

Default

EdgeStyle.Loop

  • Defined in view/AbstractGraph.ts:380

defaultOverlap

defaultOverlap: number = 0.5

Value returned by getOverlap if isAllowOverlapParent returns true for the given cell. getOverlap is used in constrainChild if isConstrainChild returns true. The value specifies the portion of the child which is allowed to overlap the parent.

  • Defined in view/AbstractGraph.ts:196

defaultParent

defaultParent: Cell | null = null

Specifies the default parent to be used to insert new cells. This is used in getDefaultParent.

Default

null
  • Defined in view/AbstractGraph.ts:203

destroyed

destroyed: boolean = false
  • Defined in view/AbstractGraph.ts:80

dialect

dialect: DialectValue = 'svg'

Dialect to be used for drawing the graph.

  • Defined in view/AbstractGraph.ts:188

disconnectGraph

disconnectGraph: (cells: Cell[]) => void

Disconnects the given edges from the terminals which are not in the given array.

Type Declaration

    • (cells: Cell[]): void
    • Parameters

      • cells: Cell[]

        Array of Cell to be disconnected.

      Returns void

  • Defined in view/mixin/ConnectionsMixin.type.ts:150

disconnectOnMove

disconnectOnMove: boolean

Specifies if edges should be disconnected from their terminals when they are moved.

Default

true
  • Defined in view/mixin/ConnectionsMixin.type.ts:41

doneResource

doneResource: string
  • Defined in view/mixin/SelectionMixin.type.ts:23

doubleClickCounter

doubleClickCounter: number
  • Defined in view/mixin/EventsMixin.type.ts:28

doubleTapEnabled

doubleTapEnabled: boolean

Specifies if double taps on touch-based devices should be handled as a double click.

Default

true
  • Defined in view/mixin/EventsMixin.type.ts:80

doubleTapTimeout

doubleTapTimeout: number

Specifies the timeout in milliseconds for double taps and non-native double clicks.

Default

500
  • Defined in view/mixin/EventsMixin.type.ts:86

doubleTapTolerance

doubleTapTolerance: number

Specifies the tolerance in pixels for double taps and double-clicks in quirks mode.

Default

25
  • Defined in view/mixin/EventsMixin.type.ts:92

dropEnabled

dropEnabled: boolean

Specifies the return value for isDropEnabled.

Default

false
  • Defined in view/mixin/DragDropMixin.type.ts:25

edgeLabelsMovable

edgeLabelsMovable: boolean

Specifies the return value for edges in isLabelMovable.

Default

true
  • Defined in view/mixin/EdgeMixin.type.ts:63

enabled

enabled: boolean = true

Specifies the return value for isEnabled.

Default

true
  • Defined in view/AbstractGraph.ts:269

enterGroup

enterGroup: (cell: Cell) => void

Uses the given cell as the root of the displayed cell hierarchy. If no cell is specified then the selection cell is used.

The cell is only used if isValidRoot returns true.

Type Declaration

    • (cell: Cell): void
    • Parameters

      • cell: Cell

        Optional Cell to be used as the new root. Default is the selection cell.

      Returns void

  • Defined in view/mixin/GroupingMixin.type.ts:123

enterStopsCellEditing

enterStopsCellEditing: boolean

If true, pressing the enter key without pressing control or shift will stop editing and accept the new value. This is used in CellEditorHandler to stop cell editing.

Note: The F2 (accept change) and escape keys (undo change) can always be used to stop editing.

Default

false
  • Defined in view/mixin/EventsMixin.type.ts:62

escape

escape: (evt: Event) => void

Processes an escape keystroke.

Type Declaration

    • (evt: Event): void
    • Parameters

      • evt: Event

        Event that represents the keystroke.

      Returns void

  • Defined in view/mixin/EventsMixin.type.ts:165

escapeEnabled

escapeEnabled: boolean

Specifies if KeyHandler should invoke escape when the escape key is pressed.

Default

true
  • Defined in view/mixin/EventsMixin.type.ts:44

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.

Inherited from EventSource.eventListeners

  • Defined in view/event/EventSource.ts:58

eventsEnabled

eventsEnabled: boolean = true

Specifies if events can be fired. Default is true.

Inherited from EventSource.eventsEnabled

  • Defined in view/event/EventSource.ts:63

eventSource

eventSource: EventTarget | null = null

Optional source for events.

Default

null

Inherited from EventSource.eventSource

  • Defined in view/event/EventSource.ts:69

exitGroup

exitGroup: () => void

Changes the current root to the next valid root in the displayed cell hierarchy.

  • Defined in view/mixin/GroupingMixin.type.ts:128

exportEnabled

exportEnabled: boolean = true

Specifies the return value for canExportCell.

Default

true
  • Defined in view/AbstractGraph.ts:275

extendParent

extendParent: (cell: Cell) => void

Resizes the parents recursively so that they contain the complete area of the resized child cell.

Type Declaration

    • (cell: Cell): void
    • Parameters

      • cell: Cell

        Cell that has been resized.

      Returns void

  • Defined in view/mixin/CellsMixin.type.ts:555

extendParents

extendParents: boolean

Specifies if a parent should contain the child bounds after a resize of the child. This has precedence over constrainChildren.

Default

true
  • Defined in view/mixin/CellsMixin.type.ts:97

extendParentsOnAdd

extendParentsOnAdd: boolean

Specifies if parents should be extended according to the extendParents switch if cells are added.

Default

true
  • Defined in view/mixin/CellsMixin.type.ts:104

extendParentsOnMove

extendParentsOnMove: boolean

Specifies if parents should be extended according to the extendParents switch if cells are added.

Default

false (for backwards compatibility)
  • Defined in view/mixin/CellsMixin.type.ts:111

fireDoubleClick

fireDoubleClick: boolean | null
  • Defined in view/mixin/EventsMixin.type.ts:30

fireGestureEvent

fireGestureEvent: (evt: MouseEvent, cell?: Cell | null) => void

Dispatches a InternalEvent.GESTURE event. The following example will resize the cell under the mouse based on the scale property of the native touch event.

graph.addListener(mxEvent.GESTURE, function(sender, eo) {
const evt = eo.getProperty('event');
const state = graph.view.getState(eo.getProperty('cell'));

if (graph.isEnabled() && graph.isCellResizable(state.cell) && Math.abs(1 - evt.scale) > 0.2) {
const scale = graph.view.scale;
const tr = graph.view.translate;

const w = state.width * evt.scale;
const h = state.height * evt.scale;
const x = state.x - (w - state.width) / 2;
const y = state.y - (h - state.height) / 2;

const bounds = new Rectangle(graph.snap(x / scale) - tr.x,
graph.snap(y / scale) - tr.y,
graph.snap(w / scale),
graph.snap(h / scale));
graph.resizeCell(state.cell, bounds);
eo.consume();
}
});

Type Declaration

    • (evt: MouseEvent, cell?: Cell | null): void
    • Parameters

      • evt: MouseEvent

        MouseEvent event that represents the gesture.

      • Optionalcell: Cell | null

        Optional Cell associated with the gesture.

      Returns void

  • Defined in view/mixin/EventsMixin.type.ts:359

fireMouseEvent

fireMouseEvent: (
    evtName: string,
    me: InternalMouseEvent,
    sender?: EventSource,
) => void

Dispatches the given event in the graph event dispatch loop.

Possible event names are InternalEvent.MOUSE_DOWN, InternalEvent.MOUSE_MOVE and InternalEvent.MOUSE_UP. All listeners are invoked for all events regardless of the consumed state of the event.

Type Declaration

    • (evtName: string, me: InternalMouseEvent, sender?: EventSource): void
    • Parameters

      • evtName: string

        String that specifies the type of event to be dispatched.

      • me: InternalMouseEvent

        InternalMouseEvent to be fired.

      • Optionalsender: EventSource

        Optional sender argument. Default is this.

      Returns void

  • Defined in view/mixin/EventsMixin.type.ts:313

flipEdge

flipEdge: (edge: Cell) => Cell

Toggles the style of the given edge between null (or empty) and alternateEdgeStyle.

This method fires InternalEvent.FLIP_EDGE while the transaction is in progress.

Here is an example that overrides this implementation to invert the value of CellStateStyle.elbow without removing any existing styles.

graph.flipEdge = function(edge) {
if (edge) {
const style = this.getCurrentCellStyle(edge);
const elbow = style.elbow ?? 'horizontal';
const value = (elbow == 'horizontal') ? 'vertical' : 'horizontal';
this.setCellStyles('elbow', value, [edge]);
}
};

Type Declaration

    • (edge: Cell): Cell
    • Parameters

      • edge: Cell

        Cell whose style should be changed.

      Returns Cell

      The edge that was flipped.

  • Defined in view/mixin/EdgeMixin.type.ts:135

foldCells

foldCells: (
    collapse: boolean,
    recurse?: boolean,
    cells?: Cell[] | null,
    checkFoldable?: boolean,
    evt?: Event | null,
) => Cell[] | null

Sets the collapsed state of the specified cells and all descendants if recurse is true. The change is carried out using cellsFolded.

This method fires InternalEvent.FOLD_CELLS while the transaction is in progress.

Returns the cells whose collapsed state was changed.

Type Declaration

    • (
          collapse: boolean,
          recurse?: boolean,
          cells?: Cell[] | null,
          checkFoldable?: boolean,
          evt?: Event | null,
      ): Cell[] | null
    • Parameters

      • collapse: boolean

        Boolean indicating the collapsed state to be assigned. Default is false.

      • Optionalrecurse: boolean

        Optional boolean indicating if the collapsed state of all descendants should be set. Default is false.

      • Optionalcells: Cell[] | null

        Array of Cell whose collapsed state should be set. If null is specified then the foldable selection cells are used. Default is null.

      • OptionalcheckFoldable: boolean

        Optional boolean indicating of isCellFoldable should be checked. Default is false.

      • Optionalevt: Event | null

        Optional native event that triggered the invocation. Default is null.

      Returns Cell[] | null

  • Defined in view/mixin/FoldingMixin.type.ts:72

getActualStartSize

getActualStartSize: (swimlane: Cell, ignoreState: boolean) => Rectangle

Returns the actual start size of the given swimlane taking into account direction and horizontal and vertical flip styles. The start size is returned as an Rectangle where top, left, bottom, right start sizes are returned as x, y, height and width, respectively.

Type Declaration

    • (swimlane: Cell, ignoreState: boolean): Rectangle
    • Parameters

      • swimlane: Cell

        Cell whose start size should be returned.

      • ignoreState: boolean

        Optional boolean that specifies if cell state should be ignored.

      Returns Rectangle

  • Defined in view/mixin/SwimlaneMixin.type.ts:87

getAllConnectionConstraints

getAllConnectionConstraints: (
    terminal: CellState | null,
    source: boolean,
) => ConnectionConstraint[] | null

Returns an array of all ConnectionConstraints for the given terminal. If the shape of the given terminal is a StencilShape then the constraints of the corresponding StencilShape are returned.

Type Declaration

    • (terminal: CellState | null, source: boolean): ConnectionConstraint[] | null
    • Parameters

      • terminal: CellState | null

        CellState that represents the terminal.

      • source: boolean

        Boolean that specifies if the terminal is the source or target.

      Returns ConnectionConstraint[] | null

  • Defined in view/mixin/ConnectionsMixin.type.ts:62

getAllEdges

getAllEdges: (cells: Cell[] | null) => Cell[]

Returns all edges connected to the given cells or its descendants.

  • Defined in view/mixin/EdgeMixin.type.ts:243

getBoundingBox

getBoundingBox: (cells: Cell[]) => Rectangle | null

Returns the bounding box for the given array of Cell. The bounding box for each cell and its descendants is computed using view.getBoundingBox.

Type Declaration

    • (cells: Cell[]): Rectangle | null
    • Parameters

      • cells: Cell[]

        Array of Cell whose bounding box should be returned.

      Returns Rectangle | null

  • Defined in view/mixin/CellsMixin.type.ts:119

getBoundingBoxFromGeometry

getBoundingBoxFromGeometry: (
    cells: Cell[],
    includeEdges?: boolean,
) => Rectangle | null

Returns the bounding box for the geometries of the vertices in the given array of cells. This can be used to find the graph bounds during a layout operation (ie. before the last endUpdate) as follows:

var cells = graph.getChildCells(graph.getDefaultParent(), true, true);
var bounds = graph.getBoundingBoxFromGeometry(cells, true);

This can then be used to move cells to the origin:

if (bounds.x < 0 || bounds.y < 0)
{
graph.moveCells(cells, -Math.min(bounds.x, 0), -Math.min(bounds.y, 0))
}

Or to translate the graph view:

if (bounds.x < 0 || bounds.y < 0)
{
getView().setTranslate(-Math.min(bounds.x, 0), -Math.min(bounds.y, 0));
}

Type Declaration

    • (cells: Cell[], includeEdges?: boolean): Rectangle | null
    • Parameters

      • cells: Cell[]

        Array of Cell whose bounds should be returned.

      • OptionalincludeEdges: boolean

        Specifies if edge bounds should be included by computing the bounding box for all points in geometry. Default is false.

      Returns Rectangle | null

  • Defined in view/mixin/CellsMixin.type.ts:1094

getBoundsForGroup

getBoundsForGroup: (
    group: Cell,
    children: Cell[],
    border: number | null,
) => Rectangle | null

Returns the bounds to be used for the given group and children.

  • Defined in view/mixin/GroupingMixin.type.ts:43

getCellAt

getCellAt: (
    x: number,
    y: number,
    parent?: Cell | null,
    vertices?: boolean | null,
    edges?: boolean | null,
    ignoreFn?: Function | null,
) => Cell | null

Returns the bottom-most cell that intersects the given point (x, y) in the cell hierarchy starting at the given parent.

This will also return swimlanes if the given location intersects the content area of the swimlane. If this is not desired, then the hitsSwimlaneContent may be used if the returned cell is a swimlane to determine if the location is inside the content area or on the actual title of the swimlane.

Type Declaration

    • (
          x: number,
          y: number,
          parent?: Cell | null,
          vertices?: boolean | null,
          edges?: boolean | null,
          ignoreFn?: Function | null,
      ): Cell | null
    • Parameters

      • x: number

        X-coordinate of the location to be checked.

      • y: number

        Y-coordinate of the location to be checked.

      • Optionalparent: Cell | null

        Cell that should be used as the root of the recursion. Default is current root of the view or the root of the model.

      • Optionalvertices: boolean | null

        Optional boolean indicating if vertices should be returned. Default is true.

      • Optionaledges: boolean | null

        Optional boolean indicating if edges should be returned. Default is true.

      • OptionalignoreFn: Function | null

        Optional function that returns true if cell should be ignored. The function is passed the cell state and the x and y parameter. Default is null.

      Returns Cell | null

  • Defined in view/mixin/CellsMixin.type.ts:670

getCellBounds

getCellBounds: (
    cell: Cell,
    includeEdges?: boolean,
    includeDescendants?: boolean,
) => Rectangle | null

Returns the scaled, translated bounds for the given cell. See GraphView.getBounds for arrays.

Type Declaration

    • (
          cell: Cell,
          includeEdges?: boolean,
          includeDescendants?: boolean,
      ): Rectangle | null
    • Parameters

      • cell: Cell

        Cell whose bounds should be returned.

      • OptionalincludeEdges: boolean

        Optional boolean that specifies if the bounds of the connected edges should be included. Default is false.

      • OptionalincludeDescendants: boolean

        Optional boolean that specifies if the bounds of all descendants should be included. Default is false.

      Returns Rectangle | null

  • Defined in view/mixin/CellsMixin.type.ts:1057

getCellContainmentArea

getCellContainmentArea: (cell: Cell) => Rectangle | null

Returns the Rectangle inside which a cell is to be kept.

Type Declaration

    • (cell: Cell): Rectangle | null
    • Parameters

      • cell: Cell

        Cell for which the area should be returned.

      Returns Rectangle | null

  • Defined in view/mixin/CellsMixin.type.ts:632

getCellOverlays

getCellOverlays: (cell: Cell) => CellOverlay[]

Returns an array of CellOverlays for the given cell or null, if no overlays are defined.

Type Declaration

    • (cell: Cell): CellOverlay[]
    • Parameters

      • cell: Cell

        Cell whose overlays should be returned.

      Returns CellOverlay[]

  • Defined in view/mixin/OverlaysMixin.type.ts:38

getCells

getCells: (
    x: number,
    y: number,
    width: number,
    height: number,
    parent?: Cell | null,
    result?: Cell[],
    intersection?: Rectangle | null,
    ignoreFn?: Function | null,
    includeDescendants?: boolean,
) => Cell[]

Returns the child vertices and edges of the given parent that are contained in the given rectangle.

The result is added to the optional result array, which is returned. If no result array is specified then a new array is created and returned.

Type Declaration

    • (
          x: number,
          y: number,
          width: number,
          height: number,
          parent?: Cell | null,
          result?: Cell[],
          intersection?: Rectangle | null,
          ignoreFn?: Function | null,
          includeDescendants?: boolean,
      ): Cell[]
    • Parameters

      • x: number

        X-coordinate of the rectangle.

      • y: number

        Y-coordinate of the rectangle.

      • width: number

        Width of the rectangle.

      • height: number

        Height of the rectangle.

      • Optionalparent: Cell | null

        Cell that should be used as the root of the recursion. Default is current root of the view or the root of the model.

      • Optionalresult: Cell[]

        Optional array to store the result in. Default is an empty Array.

      • Optionalintersection: Rectangle | null

        Default is null.

      • OptionalignoreFn: Function | null

        Default is null.

      • OptionalincludeDescendants: boolean

        Default is false.

      Returns Cell[]

  • Defined in view/mixin/CellsMixin.type.ts:695

getCellsBeyond

getCellsBeyond: (
    x0: number,
    y0: number,
    parent: Cell | null,
    rightHalfpane: boolean,
    bottomHalfpane: boolean,
) => Cell[]

Returns the children of the given parent that are contained in the half-pane from the given point (x0, y0) rightwards or downwards depending on rightHalfpane and bottomHalfpane.

Type Declaration

    • (
          x0: number,
          y0: number,
          parent: Cell | null,
          rightHalfpane: boolean,
          bottomHalfpane: boolean,
      ): Cell[]
    • Parameters

      • x0: number

        X-coordinate of the origin.

      • y0: number

        Y-coordinate of the origin.

      • parent: Cell | null

        Optional Cell whose children should be checked. Default is .

      • rightHalfpane: boolean

        Boolean indicating if the cells in the right halfpane from the origin should be returned. Default is false.

      • bottomHalfpane: boolean

        Boolean indicating if the cells in the bottom halfpane from the origin should be returned. Default is false.

      Returns Cell[]

  • Defined in view/mixin/CellsMixin.type.ts:717

getCellsForGroup

getCellsForGroup: (cells: Cell[]) => Cell[]

Returns the cells with the same parent as the first cell in the given array.

  • Defined in view/mixin/GroupingMixin.type.ts:38

getCellsForUngroup

getCellsForUngroup: () => Cell[]

Returns the selection cells that can be ungrouped.

  • Defined in view/mixin/GroupingMixin.type.ts:76

getCellStyle

getCellStyle: (cell: Cell) => CellStateStyle

Returns the computed style of the Cell using the edge or vertex default style regarding of the type of the cell. The actual computation is done by Stylesheet.getCellStyle.

Note: You should try and get the cell state for the given cell and use the cached style in the state before using this method.

Type Declaration

    • (cell: Cell): CellStateStyle
    • Parameters

      • cell: Cell

        Cell whose style should be returned as an array.

      Returns CellStateStyle

  • Defined in view/mixin/CellsMixin.type.ts:146

getCellValidationError

getCellValidationError: (cell: Cell) => string | null

Checks all multiplicities that cannot be enforced while the graph is being modified, namely, all multiplicities that require a minimum of 1 edge.

Type Declaration

    • (cell: Cell): string | null
    • Parameters

      • cell: Cell

        Cell for which the multiplicities should be checked.

      Returns string | null

  • Defined in view/mixin/ValidationMixin.type.ts:114

getChildCells

getChildCells: (
    parent?: Cell | null,
    vertices?: boolean,
    edges?: boolean,
) => Cell[]

Returns the visible child vertices or edges in the given parent.

If vertices and edges is false, then all children are returned.

Type Declaration

    • (parent?: Cell | null, vertices?: boolean, edges?: boolean): Cell[]
    • Parameters

      • Optionalparent: Cell | null

        Cell whose children should be returned.

      • Optionalvertices: boolean

        Optional boolean that specifies if child vertices should be returned. Default is false.

      • Optionaledges: boolean

        Optional boolean that specifies if child edges should be returned. Default is false.

      Returns Cell[]

  • Defined in view/mixin/CellsMixin.type.ts:654

getChildEdges

getChildEdges: (parent: Cell) => Cell[]

Returns the visible child edges of the given parent.

Type Declaration

    • (parent: Cell): Cell[]
    • Parameters

      • parent: Cell

        Cell whose child vertices should be returned.

      Returns Cell[]

  • Defined in view/mixin/EdgeMixin.type.ts:291

getChildVertices

getChildVertices: (parent?: Cell | null) => Cell[]

Returns the visible child vertices of the given parent.

Type Declaration

    • (parent?: Cell | null): Cell[]
    • Parameters

      • Optionalparent: Cell | null

        the Cell whose children should be returned.

      Returns Cell[]

  • Defined in view/mixin/VertexMixin.type.ts:182

getCloneableCells

getCloneableCells: (cells: Cell[]) => Cell[]

Returns the cells which may be exported in the given array of cells.

  • Defined in view/mixin/CellsMixin.type.ts:765

getCollapseExpandResource

getCollapseExpandResource: () => string
  • Defined in view/mixin/FoldingMixin.type.ts:32

getConnectionConstraint

getConnectionConstraint: (
    edge: CellState,
    terminal: CellState | null,
    source: boolean,
) => ConnectionConstraint

Returns an ConnectionConstraint that describes the given connection point. This result can then be passed to getConnectionPoint.

Type Declaration

    • (
          edge: CellState,
          terminal: CellState | null,
          source: boolean,
      ): ConnectionConstraint
    • Parameters

      • edge: CellState

        CellState that represents the edge.

      • terminal: CellState | null

        CellState that represents the terminal.

      • source: boolean

        Boolean indicating if the terminal is the source or target. Default is false.

      Returns ConnectionConstraint

  • Defined in view/mixin/ConnectionsMixin.type.ts:75

getConnectionPoint

getConnectionPoint: (
    vertex: CellState,
    constraint: ConnectionConstraint,
    round?: boolean,
) => Point | null

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

Type Declaration

    • (
          vertex: CellState,
          constraint: ConnectionConstraint,
          round?: boolean,
      ): Point | null
    • Parameters

      • vertex: CellState

        CellState that represents the vertex.

      • constraint: ConnectionConstraint

        ConnectionConstraint that represents the connection point constraint as returned by getConnectionConstraint.

      • Optionalround: boolean

        Default is true.

      Returns Point | null

  • Defined in view/mixin/ConnectionsMixin.type.ts:106

getConnections

getConnections: (cell: Cell, parent?: Cell | null) => Cell[]

Returns all visible edges connected to the given cell without loops.

Type Declaration

    • (cell: Cell, parent?: Cell | null): Cell[]
    • Parameters

      • cell: Cell

        Cell whose connections should be returned.

      • Optionalparent: Cell | null

        Optional parent of the opposite end for a connection to be returned.

      Returns Cell[]

  • Defined in view/mixin/ConnectionsMixin.type.ts:158

getCurrentCellStyle

getCurrentCellStyle: (cell: Cell, ignoreState?: boolean) => CellStateStyle

Returns the style for the given cell from the cell state, if one exists, or using getCellStyle.

Type Declaration

    • (cell: Cell, ignoreState?: boolean): CellStateStyle
    • Parameters

      • cell: Cell

        Cell whose style should be returned as an array.

      • OptionalignoreState: boolean

        Optional boolean that specifies if the cell state should be ignored.

      Returns CellStateStyle

  • Defined in view/mixin/CellsMixin.type.ts:136

getCursorForCell

getCursorForCell: (cell: Cell) => string | null

Returns the cursor value to be used for the CSS of the shape for the given cell.

This implementation returns null.

Type Declaration

    • (cell: Cell): string | null
    • Parameters

      • cell: Cell

        Cell whose cursor should be returned.

      Returns string | null

  • Defined in view/mixin/CellsMixin.type.ts:1048

getCursorForMouseEvent

getCursorForMouseEvent: (me: InternalMouseEvent) => string | null

Returns the cursor value to be used for the CSS of the shape for the given event.

This implementation calls getCursorForCell.

Type Declaration

    • (me: InternalMouseEvent): string | null
    • Parameters

      • me: InternalMouseEvent

        InternalMouseEvent whose cursor should be returned.

      Returns string | null

  • Defined in view/mixin/EventsMixin.type.ts:456

getDeletableCells

getDeletableCells: (cells: Cell[]) => Cell[]

Returns the cells which may be exported in the given array of cells.

  • Defined in view/mixin/CellsMixin.type.ts:865

getDropTarget

getDropTarget: (
    cells: Cell[],
    evt: MouseEvent,
    cell: Cell | null,
    clone?: boolean,
) => Cell | null

Returns the given cell if it is a drop target for the given cells or the nearest ancestor that may be used as a drop target for the given cells.

If the given array contains a swimlane and swimlaneNesting is false then this always returns null. If no cell is given, then the bottommost swimlane at the location of the given event is returned.

This function should only be used if isDropEnabled returns true.

Type Declaration

    • (
          cells: Cell[],
          evt: MouseEvent,
          cell: Cell | null,
          clone?: boolean,
      ): Cell | null
    • Parameters

      • cells: Cell[]

        Array of Cell which are to be dropped onto the target.

      • evt: MouseEvent

        Mouse event for the drag and drop.

      • cell: Cell | null

        Cell that is under the mouse pointer.

      • Optionalclone: boolean

        Optional boolean to indicate of cells will be cloned.

      Returns Cell | null

  • Defined in view/mixin/SwimlaneMixin.type.ts:124

getEdges

getEdges: (
    cell: Cell,
    parent?: Cell | null,
    incoming?: boolean,
    outgoing?: boolean,
    includeLoops?: boolean,
    recurse?: boolean,
) => Cell[]

Returns the incoming and/or outgoing edges for the given cell.

If the optional parent argument is specified, then only edges are returned where the opposite is in the given parent cell.

If at least one of incoming or outgoing is true, then loops are ignored, if both are false, then all edges connected to the given cell are returned including loops.

Type Declaration

    • (
          cell: Cell,
          parent?: Cell | null,
          incoming?: boolean,
          outgoing?: boolean,
          includeLoops?: boolean,
          recurse?: boolean,
      ): Cell[]
    • Parameters

      • cell: Cell

        Cell whose edges should be returned.

      • Optionalparent: Cell | null

        Optional parent of the opposite end for an edge to be returned.

      • Optionalincoming: boolean

        Optional boolean that specifies if incoming edges should be included in the result. Default is true.

      • Optionaloutgoing: boolean

        Optional boolean that specifies if outgoing edges should be included in the result. Default is true.

      • OptionalincludeLoops: boolean

        Optional boolean that specifies if loops should be included in the result. Default is true.

      • Optionalrecurse: boolean

        Optional boolean the specifies if the parent specified only needs to be an ancestral parent, true, or the direct parent, false. Default is false.

      Returns Cell[]

  • Defined in view/mixin/EdgeMixin.type.ts:277

getEdgesBetween

getEdgesBetween: (source: Cell, target: Cell, directed?: boolean) => Cell[]

Returns the edges between the given source and target. This takes into account collapsed and invisible cells and returns the connected edges as displayed on the screen.

Type Declaration

    • (source: Cell, target: Cell, directed?: boolean): Cell[]
    • Parameters

      • source: Cell
      • target: Cell
      • Optionaldirected: boolean

        If set to true, only returns the directed edges i.e. edges whose source is source and target is target. Default is false.

      Returns Cell[]

  • Defined in view/mixin/EdgeMixin.type.ts:301

getEdgeValidationError

getEdgeValidationError: (
    edge: Cell | null,
    source: Cell | null,
    target: Cell | null,
) => string | null

Returns the validation error message to be displayed when inserting or changing an edges' connectivity. A return value of null means the edge is valid, a return value of '' means it's not valid, but do not display an error message. Any other (non-empty) string returned from this method is displayed as an error message when trying to connect an edge to a source and target. This implementation uses the multiplicities, and checks multigraph, allowDanglingEdges and allowLoops to generate validation errors.

For extending this method with specific checks for source/target cells, the method can be extended as follows. Returning an empty string means the edge is invalid with no error message, a non-null string specifies the error message, and null means the edge is valid.

graph.getEdgeValidationError = function(edge, source, target)
{
if (source != null && target != null &&
this.model.getValue(source) != null &&
this.model.getValue(target) != null)
{
if (target is not valid for source)
{
return 'Invalid Target';
}
}

// "Supercall"
return getEdgeValidationError.apply(this, arguments);
}

Type Declaration

    • (edge: Cell | null, source: Cell | null, target: Cell | null): string | null
    • Parameters

      • edge: Cell | null

        Cell that represents the edge to validate.

      • source: Cell | null

        Cell that represents the source terminal.

      • target: Cell | null

        Cell that represents the target terminal.

      Returns string | null

  • Defined in view/mixin/ValidationMixin.type.ts:76

getEditingValue

getEditingValue: (cell: Cell, evt: MouseEvent | null) => string

Returns the initial value for in-place editing.

This implementation returns convertValueToString for the given cell. If this function is overridden, then GraphDataModel.valueForCellChanged should take care of correctly storing the actual new value inside the user object.

Type Declaration

    • (cell: Cell, evt: MouseEvent | null): string
    • Parameters

      • cell: Cell

        Cell for which the initial editing value should be returned.

      • evt: MouseEvent | null

        Optional mouse event that triggered the editor.

      Returns string

  • Defined in view/mixin/EditingMixin.type.ts:54

getEventState

getEventState: (state: CellState) => CellState

Returns the CellState to be used when firing the mouse event for the given state.

This implementation returns the given state.

  • Defined in view/mixin/EventsMixin.type.ts:300

getEventTolerance

getEventTolerance: () => number
  • Defined in view/mixin/EventsMixin.type.ts:156

getExportableCells

getExportableCells: (cells: Cell[]) => Cell[]

Returns the cells which may be exported in the given array of cells.

  • Defined in view/mixin/CellsMixin.type.ts:793

getFoldableCells

getFoldableCells: (cells: Cell[], collapse: boolean) => Cell[] | null

Returns the cells which are movable in the given array of cells.

  • Defined in view/mixin/FoldingMixin.type.ts:39

getFoldingImage

getFoldingImage: (state: CellState) => ImageBox | null

Returns the ImageBox used to display the collapsed state of the specified cell state.

This returns null for all edges.

  • Defined in view/mixin/FoldingMixin.type.ts:56

getGridSize

getGridSize: () => number

Returns gridSize.

  • Defined in view/mixin/SnapMixin.type.ts:81

getImportableCells

getImportableCells: (cells: Cell[]) => Cell[]

Returns the cells which may be imported in the given array of cells.

  • Defined in view/mixin/CellsMixin.type.ts:807

getIncomingEdges

getIncomingEdges: (cell: Cell, parent: Cell | null) => Cell[]

Returns the visible incoming edges for the given cell. If the optional parent argument is specified, then only child edges of the given parent are returned.

Type Declaration

    • (cell: Cell, parent: Cell | null): Cell[]
    • Parameters

      • cell: Cell

        Cell whose incoming edges should be returned.

      • parent: Cell | null

        Optional parent of the opposite end for an edge to be returned.

      Returns Cell[]

  • Defined in view/mixin/EdgeMixin.type.ts:252

getLabel

getLabel: (cell?: Cell | null) => string | null

Returns a string or DOM node that represents the label for the given cell.

This implementation uses convertValueToString if labelsVisible is true. Otherwise, it returns an empty string.

To truncate a label to match the size of the cell, the following code can be used.

const getLabel = graph.getLabel;
graph.getLabel = function(cell) {
const label = getLabel.apply(this, arguments);

if (label && this.model.isVertex(cell)) {
const geo = cell.getCellGeometry();

if (geo) {
const max = parseInt(geo.width / 8);

if (label.length > max) {
label = label.substring(0, max) + '...';
}
}
}
return stringUtils.htmlEntities(label);
}

A resize listener is needed in the graph to force a repaint of the label after a resize.

graph.addListener(InternalEvent.RESIZE_CELLS, function(sender, evt) {
const cells = evt.getProperty('cells');

for (const cell of cells) {
this.view.removeState(cell);
}
});

Type Declaration

    • (cell?: Cell | null): string | null
    • Parameters

      • Optionalcell: Cell | null

        Cell whose label should be returned.

      Returns string | null

  • Defined in view/mixin/LabelMixin.type.ts:74

getMovableCells

getMovableCells: (cells: Cell[]) => Cell[]

Returns the cells which are movable in the given array of cells.

  • Defined in view/mixin/CellsMixin.type.ts:899

getOpposites

getOpposites: (
    edges: Cell[],
    terminal: Cell | null,
    includeSources?: boolean,
    includeTargets?: boolean,
) => Cell[]

Returns all distinct visible opposite cells for the specified terminal on the given edges.

Type Declaration

    • (
          edges: Cell[],
          terminal: Cell | null,
          includeSources?: boolean,
          includeTargets?: boolean,
      ): Cell[]
    • Parameters

      • edges: Cell[]

        Array of Cell that contains the edges whose opposite terminals should be returned.

      • terminal: Cell | null

        Terminal that specifies the end whose opposite should be returned. Default is null.

      • OptionalincludeSources: boolean

        Optional boolean that specifies if source terminals should be included in the result. Default is true.

      • OptionalincludeTargets: boolean

        Optional boolean that specifies if target terminals should be included in the result. Default is true.

      Returns Cell[]

  • Defined in view/mixin/TerminalMixin.type.ts:42

getOutgoingEdges

getOutgoingEdges: (cell: Cell, parent: Cell | null) => Cell[]

Returns the visible outgoing edges for the given cell. If the optional parent argument is specified, then only child edges of the given parent are returned.

Type Declaration

    • (cell: Cell, parent: Cell | null): Cell[]
    • Parameters

      • cell: Cell

        Cell whose outgoing edges should be returned.

      • parent: Cell | null

        Optional parent of the opposite end for an edge to be returned.

      Returns Cell[]

  • Defined in view/mixin/EdgeMixin.type.ts:261

getOutlineConstraint

getOutlineConstraint: (
    point: Point,
    terminalState: CellState,
    me: InternalMouseEvent,
) => ConnectionConstraint | null

Returns the constraint used to connect to the outline of the given state.

  • Defined in view/mixin/ConnectionsMixin.type.ts:48

getPanDx

getPanDx: () => number
  • Defined in view/mixin/PanningMixin.type.ts:70

getPanDy

getPanDy: () => number
  • Defined in view/mixin/PanningMixin.type.ts:72

getPointForEvent

getPointForEvent: (evt: MouseEvent, addOffset?: boolean) => Point

Returns an Point representing the given event in the unscaled, non-translated coordinate space of container and applies the grid.

Type Declaration

    • (evt: MouseEvent, addOffset?: boolean): Point
    • Parameters

      • evt: MouseEvent

        MouseEvent that contains the mouse pointer location.

      • OptionaladdOffset: boolean

        Optional boolean that specifies if the position should be offset by half of the gridSize. Default is true.

      Returns Point

  • Defined in view/mixin/EventsMixin.type.ts:415

getPreferredSizeForCell

getPreferredSizeForCell: (
    cell: Cell,
    textWidth?: number | null,
) => Rectangle | null

Returns the preferred width and height of the given Cell as an Rectangle. To implement a minimum width, add a new style e.g. minWidth in the vertex and override this method as follows.

var graphGetPreferredSizeForCell = graph.getPreferredSizeForCell;
graph.getPreferredSizeForCell(cell)
{
var result = graphGetPreferredSizeForCell.apply(this, arguments);
var style = this.getCellStyle(cell);

if (style.minWidth > 0)
{
result.width = Math.max(style.minWidth, result.width);
}

return result;
};

Type Declaration

    • (cell: Cell, textWidth?: number | null): Rectangle | null
    • Parameters

      • cell: Cell

        Cell for which the preferred size should be returned.

      • OptionaltextWidth: number | null

        Optional maximum text width for word wrapping.

      Returns Rectangle | null

  • Defined in view/mixin/CellsMixin.type.ts:448

getSelectionCell

getSelectionCell: () => Cell

Returns the first cell from the array of selected Cell.

  • Defined in view/mixin/SelectionMixin.type.ts:64

getSelectionCells

getSelectionCells: () => Cell[]

Returns the array of selected Cell.

  • Defined in view/mixin/SelectionMixin.type.ts:69

getSelectionCellsForChanges

getSelectionCellsForChanges: (
    changes: any[],
    ignoreFn?: Function | null,
) => Cell[]

Returns the cells to be selected for the given array of changes.

Type Declaration

    • (changes: any[], ignoreFn?: Function | null): Cell[]
    • Parameters

      • changes: any[]
      • OptionalignoreFn: Function | null

        Optional function that takes a change and returns true if the change should be ignored.

      Returns Cell[]

  • Defined in view/mixin/SelectionMixin.type.ts:217

getSelectionCount

getSelectionCount: () => number

Returns the number of selected cells.

  • Defined in view/mixin/SelectionMixin.type.ts:59

getSelectionModel

getSelectionModel: () => GraphSelectionModel

Returns the GraphSelectionModel that contains the selection.

  • Defined in view/mixin/SelectionMixin.type.ts:32

getSnapTolerance

getSnapTolerance: () => number
  • Defined in view/mixin/SnapMixin.type.ts:40

getStartSize

getStartSize: (swimlane: Cell, ignoreState?: boolean) => Rectangle

Returns the start size of the given swimlane, that is, the width or height of the part that contains the title, depending on the horizontal style. The return value is an Rectangle with either width or height set as appropriate.

Type Declaration

    • (swimlane: Cell, ignoreState?: boolean): Rectangle
    • Parameters

      • swimlane: Cell

        Cell whose start size should be returned.

      • OptionalignoreState: boolean

        Optional boolean that specifies if cell state should be ignored.

      Returns Rectangle

  • Defined in view/mixin/SwimlaneMixin.type.ts:73

getStateForTouchEvent

getStateForTouchEvent: (evt: MouseEvent) => CellState | null

Returns the state for the given touch event.

  • Defined in view/mixin/EventsMixin.type.ts:261

getSwimlane

getSwimlane: (cell: Cell | null) => Cell | null

Returns the nearest ancestor of the given cell which is a swimlane, or the given cell, if it is itself a swimlane.

Type Declaration

    • (cell: Cell | null): Cell | null
    • Parameters

      • cell: Cell | null

        Cell for which the ancestor swimlane should be returned.

      Returns Cell | null

  • Defined in view/mixin/SwimlaneMixin.type.ts:46

getSwimlaneAt

getSwimlaneAt: (x: number, y: number, parent?: Cell | null) => Cell | null

Returns the bottom-most swimlane that intersects the given point (x, y) in the cell hierarchy that starts at the given parent.

Type Declaration

    • (x: number, y: number, parent?: Cell | null): Cell | null
    • Parameters

      • x: number

        X-coordinate of the location to be checked.

      • y: number

        Y-coordinate of the location to be checked.

      • Optionalparent: Cell | null

        Cell that should be used as the root of the recursion. Default is defaultParent.

      Returns Cell | null

  • Defined in view/mixin/SwimlaneMixin.type.ts:55

getSwimlaneDirection

getSwimlaneDirection: (style: CellStateStyle) => DirectionValue

Returns the direction for the given swimlane style.

  • Defined in view/mixin/SwimlaneMixin.type.ts:78

getTerminalForPort

getTerminalForPort: (cell: Cell, source?: boolean) => Cell | null

Returns the terminal to be used for a given port.

This implementation always returns the parent cell.

Type Declaration

    • (cell: Cell, source?: boolean): Cell | null
    • Parameters

      • cell: Cell

        Cell that represents the port.

      • Optionalsource: boolean

        If the cell is the source or target port. Default is false.

      Returns Cell | null

  • Defined in view/mixin/PortsMixin.type.ts:57

graphModelChangeListener

graphModelChangeListener: Function | null = null
  • Defined in view/AbstractGraph.ts:82

gridEnabled

gridEnabled: boolean

Specifies if the grid is enabled. This is used in snap.

Default

true
  • Defined in view/mixin/SnapMixin.type.ts:38

gridSize

gridSize: number

Specifies the grid size.

Default

10
  • Defined in view/mixin/SnapMixin.type.ts:32

groupCells

groupCells: (group: Cell, border: number, cells?: Cell[] | null) => Cell

Adds the cells into the given group. The change is carried out using cellsAdded, cellsMoved and cellsResized.

This method fires InternalEvent.GROUP_CELLS while the transaction is in progress.

Type Declaration

    • (group: Cell, border: number, cells?: Cell[] | null): Cell
    • Parameters

      • group: Cell

        Cell that represents the target group. If null is specified then a new group is created using createGroupCell.

      • border: number

        Optional integer that specifies the border between the child area and the group bounds. Default is 0.

      • Optionalcells: Cell[] | null

        Optional array of Cell to be grouped. If null is specified then the selection cells are used.

      Returns Cell

      the new group. A group is only created if there is at least one entry in the given array of cells.

  • Defined in view/mixin/GroupingMixin.type.ts:33

hitsSwimlaneContent

hitsSwimlaneContent: (swimlane: Cell, x: number, y: number) => boolean

Returns true if the given coordinate pair is inside the content are of the given swimlane.

Type Declaration

    • (swimlane: Cell, x: number, y: number): boolean
    • Parameters

      • swimlane: Cell

        Cell that specifies the swimlane.

      • x: number

        X-coordinate of the mouse event.

      • y: number

        Y-coordinate of the mouse event.

      Returns boolean

  • Defined in view/mixin/SwimlaneMixin.type.ts:64

horizontalPageBreaks

horizontalPageBreaks: Shape[] | null

Default

null
  • Defined in view/mixin/PageBreaksMixin.type.ts:22

htmlLabels

htmlLabels: boolean

Specifies the return value for isHtmlLabel.

Default

false
  • Defined in view/mixin/LabelMixin.type.ts:31

ignoreMouseEvents

ignoreMouseEvents: boolean | null
  • Defined in view/mixin/EventsMixin.type.ts:35

ignoreScrollbars

ignoreScrollbars: boolean = false

Specifies if the graph should automatically scroll regardless of the scrollbars. This will scroll the container using positive values for scroll positions (ie usually only rightwards and downwards). To avoid possible conflicts with panning, set translateToScrollPosition to true.

  • Defined in view/AbstractGraph.ts:289

importCells

importCells: (
    cells: Cell[],
    dx?: number,
    dy?: number,
    target?: Cell | null,
    evt?: MouseEvent | null,
    mapping?: any,
) => Cell[]

Clones and inserts the given cells into the graph using the move method and returns the inserted cells. This shortcut is used if cells are inserted via data transfer.

Type Declaration

    • (
          cells: Cell[],
          dx?: number,
          dy?: number,
          target?: Cell | null,
          evt?: MouseEvent | null,
          mapping?: any,
      ): Cell[]
    • Parameters

      • cells: Cell[]

        Array of Cell to be imported.

      • Optionaldx: number

        Integer that specifies the x-coordinate of the vector. Default is 0.

      • Optionaldy: number

        Integer that specifies the y-coordinate of the vector. Default is 0.

      • Optionaltarget: Cell | null

        Cell that represents the new parent of the cells.

      • Optionalevt: MouseEvent | null

        MouseEvent that triggered the invocation.

      • Optionalmapping: any

        Optional mapping for existing clones.

      Returns Cell[]

      the cells that were imported.

  • Defined in view/mixin/CellsMixin.type.ts:569

importEnabled

importEnabled: boolean = true

Specifies the return value for canImportCell.

Default

true
  • Defined in view/AbstractGraph.ts:281

initialTouchX

initialTouchX: number

Holds the x-coordinate of the initial touch event for tap and hold.

Default

0
  • Defined in view/mixin/EventsMixin.type.ts:140

initialTouchY

initialTouchY: number

Holds the y-coordinate of the initial touch event for tap and hold.

Default

0
  • Defined in view/mixin/EventsMixin.type.ts:146

intersects

intersects: (state: CellState, x: number, y: number) => boolean

Returns the bottom-most cell that intersects the given point (x, y) in the cell hierarchy that starts at the given parent.

Type Declaration

    • (state: CellState, x: number, y: number): boolean
    • Parameters

      • state: CellState

        CellState that represents the cell state.

      • x: number

        X-coordinate of the location to be checked.

      • y: number

        Y-coordinate of the location to be checked.

      Returns boolean

  • Defined in view/mixin/CellsMixin.type.ts:732

invokesStopCellEditing

invokesStopCellEditing: boolean

If true, when editing is to be stopped by way of selection changing, data in diagram changing or other means stopCellEditing is invoked, and changes are saved. This is implemented in a focus handler in CellEditorHandler.

Default

true
  • Defined in view/mixin/EventsMixin.type.ts:53

isAllowAutoPanning

isAllowAutoPanning: () => boolean
  • Defined in view/mixin/PanningMixin.type.ts:69

isAllowDanglingEdges

isAllowDanglingEdges: () => boolean

Returns allowDanglingEdges as a boolean.

  • Defined in view/mixin/EdgeMixin.type.ts:90

isAllowNegativeCoordinates

isAllowNegativeCoordinates: () => boolean

Returns allowNegativeCoordinates.

  • Defined in view/mixin/VertexMixin.type.ts:36

isAutoExtend

isAutoExtend: () => boolean
  • Defined in view/mixin/DragDropMixin.type.ts:62

isAutoScroll

isAutoScroll: () => boolean
  • Defined in view/mixin/DragDropMixin.type.ts:60

isAutoSizeCell

isAutoSizeCell: (cell: Cell) => boolean

Returns true if the size of the given cell should automatically be updated after a change of the label.

This implementation returns autoSizeCells or checks if the cell style does specify CellStateStyle.autoSize to be true.

Type Declaration

    • (cell: Cell): boolean
    • Parameters

      • cell: Cell

        Cell that should be resized.

      Returns boolean

  • Defined in view/mixin/CellsMixin.type.ts:978

isAutoSizeCells

isAutoSizeCells: () => boolean

Returns autoSizeCells.

  • Defined in view/mixin/CellsMixin.type.ts:983

isCellBendable

isCellBendable: (cell: Cell) => boolean

Returns true if the given cell is bendable.

This returns cellsBendable for all given cells if cellsLocked does not return true for the given cell and its style does not specify CellStateStyle.bendable to be false.

Type Declaration

    • (cell: Cell): boolean
    • Parameters

      • cell: Cell

        Cell whose bendable state should be returned.

      Returns boolean

  • Defined in view/mixin/CellsMixin.type.ts:955

isCellCloneable

isCellCloneable: (cell: Cell) => boolean

Returns true if the given cell is cloneable.

This implementation returns isCellsCloneable for all cells unless a cell style specifies CellStateStyle.cloneable to be false.

Type Declaration

    • (cell: Cell): boolean
    • Parameters

      • cell: Cell

        Optional Cell whose cloneable state should be returned.

      Returns boolean

  • Defined in view/mixin/CellsMixin.type.ts:774

isCellDeletable

isCellDeletable: (cell: Cell) => boolean

Returns true if the given cell is deletable.

Type Declaration

    • (cell: Cell): boolean
    • Parameters

      • cell: Cell

        Cell whose deletable state should be returned.

      Returns boolean

      cellsDeletable for all given cells if a cells style does not specify CellStateStyle.deletable to be false.

  • Defined in view/mixin/CellsMixin.type.ts:873

isCellDisconnectable

isCellDisconnectable: (
    cell: Cell,
    terminal: Cell | null,
    source: boolean,
) => boolean

Returns true if the given cell is disconnectable from the source or target terminal. This returns isCellsDisconnectable for all given cells if isCellLocked does not return true for the given cell.

Type Declaration

    • (cell: Cell, terminal: Cell | null, source: boolean): boolean
    • Parameters

      • cell: Cell

        Cell whose disconnectable state should be returned.

      • terminal: Cell | null

        Cell that represents the source or target terminal.

      • source: boolean

        Boolean indicating if the source or target terminal is to be disconnected.

      Returns boolean

  • Defined in view/mixin/ConnectionsMixin.type.ts:211

isCellEditable

isCellEditable: (cell: Cell) => boolean

Returns true if the given cell is editable.

This returns cellsEditable for all given cells if isCellLocked does not return true for the given cell and its style does not specify CellStateStyle.editable to be false.

Type Declaration

    • (cell: Cell): boolean
    • Parameters

      • cell: Cell

        Cell whose editable state should be returned.

      Returns boolean

  • Defined in view/mixin/EditingMixin.type.ts:115

isCellFoldable

isCellFoldable: (cell: Cell, collapse: boolean) => boolean

Returns true if the given cell is foldable.

The default implementation returns true if the cell has at least one child and its style does not specify CellStyle.foldable to be false.

Type Declaration

    • (cell: Cell, collapse: boolean): boolean
    • Parameters

      • cell: Cell

        whose foldable state should be returned.

      • collapse: boolean

      Returns boolean

  • Defined in view/mixin/FoldingMixin.type.ts:49

isCellLocked

isCellLocked: (cell: Cell) => boolean

Returns true if the given cell may not be moved, sized, bended, disconnected, edited or selected.

This implementation returns true for all vertices with a relative geometry if locked is false.

Type Declaration

    • (cell: Cell): boolean
    • Parameters

      • cell: Cell

        Cell whose locked state should be returned.

      Returns boolean

  • Defined in view/mixin/CellsMixin.type.ts:751

isCellMovable

isCellMovable: (cell: Cell) => boolean

Returns true if the given cell is movable.

This returns cellsMovable for all given cells if isCellLocked does not return true for the given cell, and its style does not specify CellStateStyle.movable to be false.

Type Declaration

    • (cell: Cell): boolean
    • Parameters

      • cell: Cell

        Cell whose movable state should be returned.

      Returns boolean

  • Defined in view/mixin/CellsMixin.type.ts:909

isCellResizable

isCellResizable: (cell: Cell) => boolean

Returns true if the given cell is resizable.

This returns cellsResizable for all given cells if isCellLocked does not return true for the given cell and its style does not specify 'resizable' to be false.

Type Declaration

    • (cell: Cell): boolean
    • Parameters

      • cell: Cell

        Cell whose resizable state should be returned.

      Returns boolean

  • Defined in view/mixin/CellsMixin.type.ts:933

isCellRotatable

isCellRotatable: (cell: Cell) => boolean

Returns true if the given cell is rotatable.

This returns true for the given cell if its style does not specify CellStateStyle.rotatable to be false.

Type Declaration

    • (cell: Cell): boolean
    • Parameters

      • cell: Cell

        Cell whose rotatable state should be returned.

      Returns boolean

  • Defined in view/mixin/CellsMixin.type.ts:894

isCellsBendable

isCellsBendable: () => boolean

Returns cellsBendable.

  • Defined in view/mixin/CellsMixin.type.ts:960

isCellsCloneable

isCellsCloneable: () => boolean

Returns cellsCloneable, that is, if the graph allows cloning of cells by using control-drag.

  • Defined in view/mixin/CellsMixin.type.ts:779

isCellsDeletable

isCellsDeletable: () => boolean

Returns cellsDeletable.

  • Defined in view/mixin/CellsMixin.type.ts:878

isCellsDisconnectable

isCellsDisconnectable: () => boolean

Returns cellsDisconnectable.

  • Defined in view/mixin/ConnectionsMixin.type.ts:216

isCellsEditable

isCellsEditable: () => boolean

Returns cellsEditable.

  • Defined in view/mixin/EditingMixin.type.ts:120

isCellSelectable

isCellSelectable: (cell: Cell) => boolean

Returns true if the given cell is selectable.

This implementation returns cellsSelectable.

To add a new style for making cells (un)selectable, use the following code.

isCellSelectable(cell) {
const style = this.getCurrentCellStyle(cell);
return this.isCellsSelectable() &&
!this.isCellLocked(cell) &&
(style.selectable ?? true);
};

You can then use the new style as shown in this example.

graph.insertVertex({
parent,
value: 'Hello,',
position: [20, 20],
size: [80, 30],
style: {
selectable: false,
},
});

Type Declaration

    • (cell: Cell): boolean
    • Parameters

      • cell: Cell

        Cell whose selectable state should be returned.

      Returns boolean

  • Defined in view/mixin/CellsMixin.type.ts:850

isCellSelected

isCellSelected: (cell: Cell) => boolean

Returns true if the given cell is selected.

Type Declaration

    • (cell: Cell): boolean
    • Parameters

      • cell: Cell

        Cell for which the selection state should be returned.

      Returns boolean

  • Defined in view/mixin/SelectionMixin.type.ts:44

isCellsLocked

isCellsLocked: () => boolean
  • Defined in view/mixin/CellsMixin.type.ts:753

isCellsMovable

isCellsMovable: () => boolean

Returns cellsMovable.

  • Defined in view/mixin/CellsMixin.type.ts:914

isCellsResizable

isCellsResizable: () => boolean

Returns cellsResizable.

  • Defined in view/mixin/CellsMixin.type.ts:938

isCellsSelectable

isCellsSelectable: () => boolean

Returns cellsSelectable.

  • Defined in view/mixin/CellsMixin.type.ts:855

isCloneEvent

isCloneEvent: (evt: MouseEvent) => boolean

Returns true if the given event is a clone event.

This implementation returns true if control is pressed.

  • Defined in view/mixin/EventsMixin.type.ts:373

isCloneInvalidEdges

isCloneInvalidEdges: () => boolean

Returns cloneInvalidEdges as a boolean.

  • Defined in view/mixin/EdgeMixin.type.ts:112

isConnectable

isConnectable: () => boolean

Returns true if the ConnectionHandler is enabled.

  • Defined in view/mixin/ConnectionsMixin.type.ts:263

isConnectableEdges

isConnectableEdges: () => boolean

Returns connectableEdges as a boolean.

  • Defined in view/mixin/EdgeMixin.type.ts:102

isConstrainChild

isConstrainChild: (cell: Cell) => boolean

Returns true if the given cell should be kept inside the bounds of its parent according to the rules defined by getOverlap and isAllowOverlapParent.

This implementation returns false for all children of edges and isConstrainChildren otherwise.

Type Declaration

    • (cell: Cell): boolean
    • Parameters

      • cell: Cell

        Cell that should be constrained.

      Returns boolean

  • Defined in view/mixin/ConnectionsMixin.type.ts:167

isConstrainChildren

isConstrainChildren: () => boolean

Returns constrainChildren.

  • Defined in view/mixin/ConnectionsMixin.type.ts:172

isConstrainedEvent

isConstrainedEvent: (evt: MouseEvent) => boolean

Returns true if the given mouse event should be aligned to the grid.

  • Defined in view/mixin/EventsMixin.type.ts:398

isConstrainedMoving

isConstrainedMoving: boolean = false
  • Defined in view/AbstractGraph.ts:84

isConstrainRelativeChildren

isConstrainRelativeChildren: () => boolean

Returns constrainRelativeChildren.

  • Defined in view/mixin/ConnectionsMixin.type.ts:182

isDisconnectOnMove

isDisconnectOnMove: () => boolean

Returns disconnectOnMove as a boolean.

  • Defined in view/mixin/ConnectionsMixin.type.ts:192

isDropEnabled

isDropEnabled: () => boolean

Returns dropEnabled as a boolean.

  • Defined in view/mixin/DragDropMixin.type.ts:67

isEdgeLabelsMovable

isEdgeLabelsMovable: () => boolean

Returns edgeLabelsMovable.

  • Defined in view/mixin/EdgeMixin.type.ts:72

isEdgeValid

isEdgeValid: (edge: Cell | null, source: Cell, target: Cell) => boolean

Checks if the return value of getEdgeValidationError for the given arguments is null.

Type Declaration

    • (edge: Cell | null, source: Cell, target: Cell): boolean
    • Parameters

      • edge: Cell | null

        Cell that represents the edge to validate.

      • source: Cell

        Cell that represents the source terminal.

      • target: Cell

        Cell that represents the target terminal.

      Returns boolean

  • Defined in view/mixin/ValidationMixin.type.ts:37

isEditing

isEditing: (cell?: Cell | null) => boolean

Returns true if the given cell is currently being edited.

If no cell is specified, then this returns true if any cell is currently being edited.

Type Declaration

    • (cell?: Cell | null): boolean
    • Parameters

      • Optionalcell: Cell | null

        Cell that should be checked.

      Returns boolean

  • Defined in view/mixin/EditingMixin.type.ts:105

isEnterStopsCellEditing

isEnterStopsCellEditing: () => boolean

Returns enterStopsCellEditing.

  • Defined in view/mixin/EventsMixin.type.ts:442

isEscapeEnabled

isEscapeEnabled: () => boolean

Returns escapeEnabled.

  • Defined in view/mixin/EventsMixin.type.ts:420

isEventIgnored

isEventIgnored: (
    evtName: string,
    me: InternalMouseEvent,
    sender: EventSource,
) => boolean

Returns true if the event should be ignored in fireMouseEvent.

  • Defined in view/mixin/EventsMixin.type.ts:266

isEventSourceIgnored

isEventSourceIgnored: (evtName: string, me: InternalMouseEvent) => boolean

Returns true if the event should be ignored in fireMouseEvent.

This implementation returns true for select, option and input (if not of type checkbox, radio, button, submit or file) event sources if the event is not a mouse event or a left mouse button press event.

Type Declaration

    • (evtName: string, me: InternalMouseEvent): boolean
    • Parameters

      • evtName: string

        The name of the event.

      • me: InternalMouseEvent

        InternalMouseEvent that should be ignored.

      Returns boolean

  • Defined in view/mixin/EventsMixin.type.ts:291

isExtendParent

isExtendParent: (cell: Cell) => boolean

Returns true if the parent of the given cell should be extended if the child has been resized so that it overlaps the parent.

This implementation returns isExtendParents if the cell is not an edge.

Type Declaration

    • (cell: Cell): boolean
    • Parameters

      • cell: Cell

        Cell that has been resized.

      Returns boolean

  • Defined in view/mixin/CellsMixin.type.ts:1003

isExtendParents

isExtendParents: () => boolean

Returns extendParents.

  • Defined in view/mixin/CellsMixin.type.ts:1008

isExtendParentsOnAdd

isExtendParentsOnAdd: (cell: Cell) => boolean

Returns extendParentsOnAdd.

  • Defined in view/mixin/CellsMixin.type.ts:1020

isExtendParentsOnMove

isExtendParentsOnMove: () => boolean

Returns extendParentsOnMove.

  • Defined in view/mixin/CellsMixin.type.ts:1032

isFoldingEnabled

isFoldingEnabled: () => boolean
  • Defined in view/mixin/FoldingMixin.type.ts:34

isGridEnabled

isGridEnabled: () => boolean

Returns gridEnabled.

  • Defined in view/mixin/SnapMixin.type.ts:69

isGridEnabledEvent

isGridEnabledEvent: (evt: MouseEvent) => boolean

Returns true if the given mouse event should be aligned to the grid.

  • Defined in view/mixin/EventsMixin.type.ts:393

isHtmlLabel

isHtmlLabel: (cell: Cell) => boolean

Returns true if the label must be rendered as HTML markup.

The default implementation returns htmlLabels.

  • Defined in view/mixin/LabelMixin.type.ts:83

isHtmlLabels

isHtmlLabels: () => boolean

Returns htmlLabels.

  • Defined in view/mixin/LabelMixin.type.ts:90

isIgnoreTerminalEvent

isIgnoreTerminalEvent: (evt: MouseEvent) => boolean

Returns true if the given mouse event should not allow any connections to be made.

This implementation returns false.

  • Defined in view/mixin/EventsMixin.type.ts:405

isInvokesStopCellEditing

isInvokesStopCellEditing: () => boolean

Returns invokesStopCellEditing.

  • Defined in view/mixin/EventsMixin.type.ts:432

isLabelClipped

isLabelClipped: (cell: Cell) => boolean

Returns true if the overflow portion of labels should be hidden.

If this returns true then vertex labels will be clipped to the size of the vertices.

This implementation returns true if overflow in the style of the given cell is 'hidden'.

Type Declaration

    • (cell: Cell): boolean
    • Parameters

      • cell: Cell

        Cell whose label should be clipped.

      Returns boolean

  • Defined in view/mixin/LabelMixin.type.ts:147

isLabelMovable

isLabelMovable: (cell: Cell) => boolean

Returns true if the given edges' label is moveable.

This returns movable for all given cells if isCellLocked does not return true for the given cell.

Type Declaration

    • (cell: Cell): boolean
    • Parameters

      • cell: Cell

        Cell whose label should be moved.

      Returns boolean

  • Defined in view/mixin/LabelMixin.type.ts:156

isLabelsVisible

isLabelsVisible: () => boolean
  • Defined in view/mixin/LabelMixin.type.ts:85

isMouseDown

isMouseDown: boolean

Holds the state of the mouse button.

Default

false
  • Defined in view/mixin/EventsMixin.type.ts:68

isMouseTrigger

isMouseTrigger: boolean | null
  • Defined in view/mixin/EventsMixin.type.ts:34

isNativeDblClickEnabled

isNativeDblClickEnabled: () => boolean
  • Defined in view/mixin/EventsMixin.type.ts:154

isPort

isPort: (cell: Cell | null) => boolean

Returns true if the given cell is a "port", that is, when connecting to it, the cell returned by getTerminalForPort should be used as the terminal and the port should be referenced by the ID in either the CellStateStyle.sourcePort or the CellStateStyle.sourcePort.

Note that a port should not be movable.

This implementation always returns false.

A typical implementation is the following:

graph.isPort = function(cell) {
const geo = cell.getGeometry();

return (geo != null) ? geo.relative : false;
};

Type Declaration

    • (cell: Cell | null): boolean
    • Parameters

      • cell: Cell | null

        Cell that represents the port.

      Returns boolean

  • Defined in view/mixin/PortsMixin.type.ts:47

isPortsEnabled

isPortsEnabled: () => boolean

Returns portsEnabled.

  • Defined in view/mixin/PortsMixin.type.ts:62

isResetEdgesOnConnect

isResetEdgesOnConnect: () => boolean
  • Defined in view/mixin/EdgeMixin.type.ts:66

isResetEdgesOnMove

isResetEdgesOnMove: () => boolean
  • Defined in view/mixin/EdgeMixin.type.ts:65

isResetEdgesOnResize

isResetEdgesOnResize: () => boolean
  • Defined in view/mixin/EdgeMixin.type.ts:67

isSelectionEmpty

isSelectionEmpty: () => boolean

Returns true if the selection is empty.

  • Defined in view/mixin/SelectionMixin.type.ts:49

isSiblingSelected

isSiblingSelected: (cell: Cell) => boolean

Returns true if any sibling of the given cell is selected.

  • Defined in view/mixin/SelectionMixin.type.ts:209

isSplitEnabled

isSplitEnabled: () => boolean

Returns splitEnabled as a boolean.

  • Defined in view/mixin/DragDropMixin.type.ts:79

isSplitTarget

isSplitTarget: (
    target: Cell,
    cells?: Cell[],
    evt?: MouseEvent | null,
) => boolean

Returns true if the given edge may be split into two edges with the given cell as a new terminal between the two.

Type Declaration

    • (target: Cell, cells?: Cell[], evt?: MouseEvent | null): boolean
    • Parameters

      • target: Cell

        Cell that represents the edge to be split.

      • Optionalcells: Cell[]

        Cell that should split the edge.

      • Optionalevt: MouseEvent | null

        MouseEvent that triggered the invocation.

      Returns boolean

  • Defined in view/mixin/DragDropMixin.type.ts:95

isSwimlane

isSwimlane: (cell: Cell, ignoreState?: boolean) => boolean

Returns true if the given cell is a swimlane in the graph. A swimlane is a container cell with some specific behaviour. This implementation checks if the shape associated with the given cell is a SwimlaneShape.

Type Declaration

    • (cell: Cell, ignoreState?: boolean): boolean
    • Parameters

      • cell: Cell

        Cell to be checked.

      • OptionalignoreState: boolean

        Optional boolean that specifies if the cell state should be ignored.

      Returns boolean

  • Defined in view/mixin/SwimlaneMixin.type.ts:97

isSwimlaneNesting

isSwimlaneNesting: () => boolean

Returns swimlaneNesting as a boolean.

  • Defined in view/mixin/SwimlaneMixin.type.ts:134

isSwimlaneSelectionEnabled

isSwimlaneSelectionEnabled: () => boolean

Returns swimlaneSelectionEnabled as a boolean.

  • Defined in view/mixin/SwimlaneMixin.type.ts:147

isSyntheticEventIgnored

isSyntheticEventIgnored: (
    evtName: string,
    me: InternalMouseEvent,
    sender: any,
) => boolean

Hook for ignoring synthetic mouse events after touchend in Firefox.

  • Defined in view/mixin/EventsMixin.type.ts:275

isTerminalPointMovable

isTerminalPointMovable: (cell: Cell, source: boolean) => boolean

Returns true if the given terminal point is movable. This is independent from isCellConnectable and isCellDisconnectable and controls if terminal points can be moved in the graph if the edge is not connected. Note that it is required for this to return true to connect unconnected edges.

This implementation returns true.

Type Declaration

    • (cell: Cell, source: boolean): boolean
    • Parameters

      • cell: Cell

        Cell whose terminal point should be moved.

      • source: boolean

        Boolean indicating if the source or target terminal should be moved.

      Returns boolean

  • Defined in view/mixin/TerminalMixin.type.ts:32

isTimerAutoScroll

isTimerAutoScroll: () => boolean
  • Defined in view/mixin/PanningMixin.type.ts:68

isToggleEvent

isToggleEvent: (evt: MouseEvent) => boolean

Returns true if the given event is a toggle event.

This implementation returns true if the meta key (Cmd) is pressed on Macs or if control is pressed on any other platform.

  • Defined in view/mixin/EventsMixin.type.ts:388

isTransparentClickEvent

isTransparentClickEvent: (evt: MouseEvent) => boolean

Hook for implementing click-through behaviour on selected cells. If this method returns true the cell behind the selected cell will be selected.

This implementation returns false.

  • Defined in view/mixin/EventsMixin.type.ts:381

isUseScrollbarsForPanning

isUseScrollbarsForPanning: () => boolean
  • Defined in view/mixin/PanningMixin.type.ts:67

isValidAncestor

isValidAncestor: (cell: Cell | null, parent: Cell, recurse?: boolean) => boolean

Returns whether the specified parent is a valid ancestor of the specified cell, either direct or indirectly based on whether ancestor recursion is enabled.

Type Declaration

    • (cell: Cell | null, parent: Cell, recurse?: boolean): boolean
    • Parameters

      • cell: Cell | null

        Cell the possible child cell

      • parent: Cell

        Cell the possible parent cell

      • Optionalrecurse: boolean

        boolean whether to recurse the child ancestors. Default is false.

      Returns boolean

  • Defined in view/mixin/CellsMixin.type.ts:742

isValidConnection

isValidConnection: (source: Cell | null, target: Cell | null) => boolean

Returns true if the given target cell is a valid target for source.

This is a boolean implementation for not allowing connections between certain pairs of vertices and is called by getEdgeValidationError.

This implementation returns true if isValidSource returns true for the source and isValidTarget returns true for the target.

Type Declaration

    • (source: Cell | null, target: Cell | null): boolean
    • Parameters

      • source: Cell | null

        Cell that represents the source cell.

      • target: Cell | null

        Cell that represents the target cell.

      Returns boolean

  • Defined in view/mixin/ConnectionsMixin.type.ts:249

isValidDropTarget

isValidDropTarget: (
    cell: Cell,
    cells?: Cell[],
    evt?: MouseEvent | null,
) => boolean

Returns true if the given cell is a valid drop target for the specified cells.

If splitEnabled is true then this returns isSplitTarget for the given arguments else it returns true if the cell is not collapsed and its child count is greater than 0.

Type Declaration

    • (cell: Cell, cells?: Cell[], evt?: MouseEvent | null): boolean
    • Parameters

      • cell: Cell

        Cell that represents the possible drop target.

      • Optionalcells: Cell[]

        Cell that should be dropped into the target.

      • Optionalevt: MouseEvent | null

        Mouseevent that triggered the invocation.

      Returns boolean

  • Defined in view/mixin/SwimlaneMixin.type.ts:109

isValidSource

isValidSource: (cell: Cell | null) => boolean

Returns true if the given cell is a valid source for new connections.

This implementation returns true for all non-null values and is called by is called by isValidConnection.

Type Declaration

    • (cell: Cell | null): boolean
    • Parameters

      • cell: Cell | null

        Cell that represents a possible source or null.

      Returns boolean

  • Defined in view/mixin/ConnectionsMixin.type.ts:230

isValidTarget

isValidTarget: (cell: Cell | null) => boolean

Returns isValidSource for the given cell. This is called by isValidConnection.

Type Declaration

    • (cell: Cell | null): boolean
    • Parameters

      • cell: Cell | null

        Cell that represents a possible target or null.

      Returns boolean

  • Defined in view/mixin/ConnectionsMixin.type.ts:237

isVertexLabelsMovable

isVertexLabelsMovable: () => boolean

Returns vertexLabelsMovable.

  • Defined in view/mixin/VertexMixin.type.ts:186

isWrapping

isWrapping: (cell: Cell) => boolean

This enables wrapping for HTML labels.

Returns true if no white-space CSS style directive should be used for displaying the given cells label.

This implementation returns true if 'whiteSpace' in the style of the given cell is 'wrap'.

This is used as a workaround for IE ignoring the white-space directive of child elements if the directive appears in a parent element. It should be overridden to return true if a white-space directive is used in the HTML markup that represents the given cells label. In order for HTML markup to work in labels, isHtmlLabel must also return true for the given cell.

Type Declaration

    • (cell: Cell): boolean
    • Parameters

      • cell: Cell

        Cell whose label should be wrapped.

      Returns boolean

Example

const getLabel = graph.getLabel;
graph.getLabel = function(cell) {
const tmp = getLabel.apply(this, arguments); // "supercall"

if (this.model.isEdge(cell)) {
tmp = '<div style="width: 150px; white-space:normal;">'+tmp+'</div>';
}

return tmp;
}

graph.isWrapping = function(state) {
return this.model.isEdge(state.cell);
}

Makes sure no edge label is wider than 150 pixels, otherwise the content is wrapped. Note: No width must be specified for wrapped vertex labels as the vertex defines the width in its geometry.

  • Defined in view/mixin/LabelMixin.type.ts:136

keepEdgesInBackground

keepEdgesInBackground: boolean = false

Specifies if edges should appear in the background regardless of their order in the model. If keepEdgesInForeground and keepEdgesInBackground are both true then the normal order is applied.

Default

false
  • Defined in view/AbstractGraph.ts:353

keepEdgesInForeground

keepEdgesInForeground: boolean = false

Specifies if edges should appear in the foreground regardless of their order in the model. If keepEdgesInForeground and keepEdgesInBackground are both true then the normal order is applied.

Default

false
  • Defined in view/AbstractGraph.ts:345

keepSelectionVisibleOnZoom

keepSelectionVisibleOnZoom: boolean

Specifies if the viewport should automatically contain the selection cells after a zoom operation.

Default

false
  • Defined in view/mixin/ZoomMixin.type.ts:31

labelChanged

labelChanged: (
    cell: Cell,
    value: any,
    evt: EventObject | InternalMouseEvent,
) => Cell

Sets the label of the specified cell to the given value using cellLabelChanged and fires InternalEvent.LABEL_CHANGED while the transaction is in progress.

Type Declaration

    • (cell: Cell, value: any, evt: EventObject | InternalMouseEvent): Cell
    • Parameters

      • cell: Cell

        Cell whose label should be changed.

      • value: any

        New label to be assigned.

      • evt: EventObject | InternalMouseEvent

        Optional event that triggered the change.

      Returns Cell

      The cell whose label was changed.

  • Defined in view/mixin/EditingMixin.type.ts:72

labelsVisible

labelsVisible: boolean

Specifies if labels should be visible. This is used in getLabel.

Default

true
  • Defined in view/mixin/LabelMixin.type.ts:25

lastEvent

lastEvent: any
  • Defined in view/mixin/EventsMixin.type.ts:38

lastMouseX

lastMouseX: number | null
  • Defined in view/mixin/EventsMixin.type.ts:32

lastMouseY

lastMouseY: number | null
  • Defined in view/mixin/EventsMixin.type.ts:33

lastTouchCell

lastTouchCell: Cell | null
  • Defined in view/mixin/EventsMixin.type.ts:29

lastTouchEvent

lastTouchEvent: MouseEvent | null
  • Defined in view/mixin/EventsMixin.type.ts:27

lastTouchTime

lastTouchTime: number

Holds the time of the last touch event for double click detection.

Default

0
  • Defined in view/mixin/EventsMixin.type.ts:110

lastTouchX

lastTouchX: number

Holds the x-coordinate of the last touch event for double tap detection.

Default

0
  • Defined in view/mixin/EventsMixin.type.ts:98

lastTouchY

lastTouchY: number

Holds the x-coordinate of the last touch event for double tap detection.

Default

0
  • Defined in view/mixin/EventsMixin.type.ts:104

maximumContainerSize

maximumContainerSize: Rectangle | null = null

Rectangle that specifies the maximum size of the container if resizeContainer is true.

  • Defined in view/AbstractGraph.ts:323

maximumGraphBounds

maximumGraphBounds: Rectangle | null = null

Rectangle that specifies the area in which all cells in the diagram should be placed. Uses in getMaximumGraphBounds. Use a width or height of 0 if you only want to give a upper, left corner.

  • Defined in view/AbstractGraph.ts:304

minimumContainerSize

minimumContainerSize: Rectangle | null = null

Rectangle that specifies the minimum size of the container if resizeContainer is true.

  • Defined in view/AbstractGraph.ts:317

minimumGraphSize

minimumGraphSize: Rectangle | null = null

Rectangle that specifies the minimum size of the graph. This is ignored if the graph container has no scrollbars.

Default

null
  • Defined in view/AbstractGraph.ts:311

minPageBreakDist

minPageBreakDist: number = 20

Specifies the minimum distance in pixels for page breaks to be visible.

Default

20
  • Defined in view/AbstractGraph.ts:249

model

model: GraphDataModel

Holds the GraphDataModel that contains the cells to be displayed.

  • Defined in view/AbstractGraph.ts:151

mouseListeners

mouseListeners: MouseListenerSet[] = []

Holds the mouse event listeners. See fireMouseEvent.

  • Defined in view/AbstractGraph.ts:109
  • Defined in view/mixin/EventsMixin.type.ts:26

mouseMoveRedirect

mouseMoveRedirect: MouseEventListener | null
  • Defined in view/mixin/EventsMixin.type.ts:36

mouseUpRedirect

mouseUpRedirect: MouseEventListener | null
  • Defined in view/mixin/EventsMixin.type.ts:37

moveCells

moveCells: (
    cells: Cell[],
    dx?: number,
    dy?: number,
    clone?: boolean,
    target?: Cell | null,
    evt?: MouseEvent | null,
    mapping?: any,
) => Cell[]

Moves or clones the specified cells and moves the cells or clones by the given amount, adding them to the optional target cell. The evt is the mouse event as the mouse was released. The change is carried out using cellsMoved. This method fires Event#MOVE_CELLS while the transaction is in progress.

Use the following code to move all cells in the graph.

graph.moveCells(graph.getChildCells(null, true, true), 10, 10);

Type Declaration

    • (
          cells: Cell[],
          dx?: number,
          dy?: number,
          clone?: boolean,
          target?: Cell | null,
          evt?: MouseEvent | null,
          mapping?: any,
      ): Cell[]
    • Parameters

      • cells: Cell[]

        Array of Cell to be moved, cloned or added to the target.

      • Optionaldx: number

        Integer that specifies the x-coordinate of the vector. Default is 0.

      • Optionaldy: number

        Integer that specifies the y-coordinate of the vector. Default is 0.

      • Optionalclone: boolean

        Boolean indicating if the cells should be cloned. Default is false.

      • Optionaltarget: Cell | null

        Cell that represents the new parent of the cells.

      • Optionalevt: MouseEvent | null

        MouseEvent that triggered the invocation.

      • Optionalmapping: any

        Optional mapping for existing clones.

      Returns Cell[]

      the cells that were moved.

  • Defined in view/mixin/CellsMixin.type.ts:598

multigraph

multigraph: boolean = true

Specifies if multiple edges in the same direction between the same pair of vertices are allowed.

Default

true
  • Defined in view/AbstractGraph.ts:387

multiplicities

multiplicities: Multiplicity[] = []

An array of Multiplicity describing the allowed connections in a graph.

  • Defined in view/AbstractGraph.ts:114

nativeDblClickEnabled

nativeDblClickEnabled: boolean

Specifies if native double click events should be detected.

Default

true
  • Defined in view/mixin/EventsMixin.type.ts:74

options

options: GraphFoldingOptions = ...

Folding options.

  • Defined in view/AbstractGraph.ts:117

orderCells

orderCells: (back: boolean, cells?: Cell[]) => Cell[]

Moves the given cells to the front or back. The change is carried out using cellsOrdered.

This method fires InternalEvent.ORDER_CELLS while the transaction is in progress.

Type Declaration

    • (back: boolean, cells?: Cell[]): Cell[]
    • Parameters

      • back: boolean

        Boolean that specifies if the cells should be moved to back. Default is false.

      • Optionalcells: Cell[]

        Array of Cell to move to the background. If not set, then the selection cells are used.

      Returns Cell[]

  • Defined in view/mixin/OrderMixin.type.ts:29

pageBreakColor

pageBreakColor: string = 'gray'

Specifies the color for page breaks.

Default

gray
  • Defined in view/AbstractGraph.ts:237

pageBreakDashed

pageBreakDashed: boolean = true

Specifies the page breaks should be dashed.

Default

true
  • Defined in view/AbstractGraph.ts:243

pageBreaksVisible

pageBreaksVisible: boolean = false

Specifies if a dashed line should be drawn between multiple pages. If you change this value while a graph is being displayed then you should call sizeDidChange to force an update of the display.

Default

false
  • Defined in view/AbstractGraph.ts:231

pageFormat

pageFormat: Rectangle = ...

Specifies the page format for the background page. This is used as the default in PrintPreview and for painting the background page if pageVisible is true and the page breaks if pageBreaksVisible is true.

Default

PAGE_FORMAT_A4_PORTRAIT

  • Defined in view/AbstractGraph.ts:130

pageScale

pageScale: number = 1.5

Specifies the scale of the background page. Not yet implemented.

Default

1.5
  • Defined in view/AbstractGraph.ts:263

pageVisible

pageVisible: boolean = false

Specifies if the background page should be visible. Not yet implemented.

Default

false
  • Defined in view/AbstractGraph.ts:223

paintBackground

paintBackground: Function | null = null
  • Defined in view/AbstractGraph.ts:83

panDx

panDx: number

Current horizontal panning value.

Default

0
  • Defined in view/mixin/PanningMixin.type.ts:59

panDy

panDy: number

Current vertical panning value.

Default

0
  • Defined in view/mixin/PanningMixin.type.ts:65

panGraph

panGraph: (dx: number, dy: number) => void

Shifts the graph display by the given amount. This is used to preview panning operations, use GraphView.setTranslate to set a persistent translation of the view.

Fires InternalEvent.PAN.

Type Declaration

    • (dx: number, dy: number): void
    • Parameters

      • dx: number

        Amount to shift the graph along the x-axis.

      • dy: number

        Amount to shift the graph along the y-axis.

      Returns void

  • Defined in view/mixin/PanningMixin.type.ts:84

portsEnabled

portsEnabled: boolean

Specifies if ports are enabled. This is used in cellConnected to update the respective style.

Default

true
  • Defined in You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.