Skip to main content

Interface: WorkspaceContext

Represents a context for the whole workspace, its stores and services.

This context is created once and exists for the full lifetime of the workspace.

Properties

PropertyModifierTypeDescription

disposeSignal

readonly

AbortSignal

Cancellation signal that becomes aborted when the workspace is disposed.

editor

readonly

EditorController

Stores, modifies and validates changes from the visual graph authoring.

getCommandBus

readonly

<T>(definition: CommandBusTopic<T>) => Events<T> & EventTrigger<T>

Gets a common command event bus for the given topic definition which allows interaction between related components.

The returned event bus will share triggered events between all observers for the same definition.

getElementStyle

readonly

(element: Element) => ProcessedTypeStyle

Computes a style to display target element in various parts of the UI.

getElementTypeStyle

readonly

(types: readonly ElementTypeIri[]) => ProcessedTypeStyle

Computes a style to display an element with target set of types in various parts of the UI.

group

readonly

(params: WorkspaceGroupParams) => Promise<EntityGroup>

Groups with animation multiple elements into an entity group.

The operation puts a command to the command history.

See

DataDiagramModel.group

model

readonly

DataDiagramModel

Stores the diagram content and asynchronously fetches from a data provider.

overlay

readonly

OverlayController

Controls UI overlays for the canvases, including dialogs and tasks.

performLayout

readonly

(params: WorkspacePerformLayoutParams) => Promise<void>

Computes and applies with animation graph layout algorithm on the diagram content.

A spinner overlay will be displayed if layout calculation will take too long (> 200ms).

The operation puts a command to the command history.

translation

readonly

Translation

Provides a translation for UI text strings.

triggerWorkspaceEvent

readonly

(key: WorkspaceEventKey) => void

Triggers a well-known workspace event.

ungroupAll

readonly

(params: WorkspaceUngroupAllParams) => Promise<EntityElement[]>

Ungroups with animation one or many entity groups into all contained elements.

The operation puts a command to the command history.

See

DataDiagramModel.ungroupAll

ungroupSome

readonly

(params: WorkspaceUngroupSomeParams) => Promise<EntityElement[]>

Ungroups with animation some entities from an entity group.

The operation puts a command to the command history.

See

DataDiagramModel.ungroupSome

view

readonly

SharedCanvasState

Stores common state and settings for all canvases in the workspace.