@orangecharts/wrun-chart-host 0.8.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/constants/feature-flags.constants.d.ts +9 -0
- package/dist/constants/feature-flags.constants.js +86 -16
- package/dist/constants/marketCapabilities.constants.d.ts +14 -9
- package/dist/constants/marketCapabilities.constants.js +36 -13
- package/dist/constants/opra-compliance.constants.d.ts +15 -0
- package/dist/constants/opra-compliance.constants.js +15 -0
- package/dist/constants/option-venues.constants.d.ts +11 -6
- package/dist/constants/option-venues.constants.js +5 -2
- package/dist/constants/scriptEditor/builtin-script-snippets.d.ts +26 -0
- package/dist/constants/scriptEditor/builtin-script-snippets.js +6 -0
- package/dist/constants/scriptEditor/technicalIndicatorScriptKeys.constants.d.ts +15 -0
- package/dist/constants/scriptEditor/technicalIndicatorScriptKeys.constants.js +17 -0
- package/dist/constants/venue-presets.constants.d.ts +20 -20
- package/dist/constants/venue-presets.constants.js +24 -26
- package/dist/host-env.d.ts +39 -9
- package/dist/host-env.js +6 -0
- package/dist/host-ports.types.d.ts +108 -18
- package/dist/index.d.ts +14 -0
- package/dist/index.js +14 -0
- package/dist/interfaces/kscript-diagnostics.interface.d.ts +6 -0
- package/dist/interfaces/opra-realtime.interface.d.ts +13 -11
- package/dist/interfaces/opra-realtime.interface.js +10 -10
- package/dist/interfaces/replay.interface.d.ts +8 -0
- package/dist/interfaces/wrun-runtime.interface.d.ts +52 -15
- package/dist/kscript-data/controls/live-trades-merge.util.d.ts +94 -14
- package/dist/kscript-data/controls/live-trades-merge.util.js +132 -22
- package/dist/kscript-data/controls/live-trades-order-gate.util.d.ts +56 -0
- package/dist/kscript-data/controls/live-trades-order-gate.util.js +107 -0
- package/dist/market-data/billing.interface.d.ts +227 -42
- package/dist/market-data/billing.interface.js +60 -12
- package/dist/market-data/venue.d.ts +88 -6
- package/dist/market-data/venues/cme.contract.copy.json +66 -0
- package/dist/market-data/venues/cme.d.ts +126 -0
- package/dist/market-data/venues/cme.js +133 -0
- package/dist/market-data/venues/index.d.ts +165 -8
- package/dist/market-data/venues/index.js +48 -6
- package/dist/market-data/venues/opra.contract.copy.json +5 -3
- package/dist/market-data/venues/opra.d.ts +3 -3
- package/dist/market-data/venues/opra.js +5 -4
- package/dist/replay/replayLadder.js +3 -1
- package/dist/settings-templates/index.js +7 -3
- package/dist/settings-templates/indicator-fields.d.ts +5 -4
- package/dist/settings-templates/indicator-fields.js +45 -6
- package/dist/settings-templates/tool-rules.d.ts +27 -17
- package/dist/settings-templates/tool-rules.js +27 -11
- package/dist/settings-templates/tool-tables.generated.js +91 -31
- package/dist/utility/chart/book-live-bucket.util.d.ts +15 -0
- package/dist/utility/chart/book-live-bucket.util.js +47 -0
- package/dist/utility/chart/crypto-index.leaf.d.ts +2 -2
- package/dist/utility/chart/crypto-index.leaf.js +2 -2
- package/dist/utility/chart/index-mode-admission.util.js +24 -3
- package/dist/utility/chart/index-mode.util.d.ts +5 -2
- package/dist/utility/chart/index-mode.util.js +23 -13
- package/dist/utility/chart/kscript-drawing-safe-area.util.d.ts +35 -11
- package/dist/utility/chart/kscript-drawing-safe-area.util.js +145 -35
- package/dist/utility/chart/kscript-live-coalesce.util.d.ts +7 -2
- package/dist/utility/chart/kscript-live-coalesce.util.js +9 -3
- package/dist/utility/chart/kscript-provenance-keys.util.js +6 -0
- package/dist/utility/chart/kscript-standin-identity.leaf.d.ts +3 -1
- package/dist/utility/chart/kscript-titancharts-render-keys.constants.d.ts +32 -2
- package/dist/utility/chart/kscript-titancharts-render-keys.constants.js +45 -0
- package/dist/utility/chart/kscript-venue-policy.util.d.ts +53 -27
- package/dist/utility/chart/kscript-venue-policy.util.js +74 -32
- package/dist/utility/chart/market-session-schedule.util.d.ts +10 -0
- package/dist/utility/chart/market-session-schedule.util.js +16 -0
- package/dist/utility/chart/marketKind.util.d.ts +12 -10
- package/dist/utility/chart/marketKind.util.js +17 -7
- package/dist/utility/chart/om-panel-push-style.util.d.ts +7 -7
- package/dist/utility/chart/om-panel-push-style.util.js +17 -15
- package/dist/utility/chart/om-panel.util.js +6 -6
- package/dist/utility/chart/opra-read-access.leaf.d.ts +5 -3
- package/dist/utility/chart/opra-read-access.leaf.js +5 -3
- package/dist/utility/chart/profile-block-size.util.d.ts +16 -0
- package/dist/utility/chart/profile-block-size.util.js +7 -0
- package/dist/utility/chart/quote-perp.leaf.d.ts +17 -0
- package/dist/utility/chart/quote-perp.leaf.js +20 -0
- package/dist/utility/chart/rth-session.util.d.ts +3 -2
- package/dist/utility/chart/rth-session.util.js +2 -1
- package/dist/utility/chart/window-geometry.leaf.d.ts +8 -0
- package/dist/utility/chart/window-geometry.leaf.js +22 -6
- package/dist/utility/chart/wrun-run-result.util.d.ts +17 -0
- package/dist/utility/chart/wrun-run-result.util.js +145 -7
- package/dist/utility/common/transformations.util.d.ts +7 -0
- package/dist/utility/common/transformations.util.js +11 -0
- package/dist/utility/options/option-bar-anchor.util.d.ts +145 -0
- package/dist/utility/options/option-bar-anchor.util.js +340 -0
- package/dist/utility/options/option-venue.util.d.ts +21 -3
- package/dist/utility/options/option-venue.util.js +30 -3
- package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.js +2 -0
- package/dist/utility/wrun/derived-roots.util.d.ts +213 -0
- package/dist/utility/wrun/derived-roots.util.js +471 -0
- package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.d.ts +41 -6
- package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.js +89 -19
- package/dist/utility/wrun/run-schedule/wrun-gate-reader-warm.util.d.ts +9 -4
- package/dist/utility/wrun/run-schedule/wrun-gate-reader-warm.util.js +47 -6
- package/dist/utility/wrun/run-schedule/wrun-late-reads.util.d.ts +5 -3
- package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +6 -4
- package/dist/utility/wrun/run-schedule/wrun-prefix-feeds.util.d.ts +2 -2
- package/dist/utility/wrun/run-schedule/wrun-prefix-feeds.util.js +5 -1
- package/dist/utility/wrun/sources/lanes/option_daily.js +5 -2
- package/dist/utility/wrun/sources/lanes/options_flow.js +5 -2
- package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +64 -19
- package/dist/utility/wrun/sources/opra-option-lanes.util.js +105 -35
- package/dist/utility/wrun/sources/row-lane-registry.js +3 -2
- package/dist/utility/wrun/sources/row-lanes/option_contract_flow.js +2 -1
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.d.ts +9 -3
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +15 -6
- package/dist/utility/wrun/sources/row-lanes/option_prints.d.ts +14 -0
- package/dist/utility/wrun/sources/row-lanes/option_prints.js +82 -13
- package/dist/utility/wrun/sources/row-lanes/option_strike_flow.js +17 -4
- package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +55 -8
- package/dist/utility/wrun/sources/row-lanes/option_strikes.js +95 -14
- package/dist/utility/wrun/sources/row-lanes/option_surface.d.ts +5 -2
- package/dist/utility/wrun/sources/row-lanes/option_surface.js +7 -3
- package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +19 -0
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +35 -14
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +70 -20
- package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.d.ts +64 -0
- package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.js +89 -0
- package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.d.ts +45 -1
- package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.js +114 -6
- package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +56 -5
- package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +224 -26
- package/dist/utility/wrun/sources/wrun-row-lanes.util.js +822 -58
- package/dist/utility/wrun/wrun-batched-marks.util.d.ts +16 -3
- package/dist/utility/wrun/wrun-batched-marks.util.js +30 -19
- package/dist/utility/wrun/wrun-batched-readout.util.d.ts +37 -9
- package/dist/utility/wrun/wrun-batched-readout.util.js +61 -15
- package/dist/utility/wrun/wrun-builtin-twin.util.d.ts +12 -0
- package/dist/utility/wrun/wrun-builtin-twin.util.js +21 -0
- package/dist/utility/wrun/wrun-canvas-readout.util.d.ts +4 -0
- package/dist/utility/wrun/wrun-cell-capacity.leaf.d.ts +66 -0
- package/dist/utility/wrun/wrun-cell-capacity.leaf.js +86 -0
- package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +192 -13
- package/dist/utility/wrun/wrun-chart-market-facts.util.js +437 -55
- package/dist/utility/wrun/wrun-color-facts.util.d.ts +19 -9
- package/dist/utility/wrun/wrun-color-facts.util.js +24 -14
- package/dist/utility/wrun/wrun-color-settings.util.d.ts +15 -4
- package/dist/utility/wrun/wrun-color-settings.util.js +31 -12
- package/dist/utility/wrun/wrun-dollar-unit-port.leaf.d.ts +17 -0
- package/dist/utility/wrun/wrun-dollar-unit-port.leaf.js +9 -0
- package/dist/utility/wrun/wrun-download-meter.util.d.ts +107 -0
- package/dist/utility/wrun/wrun-download-meter.util.js +134 -0
- package/dist/utility/wrun/wrun-download-plan.util.d.ts +99 -0
- package/dist/utility/wrun/wrun-download-plan.util.js +118 -0
- package/dist/utility/wrun/wrun-draft-legend-note.util.d.ts +11 -3
- package/dist/utility/wrun/wrun-draft-legend-note.util.js +26 -4
- package/dist/utility/wrun/wrun-draft-overlay.util.d.ts +6 -1
- package/dist/utility/wrun/wrun-draft-overlay.util.js +23 -3
- package/dist/utility/wrun/wrun-frames.d.ts +27 -6
- package/dist/utility/wrun/wrun-frames.js +78 -15
- package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +2 -2
- package/dist/utility/wrun/wrun-hosted-wire-caps.js +7 -0
- package/dist/utility/wrun/wrun-hosted-wire.util.d.ts +7 -1
- package/dist/utility/wrun/wrun-hosted-wire.util.js +12 -2
- package/dist/utility/wrun/wrun-hud-looks.util.d.ts +51 -21
- package/dist/utility/wrun/wrun-hud-looks.util.js +74 -28
- package/dist/utility/wrun/wrun-latest-snapshot.d.ts +11 -0
- package/dist/utility/wrun/wrun-lifecycle-runtime.util.d.ts +8 -6
- package/dist/utility/wrun/wrun-lifecycle-runtime.util.js +8 -6
- package/dist/utility/wrun/wrun-lifecycle.contract.d.ts +4 -2
- package/dist/utility/wrun/wrun-live-intake.util.d.ts +19 -9
- package/dist/utility/wrun/wrun-live-intake.util.js +213 -45
- package/dist/utility/wrun/wrun-live-tick.util.d.ts +4 -0
- package/dist/utility/wrun/wrun-live-tick.util.js +246 -49
- package/dist/utility/wrun/wrun-market-size-contract-carry.leaf.d.ts +53 -0
- package/dist/utility/wrun/wrun-market-size-contract-carry.leaf.js +162 -0
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +205 -48
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +277 -34
- package/dist/utility/wrun/wrun-market-size-defaults.util.d.ts +51 -7
- package/dist/utility/wrun/wrun-market-size-defaults.util.js +340 -56
- package/dist/utility/wrun/wrun-opra-lane.util.d.ts +17 -4
- package/dist/utility/wrun/wrun-opra-lane.util.js +6 -4
- package/dist/utility/wrun/wrun-option-prints.util.d.ts +41 -2
- package/dist/utility/wrun/wrun-option-prints.util.js +80 -13
- package/dist/utility/wrun/wrun-option-strike-flow-forecast.util.d.ts +31 -0
- package/dist/utility/wrun/wrun-option-strike-flow-forecast.util.js +119 -0
- package/dist/utility/wrun/wrun-option-strike-flow-lane.util.d.ts +26 -6
- package/dist/utility/wrun/wrun-option-strike-flow-lane.util.js +50 -11
- package/dist/utility/wrun/wrun-option-strike-flow.util.d.ts +109 -19
- package/dist/utility/wrun/wrun-option-strike-flow.util.js +222 -61
- package/dist/utility/wrun/wrun-option-views.util.d.ts +96 -18
- package/dist/utility/wrun/wrun-option-views.util.js +246 -51
- package/dist/utility/wrun/wrun-options-stop.util.d.ts +2 -1
- package/dist/utility/wrun/wrun-options-stop.util.js +3 -2
- package/dist/utility/wrun/wrun-output-style.util.d.ts +6 -2
- package/dist/utility/wrun/wrun-output-style.util.js +20 -2
- package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +20 -0
- package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.d.ts +31 -14
- package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.js +22 -0
- package/dist/utility/wrun/wrun-overlay-lifecycle.util.d.ts +10 -1
- package/dist/utility/wrun/wrun-overlay-lifecycle.util.js +52 -4
- package/dist/utility/wrun/wrun-overlay-recovery.util.d.ts +7 -0
- package/dist/utility/wrun/wrun-overlay-recovery.util.js +25 -1
- package/dist/utility/wrun/wrun-overlay-result.util.d.ts +7 -1
- package/dist/utility/wrun/wrun-overlay-result.util.js +2 -0
- package/dist/utility/wrun/wrun-overlay-run.util.d.ts +134 -37
- package/dist/utility/wrun/wrun-overlay-run.util.js +1118 -254
- package/dist/utility/wrun/wrun-pack-widths.leaf.d.ts +4 -4
- package/dist/utility/wrun/wrun-pack-widths.leaf.js +4 -4
- package/dist/utility/wrun/wrun-pack.util.d.ts +7 -3
- package/dist/utility/wrun/wrun-pack.util.js +20 -9
- package/dist/utility/wrun/wrun-pane-format.util.d.ts +2 -1
- package/dist/utility/wrun/wrun-pane-format.util.js +7 -3
- package/dist/utility/wrun/wrun-panel-mount.util.d.ts +9 -0
- package/dist/utility/wrun/wrun-panel-mount.util.js +63 -13
- package/dist/utility/wrun/wrun-panel-style.util.d.ts +37 -24
- package/dist/utility/wrun/wrun-panel-style.util.js +100 -29
- package/dist/utility/wrun/wrun-param-map.util.d.ts +15 -11
- package/dist/utility/wrun/wrun-param-map.util.js +13 -5
- package/dist/utility/wrun/wrun-param-values.util.d.ts +21 -3
- package/dist/utility/wrun/wrun-param-values.util.js +6 -0
- package/dist/utility/wrun/wrun-pin-spelling.util.js +12 -11
- package/dist/utility/wrun/wrun-prefix-lanes.util.js +2 -2
- package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +50 -0
- package/dist/utility/wrun/wrun-refusal-surface.util.js +68 -0
- package/dist/utility/wrun/wrun-refusal.util.js +10 -1
- package/dist/utility/wrun/wrun-refused-latest.util.d.ts +10 -0
- package/dist/utility/wrun/wrun-refused-latest.util.js +12 -0
- package/dist/utility/wrun/wrun-row-source.d.ts +11 -0
- package/dist/utility/wrun/wrun-run-interval.util.d.ts +4 -2
- package/dist/utility/wrun/wrun-run-interval.util.js +9 -6
- package/dist/utility/wrun/wrun-script-inputs.util.d.ts +52 -1
- package/dist/utility/wrun/wrun-script-inputs.util.js +112 -4
- package/dist/utility/wrun/wrun-setting-words.util.d.ts +7 -3
- package/dist/utility/wrun/wrun-setting-words.util.js +13 -5
- package/dist/utility/wrun/wrun-socket-row-source.d.ts +27 -2
- package/dist/utility/wrun/wrun-socket-row-source.js +113 -8
- package/dist/utility/wrun/wrun-source-rows.util.d.ts +9 -1
- package/dist/utility/wrun/wrun-source-rows.util.js +108 -43
- package/dist/utility/wrun/wrun-style-words.util.js +6 -4
- package/dist/utility/wrun/wrun-table-chrome.util.d.ts +3 -2
- package/dist/utility/wrun/wrun-table-chrome.util.js +19 -11
- package/dist/utility/wrun/wrun-tape-per-order.util.d.ts +2 -0
- package/dist/utility/wrun/wrun-tape-per-order.util.js +26 -0
- package/dist/utility/wrun/wrun-tape-source.util.d.ts +126 -50
- package/dist/utility/wrun/wrun-tape-source.util.js +193 -68
- package/dist/utility/wrun/wrun-volume-profile-lane.util.d.ts +7 -5
- package/dist/utility/wrun/wrun-volume-profile-lane.util.js +8 -6
- package/dist/utils/replay/replay-buffer-math.d.ts +53 -2
- package/dist/utils/replay/replay-buffer-math.js +227 -20
- package/dist/workers/utils/volume-profile.worker.util.d.ts +4 -1
- package/dist/workers/utils/volume-profile.worker.util.js +5 -2
- package/dist/workers/wrun/wrun-abi-host.js +3 -2
- package/package.json +5 -5
|
@@ -8,9 +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), except
|
|
12
|
-
*
|
|
13
|
-
*
|
|
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.
|
|
14
16
|
*
|
|
15
17
|
* Pure and worker safe (om-panel.util rides the frame worker): it imports the
|
|
16
18
|
* style foundation only. Colour words resolve here against `ctx.theme`
|
|
@@ -131,9 +133,14 @@ const WRUN_PANEL_SERIES_STYLE_WORDS = {
|
|
|
131
133
|
export const WRUN_PANEL_STYLE_KEYS = Object.keys(WRUN_PANEL_STYLE_WORDS);
|
|
132
134
|
/** Every `panels[i].series[j]` style word. */
|
|
133
135
|
export const WRUN_PANEL_SERIES_STYLE_KEYS = Object.keys(WRUN_PANEL_SERIES_STYLE_WORDS);
|
|
134
|
-
/**
|
|
135
|
-
*
|
|
136
|
-
|
|
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'];
|
|
137
144
|
/** The default `stroke_fade.edge_opacity` (SC03; the engine's own default). */
|
|
138
145
|
export const WRUN_PANEL_STROKE_FADE_EDGE_OPACITY = 0.35;
|
|
139
146
|
/** The badge chip's defaults (C2): the fill when `color` is absent, and the
|
|
@@ -166,14 +173,23 @@ const WRUN_ENGINE_FORMATTING = undefined;
|
|
|
166
173
|
export function wrunPaneColor(word, theme) {
|
|
167
174
|
return wrunHex8ToRgba(theme === undefined ? word : resolveWrunColorWord(word, theme));
|
|
168
175
|
}
|
|
169
|
-
/**
|
|
170
|
-
*
|
|
171
|
-
|
|
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. */
|
|
172
189
|
export function wrunPanelChrome(panel) {
|
|
173
190
|
if (panel.chrome !== undefined)
|
|
174
191
|
return panel.chrome;
|
|
175
|
-
|
|
176
|
-
return panel.kind === 'line' && numeric && panel.stacked !== true ? 'grid' : 'box';
|
|
192
|
+
return WRUN_PANEL_HAIRLINE_KINDS.has(panel.kind) ? 'hairlines' : 'box';
|
|
177
193
|
}
|
|
178
194
|
// Helpers
|
|
179
195
|
/** Writes `key` only when the word is declared. */
|
|
@@ -225,10 +241,13 @@ function panelBadge(panel, chrome, ctx) {
|
|
|
225
241
|
const textColor = badge.text_color !== undefined ? wrunPaneColor(badge.text_color, ctx.theme) : wrunPanelBadgeInk(color);
|
|
226
242
|
return { text: badge.text, color, textColor };
|
|
227
243
|
}
|
|
228
|
-
/** The
|
|
229
|
-
* 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. */
|
|
230
247
|
function chromeStylePatch(panel) {
|
|
231
|
-
return panel.chrome !== undefined
|
|
248
|
+
return panel.chrome !== undefined || WRUN_PANEL_HAIRLINE_KINDS.has(panel.kind)
|
|
249
|
+
? { chromeStyle: wrunPanelChrome(panel) }
|
|
250
|
+
: {};
|
|
232
251
|
}
|
|
233
252
|
/** A time key in ms (keys under 1e11 are seconds; the SC37 rule). */
|
|
234
253
|
function timeKeyMs(key) {
|
|
@@ -257,6 +276,52 @@ function keyOrdinals(rows) {
|
|
|
257
276
|
}
|
|
258
277
|
return ordinals;
|
|
259
278
|
}
|
|
279
|
+
/** C3: the labels a numeric-x frame carries for its rows (`x_labels`, ""
|
|
280
|
+
* for a row without one); undefined off a numeric x, without the word, or
|
|
281
|
+
* when no entry holds a label, so such a frame sends no key. */
|
|
282
|
+
function frameXLabels(panel, chrome) {
|
|
283
|
+
const labels = panel.x === 'number' ? chrome?.x_labels : undefined;
|
|
284
|
+
return labels?.some((label) => label !== '') === true ? labels : undefined;
|
|
285
|
+
}
|
|
286
|
+
/** A numeric line's row labels as the curve's `xValueLabels` (C3): each
|
|
287
|
+
* labelled row's exact x as `String(x)` (the key the engine reads back as
|
|
288
|
+
* `x + ""`) to its label, in row order, the first labelled row of a repeated
|
|
289
|
+
* x winning. The curve titles its hover card and a marker's show_value text
|
|
290
|
+
* with it; its axis ticks fall between the rows and print through the x
|
|
291
|
+
* words only. */
|
|
292
|
+
function lineXValueLabels(panel, chrome, rows) {
|
|
293
|
+
const labels = frameXLabels(panel, chrome);
|
|
294
|
+
if (labels === undefined)
|
|
295
|
+
return undefined;
|
|
296
|
+
const byX = new Map();
|
|
297
|
+
rows.forEach((row, index) => {
|
|
298
|
+
const label = labels[index];
|
|
299
|
+
const key = String(row[0]);
|
|
300
|
+
if (label && !byX.has(key))
|
|
301
|
+
byX.set(key, label);
|
|
302
|
+
});
|
|
303
|
+
return byX.size > 0 ? Object.fromEntries(byX) : undefined;
|
|
304
|
+
}
|
|
305
|
+
/** A numeric bars pane's row labels (C3). The bars engine reads no
|
|
306
|
+
* `xValueLabels`: it ticks each bar and titles its hover card from `xLabels`
|
|
307
|
+
* (one per bar in row order; `hoverLabels` falls back to it), so a labelled
|
|
308
|
+
* row's label replaces its key there and every other bar keeps the text
|
|
309
|
+
* translatePanelToEngine gives a numeric key (the x words when `x_format`
|
|
310
|
+
* is declared, else `String(key)`; the spec pins the two against each
|
|
311
|
+
* other). */
|
|
312
|
+
function barsXLabels(panel, chrome, rows, ctx) {
|
|
313
|
+
const labels = frameXLabels(panel, chrome);
|
|
314
|
+
if (labels === undefined)
|
|
315
|
+
return undefined;
|
|
316
|
+
const format = panel.x_format !== undefined ? wrunPanelFormatter(panel, rows, ctx) : undefined;
|
|
317
|
+
return rows.map((row, index) => {
|
|
318
|
+
const label = labels[index];
|
|
319
|
+
if (label)
|
|
320
|
+
return label;
|
|
321
|
+
const key = row[0];
|
|
322
|
+
return format !== undefined ? format(key, 'x', -1) : String(key);
|
|
323
|
+
});
|
|
324
|
+
}
|
|
260
325
|
/** The axis words shared by line, bars, histogram and scatter (SC39, SC20):
|
|
261
326
|
* titles, pinned ranges (frame first) and the zero rule. `y_title` is the
|
|
262
327
|
* rich curve's `yCaption` and every other pane's `yTitle`; `xLabel` (the
|
|
@@ -399,11 +464,11 @@ function lineMarkers(panel, chrome, rows, ctx) {
|
|
|
399
464
|
return markers;
|
|
400
465
|
}
|
|
401
466
|
/** The line words (SC03 SC04 SC24 SC25 SC29 SC30 SC39): smoothing, the
|
|
402
|
-
* signed two-tone fill, fill fade, stroke fade, markers,
|
|
403
|
-
* glow, motion, latest-value chips and the
|
|
404
|
-
* fill ink, style, width, dash, dots, end
|
|
405
|
-
* series. `y_title` is the rich curve's
|
|
406
|
-
* (the effective chrome decides, SC02). */
|
|
467
|
+
* signed two-tone fill, fill fade, stroke fade, markers, the frame's row
|
|
468
|
+
* labels (C3), dots, end labels, glow, motion, latest-value chips and the
|
|
469
|
+
* axis words on the pane; fill, fill ink, style, width, dash, dots, end
|
|
470
|
+
* label and legend membership per series. `y_title` is the rich curve's
|
|
471
|
+
* caption and a box line's axis title (the effective chrome decides, SC02). */
|
|
407
472
|
export function wrunLineStyle(panel, chrome, rows, ctx) {
|
|
408
473
|
const color = (word) => wrunPaneColor(word, ctx.theme);
|
|
409
474
|
const rich = wrunPanelChrome(panel) !== 'box';
|
|
@@ -431,6 +496,7 @@ export function wrunLineStyle(panel, chrome, rows, ctx) {
|
|
|
431
496
|
settings.strokeGradient = strokeGradient;
|
|
432
497
|
}
|
|
433
498
|
put(settings, 'markers', lineMarkers(panel, chrome, rows, ctx));
|
|
499
|
+
put(settings, 'xValueLabels', lineXValueLabels(panel, chrome, rows));
|
|
434
500
|
put(settings, 'badge', panelBadge(panel, chrome, ctx));
|
|
435
501
|
put(settings, 'points', panel.points);
|
|
436
502
|
put(settings, 'endLabels', panel.labels);
|
|
@@ -465,10 +531,11 @@ function barShapeStyle(panel) {
|
|
|
465
531
|
}
|
|
466
532
|
/** The bars words (SC19 SC23 SC24 SC39, C2): sign colouring (the tones
|
|
467
533
|
* come from the common words), the axis words, the bar shape, the badge
|
|
468
|
-
* chip
|
|
469
|
-
*
|
|
470
|
-
* per-bar colours are row data
|
|
471
|
-
|
|
534
|
+
* chip, the frame's row labels (C3, as `xLabels`) and legend membership
|
|
535
|
+
* per series (`series[j].legend: false` keeps that series out of the legend
|
|
536
|
+
* chips, a `series` patch merged per index); per-bar colours are row data
|
|
537
|
+
* the caller maps. */
|
|
538
|
+
export function wrunBarsStyle(panel, chrome, rows, ctx) {
|
|
472
539
|
const patch = {
|
|
473
540
|
...chromeStylePatch(panel),
|
|
474
541
|
...axisStyle(panel, chrome, { rich: false, curve: false, xBounds: false }),
|
|
@@ -477,6 +544,7 @@ export function wrunBarsStyle(panel, chrome, _rows, ctx) {
|
|
|
477
544
|
if (panel.color_mode === 'sign')
|
|
478
545
|
patch.signedBars = true;
|
|
479
546
|
put(patch, 'badge', panelBadge(panel, chrome, ctx));
|
|
547
|
+
put(patch, 'xLabels', barsXLabels(panel, chrome, rows, ctx));
|
|
480
548
|
const series = panel.series ?? [];
|
|
481
549
|
if (series.some((entry) => entry.legend === false)) {
|
|
482
550
|
patch.series = series.map((entry) => (entry.legend === false ? { hideFromLegend: true } : {}));
|
|
@@ -572,15 +640,18 @@ export function wrunPieStyle(panel, chrome, rows, ctx) {
|
|
|
572
640
|
return patch;
|
|
573
641
|
}
|
|
574
642
|
/** The heatmap words (SC06 SC18): under scale "palette" the stops (the
|
|
575
|
-
* declared ones, else today's three
|
|
576
|
-
*
|
|
577
|
-
*
|
|
578
|
-
*
|
|
579
|
-
*
|
|
643
|
+
* declared ones, else the mono ramp, or today's three on the push lane,
|
|
644
|
+
* which has no theme to resolve the ramp against) and the bounds (frame
|
|
645
|
+
* first); under "signed" none of them, so the engine's diverging scale
|
|
646
|
+
* draws through the common tone pair. The highlight resolves its keys to
|
|
647
|
+
* the engine's row and column indices (a key absent from the rows is
|
|
648
|
+
* dropped), the axis nouns pass through, and a frame summary is fitted to
|
|
649
|
+
* the column count. */
|
|
580
650
|
export function wrunHeatmapStyle(panel, chrome, indices, ctx) {
|
|
581
651
|
const patch = {};
|
|
582
652
|
if (panel.scale !== 'signed') {
|
|
583
|
-
|
|
653
|
+
const stops = panel.palette ?? (ctx.theme !== undefined ? WRUN_PANEL_HEATMAP_PALETTE : WRUN_PANEL_HEATMAP_UNTHEMED_PALETTE);
|
|
654
|
+
patch.palette = stops.map((word) => wrunPaneColor(word, ctx.theme));
|
|
584
655
|
put(patch, 'min', frameFirst(panel, chrome, 'min'));
|
|
585
656
|
put(patch, 'max', frameFirst(panel, chrome, 'max'));
|
|
586
657
|
}
|
|
@@ -56,8 +56,9 @@
|
|
|
56
56
|
* (tests/workers/worker-runtime-boundary.spec.ts), which the alert identity
|
|
57
57
|
* module does.
|
|
58
58
|
*/
|
|
59
|
-
import type { WrunIndicatorMetadata, WrunMetadataParam
|
|
59
|
+
import type { WrunIndicatorMetadata, WrunMetadataParam } from '../../interfaces/wrun-runtime.interface.js';
|
|
60
60
|
import { type WrunHostFillContext } from './wrun-script-inputs.util.js';
|
|
61
|
+
import type { WrunHostFillWord } from './wrun-param-values.util.js';
|
|
61
62
|
/** The hosted lane's param map: packed finite numbers; for a `type: "text"`
|
|
62
63
|
* param (wrun-5) the chart's own run value for the setting (each host
|
|
63
64
|
* applies the plain-text rule and the byte cap again on its side and
|
|
@@ -79,17 +80,19 @@ export declare function wrunHostedTextValue(param: Pick<WrunMetadataParam, 'text
|
|
|
79
80
|
* reads) and the hidden param the kit generates for it (`market.<word>()` declares `market_<word>`, `chart.<word>()`
|
|
80
81
|
* `chart_<word>`; the extractor refuses any other param under those names), in the kit's order: the market's tick
|
|
81
82
|
* 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
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
83
|
+
* TH-candle-colors), the market's five facts (WRUN-GAPS-1005, WRUN-SESSION), the issuer's three earnings facts, the
|
|
84
|
+
* option multiplier of the chart's options chain, the dollar multiplier of its own trades (kit 0.95.0) and whether the
|
|
85
|
+
* chart is one option contract (om C5, a word read ahead of the kit pin: WrunHostFillWord). Every hosted path reads it:
|
|
86
|
+
* the settings record's `hostFill` (wrunHostedHostFill), the declaration rebuild (WRUN_HOST_FILL_BY_GENERATED_NAME)
|
|
87
|
+
* and the kScript socket worker's read of the main thread's context (WRUN_HOST_FILL_CONTEXT_KEYS), so no hosted path
|
|
88
|
+
* drops a word another carries; wrun-param-values.util.spec holds the table to every word the browser run fills, the
|
|
89
|
+
* kit's and those read ahead of its pin.
|
|
87
90
|
*/
|
|
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"]];
|
|
91
|
+
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"], readonly ["option_contract", "optionContract", "market_option_contract"]];
|
|
89
92
|
/** The host-filled params by the names the kit generates for them (WRUN_HOST_FILL_WORDS). A declaration row carries
|
|
90
93
|
* no `host_fill` word, so the rebuild recovers it here: without it the host context could not fill the param and a
|
|
91
94
|
* hosted lane would evaluate the declared 0 (unavailable). */
|
|
92
|
-
export declare const WRUN_HOST_FILL_BY_GENERATED_NAME: ReadonlyMap<string,
|
|
95
|
+
export declare const WRUN_HOST_FILL_BY_GENERATED_NAME: ReadonlyMap<string, WrunHostFillWord>;
|
|
93
96
|
/** The chart context keys the kScript socket worker reads off the `wrunHostFill` the main thread puts beside a hosted
|
|
94
97
|
* overlay's settings (finite numbers only), one per host-fill word (WRUN_HOST_FILL_WORDS). */
|
|
95
98
|
export declare const WRUN_HOST_FILL_CONTEXT_KEYS: ReadonlyArray<keyof WrunHostFillContext>;
|
|
@@ -177,9 +180,10 @@ export declare function wrunHostedSettingsRecord(settings: unknown): WrunHostedS
|
|
|
177
180
|
* members to theirs). The cloud merges the patch over its record, so the two end equal. */
|
|
178
181
|
export declare function wrunHostedSettingsPatch(held: unknown, asked: unknown): WrunHostedSettingsRecord;
|
|
179
182
|
/** The host fills a hosted run sends beside its settings record (C4 `hostFill`): the packed chart
|
|
180
|
-
* context by the kit's
|
|
181
|
-
* (its `hostFills
|
|
182
|
-
|
|
183
|
+
* context by host-fill word (the kit's, and a word read ahead of its pin: WrunHostFillWord), the
|
|
184
|
+
* record the SDK's resolver fills `host_fill` params from (its `hostFills`, by each param's own
|
|
185
|
+
* word, so a word it does not know fills nothing). */
|
|
186
|
+
export type WrunHostedHostFill = Partial<Record<WrunHostFillWord, number>>;
|
|
183
187
|
/** The host fills of a chart context (`wrunHostFill`, the pane's market and chart words, packed the
|
|
184
188
|
* way the browser run fills them) by host-fill word: finite numbers only, in the kit's order; none
|
|
185
189
|
* (undefined) for no context or a context holding none. */
|
|
@@ -102,11 +102,13 @@ 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
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
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, the dollar multiplier of its own trades (kit 0.95.0) and whether the
|
|
107
|
+
* chart is one option contract (om C5, a word read ahead of the kit pin: WrunHostFillWord). Every hosted path reads it:
|
|
108
|
+
* the settings record's `hostFill` (wrunHostedHostFill), the declaration rebuild (WRUN_HOST_FILL_BY_GENERATED_NAME)
|
|
109
|
+
* and the kScript socket worker's read of the main thread's context (WRUN_HOST_FILL_CONTEXT_KEYS), so no hosted path
|
|
110
|
+
* drops a word another carries; wrun-param-values.util.spec holds the table to every word the browser run fills, the
|
|
111
|
+
* kit's and those read ahead of its pin.
|
|
110
112
|
*/
|
|
111
113
|
export const WRUN_HOST_FILL_WORDS = [
|
|
112
114
|
['tick_size', 'tickSize', 'market_tick_size'],
|
|
@@ -128,6 +130,10 @@ export const WRUN_HOST_FILL_WORDS = [
|
|
|
128
130
|
['earnings_session', 'earningsSession', 'market_earnings_session'],
|
|
129
131
|
// The option multiplier of the chart's options chain (kit 0.87.0, wrun-chart-market-facts.util).
|
|
130
132
|
['option_multiplier', 'optionMultiplier', 'market_option_multiplier'],
|
|
133
|
+
// The dollar multiplier of the market's own trades (kit 0.95.0, wrun-chart-market-facts.util).
|
|
134
|
+
['dollar_multiplier', 'dollarMultiplier', 'market_dollar_multiplier'],
|
|
135
|
+
// Whether the chart is one option contract (om C5, read ahead of the kit pin, wrun-chart-market-facts.util).
|
|
136
|
+
['option_contract', 'optionContract', 'market_option_contract'],
|
|
131
137
|
];
|
|
132
138
|
/** The host-filled params by the names the kit generates for them (WRUN_HOST_FILL_WORDS). A declaration row carries
|
|
133
139
|
* no `host_fill` word, so the rebuild recovers it here: without it the host context could not fill the param and a
|
|
@@ -237,6 +243,8 @@ export function wrunSheetParamsFromDeclarations(declarations) {
|
|
|
237
243
|
multiline: row.multiline === true,
|
|
238
244
|
}
|
|
239
245
|
: {}),
|
|
246
|
+
// A word read ahead of the kit pin (WrunHostFillWord) rides under the param's pinned type, as it does on the
|
|
247
|
+
// sheet a newer SDK compiled.
|
|
240
248
|
...(hostFill !== undefined ? { host_fill: hostFill, hidden: true } : {}),
|
|
241
249
|
});
|
|
242
250
|
}
|
|
@@ -4,13 +4,21 @@
|
|
|
4
4
|
* (wrun-script-inputs.util re-exports it) and keeps them off the pre-candle closure. Its imports are settings readers
|
|
5
5
|
* the boot path already holds.
|
|
6
6
|
*/
|
|
7
|
-
import type { WrunIndicatorMetadata, WrunMetadataParam } from '../../interfaces/wrun-runtime.interface.js';
|
|
7
|
+
import type { WrunIndicatorMetadata, WrunMetadataParam, WrunParamHostFill } from '../../interfaces/wrun-runtime.interface.js';
|
|
8
|
+
/** The host_fill words the chart fills: the pinned kit's (WrunParamHostFill) and each word read ahead of the pin
|
|
9
|
+
* while the kit that declares it is built. A sheet a newer SDK compiled carries such a word at run time though the
|
|
10
|
+
* pinned type lacks it; once a pin carries it the union adds nothing and the word leaves
|
|
11
|
+
* wrun-param-values.util.spec's AHEAD_OF_KIT. None is read ahead today: `option_contract` (om C5) was, until the
|
|
12
|
+
* chart pinned kit 0.102.0, which declares it. */
|
|
13
|
+
export type WrunHostFillWord = WrunParamHostFill;
|
|
8
14
|
/** What the host fills into `host_fill` params at run time: the chart
|
|
9
15
|
* market's tick size and price precision, the chart's bar interval in
|
|
10
16
|
* seconds, its background / text / candle up / candle down / grid colour as
|
|
11
17
|
* the kit's packed signed i32 (wrun-chart-context.util), the market's
|
|
12
|
-
* five facts as their codes
|
|
13
|
-
*
|
|
18
|
+
* five facts as their codes, the option multiplier of its options chain,
|
|
19
|
+
* the dollar multiplier of its own trades and whether it is one option
|
|
20
|
+
* contract (wrun-chart-market-facts.util); absent = the declared default
|
|
21
|
+
* (0, unknown). */
|
|
14
22
|
export interface WrunHostFillContext {
|
|
15
23
|
tickSize?: number;
|
|
16
24
|
pricePrecision?: number;
|
|
@@ -48,6 +56,16 @@ export interface WrunHostFillContext {
|
|
|
48
56
|
* CME, 1 on a crypto chart (wrunChartOptionMultiplier); 0 where the chart
|
|
49
57
|
* has no options family, which a package reads as unknown (no premium). */
|
|
50
58
|
optionMultiplier?: number;
|
|
59
|
+
/** `market.dollar_multiplier()` (kit 0.95.0): the US dollars one size unit of the
|
|
60
|
+
* market's own trades at one price unit is worth, the unit the dollar tape
|
|
61
|
+
* prices its live prints with and the batched captions read
|
|
62
|
+
* (wrunMarketDollarUnit: a CME contract's registry point value, NQ 20; 1 on
|
|
63
|
+
* a market quoted in dollars); 0 where it is not proven (a full run never
|
|
64
|
+
* computes a sheet declaring it over 0: it refuses first). */
|
|
65
|
+
dollarMultiplier?: number;
|
|
66
|
+
/** `market.option_contract()` (om C5, a kit host-fill word by 0.102.0): 1 when the chart's
|
|
67
|
+
* market is one option contract (an OPRA contract, a CME or crypto option), else 0 (wrunChartOptionContract). */
|
|
68
|
+
optionContract?: number;
|
|
51
69
|
}
|
|
52
70
|
export declare function nonEmptyString(value: unknown): string | undefined;
|
|
53
71
|
export declare function finiteNumber(value: unknown): number | undefined;
|
|
@@ -137,6 +137,12 @@ 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);
|
|
142
|
+
// Asserted wider (WrunHostFillWord): the pinned kit's type lacks this word, which a newer SDK's sheet carries.
|
|
143
|
+
if (param.host_fill === 'option_contract') {
|
|
144
|
+
return finiteOr(finiteNumber(host?.optionContract), fallback);
|
|
145
|
+
}
|
|
140
146
|
const raw = flat?.[param.name];
|
|
141
147
|
switch (param.type) {
|
|
142
148
|
case 'symbol':
|
|
@@ -13,10 +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
|
|
17
|
-
* `BTCUSDT`; a pair on a venue the
|
|
18
|
-
* TradingView spells unlike us (`CRYPTOCAP:HYPEH.D`, the coin cap `CRYPTOCAP:BTC`). Everything else
|
|
19
|
-
* the catalog.
|
|
16
|
+
* (`venue-presets.constants` VENUE_PAIR_QUOTES: Coinbase and OKX write `BTC-USD`, OKX's perpetuals `BTC-USDT-SWAP`,
|
|
17
|
+
* Binance and Bybit `BTCUSDT`; a pair on a venue the table does not spell is confirmed by the catalog), or a
|
|
18
|
+
* CRYPTOCAP symbol TradingView spells unlike us (`CRYPTOCAP:HYPEH.D`, the coin cap `CRYPTOCAP:BTC`). Everything else
|
|
19
|
+
* is ours and skips the catalog.
|
|
20
20
|
* - `resolveWrunPinMarket` (sync over an already-loaded catalog): the written spelling first (our own spelling always
|
|
21
21
|
* wins), then the same instrument through the TradingView prefix tables (tradingview-symbols.leaf, the watchlist
|
|
22
22
|
* import's own: the venue map, the quote split, the perpetual ids, the metals, the CRYPTOCAP ticker renames, where
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
* in an empty fetch. Pure: no store, no service, no I/O (the one async helper awaits a catalog ask its caller injects).
|
|
37
37
|
*/
|
|
38
38
|
import { Category, Exchange } from '@orangecharts/orange-v2-pb-common';
|
|
39
|
-
import {
|
|
39
|
+
import { VENUE_PAIR_QUOTES } from '../../constants/venue-presets.constants.js';
|
|
40
40
|
import { normalizeLegacyExchange } from '../chart/legacy-exchange.leaf.js';
|
|
41
41
|
import { EXCHANGE_DISPLAY_SUFFIXES, formatDisplayToExchange } from '../exchange-normalization.util.js';
|
|
42
42
|
import { BASE_ALIASES, CME_PREFIXES, CRYPTO_VENUES, CRYPTOCAP_PREFIX, FX_PREFIXES, NATIVE_PREFIX, PERP_SUFFIX_RE, TVC_SPOT_METALS, US_STOCK_PREFIXES, VENUE_TO_TRADINGVIEW, cmeContinuousKeyOf, cryptoCandidate, cryptoCapSeriesOf, fxPair, splitCryptoSymbol, } from '../watchlist/import/tradingview-symbols.leaf.js';
|
|
@@ -109,15 +109,16 @@ function readingsOf(input, chartExchange) {
|
|
|
109
109
|
const meant = unwrapNative(named ?? written);
|
|
110
110
|
return meant === written ? [written] : [written, meant];
|
|
111
111
|
}
|
|
112
|
-
/** A crypto venue of ours the TradingView tables or the venue
|
|
112
|
+
/** A crypto venue of ours the TradingView tables describe or the venue spelling table spells. */
|
|
113
113
|
function isOurCryptoVenue(venue) {
|
|
114
|
-
return venue in VENUE_TO_TRADINGVIEW ||
|
|
114
|
+
return venue in VENUE_TO_TRADINGVIEW || Object.hasOwn(VENUE_PAIR_QUOTES, venue);
|
|
115
115
|
}
|
|
116
|
-
/** How a
|
|
117
|
-
* 'USDT'` is `BTCUSDT`, `COINBASE: '-USD'` is `BTC-USD`, `OKEX_SWAP: '-USDT-SWAP'` is `BTC-USDT-SWAP`);
|
|
118
|
-
* for a venue the
|
|
116
|
+
/** How a venue spells a pair in its catalog, read off the whole quote (`venue-presets.constants` VENUE_PAIR_QUOTES:
|
|
117
|
+
* `BINANCE: 'USDT'` is `BTCUSDT`, `COINBASE: '-USD'` is `BTC-USD`, `OKEX_SWAP: '-USDT-SWAP'` is `BTC-USDT-SWAP`);
|
|
118
|
+
* undefined for a venue the table does not spell, and for the bare coin (Hyperliquid's quote ''), which no shape
|
|
119
|
+
* tells. */
|
|
119
120
|
function presetPairForm(venue) {
|
|
120
|
-
const quote =
|
|
121
|
+
const quote = Object.hasOwn(VENUE_PAIR_QUOTES, venue) ? VENUE_PAIR_QUOTES[venue] : undefined;
|
|
121
122
|
if (!quote)
|
|
122
123
|
return undefined;
|
|
123
124
|
if (/^[A-Z0-9]/.test(quote))
|
|
@@ -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 ?? [];
|
|
@@ -1,4 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a refusal record lands (contract C3): the overlay's legend chip and card, a change event
|
|
3
|
+
* for the folded legend summary and the works-on list, and, once per failed user attempt, a toast.
|
|
4
|
+
*
|
|
5
|
+
* - Per-owner verdicts: a full run (`run`) and a live tick (`tick`) each hold at most one record
|
|
6
|
+
* per overlay; the legend shows the higher one by precedence (`compareWrunRefusals`), written
|
|
7
|
+
* through the inert-legend writer, so the legend observer and the change-only comparator keep
|
|
8
|
+
* working and an equal record writes once. A full run or reseed success retracts `all` (it
|
|
9
|
+
* supersedes every earlier tick verdict); a healthy tick retracts `tick`, which shows the run's
|
|
10
|
+
* verdict again when one stands.
|
|
11
|
+
* - Currentness: `projectWrunRefusal` re-checks `isCurrent()` and re-resolves the overlay after
|
|
12
|
+
* EVERY await, so a stale settlement never writes onto an overlay a newer run owns, and a target
|
|
13
|
+
* that moved cells is followed to its new cell.
|
|
14
|
+
* - Attempt tokens: one per overlay key (`chartIndex:indicatorId`), each open a new generation with
|
|
15
|
+
* its origin. A notice is claimable once per live user-origin token, never for `system`, never
|
|
16
|
+
* after close or after the request that carried it ended (`concludeWrunRefusalAttempt`: answered,
|
|
17
|
+
* or superseded by a later request); re-opening a key supersedes the earlier token (the
|
|
18
|
+
* attempt-envelope discipline, kept apart from it: that one settles analytics).
|
|
19
|
+
* - The transient grace (CLOUD-RUN-ROBUST C5, wrun-transient-rerun.util): a record whose cause is
|
|
20
|
+
* transient (`telemetry.cause` in WRUN_TRANSIENT_FAILURE_CAUSES) on an overlay a rerun driver runs
|
|
21
|
+
* waits instead of showing: the overlay shows loading, the events that end the condition rerun it,
|
|
22
|
+
* and the owner's latest record waits. A retraction of its owner (a paint) drops it and nothing
|
|
23
|
+
* shows; a record that shows at once replaces it; a teardown drops it; the grace's deadline shows
|
|
24
|
+
* it exactly as it would have shown at once, while the run or tick that raised it still owns the
|
|
25
|
+
* overlay. A record with no cause, any other cause, or on an overlay no driver runs (a revive or
|
|
26
|
+
* an add whose load failed: nothing could rerun it) shows at once as before, with its Retry.
|
|
27
|
+
* - The HUD (OPRA QA class 5): a `run` record that drew nothing (`paused`) replaces the overlay's
|
|
28
|
+
* latest-values snapshot with the refused one (`wrunRefusedLatestSnapshotOf`) the moment it
|
|
29
|
+
* shows, whoever raised it (the run pass, the loader's own phases, the grace's deadline), so the
|
|
30
|
+
* card says the chip's sentence instead of the numbers of a run before it. A note keeps the
|
|
31
|
+
* snapshot (its picture stands), a record waiting out its grace has not shown yet, and the next
|
|
32
|
+
* accepted run replaces the refused snapshot.
|
|
33
|
+
*
|
|
34
|
+
* Import graph: the chart instances load through the host's loader (`chart.loadTitanCharts`, the
|
|
35
|
+
* wrun lifecycle's rule), and the toast rides the actions util through its loader too
|
|
36
|
+
* (`ui.loadWrunRefusalActions`). The HUD snapshot rides the host's `chart.publishLatestValues`;
|
|
37
|
+
* its words, its bar and its clock come from leaves the boot closure already holds (the legend
|
|
38
|
+
* writer's text util, the gap detector, the server clock).
|
|
39
|
+
*/
|
|
40
|
+
import type { WrunChartHandle } from '../../host-ports.types.js';
|
|
1
41
|
import type { WrunRunReason } from './wrun-lifecycle.contract.js';
|
|
42
|
+
import type { WrunLatestSnapshot } from './wrun-latest-snapshot.js';
|
|
2
43
|
import { type WrunRefusal, type WrunRefusalAttemptToken, type WrunRefusalOverlayTarget } from './wrun-refusal.util.js';
|
|
3
44
|
/** Load the chart instances once (shared by every caller; a failed load is retried). Every async
|
|
4
45
|
* entry point awaits it before `resolveWrunRefusalTarget`, which reads them synchronously. */
|
|
@@ -26,6 +67,15 @@ export declare function projectWrunRefusal(target: WrunRefusalOverlayTarget, r:
|
|
|
26
67
|
notify: boolean;
|
|
27
68
|
isCurrent: () => boolean;
|
|
28
69
|
}): Promise<boolean>;
|
|
70
|
+
/**
|
|
71
|
+
* The latest-values snapshot of a full run refused by name (contract C2, `WrunLatestSnapshot.refused`): no values,
|
|
72
|
+
* strings or history, so no reader (the HUD card, the legend's entries, the hover) shows the numbers of a run before
|
|
73
|
+
* it, which computed for another market or other settings. `refused` carries the record's C2 row key
|
|
74
|
+
* (`<class>/<variant>`, the row its words come from) and the one sentence its legend chip shows
|
|
75
|
+
* (`wrunRefusalSentence`: the chip's tooltip and its card's words, buildWrunRefusalErrorMessage), in the locale
|
|
76
|
+
* active at the publish. Stamped at the chart's newest bar, else now on the server's clock.
|
|
77
|
+
*/
|
|
78
|
+
export declare function wrunRefusedLatestSnapshotOf(r: WrunRefusal, tc?: WrunChartHandle | null): WrunLatestSnapshot;
|
|
29
79
|
export declare function wrunRefusalRetractionCount(target: WrunRefusalOverlayTarget): number;
|
|
30
80
|
export declare function retractWrunRefusal(target: WrunRefusalOverlayTarget, owner: 'run' | 'tick' | 'all'): Promise<void>;
|
|
31
81
|
/**
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { serverNowMs } from '../auth/server-clock.util.js';
|
|
2
|
+
import { realMainRows } from '../chart/indicator-gap-detector.util.js';
|
|
1
3
|
import { applyWrunInertLegendState, clearWrunInertLegendState } from './wrun-inert-legend.util.js';
|
|
4
|
+
import { wrunRefusalSentence } from './wrun-refusal-text.util.js';
|
|
2
5
|
import { compareWrunRefusals, } from './wrun-refusal.util.js';
|
|
3
6
|
import { isWrunTransientFailureCause } from './wrun-failure-cause.js';
|
|
4
7
|
import { __resetWrunTransientGraceForTests, endWrunTransientGrace, holdWrunTransientRefusal, } from './wrun-transient-rerun.util.js';
|
|
@@ -138,9 +141,14 @@ export async function projectWrunRefusal(target, r, opts) {
|
|
|
138
141
|
const owned = { ...verdicts.get(key), [opts.owner]: r };
|
|
139
142
|
verdicts.set(key, owned);
|
|
140
143
|
const tc = chartReader?.getTC(resolved.chartIndex);
|
|
144
|
+
// The HUD's publish is scheduled before the legend write and awaited after it: a legend writer that throws never
|
|
145
|
+
// leaves the card on the numbers this run replaced (the publish is already on its way), and the caller's await
|
|
146
|
+
// covers the publish.
|
|
147
|
+
const published = opts.owner === 'run' && r.severity === 'paused' ? publishWrunRefusedLatestValues(resolved, r, tc) : undefined;
|
|
141
148
|
if (tc)
|
|
142
149
|
writeTop(tc, resolved, owned);
|
|
143
150
|
emitWrunRefusalChange(resolved.chartIndex);
|
|
151
|
+
await published;
|
|
144
152
|
if (opts.notify && r.severity === 'paused') {
|
|
145
153
|
const actions = await wrunChartHostEnv().ui.loadWrunRefusalActions();
|
|
146
154
|
if (!opts.isCurrent())
|
|
@@ -160,6 +168,65 @@ export async function projectWrunRefusal(target, r, opts) {
|
|
|
160
168
|
return true;
|
|
161
169
|
}
|
|
162
170
|
// ---------------------------------------------------------------------------
|
|
171
|
+
// The HUD's refused snapshot (OPRA QA class 5)
|
|
172
|
+
// ---------------------------------------------------------------------------
|
|
173
|
+
/**
|
|
174
|
+
* The latest-values snapshot of a full run refused by name (contract C2, `WrunLatestSnapshot.refused`): no values,
|
|
175
|
+
* strings or history, so no reader (the HUD card, the legend's entries, the hover) shows the numbers of a run before
|
|
176
|
+
* it, which computed for another market or other settings. `refused` carries the record's C2 row key
|
|
177
|
+
* (`<class>/<variant>`, the row its words come from) and the one sentence its legend chip shows
|
|
178
|
+
* (`wrunRefusalSentence`: the chip's tooltip and its card's words, buildWrunRefusalErrorMessage), in the locale
|
|
179
|
+
* active at the publish. Stamped at the chart's newest bar, else now on the server's clock.
|
|
180
|
+
*/
|
|
181
|
+
export function wrunRefusedLatestSnapshotOf(r, tc) {
|
|
182
|
+
return {
|
|
183
|
+
time: newestWrunChartBarTs(tc) ?? serverNowMs(),
|
|
184
|
+
values: {},
|
|
185
|
+
strings: {},
|
|
186
|
+
history: {},
|
|
187
|
+
refused: { reason: `${r.cls}/${r.variant}`, sentence: wrunRefusalSentence(r) },
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
/** The open time of the chart's newest traded bar: the newest row the server sent (`realMainRows`, no synthetic
|
|
191
|
+
* marker) with a close, the bar the run pass's candle read ends on; undefined on a chart with none. */
|
|
192
|
+
function newestWrunChartBarTs(tc) {
|
|
193
|
+
const main = tc
|
|
194
|
+
?.metadata?.[0];
|
|
195
|
+
const raw = main?.rawData;
|
|
196
|
+
if (!Array.isArray(raw))
|
|
197
|
+
return undefined;
|
|
198
|
+
const rows = realMainRows(raw, main?.syntheticFlags ?? undefined) ?? [];
|
|
199
|
+
for (let at = rows.length - 1; at >= 0; at -= 1) {
|
|
200
|
+
const row = rows[at];
|
|
201
|
+
if (Array.isArray(row) && Number.isFinite(row[0]) && Number.isFinite(row[4]))
|
|
202
|
+
return Number(row[0]);
|
|
203
|
+
}
|
|
204
|
+
return undefined;
|
|
205
|
+
}
|
|
206
|
+
/** The publisher of the refused snapshot, loaded beside the run binder: `chart.publishLatestValues` is a run port,
|
|
207
|
+
* and this surface is reached by every toast path, most of which never loaded the run plane
|
|
208
|
+
* (web-ports.cold-entries.spec.ts: a package module reads a non-boot member only behind its binder's load). The
|
|
209
|
+
* same carried-import form as wrun-transient-rerun.util's admit load. */
|
|
210
|
+
let refusedLatestLoad;
|
|
211
|
+
/** Publish the refused snapshot of a run record that shows now. The snapshot is built at the call (the record's
|
|
212
|
+
* words in the locale of the moment, the chart's newest bar); the port write lands once the run binder is bound.
|
|
213
|
+
* Presentation only: a failure is logged, never a second failure over the projection. */
|
|
214
|
+
function publishWrunRefusedLatestValues(t, r, tc) {
|
|
215
|
+
const snapshot = wrunRefusedLatestSnapshotOf(r, tc);
|
|
216
|
+
refusedLatestLoad ??= Promise.all([
|
|
217
|
+
import('./wrun-refused-latest.util.js'),
|
|
218
|
+
wrunChartHostEnv().chart.loadRunPorts(),
|
|
219
|
+
]).then(([publisher]) => publisher, (error) => {
|
|
220
|
+
refusedLatestLoad = undefined;
|
|
221
|
+
throw error;
|
|
222
|
+
});
|
|
223
|
+
return refusedLatestLoad
|
|
224
|
+
.then((publisher) => publisher.publishWrunRefusedLatest(t.chartIndex, t.indicatorId, snapshot))
|
|
225
|
+
.catch((error) => {
|
|
226
|
+
console.warn(`[wrun] the refused snapshot of '${t.indicatorId}' was not published:`, error);
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
// ---------------------------------------------------------------------------
|
|
163
230
|
// The transient grace (CLOUD-RUN-ROBUST C5)
|
|
164
231
|
// ---------------------------------------------------------------------------
|
|
165
232
|
const OWNERS = ['run', 'tick'];
|
|
@@ -378,4 +445,5 @@ export function __resetWrunRefusalSurfaceForTests() {
|
|
|
378
445
|
changeListeners.clear();
|
|
379
446
|
chartReader = undefined;
|
|
380
447
|
chartReaderLoad = undefined;
|
|
448
|
+
refusedLatestLoad = undefined;
|
|
381
449
|
}
|
|
@@ -765,12 +765,19 @@ function seedFromCodes(message, ctx) {
|
|
|
765
765
|
if (message.includes('wrun_cell_block_too_large')) {
|
|
766
766
|
const inputIndex = numberMatch(message, /\binput (\d+)\b/);
|
|
767
767
|
const cells = numberMatch(message, /\bhas (\d+) cells\b/) ?? 0;
|
|
768
|
-
|
|
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;
|
|
769
771
|
const sourceClass = inputIndex === undefined ? undefined : ctx.inputClassAt?.(inputIndex);
|
|
770
772
|
if (sourceClass === 'options_chain')
|
|
771
773
|
return { cls: 'too-big', variant: 'chain', params: { cells, max } };
|
|
772
774
|
return { cls: 'too-big', variant: 'block', params: { feed: sourceClass ?? '', cells, max } };
|
|
773
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');
|
|
774
781
|
const optionsCode = /\b(wrun_options_chain_[a-z_]+)\b/.exec(message)?.[1];
|
|
775
782
|
if (optionsCode !== undefined) {
|
|
776
783
|
const coin = /\bcoin '([^']+)'/.exec(message)?.[1] ?? ctx.chart?.coin ?? '';
|
|
@@ -857,6 +864,8 @@ const WRUN_REFUSAL_READ_FAILED_CODE = 'wrun_refusal_read_failed';
|
|
|
857
864
|
const SETTINGS_REFUSAL_CODES = new Set([
|
|
858
865
|
'wrun_params_invalid',
|
|
859
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',
|
|
860
869
|
'wrun_param_unknown',
|
|
861
870
|
'wrun_settings_paint_unsupported',
|
|
862
871
|
]);
|