@orangecharts/wrun-chart-host 0.7.0 → 0.8.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 +25 -2
- package/dist/constants/feature-flags.constants.d.ts +1 -0
- package/dist/constants/feature-flags.constants.js +5 -0
- package/dist/constants/option-venues.constants.d.ts +18 -0
- package/dist/constants/option-venues.constants.js +14 -0
- 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 +24 -0
- package/dist/host-env.js +21 -0
- package/dist/host-ports.types.d.ts +12 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +16 -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/option-instrument.interface.d.ts +6 -0
- package/dist/kscript-data/controls/live-trades-merge.util.d.ts +4 -0
- package/dist/kscript-data/controls/live-trades-merge.util.js +4 -0
- 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 +11 -0
- package/dist/settings-templates/index.js +29 -6
- package/dist/settings-templates/indicator-fields.d.ts +2 -0
- package/dist/settings-templates/indicator-fields.js +78 -0
- package/dist/settings-templates/tool-rules.d.ts +40 -4
- package/dist/settings-templates/tool-rules.js +45 -4
- package/dist/settings-templates/tool-tables.generated.js +22 -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/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/kscript-venue-policy.util.js +4 -2
- package/dist/utility/chart/om-panel.util.d.ts +11 -0
- package/dist/utility/chart/om-panel.util.js +59 -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/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/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 +9 -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_prints.d.ts +14 -1
- package/dist/utility/wrun/sources/row-lanes/option_prints.js +100 -23
- 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 +47 -1
- package/dist/utility/wrun/sources/row-lanes/option_strikes.js +71 -2
- package/dist/utility/wrun/sources/row-lanes/option_surface.d.ts +14 -1
- package/dist/utility/wrun/sources/row-lanes/option_surface.js +30 -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 +45 -5
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +115 -3
- package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.d.ts +10 -0
- package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.js +57 -0
- package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +60 -6
- package/dist/utility/wrun/sources/wrun-row-lanes.util.js +160 -23
- 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-settings.util.d.ts +7 -5
- package/dist/utility/wrun/wrun-color-settings.util.js +26 -11
- package/dist/utility/wrun/wrun-draft-overlay.util.d.ts +4 -2
- package/dist/utility/wrun/wrun-draft-overlay.util.js +40 -3
- package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +1 -1
- package/dist/utility/wrun/wrun-hosted-wire-caps.js +4 -0
- 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-live-tick.util.d.ts +4 -1
- package/dist/utility/wrun/wrun-live-tick.util.js +39 -6
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +106 -0
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +159 -0
- package/dist/utility/wrun/wrun-market-size-defaults.util.d.ts +44 -0
- package/dist/utility/wrun/wrun-market-size-defaults.util.js +213 -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 +133 -3
- package/dist/utility/wrun/wrun-option-prints.util.js +318 -8
- package/dist/utility/wrun/wrun-option-strike-flow-lane.util.d.ts +96 -0
- package/dist/utility/wrun/wrun-option-strike-flow-lane.util.js +215 -0
- package/dist/utility/wrun/wrun-option-strike-flow.util.d.ts +342 -0
- package/dist/utility/wrun/wrun-option-strike-flow.util.js +742 -0
- package/dist/utility/wrun/wrun-option-views.util.d.ts +183 -3
- package/dist/utility/wrun/wrun-option-views.util.js +504 -7
- 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-overlay-recovery.util.d.ts +2 -1
- package/dist/utility/wrun/wrun-overlay-recovery.util.js +7 -2
- package/dist/utility/wrun/wrun-overlay-run.util.js +120 -18
- 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 +9 -8
- package/dist/utility/wrun/wrun-pack.util.js +21 -15
- 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 +17 -2
- package/dist/utility/wrun/wrun-panel-style.util.js +47 -9
- package/dist/utility/wrun/wrun-pin-spelling.util.js +19 -10
- package/dist/utility/wrun/wrun-refusal.util.js +7 -1
- package/dist/utility/wrun/wrun-script-inputs.util.d.ts +13 -0
- package/dist/utility/wrun/wrun-script-inputs.util.js +43 -0
- package/dist/utility/wrun/wrun-tape-source.util.d.ts +9 -0
- package/dist/utility/wrun/wrun-tape-source.util.js +18 -0
- package/package.json +3 -3
|
@@ -8,7 +8,9 @@
|
|
|
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 a wrun table's:
|
|
12
|
+
* on the wrun lane an absent table colour, border or grid word takes the
|
|
13
|
+
* chart's look (wrunTableStyle), the push lane's table keeps the engine's.
|
|
12
14
|
*
|
|
13
15
|
* Pure and worker safe (om-panel.util rides the frame worker): it imports the
|
|
14
16
|
* style foundation only. Colour words resolve here against `ctx.theme`
|
|
@@ -148,11 +150,24 @@ export declare function wrunHeatmapStyle(panel: WrunStyledPanel, chrome: WrunPan
|
|
|
148
150
|
* formats reach the engine through {@link wrunPanelFormatter} (SC26). The
|
|
149
151
|
* seam stays so a tiles word lands here without touching the caller. */
|
|
150
152
|
export declare function wrunTilesStyle(_panel: WrunStyledPanel, _rows: WrunStyledPanelRows, _ctx: WrunPanelTranslateContext): WrunPanelSettingsPatch;
|
|
153
|
+
/** The fill a wrun table cell takes where the author declared none: the engine paints a cell's fill through the
|
|
154
|
+
* canvas `fillStyle`, which takes any CSS colour, so `transparent` paints nothing where an absent key paints the
|
|
155
|
+
* engine's own grey. */
|
|
156
|
+
export declare const WRUN_TABLE_NO_FILL = "transparent";
|
|
151
157
|
/** The table words onto the engine's Table payload (SC22 SC35; the
|
|
152
158
|
* WRUN-CAPS keys verbatim): the anchor and offset (`y` adds the legend
|
|
153
159
|
* clearance under a top_* anchor), widths, padding, type, alignment, inks
|
|
154
160
|
* (resolved), the background fill and gradient, the border and grid lines,
|
|
155
|
-
* and the header column. Only declared words patch the caller's defaults
|
|
161
|
+
* and the header column. Only declared words patch the caller's defaults on
|
|
162
|
+
* the om push lane (no theme), so its payload stays byte for byte the
|
|
163
|
+
* engine's look. The wrun lane (a theme in hand) also sends the table that
|
|
164
|
+
* fills its pane's width with a hovered row (`fillWidth`, `hoverRow`) and,
|
|
165
|
+
* for each word the author did not declare, the chart's look instead of the
|
|
166
|
+
* engine's greys: text in the theme's text colour, the header in its muted
|
|
167
|
+
* colour, no cell or header fill, no border and, when the author declared
|
|
168
|
+
* no grid word at all, one rule under the header in the theme's grid
|
|
169
|
+
* colour. A declared word always wins; a theme switch re-resolves the
|
|
170
|
+
* fallbacks like every other theme word (the mount's retranslate). */
|
|
156
171
|
export declare function wrunTableStyle(panel: WrunStyledPanel, ctx: WrunPanelTranslateContext): WrunPanelSettingsPatch;
|
|
157
172
|
/** The engine's number formatter for a panel (SC08 SC26 SC40), built only
|
|
158
173
|
* when a format word is declared somewhere on it: `format`, `decimals`,
|
|
@@ -8,7 +8,9 @@
|
|
|
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 a wrun table's:
|
|
12
|
+
* on the wrun lane an absent table colour, border or grid word takes the
|
|
13
|
+
* chart's look (wrunTableStyle), the push lane's table keeps the engine's.
|
|
12
14
|
*
|
|
13
15
|
* Pure and worker safe (om-panel.util rides the frame worker): it imports the
|
|
14
16
|
* style foundation only. Colour words resolve here against `ctx.theme`
|
|
@@ -610,14 +612,28 @@ export function wrunHeatmapStyle(panel, chrome, indices, ctx) {
|
|
|
610
612
|
export function wrunTilesStyle(_panel, _rows, _ctx) {
|
|
611
613
|
return {};
|
|
612
614
|
}
|
|
615
|
+
/** The fill a wrun table cell takes where the author declared none: the engine paints a cell's fill through the
|
|
616
|
+
* canvas `fillStyle`, which takes any CSS colour, so `transparent` paints nothing where an absent key paints the
|
|
617
|
+
* engine's own grey. */
|
|
618
|
+
export const WRUN_TABLE_NO_FILL = 'transparent';
|
|
613
619
|
/** The table words onto the engine's Table payload (SC22 SC35; the
|
|
614
620
|
* WRUN-CAPS keys verbatim): the anchor and offset (`y` adds the legend
|
|
615
621
|
* clearance under a top_* anchor), widths, padding, type, alignment, inks
|
|
616
622
|
* (resolved), the background fill and gradient, the border and grid lines,
|
|
617
|
-
* and the header column. Only declared words patch the caller's defaults
|
|
623
|
+
* and the header column. Only declared words patch the caller's defaults on
|
|
624
|
+
* the om push lane (no theme), so its payload stays byte for byte the
|
|
625
|
+
* engine's look. The wrun lane (a theme in hand) also sends the table that
|
|
626
|
+
* fills its pane's width with a hovered row (`fillWidth`, `hoverRow`) and,
|
|
627
|
+
* for each word the author did not declare, the chart's look instead of the
|
|
628
|
+
* engine's greys: text in the theme's text colour, the header in its muted
|
|
629
|
+
* colour, no cell or header fill, no border and, when the author declared
|
|
630
|
+
* no grid word at all, one rule under the header in the theme's grid
|
|
631
|
+
* colour. A declared word always wins; a theme switch re-resolves the
|
|
632
|
+
* fallbacks like every other theme word (the mount's retranslate). */
|
|
618
633
|
export function wrunTableStyle(panel, ctx) {
|
|
619
634
|
const color = (word) => wrunPaneColor(word, ctx.theme);
|
|
620
|
-
const
|
|
635
|
+
const themed = ctx.theme !== undefined;
|
|
636
|
+
const patch = themed ? { fillWidth: true, hoverRow: true } : {};
|
|
621
637
|
if (panel.position !== undefined || panel.offset !== undefined) {
|
|
622
638
|
const position = panel.position ?? 'top_left';
|
|
623
639
|
const [dx, dy] = panel.offset ?? [0, 0];
|
|
@@ -636,25 +652,47 @@ export function wrunTableStyle(panel, ctx) {
|
|
|
636
652
|
put(patch, 'valign', panel.valign);
|
|
637
653
|
if (panel.text_color !== undefined)
|
|
638
654
|
patch.textColor = color(panel.text_color);
|
|
655
|
+
else if (themed)
|
|
656
|
+
patch.textColor = color('theme.text');
|
|
639
657
|
if (panel.header_text_color !== undefined)
|
|
640
658
|
patch.headerTextColor = color(panel.header_text_color);
|
|
659
|
+
else if (themed)
|
|
660
|
+
patch.headerTextColor = color('theme.muted');
|
|
641
661
|
if (panel.background_color !== undefined)
|
|
642
662
|
patch.backgroundColor = color(panel.background_color);
|
|
663
|
+
else if (themed)
|
|
664
|
+
patch.backgroundColor = WRUN_TABLE_NO_FILL;
|
|
643
665
|
if (panel.header_background_color !== undefined)
|
|
644
666
|
patch.headerBackgroundColor = color(panel.header_background_color);
|
|
667
|
+
else if (themed)
|
|
668
|
+
patch.headerBackgroundColor = WRUN_TABLE_NO_FILL;
|
|
645
669
|
put(patch, 'backgroundOpacity', panel.background_opacity);
|
|
646
670
|
if (panel.background_gradient !== undefined)
|
|
647
671
|
patch.backgroundGradient = panel.background_gradient.map(color);
|
|
648
672
|
put(patch, 'gradientDirection', panel.gradient_direction);
|
|
649
673
|
if (panel.border_color !== undefined)
|
|
650
674
|
patch.borderColor = color(panel.border_color);
|
|
651
|
-
|
|
675
|
+
if (panel.border_width !== undefined)
|
|
676
|
+
patch.borderWidth = panel.border_width;
|
|
677
|
+
else if (themed)
|
|
678
|
+
patch.borderWidth = 0;
|
|
652
679
|
put(patch, 'borderStyle', panel.border_style);
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
680
|
+
const gridDeclared = panel.grid_color !== undefined ||
|
|
681
|
+
panel.grid_width !== undefined ||
|
|
682
|
+
panel.grid_style !== undefined ||
|
|
683
|
+
panel.grid_lines !== undefined;
|
|
684
|
+
if (gridDeclared) {
|
|
685
|
+
if (panel.grid_color !== undefined)
|
|
686
|
+
patch.gridColor = color(panel.grid_color);
|
|
687
|
+
put(patch, 'gridWidth', panel.grid_width);
|
|
688
|
+
put(patch, 'gridStyle', panel.grid_style);
|
|
689
|
+
put(patch, 'gridLines', panel.grid_lines);
|
|
690
|
+
}
|
|
691
|
+
else if (themed) {
|
|
692
|
+
patch.gridLines = 'header';
|
|
693
|
+
patch.gridColor = color('theme.grid');
|
|
694
|
+
patch.gridWidth = 1;
|
|
695
|
+
}
|
|
658
696
|
put(patch, 'headerColumn', panel.header_column);
|
|
659
697
|
return patch;
|
|
660
698
|
}
|
|
@@ -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
|
/**
|
|
@@ -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': {
|
|
@@ -1178,7 +1184,7 @@ function variantFor(seed, ctx) {
|
|
|
1178
1184
|
case 'cme-wall':
|
|
1179
1185
|
return declared !== undefined && variantSpec('cme-wall', declared) ? declared : 'default';
|
|
1180
1186
|
case 'too-big':
|
|
1181
|
-
return declared === 'chain' || declared === 'rows' ? declared : 'block';
|
|
1187
|
+
return declared === 'chain' || declared === 'rows' || declared === 'tape' ? declared : 'block';
|
|
1182
1188
|
case 'not-reached':
|
|
1183
1189
|
return declared !== undefined && variantSpec('not-reached', declared) ? declared : 'run';
|
|
1184
1190
|
case 'slots':
|
|
@@ -395,6 +395,19 @@ export declare function buildWrunScriptLayout(metadata: WrunScriptInputsSheet, d
|
|
|
395
395
|
* or a reset.
|
|
396
396
|
*/
|
|
397
397
|
export declare function coerceWrunRowValue(row: WrunScriptInputDeclaration, raw: unknown): unknown;
|
|
398
|
+
/** A row's stored value in its declared kind, else its declared default
|
|
399
|
+
* (the settings panel's read, wrun-dialog-rows `readRowValue`: the controls,
|
|
400
|
+
* the changed dot and its reset, the preset chip, a `when` gate, a swatch).
|
|
401
|
+
* The run head's market-scaled defaults (wrun-market-size-defaults.util) read
|
|
402
|
+
* a row through it too, so "unchanged" there is the reset icon's own test. */
|
|
403
|
+
export declare function wrunRowValue(settings: Readonly<Record<string, unknown>>, row: WrunScriptInputDeclaration): unknown;
|
|
404
|
+
/** Equality the way the run reads values back: a toggle as 1/0, a select's
|
|
405
|
+
* numeric string as its number, a colour array element by element. */
|
|
406
|
+
export declare function wrunValuesEqual(a: unknown, b: unknown): boolean;
|
|
407
|
+
/** Equality for one row's value: a text row compares its words exactly (a
|
|
408
|
+
* typed "20" is not the number 20, "Abc" is not "abc"); every other kind
|
|
409
|
+
* the way the run reads values back ({@link wrunValuesEqual}). */
|
|
410
|
+
export declare function wrunRowValuesEqual(row: WrunScriptInputDeclaration, a: unknown, b: unknown): boolean;
|
|
398
411
|
/**
|
|
399
412
|
* A preset's values in the dialog's storage types (frozen contract, plan
|
|
400
413
|
* 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
|
|
@@ -38,6 +38,12 @@ export declare const WRUN_TAPE_HISTORY_INVALID_CODE = "wrun_tape_history_invalid
|
|
|
38
38
|
* calendar interval of a month or coarser): the shared host's refusal code (`WrunHostRefusalCode`,
|
|
39
39
|
* the kit's `WRUN_TAPE_INTERVAL_UNSUPPORTED_CODE`), whose words its `wrunRefusalMessage` gives. */
|
|
40
40
|
export declare const WRUN_TAPE_INTERVAL_UNSUPPORTED_CODE = "wrun_tape_interval_unsupported";
|
|
41
|
+
/** The large lane's history held more prints at or above the floor than the history worker reads
|
|
42
|
+
* (`TRADES_HISTORY_MAX_CELLS`): its refusal by name (wrun-lane-refusal.leaf), which the run words as
|
|
43
|
+
* too much data with the floor to raise (the `too-big` `tape` record, Open the settings), never as a
|
|
44
|
+
* source that did not answer. The same floor over the same history is refused again, so no ladder
|
|
45
|
+
* re-asks it: only a settings change (a higher floor) or a shorter window can pass it. */
|
|
46
|
+
export declare const WRUN_TAPE_TOO_MANY_TRADES_CODE = "tape-too-many-trades";
|
|
41
47
|
/** The longest tape history a package may declare, in seconds (30 days). */
|
|
42
48
|
export declare const WRUN_TAPE_HISTORY_MAX_SEC = 2592000;
|
|
43
49
|
/** The longest tape history the lane serves today, in seconds: the gateway's bar limit on an
|
|
@@ -69,6 +75,9 @@ export declare function resolveWrunTapeMinSize(metadata: Pick<WrunIndicatorMetad
|
|
|
69
75
|
* input.
|
|
70
76
|
*/
|
|
71
77
|
export declare function resolveWrunTapeAcquisition(metadata: Pick<WrunIndicatorMetadata, 'id' | 'params' | 'inputs' | 'inputSources'>, paramValues: Readonly<Record<string, number>>): WrunTapeAcquisition | undefined;
|
|
78
|
+
/** The words of the setting a tape's floor reads: the label (else the name) of the param its first tape input's
|
|
79
|
+
* `min_size` names, or `min_size` itself for a literal floor (a source edit raises it). */
|
|
80
|
+
export declare function wrunTapeFloorSettingWords(metadata: Pick<WrunIndicatorMetadata, 'params' | 'inputSources'>): string;
|
|
72
81
|
/**
|
|
73
82
|
* The settings a row build hands the shared host's plan for a param-bound floor
|
|
74
83
|
* (`WrunChartSourceRows.settings`): the floor the lane's acquisition was asked at, under the name
|
|
@@ -38,6 +38,12 @@ export const WRUN_TAPE_HISTORY_INVALID_CODE = 'wrun_tape_history_invalid';
|
|
|
38
38
|
* calendar interval of a month or coarser): the shared host's refusal code (`WrunHostRefusalCode`,
|
|
39
39
|
* the kit's `WRUN_TAPE_INTERVAL_UNSUPPORTED_CODE`), whose words its `wrunRefusalMessage` gives. */
|
|
40
40
|
export const WRUN_TAPE_INTERVAL_UNSUPPORTED_CODE = 'wrun_tape_interval_unsupported';
|
|
41
|
+
/** The large lane's history held more prints at or above the floor than the history worker reads
|
|
42
|
+
* (`TRADES_HISTORY_MAX_CELLS`): its refusal by name (wrun-lane-refusal.leaf), which the run words as
|
|
43
|
+
* too much data with the floor to raise (the `too-big` `tape` record, Open the settings), never as a
|
|
44
|
+
* source that did not answer. The same floor over the same history is refused again, so no ladder
|
|
45
|
+
* re-asks it: only a settings change (a higher floor) or a shorter window can pass it. */
|
|
46
|
+
export const WRUN_TAPE_TOO_MANY_TRADES_CODE = 'tape-too-many-trades';
|
|
41
47
|
/** The longest tape history a package may declare, in seconds (30 days). */
|
|
42
48
|
export const WRUN_TAPE_HISTORY_MAX_SEC = 2_592_000;
|
|
43
49
|
/** The longest tape history the lane serves today, in seconds: the gateway's bar limit on an
|
|
@@ -128,6 +134,18 @@ export function resolveWrunTapeAcquisition(metadata, paramValues) {
|
|
|
128
134
|
}
|
|
129
135
|
return acquisition;
|
|
130
136
|
}
|
|
137
|
+
/** The words of the setting a tape's floor reads: the label (else the name) of the param its first tape input's
|
|
138
|
+
* `min_size` names, or `min_size` itself for a literal floor (a source edit raises it). */
|
|
139
|
+
export function wrunTapeFloorSettingWords(metadata) {
|
|
140
|
+
for (const source of Object.values(metadata.inputSources)) {
|
|
141
|
+
if (source?.source !== 'tape' || typeof source.min_size !== 'string')
|
|
142
|
+
continue;
|
|
143
|
+
const param = metadata.params.find((candidate) => candidate.name === source.min_size);
|
|
144
|
+
const label = typeof param?.label === 'string' ? param.label.trim() : '';
|
|
145
|
+
return label !== '' ? label : source.min_size;
|
|
146
|
+
}
|
|
147
|
+
return 'min_size';
|
|
148
|
+
}
|
|
131
149
|
/**
|
|
132
150
|
* The settings a row build hands the shared host's plan for a param-bound floor
|
|
133
151
|
* (`WrunChartSourceRows.settings`): the floor the lane's acquisition was asked at, under the name
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orangecharts/wrun-chart-host",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "The wrun chart-host layer shared by the kiyotaka web app and the mobile app: the wrun result reader and painter model, cut from the web app (its reference implementation).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -28,13 +28,13 @@
|
|
|
28
28
|
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@orangecharts/indicator-kit": "0.
|
|
31
|
+
"@orangecharts/indicator-kit": "0.91.1",
|
|
32
32
|
"@orangecharts/orange-v2-pb-common": "12.72.0",
|
|
33
33
|
"dayjs": "1.11.23",
|
|
34
34
|
"lodash-es": "4.18.1"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@orangecharts/indicator-kit": "0.
|
|
37
|
+
"@orangecharts/indicator-kit": "0.91.1",
|
|
38
38
|
"@orangecharts/orange-v2-pb-common": "12.72.0",
|
|
39
39
|
"@types/lodash-es": "4.17.12",
|
|
40
40
|
"dayjs": "1.11.23",
|