@orangecharts/wrun-chart-host 0.7.1 → 0.9.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 +27 -4
- package/dist/constants/feature-flags.constants.d.ts +5 -0
- package/dist/constants/feature-flags.constants.js +32 -0
- 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 +14 -0
- package/dist/constants/opra-compliance.constants.js +14 -0
- package/dist/constants/option-venues.constants.d.ts +29 -6
- package/dist/constants/option-venues.constants.js +19 -2
- package/dist/constants/venue-presets.constants.d.ts +17 -3
- package/dist/constants/venue-presets.constants.js +17 -3
- package/dist/host-env.d.ts +34 -4
- package/dist/host-env.js +21 -0
- package/dist/host-ports.types.d.ts +51 -3
- package/dist/index.d.ts +17 -0
- package/dist/index.js +17 -0
- package/dist/indicators/controls/tpo-session.util.d.ts +40 -11
- package/dist/indicators/controls/tpo-session.util.js +138 -14
- package/dist/interfaces/opra-realtime.interface.d.ts +13 -11
- package/dist/interfaces/opra-realtime.interface.js +10 -10
- package/dist/interfaces/option-instrument.interface.d.ts +6 -0
- package/dist/interfaces/wrun-runtime.interface.d.ts +34 -13
- package/dist/kscript-data/controls/live-trades-merge.util.d.ts +57 -10
- package/dist/kscript-data/controls/live-trades-merge.util.js +85 -16
- package/dist/market-data/billing.interface.d.ts +138 -17
- package/dist/market-data/billing.interface.js +25 -8
- package/dist/market-data/venues/index.d.ts +3 -3
- 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/footprint-rows.d.ts +25 -0
- package/dist/settings-templates/footprint-rows.js +127 -0
- package/dist/settings-templates/form-rows.d.ts +56 -0
- package/dist/settings-templates/form-rows.js +19 -0
- package/dist/settings-templates/frvp-fields.js +14 -0
- package/dist/settings-templates/index.d.ts +10 -1
- package/dist/settings-templates/index.js +11 -2
- package/dist/settings-templates/indicator-fields.js +78 -0
- package/dist/settings-templates/tool-rules.d.ts +35 -9
- package/dist/settings-templates/tool-rules.js +42 -8
- package/dist/settings-templates/tool-tables.generated.js +13 -2
- package/dist/utility/chart/candle-volume-unit.leaf.d.ts +16 -0
- package/dist/utility/chart/candle-volume-unit.leaf.js +61 -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/footprint-columns.util.d.ts +74 -0
- package/dist/utility/chart/footprint-columns.util.js +106 -0
- package/dist/utility/chart/footprint-display-mode.util.d.ts +40 -0
- package/dist/utility/chart/footprint-display-mode.util.js +62 -0
- package/dist/utility/chart/footprint-sierra-look.util.d.ts +2 -0
- package/dist/utility/chart/footprint-sierra-look.util.js +37 -0
- package/dist/utility/chart/index-mode-admission.util.js +9 -1
- 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-venue-policy.util.d.ts +28 -21
- package/dist/utility/chart/kscript-venue-policy.util.js +34 -26
- 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.d.ts +11 -0
- package/dist/utility/chart/om-panel.util.js +65 -6
- 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/window-geometry.leaf.d.ts +23 -1
- package/dist/utility/chart/window-geometry.leaf.js +78 -6
- package/dist/utility/chart/window-owner.leaf.d.ts +13 -0
- package/dist/utility/chart/window-owner.leaf.js +5 -0
- package/dist/utility/chart/wrun-run-result.util.d.ts +5 -0
- package/dist/utility/chart/wrun-run-result.util.js +4 -1
- package/dist/utility/common/transformations.util.d.ts +7 -0
- package/dist/utility/common/transformations.util.js +11 -0
- package/dist/utility/options/cme-options-root.util.d.ts +25 -0
- package/dist/utility/options/cme-options-root.util.js +40 -0
- package/dist/utility/options/option-book.util.d.ts +27 -0
- package/dist/utility/options/option-book.util.js +76 -0
- package/dist/utility/options/option-trade-date.util.d.ts +50 -0
- package/dist/utility/options/option-trade-date.util.js +120 -0
- package/dist/utility/options/option-venue.util.d.ts +3 -3
- package/dist/utility/options/option-venue.util.js +3 -3
- package/dist/utility/wrun/run-schedule/wrun-late-reads.util.d.ts +1 -1
- package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +2 -2
- 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/host-grid-landing.d.ts +4 -2
- package/dist/utility/wrun/sources/host-grid-landing.js +8 -0
- package/dist/utility/wrun/sources/lanes/options_flow.d.ts +40 -4
- package/dist/utility/wrun/sources/lanes/options_flow.js +115 -18
- package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +12 -9
- package/dist/utility/wrun/sources/opra-option-lanes.util.js +10 -7
- package/dist/utility/wrun/sources/row-lane-registry.js +10 -5
- package/dist/utility/wrun/sources/row-lanes/index.js +2 -0
- package/dist/utility/wrun/sources/row-lanes/option_contract_flow.d.ts +3 -2
- package/dist/utility/wrun/sources/row-lanes/option_contract_flow.js +30 -5
- 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 +13 -5
- package/dist/utility/wrun/sources/row-lanes/option_prints.d.ts +25 -1
- package/dist/utility/wrun/sources/row-lanes/option_prints.js +161 -30
- package/dist/utility/wrun/sources/row-lanes/option_strike_flow.d.ts +4 -0
- package/dist/utility/wrun/sources/row-lanes/option_strike_flow.js +65 -0
- package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +55 -1
- package/dist/utility/wrun/sources/row-lanes/option_strikes.js +83 -2
- package/dist/utility/wrun/sources/row-lanes/option_surface.d.ts +17 -1
- package/dist/utility/wrun/sources/row-lanes/option_surface.js +33 -2
- package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +7 -1
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +51 -5
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +136 -3
- package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.d.ts +42 -0
- package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.js +146 -0
- package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +25 -5
- package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +111 -20
- package/dist/utility/wrun/sources/wrun-row-lanes.util.js +291 -48
- 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-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 +147 -9
- package/dist/utility/wrun/wrun-chart-market-facts.util.js +345 -11
- package/dist/utility/wrun/wrun-cloud-record.leaf.d.ts +27 -0
- package/dist/utility/wrun/wrun-cloud-record.leaf.js +71 -0
- package/dist/utility/wrun/wrun-cloud-record.util.d.ts +4 -21
- package/dist/utility/wrun/wrun-cloud-record.util.js +5 -65
- 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 +22 -9
- package/dist/utility/wrun/wrun-color-settings.util.js +57 -23
- 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 +92 -0
- package/dist/utility/wrun/wrun-download-meter.util.js +122 -0
- package/dist/utility/wrun/wrun-draft-overlay.util.d.ts +10 -3
- package/dist/utility/wrun/wrun-draft-overlay.util.js +63 -6
- package/dist/utility/wrun/wrun-frames.js +5 -5
- package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +2 -2
- package/dist/utility/wrun/wrun-hosted-wire-caps.js +11 -0
- package/dist/utility/wrun/wrun-hud-looks.util.d.ts +33 -17
- package/dist/utility/wrun/wrun-hud-looks.util.js +30 -16
- package/dist/utility/wrun/wrun-lane-refusal.leaf.d.ts +29 -3
- package/dist/utility/wrun/wrun-lane-refusal.leaf.js +33 -3
- 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 +6 -2
- package/dist/utility/wrun/wrun-live-intake.util.js +136 -21
- package/dist/utility/wrun/wrun-live-tick.util.d.ts +4 -1
- package/dist/utility/wrun/wrun-live-tick.util.js +130 -44
- 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 +224 -0
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +342 -0
- package/dist/utility/wrun/wrun-market-size-defaults.util.d.ts +88 -0
- package/dist/utility/wrun/wrun-market-size-defaults.util.js +471 -0
- package/dist/utility/wrun/wrun-opra-flow.leaf.d.ts +43 -8
- package/dist/utility/wrun/wrun-opra-flow.leaf.js +37 -6
- package/dist/utility/wrun/wrun-option-contract-flow.util.d.ts +51 -10
- package/dist/utility/wrun/wrun-option-contract-flow.util.js +85 -33
- package/dist/utility/wrun/wrun-option-prints.util.d.ts +172 -3
- package/dist/utility/wrun/wrun-option-prints.util.js +394 -17
- package/dist/utility/wrun/wrun-option-strike-flow-lane.util.d.ts +99 -0
- package/dist/utility/wrun/wrun-option-strike-flow-lane.util.js +218 -0
- package/dist/utility/wrun/wrun-option-strike-flow.util.d.ts +365 -0
- package/dist/utility/wrun/wrun-option-strike-flow.util.js +797 -0
- package/dist/utility/wrun/wrun-option-views.util.d.ts +231 -7
- package/dist/utility/wrun/wrun-option-views.util.js +643 -23
- package/dist/utility/wrun/wrun-options-chain.util.d.ts +6 -4
- package/dist/utility/wrun/wrun-options-chain.util.js +8 -5
- 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-overlay-drivers.util.d.ts +3 -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-recovery.util.d.ts +9 -1
- package/dist/utility/wrun/wrun-overlay-recovery.util.js +32 -3
- 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 +34 -6
- package/dist/utility/wrun/wrun-overlay-run.util.js +527 -180
- package/dist/utility/wrun/wrun-pack-widths.leaf.d.ts +15 -0
- package/dist/utility/wrun/wrun-pack-widths.leaf.js +22 -0
- package/dist/utility/wrun/wrun-pack.util.d.ts +13 -8
- package/dist/utility/wrun/wrun-pack.util.js +38 -21
- package/dist/utility/wrun/wrun-panel-mount.util.d.ts +4 -0
- package/dist/utility/wrun/wrun-panel-mount.util.js +62 -22
- package/dist/utility/wrun/wrun-panel-style.util.d.ts +41 -14
- package/dist/utility/wrun/wrun-panel-style.util.js +86 -26
- package/dist/utility/wrun/wrun-param-map.util.d.ts +7 -6
- package/dist/utility/wrun/wrun-param-map.util.js +8 -5
- package/dist/utility/wrun/wrun-param-values.util.d.ts +10 -2
- package/dist/utility/wrun/wrun-param-values.util.js +2 -0
- package/dist/utility/wrun/wrun-pin-spelling.util.js +19 -10
- package/dist/utility/wrun/wrun-prefix-lanes.util.js +2 -2
- package/dist/utility/wrun/wrun-refusal.util.js +17 -2
- package/dist/utility/wrun/wrun-script-inputs.util.d.ts +20 -0
- package/dist/utility/wrun/wrun-script-inputs.util.js +43 -0
- package/dist/utility/wrun/wrun-source-rows.util.d.ts +4 -0
- package/dist/utility/wrun/wrun-source-rows.util.js +92 -40
- package/dist/utility/wrun/wrun-tape-source.util.d.ts +133 -48
- package/dist/utility/wrun/wrun-tape-source.util.js +205 -62
- 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/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 +11 -11
|
@@ -5,12 +5,13 @@ import { type OmTargetMetadata } from './om-target.util.js';
|
|
|
5
5
|
* The frontend's market-kind vocabulary: TitanCharts' `MarketKind` union plus
|
|
6
6
|
* FE-owned kinds for governed CME venues (`'futures'`), HyperLiquid
|
|
7
7
|
* prediction markets (`'hip4'`), economic series (`'economic'`: FRED and
|
|
8
|
-
* the ECONOMICS catalog publishers, which the engine still knows as `'fred'`)
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
8
|
+
* the ECONOMICS catalog publishers, which the engine still knows as `'fred'`),
|
|
9
|
+
* the crypto-wide indices (`'cryptoIndex'`: CRYPTOCAP's BTC.D, TOTAL, ...)
|
|
10
|
+
* and the perpetual venues that publish quotes, never trades (`'quotePerp'`:
|
|
11
|
+
* Variational, quote-perp.leaf). TitanCharts does not know these kinds;
|
|
12
|
+
* anything handed into the engine narrows through `toTitanMarketKind`.
|
|
12
13
|
*/
|
|
13
|
-
export type VenueMarketKind = Exclude<MarketKind, 'fred'> | 'economic' | 'futures' | 'hip4' | 'options' | 'cryptoIndex';
|
|
14
|
+
export type VenueMarketKind = Exclude<MarketKind, 'fred'> | 'economic' | 'futures' | 'hip4' | 'options' | 'cryptoIndex' | 'quotePerp';
|
|
14
15
|
/** Which wire path serves an economic series (see `economicSource`). */
|
|
15
16
|
export type EconomicSource = 'fred' | 'observation';
|
|
16
17
|
/**
|
|
@@ -127,15 +128,16 @@ export declare function checkIsForexCommodityOrFutures(exchange: string | undefi
|
|
|
127
128
|
* the engine's `'fred'` (single-value series treatment); `'cryptoIndex'`
|
|
128
129
|
* maps to `'crypto'`: the indices print 24/7 (about every 250 ms after a
|
|
129
130
|
* price move, every 5 s per coin) onto uniform bars from 1m up, the crypto
|
|
130
|
-
* treatment's own shape, gap policy included.
|
|
131
|
-
* the
|
|
131
|
+
* treatment's own shape, gap policy included. `'quotePerp'` maps to
|
|
132
|
+
* `'crypto'` too: its perpetuals quote around the clock onto uniform minute
|
|
133
|
+
* bars. FE-internal code always sees the honest venue kind.
|
|
132
134
|
*/
|
|
133
135
|
export declare function toTitanMarketKind(kind: VenueMarketKind): MarketKind;
|
|
134
136
|
/**
|
|
135
137
|
* True when TitanCharts must omit the dedicated 'volume' legend overlay:
|
|
136
|
-
* economic series, forex/commodity venues
|
|
137
|
-
* per-bar volume. Governed CME futures
|
|
138
|
-
* bars, so they keep it.
|
|
138
|
+
* economic series, forex/commodity venues, the crypto indices and the
|
|
139
|
+
* quote-priced perpetual venues ship no per-bar volume. Governed CME futures
|
|
140
|
+
* DO ship contracts volume on TRADE_AGG bars, so they keep it.
|
|
139
141
|
*/
|
|
140
142
|
export declare function venueOmitsVolumeOverlay(exchange: string | undefined | null): boolean;
|
|
141
143
|
export declare function checkIsDex(exchange: string | undefined | null): boolean;
|
|
@@ -2,6 +2,7 @@ import { MARKET_CAPABILITIES, ONCHAIN_POOL_CAPABILITIES, } from '../../constants
|
|
|
2
2
|
import { isBlkExchange } from '../blk-market.util.js';
|
|
3
3
|
import { ECONOMIC_EXCHANGES, FRED_EXCHANGE } from '../../constants/economic.constants.js';
|
|
4
4
|
import { CRYPTO_INDEX_EXCHANGES } from './crypto-index.leaf.js';
|
|
5
|
+
import { QUOTE_PERP_EXCHANGES } from './quote-perp.leaf.js';
|
|
5
6
|
import { isCmeGoverned, normalizeExchangeCode } from './cme-realtime.util.js';
|
|
6
7
|
import { isGovernedPlaneExchange } from '../v2/gate-plane.util.js';
|
|
7
8
|
import { isOmTargetPane } from './om-target.util.js';
|
|
@@ -80,6 +81,11 @@ const EXCHANGE_TO_KIND = {
|
|
|
80
81
|
// Crypto-wide indices (CRYPTOCAP): value prints 24/7 with no trades,
|
|
81
82
|
// volume or book behind them (crypto-index.leaf owns the list).
|
|
82
83
|
...Object.fromEntries(CRYPTO_INDEX_EXCHANGES.map((code) => [code, 'cryptoIndex'])),
|
|
84
|
+
// Perpetual venues that publish quotes, never trades (Variational): TICKER
|
|
85
|
+
// candles and prints, funding and open interest, no trades, volume or book
|
|
86
|
+
// (quote-perp.leaf owns the list). Unlisted, they read as crypto and ask for
|
|
87
|
+
// trades the gateway never serves them.
|
|
88
|
+
...Object.fromEntries(QUOTE_PERP_EXCHANGES.map((code) => [code, 'quotePerp'])),
|
|
83
89
|
// Polymarket
|
|
84
90
|
POLYMARKET: 'polymarket',
|
|
85
91
|
// Hip3 (Hyperliquid synthetic derivatives)
|
|
@@ -285,8 +291,9 @@ export function checkIsForexCommodityOrFutures(exchange) {
|
|
|
285
291
|
* the engine's `'fred'` (single-value series treatment); `'cryptoIndex'`
|
|
286
292
|
* maps to `'crypto'`: the indices print 24/7 (about every 250 ms after a
|
|
287
293
|
* price move, every 5 s per coin) onto uniform bars from 1m up, the crypto
|
|
288
|
-
* treatment's own shape, gap policy included.
|
|
289
|
-
* the
|
|
294
|
+
* treatment's own shape, gap policy included. `'quotePerp'` maps to
|
|
295
|
+
* `'crypto'` too: its perpetuals quote around the clock onto uniform minute
|
|
296
|
+
* bars. FE-internal code always sees the honest venue kind.
|
|
290
297
|
*/
|
|
291
298
|
export function toTitanMarketKind(kind) {
|
|
292
299
|
if (kind === 'futures' || kind === 'options')
|
|
@@ -295,18 +302,21 @@ export function toTitanMarketKind(kind) {
|
|
|
295
302
|
return 'polymarket';
|
|
296
303
|
if (kind === 'economic')
|
|
297
304
|
return 'fred';
|
|
298
|
-
if (kind === 'cryptoIndex')
|
|
305
|
+
if (kind === 'cryptoIndex' || kind === 'quotePerp')
|
|
299
306
|
return 'crypto';
|
|
300
307
|
return kind;
|
|
301
308
|
}
|
|
302
309
|
/**
|
|
303
310
|
* True when TitanCharts must omit the dedicated 'volume' legend overlay:
|
|
304
|
-
* economic series, forex/commodity venues
|
|
305
|
-
* per-bar volume. Governed CME futures
|
|
306
|
-
* bars, so they keep it.
|
|
311
|
+
* economic series, forex/commodity venues, the crypto indices and the
|
|
312
|
+
* quote-priced perpetual venues ship no per-bar volume. Governed CME futures
|
|
313
|
+
* DO ship contracts volume on TRADE_AGG bars, so they keep it.
|
|
307
314
|
*/
|
|
308
315
|
export function venueOmitsVolumeOverlay(exchange) {
|
|
309
|
-
|
|
316
|
+
if (checkIsEconomic(exchange) || checkIsForexOrCommodity(exchange))
|
|
317
|
+
return true;
|
|
318
|
+
const kind = getMarketKind(exchange);
|
|
319
|
+
return kind === 'cryptoIndex' || kind === 'quotePerp';
|
|
310
320
|
}
|
|
311
321
|
export function checkIsDex(exchange) {
|
|
312
322
|
return getMarketKind(exchange) === 'dex';
|
|
@@ -43,13 +43,13 @@ export declare function invalidSeriesStyleWord(series: Record<string, unknown>,
|
|
|
43
43
|
* style word it does not declare (a declared word always wins). Tuned against the approved mock
|
|
44
44
|
* (openmarket mocks/yzi-chart-style), within what the engine draws:
|
|
45
45
|
*
|
|
46
|
-
* - bars, histogram
|
|
47
|
-
*
|
|
48
|
-
* -
|
|
49
|
-
* `
|
|
50
|
-
* -
|
|
51
|
-
*
|
|
52
|
-
*
|
|
46
|
+
* - bars, histogram, line, scatter: no chrome word, so the plain default both lanes share
|
|
47
|
+
* (`hairlines`, wrunPanelChrome): value hairlines, no frame, no vertical grid.
|
|
48
|
+
* - bars, histogram: bars at about half their slot with a rounded data end (`bar_width`,
|
|
49
|
+
* `bar_radius`).
|
|
50
|
+
* - line: a smoothed stroke and a fading fill.
|
|
51
|
+
* - scatter: points in the engine's own default teal at half opacity, so a dense cloud reads as
|
|
52
|
+
* density. A row's own colour wins.
|
|
53
53
|
* - pie: no frame, 2 px gaps between slices and the total in the hole when the pie has one.
|
|
54
54
|
* Slices keep their leader-line labels (name and percent); a pie that declares
|
|
55
55
|
* `legend_style: 'title'` lists them as chips beside the title instead, as on the wrun lane
|
|
@@ -63,6 +63,8 @@ const guide = shape({
|
|
|
63
63
|
const ALL = ['bars', 'line', 'scatter', 'histogram', 'pie', 'heatmap', 'table', 'tiles'];
|
|
64
64
|
const AXIS = ['line', 'bars', 'histogram', 'scatter'];
|
|
65
65
|
const BARS = ['bars', 'histogram'];
|
|
66
|
+
/** A chrome word the sheet type gains without a key here fails to compile. */
|
|
67
|
+
const CHROME_WORDS = Object.keys({ box: 1, grid: 1, none: 1, hairlines: 1 });
|
|
66
68
|
/** Every panel style word: its valid values and the kinds it applies to (the SDK's table, plus
|
|
67
69
|
* the two bar words). A word the interface gains without a rule here fails to compile. */
|
|
68
70
|
const PANEL_WORD_RULES = {
|
|
@@ -71,7 +73,7 @@ const PANEL_WORD_RULES = {
|
|
|
71
73
|
stats_row: { kinds: ['line'], valid: bool },
|
|
72
74
|
font_family: { kinds: ALL, valid: oneOf(WRUN_FONT_FAMILIES) },
|
|
73
75
|
hover_card: { kinds: ['line', 'bars', 'histogram', 'scatter', 'pie', 'heatmap', 'tiles'], valid: bool },
|
|
74
|
-
chrome: { kinds: ['line', 'bars', 'histogram', 'scatter', 'pie'], valid: oneOf(
|
|
76
|
+
chrome: { kinds: ['line', 'bars', 'histogram', 'scatter', 'pie'], valid: oneOf(CHROME_WORDS) },
|
|
75
77
|
format: { kinds: ALL, valid: format },
|
|
76
78
|
decimals: { kinds: ALL, valid: decimals },
|
|
77
79
|
signed: { kinds: ALL, valid: bool },
|
|
@@ -192,8 +194,8 @@ export const PANEL_SERIES_STYLE_WORDS = new Set(Object.keys(SERIES_WORD_RULES));
|
|
|
192
194
|
/** The words the kit does not validate yet: checked on the wrun lane too. */
|
|
193
195
|
const APP_CHECKED_WORDS = new Set(['bar_width', 'bar_radius']);
|
|
194
196
|
/** The SDK's conditions past the kind table: x words need a numeric x (or a scatter), the side
|
|
195
|
-
* box needs place side, a pie
|
|
196
|
-
* one (wrunPanelAllowsWord and refineWrunPanelStyle). */
|
|
197
|
+
* box needs place side, a pie's chrome is box or none, chips are a line legend and pane a line or
|
|
198
|
+
* bars one (wrunPanelAllowsWord and refineWrunPanelStyle). */
|
|
197
199
|
function fitsPanel(scope, word, value) {
|
|
198
200
|
const numeric = scope.x === 'index' || scope.x === 'number';
|
|
199
201
|
switch (word) {
|
|
@@ -207,7 +209,7 @@ function fitsPanel(scope, word, value) {
|
|
|
207
209
|
case 'height_px':
|
|
208
210
|
return scope.place === 'side';
|
|
209
211
|
case 'chrome':
|
|
210
|
-
return
|
|
212
|
+
return scope.kind !== 'pie' || value === 'box' || value === 'none';
|
|
211
213
|
case 'legend_style':
|
|
212
214
|
if (value === 'chips')
|
|
213
215
|
return scope.kind === 'line';
|
|
@@ -250,13 +252,13 @@ export function invalidSeriesStyleWord(series, kind) {
|
|
|
250
252
|
* style word it does not declare (a declared word always wins). Tuned against the approved mock
|
|
251
253
|
* (openmarket mocks/yzi-chart-style), within what the engine draws:
|
|
252
254
|
*
|
|
253
|
-
* - bars, histogram
|
|
254
|
-
*
|
|
255
|
-
* -
|
|
256
|
-
* `
|
|
257
|
-
* -
|
|
258
|
-
*
|
|
259
|
-
*
|
|
255
|
+
* - bars, histogram, line, scatter: no chrome word, so the plain default both lanes share
|
|
256
|
+
* (`hairlines`, wrunPanelChrome): value hairlines, no frame, no vertical grid.
|
|
257
|
+
* - bars, histogram: bars at about half their slot with a rounded data end (`bar_width`,
|
|
258
|
+
* `bar_radius`).
|
|
259
|
+
* - line: a smoothed stroke and a fading fill.
|
|
260
|
+
* - scatter: points in the engine's own default teal at half opacity, so a dense cloud reads as
|
|
261
|
+
* density. A row's own colour wins.
|
|
260
262
|
* - pie: no frame, 2 px gaps between slices and the total in the hole when the pie has one.
|
|
261
263
|
* Slices keep their leader-line labels (name and percent); a pie that declares
|
|
262
264
|
* `legend_style: 'title'` lists them as chips beside the title instead, as on the wrun lane
|
|
@@ -266,10 +268,10 @@ export function invalidSeriesStyleWord(series, kind) {
|
|
|
266
268
|
* - heatmap, tiles: no word to quiet them; today's look stands.
|
|
267
269
|
*/
|
|
268
270
|
export const OM_PANEL_QUIET_DEFAULTS = {
|
|
269
|
-
bars: {
|
|
270
|
-
histogram: {
|
|
271
|
-
line: {
|
|
272
|
-
scatter: {
|
|
271
|
+
bars: { bar_width: 0.52, bar_radius: 3 },
|
|
272
|
+
histogram: { bar_width: 0.52, bar_radius: 3 },
|
|
273
|
+
line: { smooth: true, fill_fade: true },
|
|
274
|
+
scatter: { color: '#43d3c380' },
|
|
273
275
|
pie: { chrome: 'none', slice_gap: 2 },
|
|
274
276
|
table: { border_width: 0, grid_lines: 'rows', grid_width: 1 },
|
|
275
277
|
};
|
|
@@ -118,6 +118,17 @@ export interface PanelTableCellContext {
|
|
|
118
118
|
* (SC14 SC22 SC35); a cell without an alignment takes its column's. A missing
|
|
119
119
|
* reading (`null`) is an empty cell. */
|
|
120
120
|
export declare function engineTableCell(cell: ParsedPanel['rows'][number][number], column?: PanelTableColumn, ctx?: PanelTableCellContext): unknown;
|
|
121
|
+
/**
|
|
122
|
+
* A wrun table frame without its all-empty columns (C4): a column whose every body cell shows nothing
|
|
123
|
+
* (isEmptyTableCell) leaves the frame whole, its series entry (the header cell, its alignment and number words), its
|
|
124
|
+
* cell in every row and its `column_widths` entry together, so every remaining column keeps its own words. Never a
|
|
125
|
+
* column a colspan or rowspan touches (a span counts columns by place, so a dropped one would move it), never column
|
|
126
|
+
* 0 under `header_column` (the row headers), and never every column (the header of a table with no reading yet
|
|
127
|
+
* stays). A frame with nothing to drop, a frame of another kind and a frame with no rows come back as they are. The
|
|
128
|
+
* wrun child mount runs it ahead of the translation and its formatter, so both read the kept columns by their new
|
|
129
|
+
* index; the om push lane never calls it. `chrome.markets` names rows, so it stays.
|
|
130
|
+
*/
|
|
131
|
+
export declare function withoutEmptyTableColumns(frame: ParsedPanel): ParsedPanel;
|
|
121
132
|
/** Labels for a time-keyed curve or bars panel, as short as the key set
|
|
122
133
|
* allows: clock times inside one day, dates for day-aligned keys, a year
|
|
123
134
|
* only past a year. `offsetMs` is the chart's display-timezone shift
|
|
@@ -60,7 +60,6 @@ const FONT_WEIGHTS = new Set(['normal', 'medium', 'bold']);
|
|
|
60
60
|
const VALUE_FORMATS = new Set(WRUN_VALUE_FORMATS);
|
|
61
61
|
/** The pane kinds whose `chrome` word reaches the engine as `chromeStyle`. */
|
|
62
62
|
const CHROME_KINDS = new Set(['line', 'bars', 'histogram', 'scatter', 'pie']);
|
|
63
|
-
const DEFAULT_HEATMAP_PALETTE = ['#e06c75', '#7a7f93', '#98c379'];
|
|
64
63
|
/** Chart-shaped panels (bars, curves, scatter, pie, heatmap, tiles) keep one weight below the chart. */
|
|
65
64
|
export const PANEL_CHART_GRID_HEIGHT = 0.22;
|
|
66
65
|
/** The engine's table defaults: 12 px text with 8 px cell padding gives 28 px rows, 8 px edge padding. */
|
|
@@ -485,6 +484,65 @@ export function engineTableCell(cell, column = {}, ctx = {}) {
|
|
|
485
484
|
...(entry.font_weight !== undefined ? { fontWeight: wrunFontWeightCss(entry.font_weight) } : {}),
|
|
486
485
|
};
|
|
487
486
|
}
|
|
487
|
+
/** A table cell that shows nothing: a missing reading (`null`), no cell, empty text, or a styled cell with no text,
|
|
488
|
+
* no value, no bar and no spark. A styled cell with only a background (a fill or a gradient) shows its fill, so it
|
|
489
|
+
* is not empty. */
|
|
490
|
+
function isEmptyTableCell(cell) {
|
|
491
|
+
if (cell === null || cell === undefined || cell === '')
|
|
492
|
+
return true;
|
|
493
|
+
if (!isRecord(cell))
|
|
494
|
+
return false;
|
|
495
|
+
const entry = cell;
|
|
496
|
+
return ((entry.text === undefined || entry.text === '') &&
|
|
497
|
+
entry.value === undefined &&
|
|
498
|
+
entry.bar === undefined &&
|
|
499
|
+
(entry.spark === undefined || entry.spark.length === 0) &&
|
|
500
|
+
entry.background_color === undefined &&
|
|
501
|
+
entry.gradient === undefined);
|
|
502
|
+
}
|
|
503
|
+
/** The span a table cell declares past its own column and row (1 when none). */
|
|
504
|
+
function cellSpan(cell, key) {
|
|
505
|
+
const span = isRecord(cell) ? cell[key] : undefined;
|
|
506
|
+
return typeof span === 'number' && span > 1 ? span : 1;
|
|
507
|
+
}
|
|
508
|
+
/**
|
|
509
|
+
* A wrun table frame without its all-empty columns (C4): a column whose every body cell shows nothing
|
|
510
|
+
* (isEmptyTableCell) leaves the frame whole, its series entry (the header cell, its alignment and number words), its
|
|
511
|
+
* cell in every row and its `column_widths` entry together, so every remaining column keeps its own words. Never a
|
|
512
|
+
* column a colspan or rowspan touches (a span counts columns by place, so a dropped one would move it), never column
|
|
513
|
+
* 0 under `header_column` (the row headers), and never every column (the header of a table with no reading yet
|
|
514
|
+
* stays). A frame with nothing to drop, a frame of another kind and a frame with no rows come back as they are. The
|
|
515
|
+
* wrun child mount runs it ahead of the translation and its formatter, so both read the kept columns by their new
|
|
516
|
+
* index; the om push lane never calls it. `chrome.markets` names rows, so it stays.
|
|
517
|
+
*/
|
|
518
|
+
export function withoutEmptyTableColumns(frame) {
|
|
519
|
+
const { panel, rows } = frame;
|
|
520
|
+
const series = panel.series;
|
|
521
|
+
if (panel.kind !== 'table' || series === undefined || rows.length === 0)
|
|
522
|
+
return frame;
|
|
523
|
+
const kept = new Set();
|
|
524
|
+
if (panel.header_column === true)
|
|
525
|
+
kept.add(0);
|
|
526
|
+
rows.forEach((row) => row.forEach((cell, column) => {
|
|
527
|
+
const colspan = cellSpan(cell, 'colspan');
|
|
528
|
+
const spanned = colspan > 1 || cellSpan(cell, 'rowspan') > 1;
|
|
529
|
+
for (let at = column; at < column + colspan; at += 1)
|
|
530
|
+
if (spanned || !isEmptyTableCell(cell))
|
|
531
|
+
kept.add(at);
|
|
532
|
+
}));
|
|
533
|
+
if (kept.size === 0 || kept.size >= series.length)
|
|
534
|
+
return frame;
|
|
535
|
+
const keep = (entries) => entries.filter((_, column) => kept.has(column));
|
|
536
|
+
return {
|
|
537
|
+
...frame,
|
|
538
|
+
panel: {
|
|
539
|
+
...panel,
|
|
540
|
+
series: keep(series),
|
|
541
|
+
...(panel.column_widths !== undefined ? { column_widths: keep(panel.column_widths) } : {}),
|
|
542
|
+
},
|
|
543
|
+
rows: rows.map((row) => keep(row)),
|
|
544
|
+
};
|
|
545
|
+
}
|
|
488
546
|
const pad2 = (value) => String(value).padStart(2, '0');
|
|
489
547
|
/** Labels for a time-keyed curve or bars panel, as short as the key set
|
|
490
548
|
* allows: clock times inside one day, dates for day-aligned keys, a year
|
|
@@ -615,9 +673,10 @@ export function translatePanelToEngine(frame, ctx = {}) {
|
|
|
615
673
|
let settings;
|
|
616
674
|
if (panel.x === 'time') {
|
|
617
675
|
const sorted = [...rows].sort((a, b) => a[0] - b[0]);
|
|
618
|
-
if (effective
|
|
619
|
-
// The rich curve
|
|
620
|
-
//
|
|
676
|
+
if (effective !== 'box') {
|
|
677
|
+
// The rich curve (every chrome but box, the hairlines default too)
|
|
678
|
+
// spaces points by their time (gaps stay gaps) and labels the axis
|
|
679
|
+
// in the chart's display timezone (SC37).
|
|
621
680
|
panelRows = sorted.map((row) => [timeKeyMs(row[0]), ...row.slice(1)]);
|
|
622
681
|
settings = {
|
|
623
682
|
series,
|
|
@@ -711,11 +770,11 @@ export function translatePanelToEngine(frame, ctx = {}) {
|
|
|
711
770
|
const yKeys = [...new Set(rows.map((row) => row[1]))];
|
|
712
771
|
const xIndices = new Map(xKeys.map((key, index) => [key, index]));
|
|
713
772
|
const yIndices = new Map(yKeys.map((key, index) => [key, index]));
|
|
773
|
+
// The palette is the heatmap mapper's (wrunHeatmapStyle: the declared or
|
|
774
|
+
// default stops; none under the engine's signed scale, SC06).
|
|
714
775
|
const settings = {
|
|
715
776
|
rowLabels: yKeys.map(String),
|
|
716
777
|
colLabels: xKeys.map(String),
|
|
717
|
-
// The signed scale is the engine's own diverging default (SC06).
|
|
718
|
-
...(panel.scale === 'signed' ? {} : { palette: [...DEFAULT_HEATMAP_PALETTE] }),
|
|
719
778
|
fontFamily,
|
|
720
779
|
};
|
|
721
780
|
const result = finish('matrix', rows.map((row) => [yIndices.get(row[1]), xIndices.get(row[0]), row[2]]), settings);
|
|
@@ -44,6 +44,22 @@ export declare function resolveProfileRowHeight(settings: ProfileRowSettings, mi
|
|
|
44
44
|
* re-grid refetch.
|
|
45
45
|
*/
|
|
46
46
|
export declare function resolveAdoptedProfileBlockSize(servedBlockSize: unknown, persistedMinimumBarHeight: unknown): number | null;
|
|
47
|
+
/**
|
|
48
|
+
* The block an answer's rows are built on: the overlay's held base when the
|
|
49
|
+
* served block is finer and the base is a whole multiple of it, else the
|
|
50
|
+
* served block. The gateway serves each answer on its own row (the requested
|
|
51
|
+
* row raised to the coarsest grid in the window, tsdb-gateway docs/vp-grid.md),
|
|
52
|
+
* so a short window can answer finer than the base a long window adopted
|
|
53
|
+
* (COINBASE BTC-USD 1d, 2026-10-22: the history on 10, the forming-tail poll
|
|
54
|
+
* on 5). Built on the base, those rows merge whole into base rows the way a
|
|
55
|
+
* "Ticks per bar" multiple merges them, so an overlay keeps one grid and its
|
|
56
|
+
* newest columns stop drawing on another one. A served block that is coarser,
|
|
57
|
+
* or does not nest (a legacy grid), keeps its own grid. Shared by the workers
|
|
58
|
+
* (the grid they build on) and the response adopt (which then has nothing to
|
|
59
|
+
* adopt), so both read one rule.
|
|
60
|
+
*/
|
|
61
|
+
export declare function resolveHeldProfileBlockSize(servedBlockSize: number, heldBlockSize: unknown): number;
|
|
62
|
+
export declare function resolveHeldProfileBlockSize(servedBlockSize: number | undefined, heldBlockSize: unknown): number | undefined;
|
|
47
63
|
/**
|
|
48
64
|
* The effective row size the "Ticks per bar" multiplier produces
|
|
49
65
|
* (minimumBarHeight x multiplier), formatted at the base block's precision so
|
|
@@ -106,6 +106,13 @@ export function resolveAdoptedProfileBlockSize(servedBlockSize, persistedMinimum
|
|
|
106
106
|
const scale = Math.max(servedBlockSize, persistedMinimumBarHeight);
|
|
107
107
|
return Math.abs(servedBlockSize - persistedMinimumBarHeight) > scale * 1e-9 ? servedBlockSize : null;
|
|
108
108
|
}
|
|
109
|
+
export function resolveHeldProfileBlockSize(servedBlockSize, heldBlockSize) {
|
|
110
|
+
if (!isPositiveFinite(servedBlockSize) || !isPositiveFinite(heldBlockSize))
|
|
111
|
+
return servedBlockSize;
|
|
112
|
+
const ratio = heldBlockSize / servedBlockSize;
|
|
113
|
+
const whole = Math.round(ratio);
|
|
114
|
+
return whole >= 2 && Math.abs(ratio - whole) <= whole * 1e-9 ? heldBlockSize : servedBlockSize;
|
|
115
|
+
}
|
|
109
116
|
/**
|
|
110
117
|
* The effective row size the "Ticks per bar" multiplier produces
|
|
111
118
|
* (minimumBarHeight x multiplier), formatted at the base block's precision so
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Perpetual venues that publish quotes and never trades: Variational Omni, an RFQ venue (VARIATIONAL carries its
|
|
3
|
+
* perpetuals, crypto and RWA alike; VARIATIONAL_SWAP its swaps). The backend prints each market as raw TICKER points
|
|
4
|
+
* and serves its candles as TICKER_AGG on tsdb-gateway v2 (open/high/low/close, no volume), plus FUNDING_RATE_AGG and
|
|
5
|
+
* OPEN_INTEREST_AGG; no trade type lists them (the gateway's `tickerPricedExchanges`, open_interest_agg.go). See
|
|
6
|
+
* docs/features/data/quote-perp-venues.md.
|
|
7
|
+
*
|
|
8
|
+
* A leaf on purpose, with no imports, like crypto-index.leaf: the market-kind table (`marketKind.util`) and the ticker
|
|
9
|
+
* hub (`index-mode.util`) both read it, and web code asks `checkIsQuotePerp` here, never through those two modules,
|
|
10
|
+
* which over a hundred specs mock with partial factories.
|
|
11
|
+
*/
|
|
12
|
+
export declare const QUOTE_PERP_EXCHANGES: readonly ["VARIATIONAL", "VARIATIONAL_SWAP"];
|
|
13
|
+
/**
|
|
14
|
+
* A quote-priced perpetual venue (`QUOTE_PERP_EXCHANGES`), the `'quotePerp'` market kind. Case-insensitive like the
|
|
15
|
+
* kind table, and a foreign shape (a persisted object, a number) is no venue, never a throw.
|
|
16
|
+
*/
|
|
17
|
+
export declare function checkIsQuotePerp(exchange: string | undefined | null): boolean;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Perpetual venues that publish quotes and never trades: Variational Omni, an RFQ venue (VARIATIONAL carries its
|
|
3
|
+
* perpetuals, crypto and RWA alike; VARIATIONAL_SWAP its swaps). The backend prints each market as raw TICKER points
|
|
4
|
+
* and serves its candles as TICKER_AGG on tsdb-gateway v2 (open/high/low/close, no volume), plus FUNDING_RATE_AGG and
|
|
5
|
+
* OPEN_INTEREST_AGG; no trade type lists them (the gateway's `tickerPricedExchanges`, open_interest_agg.go). See
|
|
6
|
+
* docs/features/data/quote-perp-venues.md.
|
|
7
|
+
*
|
|
8
|
+
* A leaf on purpose, with no imports, like crypto-index.leaf: the market-kind table (`marketKind.util`) and the ticker
|
|
9
|
+
* hub (`index-mode.util`) both read it, and web code asks `checkIsQuotePerp` here, never through those two modules,
|
|
10
|
+
* which over a hundred specs mock with partial factories.
|
|
11
|
+
*/
|
|
12
|
+
export const QUOTE_PERP_EXCHANGES = ['VARIATIONAL', 'VARIATIONAL_SWAP'];
|
|
13
|
+
const QUOTE_PERP_EXCHANGES_SET = new Set(QUOTE_PERP_EXCHANGES);
|
|
14
|
+
/**
|
|
15
|
+
* A quote-priced perpetual venue (`QUOTE_PERP_EXCHANGES`), the `'quotePerp'` market kind. Case-insensitive like the
|
|
16
|
+
* kind table, and a foreign shape (a persisted object, a number) is no venue, never a throw.
|
|
17
|
+
*/
|
|
18
|
+
export function checkIsQuotePerp(exchange) {
|
|
19
|
+
return typeof exchange === 'string' && QUOTE_PERP_EXCHANGES_SET.has(exchange.toUpperCase());
|
|
20
|
+
}
|
|
@@ -46,6 +46,12 @@ export interface WindowGeometryMeta {
|
|
|
46
46
|
settings?: Record<string, unknown>;
|
|
47
47
|
rawData?: unknown;
|
|
48
48
|
data?: unknown;
|
|
49
|
+
/** An owner's own plots (titan nests every output of a kScript container) and the run titan applied last: what
|
|
50
|
+
* its pane draws (ownerPaneDrawsNothing). */
|
|
51
|
+
nestedMeta?: unknown;
|
|
52
|
+
runResult?: unknown;
|
|
53
|
+
/** The window hid this owner's pane (window-owner.leaf WindowHiddenPaneMeta, C5). */
|
|
54
|
+
wrunWindowHidPane?: boolean;
|
|
49
55
|
}
|
|
50
56
|
export interface WindowGeometryChart {
|
|
51
57
|
metadata: ReadonlyArray<WindowGeometryMeta>;
|
|
@@ -58,6 +64,9 @@ export interface WindowGeometryChart {
|
|
|
58
64
|
} | null;
|
|
59
65
|
updateSettings?(id: string, payload: Record<string, unknown>): unknown;
|
|
60
66
|
resizeCanvasOnce?(): void;
|
|
67
|
+
/** titan's pane collapse: `hide` takes the pane out of the stack (its `isPaneHidden`, its height kept for the way
|
|
68
|
+
* back) and leaves the overlay's eye alone, unlike `togglePane`, which hides the plot too. */
|
|
69
|
+
togglePaneWithAnimation?(id: string, hide: boolean): void;
|
|
61
70
|
}
|
|
62
71
|
/** The body rows of a table pane (a mounted meta or an addOverlay config):
|
|
63
72
|
* its one decorator row's grid minus the header; undefined when unreadable. */
|
|
@@ -67,6 +76,16 @@ export declare function tableRowCountOf(pane: {
|
|
|
67
76
|
}): number | undefined;
|
|
68
77
|
/** The owner's mounted window panes, in stack order, classified for the planner. */
|
|
69
78
|
export declare function mountedWindowPanes(metadata: ReadonlyArray<WindowGeometryMeta>, ownerId: string): WindowPane[];
|
|
79
|
+
/**
|
|
80
|
+
* Whether an owner's own pane draws nothing (C5): an offchart owner that holds only its run's empty container (plot
|
|
81
|
+
* `empty`: every wrun run mounts its outputs as the container's nested plots) and whose every nested plot is hidden,
|
|
82
|
+
* or that has none (every output data only, left out on this market, or hidden by its Style row), with no drawing in
|
|
83
|
+
* its last applied run and no message on its legend row (an error or the inert legend show there). The registry homes
|
|
84
|
+
* an owner offchart when its first output's panel is `lower`, even when every output is hidden (the app's
|
|
85
|
+
* wrun-registry-loader `packagePosition`), and that empty pane took a share of a window of tables. False until a run
|
|
86
|
+
* landed on the meta (what the pane draws is not known yet) and for any other meta.
|
|
87
|
+
*/
|
|
88
|
+
export declare function ownerPaneDrawsNothing(meta: Pick<WindowGeometryMeta, 'type' | 'plot' | 'settings' | 'nestedMeta' | 'runResult'>): boolean;
|
|
70
89
|
/** Whether the candle pane is hidden on this engine: the window layout is in force. */
|
|
71
90
|
export declare function isMainPaneHidden(metadata: ReadonlyArray<WindowGeometryMeta>): boolean;
|
|
72
91
|
/**
|
|
@@ -104,7 +123,9 @@ export declare function savedWindowSplit(ownerSettings: Record<string, unknown>
|
|
|
104
123
|
* nothing held, the reader's saved split (savedWindowSplit over the owner's
|
|
105
124
|
* engine copy, patched in step with the row) is the plan while it names
|
|
106
125
|
* exactly the mounted panes; else the planner's. Main itself is never
|
|
107
|
-
* written.
|
|
126
|
+
* written. First the owner's own pane is settled (settleOwnerPane: hidden
|
|
127
|
+
* while it draws nothing beside other panes, C5), so the plan reads the
|
|
128
|
+
* panes that will show. Returns whether anything was written.
|
|
108
129
|
*/
|
|
109
130
|
export declare function reconcileWindowOwnerGeometry(tc: WindowGeometryChart | null | undefined, ownerId: string, canvasHeightPx?: number): boolean;
|
|
110
131
|
/**
|
|
@@ -114,6 +135,7 @@ export declare function reconcileWindowOwnerGeometry(tc: WindowGeometryChart | n
|
|
|
114
135
|
* Writes only once the candle pane is visible again (the host releases main
|
|
115
136
|
* first), so the engine carves the panes out of main the way a fresh mount
|
|
116
137
|
* would. Keyed by the owner id because the flag is already off by then.
|
|
138
|
+
* An owner pane the window hid (C5) comes back first, as a chart shows it.
|
|
117
139
|
* Returns whether anything was written.
|
|
118
140
|
*/
|
|
119
141
|
export declare function restoreNormalOwnerGeometry(tc: WindowGeometryChart | null | undefined, ownerId: string, canvasHeightPx?: number): boolean;
|
|
@@ -35,6 +35,17 @@
|
|
|
35
35
|
* never squeezed by sum-1 weights. A cell without a flagged owner never gets
|
|
36
36
|
* a write (isWindowCell gates the entry).
|
|
37
37
|
*
|
|
38
|
+
* An owner pane that draws nothing (C5, ownerPaneDrawsNothing: an offchart
|
|
39
|
+
* owner whose every output is hidden or data only) beside other window panes
|
|
40
|
+
* takes no share: the reconcile hides it on the engine (titan's pane
|
|
41
|
+
* collapse, which leaves the owner's eye alone), so the plan, which reads the
|
|
42
|
+
* visible panes, leaves it out and a window whose only drawn panes are tables
|
|
43
|
+
* gives them the whole cell. It comes back when it draws again, when it would
|
|
44
|
+
* be the window's only pane (never a blank window) and on the reversal; a
|
|
45
|
+
* pane the reader hid stays theirs. While hidden, the meta carries the
|
|
46
|
+
* window's mark (window-owner.leaf isPaneHiddenByWindow), so the run gates
|
|
47
|
+
* never take it for the reader's collapse: the owner keeps running.
|
|
48
|
+
*
|
|
38
49
|
* The reader's own split outranks the plan. The reconcile runs at the end of
|
|
39
50
|
* EVERY run of the owner (the child mount calls it on each live tick), so a
|
|
40
51
|
* plan that re-asserts itself there undoes a splitter drag within one tick.
|
|
@@ -194,6 +205,63 @@ function windowPaneOf(meta, ownerId) {
|
|
|
194
205
|
export function mountedWindowPanes(metadata, ownerId) {
|
|
195
206
|
return windowPaneMetas(metadata, ownerId).map((meta) => windowPaneOf(meta, ownerId));
|
|
196
207
|
}
|
|
208
|
+
function isObject(value) {
|
|
209
|
+
return value !== null && typeof value === 'object';
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Whether an owner's own pane draws nothing (C5): an offchart owner that holds only its run's empty container (plot
|
|
213
|
+
* `empty`: every wrun run mounts its outputs as the container's nested plots) and whose every nested plot is hidden,
|
|
214
|
+
* or that has none (every output data only, left out on this market, or hidden by its Style row), with no drawing in
|
|
215
|
+
* its last applied run and no message on its legend row (an error or the inert legend show there). The registry homes
|
|
216
|
+
* an owner offchart when its first output's panel is `lower`, even when every output is hidden (the app's
|
|
217
|
+
* wrun-registry-loader `packagePosition`), and that empty pane took a share of a window of tables. False until a run
|
|
218
|
+
* landed on the meta (what the pane draws is not known yet) and for any other meta.
|
|
219
|
+
*/
|
|
220
|
+
export function ownerPaneDrawsNothing(meta) {
|
|
221
|
+
if (meta.type !== 'offchart' || meta.plot !== 'empty' || !isObject(meta.runResult))
|
|
222
|
+
return false;
|
|
223
|
+
const drawings = meta.runResult.drawings;
|
|
224
|
+
if (Array.isArray(drawings) && drawings.length > 0)
|
|
225
|
+
return false;
|
|
226
|
+
const message = meta.settings?.errorMessage;
|
|
227
|
+
if (isObject(message) && message.show === true)
|
|
228
|
+
return false;
|
|
229
|
+
const plots = meta.nestedMeta;
|
|
230
|
+
return !Array.isArray(plots) || plots.every((plot) => isObject(plot) && plot.isHidden === true);
|
|
231
|
+
}
|
|
232
|
+
/** Show an owner pane the window hid again (its mark, window-owner.leaf; a pane the reader hid carries none and stays
|
|
233
|
+
* hidden), the mark taken off. Returns whether the engine changed. */
|
|
234
|
+
function showOwnerPane(tc, ownerId) {
|
|
235
|
+
const owner = tc.metadata.find((meta) => meta.id === ownerId);
|
|
236
|
+
if (owner?.wrunWindowHidPane !== true)
|
|
237
|
+
return false;
|
|
238
|
+
delete owner.wrunWindowHidPane;
|
|
239
|
+
if (owner.isPaneHidden !== true || typeof tc.togglePaneWithAnimation !== 'function')
|
|
240
|
+
return false;
|
|
241
|
+
tc.togglePaneWithAnimation(ownerId, false);
|
|
242
|
+
return true;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* The owner's own pane under the window layout (C5): hidden while it draws nothing beside another window pane of the
|
|
246
|
+
* owner, so the plan (the visible panes) leaves it out; shown again once it draws or once it would be the window's
|
|
247
|
+
* only pane. Only the pane collapse is used (the owner's eye, which its children follow, is untouched), the meta
|
|
248
|
+
* carries the window's mark while hidden (so the run gates tell it from the reader's collapse, window-owner.leaf
|
|
249
|
+
* isPaneHiddenByWindow), only a marked pane is shown again, and an engine without the collapse keeps today's pane.
|
|
250
|
+
* Returns whether the engine changed.
|
|
251
|
+
*/
|
|
252
|
+
function settleOwnerPane(tc, ownerId) {
|
|
253
|
+
const owner = tc.metadata.find((meta) => meta.id === ownerId);
|
|
254
|
+
if (!owner || owner.type !== 'offchart' || owner.hostPaneId)
|
|
255
|
+
return false;
|
|
256
|
+
const others = tc.metadata.some((meta) => meta.id !== ownerId && isWindowPaneMeta(meta, ownerId));
|
|
257
|
+
if (!others || !ownerPaneDrawsNothing(owner))
|
|
258
|
+
return showOwnerPane(tc, ownerId);
|
|
259
|
+
if (owner.isPaneHidden === true || typeof tc.togglePaneWithAnimation !== 'function')
|
|
260
|
+
return false;
|
|
261
|
+
owner.wrunWindowHidPane = true;
|
|
262
|
+
tc.togglePaneWithAnimation(ownerId, true);
|
|
263
|
+
return true;
|
|
264
|
+
}
|
|
197
265
|
/** Whether the candle pane is hidden on this engine: the window layout is in force. */
|
|
198
266
|
export function isMainPaneHidden(metadata) {
|
|
199
267
|
const main = metadata.find((meta) => meta.id === 'main') ?? metadata[0];
|
|
@@ -288,16 +356,19 @@ export function savedWindowSplit(ownerSettings, panes) {
|
|
|
288
356
|
* nothing held, the reader's saved split (savedWindowSplit over the owner's
|
|
289
357
|
* engine copy, patched in step with the row) is the plan while it names
|
|
290
358
|
* exactly the mounted panes; else the planner's. Main itself is never
|
|
291
|
-
* written.
|
|
359
|
+
* written. First the owner's own pane is settled (settleOwnerPane: hidden
|
|
360
|
+
* while it draws nothing beside other panes, C5), so the plan reads the
|
|
361
|
+
* panes that will show. Returns whether anything was written.
|
|
292
362
|
*/
|
|
293
363
|
export function reconcileWindowOwnerGeometry(tc, ownerId, canvasHeightPx) {
|
|
294
364
|
if (!tc || tc.isDestroyed || typeof tc.updateSettings !== 'function')
|
|
295
365
|
return false;
|
|
296
366
|
if (!isMainPaneHidden(tc.metadata)) {
|
|
297
|
-
// The window layout is not in force: no hold outlives it.
|
|
367
|
+
// The window layout is not in force: no hold outlives it, and an owner pane it hid comes back.
|
|
298
368
|
windowHolds.delete(tc);
|
|
299
|
-
return
|
|
369
|
+
return showOwnerPane(tc, ownerId);
|
|
300
370
|
}
|
|
371
|
+
let written = settleOwnerPane(tc, ownerId);
|
|
301
372
|
const metas = windowPaneMetas(tc.metadata, ownerId);
|
|
302
373
|
const height = canvasHeightPx ?? tc.canvasChartController?.canvasElement?.clientHeight;
|
|
303
374
|
let plan = [];
|
|
@@ -306,7 +377,6 @@ export function reconcileWindowOwnerGeometry(tc, ownerId, canvasHeightPx) {
|
|
|
306
377
|
const owner = tc.metadata.find((candidate) => candidate.id === ownerId);
|
|
307
378
|
plan = savedWindowSplit(owner?.settings, panes) ?? planWindowWeights(panes, height);
|
|
308
379
|
}
|
|
309
|
-
let written = false;
|
|
310
380
|
for (const { id, gridHeight } of plan) {
|
|
311
381
|
const meta = tc.metadata.find((candidate) => candidate.id === id);
|
|
312
382
|
if (!meta)
|
|
@@ -340,6 +410,7 @@ export function reconcileWindowOwnerGeometry(tc, ownerId, canvasHeightPx) {
|
|
|
340
410
|
* Writes only once the candle pane is visible again (the host releases main
|
|
341
411
|
* first), so the engine carves the panes out of main the way a fresh mount
|
|
342
412
|
* would. Keyed by the owner id because the flag is already off by then.
|
|
413
|
+
* An owner pane the window hid (C5) comes back first, as a chart shows it.
|
|
343
414
|
* Returns whether anything was written.
|
|
344
415
|
*/
|
|
345
416
|
export function restoreNormalOwnerGeometry(tc, ownerId, canvasHeightPx) {
|
|
@@ -349,11 +420,12 @@ export function restoreNormalOwnerGeometry(tc, ownerId, canvasHeightPx) {
|
|
|
349
420
|
return false;
|
|
350
421
|
// Back to a chart: the reader's window split ends with the window.
|
|
351
422
|
windowHolds.delete(tc);
|
|
423
|
+
const shown = showOwnerPane(tc, ownerId);
|
|
352
424
|
const panes = mountedWindowPanes(tc.metadata, ownerId);
|
|
353
425
|
if (panes.length === 0)
|
|
354
|
-
return
|
|
426
|
+
return shown;
|
|
355
427
|
const height = canvasHeightPx ?? tc.canvasChartController?.canvasElement?.clientHeight;
|
|
356
|
-
let written =
|
|
428
|
+
let written = shown;
|
|
357
429
|
for (const pane of panes) {
|
|
358
430
|
const meta = tc.metadata.find((candidate) => candidate.id === pane.id);
|
|
359
431
|
if (!meta)
|
|
@@ -17,3 +17,16 @@ export type WindowOwnerOverlay = {
|
|
|
17
17
|
} | null | undefined;
|
|
18
18
|
/** A wrun Indicator overlay (registry, draft or hosted lane) that carries the owner flag. */
|
|
19
19
|
export declare function isWrunWindowOwner(overlay: WindowOwnerOverlay): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* An engine meta as the window's pane mark reads it. The window geometry (window-geometry.leaf, C5) hides an owner's
|
|
22
|
+
* own pane that draws nothing beside the owner's other window panes and marks the meta `wrunWindowHidPane`: the
|
|
23
|
+
* window's layout, never the reader's collapse. The mark lives on the engine meta, not in its settings, so no save
|
|
24
|
+
* carries it, and it goes with the meta (a rebuilt engine shows every pane).
|
|
25
|
+
*/
|
|
26
|
+
export interface WindowHiddenPaneMeta {
|
|
27
|
+
isPaneHidden?: boolean;
|
|
28
|
+
wrunWindowHidPane?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/** Whether a meta's pane is hidden by its window (above) and not by the reader: a gate that holds a collapsed pane's
|
|
31
|
+
* runs lets this owner run, since its runs feed the window's tables (wrun-overlay-recovery.util). */
|
|
32
|
+
export declare function isPaneHiddenByWindow(meta: WindowHiddenPaneMeta | null | undefined): boolean;
|
|
@@ -22,3 +22,8 @@ export function isWrunWindowOwner(overlay) {
|
|
|
22
22
|
const settings = overlay?.settings;
|
|
23
23
|
return !!settings && settings[WRUN_WINDOW_SETTING] === true && isWrunPackageOverlaySettings(settings);
|
|
24
24
|
}
|
|
25
|
+
/** Whether a meta's pane is hidden by its window (above) and not by the reader: a gate that holds a collapsed pane's
|
|
26
|
+
* runs lets this owner run, since its runs feed the window's tables (wrun-overlay-recovery.util). */
|
|
27
|
+
export function isPaneHiddenByWindow(meta) {
|
|
28
|
+
return meta?.isPaneHidden === true && meta.wrunWindowHidPane === true;
|
|
29
|
+
}
|