@orangecharts/wrun-chart-host 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +72 -0
- package/dist/constants/governed-exchanges.constants.d.ts +11 -0
- package/dist/constants/governed-exchanges.constants.js +11 -0
- package/dist/constants/indicator-sets.constants.d.ts +8 -0
- package/dist/constants/indicator-sets.constants.js +8 -0
- package/dist/constants/interval.constants.d.ts +34 -0
- package/dist/constants/interval.constants.js +121 -0
- package/dist/constants/scriptEditor/technicalIndicatorScriptKeys.constants.d.ts +28 -0
- package/dist/constants/scriptEditor/technicalIndicatorScriptKeys.constants.js +65 -0
- package/dist/constants/tpo-color-schemes.constants.d.ts +30 -0
- package/dist/constants/tpo-color-schemes.constants.js +32 -0
- package/dist/host-env.d.ts +102 -0
- package/dist/host-env.js +26 -0
- package/dist/index.d.ts +93 -0
- package/dist/index.js +96 -0
- package/dist/indicators/controls/tpo-letter.util.d.ts +2 -0
- package/dist/indicators/controls/tpo-letter.util.js +13 -0
- package/dist/indicators/controls/tpo-session.util.d.ts +99 -0
- package/dist/indicators/controls/tpo-session.util.js +389 -0
- package/dist/interfaces/kscript-diagnostics.interface.d.ts +64 -0
- package/dist/interfaces/kscript-diagnostics.interface.js +1 -0
- package/dist/interfaces/om-panel-data.interface.d.ts +103 -0
- package/dist/interfaces/om-panel-data.interface.js +7 -0
- package/dist/interfaces/wrun-runtime.interface.d.ts +2659 -0
- package/dist/interfaces/wrun-runtime.interface.js +55 -0
- package/dist/utility/chart/calendar-interval.util.d.ts +24 -0
- package/dist/utility/chart/calendar-interval.util.js +81 -0
- package/dist/utility/chart/candle-bar-end.util.d.ts +15 -0
- package/dist/utility/chart/candle-bar-end.util.js +23 -0
- package/dist/utility/chart/cme-realtime.util.d.ts +24 -0
- package/dist/utility/chart/cme-realtime.util.js +53 -0
- package/dist/utility/chart/interval-ladder.util.d.ts +27 -0
- package/dist/utility/chart/interval-ladder.util.js +92 -0
- package/dist/utility/chart/kscript-drawing-prep.util.d.ts +40 -0
- package/dist/utility/chart/kscript-drawing-prep.util.js +184 -0
- package/dist/utility/chart/kscript-drawing-safe-area.util.d.ts +95 -0
- package/dist/utility/chart/kscript-drawing-safe-area.util.js +805 -0
- package/dist/utility/chart/kscript-legend-entries.util.d.ts +166 -0
- package/dist/utility/chart/kscript-legend-entries.util.js +538 -0
- package/dist/utility/chart/kscript-output-role.util.d.ts +32 -0
- package/dist/utility/chart/kscript-output-role.util.js +215 -0
- package/dist/utility/chart/kscript-provenance-keys.util.d.ts +22 -0
- package/dist/utility/chart/kscript-provenance-keys.util.js +56 -0
- package/dist/utility/chart/kscript-run-result-normalize.util.d.ts +53 -0
- package/dist/utility/chart/kscript-run-result-normalize.util.js +476 -0
- package/dist/utility/chart/kscript-run-result-shape.util.d.ts +14 -0
- package/dist/utility/chart/kscript-run-result-shape.util.js +66 -0
- package/dist/utility/chart/kscript-titancharts-container.util.d.ts +29 -0
- package/dist/utility/chart/kscript-titancharts-container.util.js +151 -0
- package/dist/utility/chart/kscript-viewport-overlays.util.d.ts +83 -0
- package/dist/utility/chart/kscript-viewport-overlays.util.js +443 -0
- package/dist/utility/chart/om-panel-push-style.util.d.ts +78 -0
- package/dist/utility/chart/om-panel-push-style.util.js +301 -0
- package/dist/utility/chart/om-panel.util.d.ts +166 -0
- package/dist/utility/chart/om-panel.util.js +815 -0
- package/dist/utility/chart/om-series.util.d.ts +42 -0
- package/dist/utility/chart/om-series.util.js +330 -0
- package/dist/utility/chart/om-target.util.d.ts +11 -0
- package/dist/utility/chart/om-target.util.js +24 -0
- package/dist/utility/chart/om-widget.util.d.ts +148 -0
- package/dist/utility/chart/om-widget.util.js +413 -0
- package/dist/utility/chart/overlay-output-budget.util.d.ts +16 -0
- package/dist/utility/chart/overlay-output-budget.util.js +109 -0
- package/dist/utility/chart/overlay-paint-flags.util.d.ts +24 -0
- package/dist/utility/chart/overlay-paint-flags.util.js +55 -0
- package/dist/utility/chart/profile-row-height.util.d.ts +21 -0
- package/dist/utility/chart/profile-row-height.util.js +110 -0
- package/dist/utility/chart/session-interval.util.d.ts +1 -0
- package/dist/utility/chart/session-interval.util.js +35 -0
- package/dist/utility/chart/technical-script-legend-value.util.d.ts +18 -0
- package/dist/utility/chart/technical-script-legend-value.util.js +53 -0
- package/dist/utility/chart/trading-day.util.d.ts +70 -0
- package/dist/utility/chart/trading-day.util.js +238 -0
- package/dist/utility/chart/wrun-legend-name.util.d.ts +25 -0
- package/dist/utility/chart/wrun-legend-name.util.js +87 -0
- package/dist/utility/chart/wrun-run-result.util.d.ts +977 -0
- package/dist/utility/chart/wrun-run-result.util.js +5179 -0
- package/dist/utility/chart/wrun-visibility-chart.util.d.ts +25 -0
- package/dist/utility/chart/wrun-visibility-chart.util.js +22 -0
- package/dist/utility/indicators/heatmap-sensitivity.util.d.ts +62 -0
- package/dist/utility/indicators/heatmap-sensitivity.util.js +82 -0
- package/dist/utility/number-format.util.d.ts +68 -0
- package/dist/utility/number-format.util.js +188 -0
- package/dist/utility/v2/opra-governed.util.d.ts +1 -0
- package/dist/utility/v2/opra-governed.util.js +13 -0
- package/dist/utility/wrun/wrun-auto-row.util.d.ts +54 -0
- package/dist/utility/wrun/wrun-auto-row.util.js +96 -0
- package/dist/utility/wrun/wrun-batched-marks.util.d.ts +341 -0
- package/dist/utility/wrun/wrun-batched-marks.util.js +938 -0
- package/dist/utility/wrun/wrun-batched-readout.util.d.ts +75 -0
- package/dist/utility/wrun/wrun-batched-readout.util.js +171 -0
- package/dist/utility/wrun/wrun-box-segment.util.d.ts +185 -0
- package/dist/utility/wrun/wrun-box-segment.util.js +570 -0
- package/dist/utility/wrun/wrun-build-memo.util.d.ts +133 -0
- package/dist/utility/wrun/wrun-build-memo.util.js +301 -0
- package/dist/utility/wrun/wrun-builtin-twin-ports.util.d.ts +25 -0
- package/dist/utility/wrun/wrun-builtin-twin-ports.util.js +75 -0
- package/dist/utility/wrun/wrun-builtin-twin.util.d.ts +9 -0
- package/dist/utility/wrun/wrun-builtin-twin.util.js +40 -0
- package/dist/utility/wrun/wrun-canvas-cache.util.d.ts +28 -0
- package/dist/utility/wrun/wrun-canvas-cache.util.js +56 -0
- package/dist/utility/wrun/wrun-canvas-readout.util.d.ts +69 -0
- package/dist/utility/wrun/wrun-canvas-readout.util.js +53 -0
- package/dist/utility/wrun/wrun-canvases.util.d.ts +295 -0
- package/dist/utility/wrun/wrun-canvases.util.js +1432 -0
- package/dist/utility/wrun/wrun-cap-notice.util.d.ts +77 -0
- package/dist/utility/wrun/wrun-cap-notice.util.js +296 -0
- package/dist/utility/wrun/wrun-card-style.util.d.ts +154 -0
- package/dist/utility/wrun/wrun-card-style.util.js +539 -0
- package/dist/utility/wrun/wrun-chart-context.util.d.ts +89 -0
- package/dist/utility/wrun/wrun-chart-context.util.js +213 -0
- package/dist/utility/wrun/wrun-chart-names.util.d.ts +23 -0
- package/dist/utility/wrun/wrun-chart-names.util.js +33 -0
- package/dist/utility/wrun/wrun-chart-time.util.d.ts +12 -0
- package/dist/utility/wrun/wrun-chart-time.util.js +23 -0
- package/dist/utility/wrun/wrun-child-overlay-id.util.d.ts +13 -0
- package/dist/utility/wrun/wrun-child-overlay-id.util.js +44 -0
- package/dist/utility/wrun/wrun-color-facts.util.d.ts +40 -0
- package/dist/utility/wrun/wrun-color-facts.util.js +88 -0
- package/dist/utility/wrun/wrun-color-settings.lazy.d.ts +26 -0
- package/dist/utility/wrun/wrun-color-settings.lazy.js +9 -0
- package/dist/utility/wrun/wrun-color-settings.util.d.ts +351 -0
- package/dist/utility/wrun/wrun-color-settings.util.js +1363 -0
- package/dist/utility/wrun/wrun-footprint-modes.util.d.ts +23 -0
- package/dist/utility/wrun/wrun-footprint-modes.util.js +24 -0
- package/dist/utility/wrun/wrun-frames.d.ts +217 -0
- package/dist/utility/wrun/wrun-frames.js +1021 -0
- package/dist/utility/wrun/wrun-handles.util.d.ts +792 -0
- package/dist/utility/wrun/wrun-handles.util.js +2050 -0
- package/dist/utility/wrun/wrun-heatmap-cell-budget.util.d.ts +156 -0
- package/dist/utility/wrun/wrun-heatmap-cell-budget.util.js +342 -0
- package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +218 -0
- package/dist/utility/wrun/wrun-hosted-wire-caps.js +667 -0
- package/dist/utility/wrun/wrun-hosted-wire.util.d.ts +40 -0
- package/dist/utility/wrun/wrun-hosted-wire.util.js +27 -0
- package/dist/utility/wrun/wrun-hover.util.d.ts +182 -0
- package/dist/utility/wrun/wrun-hover.util.js +534 -0
- package/dist/utility/wrun/wrun-hud-looks.util.d.ts +246 -0
- package/dist/utility/wrun/wrun-hud-looks.util.js +587 -0
- package/dist/utility/wrun/wrun-integration-budget.util.d.ts +47 -0
- package/dist/utility/wrun/wrun-integration-budget.util.js +122 -0
- package/dist/utility/wrun/wrun-latest-snapshot.d.ts +19 -0
- package/dist/utility/wrun/wrun-latest-snapshot.js +7 -0
- package/dist/utility/wrun/wrun-levels-child.util.d.ts +131 -0
- package/dist/utility/wrun/wrun-levels-child.util.js +514 -0
- package/dist/utility/wrun/wrun-lifecycle.contract.d.ts +75 -0
- package/dist/utility/wrun/wrun-lifecycle.contract.js +9 -0
- package/dist/utility/wrun/wrun-market-facts.util.d.ts +116 -0
- package/dist/utility/wrun/wrun-market-facts.util.js +238 -0
- package/dist/utility/wrun/wrun-output-style.util.d.ts +344 -0
- package/dist/utility/wrun/wrun-output-style.util.js +1239 -0
- package/dist/utility/wrun/wrun-overlay-identity.util.d.ts +84 -0
- package/dist/utility/wrun/wrun-overlay-identity.util.js +142 -0
- package/dist/utility/wrun/wrun-overlay-result.util.d.ts +120 -0
- package/dist/utility/wrun/wrun-overlay-result.util.js +219 -0
- package/dist/utility/wrun/wrun-pack.util.d.ts +70 -0
- package/dist/utility/wrun/wrun-pack.util.js +301 -0
- package/dist/utility/wrun/wrun-pane-format.util.d.ts +180 -0
- package/dist/utility/wrun/wrun-pane-format.util.js +299 -0
- package/dist/utility/wrun/wrun-panel-style.lazy.d.ts +25 -0
- package/dist/utility/wrun/wrun-panel-style.lazy.js +15 -0
- package/dist/utility/wrun/wrun-panel-style.util.d.ts +174 -0
- package/dist/utility/wrun/wrun-panel-style.util.js +726 -0
- package/dist/utility/wrun/wrun-param-values.util.d.ts +69 -0
- package/dist/utility/wrun/wrun-param-values.util.js +230 -0
- package/dist/utility/wrun/wrun-refusal.util.d.ts +263 -0
- package/dist/utility/wrun/wrun-refusal.util.js +1259 -0
- package/dist/utility/wrun/wrun-registry-errors.util.d.ts +199 -0
- package/dist/utility/wrun/wrun-registry-errors.util.js +257 -0
- package/dist/utility/wrun/wrun-render-select.util.d.ts +336 -0
- package/dist/utility/wrun/wrun-render-select.util.js +1157 -0
- package/dist/utility/wrun/wrun-script-inputs.util.d.ts +434 -0
- package/dist/utility/wrun/wrun-script-inputs.util.js +1971 -0
- package/dist/utility/wrun/wrun-setting-words.lazy.d.ts +20 -0
- package/dist/utility/wrun/wrun-setting-words.lazy.js +9 -0
- package/dist/utility/wrun/wrun-setting-words.util.d.ts +79 -0
- package/dist/utility/wrun/wrun-setting-words.util.js +176 -0
- package/dist/utility/wrun/wrun-socket-row-store.d.ts +98 -0
- package/dist/utility/wrun/wrun-socket-row-store.js +417 -0
- package/dist/utility/wrun/wrun-style-flags.util.d.ts +18 -0
- package/dist/utility/wrun/wrun-style-flags.util.js +21 -0
- package/dist/utility/wrun/wrun-style-words.util.d.ts +148 -0
- package/dist/utility/wrun/wrun-style-words.util.js +439 -0
- package/dist/utility/wrun/wrun-table-look.util.d.ts +125 -0
- package/dist/utility/wrun/wrun-table-look.util.js +225 -0
- package/dist/utility/wrun/wrun-text-look.util.d.ts +51 -0
- package/dist/utility/wrun/wrun-text-look.util.js +227 -0
- package/dist/utility/wrun/wrun-text-params.util.d.ts +106 -0
- package/dist/utility/wrun/wrun-text-params.util.js +171 -0
- package/dist/utility/wrun/wrun-tpo-rows.util.d.ts +71 -0
- package/dist/utility/wrun/wrun-tpo-rows.util.js +438 -0
- package/dist/utility/wrun/wrun-twin-compute-inputs.util.d.ts +14 -0
- package/dist/utility/wrun/wrun-twin-compute-inputs.util.js +58 -0
- package/dist/utility/wrun/wrun-visibility-table.d.ts +437 -0
- package/dist/utility/wrun/wrun-visibility-table.js +237 -0
- package/dist/utility/wrun/wrun-volume-profile.util.d.ts +37 -0
- package/dist/utility/wrun/wrun-volume-profile.util.js +278 -0
- package/package.json +38 -0
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multi-value legend for container-native kScript overlays.
|
|
3
|
+
*
|
|
4
|
+
* Titan mounts every v2 run under a synthetic parent (`__kiyoKScriptContainer`,
|
|
5
|
+
* plot 'empty') and hangs the real outputs off `meta.nestedMeta`. The legend
|
|
6
|
+
* hover bridge only ever visits the PARENT row, so a script with several lines
|
|
7
|
+
* (Chandelier long/short stops, EWMA vs equal-weight) used to read one column
|
|
8
|
+
* of whichever child seeded the container. This module resolves one entry per
|
|
9
|
+
* value-bearing child at the hovered timestamp so the legend lists every line.
|
|
10
|
+
*
|
|
11
|
+
* Pure and node-testable: no titan, DOM, or store access.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Slot pool size. The engine folds every legend entry past its visible width
|
|
15
|
+
* into a `+N` chip whose popover lists the hidden slots, so the pool only has
|
|
16
|
+
* to cover what a script plausibly plots, not what fits on one row. Padded
|
|
17
|
+
* empty slots are never counted toward the chip.
|
|
18
|
+
*/
|
|
19
|
+
export declare const KSCRIPT_LEGEND_MAX_ENTRIES = 16;
|
|
20
|
+
/** The legend's own O / H / L / C markers (OT28); callers pass the i18n
|
|
21
|
+
* `chart.legend.open` / `high` / `low` / `close` words. */
|
|
22
|
+
export interface KScriptLegendOhlcLabels {
|
|
23
|
+
open: string;
|
|
24
|
+
high: string;
|
|
25
|
+
low: string;
|
|
26
|
+
close: string;
|
|
27
|
+
}
|
|
28
|
+
export interface KScriptLegendEntriesOptions {
|
|
29
|
+
/** The markers a candle group's entry prints before its four values. */
|
|
30
|
+
ohlcLabels?: KScriptLegendOhlcLabels;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Value text ink for every kScript legend slot. The plot color rides the
|
|
34
|
+
* slot's `swatch` (titan draws it as a dot before the cell) and the line's name
|
|
35
|
+
* its `label` (titan renders it in the legend title ink), so the reading
|
|
36
|
+
* itself stays in the neutral value ink the OHLC row uses: a dark plot color
|
|
37
|
+
* (a crimson Tenkan reads 1.8:1 on a dark chart) never has to carry text.
|
|
38
|
+
*/
|
|
39
|
+
export declare const KSCRIPT_LEGEND_VALUE_INK = "var(--legend-value-color)";
|
|
40
|
+
export interface KScriptLegendEntry {
|
|
41
|
+
id: string;
|
|
42
|
+
/** The reading alone (`1.45`, `-` for a hole). */
|
|
43
|
+
text: string;
|
|
44
|
+
color: string;
|
|
45
|
+
/** The line's name, rendered muted before the reading; '' for none. */
|
|
46
|
+
label?: string;
|
|
47
|
+
/** The plot color, drawn as a dot before the cell; '' clears it. */
|
|
48
|
+
swatch?: string;
|
|
49
|
+
}
|
|
50
|
+
export interface KScriptLegendLine {
|
|
51
|
+
meta: Record<string, unknown>;
|
|
52
|
+
/** Index inside the parent's nestedMeta; contract plot labels align by declaration order. */
|
|
53
|
+
nestedIndex: number;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The full slot pool. Titan creates one span per initLegendText entry at
|
|
57
|
+
* addOverlay time, before any run result has mounted nestedMeta, and silently
|
|
58
|
+
* drops updates for ids it never created: every slot the multi-entry branch
|
|
59
|
+
* may address has to be born with the static legend.
|
|
60
|
+
*/
|
|
61
|
+
export declare function kScriptLegendSlotIds(): string[];
|
|
62
|
+
/**
|
|
63
|
+
* The slot pool as initLegendText cells. Every slot is born empty and LABELLED
|
|
64
|
+
* (`label: ''`): titan builds a name span + value host only for a cell that
|
|
65
|
+
* carries a label at creation, and later updates fill both.
|
|
66
|
+
*/
|
|
67
|
+
export declare function kScriptLegendSlotCells(): Array<KScriptLegendEntry & {
|
|
68
|
+
isStatic: false;
|
|
69
|
+
}>;
|
|
70
|
+
/**
|
|
71
|
+
* The nested outputs that earn a legend slot, in declaration order, capped at
|
|
72
|
+
* the pool size. `includeUnlisted` also returns the drawn value plots a run
|
|
73
|
+
* output opted out of the legend (`legend: false`) and lifts the cap: the
|
|
74
|
+
* set a series hover walks (a line the legend does not list is still on the
|
|
75
|
+
* chart); the legend itself never passes it.
|
|
76
|
+
*/
|
|
77
|
+
export declare function kScriptLegendLines(meta: unknown, options?: {
|
|
78
|
+
includeUnlisted?: boolean;
|
|
79
|
+
}): KScriptLegendLine[];
|
|
80
|
+
/** Binary-search the last row whose timestamp is <= ts (rows ascend by row[0], titan's floorRow rule). */
|
|
81
|
+
export declare function floorRowAt(rows: unknown[] | undefined, ts: number): number[] | undefined;
|
|
82
|
+
/** The run-result output key a legend line was mounted from (the wrun
|
|
83
|
+
* output NAME for a sheet run: the adapter keys `outputs` by it), read the
|
|
84
|
+
* way titan keys a container child (outputKey, then plotKey, then plotId). */
|
|
85
|
+
export declare function kScriptLegendLineOutputKey(line: KScriptLegendLine): string | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* The declared value format of a legend line (the sheet output's `format`
|
|
88
|
+
* word, WRUN-INPUTS-PLAN 1.3): the adapter stamps it on the run output the
|
|
89
|
+
* child was mounted from (`format`, an FE-only field like `legend`), and
|
|
90
|
+
* titan does not copy it onto the nested meta, so the run output is read
|
|
91
|
+
* too. Undefined = the caller's placement rule.
|
|
92
|
+
*/
|
|
93
|
+
export declare function kScriptLegendLineFormat(meta: unknown, line: KScriptLegendLine): string | undefined;
|
|
94
|
+
/**
|
|
95
|
+
* The declared format companions of a legend line (WRUN-STYLE OT32): the
|
|
96
|
+
* adapter stamps `formatOptions` ({ decimals, signed, unit }) on the run
|
|
97
|
+
* output beside `format`; titan does not copy it onto the nested meta, so
|
|
98
|
+
* the run output is read too. Undefined = none declared.
|
|
99
|
+
*/
|
|
100
|
+
export declare function kScriptLegendLineFormatOptions(meta: unknown, line: KScriptLegendLine): {
|
|
101
|
+
decimals?: number;
|
|
102
|
+
signed?: boolean;
|
|
103
|
+
unit?: string;
|
|
104
|
+
} | undefined;
|
|
105
|
+
/**
|
|
106
|
+
* The colour a legend line is drawn in at `ts` (WRUN-STYLE OT27): what its
|
|
107
|
+
* own output paints the row the reading takes (rowPaint: a per-bar colour, a
|
|
108
|
+
* candle's or a column's sign colour), else the line's own colour (lineColor),
|
|
109
|
+
* also on a row painted fully transparent (a clear rung draws nothing, and
|
|
110
|
+
* titan would show it as a black dot). The row is the reading's (lineRowAt: a
|
|
111
|
+
* column, candle or mark at a bar without its own row shows the line colour);
|
|
112
|
+
* no timestamp reads the last row. It takes no slot: a line's colour is never
|
|
113
|
+
* read from the overlay palette by position.
|
|
114
|
+
*/
|
|
115
|
+
export declare function kScriptLegendLineSwatchAt(meta: unknown, line: KScriptLegendLine, ts: number | undefined): string;
|
|
116
|
+
/**
|
|
117
|
+
* What a readout printing the container row reads paints at `ts`: the output
|
|
118
|
+
* the container's rows come from (densestKScriptOutputKey over the run's
|
|
119
|
+
* outputs, the container's own rule), a legend line or not (a mark, a stats
|
|
120
|
+
* row). Undefined when nothing coloured is read: no output seeds the container
|
|
121
|
+
* (handles only, no run yet), the seed has no row at that bar, or it declares
|
|
122
|
+
* no colour (a stats row at its default, which titan's strip paints from the
|
|
123
|
+
* overlay's palette).
|
|
124
|
+
*/
|
|
125
|
+
export declare function kScriptLegendSeedSwatchAt(meta: unknown, ts: number | undefined): string | undefined;
|
|
126
|
+
/**
|
|
127
|
+
* One labelled entry per value line at the hovered point's timestamp: the
|
|
128
|
+
* line's name as `label`, its reading as `text` (value ink) and the colour it
|
|
129
|
+
* is drawn in at that bar as `swatch` (kScriptLegendLineSwatchAt: a ladder's
|
|
130
|
+
* per-bar colour, a column's sign colour, else the line colour). Returns an
|
|
131
|
+
* empty list for fewer than two lines so the caller keeps today's unlabelled
|
|
132
|
+
* single-slot readout for one-line scripts. `format` also gets the line it
|
|
133
|
+
* prints, so a caller can honour a per-output format word
|
|
134
|
+
* (kScriptLegendLineFormat); callers that ignore it are unchanged. A candle
|
|
135
|
+
* group's line reads its four values after `options.ohlcLabels` (OT28), a
|
|
136
|
+
* stacked column its own height (OT38). A column, candle group or mark reads
|
|
137
|
+
* the hovered bar's own row, '-' on a bar without one; a line its floor row
|
|
138
|
+
* (lineRowAt).
|
|
139
|
+
*/
|
|
140
|
+
export declare function kScriptLegendEntries(point: unknown, meta: unknown, format: (value: number, line: KScriptLegendLine) => string, options?: KScriptLegendEntriesOptions): KScriptLegendEntry[];
|
|
141
|
+
/** The value a legend line holds at `ts` (lineRowAt: the floor row for a
|
|
142
|
+
* line, titan's rule; the bar's own row for a column, candle group or mark,
|
|
143
|
+
* so a bar without one is a hole; the last row without a timestamp),
|
|
144
|
+
* undefined for a hole. `withinRows` also reads a `ts` past the line's last
|
|
145
|
+
* row as a hole: the legend keeps a line's last reading there, a hover on
|
|
146
|
+
* the plot has nothing drawn to land on. A candle line's value is its close
|
|
147
|
+
* (OT28); a stacked column's its own height, top - bottom (OT38, read off
|
|
148
|
+
* the run output through `meta`). */
|
|
149
|
+
export declare function kScriptLegendLineValueAt(line: KScriptLegendLine, ts: number | undefined, options?: {
|
|
150
|
+
withinRows?: boolean;
|
|
151
|
+
meta?: unknown;
|
|
152
|
+
}): number | undefined;
|
|
153
|
+
/** The line's values on its last `count` rows at or before `ts`, oldest
|
|
154
|
+
* first (a hole reads NaN): the run-up a sparkline draws to a hovered bar. */
|
|
155
|
+
export declare function kScriptLegendLineTrailingValues(line: KScriptLegendLine, ts: number, count: number): number[];
|
|
156
|
+
/** Slot id for entry `index` (the pool's addressing, exported for callers
|
|
157
|
+
* that place entries after the value lines). */
|
|
158
|
+
export declare function kScriptLegendSlotIdAt(index: number): string;
|
|
159
|
+
/** The colour a legend line paints with (lineColor: its own, never a palette slot). */
|
|
160
|
+
export declare function kScriptLegendLineColor(meta: unknown, line: KScriptLegendLine): string;
|
|
161
|
+
/**
|
|
162
|
+
* Pad a legend result to the full slot pool with empty text, name and dot so
|
|
163
|
+
* slots a previous run addressed (a line hidden by a settings toggle) never
|
|
164
|
+
* keep a stale reading. Slots already present are left untouched.
|
|
165
|
+
*/
|
|
166
|
+
export declare function padKScriptLegendSlots(entries: KScriptLegendEntry[]): KScriptLegendEntry[];
|