Skip to content
EliteChart

IndicatorsDialogConfig

Documentation


Documentation / @elitechart/core / IndicatorsDialogConfig

Defined in: ui/indicators-dialog.ts:79

Constructor config for IndicatorsDialog. The embedder owns the catalog and selection state.

Example

code
const dialog = new IndicatorsDialog({
  mount: document.body,
  catalog: DEFAULT_INDICATORS_CATALOG,
  onAdd: (id) => addIndicator(id),
  isSelected: (id) => active.has(id),
  onRemove: (id) => removeIndicator(id),
});

Properties

catalog

code
readonly catalog: readonly IndicatorCatalogEntry[];

Defined in: ui/indicators-dialog.ts:81


isFavorite?

code
readonly optional isFavorite?: (id) => boolean;

Defined in: ui/indicators-dialog.ts:98

Optional — queried at render time to decide whether to show a filled star (★ favorite) vs empty star (☆). Also enables the favorites category in the sidebar so the user can filter to their starred indicators.

Parameters

id

string

Returns

boolean


isSelected?

code
readonly optional isSelected?: (id) => boolean;

Defined in: ui/indicators-dialog.ts:89

Optional — queried at render time to decide whether a row shows "Added ✓" (selected) or "Add". When selected AND onRemove is provided, clicking the button removes the indicator instead of adding a duplicate — matches TV's toggle-in-list pattern.

Parameters

id

string

Returns

boolean


mount

code
readonly mount: HTMLElement;

Defined in: ui/indicators-dialog.ts:80


onAdd

code
readonly onAdd: (id, entry) => void;

Defined in: ui/indicators-dialog.ts:82

Parameters

id

string

entry

IndicatorCatalogEntry

Returns

void


onClose?

code
readonly optional onClose?: () => void;

Defined in: ui/indicators-dialog.ts:109

Optional close handler — called on Esc, backdrop click, or X button.

Returns

void


onRemove?

code
readonly optional onRemove?: (id, entry) => void;

Defined in: ui/indicators-dialog.ts:91

Optional remove handler — fires when a selected row is re-clicked.

Parameters

id

string

entry

IndicatorCatalogEntry

Returns

void


onToggleFavorite?

code
readonly optional onToggleFavorite?: (id, entry) => void;

Defined in: ui/indicators-dialog.ts:100

Optional — fires when the star is clicked. Embedder persists the toggle.

Parameters

id

string

entry

IndicatorCatalogEntry

Returns

void


recentOrder?

code
readonly optional recentOrder?: () => readonly string[];

Defined in: ui/indicators-dialog.ts:107

Optional — returns the embedder's "recently used" indicator ids in most-recent-first order. Enables the Recent sidebar category. The dialog filters the catalog down to these ids and preserves the order so the top row is the most recently picked indicator.

Returns

readonly string[]