@orangecharts/wrun-chart-host 0.8.0 → 0.10.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 +3 -1
- package/dist/constants/feature-flags.constants.d.ts +9 -0
- package/dist/constants/feature-flags.constants.js +86 -16
- package/dist/constants/marketCapabilities.constants.d.ts +14 -9
- package/dist/constants/marketCapabilities.constants.js +36 -13
- package/dist/constants/opra-compliance.constants.d.ts +15 -0
- package/dist/constants/opra-compliance.constants.js +15 -0
- package/dist/constants/option-venues.constants.d.ts +11 -6
- package/dist/constants/option-venues.constants.js +5 -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 +39 -9
- package/dist/host-env.js +6 -0
- package/dist/host-ports.types.d.ts +108 -18
- package/dist/index.d.ts +14 -0
- package/dist/index.js +14 -0
- package/dist/interfaces/kscript-diagnostics.interface.d.ts +6 -0
- package/dist/interfaces/opra-realtime.interface.d.ts +13 -11
- package/dist/interfaces/opra-realtime.interface.js +10 -10
- package/dist/interfaces/replay.interface.d.ts +8 -0
- package/dist/interfaces/wrun-runtime.interface.d.ts +52 -15
- package/dist/kscript-data/controls/live-trades-merge.util.d.ts +94 -14
- package/dist/kscript-data/controls/live-trades-merge.util.js +132 -22
- package/dist/kscript-data/controls/live-trades-order-gate.util.d.ts +56 -0
- package/dist/kscript-data/controls/live-trades-order-gate.util.js +107 -0
- package/dist/market-data/billing.interface.d.ts +227 -42
- package/dist/market-data/billing.interface.js +60 -12
- package/dist/market-data/venue.d.ts +88 -6
- 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 +165 -8
- package/dist/market-data/venues/index.js +48 -6
- package/dist/market-data/venues/opra.contract.copy.json +5 -3
- package/dist/market-data/venues/opra.d.ts +3 -3
- package/dist/market-data/venues/opra.js +5 -4
- package/dist/replay/replayLadder.js +3 -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 +45 -6
- package/dist/settings-templates/tool-rules.d.ts +27 -17
- package/dist/settings-templates/tool-rules.js +27 -11
- package/dist/settings-templates/tool-tables.generated.js +91 -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/crypto-index.leaf.d.ts +2 -2
- package/dist/utility/chart/crypto-index.leaf.js +2 -2
- package/dist/utility/chart/index-mode-admission.util.js +24 -3
- package/dist/utility/chart/index-mode.util.d.ts +5 -2
- package/dist/utility/chart/index-mode.util.js +23 -13
- 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 +7 -2
- package/dist/utility/chart/kscript-live-coalesce.util.js +9 -3
- package/dist/utility/chart/kscript-provenance-keys.util.js +6 -0
- package/dist/utility/chart/kscript-standin-identity.leaf.d.ts +3 -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 +53 -27
- package/dist/utility/chart/kscript-venue-policy.util.js +74 -32
- 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.d.ts +12 -10
- package/dist/utility/chart/marketKind.util.js +17 -7
- package/dist/utility/chart/om-panel-push-style.util.d.ts +7 -7
- package/dist/utility/chart/om-panel-push-style.util.js +17 -15
- package/dist/utility/chart/om-panel.util.js +6 -6
- 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/profile-block-size.util.d.ts +16 -0
- package/dist/utility/chart/profile-block-size.util.js +7 -0
- package/dist/utility/chart/quote-perp.leaf.d.ts +17 -0
- package/dist/utility/chart/quote-perp.leaf.js +20 -0
- package/dist/utility/chart/rth-session.util.d.ts +3 -2
- package/dist/utility/chart/rth-session.util.js +2 -1
- 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/wrun-run-result.util.d.ts +17 -0
- package/dist/utility/chart/wrun-run-result.util.js +145 -7
- package/dist/utility/common/transformations.util.d.ts +7 -0
- package/dist/utility/common/transformations.util.js +11 -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 +21 -3
- package/dist/utility/options/option-venue.util.js +30 -3
- package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.js +2 -0
- package/dist/utility/wrun/derived-roots.util.d.ts +213 -0
- package/dist/utility/wrun/derived-roots.util.js +471 -0
- package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.d.ts +41 -6
- 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 +5 -3
- package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +6 -4
- package/dist/utility/wrun/run-schedule/wrun-prefix-feeds.util.d.ts +2 -2
- package/dist/utility/wrun/run-schedule/wrun-prefix-feeds.util.js +5 -1
- 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-lane-registry.js +3 -2
- package/dist/utility/wrun/sources/row-lanes/option_contract_flow.js +2 -1
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.d.ts +9 -3
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +15 -6
- package/dist/utility/wrun/sources/row-lanes/option_prints.d.ts +14 -0
- package/dist/utility/wrun/sources/row-lanes/option_prints.js +82 -13
- package/dist/utility/wrun/sources/row-lanes/option_strike_flow.js +17 -4
- package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +55 -8
- package/dist/utility/wrun/sources/row-lanes/option_strikes.js +95 -14
- package/dist/utility/wrun/sources/row-lanes/option_surface.d.ts +5 -2
- package/dist/utility/wrun/sources/row-lanes/option_surface.js +7 -3
- package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +19 -0
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +35 -14
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +70 -20
- package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.d.ts +64 -0
- package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.js +89 -0
- package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.d.ts +45 -1
- package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.js +114 -6
- package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +56 -5
- package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +224 -26
- package/dist/utility/wrun/sources/wrun-row-lanes.util.js +822 -58
- package/dist/utility/wrun/wrun-batched-marks.util.d.ts +16 -3
- package/dist/utility/wrun/wrun-batched-marks.util.js +30 -19
- package/dist/utility/wrun/wrun-batched-readout.util.d.ts +37 -9
- package/dist/utility/wrun/wrun-batched-readout.util.js +61 -15
- 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-canvas-readout.util.d.ts +4 -0
- package/dist/utility/wrun/wrun-cell-capacity.leaf.d.ts +66 -0
- package/dist/utility/wrun/wrun-cell-capacity.leaf.js +86 -0
- package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +192 -13
- package/dist/utility/wrun/wrun-chart-market-facts.util.js +437 -55
- package/dist/utility/wrun/wrun-color-facts.util.d.ts +19 -9
- package/dist/utility/wrun/wrun-color-facts.util.js +24 -14
- package/dist/utility/wrun/wrun-color-settings.util.d.ts +15 -4
- package/dist/utility/wrun/wrun-color-settings.util.js +31 -12
- package/dist/utility/wrun/wrun-dollar-unit-port.leaf.d.ts +17 -0
- package/dist/utility/wrun/wrun-dollar-unit-port.leaf.js +9 -0
- package/dist/utility/wrun/wrun-download-meter.util.d.ts +107 -0
- package/dist/utility/wrun/wrun-download-meter.util.js +134 -0
- 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-draft-overlay.util.d.ts +6 -1
- package/dist/utility/wrun/wrun-draft-overlay.util.js +23 -3
- package/dist/utility/wrun/wrun-frames.d.ts +27 -6
- package/dist/utility/wrun/wrun-frames.js +78 -15
- package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +2 -2
- package/dist/utility/wrun/wrun-hosted-wire-caps.js +7 -0
- 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 +51 -21
- package/dist/utility/wrun/wrun-hud-looks.util.js +74 -28
- package/dist/utility/wrun/wrun-latest-snapshot.d.ts +11 -0
- package/dist/utility/wrun/wrun-lifecycle-runtime.util.d.ts +8 -6
- package/dist/utility/wrun/wrun-lifecycle-runtime.util.js +8 -6
- package/dist/utility/wrun/wrun-lifecycle.contract.d.ts +4 -2
- package/dist/utility/wrun/wrun-live-intake.util.d.ts +19 -9
- package/dist/utility/wrun/wrun-live-intake.util.js +213 -45
- package/dist/utility/wrun/wrun-live-tick.util.d.ts +4 -0
- package/dist/utility/wrun/wrun-live-tick.util.js +246 -49
- package/dist/utility/wrun/wrun-market-size-contract-carry.leaf.d.ts +53 -0
- package/dist/utility/wrun/wrun-market-size-contract-carry.leaf.js +162 -0
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +205 -48
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +277 -34
- package/dist/utility/wrun/wrun-market-size-defaults.util.d.ts +51 -7
- package/dist/utility/wrun/wrun-market-size-defaults.util.js +340 -56
- 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-prints.util.d.ts +41 -2
- package/dist/utility/wrun/wrun-option-prints.util.js +80 -13
- 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 +26 -6
- package/dist/utility/wrun/wrun-option-strike-flow-lane.util.js +50 -11
- package/dist/utility/wrun/wrun-option-strike-flow.util.d.ts +109 -19
- package/dist/utility/wrun/wrun-option-strike-flow.util.js +222 -61
- package/dist/utility/wrun/wrun-option-views.util.d.ts +96 -18
- package/dist/utility/wrun/wrun-option-views.util.js +246 -51
- package/dist/utility/wrun/wrun-options-stop.util.d.ts +2 -1
- package/dist/utility/wrun/wrun-options-stop.util.js +3 -2
- 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 +20 -0
- package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.d.ts +31 -14
- package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.js +22 -0
- 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.d.ts +7 -0
- package/dist/utility/wrun/wrun-overlay-recovery.util.js +25 -1
- package/dist/utility/wrun/wrun-overlay-result.util.d.ts +7 -1
- package/dist/utility/wrun/wrun-overlay-result.util.js +2 -0
- package/dist/utility/wrun/wrun-overlay-run.util.d.ts +134 -37
- package/dist/utility/wrun/wrun-overlay-run.util.js +1118 -254
- package/dist/utility/wrun/wrun-pack-widths.leaf.d.ts +4 -4
- package/dist/utility/wrun/wrun-pack-widths.leaf.js +4 -4
- package/dist/utility/wrun/wrun-pack.util.d.ts +7 -3
- package/dist/utility/wrun/wrun-pack.util.js +20 -9
- 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 +63 -13
- package/dist/utility/wrun/wrun-panel-style.util.d.ts +37 -24
- package/dist/utility/wrun/wrun-panel-style.util.js +100 -29
- package/dist/utility/wrun/wrun-param-map.util.d.ts +15 -11
- package/dist/utility/wrun/wrun-param-map.util.js +13 -5
- package/dist/utility/wrun/wrun-param-values.util.d.ts +21 -3
- package/dist/utility/wrun/wrun-param-values.util.js +6 -0
- package/dist/utility/wrun/wrun-pin-spelling.util.js +12 -11
- package/dist/utility/wrun/wrun-prefix-lanes.util.js +2 -2
- 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.js +10 -1
- 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-row-source.d.ts +11 -0
- package/dist/utility/wrun/wrun-run-interval.util.d.ts +4 -2
- package/dist/utility/wrun/wrun-run-interval.util.js +9 -6
- package/dist/utility/wrun/wrun-script-inputs.util.d.ts +52 -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 +113 -8
- package/dist/utility/wrun/wrun-source-rows.util.d.ts +9 -1
- package/dist/utility/wrun/wrun-source-rows.util.js +108 -43
- 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 +26 -0
- package/dist/utility/wrun/wrun-tape-source.util.d.ts +126 -50
- package/dist/utility/wrun/wrun-tape-source.util.js +193 -68
- package/dist/utility/wrun/wrun-volume-profile-lane.util.d.ts +7 -5
- package/dist/utility/wrun/wrun-volume-profile-lane.util.js +8 -6
- package/dist/utils/replay/replay-buffer-math.d.ts +53 -2
- package/dist/utils/replay/replay-buffer-math.js +227 -20
- package/dist/workers/utils/volume-profile.worker.util.d.ts +4 -1
- package/dist/workers/utils/volume-profile.worker.util.js +5 -2
- package/dist/workers/wrun/wrun-abi-host.js +3 -2
- package/package.json +5 -5
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { formatDisplayToExchange } from '../exchange-normalization.util.js';
|
|
2
|
-
import {
|
|
2
|
+
import { checkIsCryptoIndex } from './crypto-index.leaf.js';
|
|
3
|
+
import { checkIsQuotePerp } from './quote-perp.leaf.js';
|
|
3
4
|
import { PREDICTION_MARKET_EXCHANGE_NAMES } from './prediction-identity.util.js';
|
|
4
5
|
// ============================================================================
|
|
5
6
|
// EXCHANGE CONSTANTS
|
|
@@ -49,15 +50,12 @@ const INDEX_MODE_EXCHANGES = [
|
|
|
49
50
|
...COMMODITY_EXCHANGES,
|
|
50
51
|
...INDEX_VENUE_EXCHANGES,
|
|
51
52
|
];
|
|
52
|
-
// Exchanges that don't support 1s interval (index mode + prediction + forex + commodity
|
|
53
|
-
//
|
|
54
|
-
//
|
|
55
|
-
//
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
...PREDICTION_MARKET_EXCHANGE_NAMES,
|
|
59
|
-
...CRYPTO_INDEX_EXCHANGES,
|
|
60
|
-
];
|
|
53
|
+
// Exchanges that don't support 1s interval (index mode + prediction + forex + commodity). Prediction
|
|
54
|
+
// venues poll a price rather than printing trades, so none of them can host a 1s bar: the list tracks
|
|
55
|
+
// the venue SET, not Polymarket alone. The crypto indices (CRYPTOCAP) are not here: their 1s candles
|
|
56
|
+
// read the raw prints (tsdb-gateway's crypto_dominance_agg_1s tier), like a crypto pair's trades. The
|
|
57
|
+
// quote-priced perpetual venues are blocked by their own predicate (checkIsBlockedOn1s).
|
|
58
|
+
const EXCHANGES_BLOCKED_ON_1S = [...INDEX_MODE_EXCHANGES, ...PREDICTION_MARKET_EXCHANGE_NAMES];
|
|
61
59
|
const PM_SIGNAL_CRYPTO_SYMBOLS = ['BTC', 'ETH', 'SOL', 'XRP'];
|
|
62
60
|
const PM_SIGNAL_TRADFI_SYMBOLS = [
|
|
63
61
|
'TSLA',
|
|
@@ -322,8 +320,11 @@ export function checkIsIndexVenue(exchange) {
|
|
|
322
320
|
}
|
|
323
321
|
/**
|
|
324
322
|
* Exchanges that print quotes instead of trades: value-only candles with no
|
|
325
|
-
* volume and a quote channel live (forex, commodity
|
|
326
|
-
* TICKER/TICKER_AGG, the crypto indices on
|
|
323
|
+
* volume and a quote channel live (forex, commodity, the index venues and the
|
|
324
|
+
* quote-priced perpetual venues on TICKER/TICKER_AGG, the crypto indices on
|
|
325
|
+
* CRYPTO_DOMINANCE/CRYPTO_DOMINANCE_AGG). A venue the gateway serves only as
|
|
326
|
+
* quotes must answer true here: unlisted, it reads as crypto and asks for
|
|
327
|
+
* trades it is never served (venue-price-source.ratchet.spec.ts).
|
|
327
328
|
* The hub of the quote routing: the candle parse (the ohlcv and K_OHLCV
|
|
328
329
|
* workers keep a volume-less row), the sided-candle refusal and the live
|
|
329
330
|
* channel (`liveQuoteType`, live-feed-channel-factory.util) all read it; the
|
|
@@ -334,7 +335,11 @@ export function checkIsIndexVenue(exchange) {
|
|
|
334
335
|
* cme-futures-capability.spec.ts.
|
|
335
336
|
*/
|
|
336
337
|
export function checkIsTickerDataType(exchange) {
|
|
337
|
-
return (checkIsForex(exchange) ||
|
|
338
|
+
return (checkIsForex(exchange) ||
|
|
339
|
+
checkIsCommodity(exchange) ||
|
|
340
|
+
checkIsIndexVenue(exchange) ||
|
|
341
|
+
checkIsCryptoIndex(exchange) ||
|
|
342
|
+
checkIsQuotePerp(exchange));
|
|
338
343
|
}
|
|
339
344
|
export function checkIsBlockedOn1s(exchange) {
|
|
340
345
|
if (isCmeFuturesPolicyActive(exchange))
|
|
@@ -345,6 +350,11 @@ export function checkIsBlockedOn1s(exchange) {
|
|
|
345
350
|
// sub-minute rung (1s 5s 15s 30s) is ever servable on a contract.
|
|
346
351
|
if (isOpraGoverned(exchange))
|
|
347
352
|
return true;
|
|
353
|
+
// Quote-priced perpetual venues: the gateway serves TICKER_AGG from the
|
|
354
|
+
// minute up ("interval SECOND is not served for TICKER_AGG"). The leaf
|
|
355
|
+
// predicate, case-insensitive like the kind that routes their quotes.
|
|
356
|
+
if (checkIsQuotePerp(exchange))
|
|
357
|
+
return true;
|
|
348
358
|
return checkIsExchangeInSet(exchange, EXCHANGES_BLOCKED_ON_1S_SET);
|
|
349
359
|
}
|
|
350
360
|
export function getMarketType(exchange) {
|
|
@@ -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);
|
|
@@ -22,13 +22,18 @@ export declare function shouldAccumulateV2LiveDataPoints(sourceType: unknown): b
|
|
|
22
22
|
* The size floor a raw TRADE print must clear to fold into ANY `trades`
|
|
23
23
|
* source of an engine: the smallest declared minSize (0 when a source has
|
|
24
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.
|
|
25
|
+
* prints cannot push a qualifying print out of the 1,024-message window. On a
|
|
26
|
+
* tape judged per aggressor order (wrun-tape-per-order.util `wrunTapePerOrder`)
|
|
27
|
+
* the fan-out judges it per order instead (live-trades-order-gate.util), so the
|
|
28
|
+
* small fills of an order that reached it still fold.
|
|
26
29
|
*/
|
|
27
30
|
export declare function v2LiveTradesSizeFloor(snapshots: ReadonlyArray<{
|
|
28
31
|
sourceType?: string;
|
|
29
32
|
payload?: unknown;
|
|
30
33
|
}> | undefined): number;
|
|
31
|
-
/** True when a
|
|
34
|
+
/** True when a live trade message carries a print below `floor` (a non-print message never is). The print is read on
|
|
35
|
+
* either case the fold reads (live-trades-merge.util `liveTradeOfPoint`: the raw TRADE `trade`, the TRADE_LARGE
|
|
36
|
+
* `tradeLarge`), so the floor never passes a print the fold would judge. */
|
|
32
37
|
export declare function v2LiveTradePrintBelowFloor(data: unknown, floor: number): boolean;
|
|
33
38
|
/**
|
|
34
39
|
* One coalesce key's pending live points, oldest first, bounded by the cap.
|
|
@@ -42,7 +42,10 @@ export function shouldAccumulateV2LiveDataPoints(sourceType) {
|
|
|
42
42
|
* The size floor a raw TRADE print must clear to fold into ANY `trades`
|
|
43
43
|
* source of an engine: the smallest declared minSize (0 when a source has
|
|
44
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.
|
|
45
|
+
* prints cannot push a qualifying print out of the 1,024-message window. On a
|
|
46
|
+
* tape judged per aggressor order (wrun-tape-per-order.util `wrunTapePerOrder`)
|
|
47
|
+
* the fan-out judges it per order instead (live-trades-order-gate.util), so the
|
|
48
|
+
* small fills of an order that reached it still fold.
|
|
46
49
|
*/
|
|
47
50
|
export function v2LiveTradesSizeFloor(snapshots) {
|
|
48
51
|
let floor = Number.POSITIVE_INFINITY;
|
|
@@ -56,11 +59,14 @@ export function v2LiveTradesSizeFloor(snapshots) {
|
|
|
56
59
|
}
|
|
57
60
|
return any && Number.isFinite(floor) ? floor : 0;
|
|
58
61
|
}
|
|
59
|
-
/** True when a
|
|
62
|
+
/** True when a live trade message carries a print below `floor` (a non-print message never is). The print is read on
|
|
63
|
+
* either case the fold reads (live-trades-merge.util `liveTradeOfPoint`: the raw TRADE `trade`, the TRADE_LARGE
|
|
64
|
+
* `tradeLarge`), so the floor never passes a print the fold would judge. */
|
|
60
65
|
export function v2LiveTradePrintBelowFloor(data, floor) {
|
|
61
66
|
if (!(floor > 0))
|
|
62
67
|
return false;
|
|
63
|
-
const
|
|
68
|
+
const point = data;
|
|
69
|
+
const amount = Number((point?.trade ?? point?.tradeLarge)?.amount);
|
|
64
70
|
return Number.isFinite(amount) && amount < floor;
|
|
65
71
|
}
|
|
66
72
|
/**
|
|
@@ -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',
|
|
@@ -27,7 +27,9 @@ 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' | `ineligible:${string}`;
|
|
31
33
|
/**
|
|
32
34
|
* Why a row's wrun identity names no package a stand-in can key, or null (also for a row with no
|
|
33
35
|
* 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"];
|
|
@@ -84,8 +84,23 @@ export const KSCRIPT_NESTED_PARENT_PROMOTION_KEYS = [
|
|
|
84
84
|
'subsetRange',
|
|
85
85
|
...KSCRIPT_PARENT_OUTPUT_RENDER_META_KEYS,
|
|
86
86
|
];
|
|
87
|
+
/**
|
|
88
|
+
* The live refresh's field contract (contract R, EM-LOOK). A mount writes each plot on two records the engine
|
|
89
|
+
* draws from: its nested meta (the engine's `applyPlotOutputs` copies the run output's fields onto it) and its
|
|
90
|
+
* stored run output (`applyRunResult` keeps the whole result; an hline draws its line from it through
|
|
91
|
+
* `getPlotOutput`). The live lanes patch mounted plots in place and never call that apply
|
|
92
|
+
* (`patchMountedOutputRenderMetadata`), so every field the mount writes is either refreshed (this list: written
|
|
93
|
+
* when the output carries it, deleted when it drops a key of KSCRIPT_LIVE_REFRESH_DELETE_IF_ABSENT_KEYS, and a
|
|
94
|
+
* changed value is a render change, which claims a full repaint; a nested plot's settings by
|
|
95
|
+
* KSCRIPT_LIVE_REFRESH_RUN_SETTINGS_KEYS) or a declaration word a live run cannot move (a settings run remounts),
|
|
96
|
+
* declared static with its reason in the contract spec
|
|
97
|
+
* tests/packages/wrun-chart-host/utility/chart/kscript-titancharts-render-keys.constants.spec.ts, which reads the
|
|
98
|
+
* installed engine's write set and the guide fields the host mounts, and fails on a field that is neither.
|
|
99
|
+
*/
|
|
87
100
|
export const KSCRIPT_LIVE_REFRESH_RENDER_META_KEYS = [
|
|
88
101
|
'activeData',
|
|
102
|
+
'axisLabel',
|
|
103
|
+
'axisTagLook',
|
|
89
104
|
'batched',
|
|
90
105
|
'color',
|
|
91
106
|
'colors',
|
|
@@ -97,6 +112,7 @@ export const KSCRIPT_LIVE_REFRESH_RENDER_META_KEYS = [
|
|
|
97
112
|
'getMultiLineLabels',
|
|
98
113
|
'glow',
|
|
99
114
|
'high',
|
|
115
|
+
'label',
|
|
100
116
|
'lineStyle',
|
|
101
117
|
'low',
|
|
102
118
|
'mainPlotKey',
|
|
@@ -116,15 +132,44 @@ export const KSCRIPT_LIVE_REFRESH_RENDER_META_KEYS = [
|
|
|
116
132
|
'styleProperties',
|
|
117
133
|
'subsetRange',
|
|
118
134
|
'type',
|
|
135
|
+
'value',
|
|
119
136
|
'width',
|
|
120
137
|
'widths',
|
|
121
138
|
];
|
|
139
|
+
/**
|
|
140
|
+
* An hline's level and axis tag (a kScript hline, a wrun guide): the engine's apply copies them onto an hline's
|
|
141
|
+
* nested meta only and deletes them from it when the output drops them (its `NESTED_HLINE_META_KEYS`), and the hline
|
|
142
|
+
* draws its line from the same fields on its stored run output. The live refresh owns them on an hline alone, on both
|
|
143
|
+
* records, and never writes them on another plot kind (a text plot's own `label` is not a level).
|
|
144
|
+
*/
|
|
145
|
+
export const KSCRIPT_LIVE_REFRESH_HLINE_META_KEYS = ['axisLabel', 'axisTagLook', 'label', 'value'];
|
|
122
146
|
export const KSCRIPT_LIVE_REFRESH_DELETE_IF_ABSENT_KEYS = [
|
|
147
|
+
'axisLabel',
|
|
148
|
+
'axisTagLook',
|
|
123
149
|
'color',
|
|
124
150
|
'colors',
|
|
151
|
+
'label',
|
|
125
152
|
'styleDataOffset',
|
|
126
153
|
'styleProperties',
|
|
154
|
+
'value',
|
|
127
155
|
'widths',
|
|
128
156
|
];
|
|
157
|
+
/**
|
|
158
|
+
* The nested plot settings the engine's apply rebuilds from a run output that a live run can move (its
|
|
159
|
+
* `applyPlotOutputs` settings literal; the engine's renderers read a nested plot's style there, never at the top
|
|
160
|
+
* level): the palette (a slot palette's rows index it, so it only grows and is never synced), the width (a width
|
|
161
|
+
* binding) and the marker size it feeds, the value tag (a tag binding), the fill flag (a band's zero-baseline rule)
|
|
162
|
+
* and the fill gradient. The live refresh writes them on a nested plot as the engine would and keeps every other
|
|
163
|
+
* settings key as mounted (the Style page's stamps, the host's price markers). The settings the engine rebuilds from
|
|
164
|
+
* declaration words are static; the contract spec lists each with its reason.
|
|
165
|
+
*/
|
|
166
|
+
export const KSCRIPT_LIVE_REFRESH_RUN_SETTINGS_KEYS = [
|
|
167
|
+
'colors',
|
|
168
|
+
'fillGradient',
|
|
169
|
+
'fillMode',
|
|
170
|
+
'markerSize',
|
|
171
|
+
'showPriceDisplay',
|
|
172
|
+
'width',
|
|
173
|
+
];
|
|
129
174
|
export const KSCRIPT_LIVE_REFRESH_RENDER_CONTRACT_SCALAR_KEYS = ['styleDataOffset'];
|
|
130
175
|
export const KSCRIPT_LIVE_REFRESH_RENDER_CONTRACT_ARRAY_KEYS = ['color', 'colors', 'styleProperties'];
|