Skip to content

charton API


charton API / @chart-on/core / index / InputBase

Interface: InputBase ​

Defined in: packages/core/src/indicators/types.ts:24

Members every input has. visible, disabled and validate receive all of the indicator's current input values; a settings form calls them on every change (see inputFields).

Properties ​

affectsData? ​

optional affectsData?: boolean

Defined in: packages/core/src/indicators/types.ts:41

The input changes what fetch / subscribe load: changing it drops the fetched rows and fetches again, like listing it in refetchOn.inputs.


group? ​

optional group?: string

Defined in: packages/core/src/indicators/types.ts:32

Section the input belongs to in a settings form, e.g. 'Bands'. Inputs without one come first; groups follow in the order of their first input.


id ​

id: string

Defined in: packages/core/src/indicators/types.ts:26

Unique within the indicator; no ., as it is part of the message key input.<id>.<input>.


label? ​

optional label?: string

Defined in: packages/core/src/indicators/types.ts:27

Methods ​

disabled()? ​

optional disabled(inputs): boolean

Defined in: packages/core/src/indicators/types.ts:36

True shows the input but makes it read-only. Default enabled.

Parameters ​

inputs ​

Record<string, InputValue>

Returns ​

boolean


validate()? ​

optional validate(value, inputs): string | null

Defined in: packages/core/src/indicators/types.ts:47

Check a value that has the right type, e.g. against other inputs (fast < slow). Return an error message, or null when it is fine. Not called while the input is hidden.

Parameters ​

value ​

InputValue

inputs ​

Record<string, InputValue>

Returns ​

string | null


visible()? ​

optional visible(inputs): boolean

Defined in: packages/core/src/indicators/types.ts:34

False hides the input, e.g. "show this only when that one is on". Default shown.

Parameters ​

inputs ​

Record<string, InputValue>

Returns ​

boolean