Ir al contenido

ThemeManager

Defined in: theme/ThemeManager.ts:12

GoJS-compatible: manages a Diagram’s (or several Diagrams’) set of named Themes and which one is active. Templates read theme values via GraphObject.theme()/themeData()/themeModel() (which attach a ThemeBinding), or by calling findValue/getValue directly.

new ThemeManager(init?): ThemeManager

Defined in: theme/ThemeManager.ts:20

Partial<ThemeManager>

ThemeManager

changesDivBackground: boolean = false

Defined in: theme/ThemeManager.ts:16


usesSystemCssVariables: boolean = false

Defined in: theme/ThemeManager.ts:17

get currentTheme(): string

Defined in: theme/ThemeManager.ts:49

string

set currentTheme(value): void

Defined in: theme/ThemeManager.ts:53

string

void


get defaultTheme(): string

Defined in: theme/ThemeManager.ts:41

string

set defaultTheme(value): void

Defined in: theme/ThemeManager.ts:45

string

void


get themeMap(): Map<string, Theme>

Defined in: theme/ThemeManager.ts:33

Map<string, Theme>

set themeMap(value): void

Defined in: theme/ThemeManager.ts:37

Map<string, Theme>

void

addDiagram(diagram): this

Defined in: theme/ThemeManager.ts:60

Associate a Diagram with this ThemeManager, so currentTheme changes refresh its theme bindings.

Diagram

this


findTheme(themeName): Theme | null

Defined in: theme/ThemeManager.ts:84

Find the named theme, resolving "system" to the browser’s preferred light/dark color scheme.

string

Theme | null


findValue(prop, source?, tprop?): unknown

Defined in: theme/ThemeManager.ts:99

Look up prop in currentTheme, falling back to defaultTheme if not found there.

string | number | string[]

string | string[]

string

unknown


getValue(theme, prop, source?, tprop?): unknown

Defined in: theme/ThemeManager.ts:106

Look up prop (optionally under source) within the given Theme.

Theme | null

string | number | string[]

string | string[]

string

unknown


removeDiagram(diagram): this

Defined in: theme/ThemeManager.ts:66

Disassociate a Diagram from this ThemeManager.

Diagram

this


set(themeName, props): this

Defined in: theme/ThemeManager.ts:72

Merge props into the named theme (or create it if it doesn’t yet exist), then refresh theme bindings.

string

Partial<Theme>

this


updateAllThemes(): void

Defined in: theme/ThemeManager.ts:141

Re-apply every ThemeBinding on every associated Diagram (called automatically when currentTheme/a theme’s contents change).

void