Skip to main content

Interface: WorkspaceProps

Props for Workspace component.

See

Workspace

Properties

PropertyTypeDescription

children

ReactNode

Component children.

defaultLanguage?

string

Initial language to display the graph data with.

defaultLayout

LayoutFunction

Default function to compute diagram layout.

It is recommended to get layout function from a background worker, e.g. with defineDefaultLayouts and useWorker.

In cases when a worker is not available, it is possible to import and use blockingDefaultLayout as a synchronous fallback.

history?

CommandHistory

Overrides default command history implementation.

By default, it uses InMemoryHistory instance.

metadataProvider?

MetadataProvider

Provides an strategy to visually edit graph data.

If provided, switches editor into the graph authoring mode.

onWorkspaceEvent?

(key: WorkspaceEventKey) => void

Handler for a well-known workspace event.

renameLinkProvider?

RenameLinkProvider

Provides a strategy to rename diagram links (change labels).

selectLabelLanguage?

LabelLanguageSelector

Overrides how a single label gets selected from multiple of them based on target language.

translations?

readonly Partial<TranslationPartial<DefaultBundleData>>[]

Additional translation bundles for UI text strings in the workspace in order from higher to lower priority.

Default

[]

See

useDefaultTranslation

typeStyleResolver?

TypeStyleResolver

Allows to customize how colors and icons are assigned to elements based on its types.

By default, the colors are assigned deterministically based on total hash of type strings.

useDefaultTranslation?

boolean

If set, disables translation fallback which (with default en language).

Default

true

See

translations

validationProvider?

ValidationProvider

Provides a strategy to validate changes to the data in the graph authoring mode.