gloomberb 0.15.7 → 0.16.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 +11 -2
- package/package.json +1 -1
- package/src/api-client/app-attention.ts +147 -0
- package/src/api-client/attention.ts +26 -0
- package/src/api-client/awards.ts +215 -0
- package/src/api-client/catalysts.ts +160 -0
- package/src/api-client/chat.ts +137 -14
- package/src/api-client/company-kpis.ts +153 -0
- package/src/api-client/cpi.ts +52 -0
- package/src/api-client/credit-documents.ts +107 -0
- package/src/api-client/data.ts +192 -3
- package/src/api-client/distress.ts +164 -0
- package/src/api-client/doe.ts +75 -0
- package/src/api-client/equity-screener.ts +11 -0
- package/src/api-client/exposure.ts +202 -0
- package/src/api-client/gpu.ts +93 -0
- package/src/api-client/hiring.ts +110 -0
- package/src/api-client/index.ts +78 -3
- package/src/api-client/normalizers.ts +31 -1
- package/src/api-client/paths.ts +3 -0
- package/src/api-client/perps.ts +127 -0
- package/src/api-client/power.ts +148 -0
- package/src/api-client/request.ts +58 -1
- package/src/api-client/research-activity.ts +172 -13
- package/src/api-client/socket.ts +75 -27
- package/src/api-client/supply-chain-graph.ts +40 -0
- package/src/api-client/supply-chain.ts +98 -0
- package/src/api-client/telemetry.ts +29 -0
- package/src/api-client/themes.ts +28 -0
- package/src/api-client/types.ts +33 -1
- package/src/api-client/wall-experiments.ts +100 -0
- package/src/api-client/wall-summary.ts +49 -0
- package/src/api-client/web-experiments.ts +136 -0
- package/src/app/pane-runtime/plugin-bindings.ts +5 -0
- package/src/app/pane-runtime/ticker-open-runtime.ts +8 -2
- package/src/app/runtime/update.ts +13 -1
- package/src/cli/commands/system.ts +2 -0
- package/src/cli/desktop-pane-shot.ts +3 -4
- package/src/cli/pane-functions/data.ts +78 -0
- package/src/cli/pane-functions/financial-ratio-shot.ts +160 -0
- package/src/cli/pane-functions/function-help.ts +220 -8
- package/src/cli/pane-functions/headless.ts +4 -0
- package/src/cli/pane-functions/screenshot-evidence.ts +21 -0
- package/src/cli/pane-functions/screenshot.ts +49 -5
- package/src/components/chart/composite/composite-chart.tsx +15 -2
- package/src/components/chart/composite/format.ts +24 -11
- package/src/components/chart/composite/rasterizer.ts +67 -16
- package/src/components/chart/composite/scene.ts +53 -2
- package/src/components/chart/composite/session-shading.ts +3 -2
- package/src/components/chart/composite/text-renderer.ts +52 -1
- package/src/components/chart/composite/time-axis.ts +100 -30
- package/src/components/chart/composite/tools.ts +2 -1
- package/src/components/chart/composite/types.ts +4 -0
- package/src/components/chart-table/index.ts +1 -0
- package/src/components/chart-table/layout.ts +15 -0
- package/src/components/command-bar/action-runtime.ts +1 -0
- package/src/components/command-bar/commands/direct/index.ts +32 -0
- package/src/components/command-bar/commands/registry.ts +7 -0
- package/src/components/command-bar/pane-templates/items.ts +11 -0
- package/src/components/command-bar/pane-templates/workflow.ts +19 -4
- package/src/components/command-bar/routes/root/command-items.ts +6 -0
- package/src/components/command-bar/routes/root/provider-search.ts +2 -0
- package/src/components/command-bar/routes/root/results.ts +64 -0
- package/src/components/command-bar/routes/root/runtime.ts +8 -0
- package/src/components/command-bar/routes/ticker-search/results.ts +89 -24
- package/src/components/command-bar/routes/ticker-search/route.ts +2 -0
- package/src/components/command-bar/surface/index.tsx +15 -0
- package/src/components/command-bar/view-model.ts +3 -0
- package/src/components/command-bar/workflow/collection-actions.ts +9 -7
- package/src/components/command-bar/workflow/ops.ts +19 -0
- package/src/components/command-bar/workflow/tickers.ts +5 -0
- package/src/components/company-logo.tsx +15 -2
- package/src/components/data-table/table-pane.ts +2 -1
- package/src/components/index.ts +1 -0
- package/src/components/layout/detached-pane-shell.tsx +12 -1
- package/src/components/layout/missing-pane.tsx +87 -23
- package/src/components/layout/pane/footer/index.tsx +64 -18
- package/src/components/layout/pane/footer/model.ts +85 -0
- package/src/components/layout/pane/sidebar.tsx +19 -1
- package/src/components/layout/shell/index.tsx +38 -28
- package/src/components/layout/shell/pane/management-shortcuts.ts +13 -1
- package/src/components/layout/status-bar.tsx +93 -28
- package/src/components/layout/status-widget-space.ts +72 -0
- package/src/components/onboarding/first-run-workspace.ts +8 -2
- package/src/components/onboarding/onboarding-wizard.tsx +35 -16
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +14 -5
- package/src/components/onboarding/wizard-model.ts +13 -5
- package/src/components/onboarding/wizard-positions.ts +56 -7
- package/src/components/price-performance.tsx +31 -34
- package/src/components/ui/data-table/index.tsx +11 -8
- package/src/components/ui/display.tsx +15 -6
- package/src/components/ui/fields.tsx +5 -0
- package/src/components/ui/figure.tsx +94 -0
- package/src/components/ui/header-case.ts +25 -3
- package/src/components/ui/icon.tsx +3 -1
- package/src/components/ui/message-composer.tsx +8 -1
- package/src/components/ui/query-bar.tsx +8 -1
- package/src/components/ui/ratio-bar.tsx +84 -0
- package/src/components/ui/toggle.tsx +3 -1
- package/src/components/use-scrollbox-layout.ts +17 -0
- package/src/core/state/app/layout.ts +35 -1
- package/src/core/state/app/state.ts +15 -0
- package/src/core/state/app/types.ts +1 -0
- package/src/data/config/store/normalize.ts +24 -0
- package/src/i18n/es.ts +2 -0
- package/src/i18n/ja.ts +2 -0
- package/src/i18n/ko.ts +2 -0
- package/src/i18n/zh-cn.ts +2 -0
- package/src/i18n/zh-tw.ts +2 -0
- package/src/layout-marketplace/pane-imagery.ts +1 -0
- package/src/market-data/coordinator/entries.ts +13 -0
- package/src/market-data/coordinator/financials.ts +33 -8
- package/src/market-data/market/freshness.ts +16 -5
- package/src/market-data/market/trading-sessions.ts +65 -1
- package/src/market-data/published-cn-sessions.ts +25 -0
- package/src/market-data/published-nse-sessions.ts +20 -0
- package/src/news/aggregator.ts +4 -0
- package/src/plugins/builtin/account-management/model.ts +6 -1
- package/src/plugins/builtin/account-management/pane.tsx +36 -25
- package/src/plugins/builtin/alerts/catalysts.ts +77 -0
- package/src/plugins/builtin/alerts/events-pane.tsx +3 -0
- package/src/plugins/builtin/alerts/events.ts +10 -4
- package/src/plugins/builtin/alerts/history-pane.tsx +1 -1
- package/src/plugins/builtin/alerts/history.ts +1 -0
- package/src/plugins/builtin/alerts/index.tsx +6 -0
- package/src/plugins/builtin/alerts/research-builder.ts +10 -3
- package/src/plugins/builtin/alerts/research-rules.ts +15 -1
- package/src/plugins/builtin/analytics/risk-client.ts +15 -3
- package/src/plugins/builtin/analytics/risk-headless.ts +123 -18
- package/src/plugins/builtin/attention/client.ts +80 -0
- package/src/plugins/builtin/attention/evidence.ts +30 -0
- package/src/plugins/builtin/attention/headless.ts +33 -0
- package/src/plugins/builtin/attention/index.tsx +18 -0
- package/src/plugins/builtin/attention/model.ts +59 -0
- package/src/plugins/builtin/attention/pane.tsx +211 -0
- package/src/plugins/builtin/attention/trending.tsx +59 -0
- package/src/plugins/builtin/awards/alerts.ts +32 -0
- package/src/plugins/builtin/awards/client.ts +82 -0
- package/src/plugins/builtin/awards/detail.tsx +107 -0
- package/src/plugins/builtin/awards/evidence.ts +36 -0
- package/src/plugins/builtin/awards/headless.ts +55 -0
- package/src/plugins/builtin/awards/index.tsx +20 -0
- package/src/plugins/builtin/awards/model.ts +42 -0
- package/src/plugins/builtin/awards/pane.tsx +263 -0
- package/src/plugins/builtin/catalysts/client.ts +28 -0
- package/src/plugins/builtin/catalysts/detail.tsx +88 -0
- package/src/plugins/builtin/catalysts/evidence.ts +47 -0
- package/src/plugins/builtin/catalysts/headless.ts +42 -0
- package/src/plugins/builtin/catalysts/history.ts +26 -0
- package/src/plugins/builtin/catalysts/index.tsx +29 -0
- package/src/plugins/builtin/catalysts/model.ts +135 -0
- package/src/plugins/builtin/catalysts/pane.tsx +159 -0
- package/src/plugins/builtin/chart-composer/cli-options.ts +4 -0
- package/src/plugins/builtin/chart-composer/headless-schema.ts +6 -0
- package/src/plugins/builtin/chart-composer/index.tsx +8 -1
- package/src/plugins/builtin/chart-composer/pane.tsx +28 -1
- package/src/plugins/builtin/chat/attachments/desktop.tsx +610 -0
- package/src/plugins/builtin/chat/attachments/files.ts +45 -0
- package/src/plugins/builtin/chat/attachments/model.ts +164 -0
- package/src/plugins/builtin/chat/attachments/terminal.tsx +72 -0
- package/src/plugins/builtin/chat/attachments/transfer.ts +165 -0
- package/src/plugins/builtin/chat/content/channel-navigation.ts +13 -12
- package/src/plugins/builtin/chat/content/composer-runtime.ts +25 -4
- package/src/plugins/builtin/chat/content/composer.tsx +46 -4
- package/src/plugins/builtin/chat/content/footer.tsx +46 -8
- package/src/plugins/builtin/chat/content/index.tsx +263 -62
- package/src/plugins/builtin/chat/content/layout-metrics.ts +10 -2
- package/src/plugins/builtin/chat/content/open-targets.ts +17 -3
- package/src/plugins/builtin/chat/content/scroll.ts +7 -1
- package/src/plugins/builtin/chat/content/shortcuts.ts +36 -11
- package/src/plugins/builtin/chat/content/snapshot.ts +3 -0
- package/src/plugins/builtin/chat/content/transcript.tsx +17 -1
- package/src/plugins/builtin/chat/content/types.ts +7 -0
- package/src/plugins/builtin/chat/controller/attachments.ts +213 -0
- package/src/plugins/builtin/chat/controller/connections.ts +3 -1
- package/src/plugins/builtin/chat/controller/index.ts +114 -2
- package/src/plugins/builtin/chat/controller/lifecycle.ts +9 -0
- package/src/plugins/builtin/chat/controller/messages.ts +35 -2
- package/src/plugins/builtin/chat/controller/send.ts +128 -25
- package/src/plugins/builtin/chat/controller/state.ts +12 -1
- package/src/plugins/builtin/chat/controller/utils.ts +7 -5
- package/src/plugins/builtin/chat/controller/view.ts +2 -0
- package/src/plugins/builtin/chat/index.tsx +21 -0
- package/src/plugins/builtin/chat/layout.ts +9 -4
- package/src/plugins/builtin/chat/message/desktop.tsx +55 -20
- package/src/plugins/builtin/chat/message/header.tsx +30 -5
- package/src/plugins/builtin/chat/message/inline-tokens.tsx +9 -0
- package/src/plugins/builtin/chat/message/pending-send.ts +35 -0
- package/src/plugins/builtin/chat/message/profile-popover.tsx +5 -1
- package/src/plugins/builtin/chat/message/render-state.ts +12 -2
- package/src/plugins/builtin/chat/message/terminal.tsx +51 -4
- package/src/plugins/builtin/chat/message/types.ts +6 -1
- package/src/plugins/builtin/chat/pane-state.ts +59 -1
- package/src/plugins/builtin/chat/profile-popover.ts +50 -1
- package/src/plugins/builtin/chat/sidebar.tsx +8 -3
- package/src/plugins/builtin/chat/status-widget.tsx +29 -12
- package/src/plugins/builtin/chat/unread-inbox-pane.tsx +143 -0
- package/src/plugins/builtin/chat/unread-inbox.ts +91 -0
- package/src/plugins/builtin/clinical-trials/client.ts +237 -0
- package/src/plugins/builtin/clinical-trials/index.tsx +74 -0
- package/src/plugins/builtin/clinical-trials/pane.tsx +225 -0
- package/src/plugins/builtin/clinical-trials/types.ts +2 -0
- package/src/plugins/builtin/cloud/askg/controller.ts +37 -6
- package/src/plugins/builtin/cloud/askg/executor.ts +59 -44
- package/src/plugins/builtin/cloud/askg/host.ts +8 -1
- package/src/plugins/builtin/cloud/askg/manifest.ts +29 -2
- package/src/plugins/builtin/cloud/askg/model.ts +47 -13
- package/src/plugins/builtin/cloud/askg/notes.ts +100 -0
- package/src/plugins/builtin/cloud/askg/pane.tsx +50 -14
- package/src/plugins/builtin/cloud/askg/protocol.ts +39 -1
- package/src/plugins/builtin/cloud/askg/result-budget.ts +156 -0
- package/src/plugins/builtin/cloud/askg/user-data.ts +89 -0
- package/src/plugins/builtin/cloud/auth-actions.tsx +55 -31
- package/src/plugins/builtin/cloud/plugin.tsx +4 -1
- package/src/plugins/builtin/cloud/team/pane-sections.tsx +10 -1
- package/src/plugins/builtin/cloud/team/pane.tsx +3 -2
- package/src/plugins/builtin/cloud/thesis/board-pane.tsx +2 -2
- package/src/plugins/builtin/cloud/thesis/detail.tsx +1 -1
- package/src/plugins/builtin/cloud/thesis/ticker-tab.tsx +2 -2
- package/src/plugins/builtin/cloud/trial-offer-status-widget.tsx +202 -0
- package/src/plugins/builtin/cloud/upgrade-command.ts +1 -1
- package/src/plugins/builtin/cloud/upgrade-dialog.tsx +29 -3
- package/src/plugins/builtin/cloud/upgrade-status-widget.tsx +1 -1
- package/src/plugins/builtin/cloud-tweets/table.tsx +1 -1
- package/src/plugins/builtin/comment-letters/client.ts +342 -0
- package/src/plugins/builtin/comment-letters/index.tsx +74 -0
- package/src/plugins/builtin/comment-letters/pane.tsx +295 -0
- package/src/plugins/builtin/comment-letters/types.ts +43 -0
- package/src/plugins/builtin/company-attention/app-rank.tsx +79 -0
- package/src/plugins/builtin/company-attention/client.ts +69 -0
- package/src/plugins/builtin/company-attention/evidence.ts +45 -0
- package/src/plugins/builtin/company-attention/headless.ts +47 -0
- package/src/plugins/builtin/company-attention/index.tsx +30 -0
- package/src/plugins/builtin/company-attention/model.ts +129 -0
- package/src/plugins/builtin/company-attention/pane.tsx +183 -0
- package/src/plugins/builtin/company-kpis/client.ts +92 -0
- package/src/plugins/builtin/company-kpis/headless.ts +32 -0
- package/src/plugins/builtin/company-kpis/index.tsx +26 -0
- package/src/plugins/builtin/company-kpis/model.ts +124 -0
- package/src/plugins/builtin/company-kpis/pane.tsx +226 -0
- package/src/plugins/builtin/company-kpis/related.ts +11 -0
- package/src/plugins/builtin/company-kpis/screenshot-evidence.ts +44 -0
- package/src/plugins/builtin/composite-plugins.ts +34 -0
- package/src/plugins/builtin/correlation/history.ts +4 -1
- package/src/plugins/builtin/correlation/index.tsx +139 -80
- package/src/plugins/builtin/correlation/matrix/pair-chart.tsx +48 -0
- package/src/plugins/builtin/correlation/matrix/selection.ts +77 -0
- package/src/plugins/builtin/correlation/relationship/model.ts +2 -2
- package/src/plugins/builtin/cpi/client.ts +66 -0
- package/src/plugins/builtin/cpi/headless.ts +78 -0
- package/src/plugins/builtin/cpi/index.tsx +31 -0
- package/src/plugins/builtin/cpi/model.ts +198 -0
- package/src/plugins/builtin/cpi/pane.tsx +157 -0
- package/src/plugins/builtin/credit-documents/client.ts +99 -0
- package/src/plugins/builtin/credit-documents/detail.tsx +109 -0
- package/src/plugins/builtin/credit-documents/evidence.ts +64 -0
- package/src/plugins/builtin/credit-documents/gauge.tsx +55 -0
- package/src/plugins/builtin/credit-documents/headless.ts +40 -0
- package/src/plugins/builtin/credit-documents/index.tsx +19 -0
- package/src/plugins/builtin/credit-documents/model.ts +336 -0
- package/src/plugins/builtin/credit-documents/pane.tsx +185 -0
- package/src/plugins/builtin/custom-view/view-spec.ts +14 -2
- package/src/plugins/builtin/debt-maturities/pane.tsx +1 -0
- package/src/plugins/builtin/dividend-yield/pane.tsx +1 -1
- package/src/plugins/builtin/doe/client.ts +73 -0
- package/src/plugins/builtin/doe/headless.ts +93 -0
- package/src/plugins/builtin/doe/index.tsx +41 -0
- package/src/plugins/builtin/doe/model.ts +215 -0
- package/src/plugins/builtin/doe/pane.tsx +148 -0
- package/src/plugins/builtin/doe/range-bar.tsx +45 -0
- package/src/plugins/builtin/earnings/board.tsx +3 -0
- package/src/plugins/builtin/earnings/index.tsx +2 -0
- package/src/plugins/builtin/earnings-calls/pane.tsx +7 -1
- package/src/plugins/builtin/earnings-calls/transcript-view.tsx +7 -7
- package/src/plugins/builtin/earnings-ripple/client.ts +60 -0
- package/src/plugins/builtin/earnings-ripple/headless.ts +35 -0
- package/src/plugins/builtin/earnings-ripple/index.tsx +35 -0
- package/src/plugins/builtin/earnings-ripple/model.ts +98 -0
- package/src/plugins/builtin/earnings-ripple/pane.tsx +103 -0
- package/src/plugins/builtin/equity-screener/client.ts +1 -1
- package/src/plugins/builtin/equity-screener/criterion-editor.tsx +1 -1
- package/src/plugins/builtin/equity-screener/model.ts +74 -9
- package/src/plugins/builtin/equity-screener/pane.tsx +2 -0
- package/src/plugins/builtin/estimate-revisions/pane.tsx +3 -0
- package/src/plugins/builtin/executives/pane.tsx +7 -5
- package/src/plugins/builtin/exposure/charts.tsx +66 -0
- package/src/plugins/builtin/exposure/client.ts +53 -0
- package/src/plugins/builtin/exposure/drivers.ts +29 -0
- package/src/plugins/builtin/exposure/editor.tsx +61 -0
- package/src/plugins/builtin/exposure/evidence.ts +39 -0
- package/src/plugins/builtin/exposure/headless.ts +51 -0
- package/src/plugins/builtin/exposure/holdings.ts +56 -0
- package/src/plugins/builtin/exposure/index.tsx +13 -0
- package/src/plugins/builtin/exposure/model.ts +104 -0
- package/src/plugins/builtin/exposure/pane.tsx +247 -0
- package/src/plugins/builtin/fear-greed/charts.tsx +1 -1
- package/src/plugins/builtin/fear-greed/pane.tsx +2 -9
- package/src/plugins/builtin/filing-events/pane.tsx +2 -1
- package/src/plugins/builtin/gpu/board.tsx +163 -0
- package/src/plugins/builtin/gpu/changes.tsx +94 -0
- package/src/plugins/builtin/gpu/client.ts +130 -0
- package/src/plugins/builtin/gpu/equities.tsx +112 -0
- package/src/plugins/builtin/gpu/headless.ts +67 -0
- package/src/plugins/builtin/gpu/history.tsx +140 -0
- package/src/plugins/builtin/gpu/index.tsx +18 -0
- package/src/plugins/builtin/gpu/ladder.tsx +127 -0
- package/src/plugins/builtin/gpu/model.ts +317 -0
- package/src/plugins/builtin/gpu/pane.tsx +63 -0
- package/src/plugins/builtin/help/index.tsx +19 -2
- package/src/plugins/builtin/holders/pane.tsx +5 -9
- package/src/plugins/builtin/insider/detail.tsx +119 -0
- package/src/plugins/builtin/insider/display.ts +221 -0
- package/src/plugins/builtin/insider/headless.ts +24 -3
- package/src/plugins/builtin/insider/index.tsx +206 -108
- package/src/plugins/builtin/insider/insider-data.ts +31 -3
- package/src/plugins/builtin/insider/model.ts +53 -4
- package/src/plugins/builtin/insider/table-model.ts +226 -0
- package/src/plugins/builtin/insider/table.tsx +79 -0
- package/src/plugins/builtin/iv-history/screen-pane.tsx +1 -1
- package/src/plugins/builtin/jobs/pane.tsx +14 -7
- package/src/plugins/builtin/kelly-sizer/pane.tsx +1 -1
- package/src/plugins/builtin/macro-day/client.ts +50 -0
- package/src/plugins/builtin/macro-day/headless.ts +51 -0
- package/src/plugins/builtin/macro-day/index.tsx +21 -0
- package/src/plugins/builtin/macro-day/model.ts +137 -0
- package/src/plugins/builtin/macro-day/pane.tsx +118 -0
- package/src/plugins/builtin/macro-day/releases.ts +58 -0
- package/src/plugins/builtin/market-halts/model.ts +30 -17
- package/src/plugins/builtin/market-halts/pane.tsx +15 -21
- package/src/plugins/builtin/market-heatmap/data.ts +1 -1
- package/src/plugins/builtin/market-heatmap/index.tsx +198 -50
- package/src/plugins/builtin/market-heatmap/portfolio.ts +220 -0
- package/src/plugins/builtin/market-movers/index.tsx +1 -0
- package/src/plugins/builtin/market-movers/session-body.tsx +5 -2
- package/src/plugins/builtin/mna/distress/client.ts +326 -0
- package/src/plugins/builtin/mna/distress/detail.tsx +247 -0
- package/src/plugins/builtin/mna/distress/headless.ts +257 -0
- package/src/plugins/builtin/mna/distress/model.ts +427 -0
- package/src/plugins/builtin/mna/distress/pane.tsx +606 -0
- package/src/plugins/builtin/mna/index.tsx +15 -0
- package/src/plugins/builtin/mna/pane.tsx +42 -1
- package/src/plugins/builtin/news/index.tsx +62 -16
- package/src/plugins/builtin/news/wire/filter-articles.ts +54 -0
- package/src/plugins/builtin/news/wire/index.tsx +37 -3
- package/src/plugins/builtin/news/wire/industry-pane.tsx +29 -13
- package/src/plugins/builtin/news/wire/mutes.ts +253 -0
- package/src/plugins/builtin/news/wire/news/command-bar-search.ts +117 -0
- package/src/plugins/builtin/news/wire/news/footer.ts +4 -0
- package/src/plugins/builtin/news/wire/news/list-search.ts +34 -0
- package/src/plugins/builtin/news/wire/news/pop-out.tsx +158 -0
- package/src/plugins/builtin/news/wire/news/preset-pane.tsx +64 -19
- package/src/plugins/builtin/openfda/client.ts +300 -0
- package/src/plugins/builtin/openfda/index.tsx +71 -0
- package/src/plugins/builtin/openfda/pane.tsx +382 -0
- package/src/plugins/builtin/openfda/types.ts +76 -0
- package/src/plugins/builtin/options/footer.ts +1 -0
- package/src/plugins/builtin/options/view.tsx +1 -1
- package/src/plugins/builtin/options-calculator/pane.tsx +0 -1
- package/src/plugins/builtin/options-positioning/index.tsx +4 -2
- package/src/plugins/builtin/options-positioning/pane.tsx +1 -1
- package/src/plugins/builtin/pe-band/client.ts +61 -0
- package/src/plugins/builtin/pe-band/headless.ts +51 -0
- package/src/plugins/builtin/pe-band/index.tsx +20 -0
- package/src/plugins/builtin/pe-band/model.ts +267 -0
- package/src/plugins/builtin/pe-band/pane.tsx +159 -0
- package/src/plugins/builtin/perps/client.ts +66 -0
- package/src/plugins/builtin/perps/equity-row.tsx +28 -0
- package/src/plugins/builtin/perps/headless.ts +34 -0
- package/src/plugins/builtin/perps/index.tsx +14 -0
- package/src/plugins/builtin/perps/model.ts +58 -0
- package/src/plugins/builtin/perps/pane.tsx +185 -0
- package/src/plugins/builtin/plugin-marketplace/pane.tsx +0 -1
- package/src/plugins/builtin/portfolio-list/cli/render.ts +177 -87
- package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +6 -20
- package/src/plugins/builtin/portfolio-list/command-bar.ts +6 -2
- package/src/plugins/builtin/portfolio-list/headless.ts +237 -0
- package/src/plugins/builtin/portfolio-list/index.tsx +2 -0
- package/src/plugins/builtin/portfolio-list/mutations.ts +70 -1
- package/src/plugins/builtin/portfolio-list/pane/data.ts +17 -0
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +88 -5
- package/src/plugins/builtin/portfolio-list/pane/remove-ticker.ts +85 -0
- package/src/plugins/builtin/portfolio-list/pane/streaming.ts +18 -12
- package/src/plugins/builtin/portfolio-list/quick-add/index.tsx +6 -0
- package/src/plugins/builtin/power/client.ts +100 -0
- package/src/plugins/builtin/power/detail.tsx +82 -0
- package/src/plugins/builtin/power/evidence.ts +56 -0
- package/src/plugins/builtin/power/generation.tsx +37 -0
- package/src/plugins/builtin/power/headless.ts +43 -0
- package/src/plugins/builtin/power/index.tsx +16 -0
- package/src/plugins/builtin/power/model.ts +89 -0
- package/src/plugins/builtin/power/pane.tsx +209 -0
- package/src/plugins/builtin/power/query.ts +25 -0
- package/src/plugins/builtin/relative-rotation/pane.tsx +3 -3
- package/src/plugins/builtin/research/analyst-pane.tsx +1 -1
- package/src/plugins/builtin/research/corporate-actions-pane.tsx +13 -4
- package/src/plugins/builtin/research/equity-diagnostic-pane.tsx +11 -9
- package/src/plugins/builtin/research-search/pane.tsx +21 -7
- package/src/plugins/builtin/revenue-breakdown/pane.tsx +1 -1
- package/src/plugins/builtin/reverse-dcf/client.ts +35 -0
- package/src/plugins/builtin/reverse-dcf/headless.ts +44 -0
- package/src/plugins/builtin/reverse-dcf/index.tsx +20 -0
- package/src/plugins/builtin/reverse-dcf/model.ts +87 -0
- package/src/plugins/builtin/reverse-dcf/pane.tsx +107 -0
- package/src/plugins/builtin/risk-factors/pane.tsx +6 -5
- package/src/plugins/builtin/scanner/denied.tsx +4 -2
- package/src/plugins/builtin/scanner/feed.ts +1 -0
- package/src/plugins/builtin/scanner/flow-pane.tsx +3 -2
- package/src/plugins/builtin/scanner/hilo-pane.tsx +1 -1
- package/src/plugins/builtin/seasonality/client.ts +4 -1
- package/src/plugins/builtin/sec/command-bar-search.ts +217 -0
- package/src/plugins/builtin/sec/forms.ts +54 -0
- package/src/plugins/builtin/sec/headless.ts +31 -5
- package/src/plugins/builtin/sec/index.tsx +67 -11
- package/src/plugins/builtin/sec/model.ts +35 -5
- package/src/plugins/builtin/sectors/headless.ts +1 -0
- package/src/plugins/builtin/sectors/index.tsx +72 -26
- package/src/plugins/builtin/shared/cloud-upgrade.ts +143 -39
- package/src/plugins/builtin/shared/pro-feature-wall.tsx +8 -4
- package/src/plugins/builtin/shared/research-cells.tsx +107 -0
- package/src/plugins/builtin/shared/series-list-detail.tsx +5 -1
- package/src/plugins/builtin/shared/ticker-request.ts +1 -1
- package/src/plugins/builtin/shared/wall-teaser-catalog.ts +80 -0
- package/src/plugins/builtin/shared/wall-teaser.tsx +192 -0
- package/src/plugins/builtin/shared/wall-view-lifecycle.ts +43 -0
- package/src/plugins/builtin/short-interest/index.tsx +31 -0
- package/src/plugins/builtin/short-interest/watch-client.ts +70 -0
- package/src/plugins/builtin/short-interest/watch-headless.ts +49 -0
- package/src/plugins/builtin/short-interest/watch-model.ts +185 -0
- package/src/plugins/builtin/short-interest/watch-pane.tsx +169 -0
- package/src/plugins/builtin/short-volume/pane.tsx +1 -1
- package/src/plugins/builtin/social-mentions/pane.tsx +1 -1
- package/src/plugins/builtin/supply-chain/client.ts +104 -0
- package/src/plugins/builtin/supply-chain/disclosure-quote.tsx +17 -0
- package/src/plugins/builtin/supply-chain/evidence.ts +88 -0
- package/src/plugins/builtin/supply-chain/flow-layout.ts +133 -0
- package/src/plugins/builtin/supply-chain/flow.tsx +323 -0
- package/src/plugins/builtin/supply-chain/graph-client.ts +83 -0
- package/src/plugins/builtin/supply-chain/graph-evidence.ts +25 -0
- package/src/plugins/builtin/supply-chain/graph-model.ts +45 -0
- package/src/plugins/builtin/supply-chain/graph-pane.tsx +218 -0
- package/src/plugins/builtin/supply-chain/graph.tsx +163 -0
- package/src/plugins/builtin/supply-chain/headless.ts +105 -0
- package/src/plugins/builtin/supply-chain/index.tsx +17 -0
- package/src/plugins/builtin/supply-chain/model.ts +145 -0
- package/src/plugins/builtin/supply-chain/pane.tsx +276 -0
- package/src/plugins/builtin/supply-chain/row-evidence.tsx +96 -0
- package/src/plugins/builtin/supply-chain/trust.ts +34 -0
- package/src/plugins/builtin/themes/client.ts +39 -0
- package/src/plugins/builtin/themes/headless.ts +38 -0
- package/src/plugins/builtin/themes/model.ts +92 -0
- package/src/plugins/builtin/themes/pane.tsx +125 -0
- package/src/plugins/builtin/thirteenf/pane.tsx +6 -15
- package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +5 -6
- package/src/plugins/builtin/ticker-detail/data-panes/returns-model.ts +201 -0
- package/src/plugins/builtin/ticker-detail/data-panes/returns-pane.tsx +327 -0
- package/src/plugins/builtin/ticker-detail/financials/period-end-history.ts +5 -2
- package/src/plugins/builtin/ticker-detail/financials/ratios.ts +60 -12
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +2 -1
- package/src/plugins/builtin/ticker-detail/headless.ts +7 -2
- package/src/plugins/builtin/ticker-detail/index.tsx +22 -0
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +53 -30
- package/src/plugins/builtin/ticker-detail/overview/pane.tsx +2 -0
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +112 -47
- package/src/plugins/builtin/ticker-detail/pane.tsx +50 -6
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +21 -42
- package/src/plugins/builtin/ticker-detail/quote-monitor/index.tsx +3 -0
- package/src/plugins/builtin/time-sales/pane.tsx +1 -1
- package/src/plugins/builtin/world-indices/indices.ts +1 -0
- package/src/plugins/catalog-browser.ts +40 -0
- package/src/plugins/catalog-manifest.ts +3 -0
- package/src/plugins/catalog-ui.ts +6 -0
- package/src/plugins/current-target.ts +0 -9
- package/src/public/__snapshots__/public-api.test.ts.snap +1 -0
- package/src/renderers/browser/cloud-transport.ts +66 -1
- package/src/renderers/browser/main.tsx +2 -0
- package/src/renderers/dom/data-table/row.tsx +2 -0
- package/src/renderers/dom/desktop/controls.tsx +38 -25
- package/src/renderers/dom/desktop/icons.tsx +8 -0
- package/src/renderers/dom/host/chart-surface.tsx +36 -2
- package/src/renderers/dom/host/focus-scope.ts +11 -1
- package/src/renderers/dom/styles.css +28 -0
- package/src/renderers/electrobun/view/backend-rpc.ts +3 -2
- package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +1 -1
- package/src/renderers/electrobun/view/http-fetch.ts +2 -0
- package/src/renderers/electrobun/view/main.tsx +3 -1
- package/src/renderers/electrobun/view/rpc-timeout.ts +59 -0
- package/src/renderers/opentui/start.tsx +3 -0
- package/src/shares/api.ts +3 -1
- package/src/sources/gloomberb-cloud/index.ts +47 -13
- package/src/sources/history-result.ts +1 -0
- package/src/sources/history-retention.ts +16 -0
- package/src/sources/provider-router/history.ts +4 -2
- package/src/sources/sec-edgar/identity.ts +36 -0
- package/src/sources/sec-edgar.ts +1 -34
- package/src/state/app/context/index.tsx +8 -0
- package/src/sync/core-contributors.ts +20 -2
- package/src/telemetry/attention-counts.ts +164 -0
- package/src/telemetry/live-config.ts +7 -0
- package/src/test-support/rpc-loopback.ts +7 -3
- package/src/test-support/shell-pane-keys.tsx +34 -0
- package/src/tickers/instrument-kind.ts +12 -6
- package/src/tickers/open-target.ts +1 -1
- package/src/tickers/search/asset-classes.ts +91 -0
- package/src/tickers/search/index.ts +62 -15
- package/src/tickers/search/ranking.ts +22 -3
- package/src/tickers/search/upsert.ts +4 -1
- package/src/time-series/live-bars.ts +8 -3
- package/src/time-series/resolve.ts +224 -17
- package/src/time-series/spec.ts +1 -0
- package/src/time-series/types.ts +9 -1
- package/src/types/config.ts +23 -1
- package/src/types/data-provider.ts +2 -0
- package/src/types/headless.ts +17 -0
- package/src/types/price-history.ts +2 -0
- package/src/ui/host.tsx +6 -0
- package/src/utils/double-escape-close.ts +20 -0
- package/src/utils/exchanges.ts +1 -0
- package/src/utils/html-entities.ts +15 -0
- package/src/utils/http-proxy-response.ts +44 -7
- package/src/utils/plugin-proxy-hosts.json +3 -0
- package/src/utils/price-history.ts +35 -1
- package/src/utils/sec.ts +21 -2
- package/src/utils/text-wrap.ts +13 -8
- package/src/utils/zoned-date-time.ts +67 -0
|
@@ -39,6 +39,9 @@ interface RenderCompositePanelBitmapOptions {
|
|
|
39
39
|
const LAST_PRICE_DASH_PIXELS = 6;
|
|
40
40
|
const LAST_PRICE_GAP_PIXELS = 5;
|
|
41
41
|
const LAST_PRICE_OPACITY = 0.9;
|
|
42
|
+
const PRIOR_CLOSE_DOT_PIXELS = 2;
|
|
43
|
+
const PRIOR_CLOSE_GAP_PIXELS = 3;
|
|
44
|
+
const PRIOR_CLOSE_OPACITY = 0.7;
|
|
42
45
|
|
|
43
46
|
function pixelPoint(point: CompositeProjectedPoint, width: number, height: number): { x: number; y: number } {
|
|
44
47
|
return {
|
|
@@ -118,6 +121,53 @@ function fillAreaGradient(
|
|
|
118
121
|
}
|
|
119
122
|
}
|
|
120
123
|
|
|
124
|
+
const BAND_FILL_OPACITY = 0.2;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* The range a band series spans, one flat fill per pixel column between its
|
|
128
|
+
* points' `low` and `high`, read straight across between neighbouring points.
|
|
129
|
+
*/
|
|
130
|
+
function fillBand(
|
|
131
|
+
data: Uint8Array,
|
|
132
|
+
width: number,
|
|
133
|
+
height: number,
|
|
134
|
+
series: CompositeProjectedSeries,
|
|
135
|
+
domain: CompositeAxisDomain,
|
|
136
|
+
color: RgbaColor,
|
|
137
|
+
): void {
|
|
138
|
+
const edges = series.points.map((projected) => {
|
|
139
|
+
const { high, low } = projected.point;
|
|
140
|
+
const x = pixelPoint(projected, width, height).x;
|
|
141
|
+
if (high == null || low == null || !Number.isFinite(high) || !Number.isFinite(low)) return null;
|
|
142
|
+
const top = pixelY(high, domain, height);
|
|
143
|
+
const bottom = pixelY(low, domain, height);
|
|
144
|
+
return top === null || bottom === null ? null : { x, top: Math.min(top, bottom), bottom: Math.max(top, bottom) };
|
|
145
|
+
});
|
|
146
|
+
const filled = new Uint8Array(width);
|
|
147
|
+
const fillColumn = (x: number, top: number, bottom: number) => {
|
|
148
|
+
if (x < 0 || x >= width || filled[x]) return;
|
|
149
|
+
filled[x] = 1;
|
|
150
|
+
for (let y = Math.max(0, Math.round(top)); y <= Math.min(height - 1, Math.round(bottom)); y += 1) {
|
|
151
|
+
blendPixel(data, width, height, x, y, color, BAND_FILL_OPACITY);
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
for (let index = 0; index < edges.length; index += 1) {
|
|
155
|
+
const current = edges[index];
|
|
156
|
+
if (!current) continue;
|
|
157
|
+
const previous = index > 0 && !series.points[index]?.breakBefore ? edges[index - 1] : null;
|
|
158
|
+
if (!previous) {
|
|
159
|
+
fillColumn(Math.round(current.x), current.top, current.bottom);
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
const start = Math.round(previous.x);
|
|
163
|
+
const span = Math.max(1, Math.round(current.x) - start);
|
|
164
|
+
for (let x = start; x <= start + span; x += 1) {
|
|
165
|
+
const t = (x - start) / span;
|
|
166
|
+
fillColumn(x, previous.top + (current.top - previous.top) * t, previous.bottom + (current.bottom - previous.bottom) * t);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
121
171
|
function drawConnectedSeries(
|
|
122
172
|
data: Uint8Array,
|
|
123
173
|
width: number,
|
|
@@ -343,27 +393,19 @@ function drawOhlc(
|
|
|
343
393
|
}
|
|
344
394
|
}
|
|
345
395
|
|
|
346
|
-
function
|
|
396
|
+
function drawDashedLevel(
|
|
347
397
|
data: Uint8Array,
|
|
348
398
|
width: number,
|
|
349
399
|
height: number,
|
|
350
400
|
yRatio: number,
|
|
351
401
|
color: RgbaColor,
|
|
402
|
+
dash = LAST_PRICE_DASH_PIXELS,
|
|
403
|
+
gap = LAST_PRICE_GAP_PIXELS,
|
|
404
|
+
opacity = LAST_PRICE_OPACITY,
|
|
352
405
|
): void {
|
|
353
406
|
const y = Math.round(clamp(yRatio * Math.max(height - 1, 0), 0, Math.max(height - 1, 0)));
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
fillRect(
|
|
357
|
-
data,
|
|
358
|
-
width,
|
|
359
|
-
height,
|
|
360
|
-
x,
|
|
361
|
-
y,
|
|
362
|
-
Math.min(x + LAST_PRICE_DASH_PIXELS - 1, width - 1),
|
|
363
|
-
y,
|
|
364
|
-
color,
|
|
365
|
-
LAST_PRICE_OPACITY,
|
|
366
|
-
);
|
|
407
|
+
for (let x = 0; x < width; x += dash + gap) {
|
|
408
|
+
fillRect(data, width, height, x, y, Math.min(x + dash - 1, width - 1), y, color, opacity);
|
|
367
409
|
}
|
|
368
410
|
}
|
|
369
411
|
|
|
@@ -388,9 +430,14 @@ export function renderCompositePanelBitmap(
|
|
|
388
430
|
fillRect(data, width, height, 0, y, width - 1, y + 0.6, grid, 0.42);
|
|
389
431
|
}
|
|
390
432
|
if (panel.volumeProfile) paintVolumeProfile(data, width, height, panel.volumeProfile);
|
|
433
|
+
// Under the bars, which read across it.
|
|
434
|
+
if (panel.priorClose) {
|
|
435
|
+
drawDashedLevel(data, width, height, panel.priorClose.yRatio, parseHex(options.colors.textDim),
|
|
436
|
+
PRIOR_CLOSE_DOT_PIXELS, PRIOR_CLOSE_GAP_PIXELS, PRIOR_CLOSE_OPACITY);
|
|
437
|
+
}
|
|
391
438
|
|
|
392
439
|
const ordered = [...panel.series].sort((left, right) => {
|
|
393
|
-
const rank = (style: string) => style === "area" || style === "columns" ? 0 : 1;
|
|
440
|
+
const rank = (style: string) => style === "area" || style === "columns" || style === "band" ? 0 : 1;
|
|
394
441
|
return rank(left.source.style) - rank(right.source.style);
|
|
395
442
|
});
|
|
396
443
|
const columnLayout = buildCompositeColumnLayout(panel);
|
|
@@ -430,6 +477,10 @@ export function renderCompositePanelBitmap(
|
|
|
430
477
|
case "area":
|
|
431
478
|
drawConnectedSeries(data, width, height, series, domain, color, true);
|
|
432
479
|
break;
|
|
480
|
+
case "band":
|
|
481
|
+
fillBand(data, width, height, series, domain, color);
|
|
482
|
+
drawConnectedSeries(data, width, height, series, domain, color, false);
|
|
483
|
+
break;
|
|
433
484
|
case "points":
|
|
434
485
|
for (const point of series.points) {
|
|
435
486
|
const projected = pixelPoint(point, width, height);
|
|
@@ -449,7 +500,7 @@ export function renderCompositePanelBitmap(
|
|
|
449
500
|
}
|
|
450
501
|
|
|
451
502
|
if (panel.lastPrice) {
|
|
452
|
-
|
|
503
|
+
drawDashedLevel(data, width, height, panel.lastPrice.yRatio, parseHex(panel.lastPrice.color));
|
|
453
504
|
}
|
|
454
505
|
|
|
455
506
|
return { width, height, pixels: data };
|
|
@@ -24,7 +24,8 @@ import { compositeAxisMaxTicks, seriesPriceReference } from "./format";
|
|
|
24
24
|
import type { CompositeTimeScale } from "./types";
|
|
25
25
|
import { isFiniteNumber } from "../../../utils/guards";
|
|
26
26
|
import { volumeProfile } from "../../../time-series/trader-studies";
|
|
27
|
-
import { extendedHoursSpans } from "./session-shading";
|
|
27
|
+
import { extendedHoursSpans, isIntradaySeries } from "./session-shading";
|
|
28
|
+
import { listingTimeZone } from "../../../market-data/market/trading-sessions";
|
|
28
29
|
|
|
29
30
|
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
30
31
|
|
|
@@ -247,6 +248,10 @@ function seriesDomainValues(series: ResolvedSeries): number[] {
|
|
|
247
248
|
for (const candidate of [point.open, point.high, point.low, point.close]) {
|
|
248
249
|
if (isFiniteNumber(candidate)) values.push(candidate);
|
|
249
250
|
}
|
|
251
|
+
} else if (series.style === "band") {
|
|
252
|
+
for (const candidate of [point.high, point.low]) {
|
|
253
|
+
if (isFiniteNumber(candidate)) values.push(candidate);
|
|
254
|
+
}
|
|
250
255
|
}
|
|
251
256
|
}
|
|
252
257
|
if (series.style === "columns") values.push(0);
|
|
@@ -300,6 +305,24 @@ function axisPriceReferences(axisSeries: ResolvedSeries[]): Record<string, numbe
|
|
|
300
305
|
return references;
|
|
301
306
|
}
|
|
302
307
|
|
|
308
|
+
/**
|
|
309
|
+
* A one-day chart's previous close joins the axis when it lies within one
|
|
310
|
+
* session range of the bars, so a quiet session still shows where it opened
|
|
311
|
+
* from; a far gap leaves the bars their full height.
|
|
312
|
+
*/
|
|
313
|
+
function priorCloseInReach(series: readonly ResolvedSeries[], values: readonly number[]): number[] {
|
|
314
|
+
const reference = series.find((entry) => isFiniteNumber(entry.priorClose) && entry.points.length > 0)?.priorClose;
|
|
315
|
+
if (reference === undefined || values.length === 0) return [];
|
|
316
|
+
let low = Number.POSITIVE_INFINITY;
|
|
317
|
+
let high = Number.NEGATIVE_INFINITY;
|
|
318
|
+
for (const value of values) {
|
|
319
|
+
if (value < low) low = value;
|
|
320
|
+
if (value > high) high = value;
|
|
321
|
+
}
|
|
322
|
+
const span = high - low;
|
|
323
|
+
return reference >= low - span && reference <= high + span ? [reference] : [];
|
|
324
|
+
}
|
|
325
|
+
|
|
303
326
|
function buildAxisDomain(
|
|
304
327
|
side: CompositeAxisSide,
|
|
305
328
|
series: ResolvedSeries[],
|
|
@@ -308,7 +331,8 @@ function buildAxisDomain(
|
|
|
308
331
|
): CompositeAxisDomain | undefined {
|
|
309
332
|
const axisSeries = series.filter((entry) => entry.axis === side);
|
|
310
333
|
if (axisSeries.length === 0) return undefined;
|
|
311
|
-
const
|
|
334
|
+
const values = axisSeries.flatMap(seriesDomainValues);
|
|
335
|
+
const { min, max } = paddedDomain([...values, ...priorCloseInReach(axisSeries, values)], scale);
|
|
312
336
|
const first = axisSeries[0]!;
|
|
313
337
|
return {
|
|
314
338
|
side,
|
|
@@ -496,6 +520,30 @@ function attachLastPriceMarker(
|
|
|
496
520
|
};
|
|
497
521
|
}
|
|
498
522
|
|
|
523
|
+
/** Marks the previous session's close a one-day chart carries on its price series. */
|
|
524
|
+
function attachPriorClose(panels: CompositePanelScene[], series: readonly ResolvedSeries[]): void {
|
|
525
|
+
const entry = series.find((candidate) => isFiniteNumber(candidate.priorClose));
|
|
526
|
+
const panel = entry ? panels.find((candidate) => candidate.id === entry.panelId) : undefined;
|
|
527
|
+
const domain = entry ? panel?.axes[entry.axis] : undefined;
|
|
528
|
+
if (!entry || !panel || !domain || !panel.series.some((candidate) => candidate.source.id === entry.id)) return;
|
|
529
|
+
const yRatio = projectCompositeValue(entry.priorClose!, domain);
|
|
530
|
+
// Off the axis it marks nothing; the axis follows the session's own bars.
|
|
531
|
+
if (yRatio === null || yRatio < 0 || yRatio > 1) return;
|
|
532
|
+
panel.priorClose = { axis: entry.axis, value: entry.priorClose!, yRatio };
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
* The zone intraday market bars read in: the venue's own clock, as the tape
|
|
537
|
+
* does. Daily and longer bars carry dates, which stay in UTC.
|
|
538
|
+
*/
|
|
539
|
+
function sceneTimeZone(anchor: ResolvedSeries | undefined, series: readonly ResolvedSeries[]): string | undefined {
|
|
540
|
+
const market = anchor ?? series.find((entry) => entry.observationKind === "market");
|
|
541
|
+
if (!market || !isIntradaySeries(market)) return undefined;
|
|
542
|
+
const zone = market.timeBasis?.timeZone
|
|
543
|
+
?? (market.listing ? listingTimeZone(market.listing.symbol, market.listing.exchange) : null);
|
|
544
|
+
return zone && zone !== "UTC" ? zone : undefined;
|
|
545
|
+
}
|
|
546
|
+
|
|
499
547
|
/**
|
|
500
548
|
* Profiles a volume-profile study over its bars in view and takes its points
|
|
501
549
|
* off the panel, so it draws as a histogram rather than a line or cursor dots.
|
|
@@ -754,6 +802,8 @@ export function buildCompositeChartScene(
|
|
|
754
802
|
});
|
|
755
803
|
panelScenes.forEach(attachVolumeProfile);
|
|
756
804
|
attachLastPriceMarker(panelScenes, usableSeries);
|
|
805
|
+
attachPriorClose(panelScenes, usableSeries);
|
|
806
|
+
const timeZone = sceneTimeZone(anchor, timelineSeries);
|
|
757
807
|
|
|
758
808
|
return {
|
|
759
809
|
width: Math.max(1, Math.floor(options.width)),
|
|
@@ -767,6 +817,7 @@ export function buildCompositeChartScene(
|
|
|
767
817
|
cursorDate,
|
|
768
818
|
cursorXRatio,
|
|
769
819
|
cursorValues: buildCursorValues(panelScenes, cursorDate, { startTime, endTime, timeScale }),
|
|
820
|
+
...(timeZone ? { timeZone } : {}),
|
|
770
821
|
};
|
|
771
822
|
}
|
|
772
823
|
|
|
@@ -21,7 +21,8 @@ function isRegular(exchange: string, time: number): boolean | null {
|
|
|
21
21
|
return regular;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
/** Whether a series holds intraday bars, by its cadence or its acquired resolution. */
|
|
25
|
+
export function isIntradaySeries(series: ResolvedSeries): boolean {
|
|
25
26
|
const cadence = series.timeBasis?.cadenceMs;
|
|
26
27
|
if (cadence !== undefined) return cadence < DAY_MS;
|
|
27
28
|
return !!series.historyResolution && isIntradayResolution(series.historyResolution);
|
|
@@ -39,7 +40,7 @@ export function extendedHoursSpans(
|
|
|
39
40
|
ratios: readonly number[],
|
|
40
41
|
): CompositeExtendedHoursSpan[] {
|
|
41
42
|
const exchange = anchor?.timeBasis?.exchange;
|
|
42
|
-
if (!anchor || !exchange || !
|
|
43
|
+
if (!anchor || !exchange || !isIntradaySeries(anchor) || dates.length === 0) return [];
|
|
43
44
|
const edge = (index: number, side: -1 | 1) => {
|
|
44
45
|
const ratio = ratios[index]!;
|
|
45
46
|
// At either end of the plot, mirror the gap to the bar on the other side.
|
|
@@ -113,6 +113,46 @@ function renderArea(
|
|
|
113
113
|
renderLineLike(rows, series, width, height);
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
+
/** A band's range as shade between its points' low and high rows, under its line. */
|
|
117
|
+
function renderBand(
|
|
118
|
+
rows: string[][],
|
|
119
|
+
series: CompositeProjectedSeries,
|
|
120
|
+
domain: CompositeAxisDomain,
|
|
121
|
+
width: number,
|
|
122
|
+
height: number,
|
|
123
|
+
): void {
|
|
124
|
+
const edges = series.points.map((projected) => {
|
|
125
|
+
const { high, low } = projected.point;
|
|
126
|
+
if (high == null || low == null) return null;
|
|
127
|
+
const top = valueRow(high, domain, height);
|
|
128
|
+
const bottom = valueRow(low, domain, height);
|
|
129
|
+
return top === null || bottom === null
|
|
130
|
+
? null
|
|
131
|
+
: { x: cellPoint(projected, width, height).x, top: Math.min(top, bottom), bottom: Math.max(top, bottom) };
|
|
132
|
+
});
|
|
133
|
+
const shade = (x: number, top: number, bottom: number) => {
|
|
134
|
+
for (let row = Math.round(top); row <= Math.round(bottom); row += 1) {
|
|
135
|
+
const current = rows[row]?.[x];
|
|
136
|
+
if (current === " " || current === "·") setCell(rows, x, row, "░");
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
for (let index = 0; index < edges.length; index += 1) {
|
|
140
|
+
const current = edges[index];
|
|
141
|
+
if (!current) continue;
|
|
142
|
+
const previous = index > 0 && !series.points[index]?.breakBefore ? edges[index - 1] : null;
|
|
143
|
+
if (!previous) {
|
|
144
|
+
shade(current.x, current.top, current.bottom);
|
|
145
|
+
continue;
|
|
146
|
+
}
|
|
147
|
+
const span = Math.max(1, current.x - previous.x);
|
|
148
|
+
for (let x = previous.x; x <= current.x; x += 1) {
|
|
149
|
+
const t = (x - previous.x) / span;
|
|
150
|
+
shade(x, previous.top + (current.top - previous.top) * t, previous.bottom + (current.bottom - previous.bottom) * t);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
renderLineLike(rows, series, width, height);
|
|
154
|
+
}
|
|
155
|
+
|
|
116
156
|
function renderColumns(
|
|
117
157
|
rows: string[][],
|
|
118
158
|
series: CompositeProjectedSeries,
|
|
@@ -221,7 +261,7 @@ export function renderCompositePanelText(
|
|
|
221
261
|
|
|
222
262
|
const columnLayout = buildCompositeColumnLayout(panel);
|
|
223
263
|
const orderedSeries = [...panel.series].sort((left, right) => {
|
|
224
|
-
const layerRank = (style: string) => style === "area" || style === "columns" ? 0 : 1;
|
|
264
|
+
const layerRank = (style: string) => style === "area" || style === "columns" || style === "band" ? 0 : 1;
|
|
225
265
|
return layerRank(left.source.style) - layerRank(right.source.style);
|
|
226
266
|
});
|
|
227
267
|
for (const series of orderedSeries) {
|
|
@@ -234,6 +274,9 @@ export function renderCompositePanelText(
|
|
|
234
274
|
case "area":
|
|
235
275
|
renderArea(rows, series, domain, plotWidth, height);
|
|
236
276
|
break;
|
|
277
|
+
case "band":
|
|
278
|
+
renderBand(rows, series, domain, plotWidth, height);
|
|
279
|
+
break;
|
|
237
280
|
case "candles":
|
|
238
281
|
case "ohlc":
|
|
239
282
|
case "hlc":
|
|
@@ -264,6 +307,14 @@ export function renderCompositePanelText(
|
|
|
264
307
|
if (current === " " || current === "·") setCell(rows, x, row, "╌");
|
|
265
308
|
}
|
|
266
309
|
}
|
|
310
|
+
// The previous close, dotted, where the last price has not taken the row.
|
|
311
|
+
if (panel.priorClose) {
|
|
312
|
+
const row = clamp(Math.round(panel.priorClose.yRatio * Math.max(height - 1, 0)), 0, Math.max(height - 1, 0));
|
|
313
|
+
for (let x = 0; x < plotWidth; x += 1) {
|
|
314
|
+
const current = rows[row]?.[x];
|
|
315
|
+
if (current === " " || current === "·") setCell(rows, x, row, "┈");
|
|
316
|
+
}
|
|
317
|
+
}
|
|
267
318
|
|
|
268
319
|
if (cursorXRatio !== null) {
|
|
269
320
|
const cursorX = clamp(Math.round(cursorXRatio * Math.max(plotWidth - 1, 0)), 0, Math.max(plotWidth - 1, 0));
|
|
@@ -2,6 +2,7 @@ import type { CompositeViewportRange } from "./interactions";
|
|
|
2
2
|
import { projectCompositeTimestamp } from "./time-scale";
|
|
3
3
|
import type { CompositeChartScene } from "./types";
|
|
4
4
|
import { clamp } from "../../../utils/math";
|
|
5
|
+
import { timeZoneLabel, zonedWallClockMs, zonedWallClockToUtcMs } from "../../../utils/zoned-date-time";
|
|
5
6
|
|
|
6
7
|
const MONTHS = [
|
|
7
8
|
"Jan",
|
|
@@ -63,6 +64,43 @@ export interface CompositeTimeAxisLayout {
|
|
|
63
64
|
ticks: CompositeTimeAxisTick[];
|
|
64
65
|
}
|
|
65
66
|
|
|
67
|
+
/**
|
|
68
|
+
* The clock the axis reads: wall-clock readings are timestamps whose UTC
|
|
69
|
+
* fields show the local date and time, so calendar steps and labels work the
|
|
70
|
+
* same in any zone.
|
|
71
|
+
*/
|
|
72
|
+
interface AxisClock {
|
|
73
|
+
wall(timestamp: number): number;
|
|
74
|
+
instant(wall: number): number;
|
|
75
|
+
label: string;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const UTC_CLOCK: AxisClock = { wall: (timestamp) => timestamp, instant: (wall) => wall, label: "UTC" };
|
|
79
|
+
const axisClocks = new Map<string, AxisClock>();
|
|
80
|
+
|
|
81
|
+
function axisClock(timeZone: string | undefined): AxisClock {
|
|
82
|
+
if (!timeZone || timeZone === "UTC") return UTC_CLOCK;
|
|
83
|
+
let clock = axisClocks.get(timeZone);
|
|
84
|
+
if (!clock) {
|
|
85
|
+
try {
|
|
86
|
+
zonedWallClockMs(0, timeZone);
|
|
87
|
+
} catch {
|
|
88
|
+
return UTC_CLOCK;
|
|
89
|
+
}
|
|
90
|
+
clock = {
|
|
91
|
+
wall: (timestamp) => zonedWallClockMs(timestamp, timeZone),
|
|
92
|
+
instant: (wall) => {
|
|
93
|
+
const date = new Date(wall);
|
|
94
|
+
return zonedWallClockToUtcMs(timeZone, date.getUTCFullYear(), date.getUTCMonth() + 1, date.getUTCDate(),
|
|
95
|
+
date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds());
|
|
96
|
+
},
|
|
97
|
+
label: timeZoneLabel(timeZone),
|
|
98
|
+
};
|
|
99
|
+
axisClocks.set(timeZone, clock);
|
|
100
|
+
}
|
|
101
|
+
return clock;
|
|
102
|
+
}
|
|
103
|
+
|
|
66
104
|
const TIME_AXIS_INTERVALS: readonly CompositeTimeAxisInterval[] = [
|
|
67
105
|
{ unit: "millisecond", step: 1, approximateMs: 1 },
|
|
68
106
|
{ unit: "millisecond", step: 5, approximateMs: 5 },
|
|
@@ -104,9 +142,9 @@ function validTimestamp(value: number): boolean {
|
|
|
104
142
|
return Number.isFinite(value);
|
|
105
143
|
}
|
|
106
144
|
|
|
107
|
-
function axisLabelWidth(interval: CompositeTimeAxisInterval, startTime: number, endTime: number): number {
|
|
108
|
-
const start = new Date(startTime);
|
|
109
|
-
const end = new Date(endTime);
|
|
145
|
+
function axisLabelWidth(interval: CompositeTimeAxisInterval, startTime: number, endTime: number, clock: AxisClock): number {
|
|
146
|
+
const start = new Date(clock.wall(startTime));
|
|
147
|
+
const end = new Date(clock.wall(endTime));
|
|
110
148
|
const spansDays = start.getUTCFullYear() !== end.getUTCFullYear()
|
|
111
149
|
|| start.getUTCMonth() !== end.getUTCMonth()
|
|
112
150
|
|| start.getUTCDate() !== end.getUTCDate();
|
|
@@ -134,10 +172,11 @@ function resolveTimeAxisInterval(
|
|
|
134
172
|
startTime: number,
|
|
135
173
|
endTime: number,
|
|
136
174
|
width: number,
|
|
175
|
+
clock: AxisClock,
|
|
137
176
|
): CompositeTimeAxisInterval {
|
|
138
177
|
const span = Math.max(endTime - startTime, 1);
|
|
139
178
|
for (const interval of TIME_AXIS_INTERVALS) {
|
|
140
|
-
const labelWidth = axisLabelWidth(interval, startTime, endTime);
|
|
179
|
+
const labelWidth = axisLabelWidth(interval, startTime, endTime, clock);
|
|
141
180
|
const maximumLabels = Math.max(2, Math.floor(width / (labelWidth + 2)));
|
|
142
181
|
const estimatedLabels = Math.floor(span / interval.approximateMs) + 1;
|
|
143
182
|
if (estimatedLabels <= maximumLabels) return interval;
|
|
@@ -185,10 +224,28 @@ function nextYearBoundary(startTime: number, step: number): number {
|
|
|
185
224
|
return boundary;
|
|
186
225
|
}
|
|
187
226
|
|
|
227
|
+
/** Calendar steps between two instants, taken on the axis clock. */
|
|
188
228
|
function calendarBoundaries(
|
|
189
229
|
startTime: number,
|
|
190
230
|
endTime: number,
|
|
191
231
|
interval: CompositeTimeAxisInterval,
|
|
232
|
+
clock: AxisClock,
|
|
233
|
+
): number[] {
|
|
234
|
+
const instants: number[] = [];
|
|
235
|
+
for (const wall of wallBoundaries(clock.wall(startTime), clock.wall(endTime), interval)) {
|
|
236
|
+
const instant = clock.instant(wall);
|
|
237
|
+
// A wall time skipped or repeated by a clock change lands on a neighbour.
|
|
238
|
+
if (instant > startTime && instant < endTime && instant > (instants.at(-1) ?? Number.NEGATIVE_INFINITY)) {
|
|
239
|
+
instants.push(instant);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
return instants;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
function wallBoundaries(
|
|
246
|
+
startTime: number,
|
|
247
|
+
endTime: number,
|
|
248
|
+
interval: CompositeTimeAxisInterval,
|
|
192
249
|
): number[] {
|
|
193
250
|
let boundary: number;
|
|
194
251
|
let advance: (timestamp: number) => number;
|
|
@@ -252,9 +309,11 @@ function calendarBoundaries(
|
|
|
252
309
|
}
|
|
253
310
|
|
|
254
311
|
function intervalBucketKey(
|
|
255
|
-
|
|
312
|
+
instant: number,
|
|
256
313
|
interval: CompositeTimeAxisInterval,
|
|
314
|
+
clock: AxisClock,
|
|
257
315
|
): number {
|
|
316
|
+
const timestamp = clock.wall(instant);
|
|
258
317
|
switch (interval.unit) {
|
|
259
318
|
case "millisecond":
|
|
260
319
|
return Math.floor(timestamp / interval.step);
|
|
@@ -305,7 +364,7 @@ function normalizeMarketSamples(scene: CompositeChartScene): CompositeTimeAxisSa
|
|
|
305
364
|
));
|
|
306
365
|
}
|
|
307
366
|
|
|
308
|
-
function
|
|
367
|
+
function sameWallDay(left: number, right: number): boolean {
|
|
309
368
|
const leftDate = new Date(left);
|
|
310
369
|
const rightDate = new Date(right);
|
|
311
370
|
return leftDate.getUTCFullYear() === rightDate.getUTCFullYear()
|
|
@@ -313,7 +372,7 @@ function sameUtcDay(left: number, right: number): boolean {
|
|
|
313
372
|
&& leftDate.getUTCDate() === rightDate.getUTCDate();
|
|
314
373
|
}
|
|
315
374
|
|
|
316
|
-
function
|
|
375
|
+
function sameWallMonth(left: number, right: number): boolean {
|
|
317
376
|
const leftDate = new Date(left);
|
|
318
377
|
const rightDate = new Date(right);
|
|
319
378
|
return leftDate.getUTCFullYear() === rightDate.getUTCFullYear()
|
|
@@ -338,12 +397,15 @@ function calendarLabel(timestamp: number, includeYear: boolean): string {
|
|
|
338
397
|
}
|
|
339
398
|
|
|
340
399
|
function formatBoundaryLabel(
|
|
341
|
-
|
|
342
|
-
|
|
400
|
+
instant: number,
|
|
401
|
+
counterpartInstant: number,
|
|
343
402
|
interval: CompositeTimeAxisInterval,
|
|
403
|
+
axis: AxisClock,
|
|
344
404
|
includeTimeZone = true,
|
|
345
405
|
includeBoundaryYear = true,
|
|
346
406
|
): string {
|
|
407
|
+
const timestamp = axis.wall(instant);
|
|
408
|
+
const counterpart = axis.wall(counterpartInstant);
|
|
347
409
|
const date = new Date(timestamp);
|
|
348
410
|
switch (interval.unit) {
|
|
349
411
|
case "millisecond":
|
|
@@ -351,8 +413,8 @@ function formatBoundaryLabel(
|
|
|
351
413
|
case "minute":
|
|
352
414
|
case "hour": {
|
|
353
415
|
const clock = clockLabel(timestamp, interval.unit);
|
|
354
|
-
const suffix = includeTimeZone ?
|
|
355
|
-
if (
|
|
416
|
+
const suffix = includeTimeZone ? ` ${axis.label}` : "";
|
|
417
|
+
if (sameWallDay(timestamp, counterpart)) return `${clock}${suffix}`;
|
|
356
418
|
const includeYear = includeBoundaryYear
|
|
357
419
|
&& date.getUTCFullYear() !== new Date(counterpart).getUTCFullYear();
|
|
358
420
|
return `${calendarLabel(timestamp, includeYear)} ${clock}${suffix}`;
|
|
@@ -368,10 +430,13 @@ function formatBoundaryLabel(
|
|
|
368
430
|
}
|
|
369
431
|
|
|
370
432
|
function formatInteriorLabel(
|
|
371
|
-
|
|
372
|
-
|
|
433
|
+
instant: number,
|
|
434
|
+
previousInstant: number,
|
|
373
435
|
interval: CompositeTimeAxisInterval,
|
|
436
|
+
axis: AxisClock,
|
|
374
437
|
): string {
|
|
438
|
+
const timestamp = axis.wall(instant);
|
|
439
|
+
const previousTimestamp = axis.wall(previousInstant);
|
|
375
440
|
const date = new Date(timestamp);
|
|
376
441
|
const previous = new Date(previousTimestamp);
|
|
377
442
|
switch (interval.unit) {
|
|
@@ -380,7 +445,7 @@ function formatInteriorLabel(
|
|
|
380
445
|
case "minute":
|
|
381
446
|
case "hour": {
|
|
382
447
|
const clock = clockLabel(timestamp, interval.unit);
|
|
383
|
-
if (
|
|
448
|
+
if (sameWallDay(timestamp, previousTimestamp)) return clock;
|
|
384
449
|
return `${calendarLabel(
|
|
385
450
|
timestamp,
|
|
386
451
|
date.getUTCFullYear() !== previous.getUTCFullYear(),
|
|
@@ -388,7 +453,7 @@ function formatInteriorLabel(
|
|
|
388
453
|
}
|
|
389
454
|
case "day":
|
|
390
455
|
case "week":
|
|
391
|
-
if (
|
|
456
|
+
if (sameWallMonth(timestamp, previousTimestamp)) return `${date.getUTCDate()}`;
|
|
392
457
|
return calendarLabel(
|
|
393
458
|
timestamp,
|
|
394
459
|
date.getUTCFullYear() !== previous.getUTCFullYear(),
|
|
@@ -433,10 +498,13 @@ function layoutTimeAxis({
|
|
|
433
498
|
width,
|
|
434
499
|
samples,
|
|
435
500
|
timeRatio,
|
|
501
|
+
timeZone,
|
|
436
502
|
}: {
|
|
437
503
|
startTime: number;
|
|
438
504
|
endTime: number;
|
|
439
505
|
width: number;
|
|
506
|
+
/** IANA zone the labels read in; UTC when absent. */
|
|
507
|
+
timeZone?: string;
|
|
440
508
|
samples?: readonly CompositeTimeAxisSample[];
|
|
441
509
|
/**
|
|
442
510
|
* Where a timestamp lands across the plot. Defaults to the viewport filling
|
|
@@ -451,7 +519,8 @@ function layoutTimeAxis({
|
|
|
451
519
|
return { text: axis.join(""), ticks: [] };
|
|
452
520
|
}
|
|
453
521
|
|
|
454
|
-
const
|
|
522
|
+
const clock = axisClock(timeZone);
|
|
523
|
+
const interval = resolveTimeAxisInterval(startTime, endTime, axisWidth, clock);
|
|
455
524
|
const span = Math.max(endTime - startTime, 1);
|
|
456
525
|
const ratioAt = (timestamp: number) => {
|
|
457
526
|
const projected = timeRatio?.(timestamp);
|
|
@@ -469,14 +538,14 @@ function layoutTimeAxis({
|
|
|
469
538
|
ratio: 0,
|
|
470
539
|
boundary: true,
|
|
471
540
|
}];
|
|
472
|
-
const firstBucket = intervalBucketKey(firstTimestamp, interval);
|
|
541
|
+
const firstBucket = intervalBucketKey(firstTimestamp, interval, clock);
|
|
473
542
|
|
|
474
|
-
for (const boundary of calendarBoundaries(startTime, endTime, interval)) {
|
|
543
|
+
for (const boundary of calendarBoundaries(startTime, endTime, interval, clock)) {
|
|
475
544
|
if (marketSamples) {
|
|
476
545
|
const sample = marketSamples[lowerBoundSample(marketSamples, boundary)];
|
|
477
546
|
if (
|
|
478
547
|
sample
|
|
479
|
-
&& intervalBucketKey(sample.timestamp, interval) !== firstBucket
|
|
548
|
+
&& intervalBucketKey(sample.timestamp, interval, clock) !== firstBucket
|
|
480
549
|
&& sample.timestamp < lastTimestamp
|
|
481
550
|
&& sample.ratio < 1
|
|
482
551
|
) {
|
|
@@ -484,7 +553,7 @@ function layoutTimeAxis({
|
|
|
484
553
|
}
|
|
485
554
|
continue;
|
|
486
555
|
}
|
|
487
|
-
const bucket = intervalBucketKey(boundary, interval);
|
|
556
|
+
const bucket = intervalBucketKey(boundary, interval, clock);
|
|
488
557
|
if (bucket === firstBucket) continue;
|
|
489
558
|
addCandidate(candidates, {
|
|
490
559
|
timestamp: boundary,
|
|
@@ -501,7 +570,7 @@ function layoutTimeAxis({
|
|
|
501
570
|
candidates.sort((left, right) => left.ratio - right.ratio || left.timestamp - right.timestamp);
|
|
502
571
|
|
|
503
572
|
if (candidates.length === 1 || firstTimestamp === lastTimestamp) {
|
|
504
|
-
const label = formatBoundaryLabel(firstTimestamp, lastTimestamp, interval);
|
|
573
|
+
const label = formatBoundaryLabel(firstTimestamp, lastTimestamp, interval, clock);
|
|
505
574
|
const visibleLabel = label.slice(0, axisWidth);
|
|
506
575
|
const start = Math.max(Math.floor((axisWidth - visibleLabel.length) / 2), 0);
|
|
507
576
|
writeLabel(axis, start, visibleLabel);
|
|
@@ -517,22 +586,22 @@ function layoutTimeAxis({
|
|
|
517
586
|
};
|
|
518
587
|
}
|
|
519
588
|
|
|
520
|
-
let startLabel = formatBoundaryLabel(firstTimestamp, lastTimestamp, interval);
|
|
521
|
-
let endLabel = formatBoundaryLabel(lastTimestamp, firstTimestamp, interval);
|
|
589
|
+
let startLabel = formatBoundaryLabel(firstTimestamp, lastTimestamp, interval, clock);
|
|
590
|
+
let endLabel = formatBoundaryLabel(lastTimestamp, firstTimestamp, interval, clock);
|
|
522
591
|
if (startLabel.length + endLabel.length + 1 > axisWidth) {
|
|
523
|
-
startLabel = formatBoundaryLabel(firstTimestamp, lastTimestamp, interval, false);
|
|
524
|
-
endLabel = formatBoundaryLabel(lastTimestamp, firstTimestamp, interval, false);
|
|
592
|
+
startLabel = formatBoundaryLabel(firstTimestamp, lastTimestamp, interval, clock, false);
|
|
593
|
+
endLabel = formatBoundaryLabel(lastTimestamp, firstTimestamp, interval, clock, false);
|
|
525
594
|
}
|
|
526
595
|
if (startLabel.length + endLabel.length + 1 > axisWidth) {
|
|
527
596
|
// A standalone same-year chart still needs its year. Shorten the right
|
|
528
597
|
// endpoint first instead of dropping that context from both boundaries.
|
|
529
|
-
if (new Date(firstTimestamp).getUTCFullYear() === new Date(lastTimestamp).getUTCFullYear()) {
|
|
530
|
-
endLabel = formatBoundaryLabel(lastTimestamp, firstTimestamp, interval, false, false);
|
|
598
|
+
if (new Date(clock.wall(firstTimestamp)).getUTCFullYear() === new Date(clock.wall(lastTimestamp)).getUTCFullYear()) {
|
|
599
|
+
endLabel = formatBoundaryLabel(lastTimestamp, firstTimestamp, interval, clock, false, false);
|
|
531
600
|
}
|
|
532
601
|
}
|
|
533
602
|
if (startLabel.length + endLabel.length + 1 > axisWidth) {
|
|
534
|
-
startLabel = formatBoundaryLabel(firstTimestamp, lastTimestamp, interval, false, false);
|
|
535
|
-
endLabel = formatBoundaryLabel(lastTimestamp, firstTimestamp, interval, false, false);
|
|
603
|
+
startLabel = formatBoundaryLabel(firstTimestamp, lastTimestamp, interval, clock, false, false);
|
|
604
|
+
endLabel = formatBoundaryLabel(lastTimestamp, firstTimestamp, interval, clock, false, false);
|
|
536
605
|
}
|
|
537
606
|
if (startLabel.length + endLabel.length + 1 > axisWidth) {
|
|
538
607
|
const visibleLabel = startLabel.slice(0, axisWidth);
|
|
@@ -573,7 +642,7 @@ function layoutTimeAxis({
|
|
|
573
642
|
let previousTimestamp = firstTimestamp;
|
|
574
643
|
let previousEnd = startLabel.length - 1;
|
|
575
644
|
for (const candidate of candidates.filter((entry) => !entry.boundary)) {
|
|
576
|
-
const label = formatInteriorLabel(candidate.timestamp, previousTimestamp, interval);
|
|
645
|
+
const label = formatInteriorLabel(candidate.timestamp, previousTimestamp, interval, clock);
|
|
577
646
|
// A year boundary inside the final year would repeat the right endpoint's year.
|
|
578
647
|
if (label === endLabel) continue;
|
|
579
648
|
const center = candidate.ratio * Math.max(axisWidth - 1, 0);
|
|
@@ -620,6 +689,7 @@ export function buildCompositeTimeAxisLayout(
|
|
|
620
689
|
? normalizeMarketSamples(scene)
|
|
621
690
|
: undefined,
|
|
622
691
|
timeRatio: (timestamp) => projectCompositeTimestamp(scene.timeScale, timestamp)?.ratio ?? Number.NaN,
|
|
692
|
+
timeZone: scene.timeZone,
|
|
623
693
|
});
|
|
624
694
|
}
|
|
625
695
|
|
|
@@ -387,7 +387,7 @@ export function summarizeZoomSelection(
|
|
|
387
387
|
|
|
388
388
|
/** The same preview for two times, in either order. */
|
|
389
389
|
export function summarizeZoomRange(
|
|
390
|
-
scene: Pick<CompositeChartScene, "startTime" | "endTime">,
|
|
390
|
+
scene: Pick<CompositeChartScene, "startTime" | "endTime" | "timeZone">,
|
|
391
391
|
first: number,
|
|
392
392
|
second: number,
|
|
393
393
|
): string | null {
|
|
@@ -398,6 +398,7 @@ export function summarizeZoomRange(
|
|
|
398
398
|
new Date(timestamp),
|
|
399
399
|
scene.startTime,
|
|
400
400
|
scene.endTime,
|
|
401
|
+
scene.timeZone,
|
|
401
402
|
);
|
|
402
403
|
return `${label(start)} → ${label(end)} · ${formatMeasureSpan(end - start)}`;
|
|
403
404
|
}
|
|
@@ -132,6 +132,8 @@ export interface CompositePanelScene {
|
|
|
132
132
|
volumeProfile?: CompositeVolumeProfile;
|
|
133
133
|
/** Plot spans (x ratios) of intraday bars outside the regular session, shared by every panel. */
|
|
134
134
|
extendedHours?: readonly CompositeExtendedHoursSpan[];
|
|
135
|
+
/** The previous session's close on a one-day chart, drawn as a dotted reference line. */
|
|
136
|
+
priorClose?: { axis: CompositeAxisSide; value: number; yRatio: number };
|
|
135
137
|
}
|
|
136
138
|
|
|
137
139
|
export interface CompositeCursorValue {
|
|
@@ -156,6 +158,8 @@ export interface CompositeChartScene {
|
|
|
156
158
|
cursorDate: Date | null;
|
|
157
159
|
cursorXRatio: number | null;
|
|
158
160
|
cursorValues: CompositeCursorValue[];
|
|
161
|
+
/** IANA zone the time axis and cursor read in: the venue's for intraday market bars, else UTC. */
|
|
162
|
+
timeZone?: string;
|
|
159
163
|
}
|
|
160
164
|
|
|
161
165
|
export interface BuildCompositeChartSceneOptions {
|
|
@@ -3,6 +3,7 @@ export type { ChartStripSpec, ChartTableChart, ChartTableHeaderProps } from "./h
|
|
|
3
3
|
export {
|
|
4
4
|
chartTableChromeRows,
|
|
5
5
|
chartTableLayout,
|
|
6
|
+
fitChartTableColumns,
|
|
6
7
|
} from "./layout";
|
|
7
8
|
export type { ChartBandMode, ChartTableLayout } from "./layout";
|
|
8
9
|
export { useChartTableSelection } from "./selection";
|