charton API / @chart-on/ui / index / AppearanceHandle
Interface: AppearanceHandle
Defined in: ui/src/appearance.ts:309
Returned by createAppearance: reads and changes the saved color overrides and preset, and opens or closes the appearance panel.
Properties
isOpen
readonlyisOpen:boolean
Defined in: ui/src/appearance.ts:331
mode
readonlymode:"dark"|"light"
Defined in: ui/src/appearance.ts:325
Light or dark: which variant of the preset applies.
overrides
readonlyoverrides:AppearancePatch
Defined in: ui/src/appearance.ts:311
The user's overrides.
preset
readonlypreset:ColorPreset|null
Defined in: ui/src/appearance.ts:321
The chosen colour preset; null for the base theme.
presets
readonlypresets: readonlyColorPreset[]
Defined in: ui/src/appearance.ts:319
The presets the panel offers; empty with presets: false.
Methods
close()
close():
void
Defined in: ui/src/appearance.ts:329
Returns
void
destroy()
destroy():
void
Defined in: ui/src/appearance.ts:332
Returns
void
open()
open():
void
Defined in: ui/src/appearance.ts:328
Returns
void
reset()
reset(
section?):void
Defined in: ui/src/appearance.ts:315
Drop the overrides of one section, or all of them.
Parameters
section?
Returns
void
set()
set(
patch):void
Defined in: ui/src/appearance.ts:313
Merge overrides (undefined removes one), apply and save them.
Parameters
patch
Returns
void
setMode()
setMode(
mode):void
Defined in: ui/src/appearance.ts:327
Switch the mode, e.g. to try the other variant of a preset.
Parameters
mode
"dark" | "light"
Returns
void
setPreset()
setPreset(
id):void
Defined in: ui/src/appearance.ts:323
Choose a preset by id, or go back to the base theme with null. Unknown ids do nothing. Saved with the overrides.
Parameters
id
string | null
Returns
void
theme()
theme():
ChartTheme
Defined in: ui/src/appearance.ts:317
The chart theme: base theme, then the colour preset, then the overrides.
Returns
toggle()
toggle():
void
Defined in: ui/src/appearance.ts:330
Returns
void