@orangecharts/wrun-chart-host 0.9.0 → 0.11.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 (252) hide show
  1. package/README.md +2 -0
  2. package/dist/constants/feature-flags.constants.d.ts +15 -1
  3. package/dist/constants/feature-flags.constants.js +130 -24
  4. package/dist/constants/governed-exchanges.constants.d.ts +12 -0
  5. package/dist/constants/governed-exchanges.constants.js +16 -0
  6. package/dist/constants/opra-compliance.constants.d.ts +3 -2
  7. package/dist/constants/opra-compliance.constants.js +3 -2
  8. package/dist/constants/option-venues.constants.d.ts +2 -2
  9. package/dist/constants/scriptEditor/builtin-script-snippets.d.ts +26 -0
  10. package/dist/constants/scriptEditor/builtin-script-snippets.js +6 -0
  11. package/dist/constants/scriptEditor/technicalIndicatorScriptKeys.constants.d.ts +15 -0
  12. package/dist/constants/scriptEditor/technicalIndicatorScriptKeys.constants.js +17 -0
  13. package/dist/constants/venue-presets.constants.d.ts +20 -20
  14. package/dist/constants/venue-presets.constants.js +24 -26
  15. package/dist/host-env.d.ts +21 -5
  16. package/dist/host-env.js +6 -0
  17. package/dist/host-ports.types.d.ts +102 -19
  18. package/dist/index.d.ts +18 -0
  19. package/dist/index.js +18 -0
  20. package/dist/interfaces/cancel-reason.interface.d.ts +1 -1
  21. package/dist/interfaces/cme-realtime.interface.d.ts +16 -9
  22. package/dist/interfaces/cme-realtime.interface.js +6 -3
  23. package/dist/interfaces/kscript-diagnostics.interface.d.ts +12 -0
  24. package/dist/interfaces/opra-realtime.interface.d.ts +1 -5
  25. package/dist/interfaces/prediction-market.interface.d.ts +7 -0
  26. package/dist/interfaces/replay.interface.d.ts +8 -0
  27. package/dist/interfaces/stocks-realtime.interface.d.ts +57 -0
  28. package/dist/interfaces/stocks-realtime.interface.js +32 -0
  29. package/dist/interfaces/wrun-runtime.interface.d.ts +18 -2
  30. package/dist/kscript-data/controls/live-trades-merge.util.d.ts +62 -94
  31. package/dist/kscript-data/controls/live-trades-merge.util.js +106 -171
  32. package/dist/market-data/billing.interface.d.ts +174 -36
  33. package/dist/market-data/billing.interface.js +58 -8
  34. package/dist/market-data/venue.d.ts +152 -7
  35. package/dist/market-data/venues/cme.contract.copy.json +66 -0
  36. package/dist/market-data/venues/cme.d.ts +126 -0
  37. package/dist/market-data/venues/cme.js +133 -0
  38. package/dist/market-data/venues/index.d.ts +294 -7
  39. package/dist/market-data/venues/index.js +49 -6
  40. package/dist/market-data/venues/opra.contract.copy.json +3 -2
  41. package/dist/market-data/venues/opra.d.ts +2 -2
  42. package/dist/market-data/venues/opra.js +5 -2
  43. package/dist/market-data/venues/stocks.contract.copy.json +64 -0
  44. package/dist/market-data/venues/stocks.d.ts +130 -0
  45. package/dist/market-data/venues/stocks.js +117 -0
  46. package/dist/settings-templates/footprint-rows.js +35 -2
  47. package/dist/settings-templates/form-rows.d.ts +2 -1
  48. package/dist/settings-templates/index.js +7 -3
  49. package/dist/settings-templates/indicator-fields.d.ts +5 -4
  50. package/dist/settings-templates/indicator-fields.js +79 -10
  51. package/dist/settings-templates/tool-rules.d.ts +32 -15
  52. package/dist/settings-templates/tool-rules.js +33 -11
  53. package/dist/settings-templates/tool-tables.generated.js +95 -31
  54. package/dist/utility/chart/book-live-bucket.util.d.ts +15 -0
  55. package/dist/utility/chart/book-live-bucket.util.js +47 -0
  56. package/dist/utility/chart/cme-cache-context.util.d.ts +5 -3
  57. package/dist/utility/chart/cme-cache-context.util.js +10 -6
  58. package/dist/utility/chart/cme-realtime.util.js +10 -0
  59. package/dist/utility/chart/cme-user-scripts-gate.util.d.ts +83 -0
  60. package/dist/utility/chart/cme-user-scripts-gate.util.js +142 -0
  61. package/dist/utility/chart/effective-chart-session.util.d.ts +14 -0
  62. package/dist/utility/chart/effective-chart-session.util.js +39 -0
  63. package/dist/utility/chart/host-bar-placement.util.d.ts +28 -0
  64. package/dist/utility/chart/host-bar-placement.util.js +170 -30
  65. package/dist/utility/chart/index-host-tier.util.d.ts +3 -1
  66. package/dist/utility/chart/index-host-tier.util.js +7 -2
  67. package/dist/utility/chart/index-mode-admission.util.js +30 -3
  68. package/dist/utility/chart/kscript-apply-fingerprint.util.js +1 -1
  69. package/dist/utility/chart/kscript-drawing-safe-area.util.d.ts +35 -11
  70. package/dist/utility/chart/kscript-drawing-safe-area.util.js +145 -35
  71. package/dist/utility/chart/kscript-live-coalesce.util.d.ts +9 -7
  72. package/dist/utility/chart/kscript-live-coalesce.util.js +13 -8
  73. package/dist/utility/chart/kscript-live-source-identity.util.d.ts +9 -0
  74. package/dist/utility/chart/kscript-live-source-identity.util.js +10 -1
  75. package/dist/utility/chart/kscript-provenance-keys.util.js +13 -0
  76. package/dist/utility/chart/kscript-standin-identity.leaf.d.ts +5 -1
  77. package/dist/utility/chart/kscript-titancharts-render-keys.constants.d.ts +32 -2
  78. package/dist/utility/chart/kscript-titancharts-render-keys.constants.js +45 -0
  79. package/dist/utility/chart/kscript-venue-policy.util.d.ts +156 -43
  80. package/dist/utility/chart/kscript-venue-policy.util.js +249 -59
  81. package/dist/utility/chart/live-bucket.util.d.ts +24 -8
  82. package/dist/utility/chart/live-bucket.util.js +85 -27
  83. package/dist/utility/chart/market-session-schedule.util.d.ts +10 -0
  84. package/dist/utility/chart/market-session-schedule.util.js +16 -0
  85. package/dist/utility/chart/marketKind.util.js +5 -0
  86. package/dist/utility/chart/mixed-mode.util.d.ts +7 -0
  87. package/dist/utility/chart/mixed-mode.util.js +14 -0
  88. package/dist/utility/chart/opra-read-access.leaf.d.ts +5 -3
  89. package/dist/utility/chart/opra-read-access.leaf.js +5 -3
  90. package/dist/utility/chart/opra-user-scripts-gate.util.d.ts +11 -16
  91. package/dist/utility/chart/opra-user-scripts-gate.util.js +12 -28
  92. package/dist/utility/chart/rth-session.util.d.ts +12 -10
  93. package/dist/utility/chart/rth-session.util.js +25 -21
  94. package/dist/utility/chart/trading-day.util.d.ts +17 -0
  95. package/dist/utility/chart/trading-day.util.js +59 -0
  96. package/dist/utility/chart/window-geometry.leaf.d.ts +8 -0
  97. package/dist/utility/chart/window-geometry.leaf.js +22 -6
  98. package/dist/utility/chart/window-owner.leaf.d.ts +23 -2
  99. package/dist/utility/chart/window-owner.leaf.js +45 -3
  100. package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +33 -15
  101. package/dist/utility/chart/wrun-bar-session-facts.util.js +70 -20
  102. package/dist/utility/chart/wrun-run-result.util.d.ts +12 -0
  103. package/dist/utility/chart/wrun-run-result.util.js +141 -6
  104. package/dist/utility/intl-locale.util.js +5 -0
  105. package/dist/utility/options/option-bar-anchor.util.d.ts +145 -0
  106. package/dist/utility/options/option-bar-anchor.util.js +340 -0
  107. package/dist/utility/options/option-venue.util.d.ts +18 -0
  108. package/dist/utility/options/option-venue.util.js +27 -0
  109. package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.js +4 -0
  110. package/dist/utility/v2/gate-plane.util.d.ts +12 -3
  111. package/dist/utility/v2/gate-plane.util.js +30 -4
  112. package/dist/utility/v2/gate-session-latch.util.js +1 -1
  113. package/dist/utility/v2/stocks-governed.util.d.ts +16 -0
  114. package/dist/utility/v2/stocks-governed.util.js +34 -0
  115. package/dist/utility/wrun/derived-roots.leaf.d.ts +13 -0
  116. package/dist/utility/wrun/derived-roots.leaf.js +27 -0
  117. package/dist/utility/wrun/derived-roots.util.d.ts +205 -0
  118. package/dist/utility/wrun/derived-roots.util.js +451 -0
  119. package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.d.ts +43 -7
  120. package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.js +89 -19
  121. package/dist/utility/wrun/run-schedule/wrun-gate-reader-warm.util.d.ts +9 -4
  122. package/dist/utility/wrun/run-schedule/wrun-gate-reader-warm.util.js +47 -6
  123. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.d.ts +4 -2
  124. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +4 -2
  125. package/dist/utility/wrun/run-schedule/wrun-own-candles.util.d.ts +24 -3
  126. package/dist/utility/wrun/run-schedule/wrun-own-candles.util.js +46 -10
  127. package/dist/utility/wrun/sources/lanes/option_daily.js +5 -2
  128. package/dist/utility/wrun/sources/lanes/options_flow.js +5 -2
  129. package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +64 -19
  130. package/dist/utility/wrun/sources/opra-option-lanes.util.js +105 -35
  131. package/dist/utility/wrun/sources/row-lanes/option_contract_flow.js +2 -1
  132. package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +2 -1
  133. package/dist/utility/wrun/sources/row-lanes/option_prints.d.ts +3 -0
  134. package/dist/utility/wrun/sources/row-lanes/option_prints.js +19 -4
  135. package/dist/utility/wrun/sources/row-lanes/option_strike_flow.js +17 -4
  136. package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +52 -13
  137. package/dist/utility/wrun/sources/row-lanes/option_strikes.js +88 -19
  138. package/dist/utility/wrun/sources/row-lanes/option_surface.js +2 -1
  139. package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +19 -0
  140. package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +24 -9
  141. package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +41 -10
  142. package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.d.ts +111 -0
  143. package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.js +133 -0
  144. package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.d.ts +15 -3
  145. package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.js +22 -3
  146. package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +31 -0
  147. package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +197 -13
  148. package/dist/utility/wrun/sources/wrun-row-lanes.util.js +761 -27
  149. package/dist/utility/wrun/wrun-browser-sources.leaf.js +1 -2
  150. package/dist/utility/wrun/wrun-builtin-twin.util.d.ts +12 -0
  151. package/dist/utility/wrun/wrun-builtin-twin.util.js +21 -0
  152. package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +60 -16
  153. package/dist/utility/wrun/wrun-chart-market-facts.util.js +113 -61
  154. package/dist/utility/wrun/wrun-color-settings.util.d.ts +9 -0
  155. package/dist/utility/wrun/wrun-color-settings.util.js +33 -0
  156. package/dist/utility/wrun/wrun-download-meter.util.d.ts +15 -0
  157. package/dist/utility/wrun/wrun-download-meter.util.js +14 -2
  158. package/dist/utility/wrun/wrun-download-plan.util.d.ts +99 -0
  159. package/dist/utility/wrun/wrun-download-plan.util.js +118 -0
  160. package/dist/utility/wrun/wrun-draft-legend-note.util.d.ts +11 -3
  161. package/dist/utility/wrun/wrun-draft-legend-note.util.js +26 -4
  162. package/dist/utility/wrun/wrun-frames.d.ts +27 -6
  163. package/dist/utility/wrun/wrun-frames.js +73 -10
  164. package/dist/utility/wrun/wrun-handles.util.d.ts +7 -3
  165. package/dist/utility/wrun/wrun-handles.util.js +9 -8
  166. package/dist/utility/wrun/wrun-hosted-wire.util.d.ts +7 -1
  167. package/dist/utility/wrun/wrun-hosted-wire.util.js +12 -2
  168. package/dist/utility/wrun/wrun-hud-looks.util.d.ts +18 -4
  169. package/dist/utility/wrun/wrun-hud-looks.util.js +45 -13
  170. package/dist/utility/wrun/wrun-input-requirements.leaf.d.ts +68 -0
  171. package/dist/utility/wrun/wrun-input-requirements.leaf.js +163 -7
  172. package/dist/utility/wrun/wrun-latest-snapshot.d.ts +11 -0
  173. package/dist/utility/wrun/wrun-leg-close.util.d.ts +59 -23
  174. package/dist/utility/wrun/wrun-leg-close.util.js +186 -28
  175. package/dist/utility/wrun/wrun-live-intake.util.d.ts +35 -15
  176. package/dist/utility/wrun/wrun-live-intake.util.js +243 -126
  177. package/dist/utility/wrun/wrun-live-tick.util.d.ts +13 -5
  178. package/dist/utility/wrun/wrun-live-tick.util.js +279 -99
  179. package/dist/utility/wrun/wrun-market-facts.util.d.ts +13 -3
  180. package/dist/utility/wrun/wrun-market-facts.util.js +13 -3
  181. package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +60 -11
  182. package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +70 -5
  183. package/dist/utility/wrun/wrun-market-size-defaults.util.js +31 -5
  184. package/dist/utility/wrun/wrun-opra-lane.util.d.ts +17 -4
  185. package/dist/utility/wrun/wrun-opra-lane.util.js +6 -4
  186. package/dist/utility/wrun/wrun-option-book-rows.util.d.ts +56 -0
  187. package/dist/utility/wrun/wrun-option-book-rows.util.js +96 -0
  188. package/dist/utility/wrun/wrun-option-strike-flow-forecast.util.d.ts +31 -0
  189. package/dist/utility/wrun/wrun-option-strike-flow-forecast.util.js +119 -0
  190. package/dist/utility/wrun/wrun-option-strike-flow-lane.util.d.ts +23 -6
  191. package/dist/utility/wrun/wrun-option-strike-flow-lane.util.js +47 -11
  192. package/dist/utility/wrun/wrun-option-strike-flow.util.d.ts +86 -19
  193. package/dist/utility/wrun/wrun-option-strike-flow.util.js +168 -62
  194. package/dist/utility/wrun/wrun-option-views.util.d.ts +323 -28
  195. package/dist/utility/wrun/wrun-option-views.util.js +484 -71
  196. package/dist/utility/wrun/wrun-options-chain.util.d.ts +3 -3
  197. package/dist/utility/wrun/wrun-options-chain.util.js +2 -0
  198. package/dist/utility/wrun/wrun-output-style.util.d.ts +6 -2
  199. package/dist/utility/wrun/wrun-output-style.util.js +20 -2
  200. package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +32 -2
  201. package/dist/utility/wrun/wrun-overlay-drivers.util.js +13 -3
  202. package/dist/utility/wrun/wrun-overlay-lifecycle.util.d.ts +10 -1
  203. package/dist/utility/wrun/wrun-overlay-lifecycle.util.js +52 -4
  204. package/dist/utility/wrun/wrun-overlay-recovery.util.js +3 -1
  205. package/dist/utility/wrun/wrun-overlay-run.util.d.ts +160 -42
  206. package/dist/utility/wrun/wrun-overlay-run.util.js +1244 -209
  207. package/dist/utility/wrun/wrun-pane-format.util.d.ts +2 -1
  208. package/dist/utility/wrun/wrun-pane-format.util.js +7 -3
  209. package/dist/utility/wrun/wrun-panel-mount.util.d.ts +9 -0
  210. package/dist/utility/wrun/wrun-panel-mount.util.js +114 -19
  211. package/dist/utility/wrun/wrun-panel-style.util.d.ts +10 -9
  212. package/dist/utility/wrun/wrun-panel-style.util.js +58 -9
  213. package/dist/utility/wrun/wrun-param-map.util.d.ts +14 -11
  214. package/dist/utility/wrun/wrun-param-map.util.js +10 -5
  215. package/dist/utility/wrun/wrun-param-values.util.d.ts +14 -4
  216. package/dist/utility/wrun/wrun-param-values.util.js +4 -0
  217. package/dist/utility/wrun/wrun-pin-spelling.util.d.ts +15 -2
  218. package/dist/utility/wrun/wrun-pin-spelling.util.js +39 -14
  219. package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +50 -0
  220. package/dist/utility/wrun/wrun-refusal-surface.util.js +68 -0
  221. package/dist/utility/wrun/wrun-refusal.util.d.ts +3 -2
  222. package/dist/utility/wrun/wrun-refusal.util.js +22 -0
  223. package/dist/utility/wrun/wrun-refused-latest.util.d.ts +10 -0
  224. package/dist/utility/wrun/wrun-refused-latest.util.js +12 -0
  225. package/dist/utility/wrun/wrun-registry-errors.util.d.ts +26 -0
  226. package/dist/utility/wrun/wrun-registry-errors.util.js +34 -0
  227. package/dist/utility/wrun/wrun-replay-lane.util.js +3 -2
  228. package/dist/utility/wrun/wrun-row-source.d.ts +11 -0
  229. package/dist/utility/wrun/wrun-run-interval-session.util.d.ts +20 -6
  230. package/dist/utility/wrun/wrun-run-interval-session.util.js +22 -7
  231. package/dist/utility/wrun/wrun-run-interval.util.d.ts +43 -9
  232. package/dist/utility/wrun/wrun-run-interval.util.js +58 -15
  233. package/dist/utility/wrun/wrun-script-inputs.util.d.ts +45 -1
  234. package/dist/utility/wrun/wrun-script-inputs.util.js +112 -4
  235. package/dist/utility/wrun/wrun-setting-words.util.d.ts +7 -3
  236. package/dist/utility/wrun/wrun-setting-words.util.js +13 -5
  237. package/dist/utility/wrun/wrun-socket-row-source.d.ts +27 -2
  238. package/dist/utility/wrun/wrun-socket-row-source.js +118 -8
  239. package/dist/utility/wrun/wrun-source-rows.util.d.ts +29 -18
  240. package/dist/utility/wrun/wrun-source-rows.util.js +61 -27
  241. package/dist/utility/wrun/wrun-style-words.util.js +6 -4
  242. package/dist/utility/wrun/wrun-table-chrome.util.d.ts +3 -2
  243. package/dist/utility/wrun/wrun-table-chrome.util.js +19 -11
  244. package/dist/utility/wrun/wrun-tape-per-order.util.d.ts +2 -0
  245. package/dist/utility/wrun/wrun-tape-per-order.util.js +7 -0
  246. package/dist/utility/wrun/wrun-tape-source.util.d.ts +17 -9
  247. package/dist/utility/wrun/wrun-tape-source.util.js +20 -12
  248. package/dist/utils/replay/replay-buffer-math.d.ts +53 -2
  249. package/dist/utils/replay/replay-buffer-math.js +227 -20
  250. package/dist/workers/constants/socket-slots.d.ts +91 -6
  251. package/dist/workers/constants/socket-slots.js +85 -6
  252. package/package.json +5 -5
@@ -132,7 +132,8 @@ export declare function hasWrunValueFormatOptions(options: WrunValueFormatOption
132
132
  /** One value through one declared format word: `price` at the chart's price
133
133
  * precision (`priceDigits`, the default decimals when the caller has no
134
134
  * chart), `%` as a percent with two decimals (the value already IS a
135
- * percent), `si` as K/M/B from 1K (the lower-pane axis rule), `int` and
135
+ * percent), `si` as K/M/B from 1K (the lower-pane axis rule) and below it
136
+ * at most two decimals, trailing zeros dropped ("4", "4.5"), `int` and
136
137
  * the fixed-point words at their decimals. No word: the app's own
137
138
  * partial formatter (two decimals, K/M/B from 1M). A hole reads '-'.
138
139
  * `usd`, `auto` and any word beside a companion (`decimals`, `signed`,
@@ -172,7 +172,8 @@ export function hasWrunValueFormatOptions(options) {
172
172
  /** One value through one declared format word: `price` at the chart's price
173
173
  * precision (`priceDigits`, the default decimals when the caller has no
174
174
  * chart), `%` as a percent with two decimals (the value already IS a
175
- * percent), `si` as K/M/B from 1K (the lower-pane axis rule), `int` and
175
+ * percent), `si` as K/M/B from 1K (the lower-pane axis rule) and below it
176
+ * at most two decimals, trailing zeros dropped ("4", "4.5"), `int` and
176
177
  * the fixed-point words at their decimals. No word: the app's own
177
178
  * partial formatter (two decimals, K/M/B from 1M). A hole reads '-'.
178
179
  * `usd`, `auto` and any word beside a companion (`decimals`, `signed`,
@@ -202,8 +203,11 @@ function wrunValueText(value, format, placement, options) {
202
203
  }
203
204
  case '%':
204
205
  return `${value.toFixed(2)}%`;
205
- case 'si':
206
- return formatWrunPaneNumber(value, WRUN_DEFAULT_VALUE_DIGITS);
206
+ case 'si': {
207
+ // The trim is si's own: the pane axis prints through formatWrunPaneNumber at its step digits.
208
+ const text = formatWrunPaneNumber(value, WRUN_DEFAULT_VALUE_DIGITS);
209
+ return Math.abs(value) < WRUN_PANE_COMPACT_FROM ? text.replace(/\.?0+$/, '') : text;
210
+ }
207
211
  default: {
208
212
  const digits = format === undefined ? undefined : WRUN_FIXED_DIGITS[format];
209
213
  if (digits !== undefined)
@@ -1,5 +1,6 @@
1
1
  import { type KScriptLegendEntry } from '../chart/kscript-legend-entries.util.js';
2
2
  import { type EnginePanelHooks } from '../chart/om-panel.util.js';
3
+ import { WRUN_WINDOW_TABLES_ONLY_SETTING } from '../chart/window-geometry.leaf.js';
3
4
  import { wrunSeriesChildId, type WrunRunResult } from '../chart/wrun-run-result.util.js';
4
5
  import { type WrunBuiltinTwin, type WrunPaneFormatChart } from './wrun-pane-format.util.js';
5
6
  import type { WrunRunIntervalProjection } from './wrun-run-interval-projection.types.js';
@@ -283,6 +284,14 @@ export declare function prepareWrunHeatmapWindowLanding(input: {
283
284
  }): Promise<PreparedWrunWindowLanding>;
284
285
  /** The window landing of any row-backed canvas child (a heatmap or a batched child), the generalized name. */
285
286
  export declare const prepareWrunChildWindowLanding: typeof prepareWrunHeatmapWindowLanding;
287
+ /**
288
+ * The owner setting of a window that shows its tables ALONE (window-geometry.leaf defines it; web's window-cell.util
289
+ * writes the same key: the window an add opens beside its chart Indicator, which keeps every other child under the
290
+ * candles of its own cell). Its mount mounts the `panel.table` children and no other child (mountsOnCell), so the
291
+ * window never shows a lower pane, another panel or a canvas the chart cell beside it already shows. Read off the
292
+ * parent's engine settings, like the owner flag; it means nothing on a cell that is no window.
293
+ */
294
+ export { WRUN_WINDOW_TABLES_ONLY_SETTING };
286
295
  /** Mount a run snapshot after every required pack has settled.
287
296
  * The parent remains the canonical numeric-output container. A panel child
288
297
  * the run still declares in the same pane takes the new rows in place; one
@@ -9,7 +9,10 @@
9
9
  * palette (`wrunColorThemeOf`), so a theme switch or a display-timezone
10
10
  * change re-resolves every mounted child without a rerun
11
11
  * (`retranslateWrunChildOverlays`, X13). Each mounted child keeps its last
12
- * unresolved input beside its engine config for exactly that.
12
+ * unresolved input beside its engine config for exactly that. A blank (a
13
+ * session flip's, a served-tier discard's) empties the engine's rows only:
14
+ * every seam that reads the records reads it there first and the record keeps
15
+ * no rows until a pass replaces it (settleBlankedChildRecords).
13
16
  *
14
17
  * Panels (g1): the frame translates through om-panel.util with the context
15
18
  * this file builds (theme, the chart's price digits, the display timezone);
@@ -49,7 +52,7 @@ import { isDateLabelledBarInterval } from '../chart/date-labelled-interval.leaf.
49
52
  import { KSCRIPT_LEGEND_VALUE_INK, kScriptLegendEntries, kScriptLegendLineFormat, kScriptLegendLineFormatOptions, kScriptLegendLines, kScriptLegendLineSwatchAt, kScriptLegendLineValueAt, kScriptLegendSlotCells, padKScriptLegendSlots, } from '../chart/kscript-legend-entries.util.js';
50
53
  import { panelGridHeight, refreshPanelOverlayInPlace, samePanelPane, translatePanelToEngine, withoutEmptyTableColumns, } from '../chart/om-panel.util.js';
51
54
  import { isWrunWindowOwner } from '../chart/window-owner.leaf.js';
52
- import { ownerPaneDrawsNothing, planWindowWeights, reconcileWindowOwnerGeometry, savedWindowSplit, tableRowCountOf, } from '../chart/window-geometry.leaf.js';
55
+ import { ownerPaneDrawsNothing, planWindowWeights, reconcileWindowOwnerGeometry, savedWindowSplit, tableRowCountOf, WRUN_WINDOW_TABLES_ONLY_SETTING, } from '../chart/window-geometry.leaf.js';
53
56
  import { wrunLegendName } from '../chart/wrun-legend-name.util.js';
54
57
  import { wrunResultLegendColors, wrunSeriesChildId, } from '../chart/wrun-run-result.util.js';
55
58
  import { budgetWrunBatchedRetained, budgetWrunBatchedRows, commitWrunBatchedPlan, currentWrunBatchedPlan, forgetWrunBatchedCells, isWrunBatchedMarksKind, noteWrunBatchedRowsCut, planWrunBatchedMerged, restoreWrunBatchedLedger, snapshotWrunBatchedLedger, wrunBatchedChargeOf, wrunBatchedChildConfig, wrunBatchedChildrenOverShare, wrunBatchedSiblingsToRebalance, } from './wrun-batched-marks.util.js';
@@ -131,6 +134,38 @@ const ROW_BACKED_KINDS = new Set([
131
134
  function overlayPresent(tc, id) {
132
135
  return tc.metadata.some((meta) => meta.id === id);
133
136
  }
137
+ /**
138
+ * Every blank lands on the engine, never on these records: the domain-switch blank (a session flip, a symbol or an
139
+ * interval switch, a served-tier discard) and the refetch's wipe empty a child's engine rows by its id. A record that
140
+ * still held the run's rows put them back: a retranslate (a theme or a timezone switch) re-added the other session's
141
+ * rows on a paused Indicator, a windowed run merged into them and kept the ones outside its window, and a frame
142
+ * refresh read the next run's equal rows as unchanged and left the child blank. So every seam that re-adds, merges
143
+ * into or compares with a record's rows (a pass, a retranslate, a rescale, a prefix run's window landing) settles the
144
+ * records first: a child whose engine rows are empty while its record holds rows was blanked, and its record holds
145
+ * none (`blankedRecord`) until a pass replaces it. A replay cut only trims a record and keeps its ledger note.
146
+ */
147
+ function settleBlankedChildRecords(tc, state) {
148
+ for (const [id, record] of state.children) {
149
+ if (record.blanked === true || record.config.tailOnly === true || record.config.data.length === 0)
150
+ continue;
151
+ const meta = tc.metadata.find((candidate) => candidate.id === id);
152
+ const engineRows = meta?.rawData ?? meta?.data;
153
+ if (Array.isArray(engineRows) && engineRows.length === 0)
154
+ state.children.set(id, blankedRecord(record));
155
+ }
156
+ }
157
+ /** A blanked record: its unresolved input kept (the colours and words a retranslate re-resolves), its config a fresh
158
+ * one without rows, so the next pass's rows always reach the engine (no rows never read as unchanged rows,
159
+ * sameFrameSignature). */
160
+ function blankedRecord(record) {
161
+ return { input: record.input, config: { ...record.config, data: [] }, blanked: true };
162
+ }
163
+ /** A record rebuilt from its unresolved input (a retranslate, a restore after a failed pass): a blanked one rebuilds
164
+ * without rows and stays blanked. */
165
+ function rebuiltRecord(record, ctx) {
166
+ const rebuilt = { input: record.input, config: childConfig(record.input, ctx) };
167
+ return record.blanked === true ? blankedRecord(rebuilt) : rebuilt;
168
+ }
134
169
  /** The price canvases (g6: heatmap, profile and matrix children) and the
135
170
  * batched marks drawn over the price pane like them (marks, spans, rays):
136
171
  * no price marker, a readout registered when the config is built. */
@@ -299,7 +334,10 @@ function userThemeMode() {
299
334
  * window of the layout shows it (the children filter, mountsOnCell), so it
300
335
  * never sits under the candles while its window shows it and never mounts
301
336
  * nowhere; its all-empty columns leave before the translation builds the
302
- * payload and the formatter (withoutEmptyTableColumns, C4). */
337
+ * payload and the formatter (withoutEmptyTableColumns, C4). A pane whose
338
+ * frame carries no rows says why in its caption: the owner's headline (the
339
+ * card headline the run selected, ctx.headline) stands in for the frame's
340
+ * caption, so an empty pane is never a blank box under a title. */
303
341
  function panelChildConfig(child, ctx) {
304
342
  const translateContext = {
305
343
  theme: ctx.theme,
@@ -309,7 +347,8 @@ function panelChildConfig(child, ctx) {
309
347
  const frame = withoutEmptyTableColumns(child.frame);
310
348
  const translated = translatePanelToEngine(frame, translateContext);
311
349
  const { panel, rows, chrome } = frame;
312
- const caption = chrome?.caption;
350
+ // An empty frame's words: the owner's headline (why there is nothing yet), else the frame's own caption.
351
+ const caption = (rows.length === 0 ? ctx.headline : undefined) ?? chrome?.caption;
313
352
  const id = `${ctx.overlayId}::panel:${child.name}`;
314
353
  // A table owns no value axis and a rich line (every chrome but box: the
315
354
  // numeric curve, or grid / none on a time, category or stacked line) draws
@@ -765,7 +804,10 @@ function windowPanesOfMount(parent, overlayId, children, kept) {
765
804
  panes.push({ id: config.id, kind: 'chart' });
766
805
  }
767
806
  const ownerPane = parent.type === 'offchart' && parent.isPaneHidden !== true;
768
- if (ownerPane && (panes.length === 0 || !ownerPaneDrawsNothing(parent))) {
807
+ // A window that shows its tables alone leaves the owner's own pane to the chart beside it (the geometry hides it
808
+ // there too, window-geometry.leaf settleOwnerPane), unless it would be the window's only pane.
809
+ const tablesOnly = parent.settings?.[WRUN_WINDOW_TABLES_ONLY_SETTING] === true;
810
+ if (ownerPane && (panes.length === 0 || (!tablesOnly && !ownerPaneDrawsNothing(parent)))) {
769
811
  panes.unshift({ id: overlayId, kind: 'time' });
770
812
  }
771
813
  return panes;
@@ -1303,6 +1345,9 @@ function windowLandingTarget(tc, overlayId, childId) {
1303
1345
  if (tc.metadata.find((meta) => meta.id === overlayId) !== state.parent) {
1304
1346
  throw new WrunStaleLandingError(childId, 'parent');
1305
1347
  }
1348
+ // A child a blank emptied holds no rows to merge the window into: the landing refuses (`child`), so the page goes
1349
+ // to a full run.
1350
+ settleBlankedChildRecords(tc, state);
1306
1351
  const record = state.children.get(childId);
1307
1352
  if (!isWindowRecord(record) || record.config.data.length === 0 || !overlayPresent(tc, childId)) {
1308
1353
  throw new WrunStaleLandingError(childId, 'child');
@@ -1612,17 +1657,52 @@ function ownerTimePaneId(parent, overlayId, children) {
1612
1657
  /**
1613
1658
  * Whether a run's child mounts on this cell. The class it closes: a table that mounts nowhere, or under the candles
1614
1659
  * while its window shows it (Kyle 2026-10-21: a table never sits under the candles WHILE its window shows it, which
1615
- * never lets a table vanish). A window cell mounts every child. A normal cell mounts every child but the `panel.table`
1616
- * children (any `place`) of an Indicator whose tables a window cell of the layout shows: the host shows windows (the
1617
- * env's `windows`, C1) and its `tablesShownInWindow` answers true for this chart and Indicator (R1;
1660
+ * never lets a table vanish). A window cell mounts every child, except a window that shows its tables alone
1661
+ * (`tablesOnly`, WRUN_WINDOW_TABLES_ONLY_SETTING: the window an add opened beside its chart Indicator), which mounts
1662
+ * the `panel.table` children and nothing else: every other child is on the chart cell beside it, and a second copy
1663
+ * showed the same pane twice (QA 2026-10-22, Volatility Character). A normal cell mounts every child but the
1664
+ * `panel.table` children (any `place`) of an Indicator whose tables a window cell of the layout shows: the host shows
1665
+ * windows (the env's `windows`, C1) and its `tablesShownInWindow` answers true for this chart and Indicator (R1;
1618
1666
  * `leavesTablesToWindow`, asked here only, and only for a table). An Indicator with no window, or one that cannot get
1619
1667
  * one (replay, a full layout, a slot budget that refuses the window copy, an editor draft, a layout saved before
1620
1668
  * windows), keeps its tables on the cell, as does every Indicator on a host without windows (the phone). A table an
1621
1669
  * earlier pass mounted that the rule now leaves out goes with the children a run no longer declares; one it left out
1622
1670
  * mounts again on the next run that carries frames once no window shows it.
1623
1671
  */
1624
- function mountsOnCell(child, windowCell, leavesTablesToWindow) {
1625
- return windowCell || child.kind !== 'panel' || child.frame.panel.kind !== 'table' || !leavesTablesToWindow();
1672
+ function mountsOnCell(child, windowCell, tablesOnly, leavesTablesToWindow) {
1673
+ const table = child.kind === 'panel' && child.frame.panel.kind === 'table';
1674
+ if (windowCell)
1675
+ return !tablesOnly || table;
1676
+ return !table || !leavesTablesToWindow();
1677
+ }
1678
+ /**
1679
+ * The owner setting of a window that shows its tables ALONE (window-geometry.leaf defines it; web's window-cell.util
1680
+ * writes the same key: the window an add opens beside its chart Indicator, which keeps every other child under the
1681
+ * candles of its own cell). Its mount mounts the `panel.table` children and no other child (mountsOnCell), so the
1682
+ * window never shows a lower pane, another panel or a canvas the chart cell beside it already shows. Read off the
1683
+ * parent's engine settings, like the owner flag; it means nothing on a cell that is no window.
1684
+ */
1685
+ export { WRUN_WINDOW_TABLES_ONLY_SETTING };
1686
+ /**
1687
+ * The owner's headline, the words an empty panel pane shows as its caption (panelChildConfig), so the pane says why
1688
+ * it is empty: the run's HUD headline first (WrunRunResult.headline, the card tile declared `headline: true` read on
1689
+ * the run's last ready row: Volatility Character's character word), else the text the run selected for a card
1690
+ * drawing's headline band (DW01: a declared output's formatted value or a string slot the recipe writes), the first
1691
+ * card that has one, trimmed. The HUD headline rides the result because the latest-values snapshot that feeds the
1692
+ * card is published after this mount. Undefined when the run carries neither.
1693
+ */
1694
+ function ownerHeadlineOf(runResult) {
1695
+ const hud = runResult.headline?.trim();
1696
+ if (hud)
1697
+ return hud;
1698
+ for (const drawing of runResult.drawings ?? []) {
1699
+ if (drawing?.kind !== 'card')
1700
+ continue;
1701
+ const text = drawing.props?.headline?.text;
1702
+ if (typeof text === 'string' && text.trim() !== '')
1703
+ return text.trim();
1704
+ }
1705
+ return undefined;
1626
1706
  }
1627
1707
  /** The run's children in mount order (C6): the panels first, then today's
1628
1708
  * order (series, levels, canvases, insets), each group as the run listed
@@ -1643,7 +1723,7 @@ function heatmapSensitivityOf(previews, parent, name) {
1643
1723
  * pane from the run's (or the mounted) children; each heatmap's Sensitivity
1644
1724
  * (a held drag value, else the parent's saved row) read when its config is
1645
1725
  * built; the Indicator's kept label formatters. */
1646
- function mountContext(tc, overlayId, parent, children, priceDigits, chartHeightPx, windowCell, planned, previews, formatters) {
1726
+ function mountContext(tc, overlayId, parent, children, priceDigits, chartHeightPx, windowCell, planned, previews, formatters, headline) {
1647
1727
  return {
1648
1728
  tc,
1649
1729
  overlayId,
@@ -1660,6 +1740,7 @@ function mountContext(tc, overlayId, parent, children, priceDigits, chartHeightP
1660
1740
  anchorPaneId: ownerTimePaneId(parent, overlayId, children),
1661
1741
  heatmapSensitivity: (name) => heatmapSensitivityOf(previews(), parent, name),
1662
1742
  formatters,
1743
+ headline,
1663
1744
  };
1664
1745
  }
1665
1746
  /** Mount a run snapshot after every required pack has settled.
@@ -1708,9 +1789,12 @@ export function mountWrunChildOverlays({ tc, overlayId, runResult, replaceFrames
1708
1789
  // a child the run dropped; one left out before mounts again on the first
1709
1790
  // pass that carries frames and finds no window showing it.
1710
1791
  const windowCell = cell?.window ?? isWrunWindowOwner(parent);
1792
+ // A window an add opened beside its chart Indicator shows the tables alone (the chart cell keeps the rest).
1793
+ const tablesOnly = windowCell && parent.settings?.[WRUN_WINDOW_TABLES_ONLY_SETTING] === true;
1711
1794
  let leavesTables;
1712
1795
  const leavesTablesToWindow = () => (leavesTables ??= wrunHostLeavesTablesToWindow(chartIndex, overlayId));
1713
- const children = (runResult.childOverlays ?? []).filter((child) => (replaceFrames || ROW_BACKED_KINDS.has(child.kind)) && mountsOnCell(child, windowCell, leavesTablesToWindow));
1796
+ const children = (runResult.childOverlays ?? []).filter((child) => (replaceFrames || ROW_BACKED_KINDS.has(child.kind)) &&
1797
+ mountsOnCell(child, windowCell, tablesOnly, leavesTablesToWindow));
1714
1798
  if (!state && children.length === 0)
1715
1799
  return Promise.resolve(true);
1716
1800
  if (!replaceFrames &&
@@ -1764,7 +1848,11 @@ export function mountWrunChildOverlays({ tc, overlayId, runResult, replaceFrames
1764
1848
  }
1765
1849
  current.windowCell = windowCell;
1766
1850
  current.planned = planned;
1767
- const ctx = mountContext(tc, overlayId, parent, children, priceDigits, current.chartHeightPx, windowCell, planned, () => current.previews, current.formatters);
1851
+ // The words an empty panel pane shows: re-read on every pass that carries frames (a tick carries no drawings and
1852
+ // keeps the last run's).
1853
+ if (replaceFrames)
1854
+ current.headline = ownerHeadlineOf(runResult);
1855
+ const ctx = mountContext(tc, overlayId, parent, children, priceDigits, current.chartHeightPx, windowCell, planned, () => current.previews, current.formatters, current.headline);
1768
1856
  // Panels mount ahead of the Indicator's time panes (C6), so a first mount
1769
1857
  // stacks them above the lower pane by order alone; the anchor keeps a
1770
1858
  // later or re-carved panel there.
@@ -1855,7 +1943,9 @@ export function mountWrunChildOverlays({ tc, overlayId, runResult, replaceFrames
1855
1943
  // An unmount or newer run during an import must not resurrect children.
1856
1944
  // A series child the run still declares in the same pane is preserved
1857
1945
  // in place (its result is re-applied below, never re-added); one the run
1858
- // dropped goes with the frames.
1946
+ // dropped goes with the frames. A child a blank emptied since the last
1947
+ // pass keeps no rows to merge into or to compare with.
1948
+ settleBlankedChildRecords(tc, current);
1859
1949
  const previous = current.children;
1860
1950
  const nextById = new Map(applying.map((entry) => [entry.config.id, entry]));
1861
1951
  // Every frame config this run built is signed before any of it reaches the
@@ -2050,11 +2140,12 @@ export function mountWrunChildOverlays({ tc, overlayId, runResult, replaceFrames
2050
2140
  current.children = new Map([...current.children].filter(([id]) => preserved.has(id)));
2051
2141
  if (active()) {
2052
2142
  // The previous children come back through the door (their hover
2053
- // rows and readouts with them), resolved against the current theme.
2143
+ // rows and readouts with them), resolved against the current theme;
2144
+ // a blanked one comes back without rows.
2054
2145
  for (const [id, mounted] of previous) {
2055
2146
  if (preserved.has(id))
2056
2147
  continue;
2057
- const restored = { input: mounted.input, config: childConfig(mounted.input, ctx) };
2148
+ const restored = rebuiltRecord(mounted, ctx);
2058
2149
  current.children.set(id, restored);
2059
2150
  installChild(tc, restored, ctx.theme);
2060
2151
  }
@@ -2218,9 +2309,11 @@ export function retranslateWrunChildOverlays(tc) {
2218
2309
  const parent = tc.metadata.find((meta) => meta.id === overlayId);
2219
2310
  if (!parent || state.parent !== parent)
2220
2311
  continue;
2312
+ // A child a blank emptied comes back without rows: a paused Indicator's children stay blank until Resume.
2313
+ settleBlankedChildRecords(tc, state);
2221
2314
  const owner = {
2222
2315
  state,
2223
- ctx: mountContext(tc, overlayId, parent, [...state.children.values()].map((mounted) => mounted.input), state.priceDigits, state.chartHeightPx, state.windowCell ?? false, state.planned, () => state.previews, state.formatters),
2316
+ ctx: mountContext(tc, overlayId, parent, [...state.children.values()].map((mounted) => mounted.input), state.priceDigits, state.chartHeightPx, state.windowCell ?? false, state.planned, () => state.previews, state.formatters, state.headline),
2224
2317
  };
2225
2318
  for (const [id, mounted] of state.children) {
2226
2319
  if (mounted.input.kind !== 'series')
@@ -2236,7 +2329,7 @@ export function retranslateWrunChildOverlays(tc) {
2236
2329
  const mounted = owner?.state.children.get(id);
2237
2330
  if (owner === undefined || mounted === undefined)
2238
2331
  continue;
2239
- const next = { input: mounted.input, config: childConfig(mounted.input, owner.ctx) };
2332
+ const next = rebuiltRecord(mounted, owner.ctx);
2240
2333
  const heightHeld = (owner.state.windowCell ?? false) || owner.state.planned?.has(id) === true;
2241
2334
  if (refreshRetranslatedChild(tc, mounted, next, owner.ctx, heightHeld)) {
2242
2335
  refreshed.add(owner.state);
@@ -2299,6 +2392,8 @@ export function rescaleWrunHeatmapChildren(tc, overlayId, preview) {
2299
2392
  const parent = tc.metadata.find((meta) => meta.id === overlayId);
2300
2393
  if (!parent || state.parent !== parent)
2301
2394
  return false;
2395
+ // The record this keeps holds no rows a blank emptied since the last pass (settleBlankedChildRecords).
2396
+ settleBlankedChildRecords(tc, state);
2302
2397
  let moved = false;
2303
2398
  for (const [id, mounted] of state.children) {
2304
2399
  const input = mounted.input;
@@ -2321,7 +2416,7 @@ export function rescaleWrunHeatmapChildren(tc, overlayId, preview) {
2321
2416
  }
2322
2417
  }
2323
2418
  state.children.set(id, {
2324
- input,
2419
+ ...mounted,
2325
2420
  config: { ...mounted.config, settings: { ...mounted.config.settings, min, max } },
2326
2421
  });
2327
2422
  }
@@ -118,18 +118,19 @@ export declare function wrunPanelBadgeInk(fill: string): string;
118
118
  * each series once beside the title (titleLegendStyle). */
119
119
  export declare function wrunPanelCommonStyle(panel: WrunStyledPanel, ctx: WrunPanelTranslateContext): WrunPanelSettingsPatch;
120
120
  /** The line words (SC03 SC04 SC24 SC25 SC29 SC30 SC39): smoothing, the
121
- * signed two-tone fill, fill fade, stroke fade, markers, dots, end labels,
122
- * glow, motion, latest-value chips and the axis words on the pane; fill,
123
- * fill ink, style, width, dash, dots, end label and legend membership per
124
- * series. `y_title` is the rich curve's caption and a box line's axis title
125
- * (the effective chrome decides, SC02). */
121
+ * signed two-tone fill, fill fade, stroke fade, markers, the frame's row
122
+ * labels (C3), dots, end labels, glow, motion, latest-value chips and the
123
+ * axis words on the pane; fill, fill ink, style, width, dash, dots, end
124
+ * label and legend membership per series. `y_title` is the rich curve's
125
+ * caption and a box line's axis title (the effective chrome decides, SC02). */
126
126
  export declare function wrunLineStyle(panel: WrunStyledPanel, chrome: WrunPanelFrameChrome | undefined, rows: WrunStyledPanelRows, ctx: WrunPanelTranslateContext): WrunLineStylePatch;
127
127
  /** The bars words (SC19 SC23 SC24 SC39, C2): sign colouring (the tones
128
128
  * come from the common words), the axis words, the bar shape, the badge
129
- * chip and legend membership per series (`series[j].legend: false` keeps
130
- * that series out of the legend chips, a `series` patch merged per index);
131
- * per-bar colours are row data the caller maps. */
132
- export declare function wrunBarsStyle(panel: WrunStyledPanel, chrome: WrunPanelFrameChrome | undefined, _rows: WrunStyledPanelRows, ctx: WrunPanelTranslateContext): WrunPanelSettingsPatch;
129
+ * chip, the frame's row labels (C3, as `xLabels`) and legend membership
130
+ * per series (`series[j].legend: false` keeps that series out of the legend
131
+ * chips, a `series` patch merged per index); per-bar colours are row data
132
+ * the caller maps. */
133
+ export declare function wrunBarsStyle(panel: WrunStyledPanel, chrome: WrunPanelFrameChrome | undefined, rows: WrunStyledPanelRows, ctx: WrunPanelTranslateContext): WrunPanelSettingsPatch;
133
134
  /** The histogram words beyond its colour, labels and bins (the caller's,
134
135
  * SC38): the chrome, the axis words of its curve bars sub-plan (SC23 SC39),
135
136
  * the bar shape and the badge chip (C2). */
@@ -276,6 +276,52 @@ function keyOrdinals(rows) {
276
276
  }
277
277
  return ordinals;
278
278
  }
279
+ /** C3: the labels a numeric-x frame carries for its rows (`x_labels`, ""
280
+ * for a row without one); undefined off a numeric x, without the word, or
281
+ * when no entry holds a label, so such a frame sends no key. */
282
+ function frameXLabels(panel, chrome) {
283
+ const labels = panel.x === 'number' ? chrome?.x_labels : undefined;
284
+ return labels?.some((label) => label !== '') === true ? labels : undefined;
285
+ }
286
+ /** A numeric line's row labels as the curve's `xValueLabels` (C3): each
287
+ * labelled row's exact x as `String(x)` (the key the engine reads back as
288
+ * `x + ""`) to its label, in row order, the first labelled row of a repeated
289
+ * x winning. The curve titles its hover card and a marker's show_value text
290
+ * with it; its axis ticks fall between the rows and print through the x
291
+ * words only. */
292
+ function lineXValueLabels(panel, chrome, rows) {
293
+ const labels = frameXLabels(panel, chrome);
294
+ if (labels === undefined)
295
+ return undefined;
296
+ const byX = new Map();
297
+ rows.forEach((row, index) => {
298
+ const label = labels[index];
299
+ const key = String(row[0]);
300
+ if (label && !byX.has(key))
301
+ byX.set(key, label);
302
+ });
303
+ return byX.size > 0 ? Object.fromEntries(byX) : undefined;
304
+ }
305
+ /** A numeric bars pane's row labels (C3). The bars engine reads no
306
+ * `xValueLabels`: it ticks each bar and titles its hover card from `xLabels`
307
+ * (one per bar in row order; `hoverLabels` falls back to it), so a labelled
308
+ * row's label replaces its key there and every other bar keeps the text
309
+ * translatePanelToEngine gives a numeric key (the x words when `x_format`
310
+ * is declared, else `String(key)`; the spec pins the two against each
311
+ * other). */
312
+ function barsXLabels(panel, chrome, rows, ctx) {
313
+ const labels = frameXLabels(panel, chrome);
314
+ if (labels === undefined)
315
+ return undefined;
316
+ const format = panel.x_format !== undefined ? wrunPanelFormatter(panel, rows, ctx) : undefined;
317
+ return rows.map((row, index) => {
318
+ const label = labels[index];
319
+ if (label)
320
+ return label;
321
+ const key = row[0];
322
+ return format !== undefined ? format(key, 'x', -1) : String(key);
323
+ });
324
+ }
279
325
  /** The axis words shared by line, bars, histogram and scatter (SC39, SC20):
280
326
  * titles, pinned ranges (frame first) and the zero rule. `y_title` is the
281
327
  * rich curve's `yCaption` and every other pane's `yTitle`; `xLabel` (the
@@ -418,11 +464,11 @@ function lineMarkers(panel, chrome, rows, ctx) {
418
464
  return markers;
419
465
  }
420
466
  /** The line words (SC03 SC04 SC24 SC25 SC29 SC30 SC39): smoothing, the
421
- * signed two-tone fill, fill fade, stroke fade, markers, dots, end labels,
422
- * glow, motion, latest-value chips and the axis words on the pane; fill,
423
- * fill ink, style, width, dash, dots, end label and legend membership per
424
- * series. `y_title` is the rich curve's caption and a box line's axis title
425
- * (the effective chrome decides, SC02). */
467
+ * signed two-tone fill, fill fade, stroke fade, markers, the frame's row
468
+ * labels (C3), dots, end labels, glow, motion, latest-value chips and the
469
+ * axis words on the pane; fill, fill ink, style, width, dash, dots, end
470
+ * label and legend membership per series. `y_title` is the rich curve's
471
+ * caption and a box line's axis title (the effective chrome decides, SC02). */
426
472
  export function wrunLineStyle(panel, chrome, rows, ctx) {
427
473
  const color = (word) => wrunPaneColor(word, ctx.theme);
428
474
  const rich = wrunPanelChrome(panel) !== 'box';
@@ -450,6 +496,7 @@ export function wrunLineStyle(panel, chrome, rows, ctx) {
450
496
  settings.strokeGradient = strokeGradient;
451
497
  }
452
498
  put(settings, 'markers', lineMarkers(panel, chrome, rows, ctx));
499
+ put(settings, 'xValueLabels', lineXValueLabels(panel, chrome, rows));
453
500
  put(settings, 'badge', panelBadge(panel, chrome, ctx));
454
501
  put(settings, 'points', panel.points);
455
502
  put(settings, 'endLabels', panel.labels);
@@ -484,10 +531,11 @@ function barShapeStyle(panel) {
484
531
  }
485
532
  /** The bars words (SC19 SC23 SC24 SC39, C2): sign colouring (the tones
486
533
  * come from the common words), the axis words, the bar shape, the badge
487
- * chip and legend membership per series (`series[j].legend: false` keeps
488
- * that series out of the legend chips, a `series` patch merged per index);
489
- * per-bar colours are row data the caller maps. */
490
- export function wrunBarsStyle(panel, chrome, _rows, ctx) {
534
+ * chip, the frame's row labels (C3, as `xLabels`) and legend membership
535
+ * per series (`series[j].legend: false` keeps that series out of the legend
536
+ * chips, a `series` patch merged per index); per-bar colours are row data
537
+ * the caller maps. */
538
+ export function wrunBarsStyle(panel, chrome, rows, ctx) {
491
539
  const patch = {
492
540
  ...chromeStylePatch(panel),
493
541
  ...axisStyle(panel, chrome, { rich: false, curve: false, xBounds: false }),
@@ -496,6 +544,7 @@ export function wrunBarsStyle(panel, chrome, _rows, ctx) {
496
544
  if (panel.color_mode === 'sign')
497
545
  patch.signedBars = true;
498
546
  put(patch, 'badge', panelBadge(panel, chrome, ctx));
547
+ put(patch, 'xLabels', barsXLabels(panel, chrome, rows, ctx));
499
548
  const series = panel.series ?? [];
500
549
  if (series.some((entry) => entry.legend === false)) {
501
550
  patch.series = series.map((entry) => (entry.legend === false ? { hideFromLegend: true } : {}));
@@ -56,8 +56,9 @@
56
56
  * (tests/workers/worker-runtime-boundary.spec.ts), which the alert identity
57
57
  * module does.
58
58
  */
59
- import type { WrunIndicatorMetadata, WrunMetadataParam, WrunParamHostFill } from '../../interfaces/wrun-runtime.interface.js';
59
+ import type { WrunIndicatorMetadata, WrunMetadataParam } from '../../interfaces/wrun-runtime.interface.js';
60
60
  import { type WrunHostFillContext } from './wrun-script-inputs.util.js';
61
+ import type { WrunHostFillWord } from './wrun-param-values.util.js';
61
62
  /** The hosted lane's param map: packed finite numbers; for a `type: "text"`
62
63
  * param (wrun-5) the chart's own run value for the setting (each host
63
64
  * applies the plain-text rule and the byte cap again on its side and
@@ -80,17 +81,18 @@ export declare function wrunHostedTextValue(param: Pick<WrunMetadataParam, 'text
80
81
  * `chart_<word>`; the extractor refuses any other param under those names), in the kit's order: the market's tick
81
82
  * size and decimals, the chart's interval seconds and five colours (the candle and grid colours since WRUN-STYLE
82
83
  * TH-candle-colors), the market's five facts (WRUN-GAPS-1005, WRUN-SESSION), the issuer's three earnings facts, the
83
- * option multiplier of the chart's options chain and the dollar multiplier of its own trades (kit 0.95.0). Every hosted
84
- * path reads it: the settings record's `hostFill` (wrunHostedHostFill), the declaration rebuild
85
- * (WRUN_HOST_FILL_BY_GENERATED_NAME) and the kScript socket worker's read of the main thread's context
86
- * (WRUN_HOST_FILL_CONTEXT_KEYS), so no hosted path drops a word another carries; wrun-param-values.util.spec holds the
87
- * table to every word the kit's browser lane fills.
84
+ * option multiplier of the chart's options chain, the dollar multiplier of its own trades (kit 0.95.0) and whether the
85
+ * chart is one option contract (om C5, a word read ahead of the kit pin: WrunHostFillWord). Every hosted path reads it:
86
+ * the settings record's `hostFill` (wrunHostedHostFill), the declaration rebuild (WRUN_HOST_FILL_BY_GENERATED_NAME)
87
+ * and the kScript socket worker's read of the main thread's context (WRUN_HOST_FILL_CONTEXT_KEYS), so no hosted path
88
+ * drops a word another carries; wrun-param-values.util.spec holds the table to every word the browser run fills, the
89
+ * kit's and those read ahead of its pin.
88
90
  */
89
- export declare const WRUN_HOST_FILL_WORDS: readonly [readonly ["tick_size", "tickSize", "market_tick_size"], readonly ["price_precision", "pricePrecision", "market_price_precision"], readonly ["interval_sec", "intervalSec", "chart_interval_sec"], readonly ["bg_color", "bgColor", "chart_bg_color"], readonly ["fg_color", "fgColor", "chart_fg_color"], readonly ["up_color", "upColor", "chart_up_color"], readonly ["down_color", "downColor", "chart_down_color"], readonly ["grid_color", "gridColor", "chart_grid_color"], readonly ["kind", "kind", "market_kind"], readonly ["point_value", "pointValue", "market_point_value"], readonly ["zone", "zone", "market_zone"], readonly ["quote_is_usd", "quoteIsUsd", "market_quote_is_usd"], readonly ["session_open", "sessionOpen", "market_session_open"], readonly ["earnings_next_ms", "earningsNextMs", "market_earnings_next_ms"], readonly ["earnings_prev_ms", "earningsPrevMs", "market_earnings_prev_ms"], readonly ["earnings_session", "earningsSession", "market_earnings_session"], readonly ["option_multiplier", "optionMultiplier", "market_option_multiplier"], readonly ["dollar_multiplier", "dollarMultiplier", "market_dollar_multiplier"]];
91
+ export declare const WRUN_HOST_FILL_WORDS: readonly [readonly ["tick_size", "tickSize", "market_tick_size"], readonly ["price_precision", "pricePrecision", "market_price_precision"], readonly ["interval_sec", "intervalSec", "chart_interval_sec"], readonly ["bg_color", "bgColor", "chart_bg_color"], readonly ["fg_color", "fgColor", "chart_fg_color"], readonly ["up_color", "upColor", "chart_up_color"], readonly ["down_color", "downColor", "chart_down_color"], readonly ["grid_color", "gridColor", "chart_grid_color"], readonly ["kind", "kind", "market_kind"], readonly ["point_value", "pointValue", "market_point_value"], readonly ["zone", "zone", "market_zone"], readonly ["quote_is_usd", "quoteIsUsd", "market_quote_is_usd"], readonly ["session_open", "sessionOpen", "market_session_open"], readonly ["earnings_next_ms", "earningsNextMs", "market_earnings_next_ms"], readonly ["earnings_prev_ms", "earningsPrevMs", "market_earnings_prev_ms"], readonly ["earnings_session", "earningsSession", "market_earnings_session"], readonly ["option_multiplier", "optionMultiplier", "market_option_multiplier"], readonly ["dollar_multiplier", "dollarMultiplier", "market_dollar_multiplier"], readonly ["option_contract", "optionContract", "market_option_contract"]];
90
92
  /** The host-filled params by the names the kit generates for them (WRUN_HOST_FILL_WORDS). A declaration row carries
91
93
  * no `host_fill` word, so the rebuild recovers it here: without it the host context could not fill the param and a
92
94
  * hosted lane would evaluate the declared 0 (unavailable). */
93
- export declare const WRUN_HOST_FILL_BY_GENERATED_NAME: ReadonlyMap<string, WrunParamHostFill>;
95
+ export declare const WRUN_HOST_FILL_BY_GENERATED_NAME: ReadonlyMap<string, WrunHostFillWord>;
94
96
  /** The chart context keys the kScript socket worker reads off the `wrunHostFill` the main thread puts beside a hosted
95
97
  * overlay's settings (finite numbers only), one per host-fill word (WRUN_HOST_FILL_WORDS). */
96
98
  export declare const WRUN_HOST_FILL_CONTEXT_KEYS: ReadonlyArray<keyof WrunHostFillContext>;
@@ -178,9 +180,10 @@ export declare function wrunHostedSettingsRecord(settings: unknown): WrunHostedS
178
180
  * members to theirs). The cloud merges the patch over its record, so the two end equal. */
179
181
  export declare function wrunHostedSettingsPatch(held: unknown, asked: unknown): WrunHostedSettingsRecord;
180
182
  /** The host fills a hosted run sends beside its settings record (C4 `hostFill`): the packed chart
181
- * context by the kit's host-fill word, the record the SDK's resolver fills `host_fill` params from
182
- * (its `hostFills`). */
183
- export type WrunHostedHostFill = Partial<Record<WrunParamHostFill, number>>;
183
+ * context by host-fill word (the kit's, and a word read ahead of its pin: WrunHostFillWord), the
184
+ * record the SDK's resolver fills `host_fill` params from (its `hostFills`, by each param's own
185
+ * word, so a word it does not know fills nothing). */
186
+ export type WrunHostedHostFill = Partial<Record<WrunHostFillWord, number>>;
184
187
  /** The host fills of a chart context (`wrunHostFill`, the pane's market and chart words, packed the
185
188
  * way the browser run fills them) by host-fill word: finite numbers only, in the kit's order; none
186
189
  * (undefined) for no context or a context holding none. */
@@ -103,11 +103,12 @@ function wrunHostedSymbolValue(param, settings) {
103
103
  * `chart_<word>`; the extractor refuses any other param under those names), in the kit's order: the market's tick
104
104
  * size and decimals, the chart's interval seconds and five colours (the candle and grid colours since WRUN-STYLE
105
105
  * TH-candle-colors), the market's five facts (WRUN-GAPS-1005, WRUN-SESSION), the issuer's three earnings facts, the
106
- * option multiplier of the chart's options chain and the dollar multiplier of its own trades (kit 0.95.0). Every hosted
107
- * path reads it: the settings record's `hostFill` (wrunHostedHostFill), the declaration rebuild
108
- * (WRUN_HOST_FILL_BY_GENERATED_NAME) and the kScript socket worker's read of the main thread's context
109
- * (WRUN_HOST_FILL_CONTEXT_KEYS), so no hosted path drops a word another carries; wrun-param-values.util.spec holds the
110
- * table to every word the kit's browser lane fills.
106
+ * option multiplier of the chart's options chain, the dollar multiplier of its own trades (kit 0.95.0) and whether the
107
+ * chart is one option contract (om C5, a word read ahead of the kit pin: WrunHostFillWord). Every hosted path reads it:
108
+ * the settings record's `hostFill` (wrunHostedHostFill), the declaration rebuild (WRUN_HOST_FILL_BY_GENERATED_NAME)
109
+ * and the kScript socket worker's read of the main thread's context (WRUN_HOST_FILL_CONTEXT_KEYS), so no hosted path
110
+ * drops a word another carries; wrun-param-values.util.spec holds the table to every word the browser run fills, the
111
+ * kit's and those read ahead of its pin.
111
112
  */
112
113
  export const WRUN_HOST_FILL_WORDS = [
113
114
  ['tick_size', 'tickSize', 'market_tick_size'],
@@ -131,6 +132,8 @@ export const WRUN_HOST_FILL_WORDS = [
131
132
  ['option_multiplier', 'optionMultiplier', 'market_option_multiplier'],
132
133
  // The dollar multiplier of the market's own trades (kit 0.95.0, wrun-chart-market-facts.util).
133
134
  ['dollar_multiplier', 'dollarMultiplier', 'market_dollar_multiplier'],
135
+ // Whether the chart is one option contract (om C5, read ahead of the kit pin, wrun-chart-market-facts.util).
136
+ ['option_contract', 'optionContract', 'market_option_contract'],
134
137
  ];
135
138
  /** The host-filled params by the names the kit generates for them (WRUN_HOST_FILL_WORDS). A declaration row carries
136
139
  * no `host_fill` word, so the rebuild recovers it here: without it the host context could not fill the param and a
@@ -240,6 +243,8 @@ export function wrunSheetParamsFromDeclarations(declarations) {
240
243
  multiline: row.multiline === true,
241
244
  }
242
245
  : {}),
246
+ // A word read ahead of the kit pin (WrunHostFillWord) rides under the param's pinned type, as it does on the
247
+ // sheet a newer SDK compiled.
243
248
  ...(hostFill !== undefined ? { host_fill: hostFill, hidden: true } : {}),
244
249
  });
245
250
  }
@@ -4,14 +4,21 @@
4
4
  * (wrun-script-inputs.util re-exports it) and keeps them off the pre-candle closure. Its imports are settings readers
5
5
  * the boot path already holds.
6
6
  */
7
- import type { WrunIndicatorMetadata, WrunMetadataParam } from '../../interfaces/wrun-runtime.interface.js';
7
+ import type { WrunIndicatorMetadata, WrunMetadataParam, WrunParamHostFill } from '../../interfaces/wrun-runtime.interface.js';
8
+ /** The host_fill words the chart fills: the pinned kit's (WrunParamHostFill) and each word read ahead of the pin
9
+ * while the kit that declares it is built. A sheet a newer SDK compiled carries such a word at run time though the
10
+ * pinned type lacks it; once a pin carries it the union adds nothing and the word leaves
11
+ * wrun-param-values.util.spec's AHEAD_OF_KIT. None is read ahead today: `option_contract` (om C5) was, until the
12
+ * chart pinned kit 0.102.0, which declares it. */
13
+ export type WrunHostFillWord = WrunParamHostFill;
8
14
  /** What the host fills into `host_fill` params at run time: the chart
9
15
  * market's tick size and price precision, the chart's bar interval in
10
16
  * seconds, its background / text / candle up / candle down / grid colour as
11
17
  * the kit's packed signed i32 (wrun-chart-context.util), the market's
12
- * five facts as their codes, the option multiplier of its options chain and
13
- * the dollar multiplier of its own trades (wrun-chart-market-facts.util);
14
- * absent = the declared default (0, unknown). */
18
+ * five facts as their codes, the option multiplier of its options chain,
19
+ * the dollar multiplier of its own trades and whether it is one option
20
+ * contract (wrun-chart-market-facts.util); absent = the declared default
21
+ * (0, unknown). */
15
22
  export interface WrunHostFillContext {
16
23
  tickSize?: number;
17
24
  pricePrecision?: number;
@@ -56,6 +63,9 @@ export interface WrunHostFillContext {
56
63
  * a market quoted in dollars); 0 where it is not proven (a full run never
57
64
  * computes a sheet declaring it over 0: it refuses first). */
58
65
  dollarMultiplier?: number;
66
+ /** `market.option_contract()` (om C5, a kit host-fill word by 0.102.0): 1 when the chart's
67
+ * market is one option contract (an OPRA contract, a CME or crypto option), else 0 (wrunChartOptionContract). */
68
+ optionContract?: number;
59
69
  }
60
70
  export declare function nonEmptyString(value: unknown): string | undefined;
61
71
  export declare function finiteNumber(value: unknown): number | undefined;
@@ -139,6 +139,10 @@ function paramRunValue(param, flat, host) {
139
139
  return finiteOr(finiteNumber(host?.optionMultiplier), fallback);
140
140
  if (param.host_fill === 'dollar_multiplier')
141
141
  return finiteOr(finiteNumber(host?.dollarMultiplier), fallback);
142
+ // Asserted wider (WrunHostFillWord): the pinned kit's type lacks this word, which a newer SDK's sheet carries.
143
+ if (param.host_fill === 'option_contract') {
144
+ return finiteOr(finiteNumber(host?.optionContract), fallback);
145
+ }
142
146
  const raw = flat?.[param.name];
143
147
  switch (param.type) {
144
148
  case 'symbol':