@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.
Files changed (198) hide show
  1. package/README.md +72 -0
  2. package/dist/constants/governed-exchanges.constants.d.ts +11 -0
  3. package/dist/constants/governed-exchanges.constants.js +11 -0
  4. package/dist/constants/indicator-sets.constants.d.ts +8 -0
  5. package/dist/constants/indicator-sets.constants.js +8 -0
  6. package/dist/constants/interval.constants.d.ts +34 -0
  7. package/dist/constants/interval.constants.js +121 -0
  8. package/dist/constants/scriptEditor/technicalIndicatorScriptKeys.constants.d.ts +28 -0
  9. package/dist/constants/scriptEditor/technicalIndicatorScriptKeys.constants.js +65 -0
  10. package/dist/constants/tpo-color-schemes.constants.d.ts +30 -0
  11. package/dist/constants/tpo-color-schemes.constants.js +32 -0
  12. package/dist/host-env.d.ts +102 -0
  13. package/dist/host-env.js +26 -0
  14. package/dist/index.d.ts +93 -0
  15. package/dist/index.js +96 -0
  16. package/dist/indicators/controls/tpo-letter.util.d.ts +2 -0
  17. package/dist/indicators/controls/tpo-letter.util.js +13 -0
  18. package/dist/indicators/controls/tpo-session.util.d.ts +99 -0
  19. package/dist/indicators/controls/tpo-session.util.js +389 -0
  20. package/dist/interfaces/kscript-diagnostics.interface.d.ts +64 -0
  21. package/dist/interfaces/kscript-diagnostics.interface.js +1 -0
  22. package/dist/interfaces/om-panel-data.interface.d.ts +103 -0
  23. package/dist/interfaces/om-panel-data.interface.js +7 -0
  24. package/dist/interfaces/wrun-runtime.interface.d.ts +2659 -0
  25. package/dist/interfaces/wrun-runtime.interface.js +55 -0
  26. package/dist/utility/chart/calendar-interval.util.d.ts +24 -0
  27. package/dist/utility/chart/calendar-interval.util.js +81 -0
  28. package/dist/utility/chart/candle-bar-end.util.d.ts +15 -0
  29. package/dist/utility/chart/candle-bar-end.util.js +23 -0
  30. package/dist/utility/chart/cme-realtime.util.d.ts +24 -0
  31. package/dist/utility/chart/cme-realtime.util.js +53 -0
  32. package/dist/utility/chart/interval-ladder.util.d.ts +27 -0
  33. package/dist/utility/chart/interval-ladder.util.js +92 -0
  34. package/dist/utility/chart/kscript-drawing-prep.util.d.ts +40 -0
  35. package/dist/utility/chart/kscript-drawing-prep.util.js +184 -0
  36. package/dist/utility/chart/kscript-drawing-safe-area.util.d.ts +95 -0
  37. package/dist/utility/chart/kscript-drawing-safe-area.util.js +805 -0
  38. package/dist/utility/chart/kscript-legend-entries.util.d.ts +166 -0
  39. package/dist/utility/chart/kscript-legend-entries.util.js +538 -0
  40. package/dist/utility/chart/kscript-output-role.util.d.ts +32 -0
  41. package/dist/utility/chart/kscript-output-role.util.js +215 -0
  42. package/dist/utility/chart/kscript-provenance-keys.util.d.ts +22 -0
  43. package/dist/utility/chart/kscript-provenance-keys.util.js +56 -0
  44. package/dist/utility/chart/kscript-run-result-normalize.util.d.ts +53 -0
  45. package/dist/utility/chart/kscript-run-result-normalize.util.js +476 -0
  46. package/dist/utility/chart/kscript-run-result-shape.util.d.ts +14 -0
  47. package/dist/utility/chart/kscript-run-result-shape.util.js +66 -0
  48. package/dist/utility/chart/kscript-titancharts-container.util.d.ts +29 -0
  49. package/dist/utility/chart/kscript-titancharts-container.util.js +151 -0
  50. package/dist/utility/chart/kscript-viewport-overlays.util.d.ts +83 -0
  51. package/dist/utility/chart/kscript-viewport-overlays.util.js +443 -0
  52. package/dist/utility/chart/om-panel-push-style.util.d.ts +78 -0
  53. package/dist/utility/chart/om-panel-push-style.util.js +301 -0
  54. package/dist/utility/chart/om-panel.util.d.ts +166 -0
  55. package/dist/utility/chart/om-panel.util.js +815 -0
  56. package/dist/utility/chart/om-series.util.d.ts +42 -0
  57. package/dist/utility/chart/om-series.util.js +330 -0
  58. package/dist/utility/chart/om-target.util.d.ts +11 -0
  59. package/dist/utility/chart/om-target.util.js +24 -0
  60. package/dist/utility/chart/om-widget.util.d.ts +148 -0
  61. package/dist/utility/chart/om-widget.util.js +413 -0
  62. package/dist/utility/chart/overlay-output-budget.util.d.ts +16 -0
  63. package/dist/utility/chart/overlay-output-budget.util.js +109 -0
  64. package/dist/utility/chart/overlay-paint-flags.util.d.ts +24 -0
  65. package/dist/utility/chart/overlay-paint-flags.util.js +55 -0
  66. package/dist/utility/chart/profile-row-height.util.d.ts +21 -0
  67. package/dist/utility/chart/profile-row-height.util.js +110 -0
  68. package/dist/utility/chart/session-interval.util.d.ts +1 -0
  69. package/dist/utility/chart/session-interval.util.js +35 -0
  70. package/dist/utility/chart/technical-script-legend-value.util.d.ts +18 -0
  71. package/dist/utility/chart/technical-script-legend-value.util.js +53 -0
  72. package/dist/utility/chart/trading-day.util.d.ts +70 -0
  73. package/dist/utility/chart/trading-day.util.js +238 -0
  74. package/dist/utility/chart/wrun-legend-name.util.d.ts +25 -0
  75. package/dist/utility/chart/wrun-legend-name.util.js +87 -0
  76. package/dist/utility/chart/wrun-run-result.util.d.ts +977 -0
  77. package/dist/utility/chart/wrun-run-result.util.js +5179 -0
  78. package/dist/utility/chart/wrun-visibility-chart.util.d.ts +25 -0
  79. package/dist/utility/chart/wrun-visibility-chart.util.js +22 -0
  80. package/dist/utility/indicators/heatmap-sensitivity.util.d.ts +62 -0
  81. package/dist/utility/indicators/heatmap-sensitivity.util.js +82 -0
  82. package/dist/utility/number-format.util.d.ts +68 -0
  83. package/dist/utility/number-format.util.js +188 -0
  84. package/dist/utility/v2/opra-governed.util.d.ts +1 -0
  85. package/dist/utility/v2/opra-governed.util.js +13 -0
  86. package/dist/utility/wrun/wrun-auto-row.util.d.ts +54 -0
  87. package/dist/utility/wrun/wrun-auto-row.util.js +96 -0
  88. package/dist/utility/wrun/wrun-batched-marks.util.d.ts +341 -0
  89. package/dist/utility/wrun/wrun-batched-marks.util.js +938 -0
  90. package/dist/utility/wrun/wrun-batched-readout.util.d.ts +75 -0
  91. package/dist/utility/wrun/wrun-batched-readout.util.js +171 -0
  92. package/dist/utility/wrun/wrun-box-segment.util.d.ts +185 -0
  93. package/dist/utility/wrun/wrun-box-segment.util.js +570 -0
  94. package/dist/utility/wrun/wrun-build-memo.util.d.ts +133 -0
  95. package/dist/utility/wrun/wrun-build-memo.util.js +301 -0
  96. package/dist/utility/wrun/wrun-builtin-twin-ports.util.d.ts +25 -0
  97. package/dist/utility/wrun/wrun-builtin-twin-ports.util.js +75 -0
  98. package/dist/utility/wrun/wrun-builtin-twin.util.d.ts +9 -0
  99. package/dist/utility/wrun/wrun-builtin-twin.util.js +40 -0
  100. package/dist/utility/wrun/wrun-canvas-cache.util.d.ts +28 -0
  101. package/dist/utility/wrun/wrun-canvas-cache.util.js +56 -0
  102. package/dist/utility/wrun/wrun-canvas-readout.util.d.ts +69 -0
  103. package/dist/utility/wrun/wrun-canvas-readout.util.js +53 -0
  104. package/dist/utility/wrun/wrun-canvases.util.d.ts +295 -0
  105. package/dist/utility/wrun/wrun-canvases.util.js +1432 -0
  106. package/dist/utility/wrun/wrun-cap-notice.util.d.ts +77 -0
  107. package/dist/utility/wrun/wrun-cap-notice.util.js +296 -0
  108. package/dist/utility/wrun/wrun-card-style.util.d.ts +154 -0
  109. package/dist/utility/wrun/wrun-card-style.util.js +539 -0
  110. package/dist/utility/wrun/wrun-chart-context.util.d.ts +89 -0
  111. package/dist/utility/wrun/wrun-chart-context.util.js +213 -0
  112. package/dist/utility/wrun/wrun-chart-names.util.d.ts +23 -0
  113. package/dist/utility/wrun/wrun-chart-names.util.js +33 -0
  114. package/dist/utility/wrun/wrun-chart-time.util.d.ts +12 -0
  115. package/dist/utility/wrun/wrun-chart-time.util.js +23 -0
  116. package/dist/utility/wrun/wrun-child-overlay-id.util.d.ts +13 -0
  117. package/dist/utility/wrun/wrun-child-overlay-id.util.js +44 -0
  118. package/dist/utility/wrun/wrun-color-facts.util.d.ts +40 -0
  119. package/dist/utility/wrun/wrun-color-facts.util.js +88 -0
  120. package/dist/utility/wrun/wrun-color-settings.lazy.d.ts +26 -0
  121. package/dist/utility/wrun/wrun-color-settings.lazy.js +9 -0
  122. package/dist/utility/wrun/wrun-color-settings.util.d.ts +351 -0
  123. package/dist/utility/wrun/wrun-color-settings.util.js +1363 -0
  124. package/dist/utility/wrun/wrun-footprint-modes.util.d.ts +23 -0
  125. package/dist/utility/wrun/wrun-footprint-modes.util.js +24 -0
  126. package/dist/utility/wrun/wrun-frames.d.ts +217 -0
  127. package/dist/utility/wrun/wrun-frames.js +1021 -0
  128. package/dist/utility/wrun/wrun-handles.util.d.ts +792 -0
  129. package/dist/utility/wrun/wrun-handles.util.js +2050 -0
  130. package/dist/utility/wrun/wrun-heatmap-cell-budget.util.d.ts +156 -0
  131. package/dist/utility/wrun/wrun-heatmap-cell-budget.util.js +342 -0
  132. package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +218 -0
  133. package/dist/utility/wrun/wrun-hosted-wire-caps.js +667 -0
  134. package/dist/utility/wrun/wrun-hosted-wire.util.d.ts +40 -0
  135. package/dist/utility/wrun/wrun-hosted-wire.util.js +27 -0
  136. package/dist/utility/wrun/wrun-hover.util.d.ts +182 -0
  137. package/dist/utility/wrun/wrun-hover.util.js +534 -0
  138. package/dist/utility/wrun/wrun-hud-looks.util.d.ts +246 -0
  139. package/dist/utility/wrun/wrun-hud-looks.util.js +587 -0
  140. package/dist/utility/wrun/wrun-integration-budget.util.d.ts +47 -0
  141. package/dist/utility/wrun/wrun-integration-budget.util.js +122 -0
  142. package/dist/utility/wrun/wrun-latest-snapshot.d.ts +19 -0
  143. package/dist/utility/wrun/wrun-latest-snapshot.js +7 -0
  144. package/dist/utility/wrun/wrun-levels-child.util.d.ts +131 -0
  145. package/dist/utility/wrun/wrun-levels-child.util.js +514 -0
  146. package/dist/utility/wrun/wrun-lifecycle.contract.d.ts +75 -0
  147. package/dist/utility/wrun/wrun-lifecycle.contract.js +9 -0
  148. package/dist/utility/wrun/wrun-market-facts.util.d.ts +116 -0
  149. package/dist/utility/wrun/wrun-market-facts.util.js +238 -0
  150. package/dist/utility/wrun/wrun-output-style.util.d.ts +344 -0
  151. package/dist/utility/wrun/wrun-output-style.util.js +1239 -0
  152. package/dist/utility/wrun/wrun-overlay-identity.util.d.ts +84 -0
  153. package/dist/utility/wrun/wrun-overlay-identity.util.js +142 -0
  154. package/dist/utility/wrun/wrun-overlay-result.util.d.ts +120 -0
  155. package/dist/utility/wrun/wrun-overlay-result.util.js +219 -0
  156. package/dist/utility/wrun/wrun-pack.util.d.ts +70 -0
  157. package/dist/utility/wrun/wrun-pack.util.js +301 -0
  158. package/dist/utility/wrun/wrun-pane-format.util.d.ts +180 -0
  159. package/dist/utility/wrun/wrun-pane-format.util.js +299 -0
  160. package/dist/utility/wrun/wrun-panel-style.lazy.d.ts +25 -0
  161. package/dist/utility/wrun/wrun-panel-style.lazy.js +15 -0
  162. package/dist/utility/wrun/wrun-panel-style.util.d.ts +174 -0
  163. package/dist/utility/wrun/wrun-panel-style.util.js +726 -0
  164. package/dist/utility/wrun/wrun-param-values.util.d.ts +69 -0
  165. package/dist/utility/wrun/wrun-param-values.util.js +230 -0
  166. package/dist/utility/wrun/wrun-refusal.util.d.ts +263 -0
  167. package/dist/utility/wrun/wrun-refusal.util.js +1259 -0
  168. package/dist/utility/wrun/wrun-registry-errors.util.d.ts +199 -0
  169. package/dist/utility/wrun/wrun-registry-errors.util.js +257 -0
  170. package/dist/utility/wrun/wrun-render-select.util.d.ts +336 -0
  171. package/dist/utility/wrun/wrun-render-select.util.js +1157 -0
  172. package/dist/utility/wrun/wrun-script-inputs.util.d.ts +434 -0
  173. package/dist/utility/wrun/wrun-script-inputs.util.js +1971 -0
  174. package/dist/utility/wrun/wrun-setting-words.lazy.d.ts +20 -0
  175. package/dist/utility/wrun/wrun-setting-words.lazy.js +9 -0
  176. package/dist/utility/wrun/wrun-setting-words.util.d.ts +79 -0
  177. package/dist/utility/wrun/wrun-setting-words.util.js +176 -0
  178. package/dist/utility/wrun/wrun-socket-row-store.d.ts +98 -0
  179. package/dist/utility/wrun/wrun-socket-row-store.js +417 -0
  180. package/dist/utility/wrun/wrun-style-flags.util.d.ts +18 -0
  181. package/dist/utility/wrun/wrun-style-flags.util.js +21 -0
  182. package/dist/utility/wrun/wrun-style-words.util.d.ts +148 -0
  183. package/dist/utility/wrun/wrun-style-words.util.js +439 -0
  184. package/dist/utility/wrun/wrun-table-look.util.d.ts +125 -0
  185. package/dist/utility/wrun/wrun-table-look.util.js +225 -0
  186. package/dist/utility/wrun/wrun-text-look.util.d.ts +51 -0
  187. package/dist/utility/wrun/wrun-text-look.util.js +227 -0
  188. package/dist/utility/wrun/wrun-text-params.util.d.ts +106 -0
  189. package/dist/utility/wrun/wrun-text-params.util.js +171 -0
  190. package/dist/utility/wrun/wrun-tpo-rows.util.d.ts +71 -0
  191. package/dist/utility/wrun/wrun-tpo-rows.util.js +438 -0
  192. package/dist/utility/wrun/wrun-twin-compute-inputs.util.d.ts +14 -0
  193. package/dist/utility/wrun/wrun-twin-compute-inputs.util.js +58 -0
  194. package/dist/utility/wrun/wrun-visibility-table.d.ts +437 -0
  195. package/dist/utility/wrun/wrun-visibility-table.js +237 -0
  196. package/dist/utility/wrun/wrun-volume-profile.util.d.ts +37 -0
  197. package/dist/utility/wrun/wrun-volume-profile.util.js +278 -0
  198. 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[];