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

  • Outline

Class Outline

Implements an outline (aka overview or minimap) for a Graph.

Set updateOnPan to true to enable updates while the source graph is panning.

Example

const outline = new Outline(graph, div);

To move the graph to the top, left corner the following code can be used.

const scale = graph.view.scale;
const bounds = graph.getGraphBounds();
graph.view.setTranslate(-bounds.x / scale, -bounds.y / scale);

To toggle the suspended mode, the following can be used.

outline.suspended = !outline.suspended;
if (!outline.suspended) {
outline.update(true);
}

Implements

  • MouseListenerSet
  • Defined in view/other/Outline.ts:72
Index

Constructors

constructor

Properties

active border bounds dx0 dy0 enabled graphRenderHint index labelsVisible minScale outline panHandler refreshHandler selectionBorder showViewport sizer sizerImage sizerSize source startX startY suspended updateHandler updateOnPan zoom

Methods

createGraph createSizer destroy getOutlineOffset getSourceContainerSize getSourceGraphBounds getTranslateForEvent init isEnabled mouseDown mouseMove mouseUp refresh setEnabled setZoomEnabled update

Constructors

constructor

  • new Outline(source: AbstractGraph, container?: HTMLElement | null): Outline

    Parameters

    • source: AbstractGraph
    • Optionalcontainer: HTMLElement | null

    Returns Outline

    • Defined in view/other/Outline.ts:73

Properties

active

active: boolean | null = null
  • Defined in view/other/Outline.ts:208

border

border: number = 10

Border to be added at the bottom and right.

Default

10
  • Defined in view/other/Outline.ts:256

bounds

bounds: Rectangle | null = null
  • Defined in view/other/Outline.ts:210

dx0

dx0: number | null = null
  • Defined in view/other/Outline.ts:218

dy0

dy0: number | null = null
  • Defined in view/other/Outline.ts:220

enabled

enabled: boolean = true

Specifies if events are handled.

Default

true
  • Defined in view/other/Outline.ts:244

graphRenderHint

graphRenderHint: string = 'exact'

Renderhint to be used for the outline graph.

Default

faster
  • Defined in view/other/Outline.ts:238

index

index: number | null = null
  • Defined in view/other/Outline.ts:222

labelsVisible

labelsVisible: boolean = false

Specifies if labels should be visible in the outline.

Default

false
  • Defined in view/other/Outline.ts:268

minScale

minScale: number = 0.0001

Minimum scale to be used.

Default

0.0001
  • Defined in view/other/Outline.ts:287

outline

outline: AbstractGraph | null = null

Reference to the AbstractGraph that renders the outline.

  • Defined in view/other/Outline.ts:232

panHandler

panHandler: ((sender: any, evt: EventObject) => void) | null = null
  • Defined in view/other/Outline.ts:206

refreshHandler

refreshHandler: ((sender: any, evt: EventObject) => void) | null = null
  • Defined in view/other/Outline.ts:204

selectionBorder

selectionBorder: RectangleShape | null = null
  • Defined in view/other/Outline.ts:200

showViewport

showViewport: boolean = true

Specifies a viewport rectangle should be shown.

Default

true
  • Defined in view/other/Outline.ts:250

sizer

sizer: RectangleShape | null = null
  • Defined in view/other/Outline.ts:198

sizerImage

sizerImage: ImageBox | null = null

Optional Image to be used for the sizer.

Default

null
  • Defined in view/other/Outline.ts:281

sizerSize

sizerSize: number = 8

Specifies the size of the sizer handler.

Default

8
  • Defined in view/other/Outline.ts:262

source

source: AbstractGraph

Reference to the source AbstractGraph.

  • Defined in view/other/Outline.ts:227

startX

startX: number | null = null
  • Defined in view/other/Outline.ts:214

startY

startY: number | null = null
  • Defined in view/other/Outline.ts:216

suspended

suspended: boolean = false

Optional boolean flag to suspend updates. This flag will also suspend repaints of the outline. To toggle this switch, use the following code.

Default

false

Example

nav.suspended = !nav.suspended;

if (!nav.suspended)
{
nav.update(true);
}
  • Defined in view/other/Outline.ts:306

updateHandler

updateHandler: ((sender: any, evt: EventObject) => void) | null = null
  • Defined in view/other/Outline.ts:202

updateOnPan

updateOnPan: boolean = false

Specifies if update should be called for InternalEvent.PAN in the source graph.

Default

false
  • Defined in view/other/Outline.ts:275

zoom

zoom: boolean = false
  • Defined in view/other/Outline.ts:212

Methods

createGraph

  • createGraph(container: HTMLElement): AbstractGraph

    Creates the AbstractGraph used in the outline.

    Parameters

    • container: HTMLElement

    Returns AbstractGraph

    • Defined in view/other/Outline.ts:311

createSizer

  • createSizer(): RectangleShape

    Creates the shape used as the sizer.

    Returns RectangleShape

    • Defined in view/other/Outline.ts:370

destroy

  • destroy(): void

    Destroy this outline and removes all listeners from source.

    Returns void

    • Defined in view/other/Outline.ts:740

getOutlineOffset

  • getOutlineOffset(scale?: number): Point | null

    Returns the offset for drawing the outline graph.

    Parameters

    • Optionalscale: number

    Returns Point | null

    • Defined in view/other/Outline.ts:405

getSourceContainerSize

  • getSourceContainerSize(): Rectangle

    Returns the size of the source container.

    Returns Rectangle

    • Defined in view/other/Outline.ts:393

getSourceGraphBounds

  • getSourceGraphBounds(): Rectangle

    Returns the offset for drawing the outline graph.

    Returns Rectangle

    • Defined in view/other/Outline.ts:413

getTranslateForEvent

  • getTranslateForEvent(me: InternalMouseEvent): Point

    Gets the translate for the given mouse event. Here is an example to limit the outline to stay within positive coordinates:

    Parameters

    • me: InternalMouseEvent

    Returns Point

    Example

    outline.getTranslateForEvent(me)
    {
    var pt = new mxPoint(me.getX() - this.startX, me.getY() - this.startY);

    if (!this.zoom)
    {
    var tr = this.source.view.translate;
    pt.x = Math.max(tr.x * this.outline.view.scale, pt.x);
    pt.y = Math.max(tr.y * this.outline.view.scale, pt.y);
    }

    return pt;
    };
    • Defined in view/other/Outline.ts:690

init

  • init(container: HTMLElement): void

    Initializes the outline inside the given container.

    Parameters

    • container: HTMLElement

    Returns void

    • Defined in view/other/Outline.ts:84

isEnabled

  • isEnabled(): boolean

    Returns true if events are handled. This implementation returns enabled.

    Returns boolean

    • Defined in view/other/Outline.ts:334

mouseDown

  • mouseDown(_sender: EventSource, me: InternalMouseEvent): void

    Handles the event by starting a translation or zoom.

    Parameters

    • _sender: EventSource
    • me: InternalMouseEvent

    Returns void

    Implementation of MouseListenerSet.mouseDown

    • Defined in view/other/Outline.ts:570

mouseMove

  • mouseMove(_sender: EventSource, me: InternalMouseEvent): void

    Handles the event by previewing the viewrect in graph and updating the rectangle that represents the viewrect in the outline.

    Parameters

    • _sender: EventSource
    • me: InternalMouseEvent

    Returns void

    Implementation of MouseListenerSet.mouseMove

    • Defined in view/other/Outline.ts:602

mouseUp

  • mouseUp(_sender: EventSource, me: InternalMouseEvent): void

    Handles the event by applying the translation or zoom to graph.

    Parameters

    • _sender: EventSource
    • me: InternalMouseEvent

    Returns void

    Implementation of MouseListenerSet.mouseUp

    • Defined in view/other/Outline.ts:697

refresh

  • refresh(): void

    Invokes update and revalidate the outline. This method is deprecated.

    Returns void

    • Defined in view/other/Outline.ts:362

setEnabled

  • setEnabled(value: boolean): void

    Enables or disables event handling. This implementation updates enabled.

    Parameters

    • value: boolean

      Boolean that specifies the new enabled state.

    Returns void

    • Defined in view/other/Outline.ts:344

setZoomEnabled

  • setZoomEnabled(value: boolean): void

    Enables or disables the zoom handling by showing or hiding the respective handle.

    Parameters

    • value: boolean

      Boolean that specifies the new enabled state.

    Returns void

    • Defined in view/other/Outline.ts:354

update

  • update(revalidate?: boolean): void

    Updates the outline.

    Parameters

    • revalidate: boolean = false

    Returns void

    • Defined in view/other/Outline.ts:420

Settings

Member Visibility
  • Protected
  • Inherited
Theme

On This Page

Example
Constructors
constructor
Properties
activeborderboundsdx0dy0enabledgraphRenderHintindexlabelsVisibleminScaleoutlinepanHandlerrefreshHandlerselectionBordershowViewportsizersizerImagesizerSizesourcestartXstartYsuspendedupdateHandlerupdateOnPanzoom
Methods
createGraphcreateSizerdestroygetOutlineOffsetgetSourceContainerSizegetSourceGraphBoundsgetTranslateForEventinitisEnabledmouseDownmouseMovemouseUprefreshsetEnabledsetZoomEnabledupdate
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.