Creates an instance of DiagramEditor.
The container element that will receive the editor layout.
Optionalconfig: DiagramEditorConfigOptional configuration for layout, controls, toolbars, and prompts.
Optionaldiagram: DiagramOptional initial diagram to load into the editor.
ProtectedhostProtected ReadonlyeventProtectedconfigProtecteddiagramProtectedsheet_Protected OptionaltopProtected OptionaltopProtected OptionalheaderProtected OptionalstageProtected OptionalstatusProtected OptionaltoolbarsProtectedtoolbarsProtected OptionaltoolboxProtected OptionaltoolboxProtected OptionalinspectorProtected OptionalinspectorProtected OptionalstatusProtected OptionalhintProtected OptionalfreehandProtected OptionalfreehandProtected OptionalfreehandProtected OptionalfreehandProtected OptionalfreehandProtected OptionaltextProtected OptionalfontProtected OptionalfontProtected OptionaltextProtected OptionalfontProtected OptionalfontProtected OptionaltextProtected OptionaltextProtected OptionaltextProtected OptionalstrokeProtected OptionalstrokeProtected OptionalstrokeProtected OptionaldashProtected OptionalarrowProtected OptionalarrowProtected OptionalstrokeProtected OptionalstrokeProtected OptionaldashProtected OptionalarrowProtected OptionalarrowProtected OptionalshadowProtected OptionalshadowProtected OptionalshadowProtected OptionalshadowProtected OptionalhaloProtected OptionalshadowProtected OptionalshadowProtected OptionalshadowProtected OptionalshadowProtected OptionalshadowProtected OptionalshadowProtected OptionalfillProtected OptionalfillProtected OptionalfillProtected OptionalimageProtected OptionalimageProtected OptionalimageProtected OptionalimageProtected OptionalimageProtected OptionalimageProtected OptionalimageProtected OptionalimageProtectedlistenerProtectedsyncingCleans up the editor and all owned child controls.
Clears the current diagram after resolving any unsaved-change prompt. A prompt will be shown if the diagram has unsaved changes.
True when a new empty diagram was created; otherwise false.
Loads a diagram from a live diagram instance, a serialized JSON string, or a deserialized payload. A prompt will be shown if the diagram has unsaved changes.
The diagram source to load.
True when the source was loaded; otherwise false when loading was canceled.
Opens a diagram using configured file dialog behavior after resolving unsaved-change prompts.
Optionaloptions: DiagramOpenOptionsOptional open options or source overrides.
True when a diagram was opened; otherwise false.
Loads a stylesheet from a provided source object/string and applies it.
Stylesheet source payload.
Optionaloptions: Pick<StylesheetOpenOptions, "applyAfterLoad" | "preferId">Optional load behavior.
True when loading succeeded; otherwise false.
Opens a stylesheet using dialog integrations and applies it.
Optionaloptions: StylesheetOpenOptionsOptional open/load behavior.
True when loading succeeded; otherwise false.
Saves the current diagram using the underlying DiagramEditView. A prompt will be shown if the diagram has no changes to save.
Optionaloptions: DiagramSaveOptionsOptional serialization settings.
The serialized diagram string, or undefined when saving was canceled.
Saves the currently active stylesheet through the underlying DiagramEditView.
Optionaloptions: StylesheetSaveOptionsOptional save behavior.
The resolved filename, or undefined when saving was canceled.
Exports the current diagram using the underlying DiagramEditView.
Optionaloptions: DiagramExportOptionsOptional export settings.
The export result, or undefined when export was canceled.
Closes the current diagram after resolving any unsaved-change prompt. A prompt will be shown if the diagram has unsaved changes.
True when the diagram was closed; otherwise false.
Returns the current sheet repository, creating a default one if none exists.
The sheet repository used by this editor.
Returns the action toolbars created for this editor.
Returns the tool palette instance when available.
Returns the font family selector control when available.
Returns the font size selector control when available.
Returns the text color selector control when available.
Returns the stroke color selector control when available.
Returns the stroke width selector control when available.
Returns the dash selector control when available.
Returns the arrow direction selector control when available.
Returns the arrow type selector control when available.
Returns the fill color selector control when available.
ProtectedinitializeBuilds the editor layout and initializes all owned controls.
The editor host element.
The editor configuration.
Optionaldiagram: DiagramOptional initial diagram to load.
ProtectedattachConnects editor controls to the underlying diagram view and change events.
ProtecteddetachRemoves all event listeners previously registered by the editor.
ProtectedreflectSynchronizes the style controls with the current style state of the diagram.
ProtectedpromptShows the default prompt used when a save is requested without any pending changes.
True when saving should continue; otherwise false.
ProtectedpromptShows the default unsaved-changes prompt for the requested action.
The operation that triggered the prompt.
The action selected by the user.
A composed diagram editing component that wires a DiagramEditView together with a tool palette, action toolbars, and style controls. It provides a ready-to-mount editor surface with optional prompts for unsaved-change flows.