@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.
- package/README.md +2 -0
- package/dist/constants/feature-flags.constants.d.ts +15 -1
- package/dist/constants/feature-flags.constants.js +130 -24
- package/dist/constants/governed-exchanges.constants.d.ts +12 -0
- package/dist/constants/governed-exchanges.constants.js +16 -0
- package/dist/constants/opra-compliance.constants.d.ts +3 -2
- package/dist/constants/opra-compliance.constants.js +3 -2
- package/dist/constants/option-venues.constants.d.ts +2 -2
- package/dist/constants/scriptEditor/builtin-script-snippets.d.ts +26 -0
- package/dist/constants/scriptEditor/builtin-script-snippets.js +6 -0
- package/dist/constants/scriptEditor/technicalIndicatorScriptKeys.constants.d.ts +15 -0
- package/dist/constants/scriptEditor/technicalIndicatorScriptKeys.constants.js +17 -0
- package/dist/constants/venue-presets.constants.d.ts +20 -20
- package/dist/constants/venue-presets.constants.js +24 -26
- package/dist/host-env.d.ts +21 -5
- package/dist/host-env.js +6 -0
- package/dist/host-ports.types.d.ts +102 -19
- package/dist/index.d.ts +18 -0
- package/dist/index.js +18 -0
- package/dist/interfaces/cancel-reason.interface.d.ts +1 -1
- package/dist/interfaces/cme-realtime.interface.d.ts +16 -9
- package/dist/interfaces/cme-realtime.interface.js +6 -3
- package/dist/interfaces/kscript-diagnostics.interface.d.ts +12 -0
- package/dist/interfaces/opra-realtime.interface.d.ts +1 -5
- package/dist/interfaces/prediction-market.interface.d.ts +7 -0
- package/dist/interfaces/replay.interface.d.ts +8 -0
- package/dist/interfaces/stocks-realtime.interface.d.ts +57 -0
- package/dist/interfaces/stocks-realtime.interface.js +32 -0
- package/dist/interfaces/wrun-runtime.interface.d.ts +18 -2
- package/dist/kscript-data/controls/live-trades-merge.util.d.ts +62 -94
- package/dist/kscript-data/controls/live-trades-merge.util.js +106 -171
- package/dist/market-data/billing.interface.d.ts +174 -36
- package/dist/market-data/billing.interface.js +58 -8
- package/dist/market-data/venue.d.ts +152 -7
- package/dist/market-data/venues/cme.contract.copy.json +66 -0
- package/dist/market-data/venues/cme.d.ts +126 -0
- package/dist/market-data/venues/cme.js +133 -0
- package/dist/market-data/venues/index.d.ts +294 -7
- package/dist/market-data/venues/index.js +49 -6
- package/dist/market-data/venues/opra.contract.copy.json +3 -2
- package/dist/market-data/venues/opra.d.ts +2 -2
- package/dist/market-data/venues/opra.js +5 -2
- package/dist/market-data/venues/stocks.contract.copy.json +64 -0
- package/dist/market-data/venues/stocks.d.ts +130 -0
- package/dist/market-data/venues/stocks.js +117 -0
- package/dist/settings-templates/footprint-rows.js +35 -2
- package/dist/settings-templates/form-rows.d.ts +2 -1
- package/dist/settings-templates/index.js +7 -3
- package/dist/settings-templates/indicator-fields.d.ts +5 -4
- package/dist/settings-templates/indicator-fields.js +79 -10
- package/dist/settings-templates/tool-rules.d.ts +32 -15
- package/dist/settings-templates/tool-rules.js +33 -11
- package/dist/settings-templates/tool-tables.generated.js +95 -31
- package/dist/utility/chart/book-live-bucket.util.d.ts +15 -0
- package/dist/utility/chart/book-live-bucket.util.js +47 -0
- package/dist/utility/chart/cme-cache-context.util.d.ts +5 -3
- package/dist/utility/chart/cme-cache-context.util.js +10 -6
- package/dist/utility/chart/cme-realtime.util.js +10 -0
- package/dist/utility/chart/cme-user-scripts-gate.util.d.ts +83 -0
- package/dist/utility/chart/cme-user-scripts-gate.util.js +142 -0
- package/dist/utility/chart/effective-chart-session.util.d.ts +14 -0
- package/dist/utility/chart/effective-chart-session.util.js +39 -0
- package/dist/utility/chart/host-bar-placement.util.d.ts +28 -0
- package/dist/utility/chart/host-bar-placement.util.js +170 -30
- package/dist/utility/chart/index-host-tier.util.d.ts +3 -1
- package/dist/utility/chart/index-host-tier.util.js +7 -2
- package/dist/utility/chart/index-mode-admission.util.js +30 -3
- package/dist/utility/chart/kscript-apply-fingerprint.util.js +1 -1
- package/dist/utility/chart/kscript-drawing-safe-area.util.d.ts +35 -11
- package/dist/utility/chart/kscript-drawing-safe-area.util.js +145 -35
- package/dist/utility/chart/kscript-live-coalesce.util.d.ts +9 -7
- package/dist/utility/chart/kscript-live-coalesce.util.js +13 -8
- package/dist/utility/chart/kscript-live-source-identity.util.d.ts +9 -0
- package/dist/utility/chart/kscript-live-source-identity.util.js +10 -1
- package/dist/utility/chart/kscript-provenance-keys.util.js +13 -0
- package/dist/utility/chart/kscript-standin-identity.leaf.d.ts +5 -1
- package/dist/utility/chart/kscript-titancharts-render-keys.constants.d.ts +32 -2
- package/dist/utility/chart/kscript-titancharts-render-keys.constants.js +45 -0
- package/dist/utility/chart/kscript-venue-policy.util.d.ts +156 -43
- package/dist/utility/chart/kscript-venue-policy.util.js +249 -59
- package/dist/utility/chart/live-bucket.util.d.ts +24 -8
- package/dist/utility/chart/live-bucket.util.js +85 -27
- package/dist/utility/chart/market-session-schedule.util.d.ts +10 -0
- package/dist/utility/chart/market-session-schedule.util.js +16 -0
- package/dist/utility/chart/marketKind.util.js +5 -0
- package/dist/utility/chart/mixed-mode.util.d.ts +7 -0
- package/dist/utility/chart/mixed-mode.util.js +14 -0
- package/dist/utility/chart/opra-read-access.leaf.d.ts +5 -3
- package/dist/utility/chart/opra-read-access.leaf.js +5 -3
- package/dist/utility/chart/opra-user-scripts-gate.util.d.ts +11 -16
- package/dist/utility/chart/opra-user-scripts-gate.util.js +12 -28
- package/dist/utility/chart/rth-session.util.d.ts +12 -10
- package/dist/utility/chart/rth-session.util.js +25 -21
- package/dist/utility/chart/trading-day.util.d.ts +17 -0
- package/dist/utility/chart/trading-day.util.js +59 -0
- package/dist/utility/chart/window-geometry.leaf.d.ts +8 -0
- package/dist/utility/chart/window-geometry.leaf.js +22 -6
- package/dist/utility/chart/window-owner.leaf.d.ts +23 -2
- package/dist/utility/chart/window-owner.leaf.js +45 -3
- package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +33 -15
- package/dist/utility/chart/wrun-bar-session-facts.util.js +70 -20
- package/dist/utility/chart/wrun-run-result.util.d.ts +12 -0
- package/dist/utility/chart/wrun-run-result.util.js +141 -6
- package/dist/utility/intl-locale.util.js +5 -0
- package/dist/utility/options/option-bar-anchor.util.d.ts +145 -0
- package/dist/utility/options/option-bar-anchor.util.js +340 -0
- package/dist/utility/options/option-venue.util.d.ts +18 -0
- package/dist/utility/options/option-venue.util.js +27 -0
- package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.js +4 -0
- package/dist/utility/v2/gate-plane.util.d.ts +12 -3
- package/dist/utility/v2/gate-plane.util.js +30 -4
- package/dist/utility/v2/gate-session-latch.util.js +1 -1
- package/dist/utility/v2/stocks-governed.util.d.ts +16 -0
- package/dist/utility/v2/stocks-governed.util.js +34 -0
- package/dist/utility/wrun/derived-roots.leaf.d.ts +13 -0
- package/dist/utility/wrun/derived-roots.leaf.js +27 -0
- package/dist/utility/wrun/derived-roots.util.d.ts +205 -0
- package/dist/utility/wrun/derived-roots.util.js +451 -0
- package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.d.ts +43 -7
- package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.js +89 -19
- package/dist/utility/wrun/run-schedule/wrun-gate-reader-warm.util.d.ts +9 -4
- package/dist/utility/wrun/run-schedule/wrun-gate-reader-warm.util.js +47 -6
- package/dist/utility/wrun/run-schedule/wrun-late-reads.util.d.ts +4 -2
- package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +4 -2
- package/dist/utility/wrun/run-schedule/wrun-own-candles.util.d.ts +24 -3
- package/dist/utility/wrun/run-schedule/wrun-own-candles.util.js +46 -10
- package/dist/utility/wrun/sources/lanes/option_daily.js +5 -2
- package/dist/utility/wrun/sources/lanes/options_flow.js +5 -2
- package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +64 -19
- package/dist/utility/wrun/sources/opra-option-lanes.util.js +105 -35
- package/dist/utility/wrun/sources/row-lanes/option_contract_flow.js +2 -1
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +2 -1
- package/dist/utility/wrun/sources/row-lanes/option_prints.d.ts +3 -0
- package/dist/utility/wrun/sources/row-lanes/option_prints.js +19 -4
- package/dist/utility/wrun/sources/row-lanes/option_strike_flow.js +17 -4
- package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +52 -13
- package/dist/utility/wrun/sources/row-lanes/option_strikes.js +88 -19
- package/dist/utility/wrun/sources/row-lanes/option_surface.js +2 -1
- package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +19 -0
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +24 -9
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +41 -10
- package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.d.ts +111 -0
- package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.js +133 -0
- package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.d.ts +15 -3
- package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.js +22 -3
- package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +31 -0
- package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +197 -13
- package/dist/utility/wrun/sources/wrun-row-lanes.util.js +761 -27
- package/dist/utility/wrun/wrun-browser-sources.leaf.js +1 -2
- package/dist/utility/wrun/wrun-builtin-twin.util.d.ts +12 -0
- package/dist/utility/wrun/wrun-builtin-twin.util.js +21 -0
- package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +60 -16
- package/dist/utility/wrun/wrun-chart-market-facts.util.js +113 -61
- package/dist/utility/wrun/wrun-color-settings.util.d.ts +9 -0
- package/dist/utility/wrun/wrun-color-settings.util.js +33 -0
- package/dist/utility/wrun/wrun-download-meter.util.d.ts +15 -0
- package/dist/utility/wrun/wrun-download-meter.util.js +14 -2
- package/dist/utility/wrun/wrun-download-plan.util.d.ts +99 -0
- package/dist/utility/wrun/wrun-download-plan.util.js +118 -0
- package/dist/utility/wrun/wrun-draft-legend-note.util.d.ts +11 -3
- package/dist/utility/wrun/wrun-draft-legend-note.util.js +26 -4
- package/dist/utility/wrun/wrun-frames.d.ts +27 -6
- package/dist/utility/wrun/wrun-frames.js +73 -10
- package/dist/utility/wrun/wrun-handles.util.d.ts +7 -3
- package/dist/utility/wrun/wrun-handles.util.js +9 -8
- package/dist/utility/wrun/wrun-hosted-wire.util.d.ts +7 -1
- package/dist/utility/wrun/wrun-hosted-wire.util.js +12 -2
- package/dist/utility/wrun/wrun-hud-looks.util.d.ts +18 -4
- package/dist/utility/wrun/wrun-hud-looks.util.js +45 -13
- package/dist/utility/wrun/wrun-input-requirements.leaf.d.ts +68 -0
- package/dist/utility/wrun/wrun-input-requirements.leaf.js +163 -7
- package/dist/utility/wrun/wrun-latest-snapshot.d.ts +11 -0
- package/dist/utility/wrun/wrun-leg-close.util.d.ts +59 -23
- package/dist/utility/wrun/wrun-leg-close.util.js +186 -28
- package/dist/utility/wrun/wrun-live-intake.util.d.ts +35 -15
- package/dist/utility/wrun/wrun-live-intake.util.js +243 -126
- package/dist/utility/wrun/wrun-live-tick.util.d.ts +13 -5
- package/dist/utility/wrun/wrun-live-tick.util.js +279 -99
- package/dist/utility/wrun/wrun-market-facts.util.d.ts +13 -3
- package/dist/utility/wrun/wrun-market-facts.util.js +13 -3
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +60 -11
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +70 -5
- package/dist/utility/wrun/wrun-market-size-defaults.util.js +31 -5
- package/dist/utility/wrun/wrun-opra-lane.util.d.ts +17 -4
- package/dist/utility/wrun/wrun-opra-lane.util.js +6 -4
- package/dist/utility/wrun/wrun-option-book-rows.util.d.ts +56 -0
- package/dist/utility/wrun/wrun-option-book-rows.util.js +96 -0
- package/dist/utility/wrun/wrun-option-strike-flow-forecast.util.d.ts +31 -0
- package/dist/utility/wrun/wrun-option-strike-flow-forecast.util.js +119 -0
- package/dist/utility/wrun/wrun-option-strike-flow-lane.util.d.ts +23 -6
- package/dist/utility/wrun/wrun-option-strike-flow-lane.util.js +47 -11
- package/dist/utility/wrun/wrun-option-strike-flow.util.d.ts +86 -19
- package/dist/utility/wrun/wrun-option-strike-flow.util.js +168 -62
- package/dist/utility/wrun/wrun-option-views.util.d.ts +323 -28
- package/dist/utility/wrun/wrun-option-views.util.js +484 -71
- package/dist/utility/wrun/wrun-options-chain.util.d.ts +3 -3
- package/dist/utility/wrun/wrun-options-chain.util.js +2 -0
- package/dist/utility/wrun/wrun-output-style.util.d.ts +6 -2
- package/dist/utility/wrun/wrun-output-style.util.js +20 -2
- package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +32 -2
- package/dist/utility/wrun/wrun-overlay-drivers.util.js +13 -3
- package/dist/utility/wrun/wrun-overlay-lifecycle.util.d.ts +10 -1
- package/dist/utility/wrun/wrun-overlay-lifecycle.util.js +52 -4
- package/dist/utility/wrun/wrun-overlay-recovery.util.js +3 -1
- package/dist/utility/wrun/wrun-overlay-run.util.d.ts +160 -42
- package/dist/utility/wrun/wrun-overlay-run.util.js +1244 -209
- package/dist/utility/wrun/wrun-pane-format.util.d.ts +2 -1
- package/dist/utility/wrun/wrun-pane-format.util.js +7 -3
- package/dist/utility/wrun/wrun-panel-mount.util.d.ts +9 -0
- package/dist/utility/wrun/wrun-panel-mount.util.js +114 -19
- package/dist/utility/wrun/wrun-panel-style.util.d.ts +10 -9
- package/dist/utility/wrun/wrun-panel-style.util.js +58 -9
- package/dist/utility/wrun/wrun-param-map.util.d.ts +14 -11
- package/dist/utility/wrun/wrun-param-map.util.js +10 -5
- package/dist/utility/wrun/wrun-param-values.util.d.ts +14 -4
- package/dist/utility/wrun/wrun-param-values.util.js +4 -0
- package/dist/utility/wrun/wrun-pin-spelling.util.d.ts +15 -2
- package/dist/utility/wrun/wrun-pin-spelling.util.js +39 -14
- package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +50 -0
- package/dist/utility/wrun/wrun-refusal-surface.util.js +68 -0
- package/dist/utility/wrun/wrun-refusal.util.d.ts +3 -2
- package/dist/utility/wrun/wrun-refusal.util.js +22 -0
- package/dist/utility/wrun/wrun-refused-latest.util.d.ts +10 -0
- package/dist/utility/wrun/wrun-refused-latest.util.js +12 -0
- package/dist/utility/wrun/wrun-registry-errors.util.d.ts +26 -0
- package/dist/utility/wrun/wrun-registry-errors.util.js +34 -0
- package/dist/utility/wrun/wrun-replay-lane.util.js +3 -2
- package/dist/utility/wrun/wrun-row-source.d.ts +11 -0
- package/dist/utility/wrun/wrun-run-interval-session.util.d.ts +20 -6
- package/dist/utility/wrun/wrun-run-interval-session.util.js +22 -7
- package/dist/utility/wrun/wrun-run-interval.util.d.ts +43 -9
- package/dist/utility/wrun/wrun-run-interval.util.js +58 -15
- package/dist/utility/wrun/wrun-script-inputs.util.d.ts +45 -1
- package/dist/utility/wrun/wrun-script-inputs.util.js +112 -4
- package/dist/utility/wrun/wrun-setting-words.util.d.ts +7 -3
- package/dist/utility/wrun/wrun-setting-words.util.js +13 -5
- package/dist/utility/wrun/wrun-socket-row-source.d.ts +27 -2
- package/dist/utility/wrun/wrun-socket-row-source.js +118 -8
- package/dist/utility/wrun/wrun-source-rows.util.d.ts +29 -18
- package/dist/utility/wrun/wrun-source-rows.util.js +61 -27
- package/dist/utility/wrun/wrun-style-words.util.js +6 -4
- package/dist/utility/wrun/wrun-table-chrome.util.d.ts +3 -2
- package/dist/utility/wrun/wrun-table-chrome.util.js +19 -11
- package/dist/utility/wrun/wrun-tape-per-order.util.d.ts +2 -0
- package/dist/utility/wrun/wrun-tape-per-order.util.js +7 -0
- package/dist/utility/wrun/wrun-tape-source.util.d.ts +17 -9
- package/dist/utility/wrun/wrun-tape-source.util.js +20 -12
- package/dist/utils/replay/replay-buffer-math.d.ts +53 -2
- package/dist/utils/replay/replay-buffer-math.js +227 -20
- package/dist/workers/constants/socket-slots.d.ts +91 -6
- package/dist/workers/constants/socket-slots.js +85 -6
- package/package.json +5 -5
|
@@ -63,6 +63,14 @@ export interface LegendPane {
|
|
|
63
63
|
}
|
|
64
64
|
export declare function legendPaneOf(tc: LegendSafeAreaChart): LegendPane | null;
|
|
65
65
|
export declare function legendRowsOf(pane: LegendPane): Element[];
|
|
66
|
+
/**
|
|
67
|
+
* Registers on `observer` what moves a host row of the legend without resizing one, for every tracker that measures
|
|
68
|
+
* the legend (this door, the wrun table chrome): the rows come and go as the cell's children (the quick-trade pill
|
|
69
|
+
* mounts with a wallet), and a row placed by its inline style moves with it (the pill rides `top`, a frame after the
|
|
70
|
+
* legend's rows change). `cell` adds the tracker's own options for the cell, since a second `observe` of one target
|
|
71
|
+
* replaces the first. Call it again after the rows change, so a row that just mounted is watched too.
|
|
72
|
+
*/
|
|
73
|
+
export declare function observeLegendHostRows(observer: MutationObserver, pane: LegendPane, cell?: MutationObserverInit): void;
|
|
66
74
|
export declare function measureLegendBox(pane: LegendPane): LegendBox | null;
|
|
67
75
|
/**
|
|
68
76
|
* One fresh measure of the chart's pane chrome (DW06): the price pane's
|
|
@@ -80,16 +88,32 @@ export declare function measureChartChromeSafeArea(tc: LegendSafeAreaChart): Cha
|
|
|
80
88
|
*/
|
|
81
89
|
export declare function watchChartChromeSafeArea(tc: LegendSafeAreaChart, listener: ChartChromeSafeAreaListener): () => void;
|
|
82
90
|
/**
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
91
|
+
* Keeps the chart's chrome tracker running for `holderId`, a record the chart
|
|
92
|
+
* holds that the engine places by the chrome without a drawing here (DW06):
|
|
93
|
+
* the tracker starts (and hands every measured pane's insets to the engine)
|
|
94
|
+
* on the chart's first hold, listener or tracked set, and pushes again as the
|
|
95
|
+
* chrome moves. A second hold of the same id is no change.
|
|
96
|
+
*/
|
|
97
|
+
export declare function holdChartChromeSafeArea(tc: LegendSafeAreaChart, holderId: string): void;
|
|
98
|
+
/**
|
|
99
|
+
* Lets go of `holderId`'s hold (none held: no change). The chart's last hold,
|
|
100
|
+
* listener and tracked set gone, the tracker stops and the engine's insets go
|
|
101
|
+
* back to null.
|
|
102
|
+
*/
|
|
103
|
+
export declare function releaseChartChromeSafeArea(tc: LegendSafeAreaChart, holderId: string): void;
|
|
104
|
+
/**
|
|
105
|
+
* The set to hand `updateDrawings`: each top group (`top_left`,
|
|
106
|
+
* `top_center`, `top_right`) moved under the chart's legend when they meet, a
|
|
107
|
+
* stacking overlay's corner groups moved clear of the earlier groups at the
|
|
108
|
+
* same corner, `safeArea` handles stepped past the axis tags and the action
|
|
109
|
+
* bar, and plain `top_right` / `top_center` groups dropped under their pane's
|
|
110
|
+
* button strip (the deeper line when the legend reaches them too). Every
|
|
111
|
+
* push of an overlay's drawings goes through here (a full apply, a
|
|
112
|
+
* replay-lane reveal, a clear), so the tracker always holds the mounted set of
|
|
113
|
+
* each overlay that owns a corner group, a handle under a button strip or a
|
|
114
|
+
* `safeArea` record (a card's insets ride the engine door) and can re-mount it
|
|
115
|
+
* when the chrome or an earlier group changes; a set without one (the clear
|
|
116
|
+
* included) drops the overlay from the tracker, and the overlays stacked on it
|
|
117
|
+
* follow.
|
|
94
118
|
*/
|
|
95
119
|
export declare function mountWithLegendSafeArea(tc: LegendSafeAreaChart, overlayId: string, drawings: unknown[]): unknown[];
|
|
@@ -5,13 +5,21 @@
|
|
|
5
5
|
* in CSS pixels from the plot's top-left corner, exactly where the chart's own
|
|
6
6
|
* legend stack lives: the symbol row, the OHLC row, Vol, the "N indicators"
|
|
7
7
|
* summary and one row per indicator (about 145 px tall with one indicator,
|
|
8
|
-
* growing with each)
|
|
8
|
+
* growing with each), and under the last row the quick-trade pill while it
|
|
9
|
+
* shows. TitanCharts resolves pane anchors with no inset
|
|
9
10
|
* (`paneAnchorOffset`), so the adapter shifts the overlay's `top_left` group
|
|
10
11
|
* below the legend when the two boxes intersect, at the door to
|
|
11
12
|
* `updateDrawings`. The remembered records keep the author's coordinates, so
|
|
12
13
|
* a re-apply never stacks a second shift, and the whole group moves by one
|
|
13
14
|
* amount, so the HUD's own layout is untouched. The legend is watched
|
|
14
|
-
* (rows resize, rows come and go) and the mounted set
|
|
15
|
+
* (rows resize, rows come and go, a host row moves) and the mounted set
|
|
16
|
+
* follows it.
|
|
17
|
+
*
|
|
18
|
+
* One rule holds for the three top anchors (OPRA QA 2026-10-22: a recipe's
|
|
19
|
+
* `top_center` caption drew behind the chart title): a `top_center` or
|
|
20
|
+
* `top_right` group whose box meets the legend's moves under it the same way,
|
|
21
|
+
* its box placed in the plot by the plot's width; a group clear of the legend
|
|
22
|
+
* keeps its place.
|
|
15
23
|
*
|
|
16
24
|
* The same door measures the rest of the pane chrome (DW06): the pane action
|
|
17
25
|
* bar and the compare strip along the top right, the price-axis tags along
|
|
@@ -23,6 +31,14 @@
|
|
|
23
31
|
* step under the pane's buttons. The HUD layer reads the same measure
|
|
24
32
|
* (`hudTopLeft`) for its top-left inset.
|
|
25
33
|
*
|
|
34
|
+
* The engine reads those insets for records with no drawing here too (the
|
|
35
|
+
* docked price matrix seats its title and header under them, a note label
|
|
36
|
+
* flagged for the chrome shifts by them), so a chart that holds a wrun record
|
|
37
|
+
* keeps the tracker running while the record stands
|
|
38
|
+
* (`holdChartChromeSafeArea`, from the wrun lifecycle door): one tracker per
|
|
39
|
+
* chart serves the mounted sets, the listeners and the holds, and the insets
|
|
40
|
+
* go back to null once the last of them lets go.
|
|
41
|
+
*
|
|
26
42
|
* A notice or label that did not opt in clears the buttons too (template QA
|
|
27
43
|
* A17, B10): on a pane with a measured button strip (the price pane's action
|
|
28
44
|
* bar, a lower pane's move buttons), a plain `top_right` or `top_center` group
|
|
@@ -61,6 +77,9 @@ const ACTION_BAR_SELECTOR = '.chart-pane-action-bar';
|
|
|
61
77
|
/** An offchart pane's button strip: titan's move buttons, top right of the pane's legend section (only while the pane can move). */
|
|
62
78
|
const PANE_CONTROLS_SELECTOR = '.titan-charts-pane-controls';
|
|
63
79
|
const LEGEND_ANCHOR = 'top_left';
|
|
80
|
+
/** The anchors whose y counts down from the plot's top edge, where the legend stack sits: one rule moves each one's
|
|
81
|
+
* group under the legend when the two boxes meet. */
|
|
82
|
+
const TOP_ANCHORS = new Set(['top_left', 'top_center', 'top_right']);
|
|
64
83
|
/** The corners a stacking overlay's groups stack at (DW35). */
|
|
65
84
|
const STACK_CORNERS = new Set([
|
|
66
85
|
'top_left',
|
|
@@ -82,11 +101,14 @@ const LABEL_LINE_EM = 1.4;
|
|
|
82
101
|
const LABEL_PAD_PX = 4;
|
|
83
102
|
const DEFAULT_LABEL_SIZE = 12;
|
|
84
103
|
// The pane's top-left stack. Host rows are children of the tc-container (the
|
|
85
|
-
// symbol row, the prediction-venue rows
|
|
104
|
+
// symbol row, the prediction-venue rows, and the quick-trade pill's anchor,
|
|
105
|
+
// HLQuickTradePill's root, which seats itself one gap under the legend's last
|
|
106
|
+
// row on a Hyperliquid pane with a wallet: measured without it, a top-left seat
|
|
107
|
+
// landed on the pill's chips, OPRA QA 2026-10-22); titan's rows live in the main
|
|
86
108
|
// section's legend section (`.titan-charts-legend-area` per plotted overlay,
|
|
87
109
|
// the "N indicators" summary's indicator). All are content-sized, and hover
|
|
88
110
|
// fades them by opacity, so the measured box holds still under the pointer.
|
|
89
|
-
const HOST_ROW_SELECTOR = '.symbol-interval-row, .polymarket-row-1, .polymarket-row-2, .polymarket-row-3';
|
|
111
|
+
const HOST_ROW_SELECTOR = '.symbol-interval-row, .polymarket-row-1, .polymarket-row-2, .polymarket-row-3, .hlqt-anchor';
|
|
90
112
|
const PLOT_SELECTOR = '.titan-charts-main-section .titan-charts-legend-section';
|
|
91
113
|
const TITAN_ROW_SELECTOR = '.titan-charts-legend-area, .titan-charts-legend-collapse-indicator';
|
|
92
114
|
const SECTION_PREFIX = '.titan-charts-';
|
|
@@ -186,7 +208,8 @@ function cornerGroups(drawings) {
|
|
|
186
208
|
}
|
|
187
209
|
return groups;
|
|
188
210
|
}
|
|
189
|
-
/** How far down a
|
|
211
|
+
/** How far down a top group (its box in plot px) must move to sit one gap under the legend: 0 when the two boxes do
|
|
212
|
+
* not meet. */
|
|
190
213
|
function legendShiftOf(group, legend) {
|
|
191
214
|
if (!group || !legend)
|
|
192
215
|
return 0;
|
|
@@ -198,6 +221,52 @@ function legendShiftOf(group, legend) {
|
|
|
198
221
|
return 0;
|
|
199
222
|
return Math.max(0, Math.round(legend.bottom + LEGEND_SAFE_AREA_GAP_PX - group.top));
|
|
200
223
|
}
|
|
224
|
+
/**
|
|
225
|
+
* A top-anchored member's box in plot px (origin: the plot's top-left corner, where the legend is measured), `width`
|
|
226
|
+
* the plot's. Titan resolves a centre anchor's x from the plot's middle and a right anchor's inward from its right
|
|
227
|
+
* edge, then runs a label's text from that point the way its `align` says: a right label's point mirrors, its text
|
|
228
|
+
* does not.
|
|
229
|
+
*/
|
|
230
|
+
function plotBoundsOf(member, width) {
|
|
231
|
+
const bounds = memberBounds(member.kind, member.props, false);
|
|
232
|
+
if (!bounds || member.anchor === LEGEND_ANCHOR)
|
|
233
|
+
return bounds;
|
|
234
|
+
if (member.anchor === 'top_center')
|
|
235
|
+
return { ...bounds, left: bounds.left + width / 2, right: bounds.right + width / 2 };
|
|
236
|
+
const { x } = member.props;
|
|
237
|
+
if (member.kind === 'label' && finite(x)) {
|
|
238
|
+
const offset = width - 2 * x;
|
|
239
|
+
return { ...bounds, left: bounds.left + offset, right: bounds.right + offset };
|
|
240
|
+
}
|
|
241
|
+
return { ...bounds, left: width - bounds.right, right: width - bounds.left };
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Per top anchor of the price pane, how far down the set's group there moves to sit one gap under the legend; an
|
|
245
|
+
* anchor whose group the legend does not meet is left out. A centre or right group needs the plot's width to stand
|
|
246
|
+
* where the legend is measured, so without a measured plot only the `top_left` group moves.
|
|
247
|
+
*/
|
|
248
|
+
function legendDropsOf(drawings, legend, plot) {
|
|
249
|
+
const drops = new Map();
|
|
250
|
+
if (!legend)
|
|
251
|
+
return drops;
|
|
252
|
+
const groups = new Map();
|
|
253
|
+
for (const drawing of drawings) {
|
|
254
|
+
const member = memberOf(drawing);
|
|
255
|
+
if (!member || member.pane !== 'onchart' || !TOP_ANCHORS.has(member.anchor))
|
|
256
|
+
continue;
|
|
257
|
+
if (!plot && member.anchor !== LEGEND_ANCHOR)
|
|
258
|
+
continue;
|
|
259
|
+
const bounds = plotBoundsOf(member, plot?.width ?? 0);
|
|
260
|
+
if (bounds)
|
|
261
|
+
groups.set(member.anchor, union(groups.get(member.anchor) ?? null, bounds));
|
|
262
|
+
}
|
|
263
|
+
for (const [anchor, group] of groups) {
|
|
264
|
+
const drop = legendShiftOf(group, legend);
|
|
265
|
+
if (drop > 0)
|
|
266
|
+
drops.set(anchor, drop);
|
|
267
|
+
}
|
|
268
|
+
return drops;
|
|
269
|
+
}
|
|
201
270
|
/** The room (CSS px) a group has before its far edge leaves the pane, never negative. */
|
|
202
271
|
function roomPast(far, size) {
|
|
203
272
|
return Math.max(0, Math.floor(size - far));
|
|
@@ -225,23 +294,21 @@ function shiftClassOf(member) {
|
|
|
225
294
|
return `${member.pane}|${member.anchor}|${member.props.safeArea === true ? 'safe' : 'plain'}`;
|
|
226
295
|
}
|
|
227
296
|
/**
|
|
228
|
-
* A class's shift before the cap: the
|
|
229
|
-
* price-pane corner group, the inset steps of a safeArea handle, and for a
|
|
297
|
+
* A class's shift before the cap: the inset steps of a safeArea handle, for a
|
|
230
298
|
* plain top_right / top_center class the drop that puts its top on the pane's
|
|
231
|
-
* strip line (A17)
|
|
232
|
-
*
|
|
233
|
-
*
|
|
299
|
+
* strip line (A17), and on the price pane the legend drop of its anchor's
|
|
300
|
+
* group and the stacking shift over earlier overlays' groups. The legend drop
|
|
301
|
+
* is one rule for the three top anchors, and a class under a button strip too
|
|
302
|
+
* takes the deeper of the two lines, never their sum. The drops read the
|
|
303
|
+
* author's boxes before any stacking: every group that starts above a line
|
|
304
|
+
* starts on it, so a stacking group still lands one gap under the earlier
|
|
305
|
+
* group it stacks on.
|
|
234
306
|
*/
|
|
235
307
|
function rawShiftOf(placement, cls) {
|
|
236
308
|
const { pane, anchor } = cls;
|
|
237
309
|
const offchart = pane === 'offchart';
|
|
238
310
|
let dx = 0;
|
|
239
311
|
let dy = 0;
|
|
240
|
-
if (pane === 'onchart') {
|
|
241
|
-
if (anchor === LEGEND_ANCHOR)
|
|
242
|
-
dy += placement.legendDy;
|
|
243
|
-
dy += placement.stack.get(anchor) ?? 0;
|
|
244
|
-
}
|
|
245
312
|
if (cls.safeArea) {
|
|
246
313
|
const insets = offchart ? placement.insets.pane : placement.insets.main;
|
|
247
314
|
if (insets) {
|
|
@@ -256,6 +323,8 @@ function rawShiftOf(placement, cls) {
|
|
|
256
323
|
if (line !== null)
|
|
257
324
|
dy += Math.max(0, Math.ceil(line - cls.bounds.top));
|
|
258
325
|
}
|
|
326
|
+
if (pane === 'onchart')
|
|
327
|
+
dy = Math.max(dy, placement.legend.get(anchor) ?? 0) + (placement.stack.get(anchor) ?? 0);
|
|
259
328
|
return { dx, dy };
|
|
260
329
|
}
|
|
261
330
|
/**
|
|
@@ -369,7 +438,7 @@ export function shiftLegendSafeArea(drawings, dy) {
|
|
|
369
438
|
if (dy === 0)
|
|
370
439
|
return drawings;
|
|
371
440
|
return placeDrawings(drawings, {
|
|
372
|
-
|
|
441
|
+
legend: new Map([[LEGEND_ANCHOR, dy]]),
|
|
373
442
|
stack: NO_STACK,
|
|
374
443
|
insets: NO_INSETS,
|
|
375
444
|
boxes: NO_BOXES,
|
|
@@ -400,6 +469,20 @@ export function legendPaneOf(tc) {
|
|
|
400
469
|
export function legendRowsOf(pane) {
|
|
401
470
|
return [...pane.root.querySelectorAll(HOST_ROW_SELECTOR), ...pane.plot.querySelectorAll(TITAN_ROW_SELECTOR)];
|
|
402
471
|
}
|
|
472
|
+
/**
|
|
473
|
+
* Registers on `observer` what moves a host row of the legend without resizing one, for every tracker that measures
|
|
474
|
+
* the legend (this door, the wrun table chrome): the rows come and go as the cell's children (the quick-trade pill
|
|
475
|
+
* mounts with a wallet), and a row placed by its inline style moves with it (the pill rides `top`, a frame after the
|
|
476
|
+
* legend's rows change). `cell` adds the tracker's own options for the cell, since a second `observe` of one target
|
|
477
|
+
* replaces the first. Call it again after the rows change, so a row that just mounted is watched too.
|
|
478
|
+
*/
|
|
479
|
+
export function observeLegendHostRows(observer, pane, cell = {}) {
|
|
480
|
+
if (pane.root === pane.main)
|
|
481
|
+
return;
|
|
482
|
+
observer.observe(pane.root, { ...cell, childList: true });
|
|
483
|
+
for (const row of pane.root.querySelectorAll(HOST_ROW_SELECTOR))
|
|
484
|
+
observer.observe(row, { attributes: true, attributeFilter: ['style'] });
|
|
485
|
+
}
|
|
403
486
|
/** The rows' box relative to `origin`'s top-left corner, rounded; null when no row has a size. */
|
|
404
487
|
function measureRows(origin, rows) {
|
|
405
488
|
const base = origin.getBoundingClientRect();
|
|
@@ -593,12 +676,13 @@ function dropTracker(tc, tracker) {
|
|
|
593
676
|
tracker.pushed.clear();
|
|
594
677
|
}
|
|
595
678
|
function idle(tracker) {
|
|
596
|
-
return tracker.overlays.size === 0 && tracker.listeners.size === 0;
|
|
679
|
+
return tracker.overlays.size === 0 && tracker.listeners.size === 0 && tracker.holds.size === 0;
|
|
597
680
|
}
|
|
598
681
|
/**
|
|
599
|
-
* Places every tracked set in `tc.metadata` order: the legend
|
|
600
|
-
* stacking shift over the earlier groups at the same corner,
|
|
601
|
-
* insets and the strip drop of the plain top_right / top_center
|
|
682
|
+
* Places every tracked set in `tc.metadata` order: the legend drop of each
|
|
683
|
+
* top group, the stacking shift over the earlier groups at the same corner,
|
|
684
|
+
* the safe-area insets and the strip drop of the plain top_right / top_center
|
|
685
|
+
* groups.
|
|
602
686
|
* Overlays the chart no longer holds are forgotten (`current`, the set
|
|
603
687
|
* being mounted, is kept whatever the metadata says). Every set other than
|
|
604
688
|
* `current` whose placement changed is re-mounted; `current`'s placed set is
|
|
@@ -628,7 +712,7 @@ function placeAll(tc, tracker, current) {
|
|
|
628
712
|
const panes = tracker.measure?.panes;
|
|
629
713
|
const ownPaneId = hostPaneIdOf(tc, overlayId);
|
|
630
714
|
const placement = {
|
|
631
|
-
|
|
715
|
+
legend: legendDropsOf(entry.drawings, tracker.legend, tracker.paneBoxes[MAIN_PANE_ID] ?? null),
|
|
632
716
|
stack,
|
|
633
717
|
// Only a safeArea class reads the insets (rawShiftOf), so every set can carry them.
|
|
634
718
|
insets: panes ? { main: panes[MAIN_PANE_ID] ?? null, pane: panes[ownPaneId] ?? null } : NO_INSETS,
|
|
@@ -659,6 +743,7 @@ function startTracker(tc) {
|
|
|
659
743
|
strips: {},
|
|
660
744
|
overlays: new Map(),
|
|
661
745
|
listeners: new Set(),
|
|
746
|
+
holds: new Set(),
|
|
662
747
|
pushed: new Set(),
|
|
663
748
|
stop: () => { },
|
|
664
749
|
};
|
|
@@ -728,12 +813,13 @@ function startTracker(tc) {
|
|
|
728
813
|
// The move buttons come and go with the pane order (direct children of the section, caught below).
|
|
729
814
|
rows?.observe(section, { childList: true });
|
|
730
815
|
}
|
|
731
|
-
// Panes come and go (sections are direct children of the sections pane); the compare strip rides the cell's
|
|
816
|
+
// Panes come and go (sections are direct children of the sections pane); the compare strip rides the cell's
|
|
817
|
+
// style, and the host rows come, go and move with the cell's children and their own style.
|
|
732
818
|
const sectionsPane = pane.plot.parentElement?.parentElement;
|
|
733
819
|
if (sectionsPane)
|
|
734
820
|
rows?.observe(sectionsPane, { childList: true });
|
|
735
|
-
if (
|
|
736
|
-
rows
|
|
821
|
+
if (rows)
|
|
822
|
+
observeLegendHostRows(rows, pane, { attributes: true, attributeFilter: ['style'] });
|
|
737
823
|
};
|
|
738
824
|
if (typeof MutationObserver === 'function')
|
|
739
825
|
rows = new MutationObserver(() => {
|
|
@@ -770,23 +856,47 @@ export function watchChartChromeSafeArea(tc, listener) {
|
|
|
770
856
|
dropTracker(tc, tracker);
|
|
771
857
|
};
|
|
772
858
|
}
|
|
859
|
+
/**
|
|
860
|
+
* Keeps the chart's chrome tracker running for `holderId`, a record the chart
|
|
861
|
+
* holds that the engine places by the chrome without a drawing here (DW06):
|
|
862
|
+
* the tracker starts (and hands every measured pane's insets to the engine)
|
|
863
|
+
* on the chart's first hold, listener or tracked set, and pushes again as the
|
|
864
|
+
* chrome moves. A second hold of the same id is no change.
|
|
865
|
+
*/
|
|
866
|
+
export function holdChartChromeSafeArea(tc, holderId) {
|
|
867
|
+
trackerFor(tc).holds.add(holderId);
|
|
868
|
+
}
|
|
869
|
+
/**
|
|
870
|
+
* Lets go of `holderId`'s hold (none held: no change). The chart's last hold,
|
|
871
|
+
* listener and tracked set gone, the tracker stops and the engine's insets go
|
|
872
|
+
* back to null.
|
|
873
|
+
*/
|
|
874
|
+
export function releaseChartChromeSafeArea(tc, holderId) {
|
|
875
|
+
const tracker = trackers.get(tc);
|
|
876
|
+
if (!tracker || !tracker.holds.delete(holderId))
|
|
877
|
+
return;
|
|
878
|
+
if (idle(tracker))
|
|
879
|
+
dropTracker(tc, tracker);
|
|
880
|
+
}
|
|
773
881
|
/** A pane-pixel handle at an anchor the pane's buttons sit over (top_right, top_center), in any pane. */
|
|
774
882
|
function meetsButtonStrip(drawing) {
|
|
775
883
|
const member = memberOf(drawing);
|
|
776
884
|
return member !== null && ACTION_BAR_ANCHORS.has(member.anchor);
|
|
777
885
|
}
|
|
778
886
|
/**
|
|
779
|
-
* The set to hand `updateDrawings`:
|
|
780
|
-
* chart's legend when they meet, a
|
|
781
|
-
* clear of the earlier groups at the
|
|
782
|
-
* past the axis tags and the action
|
|
783
|
-
*
|
|
784
|
-
*
|
|
785
|
-
*
|
|
786
|
-
*
|
|
787
|
-
*
|
|
788
|
-
*
|
|
789
|
-
*
|
|
887
|
+
* The set to hand `updateDrawings`: each top group (`top_left`,
|
|
888
|
+
* `top_center`, `top_right`) moved under the chart's legend when they meet, a
|
|
889
|
+
* stacking overlay's corner groups moved clear of the earlier groups at the
|
|
890
|
+
* same corner, `safeArea` handles stepped past the axis tags and the action
|
|
891
|
+
* bar, and plain `top_right` / `top_center` groups dropped under their pane's
|
|
892
|
+
* button strip (the deeper line when the legend reaches them too). Every
|
|
893
|
+
* push of an overlay's drawings goes through here (a full apply, a
|
|
894
|
+
* replay-lane reveal, a clear), so the tracker always holds the mounted set of
|
|
895
|
+
* each overlay that owns a corner group, a handle under a button strip or a
|
|
896
|
+
* `safeArea` record (a card's insets ride the engine door) and can re-mount it
|
|
897
|
+
* when the chrome or an earlier group changes; a set without one (the clear
|
|
898
|
+
* included) drops the overlay from the tracker, and the overlays stacked on it
|
|
899
|
+
* follow.
|
|
790
900
|
*/
|
|
791
901
|
export function mountWithLegendSafeArea(tc, overlayId, drawings) {
|
|
792
902
|
const groups = cornerGroups(drawings);
|
|
@@ -18,17 +18,19 @@ export declare function noteLocalKScriptHiddenHold(): void;
|
|
|
18
18
|
export declare function noteLocalKScriptHiddenRun(): void;
|
|
19
19
|
export declare function getLocalKScriptHiddenHoldStats(): LocalKScriptHiddenHoldStats;
|
|
20
20
|
export declare function shouldAccumulateV2LiveDataPoints(sourceType: unknown): boolean;
|
|
21
|
-
/**
|
|
22
|
-
* The size floor a raw TRADE print must clear to fold into ANY `trades`
|
|
23
|
-
* source of an engine: the smallest declared minSize (0 when a source has
|
|
24
|
-
* none). Applied at intake, before the pending queue, so a busy feed's small
|
|
25
|
-
* prints cannot push a qualifying print out of the 1,024-message window.
|
|
26
|
-
*/
|
|
21
|
+
/** The smallest trades minSize, applied before the queue so small prints never push a qualifying one out of the window. */
|
|
27
22
|
export declare function v2LiveTradesSizeFloor(snapshots: ReadonlyArray<{
|
|
28
23
|
sourceType?: string;
|
|
29
24
|
payload?: unknown;
|
|
30
25
|
}> | undefined): number;
|
|
31
|
-
/**
|
|
26
|
+
/** The router hands both trades channels to every trades source: queue a frame only for a source of its channel. */
|
|
27
|
+
export declare function v2LiveTradesSourcesReadChannel(snapshots: ReadonlyArray<{
|
|
28
|
+
sourceType?: string;
|
|
29
|
+
payload?: unknown;
|
|
30
|
+
}> | undefined, large: boolean): boolean;
|
|
31
|
+
/** True when a live trade message carries a print below `floor` (a non-print message never is). The print is read on
|
|
32
|
+
* either case the fold reads (live-trades-merge.util `liveTradeOfPoint`: the raw TRADE `trade`, the TRADE_LARGE
|
|
33
|
+
* `tradeLarge`), so the floor never passes a print the fold would judge. */
|
|
32
34
|
export declare function v2LiveTradePrintBelowFloor(data: unknown, floor: number): boolean;
|
|
33
35
|
/**
|
|
34
36
|
* One coalesce key's pending live points, oldest first, bounded by the cap.
|
|
@@ -38,12 +38,7 @@ export function getLocalKScriptHiddenHoldStats() {
|
|
|
38
38
|
export function shouldAccumulateV2LiveDataPoints(sourceType) {
|
|
39
39
|
return !(typeof sourceType === 'string' && sourceType.toLowerCase() === 'orderbook');
|
|
40
40
|
}
|
|
41
|
-
/**
|
|
42
|
-
* The size floor a raw TRADE print must clear to fold into ANY `trades`
|
|
43
|
-
* source of an engine: the smallest declared minSize (0 when a source has
|
|
44
|
-
* none). Applied at intake, before the pending queue, so a busy feed's small
|
|
45
|
-
* prints cannot push a qualifying print out of the 1,024-message window.
|
|
46
|
-
*/
|
|
41
|
+
/** The smallest trades minSize, applied before the queue so small prints never push a qualifying one out of the window. */
|
|
47
42
|
export function v2LiveTradesSizeFloor(snapshots) {
|
|
48
43
|
let floor = Number.POSITIVE_INFINITY;
|
|
49
44
|
let any = false;
|
|
@@ -56,11 +51,21 @@ export function v2LiveTradesSizeFloor(snapshots) {
|
|
|
56
51
|
}
|
|
57
52
|
return any && Number.isFinite(floor) ? floor : 0;
|
|
58
53
|
}
|
|
59
|
-
/**
|
|
54
|
+
/** The router hands both trades channels to every trades source: queue a frame only for a source of its channel. */
|
|
55
|
+
export function v2LiveTradesSourcesReadChannel(snapshots, large) {
|
|
56
|
+
if (snapshots === undefined)
|
|
57
|
+
return true;
|
|
58
|
+
return snapshots.some((snapshot) => snapshot.sourceType === 'trades' &&
|
|
59
|
+
(snapshot.payload?.large === true) === large);
|
|
60
|
+
}
|
|
61
|
+
/** True when a live trade message carries a print below `floor` (a non-print message never is). The print is read on
|
|
62
|
+
* either case the fold reads (live-trades-merge.util `liveTradeOfPoint`: the raw TRADE `trade`, the TRADE_LARGE
|
|
63
|
+
* `tradeLarge`), so the floor never passes a print the fold would judge. */
|
|
60
64
|
export function v2LiveTradePrintBelowFloor(data, floor) {
|
|
61
65
|
if (!(floor > 0))
|
|
62
66
|
return false;
|
|
63
|
-
const
|
|
67
|
+
const point = data;
|
|
68
|
+
const amount = Number((point?.trade ?? point?.tradeLarge)?.amount);
|
|
64
69
|
return Number.isFinite(amount) && amount < floor;
|
|
65
70
|
}
|
|
66
71
|
/**
|
|
@@ -49,6 +49,11 @@ export type KScriptLiveSourceIdentityContext = {
|
|
|
49
49
|
* sources, the coalesce key and the ring keep the wire identity.
|
|
50
50
|
*/
|
|
51
51
|
leadAliasSymbol?: string;
|
|
52
|
+
/** The chart's tape market, offered for any frame type to a run-market source a run may read; never rewrites the frame. */
|
|
53
|
+
marketAlias?: {
|
|
54
|
+
exchange: string;
|
|
55
|
+
symbol: string;
|
|
56
|
+
};
|
|
52
57
|
};
|
|
53
58
|
/**
|
|
54
59
|
* Does a source payload's (resolved) identity accept a live message with the
|
|
@@ -86,6 +91,10 @@ export declare function findAllMatchingKScriptLiveSourceSnapshots<T extends KScr
|
|
|
86
91
|
symbol?: string;
|
|
87
92
|
};
|
|
88
93
|
leadAliasSymbol?: string;
|
|
94
|
+
marketAlias?: {
|
|
95
|
+
exchange: string;
|
|
96
|
+
symbol: string;
|
|
97
|
+
};
|
|
89
98
|
includeData?: boolean;
|
|
90
99
|
}): KScriptLiveSourceMatch<T>[];
|
|
91
100
|
/**
|
|
@@ -66,6 +66,14 @@ export function matchKScriptLiveSourcePayloadIdentity(payload, context) {
|
|
|
66
66
|
const sourceExchange = resolveKScriptSourceIdentityValue(rawExchange, context.chartMetadata?.exchange);
|
|
67
67
|
const expectedSymbol = context.incomingSymbol ?? context.chartMetadata?.symbol;
|
|
68
68
|
const expectedExchange = context.incomingExchange ?? context.chartMetadata?.exchange;
|
|
69
|
+
const alias = context.marketAlias;
|
|
70
|
+
if (alias !== undefined &&
|
|
71
|
+
context.incomingExchange === alias.exchange &&
|
|
72
|
+
context.incomingSymbol === alias.symbol &&
|
|
73
|
+
sourceExchange === context.chartMetadata?.exchange &&
|
|
74
|
+
sourceSymbol === context.chartMetadata?.symbol) {
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
69
77
|
if (sourceSymbol &&
|
|
70
78
|
expectedSymbol &&
|
|
71
79
|
sourceSymbol !== expectedSymbol &&
|
|
@@ -86,7 +94,7 @@ export function matchKScriptLiveSourcePayloadIdentity(payload, context) {
|
|
|
86
94
|
* requested.
|
|
87
95
|
*/
|
|
88
96
|
export function findAllMatchingKScriptLiveSourceSnapshots(args) {
|
|
89
|
-
const { snapshots, sourceType, incomingExchange, incomingSymbol, chartMetadata, leadAliasSymbol, includeData = true, } = args;
|
|
97
|
+
const { snapshots, sourceType, incomingExchange, incomingSymbol, chartMetadata, leadAliasSymbol, marketAlias, includeData = true, } = args;
|
|
90
98
|
if (!Array.isArray(snapshots))
|
|
91
99
|
return [];
|
|
92
100
|
return snapshots
|
|
@@ -98,6 +106,7 @@ export function findAllMatchingKScriptLiveSourceSnapshots(args) {
|
|
|
98
106
|
incomingSymbol,
|
|
99
107
|
chartMetadata,
|
|
100
108
|
leadAliasSymbol,
|
|
109
|
+
marketAlias,
|
|
101
110
|
});
|
|
102
111
|
})
|
|
103
112
|
.filter((source) => Boolean(source.sourceName))
|
|
@@ -38,6 +38,12 @@ export const KSCRIPT_RESERVED_PROVENANCE_KEYS = new Set([
|
|
|
38
38
|
// The saved split beside them (window-geometry.util): a package param of
|
|
39
39
|
// this name must never size its own window's panes.
|
|
40
40
|
'wrunWindowSplit',
|
|
41
|
+
// A window's projection stamps (window-cell.util): a package param of these
|
|
42
|
+
// names must never make its overlay project another Indicator, nor turn its
|
|
43
|
+
// window into one that shows its tables alone. The control keeps both by
|
|
44
|
+
// name through every rebuild.
|
|
45
|
+
'wrunWindowSourceId',
|
|
46
|
+
'wrunWindowTablesOnly',
|
|
41
47
|
'isProtectedScript',
|
|
42
48
|
'codeVisibility',
|
|
43
49
|
'hasGuide',
|
|
@@ -50,6 +56,13 @@ export const KSCRIPT_RESERVED_PROVENANCE_KEYS = new Set([
|
|
|
50
56
|
// (options-overlay-provenance.util): the hosted chart read and the MCP
|
|
51
57
|
// withhold an overlay by it, so a same-named input must never clear it.
|
|
52
58
|
'metaExchange',
|
|
59
|
+
// The CME provenance stamp of a CME user study (`'CME'`), written on both
|
|
60
|
+
// settings copies when the fetch door admits a CME payload to a user run
|
|
61
|
+
// (Door C) and before the engine is created on a CME chart (Door B): the
|
|
62
|
+
// chart read and the MCP withhold the study by it, the mounted view reads it
|
|
63
|
+
// as a plane script and the console marks its output, so a same-named input
|
|
64
|
+
// must never clear it.
|
|
65
|
+
'metaCmeExchange',
|
|
53
66
|
]);
|
|
54
67
|
export function isReservedKScriptProvenanceKey(name) {
|
|
55
68
|
return typeof name === 'string' && KSCRIPT_RESERVED_PROVENANCE_KEYS.has(name);
|
|
@@ -27,7 +27,11 @@ export interface KScriptStandInRow {
|
|
|
27
27
|
/** The workspace side the row is saved under (`onchart` or `offchart`): the pane it paints on. */
|
|
28
28
|
side?: unknown;
|
|
29
29
|
}
|
|
30
|
-
export type KScriptStandInWriteOutcome = 'written' | 'throttled' | 'no-row' | 'no-key' | 'no-candles' | 'no-rows' | 'not-live-edge' | 'not-template' | 'incomplete'
|
|
30
|
+
export type KScriptStandInWriteOutcome = 'written' | 'throttled' | 'no-row' | 'no-key' | 'no-candles' | 'no-rows' | 'not-live-edge' | 'not-template' | 'incomplete'
|
|
31
|
+
/** A whole write stamped older than the one the key already holds or has queued: the newer picture stays. */
|
|
32
|
+
| 'stamp-older'
|
|
33
|
+
/** A wrun row's run bars ride the CME session lattice (a coarser interval than the chart's there): never stored. */
|
|
34
|
+
| 'run-interval' | `ineligible:${string}`;
|
|
31
35
|
/**
|
|
32
36
|
* Why a row's wrun identity names no package a stand-in can key, or null (also for a row with no
|
|
33
37
|
* wrun identity at all): a draft is the author's session-only run, a dev-local run serves bytes no
|
|
@@ -3,7 +3,37 @@ export declare const KSCRIPT_PARENT_OUTPUT_RENDER_META_KEYS: readonly ["color",
|
|
|
3
3
|
export declare const KSCRIPT_PARENT_OUTPUT_RENDER_SETTING_KEYS: readonly ["fill", "fillGradient", "glow", "lineStyle", "opacity", "showPriceDisplay", "smooth", "width"];
|
|
4
4
|
export declare const KSCRIPT_PARENT_OUTPUT_RENDER_SETTING_INITIALIZER_DEFAULTS: Partial<Record<(typeof KSCRIPT_PARENT_OUTPUT_RENDER_SETTING_KEYS)[number], unknown>>;
|
|
5
5
|
export declare const KSCRIPT_NESTED_PARENT_PROMOTION_KEYS: readonly ["activeData", "batched", "data", "extractors", "high", "low", "multiValue", "plot", "plotType", "rawData", "showIndependentYAxis", "startTime", "subsetRange", "color", "colors", "fill", "fillGradient", "forceOnChart", "glow", "lineStyle", "opacity", "series1", "series2", "showPriceDisplay", "smooth", "styleDataOffset", "styleProperties", "width", "widths"];
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
/**
|
|
7
|
+
* The live refresh's field contract (contract R, EM-LOOK). A mount writes each plot on two records the engine
|
|
8
|
+
* draws from: its nested meta (the engine's `applyPlotOutputs` copies the run output's fields onto it) and its
|
|
9
|
+
* stored run output (`applyRunResult` keeps the whole result; an hline draws its line from it through
|
|
10
|
+
* `getPlotOutput`). The live lanes patch mounted plots in place and never call that apply
|
|
11
|
+
* (`patchMountedOutputRenderMetadata`), so every field the mount writes is either refreshed (this list: written
|
|
12
|
+
* when the output carries it, deleted when it drops a key of KSCRIPT_LIVE_REFRESH_DELETE_IF_ABSENT_KEYS, and a
|
|
13
|
+
* changed value is a render change, which claims a full repaint; a nested plot's settings by
|
|
14
|
+
* KSCRIPT_LIVE_REFRESH_RUN_SETTINGS_KEYS) or a declaration word a live run cannot move (a settings run remounts),
|
|
15
|
+
* declared static with its reason in the contract spec
|
|
16
|
+
* tests/packages/wrun-chart-host/utility/chart/kscript-titancharts-render-keys.constants.spec.ts, which reads the
|
|
17
|
+
* installed engine's write set and the guide fields the host mounts, and fails on a field that is neither.
|
|
18
|
+
*/
|
|
19
|
+
export declare const KSCRIPT_LIVE_REFRESH_RENDER_META_KEYS: readonly ["activeData", "axisLabel", "axisTagLook", "batched", "color", "colors", "data", "extractors", "fill", "fillGradient", "forceOnChart", "getMultiLineLabels", "glow", "high", "label", "lineStyle", "low", "mainPlotKey", "multiValue", "opacity", "outputKey", "plot", "plotKey", "plotType", "series1", "series2", "showIndependentYAxis", "showPriceDisplay", "smooth", "startTime", "styleDataOffset", "styleProperties", "subsetRange", "type", "value", "width", "widths"];
|
|
20
|
+
/**
|
|
21
|
+
* An hline's level and axis tag (a kScript hline, a wrun guide): the engine's apply copies them onto an hline's
|
|
22
|
+
* nested meta only and deletes them from it when the output drops them (its `NESTED_HLINE_META_KEYS`), and the hline
|
|
23
|
+
* draws its line from the same fields on its stored run output. The live refresh owns them on an hline alone, on both
|
|
24
|
+
* records, and never writes them on another plot kind (a text plot's own `label` is not a level).
|
|
25
|
+
*/
|
|
26
|
+
export declare const KSCRIPT_LIVE_REFRESH_HLINE_META_KEYS: readonly ["axisLabel", "axisTagLook", "label", "value"];
|
|
27
|
+
export declare const KSCRIPT_LIVE_REFRESH_DELETE_IF_ABSENT_KEYS: readonly ["axisLabel", "axisTagLook", "color", "colors", "label", "styleDataOffset", "styleProperties", "value", "widths"];
|
|
28
|
+
/**
|
|
29
|
+
* The nested plot settings the engine's apply rebuilds from a run output that a live run can move (its
|
|
30
|
+
* `applyPlotOutputs` settings literal; the engine's renderers read a nested plot's style there, never at the top
|
|
31
|
+
* level): the palette (a slot palette's rows index it, so it only grows and is never synced), the width (a width
|
|
32
|
+
* binding) and the marker size it feeds, the value tag (a tag binding), the fill flag (a band's zero-baseline rule)
|
|
33
|
+
* and the fill gradient. The live refresh writes them on a nested plot as the engine would and keeps every other
|
|
34
|
+
* settings key as mounted (the Style page's stamps, the host's price markers). The settings the engine rebuilds from
|
|
35
|
+
* declaration words are static; the contract spec lists each with its reason.
|
|
36
|
+
*/
|
|
37
|
+
export declare const KSCRIPT_LIVE_REFRESH_RUN_SETTINGS_KEYS: readonly ["colors", "fillGradient", "fillMode", "markerSize", "showPriceDisplay", "width"];
|
|
8
38
|
export declare const KSCRIPT_LIVE_REFRESH_RENDER_CONTRACT_SCALAR_KEYS: readonly ["styleDataOffset"];
|
|
9
39
|
export declare const KSCRIPT_LIVE_REFRESH_RENDER_CONTRACT_ARRAY_KEYS: readonly ["color", "colors", "styleProperties"];
|