@orangecharts/wrun-chart-host 0.3.0 → 0.5.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 +23 -6
- package/dist/constants/exchange-names.leaf.d.ts +8 -0
- package/dist/constants/exchange-names.leaf.js +101 -0
- package/dist/constants/kscript-data-interval-restrictions.constants.d.ts +15 -0
- package/dist/constants/kscript-data-interval-restrictions.constants.js +40 -0
- package/dist/constants/opra-compliance.constants.d.ts +19 -0
- package/dist/constants/opra-compliance.constants.js +19 -0
- package/dist/constants/replay-ladder.leaf.d.ts +30 -0
- package/dist/constants/replay-ladder.leaf.js +99 -0
- package/dist/constants/scriptEditor/builtin-script-snippets.d.ts +133 -0
- package/dist/constants/scriptEditor/builtin-script-snippets.js +451 -0
- package/dist/constants/scriptEditor/cme-official-scripts.constants.d.ts +168 -0
- package/dist/constants/scriptEditor/cme-official-scripts.constants.js +398 -0
- package/dist/constants/scriptEditor/converted-script-id.leaf.d.ts +8 -0
- package/dist/constants/scriptEditor/converted-script-id.leaf.js +10 -0
- package/dist/constants/scriptEditor/execution.constants.d.ts +4 -0
- package/dist/constants/scriptEditor/execution.constants.js +14 -0
- package/dist/constants/wrun-prefix-safe.constants.d.ts +23 -0
- package/dist/constants/wrun-prefix-safe.constants.js +26 -0
- package/dist/host-env.d.ts +321 -24
- package/dist/host-env.js +15 -0
- package/dist/host-ports.types.d.ts +857 -35
- package/dist/index.d.ts +149 -2
- package/dist/index.js +149 -2
- package/dist/instances/script-engine-worker-ohlcv-transfer.d.ts +31 -0
- package/dist/instances/script-engine-worker-ohlcv-transfer.js +164 -0
- package/dist/interfaces/market-event.interface.d.ts +231 -0
- package/dist/interfaces/market-event.interface.js +15 -0
- package/dist/interfaces/opra-realtime.interface.d.ts +70 -134
- package/dist/interfaces/opra-realtime.interface.js +34 -59
- package/dist/interfaces/replay.interface.d.ts +285 -0
- package/dist/interfaces/replay.interface.js +1 -0
- package/dist/kscript-data/controls/live-ohlcv-merge.util.d.ts +1 -0
- package/dist/kscript-data/controls/live-ohlcv-merge.util.js +93 -0
- package/dist/kscript-data/controls/live-trades-merge.util.d.ts +5 -1
- package/dist/kscript-data/controls/live-trades-merge.util.js +2 -2
- package/dist/market-data/billing.interface.d.ts +219 -0
- package/dist/market-data/billing.interface.js +58 -0
- package/dist/market-data/venue-governed.util.d.ts +2 -0
- package/dist/market-data/venue-governed.util.js +10 -0
- package/dist/market-data/venue.d.ts +122 -0
- package/dist/market-data/venue.js +1 -0
- package/dist/market-data/venues/index.d.ts +97 -0
- package/dist/market-data/venues/index.js +33 -0
- package/dist/market-data/venues/opra.contract.copy.json +35 -0
- package/dist/market-data/venues/opra.d.ts +70 -0
- package/dist/market-data/venues/opra.js +74 -0
- package/dist/replay/replayIndicatorRows.d.ts +31 -0
- package/dist/replay/replayIndicatorRows.js +117 -0
- package/dist/replay/replayLadder.d.ts +85 -0
- package/dist/replay/replayLadder.js +388 -0
- package/dist/utility/auth/server-clock.util.d.ts +81 -0
- package/dist/utility/auth/server-clock.util.js +238 -0
- package/dist/utility/chart/builtin-identity.util.d.ts +18 -0
- package/dist/utility/chart/builtin-identity.util.js +51 -0
- package/dist/utility/chart/cache-alignment.util.d.ts +454 -0
- package/dist/utility/chart/cache-alignment.util.js +926 -0
- package/dist/utility/chart/chart-data-fetch-generation.util.d.ts +15 -0
- package/dist/utility/chart/chart-data-fetch-generation.util.js +22 -0
- package/dist/utility/chart/chart-mount-epoch.util.d.ts +5 -0
- package/dist/utility/chart/chart-mount-epoch.util.js +29 -0
- package/dist/utility/chart/chart-time-domain.util.d.ts +12 -0
- package/dist/utility/chart/chart-time-domain.util.js +23 -0
- package/dist/utility/chart/color-customization.leaf.d.ts +10 -0
- package/dist/utility/chart/color-customization.leaf.js +16 -0
- package/dist/utility/chart/date-labelled-interval.leaf.d.ts +15 -0
- package/dist/utility/chart/date-labelled-interval.leaf.js +19 -0
- package/dist/utility/chart/footprint-tick-grid.util.d.ts +106 -0
- package/dist/utility/chart/footprint-tick-grid.util.js +167 -0
- package/dist/utility/chart/gesture-timing.leaf.d.ts +29 -0
- package/dist/utility/chart/gesture-timing.leaf.js +29 -0
- package/dist/utility/chart/governed-contract-coin.util.d.ts +22 -0
- package/dist/utility/chart/governed-contract-coin.util.js +39 -0
- package/dist/utility/chart/host-bar-placement.util.d.ts +107 -0
- package/dist/utility/chart/host-bar-placement.util.js +447 -0
- package/dist/utility/chart/index-host-tier.util.d.ts +31 -0
- package/dist/utility/chart/index-host-tier.util.js +118 -0
- package/dist/utility/chart/index-mode-admission.util.d.ts +34 -0
- package/dist/utility/chart/index-mode-admission.util.js +67 -0
- package/dist/utility/chart/indicator-error-message.util.d.ts +35 -0
- package/dist/utility/chart/indicator-error-message.util.js +44 -0
- package/dist/utility/chart/indicator-run-interval.util.d.ts +130 -0
- package/dist/utility/chart/indicator-run-interval.util.js +268 -0
- package/dist/utility/chart/kscript-apply-fingerprint.util.d.ts +65 -0
- package/dist/utility/chart/kscript-apply-fingerprint.util.js +357 -0
- package/dist/utility/chart/kscript-chart-flush.leaf.d.ts +22 -0
- package/dist/utility/chart/kscript-chart-flush.leaf.js +13 -0
- package/dist/utility/chart/kscript-data-interval-restriction.leaf.d.ts +6 -0
- package/dist/utility/chart/kscript-data-interval-restriction.leaf.js +27 -0
- package/dist/utility/chart/kscript-integration-decision.leaf.d.ts +89 -0
- package/dist/utility/chart/kscript-integration-decision.leaf.js +80 -0
- package/dist/utility/chart/kscript-live-coalesce.util.d.ts +76 -0
- package/dist/utility/chart/kscript-live-coalesce.util.js +156 -0
- package/dist/utility/chart/kscript-live-rest-pace.util.d.ts +34 -0
- package/dist/utility/chart/kscript-live-rest-pace.util.js +134 -0
- package/dist/utility/chart/kscript-live-source-identity.util.d.ts +98 -0
- package/dist/utility/chart/kscript-live-source-identity.util.js +121 -0
- package/dist/utility/chart/kscript-mounted-plot-set.leaf.d.ts +48 -0
- package/dist/utility/chart/kscript-mounted-plot-set.leaf.js +145 -0
- package/dist/utility/chart/kscript-perf-tracker.util.d.ts +243 -0
- package/dist/utility/chart/kscript-perf-tracker.util.js +522 -0
- package/dist/utility/chart/kscript-run-interval-projection.util.d.ts +43 -0
- package/dist/utility/chart/kscript-run-interval-projection.util.js +471 -0
- package/dist/utility/chart/kscript-run-result-equality.util.d.ts +38 -0
- package/dist/utility/chart/kscript-run-result-equality.util.js +89 -0
- package/dist/utility/chart/kscript-settings-revision.leaf.d.ts +2 -0
- package/dist/utility/chart/kscript-settings-revision.leaf.js +12 -0
- package/dist/utility/chart/kscript-source-degrade.leaf.d.ts +63 -0
- package/dist/utility/chart/kscript-source-degrade.leaf.js +68 -0
- package/dist/utility/chart/kscript-source-retention.util.d.ts +134 -0
- package/dist/utility/chart/kscript-source-retention.util.js +218 -0
- package/dist/utility/chart/kscript-standin-identity.leaf.d.ts +57 -0
- package/dist/utility/chart/kscript-standin-identity.leaf.js +61 -0
- package/dist/utility/chart/kscript-titancharts-preparation.util.d.ts +15 -0
- package/dist/utility/chart/kscript-titancharts-preparation.util.js +376 -0
- package/dist/utility/chart/kscript-titancharts-render-keys.constants.d.ts +9 -0
- package/dist/utility/chart/kscript-titancharts-render-keys.constants.js +130 -0
- package/dist/utility/chart/kscript-venue-policy.util.d.ts +217 -0
- package/dist/utility/chart/kscript-venue-policy.util.js +324 -0
- package/dist/utility/chart/live-cadence.util.d.ts +38 -0
- package/dist/utility/chart/live-cadence.util.js +37 -0
- package/dist/utility/chart/live-feed-series-match.leaf.d.ts +13 -0
- package/dist/utility/chart/live-feed-series-match.leaf.js +21 -0
- package/dist/utility/chart/local-engine-self-heal-backoff.util.d.ts +46 -0
- package/dist/utility/chart/local-engine-self-heal-backoff.util.js +46 -0
- package/dist/utility/chart/local-engine-uninit.leaf.d.ts +21 -0
- package/dist/utility/chart/local-engine-uninit.leaf.js +22 -0
- package/dist/utility/chart/local-kscript-source-revalidation.util.d.ts +62 -0
- package/dist/utility/chart/local-kscript-source-revalidation.util.js +123 -0
- package/dist/utility/chart/local-kscript-warmup-depth.util.d.ts +214 -0
- package/dist/utility/chart/local-kscript-warmup-depth.util.js +376 -0
- package/dist/utility/chart/local-technical-script-live-apply-coalescer.util.d.ts +85 -0
- package/dist/utility/chart/local-technical-script-live-apply-coalescer.util.js +197 -0
- package/dist/utility/chart/local-technical-script-range.leaf.d.ts +72 -0
- package/dist/utility/chart/local-technical-script-range.leaf.js +126 -0
- package/dist/utility/chart/mixed-mode.util.d.ts +167 -0
- package/dist/utility/chart/mixed-mode.util.js +139 -0
- package/dist/utility/chart/ohlcv-row-readiness.util.d.ts +36 -0
- package/dist/utility/chart/ohlcv-row-readiness.util.js +90 -0
- package/dist/utility/chart/opra-user-scripts-gate.util.d.ts +19 -0
- package/dist/utility/chart/opra-user-scripts-gate.util.js +32 -0
- package/dist/utility/chart/overlay-execution-guard-key.leaf.d.ts +8 -0
- package/dist/utility/chart/overlay-execution-guard-key.leaf.js +10 -0
- package/dist/utility/chart/price-precision.util.d.ts +40 -0
- package/dist/utility/chart/price-precision.util.js +70 -0
- package/dist/utility/chart/profile-block-size.util.d.ts +64 -0
- package/dist/utility/chart/profile-block-size.util.js +141 -0
- package/dist/utility/chart/protected-kscript-degenerate-rows.leaf.d.ts +11 -0
- package/dist/utility/chart/protected-kscript-degenerate-rows.leaf.js +29 -0
- package/dist/utility/chart/protected-kscript-empty-output.util.d.ts +28 -0
- package/dist/utility/chart/protected-kscript-empty-output.util.js +84 -0
- package/dist/utility/chart/run-interval-unservable.leaf.d.ts +9 -0
- package/dist/utility/chart/run-interval-unservable.leaf.js +20 -0
- package/dist/utility/chart/run-interval-warmup.leaf.d.ts +19 -0
- package/dist/utility/chart/run-interval-warmup.leaf.js +35 -0
- package/dist/utility/chart/titan-constants.pin.d.ts +9 -5
- package/dist/utility/chart/titan-constants.pin.js +18 -5
- package/dist/utility/chart/warmup-backfill-retry.leaf.d.ts +9 -0
- package/dist/utility/chart/warmup-backfill-retry.leaf.js +9 -0
- package/dist/utility/chart/window-geometry.leaf.d.ts +119 -0
- package/dist/utility/chart/window-geometry.leaf.js +391 -0
- package/dist/utility/chart/window-owner.leaf.d.ts +19 -0
- package/dist/utility/chart/window-owner.leaf.js +24 -0
- package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +11 -2
- package/dist/utility/chart/wrun-bar-session-facts.util.js +10 -3
- package/dist/utility/chart/wrun-run-result.util.d.ts +5 -1
- package/dist/utility/chart/wrun-run-result.util.js +20 -14
- package/dist/utility/common/data-processing.util.d.ts +138 -0
- package/dist/utility/common/data-processing.util.js +346 -0
- package/dist/utility/common/visible-timeout.util.d.ts +13 -4
- package/dist/utility/common/visible-timeout.util.js +23 -8
- package/dist/utility/exchange-format.leaf.d.ts +1 -0
- package/dist/utility/exchange-format.leaf.js +47 -0
- package/dist/utility/html-escape.leaf.d.ts +11 -0
- package/dist/utility/html-escape.leaf.js +20 -0
- package/dist/utility/market-events/earnings-scope.util.d.ts +60 -0
- package/dist/utility/market-events/earnings-scope.util.js +92 -0
- package/dist/utility/market-events/market-events.util.d.ts +147 -0
- package/dist/utility/market-events/market-events.util.js +392 -0
- package/dist/utility/market-events/zoned-clock.util.d.ts +1 -0
- package/dist/utility/market-events/zoned-clock.util.js +11 -0
- package/dist/utility/options/option-venue-disclosure.util.d.ts +43 -0
- package/dist/utility/options/option-venue-disclosure.util.js +56 -0
- package/dist/utility/scriptEditor/package-semver.util.d.ts +51 -0
- package/dist/utility/scriptEditor/package-semver.util.js +120 -0
- package/dist/utility/scriptEditor/temp-script-id.util.d.ts +18 -0
- package/dist/utility/scriptEditor/temp-script-id.util.js +25 -0
- package/dist/utility/symbol-selection/markets-request-from-symbols.leaf.d.ts +20 -0
- package/dist/utility/symbol-selection/markets-request-from-symbols.leaf.js +81 -0
- package/dist/utility/v2/governed-tier.leaf.d.ts +103 -0
- package/dist/utility/v2/governed-tier.leaf.js +113 -0
- package/dist/utility/watchlist/import/import-request.leaf.d.ts +10 -0
- package/dist/utility/watchlist/import/import-request.leaf.js +10 -0
- package/dist/utility/wrun/sources/lanes/option_daily.d.ts +43 -15
- package/dist/utility/wrun/sources/lanes/option_daily.js +78 -20
- package/dist/utility/wrun/sources/lanes/option_stats_10m.d.ts +14 -10
- package/dist/utility/wrun/sources/lanes/option_stats_10m.js +5 -4
- package/dist/utility/wrun/sources/lanes/series.js +2 -2
- package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +22 -3
- package/dist/utility/wrun/sources/opra-option-lanes.util.js +38 -7
- package/dist/utility/wrun/sources/registry.js +31 -1
- package/dist/utility/wrun/sources/row-lane-registry.js +5 -5
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.d.ts +49 -0
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +75 -20
- package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +49 -0
- package/dist/utility/wrun/sources/row-lanes/option_strikes.js +57 -47
- package/dist/utility/wrun/sources/row-lanes/option_surface.d.ts +36 -4
- package/dist/utility/wrun/sources/row-lanes/option_surface.js +6 -12
- package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +37 -3
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +128 -2
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +233 -51
- package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +0 -8
- package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +26 -24
- package/dist/utility/wrun/sources/wrun-row-lanes.util.js +85 -104
- package/dist/utility/wrun/wrun-alert-outputs.registry.d.ts +166 -0
- package/dist/utility/wrun/wrun-alert-outputs.registry.js +219 -0
- package/dist/utility/wrun/wrun-bar-count.util.d.ts +83 -0
- package/dist/utility/wrun/wrun-bar-count.util.js +259 -0
- package/dist/utility/wrun/wrun-chart-context-names.util.d.ts +84 -0
- package/dist/utility/wrun/wrun-chart-context-names.util.js +186 -0
- package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +253 -0
- package/dist/utility/wrun/wrun-chart-market-facts.util.js +731 -0
- package/dist/utility/wrun/wrun-cloud-opra-stamp.util.d.ts +28 -0
- package/dist/utility/wrun/wrun-cloud-opra-stamp.util.js +45 -0
- package/dist/utility/wrun/wrun-coin-lane-live.util.d.ts +18 -0
- package/dist/utility/wrun/wrun-coin-lane-live.util.js +47 -0
- package/dist/utility/wrun/wrun-deadline.util.js +2 -1
- package/dist/utility/wrun/wrun-debug-output.util.d.ts +39 -0
- package/dist/utility/wrun/wrun-debug-output.util.js +63 -0
- package/dist/utility/wrun/wrun-declared-warmup.util.d.ts +113 -0
- package/dist/utility/wrun/wrun-declared-warmup.util.js +181 -0
- package/dist/utility/wrun/wrun-draft-legend-note.util.d.ts +43 -0
- package/dist/utility/wrun/wrun-draft-legend-note.util.js +158 -0
- package/dist/utility/wrun/wrun-draft-overlay.util.d.ts +181 -0
- package/dist/utility/wrun/wrun-draft-overlay.util.js +357 -0
- package/dist/utility/wrun/wrun-draw-skipped.leaf.d.ts +16 -0
- package/dist/utility/wrun/wrun-draw-skipped.leaf.js +16 -0
- package/dist/utility/wrun/wrun-earnings-facts.util.d.ts +42 -0
- package/dist/utility/wrun/wrun-earnings-facts.util.js +131 -0
- package/dist/utility/wrun/wrun-first-run-depth.util.d.ts +32 -0
- package/dist/utility/wrun/wrun-first-run-depth.util.js +118 -0
- package/dist/utility/wrun/wrun-gate-plane-readers.util.d.ts +24 -0
- package/dist/utility/wrun/wrun-gate-plane-readers.util.js +31 -0
- package/dist/utility/wrun/wrun-held-lanes.util.d.ts +32 -0
- package/dist/utility/wrun/wrun-held-lanes.util.js +94 -0
- package/dist/utility/wrun/wrun-host-visible-clock.util.d.ts +2 -0
- package/dist/utility/wrun/wrun-host-visible-clock.util.js +17 -0
- package/dist/utility/wrun/wrun-host.service.d.ts +266 -0
- package/dist/utility/wrun/wrun-host.service.js +655 -0
- package/dist/utility/wrun/wrun-inert-legend.util.d.ts +33 -0
- package/dist/utility/wrun/wrun-inert-legend.util.js +125 -0
- package/dist/utility/wrun/wrun-input-requirements.leaf.d.ts +155 -0
- package/dist/utility/wrun/wrun-input-requirements.leaf.js +450 -0
- package/dist/utility/wrun/wrun-integration-route.util.d.ts +51 -0
- package/dist/utility/wrun/wrun-integration-route.util.js +59 -0
- package/dist/utility/wrun/wrun-latest-history.leaf.d.ts +8 -0
- package/dist/utility/wrun/wrun-latest-history.leaf.js +8 -0
- package/dist/utility/wrun/wrun-legend-hover.lazy.d.ts +12 -0
- package/dist/utility/wrun/wrun-legend-hover.lazy.js +96 -0
- package/dist/utility/wrun/wrun-lifecycle-runtime.util.d.ts +21 -0
- package/dist/utility/wrun/wrun-lifecycle-runtime.util.js +21 -0
- package/dist/utility/wrun/wrun-live-hidden-hold.util.d.ts +23 -0
- package/dist/utility/wrun/wrun-live-hidden-hold.util.js +13 -0
- package/dist/utility/wrun/wrun-live-intake.util.d.ts +374 -0
- package/dist/utility/wrun/wrun-live-intake.util.js +2027 -0
- package/dist/utility/wrun/wrun-live-patch.util.d.ts +116 -0
- package/dist/utility/wrun/wrun-live-patch.util.js +523 -0
- package/dist/utility/wrun/wrun-live-tick.util.d.ts +619 -0
- package/dist/utility/wrun/wrun-live-tick.util.js +4974 -0
- package/dist/utility/wrun/wrun-loading-owner.util.d.ts +58 -0
- package/dist/utility/wrun/wrun-loading-owner.util.js +89 -0
- package/dist/utility/wrun/wrun-official-scope.leaf.d.ts +29 -0
- package/dist/utility/wrun/wrun-official-scope.leaf.js +36 -0
- package/dist/utility/wrun/wrun-oi-lane.util.d.ts +27 -0
- package/dist/utility/wrun/wrun-oi-lane.util.js +42 -0
- package/dist/utility/wrun/wrun-opra-stats.leaf.d.ts +29 -10
- package/dist/utility/wrun/wrun-opra-stats.leaf.js +29 -10
- package/dist/utility/wrun/wrun-options-stop.util.d.ts +52 -0
- package/dist/utility/wrun/wrun-options-stop.util.js +123 -0
- package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +719 -0
- package/dist/utility/wrun/wrun-overlay-drivers.util.js +1180 -0
- package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.d.ts +50 -0
- package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.js +131 -0
- package/dist/utility/wrun/wrun-overlay-lifecycle.util.d.ts +118 -0
- package/dist/utility/wrun/wrun-overlay-lifecycle.util.js +466 -0
- package/dist/utility/wrun/wrun-overlay-metadata.util.d.ts +45 -0
- package/dist/utility/wrun/wrun-overlay-metadata.util.js +112 -0
- package/dist/utility/wrun/wrun-overlay-recovery.util.d.ts +114 -0
- package/dist/utility/wrun/wrun-overlay-recovery.util.js +971 -0
- package/dist/utility/wrun/wrun-overlay-run.util.d.ts +858 -0
- package/dist/utility/wrun/wrun-overlay-run.util.js +11013 -0
- package/dist/utility/wrun/wrun-panel-mount.lazy.d.ts +10 -0
- package/dist/utility/wrun/wrun-panel-mount.lazy.js +68 -0
- package/dist/utility/wrun/wrun-panel-mount.util.d.ts +392 -0
- package/dist/utility/wrun/wrun-panel-mount.util.js +2346 -0
- package/dist/utility/wrun/wrun-param-map.util.d.ts +19 -4
- package/dist/utility/wrun/wrun-param-map.util.js +40 -47
- package/dist/utility/wrun/wrun-param-values.util.d.ts +9 -3
- package/dist/utility/wrun/wrun-param-values.util.js +5 -5
- package/dist/utility/wrun/wrun-pause-dim.util.d.ts +52 -0
- package/dist/utility/wrun/wrun-pause-dim.util.js +153 -0
- package/dist/utility/wrun/wrun-plot-gate.types.d.ts +23 -0
- package/dist/utility/wrun/wrun-plot-gate.types.js +7 -0
- package/dist/utility/wrun/wrun-prefix-cohort.util.d.ts +93 -0
- package/dist/utility/wrun/wrun-prefix-cohort.util.js +484 -0
- package/dist/utility/wrun/wrun-prefix-lanes.util.d.ts +114 -0
- package/dist/utility/wrun/wrun-prefix-lanes.util.js +486 -0
- package/dist/utility/wrun/wrun-prefix-proof.util.d.ts +317 -0
- package/dist/utility/wrun/wrun-prefix-proof.util.js +630 -0
- package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +73 -0
- package/dist/utility/wrun/wrun-refusal-surface.util.js +380 -0
- package/dist/utility/wrun/wrun-refusal-text.util.d.ts +15 -0
- package/dist/utility/wrun/wrun-refusal-text.util.js +40 -0
- package/dist/utility/wrun/wrun-replay-lane.util.d.ts +139 -0
- package/dist/utility/wrun/wrun-replay-lane.util.js +520 -0
- package/dist/utility/wrun/wrun-replay-rows.util.d.ts +21 -0
- package/dist/utility/wrun/wrun-replay-rows.util.js +172 -0
- package/dist/utility/wrun/wrun-row-source-factory.d.ts +53 -0
- package/dist/utility/wrun/wrun-row-source-factory.js +435 -0
- package/dist/utility/wrun/wrun-run-cells.util.d.ts +36 -0
- package/dist/utility/wrun/wrun-run-cells.util.js +46 -0
- package/dist/utility/wrun/wrun-run-interval-projection.types.d.ts +14 -0
- package/dist/utility/wrun/wrun-run-interval-projection.types.js +1 -0
- package/dist/utility/wrun/wrun-run-interval-session.util.d.ts +133 -0
- package/dist/utility/wrun/wrun-run-interval-session.util.js +121 -0
- package/dist/utility/wrun/wrun-run-interval.util.d.ts +98 -0
- package/dist/utility/wrun/wrun-run-interval.util.js +207 -0
- package/dist/utility/wrun/wrun-run-retained.util.d.ts +122 -0
- package/dist/utility/wrun/wrun-run-retained.util.js +255 -0
- package/dist/utility/wrun/wrun-sandbox-row-source.d.ts +184 -0
- package/dist/utility/wrun/wrun-sandbox-row-source.js +444 -0
- package/dist/utility/wrun/wrun-script-inputs.util.js +4 -4
- package/dist/utility/wrun/wrun-series-stream.util.d.ts +86 -0
- package/dist/utility/wrun/wrun-series-stream.util.js +537 -0
- package/dist/utility/wrun/wrun-sheet-remembered.util.d.ts +21 -0
- package/dist/utility/wrun/wrun-sheet-remembered.util.js +36 -0
- package/dist/utility/wrun/wrun-signal-sound-reasons.leaf.d.ts +7 -0
- package/dist/utility/wrun/wrun-signal-sound-reasons.leaf.js +12 -0
- package/dist/utility/wrun/wrun-socket-row-source.js +4 -2
- package/dist/utility/wrun/wrun-source-rows.util.d.ts +175 -3
- package/dist/utility/wrun/wrun-source-rows.util.js +294 -8
- package/dist/utility/wrun/wrun-stats-strip.util.d.ts +46 -0
- package/dist/utility/wrun/wrun-stats-strip.util.js +87 -0
- package/dist/utility/wrun/wrun-table-chrome.util.d.ts +163 -0
- package/dist/utility/wrun/wrun-table-chrome.util.js +557 -0
- package/dist/utility/wrun/wrun-text-params.util.d.ts +11 -6
- package/dist/utility/wrun/wrun-text-params.util.js +19 -30
- package/dist/utility/wrun/wrun-transient-rerun.util.d.ts +64 -0
- package/dist/utility/wrun/wrun-transient-rerun.util.js +317 -0
- package/dist/utility/wrun/wrun-twin-lookback.util.d.ts +10 -0
- package/dist/utility/wrun/wrun-twin-lookback.util.js +43 -0
- package/dist/utility/wrun/wrun-warmup-head-store.util.d.ts +41 -0
- package/dist/utility/wrun/wrun-warmup-head-store.util.js +120 -0
- package/dist/utility/wrun-alert-params.leaf.d.ts +24 -0
- package/dist/utility/wrun-alert-params.leaf.js +24 -0
- package/dist/utils/replay/replay-buffer-math.d.ts +148 -0
- package/dist/utils/replay/replay-buffer-math.js +684 -0
- package/dist/workers/wrun/wrun-abi-host.d.ts +190 -0
- package/dist/workers/wrun/wrun-abi-host.js +1201 -0
- package/dist/workers/wrun/wrun-engine-handler.d.ts +37 -0
- package/dist/workers/wrun/wrun-engine-handler.js +211 -0
- package/package.json +3 -3
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
import { classifyKScriptOutputRole } from './kscript-output-role.util.js';
|
|
2
|
+
import { isAxislessOnchartMetadataRunResult, isOffchartMetadataRunResult, isOnchartMetadataRunResult, isRecord, outputHasRenderableRows, } from './kscript-run-result-shape.util.js';
|
|
3
|
+
import { KSCRIPT_LIVE_REFRESH_RENDER_META_KEYS, KSCRIPT_NESTED_PARENT_PROMOTION_KEYS, } from './kscript-titancharts-render-keys.constants.js';
|
|
4
|
+
const KSCRIPT_PREPARATION_DROP_TRACE = Symbol('kiyoKScriptPreparationDropTrace');
|
|
5
|
+
function plotTypeOf(container) {
|
|
6
|
+
const plotType = container.plotType ?? container.plot;
|
|
7
|
+
return typeof plotType === 'string' ? plotType : undefined;
|
|
8
|
+
}
|
|
9
|
+
function outputTraceKey(fallback, output) {
|
|
10
|
+
if (isRecord(output)) {
|
|
11
|
+
for (const candidate of [output.sourcePlotId, output.plotId, output.outputKey, output.plotKey, output.id]) {
|
|
12
|
+
if (typeof candidate === 'string' && candidate.length > 0)
|
|
13
|
+
return candidate;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return fallback;
|
|
17
|
+
}
|
|
18
|
+
function recordKScriptPreparationDrop(trace, reason, path, fallbackKey, output) {
|
|
19
|
+
if (!trace)
|
|
20
|
+
return;
|
|
21
|
+
const role = classifyKScriptOutputRole(output);
|
|
22
|
+
trace.push({
|
|
23
|
+
key: outputTraceKey(fallbackKey, output),
|
|
24
|
+
path,
|
|
25
|
+
reason,
|
|
26
|
+
plotType: role.plotType,
|
|
27
|
+
outputRole: role.outputRole,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
const KSCRIPT_DECLARED_HELPER_ROOT_DESCRIPTOR_KEYS = [
|
|
31
|
+
'id',
|
|
32
|
+
'key',
|
|
33
|
+
'kScriptContainer',
|
|
34
|
+
'outputRole',
|
|
35
|
+
'paneParentCandidate',
|
|
36
|
+
'plotId',
|
|
37
|
+
'visibilityInputs',
|
|
38
|
+
'zOrder',
|
|
39
|
+
];
|
|
40
|
+
const KSCRIPT_DECLARED_HELPER_ROOT_MOUNT_KEYS = new Set([
|
|
41
|
+
...KSCRIPT_LIVE_REFRESH_RENDER_META_KEYS,
|
|
42
|
+
...KSCRIPT_NESTED_PARENT_PROMOTION_KEYS,
|
|
43
|
+
...KSCRIPT_DECLARED_HELPER_ROOT_DESCRIPTOR_KEYS,
|
|
44
|
+
]);
|
|
45
|
+
export function getKScriptPreparationDropTrace(runResult) {
|
|
46
|
+
if (!isRecord(runResult))
|
|
47
|
+
return [];
|
|
48
|
+
const trace = runResult[KSCRIPT_PREPARATION_DROP_TRACE];
|
|
49
|
+
return Array.isArray(trace) ? [...trace] : [];
|
|
50
|
+
}
|
|
51
|
+
export function attachKScriptPreparationDropTrace(runResult, trace) {
|
|
52
|
+
if (!trace.length || !isRecord(runResult) || !Object.isExtensible(runResult))
|
|
53
|
+
return runResult;
|
|
54
|
+
Object.defineProperty(runResult, KSCRIPT_PREPARATION_DROP_TRACE, {
|
|
55
|
+
value: trace,
|
|
56
|
+
enumerable: false,
|
|
57
|
+
configurable: true,
|
|
58
|
+
});
|
|
59
|
+
return runResult;
|
|
60
|
+
}
|
|
61
|
+
function emptyKScriptRunResultAfterRootHelperDrop(runResult, trace, options = {}) {
|
|
62
|
+
if (options.recordRootDrop !== false) {
|
|
63
|
+
recordKScriptPreparationDrop(trace, 'declared-helper', 'runResult', outputTraceKey('runResult', runResult), runResult);
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
...(isRecord(runResult.define) ? { define: runResult.define } : {}),
|
|
67
|
+
...(isRecord(runResult.settings) ? { settings: runResult.settings } : {}),
|
|
68
|
+
...(Array.isArray(runResult.drawings) ? { drawings: runResult.drawings } : {}),
|
|
69
|
+
outputs: {},
|
|
70
|
+
nestedMeta: [],
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function hasMountableKScriptOutput(output) {
|
|
74
|
+
if (!isRecord(output))
|
|
75
|
+
return false;
|
|
76
|
+
if (classifyKScriptOutputRole(output).isDeclaredHelper)
|
|
77
|
+
return false;
|
|
78
|
+
if (typeof plotTypeOf(output) === 'string')
|
|
79
|
+
return true;
|
|
80
|
+
if (isRecord(output.outputs) && Object.values(output.outputs).some(hasMountableKScriptOutput))
|
|
81
|
+
return true;
|
|
82
|
+
return Array.isArray(output.nestedMeta) && output.nestedMeta.some(hasMountableKScriptOutput);
|
|
83
|
+
}
|
|
84
|
+
function stripKScriptRootMountFields(runResult) {
|
|
85
|
+
const normalized = { ...runResult };
|
|
86
|
+
for (const key of KSCRIPT_DECLARED_HELPER_ROOT_MOUNT_KEYS)
|
|
87
|
+
delete normalized[key];
|
|
88
|
+
return normalized;
|
|
89
|
+
}
|
|
90
|
+
function dropDeclaredHelperOutputTree(output, trace, path, fallbackKey, removable) {
|
|
91
|
+
if (!isRecord(output))
|
|
92
|
+
return { output, removed: false };
|
|
93
|
+
if (removable && classifyKScriptOutputRole(output).isDeclaredHelper) {
|
|
94
|
+
recordKScriptPreparationDrop(trace, 'declared-helper', path, fallbackKey, output);
|
|
95
|
+
return { output, removed: true };
|
|
96
|
+
}
|
|
97
|
+
let normalized = output;
|
|
98
|
+
const clone = () => {
|
|
99
|
+
if (normalized === output)
|
|
100
|
+
normalized = { ...output };
|
|
101
|
+
return normalized;
|
|
102
|
+
};
|
|
103
|
+
if (isRecord(output.outputs)) {
|
|
104
|
+
let outputs = null;
|
|
105
|
+
for (const [key, child] of Object.entries(output.outputs)) {
|
|
106
|
+
const nextChild = dropDeclaredHelperOutputTree(child, trace, `${path}.outputs.${key}`, key, true);
|
|
107
|
+
if (!nextChild.removed && nextChild.output === child)
|
|
108
|
+
continue;
|
|
109
|
+
if (!outputs)
|
|
110
|
+
outputs = { ...output.outputs };
|
|
111
|
+
if (nextChild.removed)
|
|
112
|
+
delete outputs[key];
|
|
113
|
+
else
|
|
114
|
+
outputs[key] = nextChild.output;
|
|
115
|
+
}
|
|
116
|
+
if (outputs)
|
|
117
|
+
clone().outputs = outputs;
|
|
118
|
+
}
|
|
119
|
+
if (Array.isArray(output.nestedMeta)) {
|
|
120
|
+
let nestedChanged = false;
|
|
121
|
+
const nestedMeta = output.nestedMeta.flatMap((child, index) => {
|
|
122
|
+
const key = isRecord(child) ? outputTraceKey(String(index), child) : String(index);
|
|
123
|
+
const nextChild = dropDeclaredHelperOutputTree(child, trace, `${path}.nestedMeta.${index}`, key, true);
|
|
124
|
+
nestedChanged ||= nextChild.removed || nextChild.output !== child;
|
|
125
|
+
return nextChild.removed ? [] : [nextChild.output];
|
|
126
|
+
});
|
|
127
|
+
if (nestedChanged)
|
|
128
|
+
clone().nestedMeta = nestedMeta;
|
|
129
|
+
}
|
|
130
|
+
return { output: normalized, removed: false };
|
|
131
|
+
}
|
|
132
|
+
export function dropDeclaredHelperOutputs(runResult, trace) {
|
|
133
|
+
if (!isRecord(runResult))
|
|
134
|
+
return runResult;
|
|
135
|
+
const rootIsDeclaredHelper = classifyKScriptOutputRole(runResult).isDeclaredHelper;
|
|
136
|
+
const normalized = dropDeclaredHelperOutputTree(runResult, trace, 'runResult', 'runResult', false).output;
|
|
137
|
+
if (!rootIsDeclaredHelper)
|
|
138
|
+
return normalized;
|
|
139
|
+
recordKScriptPreparationDrop(trace, 'declared-helper', 'runResult', outputTraceKey('runResult', runResult), runResult);
|
|
140
|
+
if (!isRecord(normalized)) {
|
|
141
|
+
return emptyKScriptRunResultAfterRootHelperDrop(runResult, trace, { recordRootDrop: false });
|
|
142
|
+
}
|
|
143
|
+
const rootDroppedRunResult = stripKScriptRootMountFields(normalized);
|
|
144
|
+
if (!hasMountableKScriptOutput(rootDroppedRunResult)) {
|
|
145
|
+
return emptyKScriptRunResultAfterRootHelperDrop(rootDroppedRunResult, trace, { recordRootDrop: false });
|
|
146
|
+
}
|
|
147
|
+
return rootDroppedRunResult;
|
|
148
|
+
}
|
|
149
|
+
function isTransparentCandleAnchorOutput(output) {
|
|
150
|
+
const role = classifyKScriptOutputRole(output);
|
|
151
|
+
return ((role.roleSource === 'inferred' || role.invisibleAnchorCompat) &&
|
|
152
|
+
role.plotType === 'candle' &&
|
|
153
|
+
!role.hasVisiblePalette &&
|
|
154
|
+
isRecord(output) &&
|
|
155
|
+
outputHasRenderableRows(output));
|
|
156
|
+
}
|
|
157
|
+
function isVisibleNonCandleDrawableOutput(output) {
|
|
158
|
+
const role = classifyKScriptOutputRole(output);
|
|
159
|
+
return (role.isDrawableChild &&
|
|
160
|
+
role.plotType !== 'candle' &&
|
|
161
|
+
role.hasVisiblePalette &&
|
|
162
|
+
isRecord(output) &&
|
|
163
|
+
outputHasRenderableRows(output));
|
|
164
|
+
}
|
|
165
|
+
function outputRows(output) {
|
|
166
|
+
if (!isRecord(output))
|
|
167
|
+
return null;
|
|
168
|
+
for (const candidate of [output.data, output.rawData, output.activeData]) {
|
|
169
|
+
if (Array.isArray(candidate))
|
|
170
|
+
return candidate;
|
|
171
|
+
}
|
|
172
|
+
return null;
|
|
173
|
+
}
|
|
174
|
+
function outputIdentityKeys(output) {
|
|
175
|
+
if (!isRecord(output))
|
|
176
|
+
return [];
|
|
177
|
+
return [
|
|
178
|
+
output.sourcePlotId,
|
|
179
|
+
output.plotId,
|
|
180
|
+
output.outputKey,
|
|
181
|
+
output.plotKey,
|
|
182
|
+
output.mainPlotKey,
|
|
183
|
+
output.id,
|
|
184
|
+
output.key,
|
|
185
|
+
].filter((candidate, index, candidates) => {
|
|
186
|
+
return typeof candidate === 'string' && candidate.length > 0 && candidates.indexOf(candidate) === index;
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
function mountedParentIdentityKeys(meta) {
|
|
190
|
+
const keys = new Set();
|
|
191
|
+
if (!meta)
|
|
192
|
+
return keys;
|
|
193
|
+
for (const candidate of [meta.outputKey, meta.plotKey, meta.plotId, meta.mainPlotKey]) {
|
|
194
|
+
if (typeof candidate === 'string' && candidate.length > 0)
|
|
195
|
+
keys.add(candidate);
|
|
196
|
+
}
|
|
197
|
+
return keys;
|
|
198
|
+
}
|
|
199
|
+
function findMountedParentNestedOutput(runResult, meta) {
|
|
200
|
+
if (!Array.isArray(runResult.nestedMeta))
|
|
201
|
+
return null;
|
|
202
|
+
const parentKeys = mountedParentIdentityKeys(meta);
|
|
203
|
+
if (parentKeys.size === 0)
|
|
204
|
+
return null;
|
|
205
|
+
for (const nested of runResult.nestedMeta) {
|
|
206
|
+
if (!isRecord(nested) || !outputHasRenderableRows(nested))
|
|
207
|
+
continue;
|
|
208
|
+
if (outputIdentityKeys(nested).some((key) => parentKeys.has(key)))
|
|
209
|
+
return nested;
|
|
210
|
+
}
|
|
211
|
+
return null;
|
|
212
|
+
}
|
|
213
|
+
function shouldDropTransparentFlatRootAnchor(runResult, dropUnconditionally) {
|
|
214
|
+
if (!Array.isArray(runResult.nestedMeta) || runResult.nestedMeta.length === 0)
|
|
215
|
+
return false;
|
|
216
|
+
return dropUnconditionally
|
|
217
|
+
? runResult.nestedMeta.some((nested) => isRecord(nested) && typeof plotTypeOf(nested) === 'string')
|
|
218
|
+
: runResult.nestedMeta.some(isVisibleNonCandleDrawableOutput);
|
|
219
|
+
}
|
|
220
|
+
function dropTransparentFlatRootCandleAnchor(runResult, meta, dropUnconditionally, trace) {
|
|
221
|
+
if (!isTransparentCandleAnchorOutput(runResult) ||
|
|
222
|
+
!shouldDropTransparentFlatRootAnchor(runResult, dropUnconditionally)) {
|
|
223
|
+
return runResult;
|
|
224
|
+
}
|
|
225
|
+
const mountedParentOutput = findMountedParentNestedOutput(runResult, meta);
|
|
226
|
+
const mountedParentRows = outputRows(mountedParentOutput);
|
|
227
|
+
if (!mountedParentRows || mountedParentRows.length === 0)
|
|
228
|
+
return runResult;
|
|
229
|
+
recordKScriptPreparationDrop(trace, 'appearance-anchor', 'runResult', outputTraceKey('runResult', runResult), runResult);
|
|
230
|
+
return {
|
|
231
|
+
...stripKScriptRootMountFields(runResult),
|
|
232
|
+
data: mountedParentRows,
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
export function dropTransparentOnchartCandleAnchors(runResult, meta, trace) {
|
|
236
|
+
if (!isOnchartMetadataRunResult(runResult, meta) || !isRecord(runResult))
|
|
237
|
+
return runResult;
|
|
238
|
+
const dropUnconditionally = isAxislessOnchartMetadataRunResult(runResult, meta);
|
|
239
|
+
let normalized = dropTransparentFlatRootCandleAnchor(runResult, meta, dropUnconditionally, trace);
|
|
240
|
+
const clone = () => {
|
|
241
|
+
if (normalized === runResult)
|
|
242
|
+
normalized = { ...runResult };
|
|
243
|
+
return normalized;
|
|
244
|
+
};
|
|
245
|
+
if (isRecord(runResult.outputs)) {
|
|
246
|
+
const outputEntries = Object.entries(runResult.outputs);
|
|
247
|
+
const anchorKeys = new Set(outputEntries.filter(([, output]) => isTransparentCandleAnchorOutput(output)).map(([key]) => key));
|
|
248
|
+
if (anchorKeys.size > 0) {
|
|
249
|
+
const anchorFreeEntries = outputEntries.filter(([key]) => !anchorKeys.has(key));
|
|
250
|
+
const shouldDrop = dropUnconditionally
|
|
251
|
+
? anchorFreeEntries.some(([, output]) => isRecord(output) && typeof plotTypeOf(output) === 'string')
|
|
252
|
+
: outputEntries.some(([, output]) => isVisibleNonCandleDrawableOutput(output));
|
|
253
|
+
if (shouldDrop) {
|
|
254
|
+
for (const [key, output] of outputEntries) {
|
|
255
|
+
if (anchorKeys.has(key))
|
|
256
|
+
recordKScriptPreparationDrop(trace, 'appearance-anchor', `runResult.outputs.${key}`, key, output);
|
|
257
|
+
}
|
|
258
|
+
clone().outputs = Object.fromEntries(anchorFreeEntries);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
if (Array.isArray(runResult.nestedMeta)) {
|
|
263
|
+
const anchorIndexes = new Set();
|
|
264
|
+
runResult.nestedMeta.forEach((nested, index) => {
|
|
265
|
+
if (isTransparentCandleAnchorOutput(nested))
|
|
266
|
+
anchorIndexes.add(index);
|
|
267
|
+
});
|
|
268
|
+
if (anchorIndexes.size > 0) {
|
|
269
|
+
const siblings = [runResult, ...runResult.nestedMeta];
|
|
270
|
+
if (dropUnconditionally || siblings.some(isVisibleNonCandleDrawableOutput)) {
|
|
271
|
+
const nestedMeta = runResult.nestedMeta.filter((_, index) => !anchorIndexes.has(index));
|
|
272
|
+
runResult.nestedMeta.forEach((nested, index) => {
|
|
273
|
+
if (anchorIndexes.has(index))
|
|
274
|
+
recordKScriptPreparationDrop(trace, 'appearance-anchor', `runResult.nestedMeta.${index}`, String(index), nested);
|
|
275
|
+
});
|
|
276
|
+
if (nestedMeta.length !== runResult.nestedMeta.length)
|
|
277
|
+
clone().nestedMeta = nestedMeta;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
return normalized;
|
|
282
|
+
}
|
|
283
|
+
export function pruneTransparentOnchartCandleNestedAnchors(meta) {
|
|
284
|
+
if (!Array.isArray(meta.nestedMeta) ||
|
|
285
|
+
meta.type !== 'onchart' ||
|
|
286
|
+
!meta.nestedMeta.some(isTransparentCandleAnchorOutput))
|
|
287
|
+
return;
|
|
288
|
+
const siblings = [meta, ...meta.nestedMeta];
|
|
289
|
+
if (!siblings.some(isVisibleNonCandleDrawableOutput))
|
|
290
|
+
return;
|
|
291
|
+
const nestedMeta = meta.nestedMeta.filter((nested) => !isTransparentCandleAnchorOutput(nested));
|
|
292
|
+
if (nestedMeta.length !== meta.nestedMeta.length)
|
|
293
|
+
meta.nestedMeta = nestedMeta;
|
|
294
|
+
}
|
|
295
|
+
// The engine stamps forceOnChart=true on every fillBetween output. On an
|
|
296
|
+
// OFFCHART script that flag routes the fill's y-mapping to the main pane's
|
|
297
|
+
// price scale (titan picks chart.ts[0] for onchart-forced plots), so the fill
|
|
298
|
+
// polygon lands offscreen and the pane shows no fill at all. Release the flag
|
|
299
|
+
// for offchart scripts: the fill belongs to the pane its sibling series are
|
|
300
|
+
// in. Onchart scripts are untouched (their outputs are re-stamped onchart by
|
|
301
|
+
// withOnchartOutputCoordinateContract anyway).
|
|
302
|
+
export function releaseOffchartForcedFillPane(runResult, meta) {
|
|
303
|
+
if (!isRecord(runResult) || !isRecord(runResult.outputs))
|
|
304
|
+
return runResult;
|
|
305
|
+
if (!isOffchartMetadataRunResult(runResult, meta))
|
|
306
|
+
return runResult;
|
|
307
|
+
let outputs = runResult.outputs;
|
|
308
|
+
let outputsChanged = false;
|
|
309
|
+
for (const [key, output] of Object.entries(runResult.outputs)) {
|
|
310
|
+
if (!isRecord(output) || plotTypeOf(output) !== 'fillBetween' || output.forceOnChart !== true) {
|
|
311
|
+
continue;
|
|
312
|
+
}
|
|
313
|
+
if (!outputsChanged) {
|
|
314
|
+
outputs = { ...runResult.outputs };
|
|
315
|
+
outputsChanged = true;
|
|
316
|
+
}
|
|
317
|
+
outputs[key] = { ...output, forceOnChart: false };
|
|
318
|
+
}
|
|
319
|
+
if (!outputsChanged)
|
|
320
|
+
return runResult;
|
|
321
|
+
return { ...runResult, outputs };
|
|
322
|
+
}
|
|
323
|
+
function fillSeriesRefName(ref) {
|
|
324
|
+
if (!isRecord(ref))
|
|
325
|
+
return undefined;
|
|
326
|
+
return typeof ref.name === 'string' && ref.name.length > 0 ? ref.name : undefined;
|
|
327
|
+
}
|
|
328
|
+
function fillSeriesRefResolves(ref, outputs) {
|
|
329
|
+
if (!isRecord(ref))
|
|
330
|
+
return true; // malformed refs are the renderer's concern, not this check's
|
|
331
|
+
const plotKey = ref.plotKey;
|
|
332
|
+
return typeof plotKey === 'string' && plotKey.length > 0 && isRecord(outputs[plotKey]);
|
|
333
|
+
}
|
|
334
|
+
// A fillBetween whose series were never plotted emits refs that carry only the
|
|
335
|
+
// variable name; the renderer cannot resolve them against any mounted sibling
|
|
336
|
+
// and skips the fill with a console warning nobody sees. Surface that contract
|
|
337
|
+
// violation as a runtime diagnostic so it lands in the Problems panel instead
|
|
338
|
+
// of silently rendering nothing.
|
|
339
|
+
export function annotateUnplottedKScriptFillRefs(runResult) {
|
|
340
|
+
if (!isRecord(runResult) || !isRecord(runResult.outputs))
|
|
341
|
+
return runResult;
|
|
342
|
+
const outputs = runResult.outputs;
|
|
343
|
+
const unplotted = [];
|
|
344
|
+
for (const output of Object.values(outputs)) {
|
|
345
|
+
if (!isRecord(output) || plotTypeOf(output) !== 'fillBetween')
|
|
346
|
+
continue;
|
|
347
|
+
for (const side of ['series1', 'series2']) {
|
|
348
|
+
const ref = output[side];
|
|
349
|
+
if (fillSeriesRefResolves(ref, outputs))
|
|
350
|
+
continue;
|
|
351
|
+
const name = fillSeriesRefName(ref) ?? side;
|
|
352
|
+
if (!unplotted.includes(name))
|
|
353
|
+
unplotted.push(name);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
if (unplotted.length === 0)
|
|
357
|
+
return runResult;
|
|
358
|
+
const existing = Array.isArray(runResult.diagnostics) ? runResult.diagnostics : [];
|
|
359
|
+
const known = new Set(existing.filter(isRecord).map((diagnostic) => `${String(diagnostic.code)}:${String(diagnostic.message)}`));
|
|
360
|
+
const appended = [...existing];
|
|
361
|
+
for (const name of unplotted) {
|
|
362
|
+
const diagnostic = {
|
|
363
|
+
stage: 'render',
|
|
364
|
+
severity: 'warning',
|
|
365
|
+
code: 'KSCRIPT_FILL_SERIES_NOT_PLOTTED',
|
|
366
|
+
message: `fillBetween references '${name}', which is never plotted, so the fill is skipped.`,
|
|
367
|
+
suggestedFix: `Plot the series first (e.g. plotLine(value=${name}, ...)); fillBetween only fills between plotted series.`,
|
|
368
|
+
};
|
|
369
|
+
if (known.has(`${diagnostic.code}:${diagnostic.message}`))
|
|
370
|
+
continue;
|
|
371
|
+
appended.push(diagnostic);
|
|
372
|
+
}
|
|
373
|
+
if (appended.length === existing.length)
|
|
374
|
+
return runResult;
|
|
375
|
+
return { ...runResult, diagnostics: appended };
|
|
376
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const SNAPSHOT_META_KEYS: readonly ["activeData", "batched", "color", "colors", "extractors", "fill", "fillGradient", "forceOnChart", "getMultiLineLabels", "glow", "high", "lineStyle", "low", "mainPlotKey", "nestedMeta", "outputKey", "opacity", "plot", "plotKey", "plotType", "rawData", "runResult", "series1", "series2", "settings", "showPriceDisplay", "smooth", "showIndependentYAxis", "startTime", "styleDataOffset", "styleProperties", "subsetRange", "width", "widths"];
|
|
2
|
+
export declare const KSCRIPT_PARENT_OUTPUT_RENDER_META_KEYS: readonly ["color", "colors", "fill", "fillGradient", "forceOnChart", "glow", "lineStyle", "opacity", "series1", "series2", "showPriceDisplay", "smooth", "styleDataOffset", "styleProperties", "width", "widths"];
|
|
3
|
+
export declare const KSCRIPT_PARENT_OUTPUT_RENDER_SETTING_KEYS: readonly ["fill", "fillGradient", "glow", "lineStyle", "opacity", "showPriceDisplay", "smooth", "width"];
|
|
4
|
+
export declare const KSCRIPT_PARENT_OUTPUT_RENDER_SETTING_INITIALIZER_DEFAULTS: Partial<Record<(typeof KSCRIPT_PARENT_OUTPUT_RENDER_SETTING_KEYS)[number], unknown>>;
|
|
5
|
+
export declare const KSCRIPT_NESTED_PARENT_PROMOTION_KEYS: readonly ["activeData", "batched", "data", "extractors", "high", "low", "multiValue", "plot", "plotType", "rawData", "showIndependentYAxis", "startTime", "subsetRange", "color", "colors", "fill", "fillGradient", "forceOnChart", "glow", "lineStyle", "opacity", "series1", "series2", "showPriceDisplay", "smooth", "styleDataOffset", "styleProperties", "width", "widths"];
|
|
6
|
+
export declare const KSCRIPT_LIVE_REFRESH_RENDER_META_KEYS: readonly ["activeData", "batched", "color", "colors", "data", "extractors", "fill", "fillGradient", "forceOnChart", "getMultiLineLabels", "glow", "high", "lineStyle", "low", "mainPlotKey", "multiValue", "opacity", "outputKey", "plot", "plotKey", "plotType", "series1", "series2", "showIndependentYAxis", "showPriceDisplay", "smooth", "startTime", "styleDataOffset", "styleProperties", "subsetRange", "type", "width", "widths"];
|
|
7
|
+
export declare const KSCRIPT_LIVE_REFRESH_DELETE_IF_ABSENT_KEYS: readonly ["color", "colors", "styleDataOffset", "styleProperties", "widths"];
|
|
8
|
+
export declare const KSCRIPT_LIVE_REFRESH_RENDER_CONTRACT_SCALAR_KEYS: readonly ["styleDataOffset"];
|
|
9
|
+
export declare const KSCRIPT_LIVE_REFRESH_RENDER_CONTRACT_ARRAY_KEYS: readonly ["color", "colors", "styleProperties"];
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
export const SNAPSHOT_META_KEYS = [
|
|
2
|
+
'activeData',
|
|
3
|
+
'batched',
|
|
4
|
+
'color',
|
|
5
|
+
'colors',
|
|
6
|
+
'extractors',
|
|
7
|
+
'fill',
|
|
8
|
+
'fillGradient',
|
|
9
|
+
'forceOnChart',
|
|
10
|
+
'getMultiLineLabels',
|
|
11
|
+
'glow',
|
|
12
|
+
'high',
|
|
13
|
+
'lineStyle',
|
|
14
|
+
'low',
|
|
15
|
+
'mainPlotKey',
|
|
16
|
+
'nestedMeta',
|
|
17
|
+
'outputKey',
|
|
18
|
+
'opacity',
|
|
19
|
+
'plot',
|
|
20
|
+
'plotKey',
|
|
21
|
+
'plotType',
|
|
22
|
+
'rawData',
|
|
23
|
+
'runResult',
|
|
24
|
+
'series1',
|
|
25
|
+
'series2',
|
|
26
|
+
'settings',
|
|
27
|
+
'showPriceDisplay',
|
|
28
|
+
'smooth',
|
|
29
|
+
'showIndependentYAxis',
|
|
30
|
+
'startTime',
|
|
31
|
+
'styleDataOffset',
|
|
32
|
+
'styleProperties',
|
|
33
|
+
'subsetRange',
|
|
34
|
+
'width',
|
|
35
|
+
'widths',
|
|
36
|
+
];
|
|
37
|
+
export const KSCRIPT_PARENT_OUTPUT_RENDER_META_KEYS = [
|
|
38
|
+
'color',
|
|
39
|
+
'colors',
|
|
40
|
+
'fill',
|
|
41
|
+
'fillGradient',
|
|
42
|
+
'forceOnChart',
|
|
43
|
+
'glow',
|
|
44
|
+
'lineStyle',
|
|
45
|
+
'opacity',
|
|
46
|
+
'series1',
|
|
47
|
+
'series2',
|
|
48
|
+
'showPriceDisplay',
|
|
49
|
+
'smooth',
|
|
50
|
+
'styleDataOffset',
|
|
51
|
+
'styleProperties',
|
|
52
|
+
'width',
|
|
53
|
+
'widths',
|
|
54
|
+
];
|
|
55
|
+
export const KSCRIPT_PARENT_OUTPUT_RENDER_SETTING_KEYS = [
|
|
56
|
+
'fill',
|
|
57
|
+
// Vertical fill gradient ({ stops: [[offset, color], ...] }) emitted by the
|
|
58
|
+
// engine's plotLine fillGradient kwarg; titan's fill renderers read it from
|
|
59
|
+
// overlay settings (the same key native controls stamp).
|
|
60
|
+
'fillGradient',
|
|
61
|
+
'glow',
|
|
62
|
+
'lineStyle',
|
|
63
|
+
'opacity',
|
|
64
|
+
'showPriceDisplay',
|
|
65
|
+
'smooth',
|
|
66
|
+
'width',
|
|
67
|
+
];
|
|
68
|
+
export const KSCRIPT_PARENT_OUTPUT_RENDER_SETTING_INITIALIZER_DEFAULTS = {
|
|
69
|
+
smooth: true,
|
|
70
|
+
};
|
|
71
|
+
export const KSCRIPT_NESTED_PARENT_PROMOTION_KEYS = [
|
|
72
|
+
'activeData',
|
|
73
|
+
'batched',
|
|
74
|
+
'data',
|
|
75
|
+
'extractors',
|
|
76
|
+
'high',
|
|
77
|
+
'low',
|
|
78
|
+
'multiValue',
|
|
79
|
+
'plot',
|
|
80
|
+
'plotType',
|
|
81
|
+
'rawData',
|
|
82
|
+
'showIndependentYAxis',
|
|
83
|
+
'startTime',
|
|
84
|
+
'subsetRange',
|
|
85
|
+
...KSCRIPT_PARENT_OUTPUT_RENDER_META_KEYS,
|
|
86
|
+
];
|
|
87
|
+
export const KSCRIPT_LIVE_REFRESH_RENDER_META_KEYS = [
|
|
88
|
+
'activeData',
|
|
89
|
+
'batched',
|
|
90
|
+
'color',
|
|
91
|
+
'colors',
|
|
92
|
+
'data',
|
|
93
|
+
'extractors',
|
|
94
|
+
'fill',
|
|
95
|
+
'fillGradient',
|
|
96
|
+
'forceOnChart',
|
|
97
|
+
'getMultiLineLabels',
|
|
98
|
+
'glow',
|
|
99
|
+
'high',
|
|
100
|
+
'lineStyle',
|
|
101
|
+
'low',
|
|
102
|
+
'mainPlotKey',
|
|
103
|
+
'multiValue',
|
|
104
|
+
'opacity',
|
|
105
|
+
'outputKey',
|
|
106
|
+
'plot',
|
|
107
|
+
'plotKey',
|
|
108
|
+
'plotType',
|
|
109
|
+
'series1',
|
|
110
|
+
'series2',
|
|
111
|
+
'showIndependentYAxis',
|
|
112
|
+
'showPriceDisplay',
|
|
113
|
+
'smooth',
|
|
114
|
+
'startTime',
|
|
115
|
+
'styleDataOffset',
|
|
116
|
+
'styleProperties',
|
|
117
|
+
'subsetRange',
|
|
118
|
+
'type',
|
|
119
|
+
'width',
|
|
120
|
+
'widths',
|
|
121
|
+
];
|
|
122
|
+
export const KSCRIPT_LIVE_REFRESH_DELETE_IF_ABSENT_KEYS = [
|
|
123
|
+
'color',
|
|
124
|
+
'colors',
|
|
125
|
+
'styleDataOffset',
|
|
126
|
+
'styleProperties',
|
|
127
|
+
'widths',
|
|
128
|
+
];
|
|
129
|
+
export const KSCRIPT_LIVE_REFRESH_RENDER_CONTRACT_SCALAR_KEYS = ['styleDataOffset'];
|
|
130
|
+
export const KSCRIPT_LIVE_REFRESH_RENDER_CONTRACT_ARRAY_KEYS = ['color', 'colors', 'styleProperties'];
|