Skip to main content

Interface: CreateWorkspaceParams

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

Params for createWorkspace function.

Properties

PropertyTypeDescription

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.

dialogSettingsProvider?

DialogSettingsProvider

Provides defaults and persists changes to overlay dialog properties.

By default, DefaultDialogSettingsProvider instance is used.

history?

CommandHistory

Overrides default command history implementation.

By default, InMemoryHistory instance is used.

metadataProvider?

MetadataProvider

Provides an strategy to visually edit graph data.

If provided, switches editor into the graph authoring mode.

onWorkspaceEvent?

(key) => void

Handler for a well-known workspace event.

renameLinkProvider?

null | RenameLinkProvider

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

By default, DefaultRenameLinkProvider instance is used.

If specified as null, the default provider would not be used.

translation?

Translation<string>

Overrides default i18n (translation) implementation.

By default, DefaultTranslation instance with a single DefaultTranslationBundle is used.

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.

For non-entity elements, the Element.elementState is checked for TemplateProperties.ColorVariant template state property instead.

validationProvider?

ValidationProvider

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