@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
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
* settings it built from the structural words, a `series` array patch merging
|
|
9
9
|
* per index. A frame field overrides the declared word of the same name for
|
|
10
10
|
* that run; `markers` replaces the declared list. Absent words add no key, so
|
|
11
|
-
* today's drawing stays the default (conventions 10)
|
|
11
|
+
* today's drawing stays the default (conventions 10), except the plain look's
|
|
12
|
+
* defaults (the `hairlines` chrome of a line, bars, histogram or scatter
|
|
13
|
+
* pane; a heatmap's palette) and a wrun table's: on the wrun lane an absent
|
|
14
|
+
* table colour, border or grid word takes the chart's look (wrunTableStyle),
|
|
15
|
+
* the push lane's table keeps the engine's.
|
|
12
16
|
*
|
|
13
17
|
* Pure and worker safe (om-panel.util rides the frame worker): it imports the
|
|
14
18
|
* style foundation only. Colour words resolve here against `ctx.theme`
|
|
@@ -129,9 +133,14 @@ const WRUN_PANEL_SERIES_STYLE_WORDS = {
|
|
|
129
133
|
export const WRUN_PANEL_STYLE_KEYS = Object.keys(WRUN_PANEL_STYLE_WORDS);
|
|
130
134
|
/** Every `panels[i].series[j]` style word. */
|
|
131
135
|
export const WRUN_PANEL_SERIES_STYLE_KEYS = Object.keys(WRUN_PANEL_SERIES_STYLE_WORDS);
|
|
132
|
-
/**
|
|
133
|
-
*
|
|
134
|
-
|
|
136
|
+
/** The heatmap palette under scale "palette" when the panel declares none
|
|
137
|
+
* (SC06): the mono ramp from the chart's background to its text colour, so
|
|
138
|
+
* a dark chart ramps black to white and a light chart white to black. Theme
|
|
139
|
+
* tokens, resolved against `ctx.theme`. */
|
|
140
|
+
export const WRUN_PANEL_HEATMAP_PALETTE = ['theme.bg', 'theme.text'];
|
|
141
|
+
/** The same default without a theme to resolve the ramp against (the om
|
|
142
|
+
* push lane): the three stops a pushed heatmap has always drawn. */
|
|
143
|
+
export const WRUN_PANEL_HEATMAP_UNTHEMED_PALETTE = ['#e06c75', '#7a7f93', '#98c379'];
|
|
135
144
|
/** The default `stroke_fade.edge_opacity` (SC03; the engine's own default). */
|
|
136
145
|
export const WRUN_PANEL_STROKE_FADE_EDGE_OPACITY = 0.35;
|
|
137
146
|
/** The badge chip's defaults (C2): the fill when `color` is absent, and the
|
|
@@ -164,14 +173,23 @@ const WRUN_ENGINE_FORMATTING = undefined;
|
|
|
164
173
|
export function wrunPaneColor(word, theme) {
|
|
165
174
|
return wrunHex8ToRgba(theme === undefined ? word : resolveWrunColorWord(word, theme));
|
|
166
175
|
}
|
|
167
|
-
/**
|
|
168
|
-
*
|
|
169
|
-
|
|
176
|
+
/** The kinds whose chrome defaults to "hairlines" (the plain look): the
|
|
177
|
+
* panes with a value axis. */
|
|
178
|
+
const WRUN_PANEL_HAIRLINE_KINDS = new Set([
|
|
179
|
+
'line',
|
|
180
|
+
'bars',
|
|
181
|
+
'histogram',
|
|
182
|
+
'scatter',
|
|
183
|
+
]);
|
|
184
|
+
/** A panel's effective chrome (SC02): the declared word, else "hairlines"
|
|
185
|
+
* on a line, bars, histogram or scatter pane of every x kind, stacked or
|
|
186
|
+
* not (the plain look), else "box" (pie, heatmap, table, tiles). On a line
|
|
187
|
+
* every word but "box" is the rich curve: the engine routes any other
|
|
188
|
+
* chromeStyle there, and "hairlines" draws its rows-only grid. */
|
|
170
189
|
export function wrunPanelChrome(panel) {
|
|
171
190
|
if (panel.chrome !== undefined)
|
|
172
191
|
return panel.chrome;
|
|
173
|
-
|
|
174
|
-
return panel.kind === 'line' && numeric && panel.stacked !== true ? 'grid' : 'box';
|
|
192
|
+
return WRUN_PANEL_HAIRLINE_KINDS.has(panel.kind) ? 'hairlines' : 'box';
|
|
175
193
|
}
|
|
176
194
|
// Helpers
|
|
177
195
|
/** Writes `key` only when the word is declared. */
|
|
@@ -223,10 +241,13 @@ function panelBadge(panel, chrome, ctx) {
|
|
|
223
241
|
const textColor = badge.text_color !== undefined ? wrunPaneColor(badge.text_color, ctx.theme) : wrunPanelBadgeInk(color);
|
|
224
242
|
return { text: badge.text, color, textColor };
|
|
225
243
|
}
|
|
226
|
-
/** The
|
|
227
|
-
* default
|
|
244
|
+
/** The chrome as the engine key (SC23): the effective word on the hairline
|
|
245
|
+
* kinds, so their plain default reaches the engine (whose own default is
|
|
246
|
+
* "box"), and only a declared word on a pie. */
|
|
228
247
|
function chromeStylePatch(panel) {
|
|
229
|
-
return panel.chrome !== undefined
|
|
248
|
+
return panel.chrome !== undefined || WRUN_PANEL_HAIRLINE_KINDS.has(panel.kind)
|
|
249
|
+
? { chromeStyle: wrunPanelChrome(panel) }
|
|
250
|
+
: {};
|
|
230
251
|
}
|
|
231
252
|
/** A time key in ms (keys under 1e11 are seconds; the SC37 rule). */
|
|
232
253
|
function timeKeyMs(key) {
|
|
@@ -570,15 +591,18 @@ export function wrunPieStyle(panel, chrome, rows, ctx) {
|
|
|
570
591
|
return patch;
|
|
571
592
|
}
|
|
572
593
|
/** The heatmap words (SC06 SC18): under scale "palette" the stops (the
|
|
573
|
-
* declared ones, else today's three
|
|
574
|
-
*
|
|
575
|
-
*
|
|
576
|
-
*
|
|
577
|
-
*
|
|
594
|
+
* declared ones, else the mono ramp, or today's three on the push lane,
|
|
595
|
+
* which has no theme to resolve the ramp against) and the bounds (frame
|
|
596
|
+
* first); under "signed" none of them, so the engine's diverging scale
|
|
597
|
+
* draws through the common tone pair. The highlight resolves its keys to
|
|
598
|
+
* the engine's row and column indices (a key absent from the rows is
|
|
599
|
+
* dropped), the axis nouns pass through, and a frame summary is fitted to
|
|
600
|
+
* the column count. */
|
|
578
601
|
export function wrunHeatmapStyle(panel, chrome, indices, ctx) {
|
|
579
602
|
const patch = {};
|
|
580
603
|
if (panel.scale !== 'signed') {
|
|
581
|
-
|
|
604
|
+
const stops = panel.palette ?? (ctx.theme !== undefined ? WRUN_PANEL_HEATMAP_PALETTE : WRUN_PANEL_HEATMAP_UNTHEMED_PALETTE);
|
|
605
|
+
patch.palette = stops.map((word) => wrunPaneColor(word, ctx.theme));
|
|
582
606
|
put(patch, 'min', frameFirst(panel, chrome, 'min'));
|
|
583
607
|
put(patch, 'max', frameFirst(panel, chrome, 'max'));
|
|
584
608
|
}
|
|
@@ -610,14 +634,28 @@ export function wrunHeatmapStyle(panel, chrome, indices, ctx) {
|
|
|
610
634
|
export function wrunTilesStyle(_panel, _rows, _ctx) {
|
|
611
635
|
return {};
|
|
612
636
|
}
|
|
637
|
+
/** The fill a wrun table cell takes where the author declared none: the engine paints a cell's fill through the
|
|
638
|
+
* canvas `fillStyle`, which takes any CSS colour, so `transparent` paints nothing where an absent key paints the
|
|
639
|
+
* engine's own grey. */
|
|
640
|
+
export const WRUN_TABLE_NO_FILL = 'transparent';
|
|
613
641
|
/** The table words onto the engine's Table payload (SC22 SC35; the
|
|
614
642
|
* WRUN-CAPS keys verbatim): the anchor and offset (`y` adds the legend
|
|
615
643
|
* clearance under a top_* anchor), widths, padding, type, alignment, inks
|
|
616
644
|
* (resolved), the background fill and gradient, the border and grid lines,
|
|
617
|
-
* and the header column. Only declared words patch the caller's defaults
|
|
645
|
+
* and the header column. Only declared words patch the caller's defaults on
|
|
646
|
+
* the om push lane (no theme), so its payload stays byte for byte the
|
|
647
|
+
* engine's look. The wrun lane (a theme in hand) also sends the table that
|
|
648
|
+
* fills its pane's width with a hovered row (`fillWidth`, `hoverRow`) and,
|
|
649
|
+
* for each word the author did not declare, the chart's look instead of the
|
|
650
|
+
* engine's greys: text in the theme's text colour, the header in its muted
|
|
651
|
+
* colour, no cell or header fill, no border and, when the author declared
|
|
652
|
+
* no grid word at all, one rule under the header in the theme's grid
|
|
653
|
+
* colour. A declared word always wins; a theme switch re-resolves the
|
|
654
|
+
* fallbacks like every other theme word (the mount's retranslate). */
|
|
618
655
|
export function wrunTableStyle(panel, ctx) {
|
|
619
656
|
const color = (word) => wrunPaneColor(word, ctx.theme);
|
|
620
|
-
const
|
|
657
|
+
const themed = ctx.theme !== undefined;
|
|
658
|
+
const patch = themed ? { fillWidth: true, hoverRow: true } : {};
|
|
621
659
|
if (panel.position !== undefined || panel.offset !== undefined) {
|
|
622
660
|
const position = panel.position ?? 'top_left';
|
|
623
661
|
const [dx, dy] = panel.offset ?? [0, 0];
|
|
@@ -636,25 +674,47 @@ export function wrunTableStyle(panel, ctx) {
|
|
|
636
674
|
put(patch, 'valign', panel.valign);
|
|
637
675
|
if (panel.text_color !== undefined)
|
|
638
676
|
patch.textColor = color(panel.text_color);
|
|
677
|
+
else if (themed)
|
|
678
|
+
patch.textColor = color('theme.text');
|
|
639
679
|
if (panel.header_text_color !== undefined)
|
|
640
680
|
patch.headerTextColor = color(panel.header_text_color);
|
|
681
|
+
else if (themed)
|
|
682
|
+
patch.headerTextColor = color('theme.muted');
|
|
641
683
|
if (panel.background_color !== undefined)
|
|
642
684
|
patch.backgroundColor = color(panel.background_color);
|
|
685
|
+
else if (themed)
|
|
686
|
+
patch.backgroundColor = WRUN_TABLE_NO_FILL;
|
|
643
687
|
if (panel.header_background_color !== undefined)
|
|
644
688
|
patch.headerBackgroundColor = color(panel.header_background_color);
|
|
689
|
+
else if (themed)
|
|
690
|
+
patch.headerBackgroundColor = WRUN_TABLE_NO_FILL;
|
|
645
691
|
put(patch, 'backgroundOpacity', panel.background_opacity);
|
|
646
692
|
if (panel.background_gradient !== undefined)
|
|
647
693
|
patch.backgroundGradient = panel.background_gradient.map(color);
|
|
648
694
|
put(patch, 'gradientDirection', panel.gradient_direction);
|
|
649
695
|
if (panel.border_color !== undefined)
|
|
650
696
|
patch.borderColor = color(panel.border_color);
|
|
651
|
-
|
|
697
|
+
if (panel.border_width !== undefined)
|
|
698
|
+
patch.borderWidth = panel.border_width;
|
|
699
|
+
else if (themed)
|
|
700
|
+
patch.borderWidth = 0;
|
|
652
701
|
put(patch, 'borderStyle', panel.border_style);
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
702
|
+
const gridDeclared = panel.grid_color !== undefined ||
|
|
703
|
+
panel.grid_width !== undefined ||
|
|
704
|
+
panel.grid_style !== undefined ||
|
|
705
|
+
panel.grid_lines !== undefined;
|
|
706
|
+
if (gridDeclared) {
|
|
707
|
+
if (panel.grid_color !== undefined)
|
|
708
|
+
patch.gridColor = color(panel.grid_color);
|
|
709
|
+
put(patch, 'gridWidth', panel.grid_width);
|
|
710
|
+
put(patch, 'gridStyle', panel.grid_style);
|
|
711
|
+
put(patch, 'gridLines', panel.grid_lines);
|
|
712
|
+
}
|
|
713
|
+
else if (themed) {
|
|
714
|
+
patch.gridLines = 'header';
|
|
715
|
+
patch.gridColor = color('theme.grid');
|
|
716
|
+
patch.gridWidth = 1;
|
|
717
|
+
}
|
|
658
718
|
put(patch, 'headerColumn', panel.header_column);
|
|
659
719
|
return patch;
|
|
660
720
|
}
|
|
@@ -79,13 +79,14 @@ export declare function wrunHostedTextValue(param: Pick<WrunMetadataParam, 'text
|
|
|
79
79
|
* reads) and the hidden param the kit generates for it (`market.<word>()` declares `market_<word>`, `chart.<word>()`
|
|
80
80
|
* `chart_<word>`; the extractor refuses any other param under those names), in the kit's order: the market's tick
|
|
81
81
|
* size and decimals, the chart's interval seconds and five colours (the candle and grid colours since WRUN-STYLE
|
|
82
|
-
* TH-candle-colors), the market's five facts (WRUN-GAPS-1005, WRUN-SESSION), the issuer's three earnings facts
|
|
83
|
-
* option multiplier of the chart's options chain
|
|
84
|
-
* record's `hostFill` (wrunHostedHostFill), the declaration rebuild
|
|
85
|
-
* socket worker's read of the main thread's context
|
|
86
|
-
* another carries; wrun-param-values.util.spec holds the
|
|
82
|
+
* TH-candle-colors), the market's five facts (WRUN-GAPS-1005, WRUN-SESSION), the issuer's three earnings facts, the
|
|
83
|
+
* option multiplier of the chart's options chain and the dollar multiplier of its own trades (kit 0.95.0). Every hosted
|
|
84
|
+
* path reads it: the settings record's `hostFill` (wrunHostedHostFill), the declaration rebuild
|
|
85
|
+
* (WRUN_HOST_FILL_BY_GENERATED_NAME) and the kScript socket worker's read of the main thread's context
|
|
86
|
+
* (WRUN_HOST_FILL_CONTEXT_KEYS), so no hosted path drops a word another carries; wrun-param-values.util.spec holds the
|
|
87
|
+
* table to every word the kit's browser lane fills.
|
|
87
88
|
*/
|
|
88
|
-
export declare const WRUN_HOST_FILL_WORDS: readonly [readonly ["tick_size", "tickSize", "market_tick_size"], readonly ["price_precision", "pricePrecision", "market_price_precision"], readonly ["interval_sec", "intervalSec", "chart_interval_sec"], readonly ["bg_color", "bgColor", "chart_bg_color"], readonly ["fg_color", "fgColor", "chart_fg_color"], readonly ["up_color", "upColor", "chart_up_color"], readonly ["down_color", "downColor", "chart_down_color"], readonly ["grid_color", "gridColor", "chart_grid_color"], readonly ["kind", "kind", "market_kind"], readonly ["point_value", "pointValue", "market_point_value"], readonly ["zone", "zone", "market_zone"], readonly ["quote_is_usd", "quoteIsUsd", "market_quote_is_usd"], readonly ["session_open", "sessionOpen", "market_session_open"], readonly ["earnings_next_ms", "earningsNextMs", "market_earnings_next_ms"], readonly ["earnings_prev_ms", "earningsPrevMs", "market_earnings_prev_ms"], readonly ["earnings_session", "earningsSession", "market_earnings_session"], readonly ["option_multiplier", "optionMultiplier", "market_option_multiplier"]];
|
|
89
|
+
export declare const WRUN_HOST_FILL_WORDS: readonly [readonly ["tick_size", "tickSize", "market_tick_size"], readonly ["price_precision", "pricePrecision", "market_price_precision"], readonly ["interval_sec", "intervalSec", "chart_interval_sec"], readonly ["bg_color", "bgColor", "chart_bg_color"], readonly ["fg_color", "fgColor", "chart_fg_color"], readonly ["up_color", "upColor", "chart_up_color"], readonly ["down_color", "downColor", "chart_down_color"], readonly ["grid_color", "gridColor", "chart_grid_color"], readonly ["kind", "kind", "market_kind"], readonly ["point_value", "pointValue", "market_point_value"], readonly ["zone", "zone", "market_zone"], readonly ["quote_is_usd", "quoteIsUsd", "market_quote_is_usd"], readonly ["session_open", "sessionOpen", "market_session_open"], readonly ["earnings_next_ms", "earningsNextMs", "market_earnings_next_ms"], readonly ["earnings_prev_ms", "earningsPrevMs", "market_earnings_prev_ms"], readonly ["earnings_session", "earningsSession", "market_earnings_session"], readonly ["option_multiplier", "optionMultiplier", "market_option_multiplier"], readonly ["dollar_multiplier", "dollarMultiplier", "market_dollar_multiplier"]];
|
|
89
90
|
/** The host-filled params by the names the kit generates for them (WRUN_HOST_FILL_WORDS). A declaration row carries
|
|
90
91
|
* no `host_fill` word, so the rebuild recovers it here: without it the host context could not fill the param and a
|
|
91
92
|
* hosted lane would evaluate the declared 0 (unavailable). */
|
|
@@ -102,11 +102,12 @@ function wrunHostedSymbolValue(param, settings) {
|
|
|
102
102
|
* reads) and the hidden param the kit generates for it (`market.<word>()` declares `market_<word>`, `chart.<word>()`
|
|
103
103
|
* `chart_<word>`; the extractor refuses any other param under those names), in the kit's order: the market's tick
|
|
104
104
|
* size and decimals, the chart's interval seconds and five colours (the candle and grid colours since WRUN-STYLE
|
|
105
|
-
* TH-candle-colors), the market's five facts (WRUN-GAPS-1005, WRUN-SESSION), the issuer's three earnings facts
|
|
106
|
-
* option multiplier of the chart's options chain
|
|
107
|
-
* record's `hostFill` (wrunHostedHostFill), the declaration rebuild
|
|
108
|
-
* socket worker's read of the main thread's context
|
|
109
|
-
* another carries; wrun-param-values.util.spec holds the
|
|
105
|
+
* TH-candle-colors), the market's five facts (WRUN-GAPS-1005, WRUN-SESSION), the issuer's three earnings facts, the
|
|
106
|
+
* option multiplier of the chart's options chain and the dollar multiplier of its own trades (kit 0.95.0). Every hosted
|
|
107
|
+
* path reads it: the settings record's `hostFill` (wrunHostedHostFill), the declaration rebuild
|
|
108
|
+
* (WRUN_HOST_FILL_BY_GENERATED_NAME) and the kScript socket worker's read of the main thread's context
|
|
109
|
+
* (WRUN_HOST_FILL_CONTEXT_KEYS), so no hosted path drops a word another carries; wrun-param-values.util.spec holds the
|
|
110
|
+
* table to every word the kit's browser lane fills.
|
|
110
111
|
*/
|
|
111
112
|
export const WRUN_HOST_FILL_WORDS = [
|
|
112
113
|
['tick_size', 'tickSize', 'market_tick_size'],
|
|
@@ -128,6 +129,8 @@ export const WRUN_HOST_FILL_WORDS = [
|
|
|
128
129
|
['earnings_session', 'earningsSession', 'market_earnings_session'],
|
|
129
130
|
// The option multiplier of the chart's options chain (kit 0.87.0, wrun-chart-market-facts.util).
|
|
130
131
|
['option_multiplier', 'optionMultiplier', 'market_option_multiplier'],
|
|
132
|
+
// The dollar multiplier of the market's own trades (kit 0.95.0, wrun-chart-market-facts.util).
|
|
133
|
+
['dollar_multiplier', 'dollarMultiplier', 'market_dollar_multiplier'],
|
|
131
134
|
];
|
|
132
135
|
/** The host-filled params by the names the kit generates for them (WRUN_HOST_FILL_WORDS). A declaration row carries
|
|
133
136
|
* no `host_fill` word, so the rebuild recovers it here: without it the host context could not fill the param and a
|
|
@@ -9,8 +9,9 @@ import type { WrunIndicatorMetadata, WrunMetadataParam } from '../../interfaces/
|
|
|
9
9
|
* market's tick size and price precision, the chart's bar interval in
|
|
10
10
|
* seconds, its background / text / candle up / candle down / grid colour as
|
|
11
11
|
* the kit's packed signed i32 (wrun-chart-context.util), the market's
|
|
12
|
-
* five facts as their codes
|
|
13
|
-
* (wrun-chart-market-facts.util);
|
|
12
|
+
* five facts as their codes, the option multiplier of its options chain and
|
|
13
|
+
* the dollar multiplier of its own trades (wrun-chart-market-facts.util);
|
|
14
|
+
* absent = the declared default (0, unknown). */
|
|
14
15
|
export interface WrunHostFillContext {
|
|
15
16
|
tickSize?: number;
|
|
16
17
|
pricePrecision?: number;
|
|
@@ -48,6 +49,13 @@ export interface WrunHostFillContext {
|
|
|
48
49
|
* CME, 1 on a crypto chart (wrunChartOptionMultiplier); 0 where the chart
|
|
49
50
|
* has no options family, which a package reads as unknown (no premium). */
|
|
50
51
|
optionMultiplier?: number;
|
|
52
|
+
/** `market.dollar_multiplier()` (kit 0.95.0): the US dollars one size unit of the
|
|
53
|
+
* market's own trades at one price unit is worth, the unit the dollar tape
|
|
54
|
+
* prices its live prints with and the batched captions read
|
|
55
|
+
* (wrunMarketDollarUnit: a CME contract's registry point value, NQ 20; 1 on
|
|
56
|
+
* a market quoted in dollars); 0 where it is not proven (a full run never
|
|
57
|
+
* computes a sheet declaring it over 0: it refuses first). */
|
|
58
|
+
dollarMultiplier?: number;
|
|
51
59
|
}
|
|
52
60
|
export declare function nonEmptyString(value: unknown): string | undefined;
|
|
53
61
|
export declare function finiteNumber(value: unknown): number | undefined;
|
|
@@ -137,6 +137,8 @@ function paramRunValue(param, flat, host) {
|
|
|
137
137
|
return finiteOr(finiteNumber(host?.earningsSession), fallback);
|
|
138
138
|
if (param.host_fill === 'option_multiplier')
|
|
139
139
|
return finiteOr(finiteNumber(host?.optionMultiplier), fallback);
|
|
140
|
+
if (param.host_fill === 'dollar_multiplier')
|
|
141
|
+
return finiteOr(finiteNumber(host?.dollarMultiplier), fallback);
|
|
140
142
|
const raw = flat?.[param.name];
|
|
141
143
|
switch (param.type) {
|
|
142
144
|
case 'symbol':
|
|
@@ -13,9 +13,10 @@
|
|
|
13
13
|
* wire (a TradingView prefix, a display alias such as `BINANCE.F`, a stock listing), TradingView's perpetual suffix
|
|
14
14
|
* (`BTCUSDT.P`), our key typed into the symbol half (`COINBASE|BTC-USD`), a stock or forex symbol without its
|
|
15
15
|
* `/` (`POLYGON:AAPL`, `FX_OTC:EURUSD`), or a crypto pair whose form the venue's catalog spelling does not vouch for
|
|
16
|
-
* (`venue-presets.constants`: Coinbase and OKX write `BTC-USD`,
|
|
17
|
-
* presets do not describe is confirmed by the catalog), or a CRYPTOCAP symbol
|
|
18
|
-
* (`CRYPTOCAP:HYPEH.D`, the coin cap `CRYPTOCAP:BTC`). Everything else is ours and skips
|
|
16
|
+
* (`venue-presets.constants`: Coinbase and OKX write `BTC-USD`, OKX's perpetuals `BTC-USDT-SWAP`, Binance and Bybit
|
|
17
|
+
* `BTCUSDT`; a pair on a venue the presets do not describe is confirmed by the catalog), or a CRYPTOCAP symbol
|
|
18
|
+
* TradingView spells unlike us (`CRYPTOCAP:HYPEH.D`, the coin cap `CRYPTOCAP:BTC`). Everything else is ours and skips
|
|
19
|
+
* the catalog.
|
|
19
20
|
* - `resolveWrunPinMarket` (sync over an already-loaded catalog): the written spelling first (our own spelling always
|
|
20
21
|
* wins), then the same instrument through the TradingView prefix tables (tradingview-symbols.leaf, the watchlist
|
|
21
22
|
* import's own: the venue map, the quote split, the perpetual ids, the metals, the CRYPTOCAP ticker renames, where
|
|
@@ -112,13 +113,18 @@ function readingsOf(input, chartExchange) {
|
|
|
112
113
|
function isOurCryptoVenue(venue) {
|
|
113
114
|
return venue in VENUE_TO_TRADINGVIEW || venue in SPOT_PRESET_VENUE_QUOTES || venue in PERP_PRESET_VENUE_QUOTES;
|
|
114
115
|
}
|
|
115
|
-
/** How a preset venue spells a pair in its catalog (`venue-presets.constants`: `
|
|
116
|
-
*
|
|
116
|
+
/** How a preset venue spells a pair in its catalog, read off the whole quote (`venue-presets.constants`: `BINANCE:
|
|
117
|
+
* 'USDT'` is `BTCUSDT`, `COINBASE: '-USD'` is `BTC-USD`, `OKEX_SWAP: '-USDT-SWAP'` is `BTC-USDT-SWAP`); undefined
|
|
118
|
+
* for a venue the presets do not describe, and for the bare coin (Hyperliquid's quote ''), which no shape tells. */
|
|
117
119
|
function presetPairForm(venue) {
|
|
118
120
|
const quote = SPOT_PRESET_VENUE_QUOTES[venue] ?? PERP_PRESET_VENUE_QUOTES[venue];
|
|
119
|
-
if (quote
|
|
121
|
+
if (!quote)
|
|
120
122
|
return undefined;
|
|
121
|
-
|
|
123
|
+
if (/^[A-Z0-9]/.test(quote))
|
|
124
|
+
return { glued: true };
|
|
125
|
+
const separator = quote[0];
|
|
126
|
+
const tailAt = quote.indexOf(separator, 1);
|
|
127
|
+
return { glued: false, separator, tail: tailAt > 0 ? quote.slice(tailAt) : '' };
|
|
122
128
|
}
|
|
123
129
|
const GLUED_RE = /^[A-Z0-9]+$/;
|
|
124
130
|
/** TradingView's perpetual (`BTCUSDT.P`): no market of ours is spelled so. */
|
|
@@ -130,7 +136,7 @@ function provablyForeign(reading) {
|
|
|
130
136
|
if (TRADINGVIEW_PERP_RE.test(reading.symbol))
|
|
131
137
|
return true;
|
|
132
138
|
const form = presetPairForm(reading.exchange);
|
|
133
|
-
if (form === undefined || form
|
|
139
|
+
if (form === undefined || form.glued)
|
|
134
140
|
return false;
|
|
135
141
|
return GLUED_RE.test(reading.symbol.toUpperCase()) && splitCryptoSymbol(reading.symbol) !== null;
|
|
136
142
|
}
|
|
@@ -155,9 +161,12 @@ function writtenNeedsCatalog(reading) {
|
|
|
155
161
|
const form = presetPairForm(exchange);
|
|
156
162
|
if (form === undefined)
|
|
157
163
|
return true;
|
|
158
|
-
if (form
|
|
164
|
+
if (form.glued)
|
|
159
165
|
return !GLUED_RE.test(symbol);
|
|
160
|
-
|
|
166
|
+
// The whole shape: a pair without the venue's tail (`BTC-USDT` on OKX's perpetuals) is not how the venue writes it.
|
|
167
|
+
if (!symbol.endsWith(form.tail))
|
|
168
|
+
return true;
|
|
169
|
+
const [base, quote, ...rest] = symbol.slice(0, symbol.length - form.tail.length).split(form.separator);
|
|
161
170
|
return rest.length > 0 || !GLUED_RE.test(base ?? '') || !GLUED_RE.test(quote ?? '');
|
|
162
171
|
}
|
|
163
172
|
/**
|
|
@@ -38,7 +38,7 @@ import { wrunInputReadsChartFeed } from './wrun-bar-count.util.js';
|
|
|
38
38
|
import { wrunSourceLane } from './wrun-source-rows.util.js';
|
|
39
39
|
import { wrunPollLaneByKey, wrunPollLanesOfClass } from './sources/registry.js';
|
|
40
40
|
import { isWrunPollLaneId } from './sources/wrun-poll-lane.types.js';
|
|
41
|
-
import { parseWrunTapeHistory, wrunTapeFloorSettings, wrunTapeHistoryOf } from './wrun-tape-source.util.js';
|
|
41
|
+
import { parseWrunTapeHistory, wrunTapeAcquisitionFloor, wrunTapeFloorSettings, wrunTapeHistoryOf, } from './wrun-tape-source.util.js';
|
|
42
42
|
import { isWrunTradesLegLane } from './wrun-trades-lane.util.js';
|
|
43
43
|
import { isWrunLegStreamClass } from './wrun-leg-stream-classes.js';
|
|
44
44
|
/** Each asked lane: the fetch type the full run rode, the fetch-key suffix of the page's ask
|
|
@@ -344,7 +344,7 @@ export function wrunPrefixWindowLanes(context, plan, pages, firstRowTs, toMs) {
|
|
|
344
344
|
sourceRows.tapeRows = rows;
|
|
345
345
|
lanes.push({ lane: 'tape', rows });
|
|
346
346
|
}
|
|
347
|
-
const settings = wrunTapeFloorSettings(context.metadata, context.acquisition.tape
|
|
347
|
+
const settings = wrunTapeFloorSettings(context.metadata, wrunTapeAcquisitionFloor(context.acquisition.tape));
|
|
348
348
|
if (settings !== undefined)
|
|
349
349
|
sourceRows.settings = settings;
|
|
350
350
|
const instances = context.pollLanes ?? [];
|
|
@@ -277,6 +277,12 @@ const VARIANTS = {
|
|
|
277
277
|
// The chart's row budget (applyWrunIntegrationBudget): the run's lines over the loaded candles
|
|
278
278
|
// outgrow what one Indicator may put on the chart; the numbers say what to change.
|
|
279
279
|
rows: row('wrun.refusal.sentence.tooBigRows', 'wrun.refusal.chip.tooBig', ['series', 'bars', 'max']),
|
|
280
|
+
// The tape's history held more prints at its floor than the trades worker reads (its refusal by name,
|
|
281
|
+
// `tape-too-many-trades`): the cap, the floor's setting and value and the history's days (the plural choice)
|
|
282
|
+
// say what to raise. Its seed's way out is Open the settings (the record of the tape lane, wrun-overlay-run.util).
|
|
283
|
+
tape: row('wrun.refusal.sentence.tooBigTape', 'wrun.refusal.chip.tooBig', ['max', 'setting', 'min', 'n'], {
|
|
284
|
+
plural: 'n',
|
|
285
|
+
}),
|
|
280
286
|
},
|
|
281
287
|
// The live session's own stop (the merged tick result over the row budget): the last picture stays.
|
|
282
288
|
'live-stopped': {
|
|
@@ -759,12 +765,19 @@ function seedFromCodes(message, ctx) {
|
|
|
759
765
|
if (message.includes('wrun_cell_block_too_large')) {
|
|
760
766
|
const inputIndex = numberMatch(message, /\binput (\d+)\b/);
|
|
761
767
|
const cells = numberMatch(message, /\bhas (\d+) cells\b/) ?? 0;
|
|
762
|
-
|
|
768
|
+
// The bound the module holds, in either of the packer's words (wrun-cell-capacity.leaf `wrunCellBoundWords`):
|
|
769
|
+
// `max_cells is N`, or a print union's `its capacity is N (...)`.
|
|
770
|
+
const max = numberMatch(message, /\b(?:max_cells|capacity) is (\d+)\b/) ?? 0;
|
|
763
771
|
const sourceClass = inputIndex === undefined ? undefined : ctx.inputClassAt?.(inputIndex);
|
|
764
772
|
if (sourceClass === 'options_chain')
|
|
765
773
|
return { cls: 'too-big', variant: 'chain', params: { cells, max } };
|
|
766
774
|
return { cls: 'too-big', variant: 'block', params: { feed: sourceClass ?? '', cells, max } };
|
|
767
775
|
}
|
|
776
|
+
// A celled input's capacity no build writes (wrun-cell-capacity.leaf `wrunCellCapacityIssue`): the package's sheet
|
|
777
|
+
// is the author's to rebuild, by its code. Named here as the block code above is, so the boot path's refusal reader
|
|
778
|
+
// never loads the capacity leaf (tests/perf/pre-candle-budget.spec.ts).
|
|
779
|
+
if (message.includes('wrun_cell_capacity_invalid'))
|
|
780
|
+
return wrunAuthorRuleSeed('wrun_cell_capacity_invalid');
|
|
768
781
|
const optionsCode = /\b(wrun_options_chain_[a-z_]+)\b/.exec(message)?.[1];
|
|
769
782
|
if (optionsCode !== undefined) {
|
|
770
783
|
const coin = /\bcoin '([^']+)'/.exec(message)?.[1] ?? ctx.chart?.coin ?? '';
|
|
@@ -851,6 +864,8 @@ const WRUN_REFUSAL_READ_FAILED_CODE = 'wrun_refusal_read_failed';
|
|
|
851
864
|
const SETTINGS_REFUSAL_CODES = new Set([
|
|
852
865
|
'wrun_params_invalid',
|
|
853
866
|
'wrun_tape_min_size_invalid',
|
|
867
|
+
// C-DOLLAR: a dollar floor bound to a setting that holds no positive number; the settings raise it.
|
|
868
|
+
'wrun_tape_min_value_invalid',
|
|
854
869
|
'wrun_param_unknown',
|
|
855
870
|
'wrun_settings_paint_unsupported',
|
|
856
871
|
]);
|
|
@@ -1178,7 +1193,7 @@ function variantFor(seed, ctx) {
|
|
|
1178
1193
|
case 'cme-wall':
|
|
1179
1194
|
return declared !== undefined && variantSpec('cme-wall', declared) ? declared : 'default';
|
|
1180
1195
|
case 'too-big':
|
|
1181
|
-
return declared === 'chain' || declared === 'rows' ? declared : 'block';
|
|
1196
|
+
return declared === 'chain' || declared === 'rows' || declared === 'tape' ? declared : 'block';
|
|
1182
1197
|
case 'not-reached':
|
|
1183
1198
|
return declared !== undefined && variantSpec('not-reached', declared) ? declared : 'run';
|
|
1184
1199
|
case 'slots':
|
|
@@ -207,6 +207,13 @@ export interface WrunScriptInputDeclaration {
|
|
|
207
207
|
* row so the dialog and the hosted lanes know them without the sheet. */
|
|
208
208
|
maxBytes?: number;
|
|
209
209
|
multiline?: boolean;
|
|
210
|
+
/** A market-scaled param's value carried from an older version's setting (C-DOLLAR: a Big Trades 0.5.0 Min size the
|
|
211
|
+
* user changed, priced once into Min value; wrun-market-size-defaults.util `wrunDollarCarryPatch`). While the row
|
|
212
|
+
* holds it, the value is one the user chose, whatever the row's default reads: the market defaults never move it
|
|
213
|
+
* (`wrunMarketScaledRowChanged`), on this market or any after it. An edit or a reset to another value ends that.
|
|
214
|
+
* The mark itself stays (a reset writes values, never the rows), and while it does the carry is done: a raw value
|
|
215
|
+
* kept under its old name (a market that counts contracts) is never priced again (`wrunPendingDollarCarries`). */
|
|
216
|
+
carriedValue?: number;
|
|
210
217
|
}
|
|
211
218
|
export interface WrunScriptSection {
|
|
212
219
|
/** A section the builder names (the Style page's shared colours,
|
|
@@ -395,6 +402,19 @@ export declare function buildWrunScriptLayout(metadata: WrunScriptInputsSheet, d
|
|
|
395
402
|
* or a reset.
|
|
396
403
|
*/
|
|
397
404
|
export declare function coerceWrunRowValue(row: WrunScriptInputDeclaration, raw: unknown): unknown;
|
|
405
|
+
/** A row's stored value in its declared kind, else its declared default
|
|
406
|
+
* (the settings panel's read, wrun-dialog-rows `readRowValue`: the controls,
|
|
407
|
+
* the changed dot and its reset, the preset chip, a `when` gate, a swatch).
|
|
408
|
+
* The run head's market-scaled defaults (wrun-market-size-defaults.util) read
|
|
409
|
+
* a row through it too, so "unchanged" there is the reset icon's own test. */
|
|
410
|
+
export declare function wrunRowValue(settings: Readonly<Record<string, unknown>>, row: WrunScriptInputDeclaration): unknown;
|
|
411
|
+
/** Equality the way the run reads values back: a toggle as 1/0, a select's
|
|
412
|
+
* numeric string as its number, a colour array element by element. */
|
|
413
|
+
export declare function wrunValuesEqual(a: unknown, b: unknown): boolean;
|
|
414
|
+
/** Equality for one row's value: a text row compares its words exactly (a
|
|
415
|
+
* typed "20" is not the number 20, "Abc" is not "abc"); every other kind
|
|
416
|
+
* the way the run reads values back ({@link wrunValuesEqual}). */
|
|
417
|
+
export declare function wrunRowValuesEqual(row: WrunScriptInputDeclaration, a: unknown, b: unknown): boolean;
|
|
398
418
|
/**
|
|
399
419
|
* A preset's values in the dialog's storage types (frozen contract, plan
|
|
400
420
|
* 1.2): a toggle a boolean, a select its numeric option string (a label or
|
|
@@ -1833,6 +1833,49 @@ export function coerceWrunRowValue(row, raw) {
|
|
|
1833
1833
|
return numericValue(raw);
|
|
1834
1834
|
}
|
|
1835
1835
|
}
|
|
1836
|
+
/** A row's stored value in its declared kind, else its declared default
|
|
1837
|
+
* (the settings panel's read, wrun-dialog-rows `readRowValue`: the controls,
|
|
1838
|
+
* the changed dot and its reset, the preset chip, a `when` gate, a swatch).
|
|
1839
|
+
* The run head's market-scaled defaults (wrun-market-size-defaults.util) read
|
|
1840
|
+
* a row through it too, so "unchanged" there is the reset icon's own test. */
|
|
1841
|
+
export function wrunRowValue(settings, row) {
|
|
1842
|
+
const stored = settings[row.name];
|
|
1843
|
+
const fit = stored === undefined || stored === null ? undefined : coerceWrunRowValue(row, stored);
|
|
1844
|
+
return fit ?? row.defaultValue;
|
|
1845
|
+
}
|
|
1846
|
+
function normalizeRowScalar(value) {
|
|
1847
|
+
if (typeof value === 'boolean')
|
|
1848
|
+
return value ? 1 : 0;
|
|
1849
|
+
if (typeof value === 'string') {
|
|
1850
|
+
const trimmed = value.trim();
|
|
1851
|
+
if (trimmed !== '' && Number.isFinite(Number(trimmed)))
|
|
1852
|
+
return Number(trimmed);
|
|
1853
|
+
return value;
|
|
1854
|
+
}
|
|
1855
|
+
return value;
|
|
1856
|
+
}
|
|
1857
|
+
/** Equality the way the run reads values back: a toggle as 1/0, a select's
|
|
1858
|
+
* numeric string as its number, a colour array element by element. */
|
|
1859
|
+
export function wrunValuesEqual(a, b) {
|
|
1860
|
+
if (Array.isArray(a) || Array.isArray(b)) {
|
|
1861
|
+
if (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length)
|
|
1862
|
+
return false;
|
|
1863
|
+
return a.every((item, index) => wrunValuesEqual(item, b[index]));
|
|
1864
|
+
}
|
|
1865
|
+
const left = normalizeRowScalar(a);
|
|
1866
|
+
const right = normalizeRowScalar(b);
|
|
1867
|
+
if (typeof left === 'string' && typeof right === 'string')
|
|
1868
|
+
return left.toLowerCase() === right.toLowerCase();
|
|
1869
|
+
return left === right;
|
|
1870
|
+
}
|
|
1871
|
+
/** Equality for one row's value: a text row compares its words exactly (a
|
|
1872
|
+
* typed "20" is not the number 20, "Abc" is not "abc"); every other kind
|
|
1873
|
+
* the way the run reads values back ({@link wrunValuesEqual}). */
|
|
1874
|
+
export function wrunRowValuesEqual(row, a, b) {
|
|
1875
|
+
if (row.type === 'text')
|
|
1876
|
+
return String(a ?? '') === String(b ?? '');
|
|
1877
|
+
return wrunValuesEqual(a, b);
|
|
1878
|
+
}
|
|
1836
1879
|
/** A `colors` style row's value: exactly its declared swatches, element i
|
|
1837
1880
|
* the stored colour (a colour setting or a theme token) else the swatch's
|
|
1838
1881
|
* default, so no swatch shifts; a stored list with no usable element is no
|
|
@@ -1017,6 +1017,10 @@ export declare function wrunBrowserReadsFeeds(): boolean;
|
|
|
1017
1017
|
* must be loaded first (`wrunChartHostEnv().loadSharedHost()`) whenever the flag is on.
|
|
1018
1018
|
*/
|
|
1019
1019
|
export declare function wrunBrowserRunWireCaps(): string[];
|
|
1020
|
+
/** The celled classes the browser lanes serve by an exact join (intrabar and candles ride legs): each class's inputs
|
|
1021
|
+
* read the one lane its class rides, an unasked one none (`wrunUnaskedCelledInput`; the class guard walks this set,
|
|
1022
|
+
* tests/utility/wrun/wrun-source-rows.lane-demand.spec.ts). */
|
|
1023
|
+
export declare const WRUN_LANE_CELL_CLASSES: ReadonlySet<string>;
|
|
1020
1024
|
/**
|
|
1021
1025
|
* The state the aligner holds between builds (the shared host's `WrunInputCarry`): the newest row
|
|
1022
1026
|
* folded in, each carry input's newest finite value, each forming fold's bucket, each leg's
|