Editor settings.

interface EditorSettings {
    autoFocus?: boolean;
    autoSaveFrequency?: number;
    confirmSwitchToMoleculeStereo?: boolean;
    copyFileTypes?: (DocumentType | ImageType)[];
    copySVG?: boolean;
    customAbbreviatedGroups?: string[];
    customColors?: string[];
    defaultZoom?: number;
    exportFileTypes?: (DocumentType | ImageType)[];
    includeFontFacesInSVG?: IncludeFontFaces;
    initialTool?: "atom" | "bond" | "chain" | "erase" | "select" | "template";
    styleCollisionResolution?: StyleCollisionResolution;
    variableAttachmentHighlightExported?: boolean;
}

Properties

autoFocus?: boolean

Controls whether the editor automatically acquires focus when loaded. When true, focus is placed on the canvas automatically after the editor finishes loading. When false, focus requires explicit user interaction (click) or a programmatic focus() API call. Default: true

autoSaveFrequency?: number

Auto-save frequency in seconds.

confirmSwitchToMoleculeStereo?: boolean

Controls whether to show a confirmation dialog before switching from atom-level Enhanced Stereo to molecule-level stereo.

copyFileTypes?: (DocumentType | ImageType)[]

Allowed file types for copy. copyFileTypes must be a subset of exportFileTypes

copySVG?: boolean

Is SVG also copied whenever copying content on the clipboard. Default is true.

customAbbreviatedGroups?: string[]

List of the user-defined abbreviated groups in CXON format.
From the CXON source, the first group of property of the first molecule object will be extracted, with the specified name and attachment points. For the correct representation of an abbreviated group in CXON format, consult with the CXON Schema.
Upon import, duplicate abbreviated groups (i.e. groups with identical name property) will be ignored, and the previously imported/defined group will be kept.

customColors?: string[]

Custom colors

defaultZoom?: number

Sets the default zoom level (in percent) applied when the editor is loaded. Accepted range: 25 <= defaultZoom <= 500 (integer). Default: 200

exportFileTypes?: (DocumentType | ImageType)[]

Allowed file types for export.

includeFontFacesInSVG?: IncludeFontFaces

Applied only in SVG export. Sets whether the font face information should also be rendered or not. Default: "NONE"

initialTool?: "atom" | "bond" | "chain" | "erase" | "select" | "template"

Initial tool to be selected when the editor is loaded. Defaults to "select".

styleCollisionResolution?: StyleCollisionResolution

Controls how visual collisions are resolved when importing elements whose visual settings differ from the editor's. This covers both journal style differences and other display settings (e.g. bond lengths, atom label visibility, lone pair visibility, stereo visibility). "EDITOR": Always keep the editor's current visual settings. The collision dialog is never shown. "IMPORTED": Always apply the imported element's visual settings. The collision dialog is never shown. "PROMPT": Show a dialog letting the user choose. Default: "PROMPT"

variableAttachmentHighlightExported?: boolean

State of the variable attachment highlight export checkbox on the UI. Defaults to true.