Skip to main content

Class: DiagramState

Implements

Constructors

constructor

new DiagramState(rootStore)

Parameters

NameType
rootStoreRootStore

Accessors

importGenerationId

get importGenerationId(): number

Returns

number


offset

get offset(): Point

Returns

Point

Implementation of

IUserInteractionTranslateAndZoom.offset


ref

get ref(): HtmlElementRefState

Returns

HtmlElementRefState


zoom

get zoom(): number

Returns

number

Implementation of

IUserInteractionTranslateAndZoom.zoom

Methods

export

export(): IDiagramState

Returns

IDiagramState


getPositionByPointer

getPositionByPointer(pointerPosition): Point

Get position on Diagram in its coordinates system (including zoom) by mouse/touch position.

Parameters

NameTypeDescription
pointerPositionPointposition of mouse or finger on the screen

Returns

Point


getRenderedZoom

getRenderedZoom(): null | number

Returns

null | number


import

import(state?): void

Parameters

NameType
state?IDiagramState

Returns

void


incrementImportGenerationId

incrementImportGenerationId(): void

Returns

void


setOffset

setOffset(newOffset): void

Parameters

NameType
newOffsetundefined | null | Point

Returns

void

Implementation of

IUserInteractionTranslate.setOffset


setTransformation

setTransformation(newOffset, newZoom): void

Parameters

NameType
newOffsetPoint
newZoomnumber

Returns

void


setZoom

setZoom(newZoom): void

Parameters

NameType
newZoomundefined | null | number

Returns

void


translate

translate(translateBy): void

Parameters

NameType
translateByPoint

Returns

void


translateAndZoomInto

translateAndZoomInto(translateBy, pointToZoomInto, zoomMultiplicator): void

Parameters

NameType
translateByPoint
pointToZoomIntoPoint
zoomMultiplicatornumber

Returns

void

Implementation of

IUserInteractionTranslateAndZoom.translateAndZoomInto


zoomIn

zoomIn(): void

Returns

void


zoomInto

zoomInto(pointToZoomInto, zoomMultiplicator): void

Parameters

NameType
pointToZoomIntoPoint
zoomMultiplicatornumber

Returns

void


zoomIntoCenter

zoomIntoCenter(zoomMultiplicator): void

Parameters

NameType
zoomMultiplicatornumber

Returns

void


zoomOut

zoomOut(): void

Returns

void


zoomToFit

zoomToFit(): void

Returns

void