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 — GraphView | @maxgraph/core

  • GraphView

Class GraphView

GraphView

Hierarchy (View Summary)

  • EventSource
    • GraphView
  • Defined in view/GraphView.ts:98
Index

Constructors

constructor

Properties

allowEval backgroundImage backgroundPageShape backgroundPane canvas captureDocumentGesture currentRoot decoratorPane doneResource drawPane EMPTY_POINT endHandler eventListeners eventsEnabled eventSource graph graphBounds lastForegroundHtmlNode lastForegroundNode lastHtmlNode lastNode moveHandler overlayPane rendering scale states translate updateStyle updatingDocumentResource

Methods

addListener clear createBackgroundPageShape createHtml createHtmlPane createState createSvg destroy fireEvent getBackgroundPageBounds getBackgroundPane getBoundingBox getBounds getCanvas getCellStates getDecoratorPane getDrawPane getEdgeStyle getEmptyBounds getEventSource getFixedTerminalPoint getFloatingTerminalPoint getGraphBounds getNextPoint getOverlayPane getPerimeterBounds getPerimeterFunction getPerimeterPoint getPoint getRelativePoint getRoutingCenterX getRoutingCenterY getScale getState getStates getTerminalPort getTranslate getVisibleTerminal init installListeners invalidate isAllowEval isContainerEvent isEventsEnabled isLoopStyleEnabled isRendering isScrollEvent redrawBackgroundImage refresh removeListener removeState resetValidationState revalidate scaleAndTranslate setAllowEval setCurrentRoot setEventsEnabled setEventSource setGraphBounds setRendering setScale setStates setTranslate stateValidated transformControlPoint updateBoundsFromStencil updateCellState updateContainerStyle updateEdgeBounds updateEdgeLabelOffset updateEdgeState updateFixedTerminalPoint updateFixedTerminalPoints updateFloatingTerminalPoint updateFloatingTerminalPoints updateHtmlCanvasSize updatePoints updateVertexLabelOffset updateVertexState validate validateBackground validateBackgroundImage validateBackgroundPage validateCell validateCellState viewStateChanged

Constructors

constructor

  • new GraphView(graph: AbstractGraph): GraphView

    Parameters

    • graph: AbstractGraph

    Returns GraphView

    Overrides EventSource.constructor

    • Defined in view/GraphView.ts:99

Properties

allowEval

allowEval: boolean = false

Specifies if string values in cell styles should be evaluated using eval.

This will only be used if the string values can't be mapped to objects using EdgeStyleRegistry or PerimeterRegistry when resolving CellStateStyle.edgeStyle and CellStateStyle.perimeter respectively.

WARNING: Enabling this switch carries a possible security risk.

Default

false
  • Defined in view/GraphView.ts:148

backgroundImage

backgroundImage: ImageShape | null = null
  • Defined in view/GraphView.ts:106

backgroundPageShape

backgroundPageShape: Shape | null = null
  • Defined in view/GraphView.ts:108

backgroundPane

backgroundPane: HTMLElement | SVGElement
  • Defined in view/GraphView.ts:115

canvas

canvas: HTMLElement | SVGElement
  • Defined in view/GraphView.ts:113

captureDocumentGesture

captureDocumentGesture: boolean = true

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

  • Defined in view/GraphView.ts:154

currentRoot

currentRoot: Cell | null = null

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

  • Defined in view/GraphView.ts:170

decoratorPane

decoratorPane: HTMLElement | SVGElement
  • Defined in view/GraphView.ts:121

doneResource

doneResource: string = ...

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

Default

'done'
  • Defined in view/GraphView.ts:129

drawPane

drawPane: HTMLElement | SVGElement
  • Defined in view/GraphView.ts:117

EMPTY_POINT

EMPTY_POINT: Point = ...
  • Defined in view/GraphView.ts:110

endHandler

endHandler: MouseEventListener | null = null
  • Defined in view/GraphView.ts:2418

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

graph

graph: AbstractGraph

Reference to the enclosing AbstractGraph.

  • Defined in view/GraphView.ts:165

graphBounds

graphBounds: Rectangle = ...
  • Defined in view/GraphView.ts:172

lastForegroundHtmlNode

lastForegroundHtmlNode: HTMLElement | SVGElement | null = null

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

  • Defined in view/GraphView.ts:209

lastForegroundNode

lastForegroundNode: HTMLElement | SVGElement | null = null

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

  • Defined in view/GraphView.ts:204

lastHtmlNode

lastHtmlNode: HTMLElement | SVGElement | null = null

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

  • Defined in view/GraphView.ts:199

lastNode

lastNode: HTMLElement | SVGElement | null = null

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

  • Defined in view/GraphView.ts:194

moveHandler

moveHandler: MouseEventListener | null = null
  • Defined in view/GraphView.ts:2419

overlayPane

overlayPane: HTMLElement | SVGElement
  • Defined in view/GraphView.ts:119

rendering

rendering: boolean = true

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

  • Defined in view/GraphView.ts:160

scale

scale: number = 1
  • Defined in view/GraphView.ts:174

states

states: Map<Cell, CellState> = ...
  • Defined in view/GraphView.ts:182

translate

translate: Point = ...

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

  • Defined in view/GraphView.ts:180

updateStyle

updateStyle: boolean = false

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

  • Defined in view/GraphView.ts:189

updatingDocumentResource

updatingDocumentResource: string = ...

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

Default

'updatingSelection'
  • Defined in view/GraphView.ts:137

Methods

addListener

  • addListener(name: string, funct: Function): void

    Binds the specified function to the given event name. If no event name is given, then the listener is registered for all events.

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

    Parameters

    • name: string
    • funct: Function

    Returns void

    Inherited from EventSource.addListener

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

clear

  • clear(cell?: Cell | null, force?: boolean, recurse?: boolean): void

    Removes the state of the given cell and all descendants if the given cell is not the current root.

    Parameters

    • Optionalcell: Cell | null

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

    • force: boolean = false

      Optional boolean indicating if the current root should be ignored for recursion. Default is false.

    • recurse: boolean = true

      Optional boolean indicating if the descendants should be cleared as well. Default is true.

    Returns void

    • Defined in view/GraphView.ts:470

createBackgroundPageShape

  • createBackgroundPageShape(bounds: Rectangle): RectangleShape

    Creates and returns the shape used as the background page.

    Parameters

    • bounds: Rectangle

      Rectangle that represents the bounds of the shape.

    Returns RectangleShape

    • Defined in view/GraphView.ts:632

createHtml

  • createHtml(): void

    Creates the DOM nodes for the HTML display.

    Returns void

    • Defined in view/GraphView.ts:2292

createHtmlPane

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

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

    Parameters

    • width: string
    • height: string

    Returns HTMLElement

    • Defined in view/GraphView.ts:2342

createState

  • createState(cell: Cell): CellState

    Creates and returns an CellState for the given cell and initializes it using cellRenderer.initialize.

    Parameters

    • cell: Cell

      Cell for which a new CellState should be created.

    Returns CellState

    • Defined in view/GraphView.ts:2039

createSvg

  • createSvg(): void

    Creates and returns the DOM nodes for the SVG display.

    Returns void

    • Defined in view/GraphView.ts:2254

destroy

  • destroy(): void

    Destroys the view and all its resources.

    Returns void

    Overrides EventSource.destroy

    • Defined in view/GraphView.ts:2378

fireEvent

  • fireEvent(evt: EventObject, sender?: EventTarget | null): void

    Dispatches the given event to the listeners which are registered for the event. The sender argument is optional. The current execution scope ("this") is used for the listener invocation.

    Example:

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

    Parameters

    • evt: EventObject

      EventObject that represents the event.

    • sender: EventTarget | null = null

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

    Returns void

    Inherited from EventSource.fireEvent

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

getBackgroundPageBounds

  • getBackgroundPageBounds(): Rectangle

    Returns the bounds for the background page.

    Returns Rectangle

    • Defined in view/GraphView.ts:739

getBackgroundPane

  • getBackgroundPane(): HTMLElement | SVGElement

    Returns the DOM node that represents the background layer.

    Returns HTMLElement | SVGElement

    • Defined in view/GraphView.ts:330

getBoundingBox

  • getBoundingBox(state?: CellState | null, recurse?: boolean): Rectangle | null

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

    Parameters

    • state: CellState | null = null

      CellState whose bounding box should be returned.

    • recurse: boolean = true

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

    Returns Rectangle | null

    • Defined in view/GraphView.ts:587

getBounds

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

    Returns the union of all CellStates for the given array of Cell.

    Parameters

    • cells: Cell[]

      Array of Cell whose bounds should be returned.

    Returns Rectangle | null

    • Defined in view/GraphView.ts:360

getCanvas

  • getCanvas(): HTMLElement | SVGElement

    Returns the DOM node that contains the background-, draw-, overlay- and decorator- panes.

    Returns HTMLElement | SVGElement

    • Defined in view/GraphView.ts:323

getCellStates

  • getCellStates(cells?: Cell[] | null): CellState[]

    Returns the CellStates for the given array of Cell.

    The array contains all states that are not null, that is, the returned array may have fewer elements than the given array.

    If no argument is given, then this returns the CellState of states.

    Parameters

    • cells: Cell[] | null = null

    Returns CellState[]

    • Defined in view/GraphView.ts:1998

getDecoratorPane

  • getDecoratorPane(): HTMLElement | SVGElement

    Returns the DOM node that represents the topmost drawing layer.

    Returns HTMLElement | SVGElement

    • Defined in view/GraphView.ts:351

getDrawPane

  • getDrawPane(): HTMLElement | SVGElement

    Returns the DOM node that represents the main drawing layer.

    Returns HTMLElement | SVGElement

    • Defined in view/GraphView.ts:337

getEdgeStyle

  • getEdgeStyle(
        edge: CellState,
        points?: Point[],
        source?: CellState | null,
        target?: CellState | null,
    ): EdgeStyleFunction | null

    Returns the edge style function to be used to render the given edge state.

    Parameters

    • edge: CellState
    • points: Point[] = []
    • source: CellState | null = null
    • target: CellState | null = null

    Returns EdgeStyleFunction | null

    • Defined in view/GraphView.ts:1341

getEmptyBounds

  • getEmptyBounds(): Rectangle

    Returns the bounds for an empty graph. This returns a rectangle at translate with the size of 0 x 0.

    Returns Rectangle

    • Defined in view/GraphView.ts:575

getEventSource

  • getEventSource(): EventTarget | null

    Returns eventSource.

    Returns EventTarget | null

    Inherited from EventSource.getEventSource

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

getFixedTerminalPoint

  • getFixedTerminalPoint(
        edge: CellState,
        terminal: CellState | null,
        source: boolean,
        constraint: ConnectionConstraint | null,
    ): Point | null

    Returns the fixed source or target terminal point for the given edge.

    Parameters

    • edge: CellState

      CellState whose terminal point should be returned.

    • terminal: CellState | null

      CellState which represents the actual terminal.

    • source: boolean

      Boolean that specifies if the terminal is the source.

    • constraint: ConnectionConstraint | null

      ConnectionConstraint that specifies the connection.

    Returns Point | null

    • Defined in view/GraphView.ts:1182

getFloatingTerminalPoint

  • getFloatingTerminalPoint(
        edge: CellState,
        start: CellState,
        end: CellState | null,
        source: boolean,
    ): Point | null

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

    Parameters

    • edge: CellState

      CellState whose terminal point should be returned.

    • start: CellState

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

    • end: CellState | null

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

    • source: boolean

      Boolean indicating if start is the source terminal state.

    Returns Point | null

    • Defined in view/GraphView.ts:1427

getGraphBounds

  • getGraphBounds(): Rectangle

    Returns graphBounds.

    Returns Rectangle

    • Defined in view/GraphView.ts:214

getNextPoint

  • getNextPoint(
        edge: CellState,
        opposite: CellState | null,
        source?: boolean,
    ): Point

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

    Parameters

    • edge: CellState

      CellState that represents the edge.

    • opposite: CellState | null

      CellState that represents the opposite terminal.

    • source: boolean = false

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

    Returns Point

    • Defined in view/GraphView.ts:1646

getOverlayPane

  • getOverlayPane(): HTMLElement | SVGElement

    Returns the DOM node that represents the layer above the drawing layer.

    Returns HTMLElement | SVGElement

    • Defined in view/GraphView.ts:344

getPerimeterBounds

  • getPerimeterBounds(terminal: CellState, border?: number): Rectangle

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

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

    Parameters

    • terminal: CellState

      CellState that represents the terminal.

    • border: number = 0

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

    Returns Rectangle

    Example

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

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

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

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

    return oldGetPerimeterBounds.apply(this, arguments);
    };
    • Defined in view/GraphView.ts:1610

getPerimeterFunction

  • getPerimeterFunction(state: CellState): PerimeterFunction | null

    Returns the perimeter function for the given state.

    Parameters

    • state: CellState

    Returns PerimeterFunction | null

    • Defined in view/GraphView.ts:1618

getPerimeterPoint

  • getPerimeterPoint(
        terminal: CellState,
        next: Point,
        orthogonal: boolean,
        border?: number,
    ): Point | null

    Returns an Point that defines the location of the intersection point between the perimeter and the line between the center of the shape and the given point.

    Parameters

    • terminal: CellState

      CellState for the source or target terminal.

    • next: Point

      Point that lies outside the given terminal.

    • orthogonal: boolean

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

    • border: number = 0

      Optional border between the perimeter and the shape.

    Returns Point | null

    • Defined in view/GraphView.ts:1501

getPoint

  • getPoint(state: CellState, geometry?: Geometry | null): Point

    Returns the absolute point on the edge for the given relative Geometry as an Point. The edge is represented by the given CellState.

    Parameters

    • state: CellState

      CellState that represents the state of the parent edge.

    • geometry: Geometry | null = null

      Geometry that represents the relative location.

    Returns Point

    • Defined in view/GraphView.ts:1767

getRelativePoint

  • getRelativePoint(edgeState: CellState, x: number, y: number): Point

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

    Parameters

    • edgeState: CellState

      CellState that represents the state of the parent edge.

    • x: number

      Specifies the x-coordinate of the absolute label location.

    • y: number

      Specifies the y-coordinate of the absolute label location.

    Returns Point

    • Defined in view/GraphView.ts:1831

getRoutingCenterX

  • getRoutingCenterX(state: CellState): number

    Returns the x-coordinate of the center point for automatic routing.

    Parameters

    • state: CellState

    Returns number

    • Defined in view/GraphView.ts:1557

getRoutingCenterY

  • getRoutingCenterY(state: CellState): number

    Returns the y-coordinate of the center point for automatic routing.

    Parameters

    • state: CellState

    Returns number

    • Defined in view/GraphView.ts:1565

getScale

  • getScale(): number

    Returns the scale.

    Returns number

    • Defined in view/GraphView.ts:228

getState

  • getState(cell: Cell, create?: boolean): CellState | null

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

    Parameters

    • cell: Cell

      Cell for which the CellState should be returned.

    • create: boolean = false

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

    Returns CellState | null

    • Defined in view/GraphView.ts:1976

getStates

  • getStates(): Map<Cell, CellState>

    Returns states.

    Returns Map<Cell, CellState>

    • Defined in view/GraphView.ts:309

getTerminalPort

  • getTerminalPort(
        state: CellState,
        terminal: CellState,
        source?: boolean,
    ): CellState

    Returns an CellState that represents the source or target terminal or port for the given edge.

    Parameters

    • state: CellState

      CellState that represents the state of the edge.

    • terminal: CellState

      CellState that represents the terminal.

    • source: boolean = false

      Boolean indicating if the given terminal is the source terminal.

    Returns CellState

    • Defined in view/GraphView.ts:1469

getTranslate

  • getTranslate(): Point

    Returns the translate.

    Returns Point

    • Defined in view/GraphView.ts:252

getVisibleTerminal

  • getVisibleTerminal(edge: Cell, source: boolean): Cell | null

    Returns the nearest ancestor terminal that is visible. The edge appears to be connected to this terminal on the display. The result of this method is cached in CellState.getVisibleTerminalState.

    Parameters

    • edge: Cell

      Cell whose visible terminal should be returned.

    • source: boolean

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

    Returns Cell | null

    • Defined in view/GraphView.ts:1671

init

  • init(): void

    Initializes the graph event dispatch loop for the specified container and invokes create to create the required DOM nodes for the display.

    Returns void

    • Defined in view/GraphView.ts:2097

installListeners

  • installListeners(): void

    Installs the required listeners in the container.

    Returns void

    • Defined in view/GraphView.ts:2105

invalidate

  • invalidate(cell?: Cell | null, recurse?: boolean, includeEdges?: boolean): void

    Invalidates the state of the given cell, all its descendants and connected edges.

    Parameters

    • cell: Cell | null = null

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

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

    Returns void

    • Defined in view/GraphView.ts:497

isAllowEval

  • isAllowEval(): boolean

    Returns allowEval.

    Returns boolean

    • Defined in view/GraphView.ts:295

isContainerEvent

  • isContainerEvent(evt: MouseEvent): any

    Returns true if the event origin is one of the drawing panes or containers of the view.

    Parameters

    • evt: MouseEvent

    Returns any

    • Defined in view/GraphView.ts:2047

isEventsEnabled

  • isEventsEnabled(): boolean

    Returns eventsEnabled.

    Returns boolean

    Inherited from EventSource.isEventsEnabled

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

isLoopStyleEnabled

  • isLoopStyleEnabled(
        edge: CellState,
        points?: Point[],
        source?: CellState | null,
        target?: CellState | null,
    ): boolean

    Returns true if the given edge should be routed with AbstractGraph.defaultLoopStyle or the CellStateStyle.orthogonalLoop defined for the given edge. This implementation returns true if the given edge is a loop and does not

    Parameters

    • edge: CellState
    • points: Point[] = []
    • source: CellState | null = null
    • target: CellState | null = null

    Returns boolean

    • Defined in view/GraphView.ts:1317

isRendering

  • isRendering(): boolean

    Returns boolean

    • Defined in view/GraphView.ts:256

isScrollEvent

  • isScrollEvent(evt: MouseEvent | TouchEvent): boolean

    Parameters

    • evt: MouseEvent | TouchEvent

    Returns boolean

    • Defined in view/GraphView.ts:2066

redrawBackgroundImage

  • redrawBackgroundImage(backgroundImage: ImageShape, bg: ImageBox): void

    Updates the bounds and redraws the background image.

    Example:

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

    Parameters

    • backgroundImage: ImageShape

      ImageShape that represents the background image.

    • bg: ImageBox

      Image that specifies the image and its dimensions.

    Returns void

    Example

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

    backgroundImage.redraw();
    };
    • Defined in view/GraphView.ts:775

refresh

  • refresh(): void

    Clears the view if currentRoot is not null and revalidates.

    Returns void

    • Defined in view/GraphView.ts:448

removeListener

  • removeListener(funct: Function): void

    Removes all occurrences of the given listener from eventListeners.

    Parameters

    • funct: Function

    Returns void

    Inherited from EventSource.removeListener

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

removeState

  • removeState(cell: Cell): CellState | null

    Removes and returns the CellState for the given cell.

    Parameters

    • cell: Cell

      Cell for which the CellState should be removed.

    Returns CellState | null

    • Defined in view/GraphView.ts:2020

resetValidationState

  • resetValidationState(): void

    Resets the current validation state.

    Returns void

    • Defined in view/GraphView.ts:1094

revalidate

  • revalidate(): void

    Revalidates the complete view with all cell states.

    Returns void

    • Defined in view/GraphView.ts:458

scaleAndTranslate

  • scaleAndTranslate(scale: number, dx: number, dy: number): void

    Sets the scale and translation and fires a scale and translate event before calling revalidate followed by AbstractGraph.sizeDidChange.

    Parameters

    • scale: number

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

    • dx: number

      X-coordinate of the translation.

    • dy: number

      Y-coordinate of the translation.

    Returns void

    • Defined in view/GraphView.ts:412

setAllowEval

  • setAllowEval(value: boolean): void

    Sets allowEval.

    Parameters

    • value: boolean

    Returns void

    • Defined in view/GraphView.ts:302

setCurrentRoot

  • setCurrentRoot(root: Cell | null): Cell | null

    Sets and returns the current root and fires an undo event before calling AbstractGraph.sizeDidChange.

    Parameters

    • root: Cell | null

      Cell that specifies the root of the displayed cell hierarchy.

    Returns Cell | null

    • Defined in view/GraphView.ts:388

setEventsEnabled

  • setEventsEnabled(value: boolean): void

    Sets eventsEnabled.

    Parameters

    • value: boolean

    Returns void

    Inherited from EventSource.setEventsEnabled

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

setEventSource

  • setEventSource(value: EventTarget | null): void

    Sets eventSource.

    Parameters

    • value: EventTarget | null

    Returns void

    Inherited from EventSource.setEventSource

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

setGraphBounds

  • setGraphBounds(value: Rectangle): void

    Sets graphBounds.

    Parameters

    • value: Rectangle

    Returns void

    • Defined in view/GraphView.ts:221

setRendering

  • setRendering(value: boolean): void

    Parameters

    • value: boolean

    Returns void

    • Defined in view/GraphView.ts:260

setScale

  • setScale(value: number): void

    Sets the scale and fires a scale event before calling revalidate followed by AbstractGraph.sizeDidChange.

    Parameters

    • value: number

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

    Returns void

    • Defined in view/GraphView.ts:238

setStates

  • setStates(value: Map<Cell, CellState>): void

    Sets states.

    Parameters

    • value: Map<Cell, CellState>

    Returns void

    • Defined in view/GraphView.ts:316

setTranslate

  • setTranslate(dx: number, dy: number): void

    Sets the translation and fires a translate event before calling revalidate followed by AbstractGraph.sizeDidChange. The translation is the negative of the origin.

    Parameters

    • dx: number

      X-coordinate of the translation.

    • dy: number

      Y-coordinate of the translation.

    Returns void

    • Defined in view/GraphView.ts:272

stateValidated

  • stateValidated(state: CellState): void

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

    Parameters

    • state: CellState

      CellState that represents the cell state.

    Returns void

    • Defined in view/GraphView.ts:1107

transformControlPoint

  • transformControlPoint(
        state: CellState,
        pt: Point,
        ignoreScale?: boolean,
    ): Point | null

    Transforms the given control point to an absolute point.

    Parameters

    • state: CellState
    • pt: Point
    • ignoreScale: boolean = false

    Returns Point | null

    • Defined in view/GraphView.ts:1299

updateBoundsFromStencil

  • updateBoundsFromStencil(state: CellState | null): Rectangle | null

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

    Parameters

    • state: CellState | null

      CellState whose bounds should be updated.

    Returns Rectangle | null

    • Defined in view/GraphView.ts:1216

updateCellState

  • updateCellState(state: CellState): void

    Updates the given CellState.

    Parameters

    • state: CellState

      CellState to be updated.

    Returns void

    • Defined in view/GraphView.ts:891

updateContainerStyle

  • updateContainerStyle(container: HTMLElement): void

    Updates the style of the container after installing the SVG DOM elements.

    Parameters

    • container: HTMLElement

    Returns void

    • Defined in view/GraphView.ts:2361

updateEdgeBounds

  • updateEdgeBounds(state: CellState): void

    Updates the given state using the bounding box of the absolute points. Also updates CellState.terminalDistance, CellState.length and CellState.segments.

    Parameters

    • state: CellState

      CellState whose bounds should be updated.

    Returns void

    • Defined in view/GraphView.ts:1704

updateEdgeLabelOffset

  • updateEdgeLabelOffset(state: CellState): void

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

    Parameters

    • state: CellState

      CellState whose absolute offset should be updated.

    Returns void

    • Defined in view/GraphView.ts:1928

updateEdgeState

  • updateEdgeState(state: CellState, geo: Geometry): void

    Validates the given cell state.

    Parameters

    • state: CellState
    • geo: Geometry

    Returns void

    • Defined in view/GraphView.ts:990

updateFixedTerminalPoint

  • updateFixedTerminalPoint(
        edge: CellState,
        terminal: CellState | null,
        source: boolean,
        constraint: ConnectionConstraint | null,
    ): void

    Sets the fixed source or target terminal point on the given edge.

    Parameters

    • edge: CellState

      CellState whose terminal point should be updated.

    • terminal: CellState | null

      CellState which represents the actual terminal.

    • source: boolean

      Boolean that specifies if the terminal is the source.

    • constraint: ConnectionConstraint | null

      ConnectionConstraint that specifies the connection.

    Returns void

    • Defined in view/GraphView.ts:1162

updateFixedTerminalPoints

  • updateFixedTerminalPoints(
        edge: CellState,
        source: CellState | null,
        target: CellState | null,
    ): void

    Sets the initial absolute terminal points in the given state before the edge style is computed.

    Parameters

    • edge: CellState

      CellState whose initial terminal points should be updated.

    • source: CellState | null

      CellState which represents the source terminal.

    • target: CellState | null

      CellState which represents the target terminal.

    Returns void

    • Defined in view/GraphView.ts:1135

updateFloatingTerminalPoint

  • updateFloatingTerminalPoint(
        edge: CellState,
        start: CellState,
        end: CellState | null,
        source: boolean,
    ): void

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

    Parameters

    • edge: CellState

      CellState whose terminal point should be updated.

    • start: CellState

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

    • end: CellState | null

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

    • source: boolean

      Boolean indicating if start is the source terminal state.

    Returns void

    • Defined in view/GraphView.ts:1406

updateFloatingTerminalPoints

  • updateFloatingTerminalPoints(
        state: CellState,
        source: CellState | null,
        target: CellState | null,
    ): void

    Updates the terminal points in the given state after the edge style was computed for the edge.

    Parameters

    • state: CellState

      CellState whose terminal points should be updated.

    • source: CellState | null

      CellState that represents the source terminal.

    • target: CellState | null

      CellState that represents the target terminal.

    Returns void

    • Defined in view/GraphView.ts:1379

updateHtmlCanvasSize

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

    Updates the size of the HTML canvas.

    Parameters

    • width: number
    • height: number

    Returns void

    • Defined in view/GraphView.ts:2320

updatePoints

  • updatePoints(
        edge: CellState,
        points: Point[],
        source: CellState | null,
        target: CellState | null,
    ): void

    Updates the absolute points in the given state using the specified array of Point as the relative points.

    Parameters

    • edge: CellState

      CellState whose absolute points should be updated.

    • points: Point[]

      Array of Point that constitute the relative points.

    • source: CellState | null

      CellState that represents the source terminal.

    • target: CellState | null

      CellState that represents the target terminal.

    Returns void

    • Defined in view/GraphView.ts:1252

updateVertexLabelOffset

  • updateVertexLabelOffset(state: CellState): void

    Updates the absoluteOffset of the given vertex cell state. This takes into account the label position styles.

    Parameters

    • state: CellState

      CellState whose absolute offset should be updated.

    Returns void

    • Defined in view/GraphView.ts:1031

updateVertexState

  • updateVertexState(state: CellState, geo: Geometry): void

    Validates the given cell state.

    Parameters

    • state: CellState
    • geo: Geometry

    Returns void

    • Defined in view/GraphView.ts:966

validate

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

    Calls validateCell and validateCellState and updates the graphBounds using getBoundingBox. Finally, the background is validated using validateBackground.

    Parameters

    • cell: Cell | null = null

      Optional Cell to be used as the root of the validation. Default is currentRoot or the root of the model.

    Returns void

    • Defined in view/GraphView.ts:550

validateBackground

  • validateBackground(): void

    Calls validateBackgroundImage and validateBackgroundPage.

    Returns void

    • Defined in view/GraphView.ts:639

validateBackgroundImage

  • validateBackgroundImage(): void

    Validates the background image.

    Returns void

    • Defined in view/GraphView.ts:647

validateBackgroundPage

  • validateBackgroundPage(): void

    Validates the background page.

    Returns void

    • Defined in view/GraphView.ts:674

validateCell

  • validateCell(cell: Cell, visible?: boolean): Cell

    Recursively creates the cell state for the given cell if visible is true and the given cell is visible. If the cell is not visible but the state exists then it is removed using removeState.

    Parameters

    • cell: Cell

      Cell whose CellState should be created.

    • visible: boolean = true

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

    Returns Cell

    • Defined in view/GraphView.ts:798

validateCellState

  • validateCellState(cell: Cell | null, recurse?: boolean): CellState | null

    Validates and repaints the CellState for the given Cell.

    Parameters

    • cell: Cell | null

      Cell whose CellState should be validated.

    • recurse: boolean = true

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

    Returns CellState | null

    • Defined in view/GraphView.ts:828

viewStateChanged

  • viewStateChanged(): void

    Invoked after scale and/or translate has changed.

    Returns void

    • Defined in view/GraphView.ts:440

Settings

Member Visibility
  • Protected
  • Inherited
Theme

On This Page

Constructors
constructor
Properties
allowEvalbackgroundImagebackgroundPageShapebackgroundPanecanvascaptureDocumentGesturecurrentRootdecoratorPanedoneResourcedrawPaneEMPTY_POINTendHandlereventListenerseventsEnabledeventSourcegraphgraphBoundslastForegroundHtmlNodelastForegroundNodelastHtmlNodelastNodemoveHandleroverlayPanerenderingscalestatestranslateupdateStyleupdatingDocumentResource
Methods
addListenerclearcreateBackgroundPageShapecreateHtmlcreateHtmlPanecreateStatecreateSvgdestroyfireEventgetBackgroundPageBoundsgetBackgroundPanegetBoundingBoxgetBoundsgetCanvasgetCellStatesgetDecoratorPanegetDrawPanegetEdgeStylegetEmptyBoundsgetEventSourcegetFixedTerminalPointgetFloatingTerminalPointgetGraphBoundsgetNextPointgetOverlayPanegetPerimeterBoundsgetPerimeterFunctiongetPerimeterPointgetPointgetRelativePointgetRoutingCenterXgetRoutingCenterYgetScalegetStategetStatesgetTerminalPortgetTranslategetVisibleTerminalinitinstallListenersinvalidateisAllowEvalisContainerEventisEventsEnabledisLoopStyleEnabledisRenderingisScrollEventredrawBackgroundImagerefreshremoveListenerremoveStateresetValidationStaterevalidatescaleAndTranslatesetAllowEvalsetCurrentRootsetEventsEnabledsetEventSourcesetGraphBoundssetRenderingsetScalesetStatessetTranslatestateValidatedtransformControlPointupdateBoundsFromStencilupdateCellStateupdateContainerStyleupdateEdgeBoundsupdateEdgeLabelOffsetupdateEdgeStateupdateFixedTerminalPointupdateFixedTerminalPointsupdateFloatingTerminalPointupdateFloatingTerminalPointsupdateHtmlCanvasSizeupdatePointsupdateVertexLabelOffsetupdateVertexStatevalidatevalidateBackgroundvalidateBackgroundImagevalidateBackgroundPagevalidateCellvalidateCellStateviewStateChanged
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.