@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,78 @@
1
+ /**
2
+ * The panel style words on the om push lane (`set_panel`): the value and kind
3
+ * rules the parse checks, and the quiet look a pushed panel takes for every
4
+ * word it does not declare.
5
+ *
6
+ * The wrun lane gets its words from the kit, which validated them before the
7
+ * frame reached the app. The push lane has no kit in front of it, so a word
8
+ * om sends is checked here: its type, range or word list, the kinds it
9
+ * applies to, and colours as `#rrggbb` or `#rrggbbaa` only (the push lane
10
+ * resolves no theme tokens). The vocabulary is the om SDK's
11
+ * (`packages/sdk/src/wrun-style/panel.ts`: WRUN_PANEL_STYLE_FIELDS and
12
+ * WRUN_PANEL_WORD_KINDS); its cross-field companions (`legend_latest` needs
13
+ * chips, `decimals` needs `format` and the like) are not repeated, since a
14
+ * word without its companion draws nothing. `bar_width` and `bar_radius` are
15
+ * the app's own: the kit does not know them yet, so they are checked on both
16
+ * lanes.
17
+ *
18
+ * Pure and light: the panel parse every boot path and the frame worker hold
19
+ * imports it.
20
+ */
21
+ import type { WrunPanelSeriesStyle, WrunPanelStyle } from '../../interfaces/wrun-runtime.interface.js';
22
+ import type { ParsedPanel } from './om-panel.util.js';
23
+ type PanelKind = ParsedPanel['panel']['kind'];
24
+ export type PanelStyleWord = keyof WrunPanelStyle;
25
+ export type PanelSeriesStyleWord = keyof WrunPanelSeriesStyle;
26
+ /** Every `panels[i]` style word (both lanes accept them; the push lane checks them here). */
27
+ export declare const PANEL_STYLE_WORDS: ReadonlySet<string>;
28
+ /** Every `panels[i].series[j]` style word. */
29
+ export declare const PANEL_SERIES_STYLE_WORDS: ReadonlySet<string>;
30
+ /** What the word scoping reads off a panel: its kind, x and place. */
31
+ export interface PanelStyleScope {
32
+ kind: PanelKind;
33
+ x: string;
34
+ place: string;
35
+ }
36
+ /** The first style word on `panel` that is invalid for it (its value or its kind), else
37
+ * undefined. The push lane checks every word, the wrun lane the app's own words only. */
38
+ export declare function invalidPanelStyleWord(panel: Record<string, unknown>, scope: PanelStyleScope, lane: 'push' | 'wrun'): PanelStyleWord | undefined;
39
+ /** The first style word on a push-lane series entry that is invalid for its panel's kind. */
40
+ export declare function invalidSeriesStyleWord(series: Record<string, unknown>, kind: PanelKind): PanelSeriesStyleWord | undefined;
41
+ /**
42
+ * The quiet look of an om panel, one entry per kind: what a pushed panel draws with for every
43
+ * style word it does not declare (a declared word always wins). Tuned against the approved mock
44
+ * (openmarket mocks/yzi-chart-style), within what the engine draws:
45
+ *
46
+ * - bars, histogram: no frame and no gridlines (`chrome: none`), bars at about half their slot
47
+ * with a rounded data end (`bar_width`, `bar_radius`).
48
+ * - line: `chrome: grid`, which on the rich curve is rows-only hairlines and no frame (the
49
+ * `grid_lines` word is a table word in the SDK), a smoothed stroke and a fading fill.
50
+ * - scatter: no frame and no gridlines (the engine has no rows-only scatter grid; its two-axis
51
+ * grid adds a column rule at every x tick and a zero rule), and points in the engine's own
52
+ * default teal at half opacity, so a dense cloud reads as density. A row's own colour wins.
53
+ * - pie: no frame, 2 px gaps between slices and the total in the hole when the pie has one.
54
+ * Slices keep their leader-line labels (name and percent); a pie that declares
55
+ * `legend_style: 'title'` lists them as chips beside the title instead, as on the wrun lane
56
+ * (the chips truncate the names and drop the percents once five or six slices share a side
57
+ * panel's title row).
58
+ * - table: no outer frame and no cell boxes, a 1 px rule between rows.
59
+ * - heatmap, tiles: no word to quiet them; today's look stands.
60
+ */
61
+ export declare const OM_PANEL_QUIET_DEFAULTS: Readonly<Partial<Record<PanelKind, Readonly<WrunPanelStyle>>>>;
62
+ /** A pushed panel with its kind's quiet words under the ones it declares (a pie with a hole
63
+ * also prints its total there). */
64
+ export declare function withOmPanelQuietDefaults(frame: ParsedPanel): ParsedPanel;
65
+ /**
66
+ * The quiet look past the style words: engine settings the push mount lays under a translated
67
+ * panel's own, for what no word names (so nothing a frame says overrides them).
68
+ *
69
+ * - line: at most six value ticks (`maxYTicks`). The engine's height rule gives a tall side cell
70
+ * a label at every unit (23 on a 930 px panel over -7..15); six steps it in fives, and a short
71
+ * panel keeps its count. An engine without the setting ignores it.
72
+ */
73
+ export declare const OM_PANEL_QUIET_ENGINE_SETTINGS: Readonly<Partial<Record<PanelKind, Readonly<Record<string, unknown>>>>>;
74
+ /** A translated pushed panel with its kind's quiet engine settings under the translated ones. */
75
+ export declare function withOmPanelQuietEngineSettings<T extends {
76
+ settings: Record<string, unknown>;
77
+ }>(kind: PanelKind, translated: T): T;
78
+ export {};
@@ -0,0 +1,301 @@
1
+ import { WRUN_FONT_FAMILIES, WRUN_FONT_WEIGHTS, WRUN_MAX_VALUE_DECIMALS, WRUN_MAX_VALUE_UNIT_CHARS, WRUN_VALUE_FORMATS, } from '../wrun/wrun-style-words.util.js';
2
+ function isRecord(value) {
3
+ return value !== null && typeof value === 'object' && !Array.isArray(value);
4
+ }
5
+ const bool = (value) => typeof value === 'boolean';
6
+ const finite = (value) => typeof value === 'number' && Number.isFinite(value);
7
+ const between = (min, max) => (value) => finite(value) && value >= min && value <= max;
8
+ const integer = (min, max) => (value) => Number.isSafeInteger(value) && value >= min && value <= max;
9
+ const oneOf = (words) => (value) => typeof value === 'string' && words.includes(value);
10
+ const text = (max) => (value) => typeof value === 'string' && value.length >= 1 && value.length <= max;
11
+ const HEX_COLOR = /^#[0-9a-fA-F]{6}([0-9a-fA-F]{2})?$/;
12
+ /** A push-lane colour: `#rrggbb` or `#rrggbbaa`. */
13
+ const hex = (value) => typeof value === 'string' && HEX_COLOR.test(value);
14
+ const listOf = (item, min, max) => (value) => Array.isArray(value) && value.length >= min && value.length <= max && value.every(item);
15
+ /** An object of the named fields only, each valid, with `required` present. */
16
+ const shape = (fields, required = []) => (value) => isRecord(value) &&
17
+ required.every((key) => value[key] !== undefined) &&
18
+ Object.entries(value).every(([key, entry]) => key in fields && fields[key](entry));
19
+ const LINE_STYLES = ['solid', 'dashed', 'dotted'];
20
+ const LABEL_POSITIONS = [
21
+ 'top_left',
22
+ 'top_center',
23
+ 'top_right',
24
+ 'middle_left',
25
+ 'middle_center',
26
+ 'middle_right',
27
+ 'bottom_left',
28
+ 'bottom_center',
29
+ 'bottom_right',
30
+ ];
31
+ const ALIGNS = ['left', 'center', 'right'];
32
+ const VALIGNS = ['top', 'middle', 'bottom'];
33
+ const LABEL_CHARS = 24;
34
+ const TITLE_CHARS = 40;
35
+ const KEY_CHARS = 64;
36
+ const MAX_TABLE_PX = 4096;
37
+ const markWidth = between(0.5, 4);
38
+ const lineWidth = between(0, 10);
39
+ const unit = (value) => typeof value === 'string' && value.length <= WRUN_MAX_VALUE_UNIT_CHARS;
40
+ const decimals = integer(0, WRUN_MAX_VALUE_DECIMALS);
41
+ const format = oneOf(WRUN_VALUE_FORMATS);
42
+ const marker = shape({
43
+ x: (value) => finite(value) || text(KEY_CHARS)(value),
44
+ label: text(LABEL_CHARS),
45
+ color: hex,
46
+ badge: bool,
47
+ wash: bool,
48
+ valign: oneOf(['top', 'middle', 'point']),
49
+ y: finite,
50
+ series: text(LABEL_CHARS),
51
+ show_value: bool,
52
+ line_style: oneOf(LINE_STYLES),
53
+ width: markWidth,
54
+ }, ['x']);
55
+ const guide = shape({
56
+ axis: oneOf(['x', 'y']),
57
+ value: finite,
58
+ label: text(LABEL_CHARS),
59
+ color: hex,
60
+ line_style: oneOf(LINE_STYLES),
61
+ width: markWidth,
62
+ }, ['axis', 'value']);
63
+ const ALL = ['bars', 'line', 'scatter', 'histogram', 'pie', 'heatmap', 'table', 'tiles'];
64
+ const AXIS = ['line', 'bars', 'histogram', 'scatter'];
65
+ const BARS = ['bars', 'histogram'];
66
+ /** Every panel style word: its valid values and the kinds it applies to (the SDK's table, plus
67
+ * the two bar words). A word the interface gains without a rule here fails to compile. */
68
+ const PANEL_WORD_RULES = {
69
+ height_frac: { kinds: ALL, valid: between(0.05, 0.9) },
70
+ maximize: { kinds: ALL, valid: bool },
71
+ stats_row: { kinds: ['line'], valid: bool },
72
+ font_family: { kinds: ALL, valid: oneOf(WRUN_FONT_FAMILIES) },
73
+ hover_card: { kinds: ['line', 'bars', 'histogram', 'scatter', 'pie', 'heatmap', 'tiles'], valid: bool },
74
+ chrome: { kinds: ['line', 'bars', 'histogram', 'scatter', 'pie'], valid: oneOf(['box', 'grid', 'none']) },
75
+ format: { kinds: ALL, valid: format },
76
+ decimals: { kinds: ALL, valid: decimals },
77
+ signed: { kinds: ALL, valid: bool },
78
+ unit: { kinds: ALL, valid: unit },
79
+ x_format: { kinds: ['line', 'bars', 'scatter'], valid: format },
80
+ x_decimals: { kinds: ['line', 'bars', 'scatter'], valid: decimals },
81
+ x_unit: { kinds: ['line', 'bars', 'scatter'], valid: unit },
82
+ x_title: { kinds: AXIS, valid: text(TITLE_CHARS) },
83
+ y_title: { kinds: AXIS, valid: text(TITLE_CHARS) },
84
+ x_min: { kinds: ['line', 'scatter'], valid: finite },
85
+ x_max: { kinds: ['line', 'scatter'], valid: finite },
86
+ y_min: { kinds: AXIS, valid: finite },
87
+ y_max: { kinds: AXIS, valid: finite },
88
+ y_zero: { kinds: ['line', 'scatter'], valid: bool },
89
+ legend_style: { kinds: ['line', 'bars', 'scatter', 'pie'], valid: oneOf(['none', 'title', 'pane', 'chips']) },
90
+ legend_latest: { kinds: ['line'], valid: bool },
91
+ badge: { kinds: AXIS, valid: shape({ text: text(LABEL_CHARS), color: hex, text_color: hex }, ['text']) },
92
+ positive_color: { kinds: ['line', 'bars', 'heatmap', 'tiles'], valid: hex },
93
+ negative_color: { kinds: ['line', 'bars', 'heatmap', 'tiles'], valid: hex },
94
+ smooth: { kinds: ['line'], valid: bool },
95
+ points: { kinds: ['line'], valid: bool },
96
+ glow: { kinds: ['line'], valid: bool },
97
+ animate: { kinds: ['line'], valid: bool },
98
+ fill_mode: { kinds: ['line'], valid: oneOf(['flat', 'signed']) },
99
+ fill_positive_color: { kinds: ['line'], valid: hex },
100
+ fill_negative_color: { kinds: ['line'], valid: hex },
101
+ fill_fade: { kinds: ['line'], valid: bool },
102
+ stroke_fade: {
103
+ kinds: ['line'],
104
+ valid: shape({
105
+ pivot: (value) => value === 'spot' || finite(value),
106
+ edge_opacity: between(0, 1),
107
+ left_color: hex,
108
+ right_color: hex,
109
+ }, ['pivot']),
110
+ },
111
+ markers: { kinds: ['line'], valid: listOf(marker, 0, 8) },
112
+ bar_width: { kinds: BARS, valid: between(0.2, 1) },
113
+ bar_radius: { kinds: BARS, valid: integer(0, 12) },
114
+ color_mode: { kinds: ['bars'], valid: oneOf(['series', 'sign']) },
115
+ color: { kinds: ['histogram', 'scatter'], valid: hex },
116
+ guides: { kinds: ['scatter'], valid: listOf(guide, 0, 8) },
117
+ quadrants: {
118
+ kinds: ['scatter'],
119
+ valid: shape({ x: finite, y: finite, colors: listOf(hex, 4, 4), labels: listOf(text(LABEL_CHARS), 4, 4) }, [
120
+ 'x',
121
+ 'y',
122
+ 'colors',
123
+ ]),
124
+ },
125
+ trails: { kinds: ['scatter'], valid: bool },
126
+ trail_width: { kinds: ['scatter'], valid: between(0.5, 6) },
127
+ trail_fade: { kinds: ['scatter'], valid: bool },
128
+ label_overlap: { kinds: ['scatter'], valid: oneOf(['hide', 'leader', 'show']) },
129
+ hole_total: { kinds: ['pie'], valid: bool },
130
+ hole_caption: { kinds: ['pie'], valid: text(LABEL_CHARS) },
131
+ slice_gap: { kinds: ['pie'], valid: between(0, 8) },
132
+ border_color: { kinds: ['pie', 'table'], valid: hex },
133
+ border_width: { kinds: ['pie', 'table'], valid: lineWidth },
134
+ scale: { kinds: ['heatmap'], valid: oneOf(['palette', 'signed']) },
135
+ palette: { kinds: ['heatmap'], valid: listOf(hex, 2, 8) },
136
+ min: { kinds: ['heatmap'], valid: finite },
137
+ max: { kinds: ['heatmap'], valid: finite },
138
+ highlight: {
139
+ kinds: ['heatmap'],
140
+ valid: (value) => shape({ row: text(KEY_CHARS), col: text(KEY_CHARS) })(value) &&
141
+ (value.row !== undefined || value.col !== undefined),
142
+ },
143
+ row_title: { kinds: ['heatmap'], valid: text(LABEL_CHARS) },
144
+ col_title: { kinds: ['heatmap'], valid: text(LABEL_CHARS) },
145
+ columns: { kinds: ['tiles'], valid: integer(1, 8) },
146
+ accent: { kinds: ['tiles'], valid: oneOf(['auto', 'neutral']) },
147
+ position: { kinds: ['table'], valid: oneOf(LABEL_POSITIONS) },
148
+ offset: { kinds: ['table'], valid: listOf(integer(-200, 200), 2, 2) },
149
+ width: { kinds: ['table'], valid: integer(0, MAX_TABLE_PX) },
150
+ column_widths: { kinds: ['table'], valid: listOf(integer(0, MAX_TABLE_PX), 0, 12) },
151
+ cell_padding: { kinds: ['table'], valid: integer(0, 64) },
152
+ font_size: { kinds: ['table'], valid: integer(6, 64) },
153
+ font_weight: { kinds: ['table'], valid: oneOf(WRUN_FONT_WEIGHTS) },
154
+ align: { kinds: ['table'], valid: oneOf(ALIGNS) },
155
+ valign: { kinds: ['table'], valid: oneOf(VALIGNS) },
156
+ text_color: { kinds: ['table'], valid: hex },
157
+ header_text_color: { kinds: ['table'], valid: hex },
158
+ background_color: { kinds: ['table'], valid: hex },
159
+ background_opacity: { kinds: ['table'], valid: between(0, 1) },
160
+ background_gradient: { kinds: ['table'], valid: listOf(hex, 2, 8) },
161
+ gradient_direction: { kinds: ['table'], valid: oneOf(['vertical', 'horizontal']) },
162
+ header_background_color: { kinds: ['table'], valid: hex },
163
+ border_style: { kinds: ['table'], valid: oneOf(LINE_STYLES) },
164
+ grid_color: { kinds: ['table'], valid: hex },
165
+ grid_width: { kinds: ['table'], valid: lineWidth },
166
+ grid_style: { kinds: ['table'], valid: oneOf(LINE_STYLES) },
167
+ grid_lines: { kinds: ['table'], valid: oneOf(['all', 'rows', 'cols', 'none']) },
168
+ header_column: { kinds: ['table'], valid: bool },
169
+ width_px: { kinds: ALL, valid: integer(160, 480) },
170
+ height_px: { kinds: ALL, valid: integer(80, 800) },
171
+ };
172
+ const SERIES_WORD_RULES = {
173
+ fill: { kinds: ['line'], valid: bool },
174
+ fill_color: { kinds: ['line'], valid: hex },
175
+ style: { kinds: ['line'], valid: oneOf(['line', 'bars', 'step']) },
176
+ smooth: { kinds: ['line'], valid: bool },
177
+ points: { kinds: ['line'], valid: bool },
178
+ labels: { kinds: ['line'], valid: bool },
179
+ width: { kinds: ['line'], valid: between(0.5, 20) },
180
+ line_style: { kinds: ['line'], valid: oneOf(LINE_STYLES) },
181
+ legend: { kinds: ['line', 'bars'], valid: bool },
182
+ align: { kinds: ['table'], valid: oneOf(ALIGNS) },
183
+ format: { kinds: ['table'], valid: format },
184
+ decimals: { kinds: ['table'], valid: decimals },
185
+ signed: { kinds: ['table'], valid: bool },
186
+ unit: { kinds: ['table'], valid: unit },
187
+ };
188
+ /** Every `panels[i]` style word (both lanes accept them; the push lane checks them here). */
189
+ export const PANEL_STYLE_WORDS = new Set(Object.keys(PANEL_WORD_RULES));
190
+ /** Every `panels[i].series[j]` style word. */
191
+ export const PANEL_SERIES_STYLE_WORDS = new Set(Object.keys(SERIES_WORD_RULES));
192
+ /** The words the kit does not validate yet: checked on the wrun lane too. */
193
+ const APP_CHECKED_WORDS = new Set(['bar_width', 'bar_radius']);
194
+ /** The SDK's conditions past the kind table: x words need a numeric x (or a scatter), the side
195
+ * box needs place side, a pie has no grid chrome, chips are a line legend and pane a line or bars
196
+ * one (wrunPanelAllowsWord and refineWrunPanelStyle). */
197
+ function fitsPanel(scope, word, value) {
198
+ const numeric = scope.x === 'index' || scope.x === 'number';
199
+ switch (word) {
200
+ case 'x_format':
201
+ case 'x_decimals':
202
+ case 'x_unit':
203
+ case 'x_min':
204
+ case 'x_max':
205
+ return scope.kind === 'scatter' || numeric;
206
+ case 'width_px':
207
+ case 'height_px':
208
+ return scope.place === 'side';
209
+ case 'chrome':
210
+ return !(scope.kind === 'pie' && value === 'grid');
211
+ case 'legend_style':
212
+ if (value === 'chips')
213
+ return scope.kind === 'line';
214
+ if (value === 'pane')
215
+ return scope.kind === 'line' || scope.kind === 'bars';
216
+ return true;
217
+ default:
218
+ return true;
219
+ }
220
+ }
221
+ /** The first style word on `panel` that is invalid for it (its value or its kind), else
222
+ * undefined. The push lane checks every word, the wrun lane the app's own words only. */
223
+ export function invalidPanelStyleWord(panel, scope, lane) {
224
+ for (const [key, value] of Object.entries(panel)) {
225
+ if (!PANEL_STYLE_WORDS.has(key) || value === undefined)
226
+ continue;
227
+ if (lane === 'wrun' && !APP_CHECKED_WORDS.has(key))
228
+ continue;
229
+ const word = key;
230
+ const rule = PANEL_WORD_RULES[word];
231
+ if (!rule.kinds.includes(scope.kind) || !rule.valid(value) || !fitsPanel(scope, word, value))
232
+ return word;
233
+ }
234
+ return undefined;
235
+ }
236
+ /** The first style word on a push-lane series entry that is invalid for its panel's kind. */
237
+ export function invalidSeriesStyleWord(series, kind) {
238
+ for (const [key, value] of Object.entries(series)) {
239
+ if (!PANEL_SERIES_STYLE_WORDS.has(key) || value === undefined)
240
+ continue;
241
+ const word = key;
242
+ const rule = SERIES_WORD_RULES[word];
243
+ if (!rule.kinds.includes(kind) || !rule.valid(value))
244
+ return word;
245
+ }
246
+ return undefined;
247
+ }
248
+ /**
249
+ * The quiet look of an om panel, one entry per kind: what a pushed panel draws with for every
250
+ * style word it does not declare (a declared word always wins). Tuned against the approved mock
251
+ * (openmarket mocks/yzi-chart-style), within what the engine draws:
252
+ *
253
+ * - bars, histogram: no frame and no gridlines (`chrome: none`), bars at about half their slot
254
+ * with a rounded data end (`bar_width`, `bar_radius`).
255
+ * - line: `chrome: grid`, which on the rich curve is rows-only hairlines and no frame (the
256
+ * `grid_lines` word is a table word in the SDK), a smoothed stroke and a fading fill.
257
+ * - scatter: no frame and no gridlines (the engine has no rows-only scatter grid; its two-axis
258
+ * grid adds a column rule at every x tick and a zero rule), and points in the engine's own
259
+ * default teal at half opacity, so a dense cloud reads as density. A row's own colour wins.
260
+ * - pie: no frame, 2 px gaps between slices and the total in the hole when the pie has one.
261
+ * Slices keep their leader-line labels (name and percent); a pie that declares
262
+ * `legend_style: 'title'` lists them as chips beside the title instead, as on the wrun lane
263
+ * (the chips truncate the names and drop the percents once five or six slices share a side
264
+ * panel's title row).
265
+ * - table: no outer frame and no cell boxes, a 1 px rule between rows.
266
+ * - heatmap, tiles: no word to quiet them; today's look stands.
267
+ */
268
+ export const OM_PANEL_QUIET_DEFAULTS = {
269
+ bars: { chrome: 'none', bar_width: 0.52, bar_radius: 3 },
270
+ histogram: { chrome: 'none', bar_width: 0.52, bar_radius: 3 },
271
+ line: { chrome: 'grid', smooth: true, fill_fade: true },
272
+ scatter: { chrome: 'none', color: '#43d3c380' },
273
+ pie: { chrome: 'none', slice_gap: 2 },
274
+ table: { border_width: 0, grid_lines: 'rows', grid_width: 1 },
275
+ };
276
+ /** A pushed panel with its kind's quiet words under the ones it declares (a pie with a hole
277
+ * also prints its total there). */
278
+ export function withOmPanelQuietDefaults(frame) {
279
+ const { panel } = frame;
280
+ const quiet = OM_PANEL_QUIET_DEFAULTS[panel.kind];
281
+ if (quiet === undefined)
282
+ return frame;
283
+ const ring = panel.kind === 'pie' && typeof panel.hole === 'number' && panel.hole > 0;
284
+ return { ...frame, panel: { ...quiet, ...(ring ? { hole_total: true } : {}), ...panel } };
285
+ }
286
+ /**
287
+ * The quiet look past the style words: engine settings the push mount lays under a translated
288
+ * panel's own, for what no word names (so nothing a frame says overrides them).
289
+ *
290
+ * - line: at most six value ticks (`maxYTicks`). The engine's height rule gives a tall side cell
291
+ * a label at every unit (23 on a 930 px panel over -7..15); six steps it in fives, and a short
292
+ * panel keeps its count. An engine without the setting ignores it.
293
+ */
294
+ export const OM_PANEL_QUIET_ENGINE_SETTINGS = {
295
+ line: { maxYTicks: 6 },
296
+ };
297
+ /** A translated pushed panel with its kind's quiet engine settings under the translated ones. */
298
+ export function withOmPanelQuietEngineSettings(kind, translated) {
299
+ const quiet = OM_PANEL_QUIET_ENGINE_SETTINGS[kind];
300
+ return quiet === undefined ? translated : { ...translated, settings: { ...quiet, ...translated.settings } };
301
+ }
@@ -0,0 +1,166 @@
1
+ import type { PanelTableCell, SetPanelData } from '../../interfaces/om-panel-data.interface.js';
2
+ import type { WrunPanelSeriesStyle, WrunPanelStyle } from '../../interfaces/wrun-runtime.interface.js';
3
+ import { type PanelSeriesStyleWord, type PanelStyleWord } from './om-panel-push-style.util.js';
4
+ import type { WrunPanelTranslateContext } from '../wrun/wrun-panel-style.util.js';
5
+ import { type WrunColorTheme, type WrunNumberFormatSpec } from '../wrun/wrun-style-words.util.js';
6
+ import type { WrunPanelFrameChrome } from '../wrun/wrun-frames.js';
7
+ export declare const OM_PANEL_MAX_PER_PANE = 8;
8
+ /** Chart-shaped panels (bars, curves, scatter, pie, heatmap, tiles) keep one weight below the chart. */
9
+ export declare const PANEL_CHART_GRID_HEIGHT = 0.22;
10
+ export declare const PANEL_TABLE_ROW_HEIGHT_PX: number;
11
+ /** Pushes the table below the pane's legend pill row so the title never prints over the header. */
12
+ export declare const PANEL_TABLE_TOP_OFFSET_PX = 24;
13
+ /** Which lane a frame arrived on: the om push socket (`set_panel`) or a wrun
14
+ * frame. Both carry the style words: a wrun declaration's were validated by
15
+ * the kit, a push frame's are validated here (om-panel-push-style.util). The
16
+ * row grammar is the same on both. */
17
+ export type PanelLane = 'push' | 'wrun';
18
+ export interface ParseSetPanelOptions {
19
+ lane?: PanelLane;
20
+ }
21
+ /** One series column: the collab `{ name, color }` plus its per-series style words. */
22
+ export type PanelSeriesDeclaration = NonNullable<NonNullable<SetPanelData['panel']>['series']>[number] & WrunPanelSeriesStyle;
23
+ /** A parsed panel declaration: the collab panel plus its `panels[i]` style words. */
24
+ export type PanelDeclaration = Omit<NonNullable<SetPanelData['panel']>, 'series'> & WrunPanelStyle & {
25
+ series?: PanelSeriesDeclaration[];
26
+ };
27
+ export interface ParsedPanel {
28
+ chartIndex: number;
29
+ payloadId: string;
30
+ revision: number;
31
+ panel: PanelDeclaration;
32
+ rows: NonNullable<SetPanelData['rows']>;
33
+ source?: SetPanelData['source'];
34
+ /** The per-run chrome a wrun frame carries beside `rows` (SC17), parsed by
35
+ * the frame host; a frame field overrides the declared word for the run. */
36
+ chrome?: WrunPanelFrameChrome;
37
+ /** The server's save time of a saved copy, set only by the persisted loader
38
+ * (news-pins-load.util) from its row's `pushedAt`: the legend's "as of"
39
+ * stamp. The parser never sets it and a live frame never has it. */
40
+ savedAtMs?: number;
41
+ }
42
+ export interface ParsedPanelClear {
43
+ chartIndex: number;
44
+ payloadId: string;
45
+ revision: number;
46
+ clear: true;
47
+ }
48
+ export type ParsedPanelFrame = ParsedPanel | ParsedPanelClear;
49
+ export type PanelRejectReason = 'payload is not an object' | 'unknown payload key' | 'invalid chartIndex' | 'invalid payloadId' | 'payloadId does not match chartIndex' | 'invalid revision stamp' | 'invalid clear flag (only true is wire-legal)' | 'clear payload carries baggage' | 'invalid panel' | 'unknown panel key' | 'payloadId does not match panel.id' | `invalid panel.${'id' | 'title' | 'kind' | 'x' | 'place' | 'orientation' | 'series' | 'stacked' | 'labels' | 'bins' | 'hole'}` | `invalid panel.${PanelStyleWord}` | `invalid panel.series.${PanelSeriesStyleWord}` | 'unknown panel.series key' | 'heatmap panels use x: category' | 'histogram panels use x: category' | 'rows is not an array' | 'too many rows' | 'invalid panel row' | 'invalid source' | 'unknown source key' | `invalid source.${'kind' | 'ref' | 'computedAtMs'}`;
50
+ export type SetPanelParseResult = {
51
+ ok: true;
52
+ data: ParsedPanelFrame;
53
+ } | {
54
+ ok: false;
55
+ rejectReason: PanelRejectReason;
56
+ };
57
+ export declare function isPanelClearFrame(frame: ParsedPanelFrame): frame is ParsedPanelClear;
58
+ /** Reject an entire frame before it can advance any session revision floor.
59
+ * The row grammar and the style word list are one on both lanes. A push
60
+ * frame's style words are checked here (value, kind, `#rrggbb[aa]` colours)
61
+ * and a bad one is refused by name (`invalid panel.<word>`); a wrun
62
+ * declaration's were checked by the kit, except the app's own bar words. A
63
+ * word outside the list is refused on both lanes. */
64
+ export declare function parseSetPanelData(value: unknown, options?: ParseSetPanelOptions): SetPanelParseResult;
65
+ /** The meta-level hooks a translated panel asks the engine to call (SC08):
66
+ * `formatDomainValue` prints every number the pane shows by role,
67
+ * `getYLabel` its own axis labels on curve panes. Absent keys mean the
68
+ * engine's own formatting. */
69
+ export interface EnginePanelHooks {
70
+ formatDomainValue?: (value: number, role: 'x' | 'axis' | 'value', index: number) => string;
71
+ getYLabel?: (value: number) => string;
72
+ }
73
+ export interface EnginePanel {
74
+ plot: 'bars' | 'curve' | 'scatter' | 'piePane' | 'matrix' | 'table' | 'tiles';
75
+ /** Engine rows: numeric domain rows, or the fixed table's one `[x, payload]` decorator row. */
76
+ rows: unknown[][];
77
+ settings: Record<string, unknown>;
78
+ /** The pane title for this run, plain text: a frame `title` replaces the
79
+ * declared one (SC17). The mount escapes it before the legend. */
80
+ name: string;
81
+ hooks: EnginePanelHooks;
82
+ }
83
+ /** The pane's share of the chart: a declared `height_frac` (SC09), else one
84
+ * weight for chart-shaped panels, else the height a table's rows need
85
+ * (header included, at the declared font size and cell padding) between the
86
+ * engine's pane minimum and half the chart. `chartHeightPx` is the chart
87
+ * canvas in CSS px. */
88
+ export declare function panelGridHeight(panel: ParsedPanel['panel'], rowCount: number, chartHeightPx?: number): number;
89
+ /** One table column as the cells read it: its declared alignment (SC35) and
90
+ * number format (SC40), both ahead of the table's. */
91
+ export interface PanelTableColumn {
92
+ align?: PanelTableCell['align'];
93
+ spec?: WrunNumberFormatSpec;
94
+ }
95
+ export interface PanelTableCellContext {
96
+ theme?: WrunColorTheme;
97
+ /** The chart's price digits for the "price" format. */
98
+ priceDigits?: number;
99
+ /** The table's own number format, behind the column's. */
100
+ tableSpec?: WrunNumberFormatSpec;
101
+ }
102
+ /** The engine's rich cell: `textColor` inks plain text, `color` inks a bar or
103
+ * a spark (an undecorated `color` would paint the cell background instead).
104
+ * A number, or a styled cell's `value`, prints through the column's format,
105
+ * else the table's (SC40); no format keeps the raw print. A styled cell's
106
+ * own background, text look, alignment and spans map onto the T2 table keys
107
+ * (SC14 SC22 SC35); a cell without an alignment takes its column's. */
108
+ export declare function engineTableCell(cell: ParsedPanel['rows'][number][number], column?: PanelTableColumn, ctx?: PanelTableCellContext): unknown;
109
+ /** Labels for a time-keyed curve or bars panel, as short as the key set
110
+ * allows: clock times inside one day, dates for day-aligned keys, a year
111
+ * only past a year. `offsetMs` is the chart's display-timezone shift
112
+ * (SC37): the labels print the wall time of key + offset, UTC fields. */
113
+ export declare function panelTimeLabels(keys: readonly number[], offsetMs?: number): string[];
114
+ /** Domain keys and presentation strings never enter the engine's numeric axes.
115
+ * The panel title stays on the overlay name (the pane's legend pill); the
116
+ * engine's in-canvas chrome title would print it a second time over that pill.
117
+ * `ctx` (the wrun lane) resolves colour words against the chart palette and
118
+ * hands the style mappers the price digits and display timezone; the push
119
+ * lane passes none and its `#rrggbb` colours pass through unchanged. */
120
+ export declare function translatePanelToEngine(frame: ParsedPanel, ctx?: WrunPanelTranslateContext): EnginePanel;
121
+ /** Settings that describe the carved pane and its legend chrome, set at
122
+ * addOverlay and never rewritten by an in-place refresh (the engine also
123
+ * rewrites `gridHeight` to the fraction it carved), plus the focus stamps
124
+ * pane-maximize.util writes while a pane is maximized (SC10) and the pane
125
+ * anchor the engine reads once at addOverlay (C6 `insertBeforePaneId`, the
126
+ * wrun mount's: a later run's anchor is neither written nor deleted, so an
127
+ * anchor change never churns a mounted pane). */
128
+ export declare const PANEL_PANE_LAYOUT_KEYS: ReadonlySet<string>;
129
+ export interface MountedPanelShape {
130
+ plot: string;
131
+ hidePriceScale?: boolean;
132
+ gridHeight: number;
133
+ /** The pane chrome it was carved with: the engine decides the private
134
+ * axis once at addOverlay, so a chrome change re-carves (SC02). */
135
+ chromeStyle?: string;
136
+ }
137
+ /** A mounted panel overlay can take new rows in place when it is the same
138
+ * pane: same engine species, same axis ownership, same chrome and the height
139
+ * it was carved with (a table whose row count moved its height is re-carved). */
140
+ export declare function samePanelPane(mounted: MountedPanelShape, next: MountedPanelShape): boolean;
141
+ export interface PanelRefreshChart {
142
+ metadata: ReadonlyArray<{
143
+ id: string;
144
+ }>;
145
+ updateData?(id: string, data: unknown[][], options?: {
146
+ shouldResetRange?: boolean;
147
+ }): void;
148
+ }
149
+ export interface PanelRefreshNext {
150
+ data: unknown[][];
151
+ settings: Record<string, unknown>;
152
+ /** The run's pane title (SC17); absent leaves the overlay name alone. */
153
+ name?: string;
154
+ /** The run's meta hooks (SC08); absent leaves the mounted hooks alone, a
155
+ * bag without a hook deletes it. */
156
+ hooks?: EnginePanelHooks;
157
+ }
158
+ /** Refresh a mounted panel overlay from a new frame: the row-level settings
159
+ * (labels, series, palette, style) move onto the engine's meta, the run's
160
+ * name and formatter hooks follow (the legend is poked when its title or
161
+ * caption moved), then the rows swap through the engine's own update path.
162
+ * The pane keeps its place in the stack and whatever the reader did to it;
163
+ * a remove + add sent every refreshed pane to the bottom, and two panels
164
+ * updating leapfrogged. The wrun child mount and the om push lane share
165
+ * this one path. */
166
+ export declare function refreshPanelOverlayInPlace(tc: PanelRefreshChart, id: string, next: PanelRefreshNext, mountedSettings: Record<string, unknown>): void;