Skip to main content

Interface: TrackedWorkspaceContext

Defined in: src/workspace/workspaceProvider.tsx:131

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

The context tracks ongoing async operations while it's actively mounted with mount() once or many times at the same time, and cancels all operations with WorkspaceContext.disposeSignal when fully unmounted.

Extends

Properties

PropertyModifierTypeDescriptionInherited from

disposeSignal

readonly

AbortSignal

Cancellation signal that becomes aborted when the workspace is disposed.

WorkspaceContext.disposeSignal

editor

readonly

EditorController

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

WorkspaceContext.editor

getCommandBus

readonly

<T>(definition) => 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.

WorkspaceContext.getCommandBus

getElementStyle

readonly

(element) => ProcessedTypeStyle

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

WorkspaceContext.getElementStyle

getElementTypeStyle

readonly

(types) => ProcessedTypeStyle

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

WorkspaceContext.getElementTypeStyle

group

readonly

(params) => Promise<EntityGroup>

Groups with animation multiple elements into an entity group.

The operation puts a command to the command history.

See

DataDiagramModel.group

Deprecated

Use groupEntities function instead.

WorkspaceContext.group

model

readonly

DataDiagramModel

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

WorkspaceContext.model

overlay

readonly

OverlayController

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

WorkspaceContext.overlay

performLayout

readonly

(params) => 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.

WorkspaceContext.performLayout

translation

readonly

Translation

Provides a translation for UI text strings.

Note: it is recommended to use useTranslation hook instead when possible.

WorkspaceContext.translation

triggerWorkspaceEvent

readonly

(key) => void

Triggers a well-known workspace event.

WorkspaceContext.triggerWorkspaceEvent

ungroupAll

readonly

(params) => 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

Deprecated

Use ungroupAllEntities function instead.

WorkspaceContext.ungroupAll

ungroupSome

readonly

(params) => Promise<EntityElement[]>

Ungroups with animation some entities from an entity group.

The operation puts a command to the command history.

See

DataDiagramModel.ungroupSome

Deprecated

Use ungroupSomeEntities function instead.

WorkspaceContext.ungroupSome

view

readonly

SharedCanvasState

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

WorkspaceContext.view

Methods

mount()

mount(): () => void

Defined in: src/workspace/workspaceProvider.tsx:138

Mounts the workspace to allow tracking async operations within.

Returns

a function to unmount the workspace, cancelling all active async operations.

(): void

Returns

void