@orangecharts/wrun-chart-host 0.11.1 → 0.15.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 (319) hide show
  1. package/README.md +1 -0
  2. package/dist/constants/feature-flags.constants.d.ts +4 -4
  3. package/dist/constants/feature-flags.constants.js +38 -52
  4. package/dist/constants/feature-limits.constants.d.ts +1 -1
  5. package/dist/constants/feature-limits.constants.js +5 -4
  6. package/dist/constants/interval.constants.d.ts +7 -0
  7. package/dist/constants/interval.constants.js +7 -0
  8. package/dist/constants/scriptEditor/cme-official-scripts.constants.d.ts +20 -149
  9. package/dist/constants/scriptEditor/cme-official-scripts.constants.js +20 -309
  10. package/dist/constants/stocks-compliance.constants.d.ts +15 -0
  11. package/dist/constants/stocks-compliance.constants.js +15 -0
  12. package/dist/host-env.d.ts +69 -3
  13. package/dist/host-env.js +21 -0
  14. package/dist/host-ports.types.d.ts +36 -3
  15. package/dist/index.d.ts +18 -0
  16. package/dist/index.js +19 -0
  17. package/dist/indicators/controls/tpo-session.util.d.ts +52 -12
  18. package/dist/indicators/controls/tpo-session.util.js +113 -16
  19. package/dist/instances/script-engine-worker-ohlcv-transfer.d.ts +6 -0
  20. package/dist/instances/script-engine-worker-ohlcv-transfer.js +16 -0
  21. package/dist/interfaces/cme-realtime.interface.d.ts +8 -0
  22. package/dist/interfaces/cme-realtime.interface.js +2 -1
  23. package/dist/interfaces/feed.interface.d.ts +15 -1
  24. package/dist/interfaces/replay.interface.d.ts +5 -0
  25. package/dist/interfaces/stocks-realtime.interface.d.ts +4 -3
  26. package/dist/interfaces/stocks-realtime.interface.js +5 -4
  27. package/dist/interfaces/wrun-runtime.interface.d.ts +141 -20
  28. package/dist/kscript-data/controls/live-ohlcv-merge.util.d.ts +17 -0
  29. package/dist/kscript-data/controls/live-ohlcv-merge.util.js +22 -0
  30. package/dist/kscript-data/controls/live-trades-merge.util.d.ts +46 -40
  31. package/dist/kscript-data/controls/live-trades-merge.util.js +80 -107
  32. package/dist/market-data/billing.interface.d.ts +9 -1
  33. package/dist/market-data/venue.d.ts +1 -1
  34. package/dist/market-data/venues/index.d.ts +5 -5
  35. package/dist/market-data/venues/opra.js +3 -3
  36. package/dist/market-data/venues/stocks.contract.copy.json +6 -5
  37. package/dist/market-data/venues/stocks.d.ts +5 -5
  38. package/dist/market-data/venues/stocks.js +21 -18
  39. package/dist/settings-templates/frvp-fields.d.ts +12 -1
  40. package/dist/settings-templates/frvp-fields.js +15 -4
  41. package/dist/settings-templates/index.js +12 -5
  42. package/dist/settings-templates/indicator-fields.js +43 -2
  43. package/dist/settings-templates/tool-rules.d.ts +17 -8
  44. package/dist/settings-templates/tool-rules.js +15 -8
  45. package/dist/settings-templates/tool-tables.generated.js +4 -2
  46. package/dist/utility/auth/server-clock.util.d.ts +3 -1
  47. package/dist/utility/auth/server-clock.util.js +3 -1
  48. package/dist/utility/chart/book-live-bucket.util.js +2 -2
  49. package/dist/utility/chart/cache-alignment.util.d.ts +38 -7
  50. package/dist/utility/chart/cache-alignment.util.js +50 -13
  51. package/dist/utility/chart/chart-data-fetch-generation.util.d.ts +2 -0
  52. package/dist/utility/chart/chart-data-fetch-generation.util.js +16 -0
  53. package/dist/utility/chart/cme-session-bucket.util.d.ts +18 -75
  54. package/dist/utility/chart/cme-session-bucket.util.js +25 -332
  55. package/dist/utility/chart/continuous-contracts.util.js +6 -5
  56. package/dist/utility/chart/display-offset.leaf.d.ts +24 -0
  57. package/dist/utility/chart/display-offset.leaf.js +41 -0
  58. package/dist/utility/chart/effective-chart-session.util.d.ts +2 -1
  59. package/dist/utility/chart/effective-chart-session.util.js +13 -5
  60. package/dist/utility/chart/feed-interval.util.d.ts +6 -20
  61. package/dist/utility/chart/feed-interval.util.js +13 -22
  62. package/dist/utility/chart/fetch-dedupe-policy.util.d.ts +27 -7
  63. package/dist/utility/chart/fetch-dedupe-policy.util.js +86 -11
  64. package/dist/utility/chart/footprint-band.util.d.ts +21 -5
  65. package/dist/utility/chart/footprint-band.util.js +53 -14
  66. package/dist/utility/chart/host-bar-placement.util.d.ts +7 -4
  67. package/dist/utility/chart/host-bar-placement.util.js +8 -2
  68. package/dist/utility/chart/indicator-inflight-registry.util.d.ts +32 -0
  69. package/dist/utility/chart/indicator-inflight-registry.util.js +52 -0
  70. package/dist/utility/chart/indicator-run-interval.util.d.ts +10 -4
  71. package/dist/utility/chart/indicator-run-interval.util.js +21 -12
  72. package/dist/utility/chart/interval-registry.util.d.ts +1 -1
  73. package/dist/utility/chart/interval-registry.util.js +1 -1
  74. package/dist/utility/chart/kscript-legend-entries.util.d.ts +12 -0
  75. package/dist/utility/chart/kscript-legend-entries.util.js +16 -0
  76. package/dist/utility/chart/kscript-run-interval-projection.util.d.ts +1 -1
  77. package/dist/utility/chart/kscript-run-interval-projection.util.js +4 -2
  78. package/dist/utility/chart/kscript-venue-policy.util.d.ts +53 -62
  79. package/dist/utility/chart/kscript-venue-policy.util.js +85 -94
  80. package/dist/utility/chart/live-bucket.util.d.ts +39 -17
  81. package/dist/utility/chart/live-bucket.util.js +103 -57
  82. package/dist/utility/chart/local-kscript-source-revalidation.util.d.ts +58 -20
  83. package/dist/utility/chart/local-kscript-source-revalidation.util.js +98 -23
  84. package/dist/utility/chart/local-kscript-warmup-depth.util.d.ts +35 -11
  85. package/dist/utility/chart/local-kscript-warmup-depth.util.js +24 -3
  86. package/dist/utility/chart/market-session-schedule.util.d.ts +8 -0
  87. package/dist/utility/chart/market-session-schedule.util.js +39 -1
  88. package/dist/utility/chart/market-session.util.d.ts +136 -0
  89. package/dist/utility/chart/market-session.util.js +341 -0
  90. package/dist/utility/chart/om-panel.util.d.ts +5 -3
  91. package/dist/utility/chart/om-panel.util.js +42 -7
  92. package/dist/utility/chart/om-target.util.d.ts +14 -1
  93. package/dist/utility/chart/om-target.util.js +22 -5
  94. package/dist/utility/chart/opra-read-access.leaf.d.ts +16 -1
  95. package/dist/utility/chart/opra-read-access.leaf.js +22 -0
  96. package/dist/utility/chart/profile-row-height.util.d.ts +49 -16
  97. package/dist/utility/chart/profile-row-height.util.js +74 -37
  98. package/dist/utility/chart/rth-session.util.d.ts +55 -20
  99. package/dist/utility/chart/rth-session.util.js +94 -46
  100. package/dist/utility/chart/session-lattice.util.d.ts +150 -0
  101. package/dist/utility/chart/session-lattice.util.js +488 -0
  102. package/dist/utility/chart/trading-day.util.d.ts +40 -2
  103. package/dist/utility/chart/trading-day.util.js +84 -7
  104. package/dist/utility/chart/us-equities-session.util.d.ts +32 -11
  105. package/dist/utility/chart/us-equities-session.util.js +44 -15
  106. package/dist/utility/chart/window-geometry.leaf.d.ts +28 -7
  107. package/dist/utility/chart/window-geometry.leaf.js +57 -8
  108. package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +21 -14
  109. package/dist/utility/chart/wrun-bar-session-facts.util.js +32 -38
  110. package/dist/utility/chart/wrun-run-result.util.d.ts +38 -13
  111. package/dist/utility/chart/wrun-run-result.util.js +97 -27
  112. package/dist/utility/common/time.util.js +5 -4
  113. package/dist/utility/market-events/earnings-scope.util.d.ts +10 -5
  114. package/dist/utility/market-events/earnings-scope.util.js +17 -9
  115. package/dist/utility/market-events/market-events.util.d.ts +14 -7
  116. package/dist/utility/market-events/market-events.util.js +30 -17
  117. package/dist/utility/number-format.util.d.ts +14 -21
  118. package/dist/utility/number-format.util.js +38 -24
  119. package/dist/utility/options/option-venue-disclosure.util.d.ts +40 -6
  120. package/dist/utility/options/option-venue-disclosure.util.js +71 -11
  121. package/dist/utility/options/option-venue.util.d.ts +1 -1
  122. package/dist/utility/options/option-venue.util.js +1 -1
  123. package/dist/utility/pool-symbol.leaf.d.ts +7 -0
  124. package/dist/utility/pool-symbol.leaf.js +50 -5
  125. package/dist/utility/stocks/stock-display.util.d.ts +15 -0
  126. package/dist/utility/stocks/stock-display.util.js +37 -0
  127. package/dist/utility/symbol-selection/contract-expiry.util.js +5 -4
  128. package/dist/utility/v2/gate-plane.util.d.ts +6 -0
  129. package/dist/utility/v2/gate-plane.util.js +11 -1
  130. package/dist/utility/v2/gate-session-latch.util.d.ts +1 -1
  131. package/dist/utility/v2/gate-session-latch.util.js +3 -3
  132. package/dist/utility/v2/governed-tier.leaf.d.ts +17 -16
  133. package/dist/utility/v2/governed-tier.leaf.js +17 -16
  134. package/dist/utility/v2/stocks-governed.util.d.ts +5 -0
  135. package/dist/utility/v2/stocks-governed.util.js +14 -0
  136. package/dist/utility/v2/v2-enums.leaf.d.ts +13 -0
  137. package/dist/utility/v2/v2-enums.leaf.js +458 -0
  138. package/dist/utility/wrun/derived-roots.leaf.d.ts +21 -1
  139. package/dist/utility/wrun/derived-roots.leaf.js +27 -1
  140. package/dist/utility/wrun/derived-roots.util.d.ts +44 -32
  141. package/dist/utility/wrun/derived-roots.util.js +97 -56
  142. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.d.ts +4 -3
  143. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +4 -3
  144. package/dist/utility/wrun/sources/lanes/option_daily.d.ts +2 -1
  145. package/dist/utility/wrun/sources/lanes/option_daily.js +2 -1
  146. package/dist/utility/wrun/sources/lanes/options_flow.d.ts +3 -0
  147. package/dist/utility/wrun/sources/lanes/options_flow.js +23 -5
  148. package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +3 -4
  149. package/dist/utility/wrun/sources/row-lane-registry.js +9 -4
  150. package/dist/utility/wrun/sources/row-lanes/dark_pool.d.ts +19 -0
  151. package/dist/utility/wrun/sources/row-lanes/dark_pool.js +104 -0
  152. package/dist/utility/wrun/sources/row-lanes/index.js +2 -0
  153. package/dist/utility/wrun/sources/wrun-lane-fetch-abort.util.d.ts +20 -0
  154. package/dist/utility/wrun/sources/wrun-lane-fetch-abort.util.js +103 -0
  155. package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +19 -2
  156. package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +15 -13
  157. package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +49 -23
  158. package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +14 -9
  159. package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +75 -27
  160. package/dist/utility/wrun/sources/wrun-row-lanes.util.js +139 -82
  161. package/dist/utility/wrun/wrun-app-layer.leaf.d.ts +78 -0
  162. package/dist/utility/wrun/wrun-app-layer.leaf.js +89 -0
  163. package/dist/utility/wrun/wrun-bar-count.util.d.ts +11 -7
  164. package/dist/utility/wrun/wrun-bar-count.util.js +12 -8
  165. package/dist/utility/wrun/wrun-batched-kinds.leaf.d.ts +13 -0
  166. package/dist/utility/wrun/wrun-batched-kinds.leaf.js +18 -0
  167. package/dist/utility/wrun/wrun-batched-marks.util.d.ts +46 -23
  168. package/dist/utility/wrun/wrun-batched-marks.util.js +260 -62
  169. package/dist/utility/wrun/wrun-batched-readout.util.d.ts +26 -19
  170. package/dist/utility/wrun/wrun-batched-readout.util.js +81 -27
  171. package/dist/utility/wrun/wrun-book-bands.leaf.d.ts +8 -0
  172. package/dist/utility/wrun/wrun-book-bands.leaf.js +7 -0
  173. package/dist/utility/wrun/wrun-candle-equal.leaf.d.ts +19 -0
  174. package/dist/utility/wrun/wrun-candle-equal.leaf.js +40 -0
  175. package/dist/utility/wrun/wrun-canvas-readout.util.d.ts +4 -2
  176. package/dist/utility/wrun/wrun-canvases.util.d.ts +24 -7
  177. package/dist/utility/wrun/wrun-canvases.util.js +99 -30
  178. package/dist/utility/wrun/wrun-chart-context-names.util.d.ts +6 -3
  179. package/dist/utility/wrun/wrun-chart-context-names.util.js +8 -4
  180. package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +47 -29
  181. package/dist/utility/wrun/wrun-chart-market-facts.util.js +201 -201
  182. package/dist/utility/wrun/wrun-child-overlay-id.util.js +2 -1
  183. package/dist/utility/wrun/wrun-cme-legs-note.util.d.ts +15 -0
  184. package/dist/utility/wrun/wrun-cme-legs-note.util.js +49 -0
  185. package/dist/utility/wrun/wrun-cme-root-specs.util.d.ts +38 -0
  186. package/dist/utility/wrun/wrun-cme-root-specs.util.js +81 -0
  187. package/dist/utility/wrun/wrun-coin-lane-live.util.js +3 -0
  188. package/dist/utility/wrun/wrun-color-settings.util.d.ts +6 -1
  189. package/dist/utility/wrun/wrun-color-settings.util.js +32 -7
  190. package/dist/utility/wrun/wrun-dark-pool.util.d.ts +50 -0
  191. package/dist/utility/wrun/wrun-dark-pool.util.js +127 -0
  192. package/dist/utility/wrun/wrun-declared-warmup.util.d.ts +67 -12
  193. package/dist/utility/wrun/wrun-declared-warmup.util.js +165 -13
  194. package/dist/utility/wrun/wrun-draft-legend-note.util.d.ts +18 -8
  195. package/dist/utility/wrun/wrun-draft-legend-note.util.js +57 -11
  196. package/dist/utility/wrun/wrun-draft-overlay.util.d.ts +14 -10
  197. package/dist/utility/wrun/wrun-draft-overlay.util.js +26 -14
  198. package/dist/utility/wrun/wrun-earnings-facts.util.js +3 -2
  199. package/dist/utility/wrun/wrun-etf-funds.util.d.ts +2 -0
  200. package/dist/utility/wrun/wrun-etf-funds.util.js +4 -0
  201. package/dist/utility/wrun/wrun-held-lanes.util.js +8 -2
  202. package/dist/utility/wrun/wrun-history-as-of.util.d.ts +77 -0
  203. package/dist/utility/wrun/wrun-history-as-of.util.js +108 -0
  204. package/dist/utility/wrun/wrun-host.service.d.ts +64 -14
  205. package/dist/utility/wrun/wrun-host.service.js +137 -27
  206. package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +3 -3
  207. package/dist/utility/wrun/wrun-hosted-wire-caps.js +12 -2
  208. package/dist/utility/wrun/wrun-hover.util.d.ts +8 -2
  209. package/dist/utility/wrun/wrun-hover.util.js +24 -13
  210. package/dist/utility/wrun/wrun-inert-legend.util.d.ts +13 -0
  211. package/dist/utility/wrun/wrun-inert-legend.util.js +31 -3
  212. package/dist/utility/wrun/wrun-input-requirements.leaf.d.ts +7 -5
  213. package/dist/utility/wrun/wrun-input-requirements.leaf.js +16 -6
  214. package/dist/utility/wrun/wrun-install-pacer.util.d.ts +26 -0
  215. package/dist/utility/wrun/wrun-install-pacer.util.js +145 -0
  216. package/dist/utility/wrun/wrun-kit-refusal-stages.types.d.ts +22 -0
  217. package/dist/utility/wrun/wrun-kit-refusal-stages.types.js +1 -0
  218. package/dist/utility/wrun/wrun-lane-refusal.leaf.d.ts +12 -5
  219. package/dist/utility/wrun/wrun-lane-refusal.leaf.js +23 -5
  220. package/dist/utility/wrun/wrun-lane-warmup.util.js +22 -4
  221. package/dist/utility/wrun/wrun-leg-close.util.d.ts +6 -5
  222. package/dist/utility/wrun/wrun-leg-close.util.js +11 -9
  223. package/dist/utility/wrun/wrun-leg-fetch.util.d.ts +3 -1
  224. package/dist/utility/wrun/wrun-leg-fetch.util.js +9 -2
  225. package/dist/utility/wrun/wrun-levels-child.util.d.ts +2 -0
  226. package/dist/utility/wrun/wrun-levels-child.util.js +6 -0
  227. package/dist/utility/wrun/wrun-lifecycle.contract.d.ts +4 -0
  228. package/dist/utility/wrun/wrun-live-intake.util.d.ts +15 -6
  229. package/dist/utility/wrun/wrun-live-intake.util.js +167 -47
  230. package/dist/utility/wrun/wrun-live-tick.util.d.ts +52 -8
  231. package/dist/utility/wrun/wrun-live-tick.util.js +655 -97
  232. package/dist/utility/wrun/wrun-market-facts.util.d.ts +16 -2
  233. package/dist/utility/wrun/wrun-market-facts.util.js +32 -3
  234. package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +27 -27
  235. package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +28 -16
  236. package/dist/utility/wrun/wrun-market-size-defaults.util.js +34 -5
  237. package/dist/utility/wrun/wrun-oi-lane.util.d.ts +10 -7
  238. package/dist/utility/wrun/wrun-oi-lane.util.js +16 -10
  239. package/dist/utility/wrun/wrun-option-strike-flow.util.js +1 -1
  240. package/dist/utility/wrun/wrun-option-views.util.d.ts +2 -2
  241. package/dist/utility/wrun/wrun-option-views.util.js +5 -2
  242. package/dist/utility/wrun/wrun-options-flow-underlying.leaf.d.ts +5 -0
  243. package/dist/utility/wrun/wrun-options-flow-underlying.leaf.js +16 -0
  244. package/dist/utility/wrun/wrun-options-stop.util.d.ts +3 -2
  245. package/dist/utility/wrun/wrun-options-stop.util.js +6 -4
  246. package/dist/utility/wrun/wrun-output-words.util.d.ts +14 -0
  247. package/dist/utility/wrun/wrun-output-words.util.js +51 -0
  248. package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +116 -11
  249. package/dist/utility/wrun/wrun-overlay-drivers.util.js +208 -43
  250. package/dist/utility/wrun/wrun-overlay-lifecycle.util.js +20 -10
  251. package/dist/utility/wrun/wrun-overlay-park.util.d.ts +84 -0
  252. package/dist/utility/wrun/wrun-overlay-park.util.js +135 -0
  253. package/dist/utility/wrun/wrun-overlay-recovery.util.d.ts +37 -4
  254. package/dist/utility/wrun/wrun-overlay-recovery.util.js +26 -14
  255. package/dist/utility/wrun/wrun-overlay-result.util.d.ts +6 -1
  256. package/dist/utility/wrun/wrun-overlay-result.util.js +2 -0
  257. package/dist/utility/wrun/wrun-overlay-run.util.d.ts +247 -26
  258. package/dist/utility/wrun/wrun-overlay-run.util.js +2234 -408
  259. package/dist/utility/wrun/wrun-pack.util.d.ts +8 -5
  260. package/dist/utility/wrun/wrun-panel-mount.util.d.ts +11 -2
  261. package/dist/utility/wrun/wrun-panel-mount.util.js +122 -19
  262. package/dist/utility/wrun/wrun-panel-style.util.d.ts +4 -2
  263. package/dist/utility/wrun/wrun-panel-style.util.js +3 -2
  264. package/dist/utility/wrun/wrun-pin-spelling.util.d.ts +7 -0
  265. package/dist/utility/wrun/wrun-pin-spelling.util.js +18 -4
  266. package/dist/utility/wrun/wrun-pin-venues.util.d.ts +26 -17
  267. package/dist/utility/wrun/wrun-pin-venues.util.js +43 -36
  268. package/dist/utility/wrun/wrun-pinned-lanes.util.d.ts +58 -0
  269. package/dist/utility/wrun/wrun-pinned-lanes.util.js +72 -0
  270. package/dist/utility/wrun/wrun-prefix-cohort.util.js +2 -1
  271. package/dist/utility/wrun/wrun-prefix-lanes.util.d.ts +22 -9
  272. package/dist/utility/wrun/wrun-prefix-lanes.util.js +145 -26
  273. package/dist/utility/wrun/wrun-prefix-proof.util.d.ts +29 -0
  274. package/dist/utility/wrun/wrun-prefix-proof.util.js +23 -5
  275. package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +9 -1
  276. package/dist/utility/wrun/wrun-refusal-surface.util.js +15 -1
  277. package/dist/utility/wrun/wrun-refusal.util.d.ts +19 -1
  278. package/dist/utility/wrun/wrun-refusal.util.js +103 -16
  279. package/dist/utility/wrun/wrun-registry-errors.util.d.ts +20 -6
  280. package/dist/utility/wrun/wrun-registry-errors.util.js +20 -6
  281. package/dist/utility/wrun/wrun-replay-rows.util.js +6 -10
  282. package/dist/utility/wrun/wrun-run-health.util.d.ts +95 -5
  283. package/dist/utility/wrun/wrun-run-health.util.js +209 -3
  284. package/dist/utility/wrun/wrun-run-interval-session.util.d.ts +2 -2
  285. package/dist/utility/wrun/wrun-run-interval-session.util.js +2 -2
  286. package/dist/utility/wrun/wrun-run-interval.util.d.ts +9 -8
  287. package/dist/utility/wrun/wrun-run-interval.util.js +13 -11
  288. package/dist/utility/wrun/wrun-sandbox-row-source.js +5 -2
  289. package/dist/utility/wrun/wrun-script-inputs.util.d.ts +38 -11
  290. package/dist/utility/wrun/wrun-script-inputs.util.js +194 -56
  291. package/dist/utility/wrun/wrun-session-composition.util.d.ts +81 -0
  292. package/dist/utility/wrun/wrun-session-composition.util.js +169 -0
  293. package/dist/utility/wrun/wrun-setting-words.util.d.ts +10 -7
  294. package/dist/utility/wrun/wrun-setting-words.util.js +25 -7
  295. package/dist/utility/wrun/wrun-source-rows.util.d.ts +94 -28
  296. package/dist/utility/wrun/wrun-source-rows.util.js +738 -93
  297. package/dist/utility/wrun/wrun-stream-clock.util.d.ts +45 -0
  298. package/dist/utility/wrun/wrun-stream-clock.util.js +108 -0
  299. package/dist/utility/wrun/wrun-style-names.util.d.ts +23 -0
  300. package/dist/utility/wrun/wrun-style-names.util.js +74 -0
  301. package/dist/utility/wrun/wrun-tape-coins.util.d.ts +116 -0
  302. package/dist/utility/wrun/wrun-tape-coins.util.js +110 -0
  303. package/dist/utility/wrun/wrun-tape-source.util.d.ts +62 -32
  304. package/dist/utility/wrun/wrun-tape-source.util.js +72 -34
  305. package/dist/utility/wrun/wrun-tier-grid.util.d.ts +13 -5
  306. package/dist/utility/wrun/wrun-tier-grid.util.js +23 -13
  307. package/dist/utility/wrun/wrun-tpo-rows.util.js +2 -1
  308. package/dist/utility/wrun/wrun-trades-lane.util.d.ts +73 -0
  309. package/dist/utility/wrun/wrun-trades-lane.util.js +82 -0
  310. package/dist/utility/wrun/wrun-twin-compute-inputs.util.d.ts +5 -0
  311. package/dist/utility/wrun/wrun-twin-compute-inputs.util.js +9 -2
  312. package/dist/utility/wrun/wrun-visibility-table.d.ts +13 -0
  313. package/dist/utility/wrun/wrun-visibility-table.js +9 -0
  314. package/dist/utility/wrun/wrun-volume-profile.util.js +7 -3
  315. package/dist/utils/replay/replay-buffer-math.d.ts +16 -6
  316. package/dist/utils/replay/replay-buffer-math.js +60 -30
  317. package/dist/workers/constants/socket-slots.d.ts +11 -7
  318. package/dist/workers/constants/socket-slots.js +6 -5
  319. package/package.json +5 -5
@@ -1,5 +1,6 @@
1
+ import { WRUN_BATCHED_MARKS_KINDS } from './wrun-batched-kinds.leaf.js';
1
2
  import { WRUN_BATCHED_MARKS_CELL_BUDGET } from '../chart/overlay-output-budget.util.js';
2
- import { wrunLegendName } from '../chart/wrun-legend-name.util.js';
3
+ import { wrunStyleTitle } from './wrun-style-names.util.js';
3
4
  import { scheduleWrunCellsCapNotice } from './wrun-cap-notice.util.js';
4
5
  import { forgetWrunCanvasReadout, rememberWrunCanvasReadout } from './wrun-canvas-readout.util.js';
5
6
  import { wrunCanvasMergeLive } from './wrun-canvases.util.js';
@@ -7,22 +8,24 @@ import { decodeWrunPackedColor, isWrunStyleTargetHidden, wrunPaintedDeclarationO
7
8
  import { WRUN_HEATMAP_TRIM_WATERMARK, wrunHeatmapCellShares, wrunHeatmapTrimTarget, } from './wrun-heatmap-cell-budget.util.js';
8
9
  import { resolveWrunColorWord, wrunThemeTokenOfPacked, wrunThemeTokenWord, } from './wrun-style-words.util.js';
9
10
  import { decodeWrunMarkMeta, decodeWrunSpanMeta, isWrunBatchedNumberFormat, WRUN_BATCHED_NUMBER_FORMATS, wrunBatchedReadoutText, wrunMarkUnitValue, } from './wrun-batched-readout.util.js';
10
- export { decodeWrunMarkMeta, decodeWrunSpanMeta, formatWrunBatchedNumber, isWrunBatchedNumberFormat, WRUN_BATCHED_NUMBER_FORMATS, wrunBatchedReadoutText, wrunMarkQtyInUnits, WRUN_MARK_META_MAX_OFFSET_MS, } from './wrun-batched-readout.util.js';
11
+ export { decodeWrunFlagMeta, decodeWrunMarkMeta, decodeWrunSpanMeta, formatWrunBatchedNumber, isWrunBatchedNumberFormat, WRUN_BATCHED_NUMBER_FORMATS, wrunBatchedReadoutText, wrunMarkQtyInUnits, WRUN_MARK_META_MAX_OFFSET_MS, } from './wrun-batched-readout.util.js';
11
12
  // ── The vocabulary ──────────────────────────────────────────────────────────
12
- /** The three kinds, in mount order: each a sheet key, a child id kind and the engine plot type. */
13
- export const WRUN_BATCHED_MARKS_KINDS = Object.freeze(['marks', 'spans', 'rays']);
14
- /** The fields of one record, per kind: marks `[price, qty, meta]`, spans `[top, bottom, length,
13
+ // The four kinds, in mount order (wrun-batched-kinds.leaf, the one list the readers that never load this module read).
14
+ export { isWrunBatchedMarksKind, WRUN_BATCHED_MARKS_KINDS } from './wrun-batched-kinds.leaf.js';
15
+ /** The fields of one record, per kind: marks and flags `[price, qty, meta]`, spans `[top, bottom, length,
15
16
  * meta]`, rays `[y1, y2, length, meta]`. */
16
17
  export const WRUN_BATCHED_STRIDE = Object.freeze({
17
18
  marks: 3,
18
19
  spans: 4,
19
20
  rays: 4,
21
+ flags: 3,
20
22
  });
21
23
  /** One slot's fields in output order, per kind (the kit's WRUN_BATCHED_FIELDS). */
22
24
  export const WRUN_BATCHED_FIELDS = Object.freeze({
23
25
  marks: Object.freeze(['price', 'qty', 'meta']),
24
26
  spans: Object.freeze(['top', 'bottom', 'length', 'meta']),
25
27
  rays: Object.freeze(['y1', 'y2', 'length', 'meta']),
28
+ flags: Object.freeze(['price', 'qty', 'meta']),
26
29
  });
27
30
  /** The kinds that also take the timed layout (the kit's WRUN_BATCHED_TIMED_KINDS). */
28
31
  export const WRUN_BATCHED_TIMED_KINDS = Object.freeze(['spans', 'rays']);
@@ -37,14 +40,18 @@ export const WRUN_BATCHED_TIMED_FIELDS = Object.freeze({
37
40
  /** Where a timed slot holds its start and end (the same two places on spans and rays). */
38
41
  const TIMED_START = WRUN_BATCHED_TIMED_FIELDS.spans.indexOf('start');
39
42
  const TIMED_END = WRUN_BATCHED_TIMED_FIELDS.spans.indexOf('end');
43
+ /** A kind that takes the timed layout: spans or rays. */
44
+ function isTimedKind(kind) {
45
+ return kind === 'spans' || kind === 'rays';
46
+ }
40
47
  /** Whether a section of `kind` at `stride` takes the timed layout: spans or rays at stride 5. */
41
48
  export function isWrunBatchedTimedLayout(kind, stride) {
42
- return kind !== 'marks' && stride === WRUN_BATCHED_TIMED_STRIDE;
49
+ return isTimedKind(kind) && stride === WRUN_BATCHED_TIMED_STRIDE;
43
50
  }
44
51
  /** One slot's fields for a section of `kind` at `stride` (the kit's `wrunBatchedSectionFields`): the
45
52
  * timed fields at stride 5 on spans and rays, WRUN_BATCHED_FIELDS otherwise. */
46
53
  export function wrunBatchedSectionFields(kind, stride) {
47
- return kind !== 'marks' && isWrunBatchedTimedLayout(kind, stride)
54
+ return isTimedKind(kind) && stride === WRUN_BATCHED_TIMED_STRIDE
48
55
  ? WRUN_BATCHED_TIMED_FIELDS[kind]
49
56
  : WRUN_BATCHED_FIELDS[kind];
50
57
  }
@@ -54,21 +61,30 @@ export const WRUN_BATCHED_MAX_SLOTS = 64;
54
61
  export const WRUN_BATCHED_MAX_OUTPUTS = 256;
55
62
  /** A hover template's longest text. */
56
63
  export const WRUN_BATCHED_TOOLTIP_MAX_CHARS = 200;
57
- /** The colours each kind declares (marks: indexed by the record's side, [sell, buy, ...]). */
64
+ /** The chip templates a flags section declares at most (its meta's word is 0..3), and the longest one. */
65
+ export const WRUN_FLAGS_MAX_WORDS = 4;
66
+ export const WRUN_FLAGS_WORD_MAX_CHARS = 32;
67
+ /** A flags section's colours by part (the dark pool round): the chip's fill, its edge (the hairline too) and its
68
+ * text. A list holds at most these three; a part it leaves out takes its default (LOOK_DEFAULTS.flags). */
69
+ export const WRUN_FLAGS_COLOR_PARTS = Object.freeze(['fill', 'edge', 'text']);
70
+ /** The colours each kind declares (marks: indexed by the record's side, [sell, buy, ...]; flags: by part,
71
+ * WRUN_FLAGS_COLOR_PARTS, none to all three). */
58
72
  const COLOR_COUNTS = {
59
73
  marks: [2, 4],
60
74
  spans: [1, 8],
61
75
  rays: [1, 8],
76
+ flags: [0, WRUN_FLAGS_COLOR_PARTS.length],
62
77
  };
63
78
  /**
64
79
  * The look a host applies for a key a section leaves out (the rule settled with the kit): a published
65
80
  * sheet carries every look key (the kit's build writes these into the derived sheet) and a sheet that
66
81
  * still lacks one draws with them instead of refusing; a `null` the sheet holds stays null (a span's
67
- * border: none; a tooltip: no readout). A mirror of the kit's WRUN_MARKS_DEFAULTS, WRUN_SPANS_DEFAULTS
68
- * and WRUN_RAYS_DEFAULTS (indicator-kit `wrun-style/batched.ts`): kit 0.71.0 exports them from kit.js,
69
- * the editor-only entry, not from host.js, the runtime entry, and this module runs on the main thread,
70
- * so the copy stays and wrun-batched-marks.kit-mirror.spec.ts holds it to the installed kit.
71
- * `panel` is not read here: every batched section draws on the price pane.
82
+ * border: none; a tooltip: no readout). A mirror of the kit's WRUN_MARKS_DEFAULTS, WRUN_SPANS_DEFAULTS,
83
+ * WRUN_RAYS_DEFAULTS and WRUN_FLAGS_DEFAULTS (indicator-kit `wrun-style/batched.ts`): kit 0.71.0 exports them
84
+ * from kit.js, the editor-only entry, not from host.js, the runtime entry, and this module runs on the main thread,
85
+ * so the copy stays (its kit-mirror spec was cut on 2026-10-29, so a kit bump that changes a default changes this
86
+ * copy by hand). The flags copy writes the kit's absent `icons` as `[]`: no word leads with an icon. `panel` is not
87
+ * read here: every batched section draws on the price pane.
72
88
  */
73
89
  const LOOK_DEFAULTS = {
74
90
  marks: {
@@ -98,11 +114,18 @@ const LOOK_DEFAULTS = {
98
114
  tooltip: null,
99
115
  panel: 'overlay',
100
116
  },
117
+ flags: {
118
+ words: ['{{qty:compact}}'],
119
+ icons: [],
120
+ max_in_view: 5,
121
+ x: 1,
122
+ size: { law: 'sqrt', unit: 1, scale: 5 },
123
+ /** By part: the chip's fill, its edge and hairline, its text (WRUN_FLAGS_COLOR_PARTS). */
124
+ colors: ['theme.bg', 'theme.muted', 'theme.text'],
125
+ tooltip: null,
126
+ panel: 'overlay',
127
+ },
101
128
  };
102
- const KINDS = new Set(WRUN_BATCHED_MARKS_KINDS);
103
- export function isWrunBatchedMarksKind(kind) {
104
- return typeof kind === 'string' && KINDS.has(kind);
105
- }
106
129
  /** A batched child's id: `<overlayId>::<kind>:<name>`. */
107
130
  export function wrunBatchedChildId(overlayId, kind, name) {
108
131
  return `${overlayId}::${kind}:${name}`;
@@ -122,14 +145,32 @@ export function wrunBatchedBarCells(spec) {
122
145
  function sectionRefusal(sheetId, subject, reason) {
123
146
  return new Error(`WRUN ${sheetId}: ${subject}: ${reason}`);
124
147
  }
148
+ /** A flags section's chip templates and icons (thrown, like a colour count): `words` 1 to 4 texts of at most 32
149
+ * characters (the meta's word is 0..3), `icons` at most one a word (their values are the gate's to judge). Left out,
150
+ * the kit's defaults draw. */
151
+ function flagsSectionRefusal(sheetId, subject, entry) {
152
+ const words = entry.words;
153
+ if (words !== undefined &&
154
+ (!Array.isArray(words) ||
155
+ words.length < 1 ||
156
+ words.length > WRUN_FLAGS_MAX_WORDS ||
157
+ words.some((word) => typeof word !== 'string' || word.length > WRUN_FLAGS_WORD_MAX_CHARS))) {
158
+ throw sectionRefusal(sheetId, subject, `words must hold 1 to ${WRUN_FLAGS_MAX_WORDS} texts of at most ${WRUN_FLAGS_WORD_MAX_CHARS} characters`);
159
+ }
160
+ const icons = entry.icons;
161
+ if (Array.isArray(icons) && icons.length > WRUN_FLAGS_MAX_WORDS) {
162
+ throw sectionRefusal(sheetId, subject, `icons must hold at most ${WRUN_FLAGS_MAX_WORDS} icons, one a word`);
163
+ }
164
+ }
125
165
  /**
126
- * The sheet's batched sections in mount order (marks, spans, rays; each list in its order),
166
+ * The sheet's batched sections in mount order (marks, spans, rays, flags; each list in its order),
127
167
  * validated against the sheet's outputs BY INDEX: `slots` a whole number from 1 to 64, `stride` one
128
- * the gate admits (marks 3; spans and rays 4, or 5 for the timed layout), `first_output` a whole
168
+ * the gate admits (marks and flags 3; spans and rays 4, or 5 for the timed layout), `first_output` a whole
129
169
  * number, and outputs `first_output` through `first_output + slots * stride - 1` declared,
130
170
  * contiguous, data-only (plot ""), inside the 256 a sheet declares and owned by no other section; a
131
171
  * unique name; declared colours the kind takes (left out, the kit's default colours draw); a tooltip
132
- * of at most 200 characters. Anything else refuses the run by name (thrown). A section whose
172
+ * of at most 200 characters; a flags section's `words` 1 to 4 texts of at most 32 characters and its `icons`
173
+ * at most one a word. Anything else refuses the run by name (thrown). A section whose
133
174
  * declaration names a layout newer than this chart (`wrunBatchedLayoutVerdict`: a stride, a key or an
134
175
  * option value it does not know) refuses nothing here: it is read with its reason (`newer`), its
135
176
  * outputs unread, and its child alone is refused at the mount. A section the Style row switched off
@@ -161,6 +202,7 @@ export function readWrunBatchedSections(sheet) {
161
202
  if (names.has(name))
162
203
  throw sectionRefusal(sheetId, subject, 'the name is taken by another batched section');
163
204
  names.add(name);
205
+ const title = wrunStyleTitle(sheet, `${kind}:${name}`, name, entry.label);
164
206
  // A layout newer than this chart (the gate, cached per declaration): its child alone is refused, by
165
207
  // name, at the mount; the rules below are this layout's and never judge a newer one.
166
208
  const newer = wrunBatchedLayoutVerdict(kind, entry);
@@ -172,6 +214,7 @@ export function readWrunBatchedSections(sheet) {
172
214
  firstOutput: 0,
173
215
  stride: WRUN_BATCHED_STRIDE[kind],
174
216
  declaration: entry,
217
+ title,
175
218
  newer,
176
219
  });
177
220
  return;
@@ -207,7 +250,9 @@ export function readWrunBatchedSections(sheet) {
207
250
  const [fewest, most] = COLOR_COUNTS[kind];
208
251
  const colors = entry.colors;
209
252
  if (colors !== undefined && (!Array.isArray(colors) || colors.length < fewest || colors.length > most)) {
210
- throw sectionRefusal(sheetId, subject, `colors must hold ${fewest} to ${most} colours`);
253
+ throw sectionRefusal(sheetId, subject, kind === 'flags'
254
+ ? `colors must hold at most ${most} colours, by part: ${WRUN_FLAGS_COLOR_PARTS.join(', ')}`
255
+ : `colors must hold ${fewest} to ${most} colours`);
211
256
  }
212
257
  const tooltip = entry.tooltip;
213
258
  if (tooltip !== undefined &&
@@ -215,6 +260,8 @@ export function readWrunBatchedSections(sheet) {
215
260
  (typeof tooltip !== 'string' || tooltip.length > WRUN_BATCHED_TOOLTIP_MAX_CHARS)) {
216
261
  throw sectionRefusal(sheetId, subject, `tooltip must be text of at most ${WRUN_BATCHED_TOOLTIP_MAX_CHARS} characters`);
217
262
  }
263
+ if (kind === 'flags')
264
+ flagsSectionRefusal(sheetId, subject, entry);
218
265
  specs.push({
219
266
  kind,
220
267
  name,
@@ -222,6 +269,7 @@ export function readWrunBatchedSections(sheet) {
222
269
  firstOutput: first,
223
270
  stride,
224
271
  declaration: entry,
272
+ title,
225
273
  });
226
274
  });
227
275
  }
@@ -236,9 +284,10 @@ export function wrunSheetHasBatchedMarks(sheet) {
236
284
  function secondsToMs(value) {
237
285
  return Number.isFinite(value) ? Math.round(value * 1000) : value;
238
286
  }
239
- /** Whether a filled slot's meta is one this chart's decoders read (the kit's packers' range). */
287
+ /** Whether a filled slot's meta is one this chart's decoders read (the kit's packers' range): a flags meta packs as
288
+ * a marks meta (`word + 4 * count + 262144 * offset_ms`). */
240
289
  function packedMetaKnown(kind, meta) {
241
- return kind === 'marks' ? decodeWrunMarkMeta(meta) !== null : decodeWrunSpanMeta(meta) !== null;
290
+ return kind === 'marks' || kind === 'flags' ? decodeWrunMarkMeta(meta) !== null : decodeWrunSpanMeta(meta) !== null;
242
291
  }
243
292
  /**
244
293
  * The child rows of a section from the parent's rows `fromIndex` onward, by index: `[ts, ...fields]`,
@@ -308,25 +357,51 @@ function wordIndex(value, words, fallback) {
308
357
  }
309
358
  return wholeIn(value, 0, words.length - 1, fallback);
310
359
  }
311
- /** The marks look words (round-2 fold 1), the numbers canonical; the first contract's words read too. */
312
- const MARK_LOOKS = ['circle', 'dot', 'ring', 'square'];
360
+ /** The marks look words (round-2 fold 1), the numbers canonical; the first contract's words read too, and look 4's
361
+ * word `diamond` (the dark pool round). */
362
+ const MARK_LOOKS = ['circle', 'dot', 'ring', 'square', 'diamond'];
363
+ /** The diamond's index: a look an engine before the dark pool round's draws as another (`wrunBatchedEngineVerdict`). */
364
+ const DIAMOND_LOOK = MARK_LOOKS.indexOf('diamond');
313
365
  const MARK_TEXT_MODES = ['off', 'largest', 'all'];
314
366
  const MARK_X_WORDS = ['bar', 'offset'];
367
+ /** The size laws: sqrt and linear, and log (the dark pool round's, with the `min_px` / `max_px` bounds). */
368
+ const MARK_SIZE_LAWS = ['sqrt', 'linear', 'log'];
315
369
  const LINE_STYLES = new Set(['solid', 'dashed', 'dotted']);
370
+ /** The icon a flag's chip leads with, by index or word (one a word, `icons`). */
371
+ const FLAG_ICONS = ['none', 'dot', 'diamond', 'sprout', 'flame'];
316
372
  // ── The gate: layouts newer than this chart ─────────────────────────────────
373
+ /** A list key's rule: the key holds a list, and every entry is one of `values` (a flags section's `icons`). */
374
+ class WrunBatchedListRule {
375
+ values;
376
+ constructor(values) {
377
+ this.values = values;
378
+ }
379
+ }
317
380
  /** A key's rule in the gate's vocabulary: `ANY` (the reader takes any value, clamping or defaulting
318
- * it), the values an option takes (an index or a word), or a nested object's own vocabulary. */
381
+ * it), the values an option takes (an index or a word), a list of such options, or a nested object's own
382
+ * vocabulary. */
319
383
  const ANY = 'any';
320
- /** The strides this chart reads, per kind: marks 3; spans and rays 4, and 5 (the timed layout). */
384
+ /** The strides this chart reads, per kind: marks and flags 3; spans and rays 4, and 5 (the timed layout). */
321
385
  const KNOWN_STRIDES = {
322
386
  marks: [WRUN_BATCHED_STRIDE.marks],
323
387
  spans: [WRUN_BATCHED_STRIDE.spans, WRUN_BATCHED_TIMED_STRIDE],
324
388
  rays: [WRUN_BATCHED_STRIDE.rays, WRUN_BATCHED_TIMED_STRIDE],
389
+ flags: [WRUN_BATCHED_STRIDE.flags],
325
390
  };
391
+ /** An option's values: its indexes, then its words (what the look readers take). */
392
+ const optionValues = (words) => [...words.keys(), ...words];
326
393
  /** The marks options by index, or by the first contract's words (what the look readers take). */
327
- const MARK_LOOK_VALUES = [0, 1, 2, 3, ...MARK_LOOKS];
328
- const MARK_X_VALUES = [0, 1, ...MARK_X_WORDS];
329
- const MARK_TEXT_MODE_VALUES = [0, 1, 2, ...MARK_TEXT_MODES];
394
+ const MARK_LOOK_VALUES = optionValues(MARK_LOOKS);
395
+ const MARK_X_VALUES = optionValues(MARK_X_WORDS);
396
+ const MARK_TEXT_MODE_VALUES = optionValues(MARK_TEXT_MODES);
397
+ /** The size keys marks and flags read (`min_px` and `max_px` the dark pool round's). */
398
+ const MARK_SIZE_VOCABULARY = {
399
+ law: MARK_SIZE_LAWS,
400
+ unit: ANY,
401
+ scale: ANY,
402
+ min_px: ANY,
403
+ max_px: ANY,
404
+ };
330
405
  /** Every batched section draws on the price pane: a lower-pane section needs a newer chart. */
331
406
  const PANEL_VALUES = ['overlay'];
332
407
  /**
@@ -342,7 +417,7 @@ const SECTION_VOCABULARY = {
342
417
  slots: ANY,
343
418
  first_output: ANY,
344
419
  stride: ANY,
345
- size: { law: ['sqrt', 'linear'], unit: ANY, scale: ANY },
420
+ size: MARK_SIZE_VOCABULARY,
346
421
  opacity_pct: ANY,
347
422
  look: MARK_LOOK_VALUES,
348
423
  text: { mode: MARK_TEXT_MODE_VALUES, field: ['qty'], format: WRUN_BATCHED_NUMBER_FORMATS, min_px: ANY },
@@ -383,6 +458,22 @@ const SECTION_VOCABULARY = {
383
458
  panel: PANEL_VALUES,
384
459
  visible: ANY,
385
460
  },
461
+ flags: {
462
+ name: ANY,
463
+ slots: ANY,
464
+ first_output: ANY,
465
+ stride: ANY,
466
+ words: ANY,
467
+ icons: new WrunBatchedListRule(optionValues(FLAG_ICONS)),
468
+ max_in_view: ANY,
469
+ x: MARK_X_VALUES,
470
+ size: MARK_SIZE_VOCABULARY,
471
+ colors: ANY,
472
+ tooltip: ANY,
473
+ label: ANY,
474
+ panel: PANEL_VALUES,
475
+ visible: ANY,
476
+ },
386
477
  };
387
478
  /** A value as the gate's reasons quote it. */
388
479
  function quotedValue(value) {
@@ -403,6 +494,14 @@ function vocabularyVerdict(kind, vocabulary, value, at) {
403
494
  const rule = vocabulary[key];
404
495
  if (rule === ANY || entry === undefined || entry === null)
405
496
  continue;
497
+ if (rule instanceof WrunBatchedListRule) {
498
+ if (!Array.isArray(entry))
499
+ return `${path} ${quotedValue(entry)} is no ${kind} option this chart reads`;
500
+ const at = entry.findIndex((item) => !rule.values.includes(item));
501
+ if (at !== -1)
502
+ return `${path}[${at}] ${quotedValue(entry[at])} is no ${kind} option this chart reads`;
503
+ continue;
504
+ }
406
505
  if (Array.isArray(rule)) {
407
506
  if (!rule.includes(entry)) {
408
507
  return `${path} ${quotedValue(entry)} is no ${kind} option this chart reads`;
@@ -424,6 +523,7 @@ const layoutVerdicts = {
424
523
  marks: new WeakMap(),
425
524
  spans: new WeakMap(),
426
525
  rays: new WeakMap(),
526
+ flags: new WeakMap(),
427
527
  };
428
528
  /** A section's own stride, keys and option values against the vocabulary (uncached). */
429
529
  function sectionLayoutVerdict(kind, section) {
@@ -434,9 +534,10 @@ function sectionLayoutVerdict(kind, section) {
434
534
  }
435
535
  /**
436
536
  * Why this chart cannot draw a section of `kind` (the gate, round-1 finding 17), null when it can: a
437
- * stride it does not know (marks 3; spans and rays 4, or 5 for the timed layout), a key it does not
537
+ * stride it does not know (marks and flags 3; spans and rays 4, or 5 for the timed layout), a key it does not
438
538
  * know, or an option value it does not know under a known key, nested keys included (`size`, `text`,
439
- * `border`). The section's child is refused by name ("Needs a newer chart") and the Indicator's other
539
+ * `border`) and every entry of a list key (`icons`). The section's child is refused by name ("Needs a newer
540
+ * chart") and the Indicator's other
440
541
  * children run: the next layout change is caught here as the timed one would have been. The reason is
441
542
  * diagnostic text (the notice row's details), never copy. Read once per section (cached).
442
543
  *
@@ -458,34 +559,69 @@ export function wrunBatchedLayoutVerdict(kind, section) {
458
559
  cache.set(section, verdict);
459
560
  return verdict;
460
561
  }
461
- /** A section's words, each a string (the spans and rays `{{word}}` vocabulary, 0..16). */
462
- function wordsOf(value) {
463
- return Array.isArray(value) ? value.slice(0, 16).map((word) => (typeof word === 'string' ? word : '')) : [];
562
+ /** A section's words, each a string (the spans and rays `{{word}}` vocabulary, 0..16; a flags section's chip
563
+ * templates, 1..4). */
564
+ function wordsOf(value, most = 16) {
565
+ return Array.isArray(value) ? value.slice(0, most).map((word) => (typeof word === 'string' ? word : '')) : [];
566
+ }
567
+ /** A flags section's chip templates: its declared words, else the kit's default. */
568
+ function flagWordsOf(section) {
569
+ const words = wordsOf(section.words, WRUN_FLAGS_MAX_WORDS);
570
+ return words.length > 0 ? words : [...LOOK_DEFAULTS.flags.words];
464
571
  }
465
- /** The marks look the engine draws (r6 parity): `look` 0..3 (Bubble, Soft dot, Ring, Square), the
466
- * size law over the quantity (`unit` the Min size, `scale` the Bubble size 1..10), `x` 0..1
572
+ /** The largest diameter the engine draws a mark at (css px): a size bound past it reads as it. */
573
+ const MARK_MAX_PX = 64;
574
+ /** A marks (or flags) size as the engine reads it: the law (one of the three, else the default), the unit (above
575
+ * zero, else the default) and the Bubble size clamped to 1..10; the `min_px` / `max_px` bounds (the dark pool
576
+ * round's, clamped to 1..64 css px) ride only when declared, so a section that declares none hands the engine the
577
+ * size it always did. */
578
+ function markSizeOf(value) {
579
+ const defaults = LOOK_DEFAULTS.marks.size;
580
+ const size = isRecord(value) ? value : {};
581
+ return {
582
+ law: typeof size.law === 'string' && MARK_SIZE_LAWS.includes(size.law)
583
+ ? size.law
584
+ : defaults.law,
585
+ unit: finite(size.unit) && size.unit > 0 ? size.unit : defaults.unit,
586
+ scale: clampTo(size.scale, 1, 10, defaults.scale),
587
+ ...(finite(size.min_px) ? { min_px: clampTo(size.min_px, 1, MARK_MAX_PX, 1) } : {}),
588
+ ...(finite(size.max_px) ? { max_px: clampTo(size.max_px, 1, MARK_MAX_PX, MARK_MAX_PX) } : {}),
589
+ };
590
+ }
591
+ // Titan's size factor (renderers/batchedMarks/data.ts markSizeLawOf, not exported): every diameter scales with k.
592
+ const markSizeK = (scale) => 0.5 + 0.1 * scale;
593
+ /** Titan's largest bubble at a Bubble size (markMaxDiameterCss: min(64, 50k), rounded like a diameter). */
594
+ const markMaxDiameterPx = (scale) => Math.round(Math.min(64, 50 * markSizeK(scale)));
595
+ /** The engine's caption floor: the declared px at the default Bubble size, scaled by k and rounded like a diameter,
596
+ * held to the largest bubble this size draws, so a floor a big trade reaches at one size stays reachable at every
597
+ * size (a declared floor past the default size's cap reads as that cap's bubbles). */
598
+ function markCaptionFloorPx(declaredPx, scale) {
599
+ const scaled = Math.round((declaredPx * markSizeK(scale)) / markSizeK(LOOK_DEFAULTS.marks.size.scale));
600
+ return Math.min(scaled, markMaxDiameterPx(scale));
601
+ }
602
+ /** The marks look the engine draws (r6 parity): `look` 0..4 (Bubble, Soft dot, Ring, Square, Diamond), the
603
+ * size law over the quantity (`unit` the Min size, `scale` the Bubble size 1..10; `log` and the `min_px` /
604
+ * `max_px` bounds when declared, `markSizeOf`), `x` 0..1
467
605
  * (Candle center, Trade time), `opacity_pct` 10..80, the caption (`text.mode` 0 Off, 1 Big
468
- * bubbles, 2 All; its format, a word of the one list, and the smallest bubble that holds one). A key
606
+ * bubbles, 2 All; its format, a word of the one list, and the smallest bubble that holds one: declared
607
+ * at the default Bubble size, handed scaled to this one). A key
469
608
  * left out, or an option that is none of its values (look, x, law, the caption's mode and format),
470
609
  * takes the kit's default (LOOK_DEFAULTS.marks); a number past its range is clamped. The market's
471
610
  * dollar unit (`valuePerUnit`, proven: finite and above zero) rides at the top for the `units`
472
611
  * caption; without one, `units` is handed to the engine as `usd`. */
473
612
  function marksSettings(section, valuePerUnit) {
474
613
  const defaults = LOOK_DEFAULTS.marks;
475
- const size = isRecord(section.size) ? section.size : {};
614
+ const size = markSizeOf(section.size);
476
615
  const text = isRecord(section.text) ? section.text : {};
477
616
  const legacyShape = section.shape;
478
617
  const written = isWrunBatchedNumberFormat(text.format) ? text.format : defaults.text.format;
479
618
  // `units` divides by the market's dollar unit: with none proven it would caption a wrong number, so the engine reads
480
619
  // the same amount in dollars (the hover's rule, wrun-batched-readout.util `wrunMarkQtyInUnits`).
481
620
  const format = written === 'units' && valuePerUnit === undefined ? 'usd' : written;
621
+ const scale = size.scale;
482
622
  return {
483
623
  look: wordIndex(section.look ?? legacyShape, MARK_LOOKS, defaults.look),
484
- size: {
485
- law: size.law === 'linear' || size.law === 'sqrt' ? size.law : defaults.size.law,
486
- unit: finite(size.unit) && size.unit > 0 ? size.unit : defaults.size.unit,
487
- scale: clampTo(size.scale, 1, 10, defaults.size.scale),
488
- },
624
+ size,
489
625
  x: wordIndex(section.x, MARK_X_WORDS, defaults.x),
490
626
  colors: [...(section.colors ?? defaults.colors)],
491
627
  opacity_pct: clampTo(section.opacity_pct, 10, 80, defaults.opacity_pct),
@@ -493,7 +629,7 @@ function marksSettings(section, valuePerUnit) {
493
629
  mode: wordIndex(text.mode, MARK_TEXT_MODES, defaults.text.mode),
494
630
  field: defaults.text.field,
495
631
  format,
496
- min_px: clampTo(text.min_px, 0, 64, defaults.text.min_px),
632
+ min_px: markCaptionFloorPx(clampTo(text.min_px, 0, 64, defaults.text.min_px), scale),
497
633
  },
498
634
  ...(valuePerUnit !== undefined ? { valuePerUnit } : {}),
499
635
  };
@@ -531,6 +667,37 @@ function raysSettings(section) {
531
667
  words: wordsOf(section.words),
532
668
  };
533
669
  }
670
+ /** The flags look the engine draws (the dark pool round): the chip templates (`words`, 1..4, the record's word picks
671
+ * one), each word's icon as a word (`icons`: one of the five, by word or index, `none` past the list), the chips in
672
+ * view at most (`max_in_view`, a whole 1..16), `x` 0..1 (Candle center, Trade time), the size law of the marks the
673
+ * chips point at (`markSizeOf`) and always three colours by part (the chip's fill, its edge and hairline, its text:
674
+ * a part the declared list leaves out takes its default). A key left out takes LOOK_DEFAULTS.flags. */
675
+ function flagsSettings(section) {
676
+ const defaults = LOOK_DEFAULTS.flags;
677
+ const words = flagWordsOf(section);
678
+ const icons = Array.isArray(section.icons) ? section.icons : defaults.icons;
679
+ return {
680
+ words,
681
+ icons: words.map((_word, at) => FLAG_ICONS[wordIndex(icons[at], FLAG_ICONS, 0)]),
682
+ max_in_view: Math.round(clampTo(section.max_in_view, 1, 16, defaults.max_in_view)),
683
+ x: wordIndex(section.x, MARK_X_WORDS, defaults.x),
684
+ size: markSizeOf(section.size),
685
+ colors: defaults.colors.map((fallback, at) => section.colors?.[at] ?? fallback),
686
+ };
687
+ }
688
+ /** A section's look as its kind's engine settings. */
689
+ function lookOf(spec, valuePerUnit) {
690
+ switch (spec.kind) {
691
+ case 'marks':
692
+ return marksSettings(spec.declaration, valuePerUnit);
693
+ case 'spans':
694
+ return spansSettings(spec.declaration);
695
+ case 'rays':
696
+ return raysSettings(spec.declaration);
697
+ case 'flags':
698
+ return flagsSettings(spec.declaration);
699
+ }
700
+ }
534
701
  /** The tooltip a section declares, null when it declares none (absent, null or blank). */
535
702
  function tooltipOf(section) {
536
703
  return typeof section.tooltip === 'string' && section.tooltip.trim() !== '' ? section.tooltip : null;
@@ -539,36 +706,35 @@ function tooltipOf(section) {
539
706
  * here, the child rows start at field 0), the look of its kind, and `hoverReadout` when a tooltip is
540
707
  * declared (the engine registers its drawn records for hover then). Colours stay as declared. A marks
541
708
  * child also carries the market's dollar unit (`valuePerUnit`) when the build hands a proven one; spans
542
- * and rays never do (their records hold no quantity). */
709
+ * and rays never do (their records hold no quantity), nor flags (a chip's templates print no `units`). */
543
710
  export function wrunBatchedSettingsOf(spec, context = {}) {
544
- const look = spec.kind === 'marks'
545
- ? marksSettings(spec.declaration, wrunMarkUnitValue(context.valuePerUnit))
546
- : spec.kind === 'spans'
547
- ? spansSettings(spec.declaration)
548
- : raysSettings(spec.declaration);
711
+ const look = lookOf(spec, wrunMarkUnitValue(context.valuePerUnit));
549
712
  return { slots: spec.slots, stride: spec.stride, ...look, hoverReadout: tooltipOf(spec.declaration) !== null };
550
713
  }
551
714
  /** The readout a section with a tooltip registers at its mount, with the record's text (the template
552
715
  * printed by wrun-batched-readout.util) on it: the child carries the readout it registers, so a
553
716
  * registration from the child alone (the mount's `syncCanvasReadouts` after a pass that failed part
554
- * way) keeps the hover text. A marks readout carries the market's dollar unit its `{{qty:units}}`
555
- * divides by (proven only). */
717
+ * way) keeps the hover text. A marks or flags readout carries the market's dollar unit its `{{qty:units}}`
718
+ * divides by (proven only); a flags readout carries its chip templates as its words (`{{word}}`). */
556
719
  function readoutOf(spec, valuePerUnit) {
557
720
  const tooltip = tooltipOf(spec.declaration);
558
721
  if (tooltip === null)
559
722
  return undefined;
560
- const label = spec.declaration.label;
561
- const words = spec.kind === 'marks' ? [] : wordsOf(spec.declaration.words);
723
+ const words = spec.kind === 'marks'
724
+ ? []
725
+ : spec.kind === 'flags'
726
+ ? flagWordsOf(spec.declaration)
727
+ : wordsOf(spec.declaration.words);
562
728
  const timed = isWrunBatchedTimedLayout(spec.kind, spec.stride);
563
729
  const readout = {
564
730
  kind: spec.kind,
565
- label: typeof label === 'string' && label.trim() !== '' ? label : wrunLegendName(spec.name),
731
+ label: spec.title,
566
732
  tooltip,
567
733
  format: {},
568
734
  ...(words.length > 0 ? { words } : {}),
569
735
  // A timed record's `{{start}}` and `{{end}}` (their display offset is the mount door's to stamp).
570
736
  ...(timed ? { timed: true } : {}),
571
- ...(spec.kind === 'marks' && valuePerUnit !== undefined ? { valuePerUnit } : {}),
737
+ ...((spec.kind === 'marks' || spec.kind === 'flags') && valuePerUnit !== undefined ? { valuePerUnit } : {}),
572
738
  };
573
739
  readout.text = (record, formatters) => wrunBatchedReadoutText(readout, record, formatters);
574
740
  return readout;
@@ -690,20 +856,52 @@ export function resolveWrunBatchedColor(value, theme) {
690
856
  return decodeWrunPackedColor(value);
691
857
  }
692
858
  /** The colour a slot falls back to when its declared one does not resolve: a mark's side (sell the
693
- * theme's down, buy its up), else the accent. */
859
+ * theme's down, buy its up), a flag's part (the fill the background, the edge the muted grey, the text the text),
860
+ * else the accent. */
694
861
  function fallbackColor(kind, at, theme) {
695
862
  if (kind === 'marks')
696
863
  return at === 0 ? theme.down : at === 1 ? theme.up : theme.text;
864
+ if (kind === 'flags')
865
+ return at === 0 ? theme.bg : at === 1 ? theme.muted : theme.text;
697
866
  return theme.accent;
698
867
  }
868
+ // ── The engine: a look the chart reads that an older engine draws as another ─
869
+ /** The plot renderer whose TitanCharts release also draws the marks diamond (look 4), the `log` size law and the
870
+ * size's `min_px` / `max_px` bounds: the dark pool round's one release taught the engine all four (the frozen
871
+ * contract). An engine before it has no `flags` renderer, clamps the look to 0..3 and reads only the sqrt and
872
+ * linear laws, so it would draw another look or size than the declared one, silently. */
873
+ const DIAMOND_ENGINE_PLOT = 'flags';
874
+ /**
875
+ * Why the chart's engine cannot draw a batched child its kind's renderer draws, null when it can: the mount asks it
876
+ * once the engine gate passed the kind (the pack settled and registered, `hasPlotRenderer` the engine's own answer).
877
+ * A marks child whose look needs the dark pool round's engine (look 4, the `log` law, a `min_px` or `max_px` bound)
878
+ * on an engine without that release's `flags` renderer is refused by name ("Needs a newer chart"), as an unknown
879
+ * look is by the layout gate, never drawn as another look. A flags child is never judged here: the gate already
880
+ * asked the engine for its kind. The reason is diagnostic text, never copy.
881
+ */
882
+ export function wrunBatchedEngineVerdict(child, hasPlotRenderer) {
883
+ if (child.kind !== 'marks')
884
+ return null;
885
+ const size = isRecord(child.settings.size) ? child.settings.size : {};
886
+ const needs = child.settings.look === DIAMOND_LOOK
887
+ ? 'look 4 (diamond)'
888
+ : size.law === 'log'
889
+ ? 'size.law "log"'
890
+ : size.min_px !== undefined || size.max_px !== undefined
891
+ ? 'size.min_px or size.max_px'
892
+ : null;
893
+ if (needs === null || hasPlotRenderer(DIAMOND_ENGINE_PLOT))
894
+ return null;
895
+ return `${needs} needs the chart engine that draws ${DIAMOND_ENGINE_PLOT}`;
896
+ }
699
897
  /**
700
898
  * The engine config of a batched child at its mount (and every retranslate): the id, the plot (the
701
899
  * kind), the settings with every colour resolved against the chart's theme, the live merge. A child
702
900
  * with a readout registers it for the hover inspector as the child carries it (its template's text
703
901
  * as `text`); one without forgets any it had. A timed readout first takes the display offset its
704
- * `{{start}}` and `{{end}}` print in (`timeOffsetMs`: the chart's display timezone, none on daily and
705
- * longer bars), stamped on the child's own readout so every registration of it keeps it; a timezone
706
- * switch retranslates, which stamps it again.
902
+ * `{{start}}` and `{{end}}` print in (`timeOffsetMs`: the chart's display timezone, a fixed shift or the
903
+ * shift at each instant, none on daily and longer bars), stamped on the child's own readout so every
904
+ * registration of it keeps it; a timezone switch retranslates, which stamps it again.
707
905
  */
708
906
  export function wrunBatchedChildConfig(child, ctx) {
709
907
  const id = wrunBatchedChildId(ctx.overlayId, child.kind, child.name);