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
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
unavailableText,
|
|
11
11
|
usePaneFooter,
|
|
12
12
|
usePaneHeaderTabs,
|
|
13
|
+
usePaneNoticeFooter,
|
|
13
14
|
usePaneStatusFooter,
|
|
14
15
|
type MetricTreemapDirection,
|
|
15
16
|
type MetricTreemapItem,
|
|
@@ -17,20 +18,43 @@ import {
|
|
|
17
18
|
import { handleRefreshKey } from "../../../components/data-table/table-pane";
|
|
18
19
|
import { useShortcut } from "../../../react/input";
|
|
19
20
|
import { TICKER_RESEARCH_PANE_ID } from "../../../types/config";
|
|
20
|
-
import type { GloomPlugin, PaneProps } from "../../../types/plugin";
|
|
21
|
+
import type { GloomPlugin, PaneProps, PaneSettingField } from "../../../types/plugin";
|
|
22
|
+
import type { TickerRecord } from "../../../types/ticker";
|
|
23
|
+
import { tf } from "../../../i18n";
|
|
21
24
|
import { priceColor } from "../../../theme/colors";
|
|
22
25
|
import { formatCompact, formatCurrency, formatPercentRaw } from "../../../utils/format";
|
|
23
26
|
import { isPlainKey } from "../../../utils/keyboard";
|
|
24
|
-
import { usePaneSettingValue } from "../../../state/app/context";
|
|
27
|
+
import { useAppSelector, usePaneAppConfig, usePaneSettingValue } from "../../../state/app/context";
|
|
25
28
|
import { usePluginTickerActions } from "../../runtime";
|
|
26
29
|
import { useLiveQuoteEntries } from "../../../state/hooks/quote-streaming";
|
|
30
|
+
import { useFxRatesMap, useTickerFinancialsMap } from "../../../market-data/hooks";
|
|
31
|
+
import { getSharedMarketDataCoordinator } from "../../../market-data/coordinator";
|
|
32
|
+
import { instrumentFromTicker, type InstrumentRef } from "../../../market-data/request-types";
|
|
33
|
+
import {
|
|
34
|
+
buildTrackedCurrencies,
|
|
35
|
+
getCollectionTickersFromConfig,
|
|
36
|
+
getCollectionTypeFromConfig,
|
|
37
|
+
} from "../portfolio-list/pane/data";
|
|
38
|
+
import { resolvePortfolioTotalsCurrency } from "../portfolio-list/metrics";
|
|
39
|
+
import { useThrottledMemo } from "../portfolio-list/use-throttled-memo";
|
|
40
|
+
import { PORTFOLIO_REORDER_THROTTLE_MS } from "../portfolio-list/use-throttled-ticker-order";
|
|
27
41
|
import {
|
|
28
42
|
MARKET_HEATMAP_UNIVERSES,
|
|
29
43
|
fetchMarketHeatmap,
|
|
30
44
|
resetMarketHeatmapCache,
|
|
31
|
-
type MarketHeatmapAsset,
|
|
32
45
|
type MarketHeatmapUniverseId,
|
|
33
46
|
} from "./data";
|
|
47
|
+
import {
|
|
48
|
+
PORTFOLIO_HEATMAP_TAB,
|
|
49
|
+
buildPortfolioHeatmapAssets,
|
|
50
|
+
fallbackHeatmapCollectionId,
|
|
51
|
+
heatmapCollectionLabel,
|
|
52
|
+
heatmapFollowsCollection,
|
|
53
|
+
heatmapTabId,
|
|
54
|
+
isRemoteHeatmapUniverse,
|
|
55
|
+
useLinkedHeatmapCollection,
|
|
56
|
+
type HeatmapBoardAsset,
|
|
57
|
+
} from "./portfolio";
|
|
34
58
|
import { useAutoRefresh, useUpdatedAgo } from "../../../react/auto-refresh";
|
|
35
59
|
import {
|
|
36
60
|
LIVE_STREAMING_QUICK_SETTING,
|
|
@@ -43,9 +67,28 @@ import {
|
|
|
43
67
|
resolveScreenerQuoteFeedStatus,
|
|
44
68
|
} from "../../../market-data/quotes/screener-live-quotes";
|
|
45
69
|
|
|
46
|
-
const
|
|
47
|
-
const NO_ASSETS:
|
|
70
|
+
const NO_ASSETS: HeatmapBoardAsset[] = [];
|
|
71
|
+
const NO_BOARD = { assets: NO_ASSETS, omitted: 0 };
|
|
72
|
+
const EMPTY_TICKERS: TickerRecord[] = [];
|
|
73
|
+
const NO_CURRENCIES: string[] = [];
|
|
48
74
|
const EMPTY_TITLE = "No market heatmap data.";
|
|
75
|
+
const EMPTY_PORTFOLIO_TITLE = "No symbols in this list.";
|
|
76
|
+
|
|
77
|
+
function loadCollectionSnapshots(
|
|
78
|
+
tickers: readonly TickerRecord[],
|
|
79
|
+
collectionId: string | null,
|
|
80
|
+
kind: "portfolio" | "watchlist" | null,
|
|
81
|
+
forceRefresh = false,
|
|
82
|
+
): void {
|
|
83
|
+
const coordinator = getSharedMarketDataCoordinator();
|
|
84
|
+
if (!coordinator || !collectionId) return;
|
|
85
|
+
const instrumentOptions = kind === "portfolio" ? { portfolioId: collectionId } : {};
|
|
86
|
+
const instruments = tickers.flatMap((ticker): InstrumentRef[] => {
|
|
87
|
+
const instrument = instrumentFromTicker(ticker, ticker.metadata.ticker, instrumentOptions);
|
|
88
|
+
return instrument ? [instrument] : [];
|
|
89
|
+
});
|
|
90
|
+
if (instruments.length > 0) void coordinator.loadSnapshotsBatch(instruments, { forceRefresh }).catch(() => {});
|
|
91
|
+
}
|
|
49
92
|
|
|
50
93
|
function formatMoneyCompact(value: number | null | undefined, currency: string): string {
|
|
51
94
|
if (value == null) return "—";
|
|
@@ -53,17 +96,17 @@ function formatMoneyCompact(value: number | null | undefined, currency: string):
|
|
|
53
96
|
return `${formatCompact(value)} ${currency}`;
|
|
54
97
|
}
|
|
55
98
|
|
|
56
|
-
function sizeLabel(asset:
|
|
57
|
-
if (asset.size == null) return null;
|
|
58
|
-
const label = asset.sizeKind === "net-assets" ? "Assets" : "Mkt";
|
|
59
|
-
return `${label} ${formatMoneyCompact(asset.size, asset.currency)}`;
|
|
99
|
+
function sizeLabel(asset: HeatmapBoardAsset): string | null {
|
|
100
|
+
if (asset.showSize === false || asset.size == null) return null;
|
|
101
|
+
const label = asset.sizeCaption ?? (asset.sizeKind === "net-assets" ? "Assets" : "Mkt");
|
|
102
|
+
return `${label} ${formatMoneyCompact(asset.size, asset.sizeCurrency ?? asset.currency)}`;
|
|
60
103
|
}
|
|
61
104
|
|
|
62
|
-
function buildItems(assets:
|
|
105
|
+
function buildItems(assets: HeatmapBoardAsset[]): Array<MetricTreemapItem<HeatmapBoardAsset>> {
|
|
63
106
|
return assets.map((asset) => ({
|
|
64
107
|
id: asset.symbol,
|
|
65
108
|
label: asset.symbol,
|
|
66
|
-
weight: asset.size ?? 0,
|
|
109
|
+
weight: asset.weight ?? asset.size ?? 0,
|
|
67
110
|
colorValue: asset.hasChange ? asset.changePercent : null,
|
|
68
111
|
// No change data is not a flat session; 0.00% would be a made-up number.
|
|
69
112
|
primaryText: asset.hasChange ? formatPercentRaw(asset.changePercent) : "—",
|
|
@@ -80,9 +123,9 @@ function buildItems(assets: MarketHeatmapAsset[]): Array<MetricTreemapItem<Marke
|
|
|
80
123
|
* geometry.
|
|
81
124
|
*/
|
|
82
125
|
function fitItemsToTiles(
|
|
83
|
-
items: Array<MetricTreemapItem<
|
|
126
|
+
items: Array<MetricTreemapItem<HeatmapBoardAsset>>,
|
|
84
127
|
tiles: Array<{ item: { id: string }; width: number; height: number }>,
|
|
85
|
-
): Array<MetricTreemapItem<
|
|
128
|
+
): Array<MetricTreemapItem<HeatmapBoardAsset>> {
|
|
86
129
|
const tileById = new Map(tiles.map((tile) => [tile.item.id, tile]));
|
|
87
130
|
return items.map((item) => {
|
|
88
131
|
const tile = tileById.get(item.id);
|
|
@@ -106,8 +149,62 @@ function MarketHeatmapPane({ focused, width, height }: PaneProps) {
|
|
|
106
149
|
const liveStreaming = useLiveStreamingSetting();
|
|
107
150
|
const { cellWidthPx = 8, cellHeightPx = 18, nativePaneChrome } = useUiCapabilities();
|
|
108
151
|
// A pane setting, not private pane state, so the settings dialog can show it.
|
|
109
|
-
const [
|
|
110
|
-
const [
|
|
152
|
+
const [universeSetting, setActiveUniverse] = usePaneSettingValue<string>("universe", "us-equity");
|
|
153
|
+
const [linkPortfolio] = usePaneSettingValue<boolean>("linkPortfolio", false);
|
|
154
|
+
const activeUniverse = heatmapTabId(universeSetting);
|
|
155
|
+
const portfolioTab = activeUniverse === PORTFOLIO_HEATMAP_TAB;
|
|
156
|
+
const config = usePaneAppConfig();
|
|
157
|
+
const tickersBySymbol = useAppSelector((state) => state.tickers);
|
|
158
|
+
const linkedPortfolio = useLinkedHeatmapCollection();
|
|
159
|
+
const collectionId = linkedPortfolio.collectionId ?? fallbackHeatmapCollectionId(config);
|
|
160
|
+
const collectionKind = getCollectionTypeFromConfig(config, collectionId);
|
|
161
|
+
const portfolioLabel = heatmapCollectionLabel(config, collectionId);
|
|
162
|
+
const universeTabs = useMemo(() => [
|
|
163
|
+
...MARKET_HEATMAP_UNIVERSES.map((universe) => ({ label: universe.label, value: universe.id })),
|
|
164
|
+
{ label: portfolioLabel, value: PORTFOLIO_HEATMAP_TAB },
|
|
165
|
+
], [portfolioLabel]);
|
|
166
|
+
const collectionTickers = useMemo(
|
|
167
|
+
() => (portfolioTab && collectionId && collectionKind
|
|
168
|
+
? getCollectionTickersFromConfig(config, tickersBySymbol, collectionId)
|
|
169
|
+
: EMPTY_TICKERS),
|
|
170
|
+
[collectionId, collectionKind, config, portfolioTab, tickersBySymbol],
|
|
171
|
+
);
|
|
172
|
+
const collectionSymbolsKey = collectionTickers.map((ticker) => ticker.metadata.ticker).join(",");
|
|
173
|
+
const financials = useTickerFinancialsMap(
|
|
174
|
+
collectionTickers,
|
|
175
|
+
collectionKind === "portfolio" && collectionId ? { portfolioId: collectionId } : {},
|
|
176
|
+
);
|
|
177
|
+
// Holdings in the portfolio's currency, as its pane totals them; a watchlist's caps in the base currency.
|
|
178
|
+
const boardCurrency = collectionKind === "portfolio"
|
|
179
|
+
? resolvePortfolioTotalsCurrency(config.portfolios.find((portfolio) => portfolio.id === collectionId), config.baseCurrency)
|
|
180
|
+
: resolvePortfolioTotalsCurrency(null, config.baseCurrency);
|
|
181
|
+
const trackedCurrencies = useMemo(
|
|
182
|
+
() => (collectionTickers.length > 0
|
|
183
|
+
? buildTrackedCurrencies(collectionTickers, financials, null, boardCurrency)
|
|
184
|
+
: NO_CURRENCIES),
|
|
185
|
+
[boardCurrency, collectionTickers, financials],
|
|
186
|
+
);
|
|
187
|
+
const exchangeRates = useFxRatesMap(trackedCurrencies);
|
|
188
|
+
// Tile areas follow prices on the portfolio pane's reorder cadence, so a
|
|
189
|
+
// tick does not reshuffle the board; colors and captions stream below.
|
|
190
|
+
// A snapshot arriving (the map growing) or a new list applies at once.
|
|
191
|
+
const portfolioBoard = useThrottledMemo(
|
|
192
|
+
() => (collectionId && collectionKind
|
|
193
|
+
? buildPortfolioHeatmapAssets({
|
|
194
|
+
tickers: collectionTickers,
|
|
195
|
+
financials,
|
|
196
|
+
collectionId,
|
|
197
|
+
kind: collectionKind,
|
|
198
|
+
currency: boardCurrency,
|
|
199
|
+
exchangeRates,
|
|
200
|
+
})
|
|
201
|
+
: NO_BOARD),
|
|
202
|
+
[financials],
|
|
203
|
+
[boardCurrency, collectionId, collectionKind, collectionTickers, exchangeRates, financials.size],
|
|
204
|
+
PORTFOLIO_REORDER_THROTTLE_MS,
|
|
205
|
+
);
|
|
206
|
+
const portfolioAssets = portfolioBoard.assets;
|
|
207
|
+
const [assets, setAssets] = useState<HeatmapBoardAsset[]>([]);
|
|
111
208
|
// The universe `assets` came from. A board is drawn only under its own tab,
|
|
112
209
|
// so a switch never paints the previous universe's tiles.
|
|
113
210
|
const [loadedUniverse, setLoadedUniverse] = useState<MarketHeatmapUniverseId | null>(null);
|
|
@@ -118,17 +215,18 @@ function MarketHeatmapPane({ focused, width, height }: PaneProps) {
|
|
|
118
215
|
const [stale, setStale] = useState(false);
|
|
119
216
|
const [selectedSymbol, setSelectedSymbol] = useState<string | null>(null);
|
|
120
217
|
const fetchGenRef = useRef(0);
|
|
121
|
-
const
|
|
218
|
+
const seenCollection = useRef<string | null>(null);
|
|
219
|
+
const boardAssets = portfolioTab ? portfolioAssets : (loadedUniverse === activeUniverse ? assets : NO_ASSETS);
|
|
122
220
|
const hasBoard = boardAssets.length > 0;
|
|
123
221
|
|
|
124
222
|
const selectUniverse = useCallback((value: string) => {
|
|
125
|
-
setActiveUniverse(value
|
|
223
|
+
setActiveUniverse(heatmapTabId(value));
|
|
126
224
|
setSelectedSymbol(null);
|
|
127
225
|
}, [setActiveUniverse]);
|
|
128
226
|
// The pane's only partition: the desktop draws it in the title bar, which
|
|
129
227
|
// gives the treemap the row the strip used to take.
|
|
130
228
|
const tabsInHeader = usePaneHeaderTabs({
|
|
131
|
-
tabs:
|
|
229
|
+
tabs: universeTabs,
|
|
132
230
|
activeValue: activeUniverse,
|
|
133
231
|
onSelect: selectUniverse,
|
|
134
232
|
focused,
|
|
@@ -204,33 +302,58 @@ function MarketHeatmapPane({ focused, width, height }: PaneProps) {
|
|
|
204
302
|
}, []);
|
|
205
303
|
|
|
206
304
|
useEffect(() => {
|
|
305
|
+
if (!isRemoteHeatmapUniverse(activeUniverse)) return;
|
|
207
306
|
void loadUniverse(activeUniverse);
|
|
208
307
|
}, [activeUniverse, loadUniverse]);
|
|
209
308
|
|
|
309
|
+
useEffect(() => {
|
|
310
|
+
const previous = seenCollection.current;
|
|
311
|
+
seenCollection.current = collectionId;
|
|
312
|
+
if (!heatmapFollowsCollection(linkPortfolio, previous, collectionId)) return;
|
|
313
|
+
setActiveUniverse(PORTFOLIO_HEATMAP_TAB);
|
|
314
|
+
setSelectedSymbol(null);
|
|
315
|
+
}, [collectionId, linkPortfolio, setActiveUniverse]);
|
|
316
|
+
|
|
317
|
+
// The financials map only reads the cache; this fills it for the list on screen.
|
|
318
|
+
useEffect(() => {
|
|
319
|
+
if (!portfolioTab) return;
|
|
320
|
+
loadCollectionSnapshots(collectionTickers, collectionId, collectionKind);
|
|
321
|
+
// Keyed by the symbols: another ticker's record changing does not reload the list.
|
|
322
|
+
}, [collectionId, collectionKind, collectionSymbolsKey, portfolioTab]);
|
|
323
|
+
|
|
210
324
|
useEffect(() => {
|
|
211
325
|
if (selectedSymbol && boardAssets.some((asset) => asset.symbol === selectedSymbol)) return;
|
|
212
326
|
setSelectedSymbol(boardAssets[0]?.symbol ?? null);
|
|
213
327
|
}, [boardAssets, selectedSymbol]);
|
|
214
328
|
|
|
215
329
|
const refresh = useCallback(() => {
|
|
330
|
+
if (portfolioTab) {
|
|
331
|
+
loadCollectionSnapshots(collectionTickers, collectionId, collectionKind, true);
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
if (!isRemoteHeatmapUniverse(activeUniverse)) return;
|
|
216
335
|
void loadUniverse(activeUniverse, { forceRefresh: true });
|
|
336
|
+
}, [activeUniverse, collectionId, collectionKind, collectionTickers, loadUniverse, portfolioTab]);
|
|
337
|
+
// The list's quotes stream; on a timer only the market boards reload.
|
|
338
|
+
const autoRefresh = useCallback(() => {
|
|
339
|
+
if (isRemoteHeatmapUniverse(activeUniverse)) void loadUniverse(activeUniverse, { forceRefresh: true });
|
|
217
340
|
}, [activeUniverse, loadUniverse]);
|
|
218
341
|
|
|
219
342
|
const selectAdjacentUniverse = useCallback((direction: -1 | 1) => {
|
|
220
|
-
const index =
|
|
221
|
-
const
|
|
222
|
-
if (
|
|
223
|
-
setActiveUniverse(
|
|
343
|
+
const index = universeTabs.findIndex((tab) => tab.value === activeUniverse);
|
|
344
|
+
const nextTab = universeTabs[Math.max(0, Math.min(universeTabs.length - 1, index + direction))];
|
|
345
|
+
if (nextTab && nextTab.value !== activeUniverse) {
|
|
346
|
+
setActiveUniverse(nextTab.value);
|
|
224
347
|
setSelectedSymbol(null);
|
|
225
348
|
}
|
|
226
|
-
}, [activeUniverse, setActiveUniverse]);
|
|
349
|
+
}, [activeUniverse, setActiveUniverse, universeTabs]);
|
|
227
350
|
|
|
228
351
|
const selectUniverseAt = useCallback((index: number) => {
|
|
229
|
-
const
|
|
230
|
-
if (!
|
|
231
|
-
setActiveUniverse(
|
|
352
|
+
const tab = universeTabs[index];
|
|
353
|
+
if (!tab || tab.value === activeUniverse) return;
|
|
354
|
+
setActiveUniverse(tab.value);
|
|
232
355
|
setSelectedSymbol(null);
|
|
233
|
-
}, [activeUniverse, setActiveUniverse]);
|
|
356
|
+
}, [activeUniverse, setActiveUniverse, universeTabs]);
|
|
234
357
|
|
|
235
358
|
const openSymbol = useCallback((symbol: string) => {
|
|
236
359
|
pinTicker(symbol, { floating: true, paneType: TICKER_RESEARCH_PANE_ID });
|
|
@@ -261,6 +384,12 @@ function MarketHeatmapPane({ focused, width, height }: PaneProps) {
|
|
|
261
384
|
selectUniverseAt(1);
|
|
262
385
|
return;
|
|
263
386
|
}
|
|
387
|
+
if (isPlainKey(event, "3")) {
|
|
388
|
+
event.preventDefault();
|
|
389
|
+
event.stopPropagation();
|
|
390
|
+
selectUniverseAt(2);
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
264
393
|
if (isPlainKey(event, "[")) {
|
|
265
394
|
event.preventDefault();
|
|
266
395
|
event.stopPropagation();
|
|
@@ -316,10 +445,17 @@ function MarketHeatmapPane({ focused, width, height }: PaneProps) {
|
|
|
316
445
|
}
|
|
317
446
|
});
|
|
318
447
|
|
|
319
|
-
const updated = useUpdatedAgo(loadedUniverse === activeUniverse ? lastUpdated : null);
|
|
320
|
-
useAutoRefresh(lastUpdated,
|
|
448
|
+
const updated = useUpdatedAgo(!portfolioTab && loadedUniverse === activeUniverse ? lastUpdated : null);
|
|
449
|
+
useAutoRefresh(lastUpdated, autoRefresh);
|
|
321
450
|
|
|
322
|
-
usePaneStatusFooter({ registrationId: "market-heatmap-retained", stale: hasBoard && stale });
|
|
451
|
+
usePaneStatusFooter({ registrationId: "market-heatmap-retained", stale: hasBoard && stale && !portfolioTab });
|
|
452
|
+
usePaneNoticeFooter({
|
|
453
|
+
registrationId: "market-heatmap-omitted",
|
|
454
|
+
notices: portfolioTab && portfolioBoard.omitted > 0
|
|
455
|
+
? [tf("The {count} smallest names in {list} are left out of the map.", { count: portfolioBoard.omitted, list: portfolioLabel })]
|
|
456
|
+
: [],
|
|
457
|
+
focused,
|
|
458
|
+
});
|
|
323
459
|
|
|
324
460
|
usePaneFooter("market-heatmap", () => ({
|
|
325
461
|
info: [
|
|
@@ -340,22 +476,22 @@ function MarketHeatmapPane({ focused, width, height }: PaneProps) {
|
|
|
340
476
|
id: "updated",
|
|
341
477
|
parts: [{ text: `updated ${updated}`, tone: "muted" as const }],
|
|
342
478
|
}] : []),
|
|
343
|
-
...(loading ? [{ id: "loading", parts: [{ text: "loading", tone: "muted" as const }] }] : []),
|
|
479
|
+
...(!portfolioTab && loading ? [{ id: "loading", parts: [{ text: "loading", tone: "muted" as const }] }] : []),
|
|
344
480
|
// Without a board the body carries the failure.
|
|
345
|
-
...(loadError && hasBoard ? [{ id: "error", parts: [{ text: "refresh failed", tone: "warning" as const }] }] : []),
|
|
481
|
+
...(!portfolioTab && loadError && hasBoard ? [{ id: "error", parts: [{ text: "refresh failed", tone: "warning" as const }] }] : []),
|
|
346
482
|
...(feedStatus ? [{
|
|
347
483
|
id: "feed",
|
|
348
484
|
parts: [{ text: feedStatus, tone: feedStatus === "live" ? "value" as const : "muted" as const }],
|
|
349
485
|
}] : []),
|
|
350
486
|
],
|
|
351
|
-
}), [feedStatus, hasBoard, loadError, loading, selectedAsset, updated]);
|
|
487
|
+
}), [feedStatus, hasBoard, loadError, loading, portfolioTab, selectedAsset, updated]);
|
|
352
488
|
|
|
353
489
|
return (
|
|
354
490
|
<Box flexDirection="column" width={width} height={height}>
|
|
355
491
|
{!tabsInHeader && (
|
|
356
492
|
<Box height={1} paddingX={1}>
|
|
357
493
|
<Tabs
|
|
358
|
-
tabs={
|
|
494
|
+
tabs={universeTabs}
|
|
359
495
|
activeValue={activeUniverse}
|
|
360
496
|
onSelect={selectUniverse}
|
|
361
497
|
compact
|
|
@@ -367,11 +503,11 @@ function MarketHeatmapPane({ focused, width, height }: PaneProps) {
|
|
|
367
503
|
)}
|
|
368
504
|
|
|
369
505
|
<PaneStatusBody
|
|
370
|
-
loading={loading && !hasBoard}
|
|
506
|
+
loading={!portfolioTab && loading && !hasBoard}
|
|
371
507
|
loadingLabel={loadingText("market heatmap")}
|
|
372
|
-
error={hasBoard ? null : loadError}
|
|
508
|
+
error={portfolioTab || hasBoard ? null : loadError}
|
|
373
509
|
empty={!hasBoard}
|
|
374
|
-
emptyTitle={EMPTY_TITLE}
|
|
510
|
+
emptyTitle={portfolioTab ? EMPTY_PORTFOLIO_TITLE : EMPTY_TITLE}
|
|
375
511
|
>
|
|
376
512
|
<MetricTreemapSurface
|
|
377
513
|
items={displayItems}
|
|
@@ -380,7 +516,7 @@ function MarketHeatmapPane({ focused, width, height }: PaneProps) {
|
|
|
380
516
|
selectedId={selectedSymbol}
|
|
381
517
|
onSelect={(item) => setSelectedSymbol(item.data.symbol)}
|
|
382
518
|
onActivate={(item) => openSymbol(item.data.symbol)}
|
|
383
|
-
emptyStateTitle={EMPTY_TITLE}
|
|
519
|
+
emptyStateTitle={portfolioTab ? EMPTY_PORTFOLIO_TITLE : EMPTY_TITLE}
|
|
384
520
|
/>
|
|
385
521
|
</PaneStatusBody>
|
|
386
522
|
</Box>
|
|
@@ -391,7 +527,7 @@ export const marketHeatmapPlugin: GloomPlugin = {
|
|
|
391
527
|
id: "market-heatmap",
|
|
392
528
|
name: "Market Heatmap",
|
|
393
529
|
version: "1.0.0",
|
|
394
|
-
description: "Largest US stocks and ETFs, sized by market cap or
|
|
530
|
+
description: "Largest US stocks and ETFs, or the portfolio pane's list, sized by market cap or position and colored by daily move",
|
|
395
531
|
toggleable: true,
|
|
396
532
|
targets: ["cli", "tui", "desktop", "web"],
|
|
397
533
|
|
|
@@ -411,15 +547,27 @@ export const marketHeatmapPlugin: GloomPlugin = {
|
|
|
411
547
|
quickSettings: [LIVE_STREAMING_QUICK_SETTING],
|
|
412
548
|
settings: (context) => withLiveStreamingSetting({
|
|
413
549
|
title: "Market Heatmap Settings",
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
550
|
+
values: { linkPortfolio: context.settings.linkPortfolio === true },
|
|
551
|
+
fields: [
|
|
552
|
+
{
|
|
553
|
+
key: "universe",
|
|
554
|
+
label: "Universe",
|
|
555
|
+
type: "select",
|
|
556
|
+
options: [
|
|
557
|
+
...MARKET_HEATMAP_UNIVERSES.map((universe) => ({
|
|
558
|
+
value: universe.id,
|
|
559
|
+
label: universe.label,
|
|
560
|
+
})),
|
|
561
|
+
{ value: PORTFOLIO_HEATMAP_TAB, label: "Portfolio pane list" },
|
|
562
|
+
],
|
|
563
|
+
},
|
|
564
|
+
{
|
|
565
|
+
key: "linkPortfolio",
|
|
566
|
+
label: "Link to portfolio",
|
|
567
|
+
type: "toggle",
|
|
568
|
+
description: "Open the list's tab whenever the portfolio pane switches lists.",
|
|
569
|
+
},
|
|
570
|
+
] satisfies PaneSettingField[],
|
|
423
571
|
}, context.settings),
|
|
424
572
|
},
|
|
425
573
|
],
|
|
@@ -429,8 +577,8 @@ export const marketHeatmapPlugin: GloomPlugin = {
|
|
|
429
577
|
id: "market-heatmap-pane",
|
|
430
578
|
paneId: "market-heatmap",
|
|
431
579
|
label: "Market Heatmap",
|
|
432
|
-
description: "Largest US stocks and ETFs, sized by market cap or
|
|
433
|
-
keywords: ["heatmap", "market", "largest", "top", "stocks", "etf", "screener"],
|
|
580
|
+
description: "Largest US stocks and ETFs, or the portfolio pane's list, sized by market cap or position and colored by daily move.",
|
|
581
|
+
keywords: ["heatmap", "market", "largest", "top", "stocks", "etf", "portfolio", "watchlist", "screener"],
|
|
434
582
|
shortcut: { prefix: "HM" },
|
|
435
583
|
},
|
|
436
584
|
],
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { useEffect, useMemo } from "react";
|
|
2
|
+
import type { MarketHeatmapAsset, MarketHeatmapUniverseId } from "../../../api-client/market-discovery";
|
|
3
|
+
import { useAppSelector, usePaneStateValue } from "../../../state/app/context";
|
|
4
|
+
import type { ColumnConfig } from "../../../types/config";
|
|
5
|
+
import type { TickerFinancials } from "../../../types/financials";
|
|
6
|
+
import type { TickerRecord } from "../../../types/ticker";
|
|
7
|
+
import { getSortValue, type ColumnContext } from "../portfolio-list/metrics";
|
|
8
|
+
|
|
9
|
+
export const PORTFOLIO_HEATMAP_TAB = "portfolio";
|
|
10
|
+
const MAX_PORTFOLIO_TILES = 160;
|
|
11
|
+
|
|
12
|
+
export type HeatmapTabId = MarketHeatmapUniverseId | typeof PORTFOLIO_HEATMAP_TAB;
|
|
13
|
+
|
|
14
|
+
export interface HeatmapBoardAsset extends MarketHeatmapAsset {
|
|
15
|
+
/** False when the tile has no size of its own. The caption must not invent one. */
|
|
16
|
+
showSize?: boolean;
|
|
17
|
+
sizeCaption?: "Value";
|
|
18
|
+
/** The currency `size` is in, when it is not the quote's. */
|
|
19
|
+
sizeCurrency?: string;
|
|
20
|
+
/** Treemap area, when it is not `size` itself. */
|
|
21
|
+
weight?: number;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface HeatmapPortfolioPane {
|
|
25
|
+
instanceId: string;
|
|
26
|
+
collectionId: string | null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function heatmapTabId(value: string | null | undefined): HeatmapTabId {
|
|
30
|
+
if (value === "us-equity" || value === "us-etf" || value === PORTFOLIO_HEATMAP_TAB) return value;
|
|
31
|
+
return "us-equity";
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function isRemoteHeatmapUniverse(value: HeatmapTabId): value is MarketHeatmapUniverseId {
|
|
35
|
+
return value !== PORTFOLIO_HEATMAP_TAB;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* A linked heatmap changes tab only after the portfolio pane moves from one
|
|
40
|
+
* list to another. The first id, including one that arrives after mount, is
|
|
41
|
+
* the list already selected.
|
|
42
|
+
*/
|
|
43
|
+
export function heatmapFollowsCollection(
|
|
44
|
+
linked: boolean,
|
|
45
|
+
previous: string | null,
|
|
46
|
+
next: string | null,
|
|
47
|
+
): boolean {
|
|
48
|
+
return linked && previous != null && next != null && previous !== next;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function heatmapCollectionLabel(
|
|
52
|
+
config: { portfolios: readonly { id: string; name: string }[]; watchlists: readonly { id: string; name: string }[] },
|
|
53
|
+
collectionId: string | null,
|
|
54
|
+
): string {
|
|
55
|
+
if (!collectionId) return "Portfolio";
|
|
56
|
+
return config.portfolios.find((portfolio) => portfolio.id === collectionId)?.name
|
|
57
|
+
?? config.watchlists.find((watchlist) => watchlist.id === collectionId)?.name
|
|
58
|
+
?? "Portfolio";
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function fallbackHeatmapCollectionId(
|
|
62
|
+
config: { portfolios: readonly { id: string }[]; watchlists: readonly { id: string }[] },
|
|
63
|
+
): string | null {
|
|
64
|
+
return config.portfolios[0]?.id ?? config.watchlists[0]?.id ?? null;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function heatmapPortfolioPanes(
|
|
68
|
+
instances: readonly { instanceId: string; paneId: string; params?: Record<string, string> | undefined }[],
|
|
69
|
+
paneState: Record<string, { collectionId?: unknown } | undefined>,
|
|
70
|
+
): HeatmapPortfolioPane[] {
|
|
71
|
+
return instances.flatMap((instance) => {
|
|
72
|
+
if (instance.paneId !== "portfolio-list") return [];
|
|
73
|
+
const fromState = paneState[instance.instanceId]?.collectionId;
|
|
74
|
+
const collectionId = typeof fromState === "string" && fromState
|
|
75
|
+
? fromState
|
|
76
|
+
: instance.params?.collectionId || null;
|
|
77
|
+
return [{ instanceId: instance.instanceId, collectionId }];
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** The portfolio pane the user is on, else the one this heatmap last followed. */
|
|
82
|
+
export function resolveHeatmapPortfolioSource(
|
|
83
|
+
panes: readonly HeatmapPortfolioPane[],
|
|
84
|
+
focusedPaneId: string | null,
|
|
85
|
+
rememberedSourceId: string | null,
|
|
86
|
+
): HeatmapPortfolioPane | null {
|
|
87
|
+
if (panes.length === 0) return null;
|
|
88
|
+
const focused = focusedPaneId ? panes.find((pane) => pane.instanceId === focusedPaneId) : undefined;
|
|
89
|
+
if (focused) return focused;
|
|
90
|
+
const remembered = rememberedSourceId ? panes.find((pane) => pane.instanceId === rememberedSourceId) : undefined;
|
|
91
|
+
return remembered ?? panes[0] ?? null;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export function heatmapPortfolioSignature(state: {
|
|
95
|
+
focusedPaneId: string | null;
|
|
96
|
+
config: { layout: { instances: readonly { instanceId: string; paneId: string; params?: Record<string, string> }[] } };
|
|
97
|
+
paneState: Record<string, { collectionId?: unknown } | undefined>;
|
|
98
|
+
}): string {
|
|
99
|
+
const panes = heatmapPortfolioPanes(state.config.layout.instances, state.paneState);
|
|
100
|
+
return `${state.focusedPaneId ?? ""}\n${panes.map((pane) => `${pane.instanceId}=${pane.collectionId ?? ""}`).join("\n")}`;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export function parseHeatmapPortfolioSignature(signature: string): {
|
|
104
|
+
focusedPaneId: string | null;
|
|
105
|
+
panes: HeatmapPortfolioPane[];
|
|
106
|
+
} {
|
|
107
|
+
const [focused = "", ...rows] = signature.split("\n");
|
|
108
|
+
return {
|
|
109
|
+
focusedPaneId: focused || null,
|
|
110
|
+
panes: rows.filter((row) => row.length > 0).map((row) => {
|
|
111
|
+
const splitAt = row.indexOf("=");
|
|
112
|
+
const collectionId = row.slice(splitAt + 1);
|
|
113
|
+
return {
|
|
114
|
+
instanceId: splitAt >= 0 ? row.slice(0, splitAt) : row,
|
|
115
|
+
collectionId: collectionId || null,
|
|
116
|
+
};
|
|
117
|
+
}),
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export function useLinkedHeatmapCollection(): { collectionId: string | null; sourceInstanceId: string | null } {
|
|
122
|
+
const [remembered, setRemembered] = usePaneStateValue<string>("portfolioSourceId", "");
|
|
123
|
+
const signature = useAppSelector(heatmapPortfolioSignature);
|
|
124
|
+
const resolved = useMemo(() => {
|
|
125
|
+
const { focusedPaneId, panes } = parseHeatmapPortfolioSignature(signature);
|
|
126
|
+
return resolveHeatmapPortfolioSource(panes, focusedPaneId, remembered || null);
|
|
127
|
+
}, [remembered, signature]);
|
|
128
|
+
|
|
129
|
+
useEffect(() => {
|
|
130
|
+
const next = resolved?.instanceId ?? "";
|
|
131
|
+
if (next !== remembered) setRemembered(next);
|
|
132
|
+
}, [remembered, resolved, setRemembered]);
|
|
133
|
+
|
|
134
|
+
return {
|
|
135
|
+
collectionId: resolved?.collectionId ?? null,
|
|
136
|
+
sourceInstanceId: resolved?.instanceId ?? null,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const MARKET_VALUE_COLUMN: ColumnConfig = { id: "mkt_value", label: "Mkt Value", width: 10, align: "right" };
|
|
141
|
+
const MARKET_CAP_COLUMN: ColumnConfig = { id: "market_cap", label: "Mkt Cap", width: 10, align: "right" };
|
|
142
|
+
|
|
143
|
+
function positiveNumber(value: number | string | null): number | null {
|
|
144
|
+
return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : null;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* A portfolio's holdings are sized by market value, read as the portfolio pane
|
|
149
|
+
* reads its MKT VALUE column: lots, contract multipliers and price basis, in
|
|
150
|
+
* the portfolio's currency. A watchlist's names are sized by the square root
|
|
151
|
+
* of market cap in the base currency, so a mega-cap does not hide the rest of
|
|
152
|
+
* a short list. A name with no size (no position, no quote, no cap, no FX
|
|
153
|
+
* rate) gets the smallest tile and no caption. Past `MAX_PORTFOLIO_TILES`,
|
|
154
|
+
* the smallest names are left out and counted in `omitted`.
|
|
155
|
+
*/
|
|
156
|
+
export function buildPortfolioHeatmapAssets({
|
|
157
|
+
tickers,
|
|
158
|
+
financials,
|
|
159
|
+
collectionId,
|
|
160
|
+
kind,
|
|
161
|
+
currency,
|
|
162
|
+
exchangeRates,
|
|
163
|
+
}: {
|
|
164
|
+
tickers: readonly TickerRecord[];
|
|
165
|
+
financials: ReadonlyMap<string, TickerFinancials>;
|
|
166
|
+
collectionId: string;
|
|
167
|
+
kind: "portfolio" | "watchlist";
|
|
168
|
+
/** The portfolio's totals currency, or the base currency for a watchlist. */
|
|
169
|
+
currency: string;
|
|
170
|
+
exchangeRates: Map<string, number>;
|
|
171
|
+
}): { assets: HeatmapBoardAsset[]; omitted: number } {
|
|
172
|
+
const context: ColumnContext = {
|
|
173
|
+
activeTab: kind === "portfolio" ? collectionId : undefined,
|
|
174
|
+
baseCurrency: currency,
|
|
175
|
+
exchangeRates,
|
|
176
|
+
now: 0,
|
|
177
|
+
};
|
|
178
|
+
const sizeColumn = kind === "portfolio" ? MARKET_VALUE_COLUMN : MARKET_CAP_COLUMN;
|
|
179
|
+
const measured: HeatmapBoardAsset[] = tickers.map((ticker) => {
|
|
180
|
+
const symbol = ticker.metadata.ticker;
|
|
181
|
+
const snapshot = financials.get(symbol);
|
|
182
|
+
const quote = snapshot?.quote;
|
|
183
|
+
const price = quote != null && Number.isFinite(quote.price) ? quote.price : null;
|
|
184
|
+
const size = positiveNumber(getSortValue(sizeColumn, ticker, snapshot, context));
|
|
185
|
+
const hasChange = quote != null && Number.isFinite(quote.changePercent);
|
|
186
|
+
return {
|
|
187
|
+
symbol,
|
|
188
|
+
name: quote?.name?.trim() || ticker.metadata.name || symbol,
|
|
189
|
+
price: price ?? 0,
|
|
190
|
+
change: quote != null && Number.isFinite(quote.change) ? quote.change : 0,
|
|
191
|
+
changePercent: hasChange ? quote.changePercent : 0,
|
|
192
|
+
hasChange,
|
|
193
|
+
size,
|
|
194
|
+
weight: size == null ? undefined : kind === "portfolio" ? size : Math.sqrt(size),
|
|
195
|
+
sizeKind: "market-cap",
|
|
196
|
+
sizeCaption: kind === "portfolio" ? "Value" : undefined,
|
|
197
|
+
sizeCurrency: currency,
|
|
198
|
+
showSize: size != null,
|
|
199
|
+
volume: typeof quote?.volume === "number" && Number.isFinite(quote.volume) ? quote.volume : null,
|
|
200
|
+
currency: quote?.currency || ticker.metadata.currency || currency,
|
|
201
|
+
exchange: ticker.metadata.exchange || "",
|
|
202
|
+
sector: ticker.metadata.sector ?? null,
|
|
203
|
+
industry: ticker.metadata.industry ?? null,
|
|
204
|
+
marketState: quote?.marketState ?? null,
|
|
205
|
+
source: "gloom",
|
|
206
|
+
};
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
measured.sort((left, right) => (
|
|
210
|
+
(right.size ?? 0) - (left.size ?? 0) || left.symbol.localeCompare(right.symbol)
|
|
211
|
+
));
|
|
212
|
+
const kept = measured.slice(0, MAX_PORTFOLIO_TILES);
|
|
213
|
+
const sizes = kept.flatMap((asset) => (asset.size != null ? [asset.size] : []));
|
|
214
|
+
const floor = sizes.length > 0 ? Math.min(...sizes) : 1;
|
|
215
|
+
const floorWeight = kind === "portfolio" ? floor : Math.sqrt(floor);
|
|
216
|
+
return {
|
|
217
|
+
assets: kept.map((asset) => (asset.size != null ? asset : { ...asset, weight: floorWeight })),
|
|
218
|
+
omitted: measured.length - kept.length,
|
|
219
|
+
};
|
|
220
|
+
}
|
|
@@ -52,6 +52,7 @@ export function SessionMoversBody(props: {
|
|
|
52
52
|
session: UsSession;
|
|
53
53
|
focused: boolean;
|
|
54
54
|
width: number;
|
|
55
|
+
height: number;
|
|
55
56
|
summaryQuotes: MarketSummaryQuote[];
|
|
56
57
|
liveStreaming: boolean;
|
|
57
58
|
}) {
|
|
@@ -66,11 +67,13 @@ export function SessionMoversBody(props: {
|
|
|
66
67
|
entitled ? null : { info: summaryFooterSegments(props.summaryQuotes) }
|
|
67
68
|
), [entitled, props.summaryQuotes]);
|
|
68
69
|
|
|
69
|
-
if (!access.signedIn) return <SignInWall action="see pre-market, after-hours and gap movers" />;
|
|
70
|
-
if (!access.emailVerified) return <SignInWall action="see pre-market, after-hours and gap movers" needsVerification />;
|
|
70
|
+
if (!access.signedIn) return <SignInWall placement="most-signin" width={props.width} height={props.height} action="see pre-market, after-hours and gap movers" />;
|
|
71
|
+
if (!access.emailVerified) return <SignInWall placement="most-signin" width={props.width} height={props.height} action="see pre-market, after-hours and gap movers" needsVerification />;
|
|
71
72
|
if (!entitled) {
|
|
72
73
|
return (
|
|
73
74
|
<ProWall
|
|
75
|
+
placement="most-wall"
|
|
76
|
+
width={props.width} height={props.height}
|
|
74
77
|
title="Pre-market, after-hours and gap movers are part of Gloom Cloud Pro."
|
|
75
78
|
message="The whole listed US market from 04:00 to 20:00, with relative volume, VWAP, float and catalysts."
|
|
76
79
|
/>
|