gloomberb 0.20.12 → 0.20.13
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/package.json +1 -1
- package/src/account/billing.ts +3 -2
- package/src/account/upgrade-dialog.tsx +8 -8
- package/src/api-client/index.ts +10 -2
- package/src/api-client/install-experiments.ts +146 -0
- package/src/api-client/telemetry.ts +47 -0
- package/src/api-client/types/market.ts +4 -0
- package/src/api-client/types/news.ts +16 -0
- package/src/architecture/floating-promise-allowlist.json +17 -33
- package/src/brokers/signed-in/adapter.ts +2 -2
- package/src/brokers/signed-in/catalog.ts +13 -4
- package/src/cli/commands/market.ts +51 -32
- package/src/cli/commands/overview.ts +3 -3
- package/src/cli/commands/search.ts +103 -9
- package/src/cli/commands/ticker.ts +22 -13
- package/src/cli/earnings-calendar.ts +33 -53
- package/src/cli/history-rows.ts +18 -1
- package/src/cli/known-gaps.ts +9 -0
- package/src/cli/listing-arg.ts +105 -18
- package/src/cli/pane-functions/catalog.ts +55 -7
- package/src/cli/pane-functions/dom.ts +8 -1
- package/src/cli/pane-functions/freshness.ts +2 -2
- package/src/cli/pane-functions/headless.ts +8 -8
- package/src/cli/pane-functions/index.ts +1 -1
- package/src/cli/pane-functions/report.ts +4 -1
- package/src/cli/perpetual-contract.ts +4 -4
- package/src/cli/quote-answer.ts +6 -2
- package/src/cli/result.ts +2 -1
- package/src/components/chart/composite/axis-overlays.tsx +5 -2
- package/src/components/chart/composite/composite-chart.tsx +1 -0
- package/src/components/chart/composite/format.ts +101 -15
- package/src/components/chart/composite/legend.tsx +60 -25
- package/src/components/chart/composite/time-axis.ts +51 -29
- package/src/components/chart/composite/toolbar.tsx +42 -6
- package/src/components/chart/curve/curve-surface.tsx +5 -5
- package/src/components/command-bar/list/badge.ts +8 -5
- package/src/components/command-bar/list/model.ts +0 -5
- package/src/components/command-bar/list/view.tsx +39 -2
- package/src/components/command-bar/routes/root/plugin-install.ts +4 -2
- package/src/components/command-bar/routes/root/provider-search.ts +23 -3
- package/src/components/command-bar/routes/root/results.ts +20 -9
- package/src/components/command-bar/routes/root/start-here.ts +1 -2
- package/src/components/command-bar/routes/ticker-search/actions.ts +2 -3
- package/src/components/command-bar/routes/ticker-search/results.ts +23 -4
- package/src/components/data-table/view.tsx +29 -6
- package/src/components/form-modal/host.tsx +1 -1
- package/src/components/layout/header.tsx +3 -2
- package/src/components/layout/market-summary.ts +3 -3
- package/src/components/layout/pane/error-boundary.tsx +2 -1
- package/src/components/markdown-text.tsx +36 -0
- package/src/components/market-board/index.tsx +4 -3
- package/src/components/onboarding/first-run-workspace.ts +46 -11
- package/src/components/onboarding/onboarding-keyboard.ts +57 -5
- package/src/components/onboarding/onboarding-wizard.tsx +91 -24
- package/src/components/onboarding/portfolio-step/index.tsx +1 -0
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +36 -9
- package/src/components/onboarding/portfolio-step/types.ts +2 -0
- package/src/components/onboarding/tickers-step-model.ts +140 -0
- package/src/components/onboarding/tickers-step.tsx +116 -0
- package/src/components/onboarding/use-onboarding-broker-form.ts +1 -1
- package/src/components/onboarding/use-onboarding-progress.ts +100 -11
- package/src/components/onboarding/use-onboarding-upgrade.ts +3 -2
- package/src/components/onboarding/wizard-model.ts +3 -1
- package/src/components/onboarding/wizard-tickers.ts +139 -0
- package/src/components/price-performance.tsx +2 -2
- package/src/components/speedometer-gauge/model.ts +2 -1
- package/src/components/speedometer-gauge/terminal.tsx +13 -8
- package/src/components/ui/choice-dialog.tsx +101 -32
- package/src/components/ui/multi-select/dialog.tsx +1 -7
- package/src/components/ui/not-meaningful.ts +16 -0
- package/src/components/ui/query-bar.tsx +16 -4
- package/src/components/ui/stat-grid.tsx +27 -6
- package/src/data/config/store/normalize.ts +2 -0
- package/src/docs/snapshot.json +1 -1
- package/src/i18n/es.ts +5 -2
- package/src/i18n/ja.ts +5 -2
- package/src/i18n/ko.ts +5 -2
- package/src/i18n/zh-cn.ts +5 -2
- package/src/i18n/zh-tw.ts +5 -2
- package/src/layout-marketplace/model.ts +2 -1
- package/src/market-data/futures-contract.ts +2 -1
- package/src/market-data/hooks.tsx +1 -1
- package/src/market-data/market/change-basis.ts +27 -5
- package/src/market-data/market/format.ts +13 -13
- package/src/market-data/quotes/listing-enterprise-value.ts +3 -3
- package/src/market-data/quotes/time.ts +17 -10
- package/src/market-data/tax-equivalent.ts +3 -2
- package/src/news/aggregator.ts +19 -8
- package/src/news/hooks.ts +1 -1
- package/src/news/news-model.ts +49 -0
- package/src/news/types.ts +9 -0
- package/src/plugins/builtin/account-management/calendar-tab.tsx +8 -3
- package/src/plugins/builtin/account-management/pane.tsx +9 -8
- package/src/plugins/builtin/alerts/calendar-events.ts +4 -5
- package/src/plugins/builtin/alerts/format.ts +6 -5
- package/src/plugins/builtin/alerts/headless.ts +3 -2
- package/src/plugins/builtin/alerts/history.ts +2 -1
- package/src/plugins/builtin/alerts/pane.tsx +2 -1
- package/src/plugins/builtin/alerts/price-text.ts +2 -1
- package/src/plugins/builtin/alerts/scheduled.ts +6 -5
- package/src/plugins/builtin/analytics/account-returns.ts +6 -7
- package/src/plugins/builtin/analytics/display.ts +2 -1
- package/src/plugins/builtin/analytics/pane-model.ts +5 -9
- package/src/plugins/builtin/analytics/risk-model.ts +6 -6
- package/src/plugins/builtin/analytics/risk-pane.tsx +6 -5
- package/src/plugins/builtin/analytics/view.tsx +5 -5
- package/src/plugins/builtin/attention/model.ts +6 -5
- package/src/plugins/builtin/attention/pane.tsx +5 -4
- package/src/plugins/builtin/awards/detail.tsx +5 -4
- package/src/plugins/builtin/awards/headless.ts +8 -7
- package/src/plugins/builtin/awards/model.ts +4 -3
- package/src/plugins/builtin/awards/pane.tsx +4 -4
- package/src/plugins/builtin/backtest/format.ts +3 -2
- package/src/plugins/builtin/backtest/report.ts +3 -2
- package/src/plugins/builtin/bond-calculator/headless.ts +2 -1
- package/src/plugins/builtin/bond-calculator/pane.tsx +2 -1
- package/src/plugins/builtin/broker-manager/add-flow.tsx +1 -1
- package/src/plugins/builtin/broker-trading/orders-data.ts +3 -3
- package/src/plugins/builtin/broker-trading/orders.tsx +3 -2
- package/src/plugins/builtin/broker-trading/ticket.tsx +2 -2
- package/src/plugins/builtin/buildout/cells.tsx +2 -1
- package/src/plugins/builtin/buildout/company/pane.tsx +4 -3
- package/src/plugins/builtin/buildout/data-runtime.ts +21 -23
- package/src/plugins/builtin/buildout/detail/values.ts +2 -1
- package/src/plugins/builtin/buildout/format.ts +4 -3
- package/src/plugins/builtin/buildout/pane/index.tsx +3 -3
- package/src/plugins/builtin/catalysts/detail.tsx +2 -1
- package/src/plugins/builtin/catalysts/model.ts +6 -5
- package/src/plugins/builtin/catalysts/pane.tsx +2 -1
- package/src/plugins/builtin/cds/headless.ts +3 -2
- package/src/plugins/builtin/cds/model.ts +8 -8
- package/src/plugins/builtin/cds/pane.tsx +3 -2
- package/src/plugins/builtin/central-bank-rates/headless.ts +2 -1
- package/src/plugins/builtin/central-bank-rates/model.ts +3 -2
- package/src/plugins/builtin/central-bank-rates/pane.tsx +5 -5
- package/src/plugins/builtin/changelog/index.tsx +2 -2
- package/src/plugins/builtin/chart-composer/index.tsx +4 -2
- package/src/plugins/builtin/chart-composer/pane.tsx +7 -3
- package/src/plugins/builtin/chart-composer/use-series-catalog.ts +3 -1
- package/src/plugins/builtin/chart-composer/user-series.ts +3 -1
- package/src/plugins/builtin/chat/attachments/desktop.tsx +2 -1
- package/src/plugins/builtin/chat/controller/utils.ts +2 -1
- package/src/plugins/builtin/clinical-trials/model.ts +4 -3
- package/src/plugins/builtin/clinical-trials/sponsor-tickers.ts +4 -2
- package/src/plugins/builtin/cloud/askg/lock-note.ts +16 -4
- package/src/plugins/builtin/cloud/askg/model.ts +2 -1
- package/src/plugins/builtin/cloud/askg/pane.tsx +35 -1
- package/src/plugins/builtin/cloud/company-picker.tsx +1 -3
- package/src/plugins/builtin/cloud/team/pane.tsx +12 -12
- package/src/plugins/builtin/cloud/thesis/detail.tsx +13 -8
- package/src/plugins/builtin/cloud-tweets/model.ts +2 -2
- package/src/plugins/builtin/comment-letters/pane.tsx +2 -1
- package/src/plugins/builtin/commodity-balances/headless.ts +3 -2
- package/src/plugins/builtin/company-attention/app-rank.tsx +5 -4
- package/src/plugins/builtin/company-attention/building-model.ts +7 -7
- package/src/plugins/builtin/company-attention/headless.ts +6 -5
- package/src/plugins/builtin/company-attention/model.ts +4 -4
- package/src/plugins/builtin/company-attention/moves-model.ts +9 -9
- package/src/plugins/builtin/company-attention/signals-model.ts +9 -9
- package/src/plugins/builtin/company-kpis/headless.ts +2 -1
- package/src/plugins/builtin/company-kpis/model.ts +15 -10
- package/src/plugins/builtin/company-kpis/pane.tsx +2 -2
- package/src/plugins/builtin/congress-trades/detail.tsx +6 -5
- package/src/plugins/builtin/congress-trades/headless.ts +2 -1
- package/src/plugins/builtin/congress-trades/model.ts +6 -6
- package/src/plugins/builtin/congress-trades/table.tsx +7 -6
- package/src/plugins/builtin/connections/pane.tsx +5 -5
- package/src/plugins/builtin/correlation/headless.ts +2 -2
- package/src/plugins/builtin/correlation/index.tsx +4 -1
- package/src/plugins/builtin/correlation/matrix/selection.ts +2 -1
- package/src/plugins/builtin/correlation/relationship/view-model.ts +3 -3
- package/src/plugins/builtin/cot/headless.ts +3 -2
- package/src/plugins/builtin/cot/model.ts +2 -1
- package/src/plugins/builtin/cot/pane.tsx +4 -3
- package/src/plugins/builtin/cpi/headless.ts +4 -3
- package/src/plugins/builtin/cpi/model.ts +8 -7
- package/src/plugins/builtin/credit-boards/cdx-pane.tsx +5 -4
- package/src/plugins/builtin/credit-boards/headless.ts +2 -1
- package/src/plugins/builtin/credit-boards/model.ts +5 -5
- package/src/plugins/builtin/credit-conditions/headless.ts +2 -1
- package/src/plugins/builtin/credit-conditions/index.tsx +2 -2
- package/src/plugins/builtin/credit-documents/model.ts +2 -2
- package/src/plugins/builtin/crypto-board/defi-view.tsx +7 -7
- package/src/plugins/builtin/crypto-board/defi.ts +2 -2
- package/src/plugins/builtin/crypto-board/model.ts +4 -3
- package/src/plugins/builtin/crypto-board/pane.tsx +8 -8
- package/src/plugins/builtin/crypto-board/supply.ts +2 -2
- package/src/plugins/builtin/crypto-etf-flows/model.ts +4 -4
- package/src/plugins/builtin/custom-view/index.tsx +3 -1
- package/src/plugins/builtin/custom-view/pane.tsx +5 -1
- package/src/plugins/builtin/custom-view/view-spec.ts +11 -0
- package/src/plugins/builtin/debt-maturities/model.ts +3 -3
- package/src/plugins/builtin/debt-maturities/pane.tsx +2 -2
- package/src/plugins/builtin/dividend-yield/client.ts +7 -3
- package/src/plugins/builtin/dividend-yield/headless.ts +16 -11
- package/src/plugins/builtin/dividend-yield/pane.tsx +12 -10
- package/src/plugins/builtin/dividend-yield/ranking-view.tsx +4 -1
- package/src/plugins/builtin/dividend-yield/ranking.ts +19 -11
- package/src/plugins/builtin/dividend-yield/types.ts +4 -0
- package/src/plugins/builtin/dividend-yield/view.ts +3 -3
- package/src/plugins/builtin/docs/use-docs.ts +4 -2
- package/src/plugins/builtin/doe/headless.ts +2 -1
- package/src/plugins/builtin/doe/model.ts +12 -11
- package/src/plugins/builtin/earnings/board-model.ts +14 -8
- package/src/plugins/builtin/earnings/board-table.ts +13 -8
- package/src/plugins/builtin/earnings/calendar-model.ts +5 -5
- package/src/plugins/builtin/earnings/calendar.tsx +2 -1
- package/src/plugins/builtin/earnings/format.ts +16 -14
- package/src/plugins/builtin/earnings/headless.ts +57 -19
- package/src/plugins/builtin/earnings/history-model.ts +11 -7
- package/src/plugins/builtin/earnings/history-table.ts +14 -9
- package/src/plugins/builtin/earnings/history.tsx +4 -3
- package/src/plugins/builtin/earnings-calls/calendar.tsx +2 -1
- package/src/plugins/builtin/earnings-calls/format.ts +6 -5
- package/src/plugins/builtin/earnings-calls/upcoming.ts +5 -5
- package/src/plugins/builtin/earnings-ripple/headless.ts +2 -1
- package/src/plugins/builtin/earnings-ripple/model.ts +3 -2
- package/src/plugins/builtin/earnings-ripple/pane.tsx +6 -6
- package/src/plugins/builtin/econ/calendar-model.ts +2 -2
- package/src/plugins/builtin/econ/detail-view.tsx +2 -2
- package/src/plugins/builtin/econ/index.tsx +7 -6
- package/src/plugins/builtin/econ-statistics/detail.tsx +2 -1
- package/src/plugins/builtin/econ-statistics/headless.ts +4 -4
- package/src/plugins/builtin/econ-statistics/pane.tsx +2 -2
- package/src/plugins/builtin/equity-screener/headless.ts +5 -5
- package/src/plugins/builtin/equity-screener/model.ts +6 -4
- package/src/plugins/builtin/equity-screener/pane.tsx +7 -7
- package/src/plugins/builtin/equity-screener/screen-check.ts +2 -1
- package/src/plugins/builtin/equity-screener/ticker-check.tsx +2 -1
- package/src/plugins/builtin/estimate-revisions/model.ts +3 -2
- package/src/plugins/builtin/estimate-revisions/pane.tsx +8 -8
- package/src/plugins/builtin/executives/format.ts +4 -4
- package/src/plugins/builtin/exposure/headless.ts +8 -8
- package/src/plugins/builtin/exposure/model.ts +4 -3
- package/src/plugins/builtin/exposure/pane.tsx +6 -5
- package/src/plugins/builtin/fear-greed/format.ts +7 -7
- package/src/plugins/builtin/fear-greed/headless.ts +2 -1
- package/src/plugins/builtin/filing-events/feed.ts +2 -1
- package/src/plugins/builtin/futures/table.tsx +8 -8
- package/src/plugins/builtin/futures-curve/headless.ts +18 -18
- package/src/plugins/builtin/futures-curve/model.ts +5 -5
- package/src/plugins/builtin/futures-curve/pane.tsx +8 -8
- package/src/plugins/builtin/fx-matrix/index.tsx +2 -2
- package/src/plugins/builtin/fx-matrix/pairs.ts +2 -1
- package/src/plugins/builtin/gpu/board.tsx +6 -5
- package/src/plugins/builtin/gpu/changes.tsx +2 -1
- package/src/plugins/builtin/gpu/equities.tsx +2 -2
- package/src/plugins/builtin/gpu/headless.ts +4 -3
- package/src/plugins/builtin/gpu/model.ts +8 -7
- package/src/plugins/builtin/help/functions-table.tsx +41 -9
- package/src/plugins/builtin/help/index.tsx +6 -3
- package/src/plugins/builtin/help/keybindings-editor.tsx +35 -7
- package/src/plugins/builtin/help/shortcut-table.tsx +19 -7
- package/src/plugins/builtin/help/table-cells.tsx +51 -0
- package/src/plugins/builtin/holders/pane.tsx +4 -1
- package/src/plugins/builtin/insider/base-values.ts +2 -2
- package/src/plugins/builtin/insider/display.ts +2 -1
- package/src/plugins/builtin/insider/headless.ts +16 -16
- package/src/plugins/builtin/insider/insider-data.ts +2 -1
- package/src/plugins/builtin/insider/signals-model.ts +3 -3
- package/src/plugins/builtin/insider/table-model.ts +27 -13
- package/src/plugins/builtin/insider/table.tsx +1 -1
- package/src/plugins/builtin/ipo-calendar/model.ts +4 -4
- package/src/plugins/builtin/iv-history/format.ts +8 -7
- package/src/plugins/builtin/iv-history/headless.ts +9 -8
- package/src/plugins/builtin/iv-history/pane.tsx +3 -2
- package/src/plugins/builtin/iv-history/screen-pane.tsx +5 -4
- package/src/plugins/builtin/jobs/headless.ts +11 -11
- package/src/plugins/builtin/jobs/model.ts +2 -2
- package/src/plugins/builtin/jobs/pane.tsx +5 -5
- package/src/plugins/builtin/jodi/model.ts +2 -2
- package/src/plugins/builtin/jodi/pane.tsx +2 -1
- package/src/plugins/builtin/kelly-sizer/headless.ts +4 -4
- package/src/plugins/builtin/kelly-sizer/model.ts +2 -1
- package/src/plugins/builtin/kelly-sizer/sections.tsx +2 -2
- package/src/plugins/builtin/macro-day/headless.ts +6 -5
- package/src/plugins/builtin/macro-day/model.ts +2 -1
- package/src/plugins/builtin/macro-day/pane.tsx +4 -4
- package/src/plugins/builtin/market-halts/model.ts +11 -10
- package/src/plugins/builtin/market-halts/pane.tsx +2 -1
- package/src/plugins/builtin/market-heatmap/index.tsx +4 -4
- package/src/plugins/builtin/market-movers/session-table.ts +3 -3
- package/src/plugins/builtin/market-movers/session.ts +2 -1
- package/src/plugins/builtin/market-movers/table.ts +5 -5
- package/src/plugins/builtin/market-valuation/detail.tsx +2 -2
- package/src/plugins/builtin/market-valuation/headless.ts +7 -7
- package/src/plugins/builtin/market-valuation/pane.tsx +7 -7
- package/src/plugins/builtin/members/breadth-pane.tsx +5 -4
- package/src/plugins/builtin/members/headless.ts +2 -1
- package/src/plugins/builtin/members/model.ts +3 -2
- package/src/plugins/builtin/members/pane.tsx +10 -9
- package/src/plugins/builtin/mna/distress/model.ts +2 -1
- package/src/plugins/builtin/mna/model.ts +5 -5
- package/src/plugins/builtin/money-markets/headless.ts +2 -1
- package/src/plugins/builtin/money-markets/model.ts +3 -2
- package/src/plugins/builtin/money-markets/pane.tsx +4 -4
- package/src/plugins/builtin/news/headless.ts +5 -2
- package/src/plugins/builtin/news/wire/breaking/notifications.ts +21 -19
- package/src/plugins/builtin/news/wire/news/row.ts +3 -1
- package/src/plugins/builtin/news/wire/news/table.tsx +3 -2
- package/src/plugins/builtin/news/wire/persisted-articles.ts +28 -3
- package/src/plugins/builtin/notes/headless.ts +2 -1
- package/src/plugins/builtin/notes/model.ts +2 -1
- package/src/plugins/builtin/openfda/pane.tsx +4 -3
- package/src/plugins/builtin/options/carry.ts +3 -2
- package/src/plugins/builtin/options/market-reference.ts +2 -1
- package/src/plugins/builtin/options/table.ts +48 -9
- package/src/plugins/builtin/options/view.tsx +47 -17
- package/src/plugins/builtin/options-calculator/headless.ts +3 -2
- package/src/plugins/builtin/options-calculator/pane.tsx +7 -7
- package/src/plugins/builtin/options-positioning/headless.ts +8 -7
- package/src/plugins/builtin/options-positioning/model.ts +10 -10
- package/src/plugins/builtin/options-positioning/pane.tsx +5 -5
- package/src/plugins/builtin/options-scenario/collar.ts +5 -4
- package/src/plugins/builtin/options-scenario/csp-screen-headless.ts +11 -10
- package/src/plugins/builtin/options-scenario/csp-screen-pane.tsx +15 -14
- package/src/plugins/builtin/options-scenario/csp-screen.ts +2 -1
- package/src/plugins/builtin/options-scenario/csp.ts +6 -5
- package/src/plugins/builtin/options-scenario/headless.ts +6 -5
- package/src/plugins/builtin/options-scenario/hedge.ts +3 -3
- package/src/plugins/builtin/options-scenario/pane.tsx +7 -6
- package/src/plugins/builtin/options-scenario/strategy-screen.ts +1 -1
- package/src/plugins/builtin/pe-band/headless.ts +9 -8
- package/src/plugins/builtin/pe-band/pane.tsx +7 -7
- package/src/plugins/builtin/perps/cascade.ts +3 -2
- package/src/plugins/builtin/perps/headless.ts +10 -9
- package/src/plugins/builtin/perps/model.ts +14 -14
- package/src/plugins/builtin/perps/pane.tsx +3 -2
- package/src/plugins/builtin/portfolio-list/header.tsx +2 -2
- package/src/plugins/builtin/portfolio-list/index.tsx +3 -2
- package/src/plugins/builtin/portfolio-list/pane/futures-terms.ts +4 -2
- package/src/plugins/builtin/portfolio-list/pane/period-pnl.ts +2 -1
- package/src/plugins/builtin/portfolio-list/pane/purchase-date-fx.ts +4 -2
- package/src/plugins/builtin/portfolio-list/quick-add/index.tsx +2 -2
- package/src/plugins/builtin/portfolio-list/settings.ts +4 -1
- package/src/plugins/builtin/portfolio-list/summary/index.tsx +4 -4
- package/src/plugins/builtin/power/detail.tsx +6 -5
- package/src/plugins/builtin/power/gas-model.ts +8 -7
- package/src/plugins/builtin/power/gas.tsx +2 -1
- package/src/plugins/builtin/power/headless.ts +7 -6
- package/src/plugins/builtin/power/model.ts +3 -2
- package/src/plugins/builtin/power/prices-headless.ts +10 -9
- package/src/plugins/builtin/power/prices-model.ts +3 -2
- package/src/plugins/builtin/power/prices.tsx +2 -1
- package/src/plugins/builtin/primary-dealers/model.ts +3 -3
- package/src/plugins/builtin/primary-dealers/pane.tsx +2 -2
- package/src/plugins/builtin/rate-path/headless.ts +8 -7
- package/src/plugins/builtin/rate-path/model.ts +6 -5
- package/src/plugins/builtin/rate-path/pane.tsx +6 -5
- package/src/plugins/builtin/realized-vol/fx-proxy.ts +2 -1
- package/src/plugins/builtin/realized-vol/headless.ts +11 -10
- package/src/plugins/builtin/realized-vol/pane.tsx +5 -4
- package/src/plugins/builtin/relative-rotation/headless.ts +2 -1
- package/src/plugins/builtin/relative-rotation/pane.tsx +6 -6
- package/src/plugins/builtin/research/analyst-headless.ts +5 -5
- package/src/plugins/builtin/research/analyst-model.ts +7 -7
- package/src/plugins/builtin/research/analyst-pane.tsx +7 -7
- package/src/plugins/builtin/research/client.ts +14 -0
- package/src/plugins/builtin/research/corporate-actions-pane.tsx +40 -30
- package/src/plugins/builtin/research/event-model.ts +55 -22
- package/src/plugins/builtin/research/event-sources.ts +26 -8
- package/src/plugins/builtin/research/relative-valuation-columns.ts +20 -12
- package/src/plugins/builtin/research/relative-valuation-currency.ts +16 -0
- package/src/plugins/builtin/research/relative-valuation-headless.ts +33 -21
- package/src/plugins/builtin/research/relative-valuation-model.ts +31 -17
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +29 -14
- package/src/plugins/builtin/research-search/model.ts +2 -1
- package/src/plugins/builtin/research-search/saved-view.tsx +4 -3
- package/src/plugins/builtin/revenue-breakdown/model.ts +4 -4
- package/src/plugins/builtin/reverse-dcf/headless.ts +7 -7
- package/src/plugins/builtin/reverse-dcf/model.ts +4 -4
- package/src/plugins/builtin/reverse-dcf/pane.tsx +2 -2
- package/src/plugins/builtin/scanner/flow-model.ts +7 -4
- package/src/plugins/builtin/scanner/flow-pane.tsx +1 -1
- package/src/plugins/builtin/scanner/headless.ts +3 -2
- package/src/plugins/builtin/scanner/hilo-model.ts +2 -1
- package/src/plugins/builtin/scanner/live-headless.ts +2 -2
- package/src/plugins/builtin/scanner/live-model.ts +3 -2
- package/src/plugins/builtin/scanner/live-pane.tsx +5 -5
- package/src/plugins/builtin/seasonality/headless.ts +2 -1
- package/src/plugins/builtin/seasonality/pane.tsx +4 -3
- package/src/plugins/builtin/sec/filing-display.tsx +12 -15
- package/src/plugins/builtin/sec/fund-facts.ts +2 -2
- package/src/plugins/builtin/sec/headless.ts +2 -1
- package/src/plugins/builtin/sec/index.tsx +6 -2
- package/src/plugins/builtin/sectors/headless.ts +4 -4
- package/src/plugins/builtin/sectors/index.tsx +7 -7
- package/src/plugins/builtin/shared/earnings-calendar.ts +90 -6
- package/src/plugins/builtin/shared/earnings-report.ts +13 -6
- package/src/plugins/builtin/shared/research-cells.tsx +2 -2
- package/src/plugins/builtin/shared/source-footer.ts +2 -1
- package/src/plugins/builtin/shared/trend.ts +2 -2
- package/src/plugins/builtin/shared/use-quote-board.ts +9 -8
- package/src/plugins/builtin/short-interest/headless.ts +6 -6
- package/src/plugins/builtin/short-interest/model.ts +9 -9
- package/src/plugins/builtin/short-interest/publications-model.ts +5 -5
- package/src/plugins/builtin/short-interest/publications-pane.tsx +3 -2
- package/src/plugins/builtin/short-interest/watch-headless.ts +5 -5
- package/src/plugins/builtin/short-interest/watch-pane.tsx +6 -6
- package/src/plugins/builtin/short-volume/model.ts +5 -5
- package/src/plugins/builtin/short-volume/pane.tsx +4 -4
- package/src/plugins/builtin/social-mentions/headless.ts +2 -1
- package/src/plugins/builtin/social-mentions/model.ts +4 -4
- package/src/plugins/builtin/supply-chain/graph-model.ts +2 -1
- package/src/plugins/builtin/supply-chain/graph-pane.tsx +2 -2
- package/src/plugins/builtin/supply-chain/headless.ts +3 -2
- package/src/plugins/builtin/supply-chain/model.ts +4 -4
- package/src/plugins/builtin/supply-chain/pane.tsx +2 -2
- package/src/plugins/builtin/supply-chain/row-evidence.tsx +2 -1
- package/src/plugins/builtin/themes/headless.ts +2 -1
- package/src/plugins/builtin/themes/model.ts +3 -2
- package/src/plugins/builtin/themes/pane.tsx +3 -2
- package/src/plugins/builtin/thirteenf/format.ts +9 -9
- package/src/plugins/builtin/thirteenf/headless.ts +3 -2
- package/src/plugins/builtin/thirteenf/model.ts +2 -1
- package/src/plugins/builtin/thirteenf/overlap-pane.tsx +2 -1
- package/src/plugins/builtin/thirteenf/pane.tsx +5 -4
- package/src/plugins/builtin/thirteenf/report-notes.ts +2 -1
- package/src/plugins/builtin/thirteenf/signals-pane.tsx +3 -2
- package/src/plugins/builtin/thirteenf/table.ts +6 -5
- package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +4 -3
- package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +4 -4
- package/src/plugins/builtin/ticker-detail/data-panes/returns-pane.tsx +3 -3
- package/src/plugins/builtin/ticker-detail/financials/model.ts +83 -35
- package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +3 -1
- package/src/plugins/builtin/ticker-detail/financials/ratios.ts +2 -2
- package/src/plugins/builtin/ticker-detail/financials/schema.ts +14 -18
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +8 -13
- package/src/plugins/builtin/ticker-detail/headless.ts +7 -5
- package/src/plugins/builtin/ticker-detail/overview/chart-scale.ts +52 -0
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +4 -4
- package/src/plugins/builtin/ticker-detail/overview/model.ts +24 -13
- package/src/plugins/builtin/ticker-detail/overview/pane.tsx +6 -0
- package/src/plugins/builtin/ticker-detail/overview/tax-equivalent.ts +2 -1
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +33 -7
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +7 -5
- package/src/plugins/builtin/ticker-detail/quote-monitor/rows.ts +4 -4
- package/src/plugins/builtin/ticker-detail/settings.ts +17 -0
- package/src/plugins/builtin/time-sales/headless.ts +3 -2
- package/src/plugins/builtin/time-sales/model.ts +7 -5
- package/src/plugins/builtin/time-sales/pane.tsx +7 -6
- package/src/plugins/builtin/trace-bonds/model.ts +3 -2
- package/src/plugins/builtin/trace-bonds/pane.tsx +3 -2
- package/src/plugins/builtin/treasury-auctions/client.ts +2 -1
- package/src/plugins/builtin/treasury-auctions/headless.ts +6 -6
- package/src/plugins/builtin/treasury-auctions/hk-headless.ts +3 -2
- package/src/plugins/builtin/treasury-auctions/hk-view.tsx +10 -9
- package/src/plugins/builtin/treasury-auctions/hk.ts +5 -5
- package/src/plugins/builtin/treasury-auctions/model.ts +4 -4
- package/src/plugins/builtin/treasury-auctions/pane.tsx +18 -18
- package/src/plugins/builtin/treasury-auctions/treasury-direct.ts +2 -1
- package/src/plugins/builtin/treasury-daily/model.ts +2 -2
- package/src/plugins/builtin/vol-surface/events.ts +5 -4
- package/src/plugins/builtin/vol-surface/headless.ts +19 -18
- package/src/plugins/builtin/vol-surface/heat-grid.tsx +2 -1
- package/src/plugins/builtin/vol-surface/pane.tsx +8 -7
- package/src/plugins/builtin/vol-surface/stored.ts +2 -1
- package/src/plugins/builtin/vol-surface/tables.ts +4 -3
- package/src/plugins/builtin/volatility/headless.ts +5 -4
- package/src/plugins/builtin/volatility/pane.tsx +6 -6
- package/src/plugins/builtin/world-indices/headless.ts +7 -7
- package/src/plugins/builtin/world-indices/index.tsx +3 -1
- package/src/plugins/builtin/world-venue-map/headless.ts +2 -1
- package/src/plugins/builtin/world-venue-map/layered-pane.tsx +2 -1
- package/src/plugins/builtin/world-venue-map/layers.ts +3 -2
- package/src/plugins/builtin/world-venue-map/use-geo.ts +4 -2
- package/src/plugins/builtin/yield-curve/curves.ts +3 -3
- package/src/plugins/builtin/yield-curve/headless.ts +7 -6
- package/src/plugins/builtin/yield-curve/index.tsx +5 -4
- package/src/plugins/builtin/yield-curve/swaps.tsx +2 -1
- package/src/portfolio/allocation.ts +5 -5
- package/src/portfolio/column-values.ts +47 -41
- package/src/portfolio/futures-positions.ts +2 -1
- package/src/renderers/electrobun/bun/desktop/backend-requests.ts +7 -1
- package/src/renderers/opentui/ui-host.tsx +32 -2
- package/src/renderers/share/layout-view.tsx +2 -1
- package/src/sources/gloomberb-cloud/news.ts +9 -0
- package/src/sources/gloomberb-cloud/normalizers.ts +2 -0
- package/src/sources/provider-router/search.ts +15 -10
- package/src/state/hooks/inline-tickers.ts +3 -2
- package/src/state/hooks/quote-streaming.ts +9 -10
- package/src/team/collections-sync.ts +8 -3
- package/src/telemetry/usage-counts.ts +26 -0
- package/src/tickers/company-name-listing.ts +2 -2
- package/src/tickers/company-name.ts +17 -1
- package/src/tickers/listing-venues.ts +26 -1
- package/src/tickers/renamed-listings.ts +2 -1
- package/src/tickers/search/index.ts +19 -0
- package/src/tickers/starter-symbols.ts +7 -0
- package/src/time-series/fundamentals/statement-fields.ts +11 -14
- package/src/time-series/history-acquisition.ts +1 -1
- package/src/time-series/log-scale.ts +9 -0
- package/src/time-series/reporting.ts +3 -3
- package/src/time-series/resolve.ts +6 -4
- package/src/time-series/transforms.ts +10 -5
- package/src/types/config.ts +9 -0
- package/src/types/data-provider.ts +3 -2
- package/src/types/financials.ts +15 -0
- package/src/types/instrument.ts +6 -0
- package/src/types/plugin-panes.ts +1 -1
- package/src/types/plugin-reports.ts +8 -0
- package/src/utils/datetime-format.ts +74 -33
- package/src/utils/financial-statements.ts +39 -15
- package/src/utils/format.ts +4 -9
- package/src/utils/fundamentals.ts +38 -16
- package/src/utils/growth.ts +67 -0
- package/src/utils/keyboard.ts +6 -0
- package/src/utils/options.ts +1 -1
- package/src/utils/report-timing.ts +2 -2
- package/src/utils/served-rates.ts +45 -0
- package/src/utils/text-wrap.ts +84 -3
- package/src/utils/zoned-date-time.ts +47 -22
|
@@ -2,7 +2,7 @@ import type { PerpBoardRow, PerpHistoryPayload, PerpLongShortRatio, PerpRankings
|
|
|
2
2
|
import type { DataTableCell, DataTableColumn } from "../../../components";
|
|
3
3
|
import { scalarPoint, staticSeries } from "../../../components/chart/static/series";
|
|
4
4
|
import { getTableWidth } from "../../../components/ui/table-layout";
|
|
5
|
-
import { formatCompact } from "../../../utils/format";
|
|
5
|
+
import { MISSING_VALUE, formatCompact } from "../../../utils/format";
|
|
6
6
|
import { isUsListingExchange, publicTickerKey } from "../../../utils/exchanges";
|
|
7
7
|
import { isRecord } from "../../../utils/guards";
|
|
8
8
|
import type { ThemeColors } from "../../../theme/colors";
|
|
@@ -31,12 +31,12 @@ export function uncoveredVenueNote(venue: string): string | null {
|
|
|
31
31
|
export const BOARD_SORTS = ["oi", "funding", "oi-change", "premium", "long-short"] as const;
|
|
32
32
|
export const sortLabel = (sort: string) => ({ oi: "OI", funding: "Funding", "oi-change": "OI change", premium: "Premium", "long-short": "Long %" })[sort] ?? sort;
|
|
33
33
|
export const label = (s: string) => s === "fx" ? "FX" : s.charAt(0).toUpperCase() + s.slice(1);
|
|
34
|
-
export const percent = (n: number | null | undefined, digits = 3) => n == null ?
|
|
35
|
-
export const price = (n: number | null | undefined) => n == null ?
|
|
36
|
-
export const compact = (n: number | null | undefined) => n == null ?
|
|
37
|
-
export const time = (s: string | null | undefined) => s ? `${s.slice(0, 10)} ${s.slice(11, 16)} UTC` :
|
|
34
|
+
export const percent = (n: number | null | undefined, digits = 3) => n == null ? MISSING_VALUE : `${n > 0 ? "+" : ""}${(n * 100).toFixed(digits)}%`;
|
|
35
|
+
export const price = (n: number | null | undefined) => n == null ? MISSING_VALUE : n.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: n < 1 ? 6 : 2 });
|
|
36
|
+
export const compact = (n: number | null | undefined) => n == null ? MISSING_VALUE : formatCompact(n, { fixedDecimals: true });
|
|
37
|
+
export const time = (s: string | null | undefined) => s ? `${s.slice(0, 10)} ${s.slice(11, 16)} UTC` : MISSING_VALUE;
|
|
38
38
|
/** A list row's observation, month to minute: the header names UTC and the footer the full as-of. */
|
|
39
|
-
export const observed = (s: string | null | undefined) => s ? `${s.slice(5, 10)} ${s.slice(11, 16)}` :
|
|
39
|
+
export const observed = (s: string | null | undefined) => s ? `${s.slice(5, 10)} ${s.slice(11, 16)}` : MISSING_VALUE;
|
|
40
40
|
/**
|
|
41
41
|
* The listed security a market tracks, as DES, FA and G take it: a US listing by its symbol, the key a stock is
|
|
42
42
|
* saved and opened under, and a listing abroad with its venue (`NET:XLON`), so they open the security the premium
|
|
@@ -137,7 +137,7 @@ export function collectedVenueCount(sources: unknown): number | null {
|
|
|
137
137
|
}));
|
|
138
138
|
return venues.size || null;
|
|
139
139
|
}
|
|
140
|
-
export const fundingInterval = (row: Pick<PerpBoardRow, "fundingIntervalHours" | "fundingKind">) => row.fundingIntervalHours ? `${row.fundingIntervalHours}h${row.fundingKind === "last-paid" ? " paid" : row.fundingKind === "continuous" ? " continuous" : ""}` :
|
|
140
|
+
export const fundingInterval = (row: Pick<PerpBoardRow, "fundingIntervalHours" | "fundingKind">) => row.fundingIntervalHours ? `${row.fundingIntervalHours}h${row.fundingKind === "last-paid" ? " paid" : row.fundingKind === "continuous" ? " continuous" : ""}` : MISSING_VALUE;
|
|
141
141
|
export const HISTORY_METRICS = ["funding", "oi", "premium", "price", "long-short"] as const;
|
|
142
142
|
export type HistoryMetric = typeof HISTORY_METRICS[number];
|
|
143
143
|
export const metricLabel = (metric: HistoryMetric) => metric === "oi" ? "OI" : metric === "long-short" ? "L/S" : label(metric);
|
|
@@ -175,9 +175,9 @@ export const venueLabel = (row: Pick<PerpBoardRow, "venue">) => venueName(row.ve
|
|
|
175
175
|
export const venuesOf = (rows: readonly Pick<PerpBoardRow, "venue">[]): string[] => [...new Set<string>(rows.map((row) => row.venue))].sort((a, b) => venueName(a).localeCompare(venueName(b)));
|
|
176
176
|
|
|
177
177
|
/** A share of accounts, unsigned: 0.6183 reads 61.8%. */
|
|
178
|
-
export const share = (n: number | null | undefined, digits = 1) => n == null ?
|
|
178
|
+
export const share = (n: number | null | undefined, digits = 1) => n == null ? MISSING_VALUE : `${(n * 100).toFixed(digits)}%`;
|
|
179
179
|
/** Long accounts per short account, as the venue publishes it. */
|
|
180
|
-
export const ratioText = (n: number | null | undefined, digits = 2) => n == null ?
|
|
180
|
+
export const ratioText = (n: number | null | undefined, digits = 2) => n == null ? MISSING_VALUE : n.toFixed(digits);
|
|
181
181
|
/** What a long/short reading counts, short enough for a legend; `definitionText` says it in full. */
|
|
182
182
|
const longShortDefinition = (definition: string | null | undefined) => definition === "accounts_all" || !definition ? "All accounts" : label(definition.replaceAll("_", " "));
|
|
183
183
|
const LONG_SHORT_REASONS: Record<string, string> = { unsupported: "This venue publishes no per-contract account ratio", off: "Not collected yet", collecting: "Collecting" };
|
|
@@ -207,8 +207,8 @@ export function positioningFields(row: Pick<PerpBoardRow, "longShortRatio" | "lo
|
|
|
207
207
|
}
|
|
208
208
|
|
|
209
209
|
// One text per figure, shared by the pane cells and the text report so the two always agree.
|
|
210
|
-
const markText = (row: Pick<PerpBoardRow, "markPrice" | "quoteCurrency">) => row.markPrice == null ?
|
|
211
|
-
const fundingPerInterval = (row: Pick<PerpBoardRow, "fundingRate" | "fundingIntervalHours" | "fundingKind">) => row.fundingRate == null ?
|
|
210
|
+
const markText = (row: Pick<PerpBoardRow, "markPrice" | "quoteCurrency">) => row.markPrice == null ? MISSING_VALUE : `${price(row.markPrice)} ${row.quoteCurrency}`;
|
|
211
|
+
const fundingPerInterval = (row: Pick<PerpBoardRow, "fundingRate" | "fundingIntervalHours" | "fundingKind">) => row.fundingRate == null ? MISSING_VALUE : `${percent(row.fundingRate, 5)} /${fundingInterval(row)}`;
|
|
212
212
|
/**
|
|
213
213
|
* The contract a bare name opens: the one with the largest open interest across venues, among the venues read
|
|
214
214
|
* recently (a stale one only when every one is). When that contract is Hyperliquid's, Hyperliquid's own pick is
|
|
@@ -252,7 +252,7 @@ export function venueAprSummary(rows: readonly PerpBoardRow[]) {
|
|
|
252
252
|
oiWeighted: rated.length >= 2 ? oiWeighted : null, baseline, stale };
|
|
253
253
|
}
|
|
254
254
|
/** Percentage points between two fractions: 0.00003 reads 0.0030pp. */
|
|
255
|
-
const points = (n: number | null | undefined, digits = 4) => n == null ?
|
|
255
|
+
const points = (n: number | null | undefined, digits = 4) => n == null ? MISSING_VALUE : `${(n * 100).toFixed(digits)}pp`;
|
|
256
256
|
|
|
257
257
|
export type PerpColumnId = "market" | "venue" | "symbol" | "markPrice" | "fundingRate" | "fundingRate8h" | "fundingApr" | "premium"
|
|
258
258
|
| "openInterestUsd" | "oiChange24h" | "longShare" | "priceChange24h" | "observedAt" | "value";
|
|
@@ -315,7 +315,7 @@ export function perpCellText(row: PerpBoardRow, id: PerpColumnId): string {
|
|
|
315
315
|
if (id === "observedAt") return observed(row.observedAt);
|
|
316
316
|
if (id === "longShare") return share(row.longShortRatio?.longShare);
|
|
317
317
|
const digits = SIGNED[id];
|
|
318
|
-
return digits === undefined ?
|
|
318
|
+
return digits === undefined ? MISSING_VALUE : percent(row[id as keyof PerpBoardRow] as number | null, digits);
|
|
319
319
|
}
|
|
320
320
|
export function perpCell(row: PerpBoardRow, id: PerpColumnId, colors: Pick<ThemeColors, "positive" | "negative" | "text" | "textBright" | "textMuted" | "textDim">): DataTableCell {
|
|
321
321
|
const text = perpCellText(row, id);
|
|
@@ -371,7 +371,7 @@ export function historyColumns(metric: HistoryMetric, currency: string, hasCandl
|
|
|
371
371
|
{ id: "basis", label: "Observation basis", width: 25, align: "left" },
|
|
372
372
|
];
|
|
373
373
|
}
|
|
374
|
-
export const historyChange = (value: number | null | undefined, metric: HistoryMetric) => value == null ?
|
|
374
|
+
export const historyChange = (value: number | null | undefined, metric: HistoryMetric) => value == null ? MISSING_VALUE
|
|
375
375
|
: inPoints(metric) ? `${value > 0 ? "+" : ""}${(value * 100).toFixed(metric === "funding" ? 4 : metric === "long-short" ? 2 : 3)}pp` : historyValue(value, metric);
|
|
376
376
|
export function historyCaption(data: PerpHistoryPayload | null | undefined, metric: HistoryMetric) {
|
|
377
377
|
if (metric === "long-short") {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import { Fragment, useCallback, useEffect, useMemo, useState, type ReactNode } from "react";
|
|
2
3
|
import { isAccessDenied } from "../../../api-client/errors";
|
|
3
4
|
import { usePlanAccess } from "../../../api-client/plan-access";
|
|
@@ -69,7 +70,7 @@ function MarketEvidence({ row, data, width, height }: { row: PerpBoardRow; data:
|
|
|
69
70
|
["Mark", `${price(row.markPrice)} ${row.quoteCurrency}`], ["Oracle", `${price(row.oraclePrice)} ${row.quoteCurrency}`], ["Premium vs oracle", percent(row.premium)]]],
|
|
70
71
|
["Funding", [["Funding", `${percent(row.fundingRate, 5)} / ${fundingInterval(row)}`, row.fundingKind === "last-paid" ? "Last paid" : row.fundingKind === "continuous" ? "Continuous rate" : "Current rate"],
|
|
71
72
|
["Funding 8h / APR", `${percent(row.fundingRate8h, 4)} / ${percent(row.fundingApr, 2)}`, row.fundingIntervalHours ? `APR = current ${aprFormula(row.fundingIntervalHours)}` : undefined],
|
|
72
|
-
...(row.predictedFundingRate != null ? [["Predicted funding", `${percent(row.predictedFundingRate)} / ${row.predictedFundingIntervalHours ??
|
|
73
|
+
...(row.predictedFundingRate != null ? [["Predicted funding", `${percent(row.predictedFundingRate)} / ${row.predictedFundingIntervalHours ?? MISSING_VALUE}h`] as [string, string]] : []),
|
|
73
74
|
...(row.nextFundingAt ? [["Next funding", time(row.nextFundingAt)] as [string, string]] : []),
|
|
74
75
|
...(acrossVenues ? [["APR across venues", acrossVenues.text] as [string, string]] : [])]],
|
|
75
76
|
["Open Interest", [["Open interest", `${compact(row.openInterestBase)} ${row.baseAsset} · ${compact(row.openInterestUsd)} USD`],
|
|
@@ -77,7 +78,7 @@ function MarketEvidence({ row, data, width, height }: { row: PerpBoardRow; data:
|
|
|
77
78
|
...(positioning ? [["Positioning", positioning.map((field) => [field.label, field.text, field.detail])] as [string, EvidenceField[]]] : []),
|
|
78
79
|
...(row.underlying ? [["Underlying", [...listed, ["Underlying last", `${price(row.underlying.price)} ${row.underlying.currency}`, time(row.underlying.asOf)], ["Underlying session", row.underlying.marketState ?? "Unknown"],
|
|
79
80
|
["Premium vs underlying", percent(row.underlyingPremium)], ["Closed-market premium", percent(row.closedMarketPremium)]]] as [string, EvidenceField[]]] : []),
|
|
80
|
-
["Contract", [["Contract", `${label(row.contractType)} · ${row.priceMultiplier}× price`], ["Margin", row.marginCurrency], ["Max leverage", row.maxLeverage == null ?
|
|
81
|
+
["Contract", [["Contract", `${label(row.contractType)} · ${row.priceMultiplier}× price`], ["Margin", row.marginCurrency], ["Max leverage", row.maxLeverage == null ? MISSING_VALUE : `${row.maxLeverage}×`],
|
|
81
82
|
["Margin mode", row.isolatedOnly === null ? "Unspecified" : row.isolatedOnly ? "Isolated only" : "Cross / isolated"], ["Listing", row.delisted ? "Delisted" : "Active"], ["Confidence", label(row.confidence)]]],
|
|
82
83
|
];
|
|
83
84
|
// The ticker's link is not listed in the pane menu again: `d` there opens the same DES.
|
|
@@ -2,7 +2,7 @@ import { ActionRow } from "../../../components/ui/action-row";
|
|
|
2
2
|
import { Box, ScrollBox, Text } from "../../../ui";
|
|
3
3
|
import { t } from "../../../i18n";
|
|
4
4
|
import { colors } from "../../../theme/colors";
|
|
5
|
-
import { formatCompact, padTo } from "../../../utils/format";
|
|
5
|
+
import { MISSING_VALUE, formatCompact, padTo } from "../../../utils/format";
|
|
6
6
|
import { formatMarketQuantity } from "../../../market-data/market/format";
|
|
7
7
|
import {
|
|
8
8
|
renderSummarySegments,
|
|
@@ -55,7 +55,7 @@ export function PortfolioCashMarginDrawer({
|
|
|
55
55
|
<Text fg={colors.textDim}>{" qty "}</Text>
|
|
56
56
|
<Text fg={colors.text}>{padTo(formatMarketQuantity(balance.quantity, { isCashBalance: true, maxWidth: 14 }), 14, "right")}</Text>
|
|
57
57
|
<Text fg={colors.textDim}>{" value "}</Text>
|
|
58
|
-
<Text fg={colors.text}>{padTo(balance.baseValue != null ? formatCompact(balance.baseValue, { fixedDecimals: true }) :
|
|
58
|
+
<Text fg={colors.text}>{padTo(balance.baseValue != null ? formatCompact(balance.baseValue, { fixedDecimals: true }) : MISSING_VALUE, 10, "right")}</Text>
|
|
59
59
|
</Box>
|
|
60
60
|
))
|
|
61
61
|
)}
|
|
@@ -42,7 +42,8 @@ function createCollectionPaneInstance(
|
|
|
42
42
|
const named = argument?.trim() ? findCollection(context.config, argument, { prefix: true }) : null;
|
|
43
43
|
const collectionId = named && (!kind || named.kind === kind)
|
|
44
44
|
? named.id
|
|
45
|
-
:
|
|
45
|
+
// PF alone is the portfolio: the one in view, else the first, and a watchlist only where there is no portfolio.
|
|
46
|
+
: resolveCollectionIdForKind(context, kind ?? "portfolio") ?? (kind ? null : resolveCollectionPaneId(context));
|
|
46
47
|
return collectionId ? { params: { collectionId } } : null;
|
|
47
48
|
}
|
|
48
49
|
|
|
@@ -89,7 +90,7 @@ export const portfolioListModule: PluginModule = {
|
|
|
89
90
|
{
|
|
90
91
|
id: "new-collection-pane",
|
|
91
92
|
paneId: "portfolio-list",
|
|
92
|
-
label: "
|
|
93
|
+
label: "Portfolio",
|
|
93
94
|
description: "Holdings, weights and P&L of a portfolio or watchlist; set target weights to see drift and the trades that rebalance",
|
|
94
95
|
// Phrases rather than bare words, so `fn rebalance` and `fn target` keep resolving where they did.
|
|
95
96
|
keywords: [
|
|
@@ -3,6 +3,7 @@ import { useAssetData } from "../../../runtime";
|
|
|
3
3
|
import { isFuturesTicker, type PortfolioFuturesTerms } from "../../../../portfolio/futures-positions";
|
|
4
4
|
import { dailyFuturesHistory, loadPortfolioFuturesTerms } from "../../../../portfolio/futures-terms";
|
|
5
5
|
import type { TickerRecord } from "../../../../types/ticker";
|
|
6
|
+
import { logFailure } from "../../../../utils/log-failure";
|
|
6
7
|
|
|
7
8
|
/** Settlements land once a day and the terms change with a roll; the terms cache answers sooner reads. */
|
|
8
9
|
const REFRESH_MS = 30 * 60_000;
|
|
@@ -45,12 +46,13 @@ export function usePortfolioFuturesTerms(
|
|
|
45
46
|
if (!key) return;
|
|
46
47
|
let cancelled = false;
|
|
47
48
|
const requestKey = `${key}|${settlement}`;
|
|
48
|
-
|
|
49
|
+
// A future whose terms cannot be read maps to none; anything else is logged.
|
|
50
|
+
loadPortfolioFuturesTerms(futuresRef.current, {
|
|
49
51
|
settlement,
|
|
50
52
|
sources: dataProvider ? { history: dailyFuturesHistory(dataProvider) } : {},
|
|
51
53
|
}).then((terms) => {
|
|
52
54
|
if (!cancelled) setState((previous) => ({ key: requestKey, terms, version: previous.version + 1 }));
|
|
53
|
-
});
|
|
55
|
+
}, logFailure("portfolio-list.futures-terms", "Reading futures terms failed"));
|
|
54
56
|
return () => { cancelled = true; };
|
|
55
57
|
}, [dataProvider, key, refresh, settlement]);
|
|
56
58
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { formatShortDate } from "../../../../utils/datetime-format";
|
|
1
2
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
2
3
|
import { apiClient } from "../../../../api-client";
|
|
3
4
|
import type { PortfolioFuturesTerms } from "../../../../portfolio/futures-positions";
|
|
@@ -23,7 +24,7 @@ export interface PanePeriodPnl {
|
|
|
23
24
|
|
|
24
25
|
const NO_ROWS: ReadonlyMap<string, PeriodPnlRow> = new Map();
|
|
25
26
|
|
|
26
|
-
const dayMonth = (day: string) =>
|
|
27
|
+
const dayMonth = (day: string) => formatShortDate(day, { year: false, utc: true });
|
|
27
28
|
|
|
28
29
|
/** The day every priced row shares at one end, else the window's own date. */
|
|
29
30
|
function sharedDay(result: LoadedPeriodPnl, end: "start" | "end", fallback: string): string {
|
|
@@ -2,6 +2,7 @@ import { useEffect, useMemo, useRef, useState } from "react";
|
|
|
2
2
|
import { apiClient } from "../../../../api-client";
|
|
3
3
|
import { loadPurchaseDateCostFx, purchaseDatesToRead, type PurchaseDateCostFx } from "../../../../portfolio/cost-fx";
|
|
4
4
|
import type { TickerRecord } from "../../../../types/ticker";
|
|
5
|
+
import { logFailure } from "../../../../utils/log-failure";
|
|
5
6
|
|
|
6
7
|
/** A past close does not change; a date that could not be read is tried again this often. */
|
|
7
8
|
const REFRESH_MS = 30 * 60_000;
|
|
@@ -36,9 +37,10 @@ export function usePurchaseDateCostFx(
|
|
|
36
37
|
useEffect(() => {
|
|
37
38
|
if (!key) return;
|
|
38
39
|
let cancelled = false;
|
|
39
|
-
|
|
40
|
+
// A date whose closes cannot be read is left out; anything else is logged.
|
|
41
|
+
loadPurchaseDateCostFx(tickersRef.current, { into, history: apiClient, portfolioId }).then((rates) => {
|
|
40
42
|
if (!cancelled) setState({ scope: `${into}|${portfolioId}`, rates });
|
|
41
|
-
});
|
|
43
|
+
}, logFailure("portfolio-list.purchase-date-fx", "Reading purchase date FX closes failed"));
|
|
42
44
|
return () => { cancelled = true; };
|
|
43
45
|
}, [into, key, portfolioId, refresh]);
|
|
44
46
|
|
|
@@ -11,7 +11,7 @@ import { getSharedRegistry } from "../../../registry";
|
|
|
11
11
|
import { usePluginAppActions } from "../../../runtime";
|
|
12
12
|
import { isDialogOpen } from "../../../../ui/dialog-stack";
|
|
13
13
|
import { colors, priceColor } from "../../../../theme/colors";
|
|
14
|
-
import { formatPercentRaw } from "../../../../utils/format";
|
|
14
|
+
import { MISSING_VALUE, formatPercentRaw } from "../../../../utils/format";
|
|
15
15
|
import { formatMarketPrice, quoteFormatOptions } from "../../../../market-data/market/format";
|
|
16
16
|
import { listingChoiceQuery, upsertTickerFromSearchResult } from "../../../../tickers/search";
|
|
17
17
|
import type { TickerRecord } from "../../../../types/ticker";
|
|
@@ -107,7 +107,7 @@ function QuickAddPreview({
|
|
|
107
107
|
?? (validation.resolved.kind === "provider" ? validation.resolved.result.type : undefined);
|
|
108
108
|
const priceText = quote?.price != null
|
|
109
109
|
? formatMarketPrice(quote.price, { ...quoteFormatOptions(quote, assetCategory), maxWidth: 12 })
|
|
110
|
-
:
|
|
110
|
+
: MISSING_VALUE;
|
|
111
111
|
const changeValue = quote?.changePercent;
|
|
112
112
|
const name = tickerNameFromValidation(validation);
|
|
113
113
|
const exchange = exchangeLabelFromValidation(validation);
|
|
@@ -416,7 +416,10 @@ export function buildPortfolioPaneSettingsDef(
|
|
|
416
416
|
type: "toggle",
|
|
417
417
|
});
|
|
418
418
|
return {
|
|
419
|
-
|
|
419
|
+
// Named for what the pane shows: a watchlist's settings are not a portfolio's.
|
|
420
|
+
title: activeCollectionId && !activeCollectionIsPortfolio && config.watchlists.some((watchlist) => watchlist.id === activeCollectionId)
|
|
421
|
+
? "Watchlist Settings"
|
|
422
|
+
: "Portfolio Settings",
|
|
420
423
|
values: {
|
|
421
424
|
...settings,
|
|
422
425
|
columnIds: [...settings.columnIds],
|
|
@@ -8,8 +8,8 @@ import type { BrokerConnectionStatus } from "../../../../types/broker";
|
|
|
8
8
|
import type { TickerFinancials } from "../../../../types/financials";
|
|
9
9
|
import type { Portfolio, TickerRecord } from "../../../../types/ticker";
|
|
10
10
|
import type { BrokerAccount, BrokerCashBalance } from "../../../../types/trading";
|
|
11
|
-
import { formatShortDate } from "../../../../utils/datetime-format";
|
|
12
|
-
import { displayWidth, formatPercentRaw } from "../../../../utils/format";
|
|
11
|
+
import { formatClockTime, formatShortDate } from "../../../../utils/datetime-format";
|
|
12
|
+
import { MISSING_VALUE, displayWidth, formatPercentRaw } from "../../../../utils/format";
|
|
13
13
|
import { getBrokerInstance } from "../../../../utils/broker-instances";
|
|
14
14
|
import {
|
|
15
15
|
resolvePortfolioAccountMetrics,
|
|
@@ -133,7 +133,7 @@ function formatSourceBadge(account: BrokerAccount, liveGateway: boolean): { labe
|
|
|
133
133
|
label: !syncedAt
|
|
134
134
|
? "Synced"
|
|
135
135
|
: today
|
|
136
|
-
? `Synced ${syncedAt
|
|
136
|
+
? `Synced ${formatClockTime(syncedAt)}`
|
|
137
137
|
: `Synced ${formatShortDate(syncedAt, { year: false })}`,
|
|
138
138
|
kind: "cloud",
|
|
139
139
|
};
|
|
@@ -493,7 +493,7 @@ export function buildPortfolioFooterSegments({
|
|
|
493
493
|
// Where the quotes are from and the newest's time, as `quote` ends (`Gloom Cloud · 14:44 UTC · markets open`):
|
|
494
494
|
// a bare local time ("Thu 12:25") named neither.
|
|
495
495
|
const quoted = refreshingSize > 0 ? null : quoteSourceFooterSegment(quotes, { id: "refresh" });
|
|
496
|
-
const refresh: PaneFooterSegment = quoted ?? { id: "refresh", parts: [{ text: refreshingSize > 0 ? "Refreshing..." :
|
|
496
|
+
const refresh: PaneFooterSegment = quoted ?? { id: "refresh", parts: [{ text: refreshingSize > 0 ? "Refreshing..." : MISSING_VALUE, tone: "muted" }] };
|
|
497
497
|
return [...accountStatus, refresh];
|
|
498
498
|
}
|
|
499
499
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import { isAccessDenied } from "../../../api-client/errors";
|
|
2
3
|
import { useCallback, useEffect } from "react";
|
|
3
4
|
import type { PowerProject } from "../../../api-client/power";
|
|
@@ -20,12 +21,12 @@ function ProjectFacts({ row }: { row: PowerProject }) {
|
|
|
20
21
|
["Observed UTC", row.observedAt], ["Revision", row.revision], ["Confidence", powerPercent(row.confidence)],
|
|
21
22
|
];
|
|
22
23
|
return <>
|
|
23
|
-
{facts.map(([label, value]) => <KeyValueRow key={label} label={label} value={typeof value === "number" ? powerNumber(value) : value ??
|
|
24
|
+
{facts.map(([label, value]) => <KeyValueRow key={label} label={label} value={typeof value === "number" ? powerNumber(value) : value ?? MISSING_VALUE} detail={typeof value === "string" && ["Requested", "Proposed service", "Completed", "Withdrawn", "Published as of"].includes(label) ? /^\d{4}$/.test(value) ? "year precision" : /^\d{4}-Q[1-4]$/.test(value) ? "quarter precision" : /^\d{4}-\d{2}$/.test(value) ? "month precision" : /^\d{4}-\d{2}-\d{2}$/.test(value) ? "day precision" : undefined : undefined} labelWidth={20} />)}
|
|
24
25
|
{row.entities.length ? <SectionHeading title="Mapped companies" /> : null}
|
|
25
26
|
{row.entities.map((entity) => <KeyValueRow key={`${entity.entityId}:${entity.role}`} label={titleCase(entity.role)} value={entity.name}
|
|
26
27
|
detail={`${entity.tickers.map((t) => t.exchange ? `${t.ticker}:${t.exchange}` : t.ticker).join(", ")} · ${powerPercent(entity.confidence)} confidence`} labelWidth={20} />)}
|
|
27
28
|
{Object.keys(row.metrics).length ? <SectionHeading title="Reported context" /> : null}
|
|
28
|
-
{Object.entries(row.metrics).map(([label, value]) => <KeyValueRow key={label} label={label === "revenueUsd" ? "Retail revenue (USD)" : titleCase(label.replace(/([a-z])([A-Z])/g, "$1 $2"))} value={value === null ?
|
|
29
|
+
{Object.entries(row.metrics).map(([label, value]) => <KeyValueRow key={label} label={label === "revenueUsd" ? "Retail revenue (USD)" : titleCase(label.replace(/([a-z])([A-Z])/g, "$1 $2"))} value={value === null ? MISSING_VALUE : String(value)} labelWidth={24} />)}
|
|
29
30
|
<SectionHeading title="Primary evidence" />
|
|
30
31
|
<KeyValueRow label="Location in source" value={row.sourceLocator} labelWidth={20} />
|
|
31
32
|
<PaneLinkMenu><ExternalLinkText url={row.sourceUrl} label="Open primary document" /></PaneLinkMenu>
|
|
@@ -57,16 +58,16 @@ export function PowerDetailView({ row, scope, scrollRef, snapshot, focused, widt
|
|
|
57
58
|
{hasGeneration && view === "generation" ? <PowerGeneration project={project!} width={width} height={Math.max(3, height - 1)} focused={focused} /> : <DetailScrollBody ref={scrollRef} resetScrollKey={row.id}>
|
|
58
59
|
{denied ? <Text>Project evidence is unavailable for this account.</Text> : project ? <ProjectFacts row={project} /> : <>
|
|
59
60
|
{Object.entries(row.cells).filter(([, value]) => ["string", "number"].includes(typeof value) || value === null).map(([key, value]) =>
|
|
60
|
-
<KeyValueRow key={key} label={titleCase(key.replace(/([a-z])([A-Z])/g, "$1 $2"))} value={value == null ?
|
|
61
|
+
<KeyValueRow key={key} label={titleCase(key.replace(/([a-z])([A-Z])/g, "$1 $2"))} value={value == null ? MISSING_VALUE : /Rate$/.test(key) ? powerPercent(Number(value)) : String(value)} labelWidth={22} />)}
|
|
61
62
|
{row.history ? <>
|
|
62
63
|
<KeyValueRow label="History basis" value={row.history.basis === "published" ? "Published period" : "Observed snapshot"} labelWidth={22} />
|
|
63
|
-
<KeyValueRow label="Published as of" value={row.history.asOf ??
|
|
64
|
+
<KeyValueRow label="Published as of" value={row.history.asOf ?? MISSING_VALUE} labelWidth={22} />
|
|
64
65
|
<KeyValueRow label="Observed UTC" value={row.history.observedAt} labelWidth={22} />
|
|
65
66
|
<SectionHeading title="Primary evidence" />
|
|
66
67
|
<PaneLinkMenu>{row.history.sourceUrls.map((url, index) => <Box key={url} paddingBottom={1}><ExternalLinkText url={url} label={`Open primary document ${index + 1}`} /></Box>)}</PaneLinkMenu>
|
|
67
68
|
</> : null}
|
|
68
69
|
{row.exposure ? <>
|
|
69
|
-
<KeyValueRow label="Published as of" value={row.exposure.asOf ??
|
|
70
|
+
<KeyValueRow label="Published as of" value={row.exposure.asOf ?? MISSING_VALUE} labelWidth={22} />
|
|
70
71
|
<KeyValueRow label="Observed UTC" value={row.exposure.observedAt} labelWidth={22} />
|
|
71
72
|
<SectionHeading title="Primary evidence" />
|
|
72
73
|
<PaneLinkMenu>{row.exposure.sourceUrls.map((url, index) => <Box key={url} paddingBottom={1}><ExternalLinkText url={url} label={`Open primary document ${index + 1}`} /></Box>)}</PaneLinkMenu>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import type { GasStorageHistory, GasStorageRow, GasStorageSeasonal } from "../../../api-client/europe-energy";
|
|
2
3
|
import { staticSeries } from "../../../components/chart/static/series";
|
|
3
4
|
import type { SeriesDefinition, SeriesLoadResult } from "../../../series/types";
|
|
@@ -55,18 +56,18 @@ export const GAS_PUBLISHER = "GIE AGSI+";
|
|
|
55
56
|
const fixed = (value: number, digits: number) => value.toLocaleString("en-US", { minimumFractionDigits: digits, maximumFractionDigits: digits });
|
|
56
57
|
const signed = (value: number, digits: number) => `${value > 0 ? "+" : ""}${fixed(value, digits)}`;
|
|
57
58
|
/** Percent full, to the hundredth AGSI+ publishes. */
|
|
58
|
-
export const formatGasFull = (value: number | null | undefined) => value == null ?
|
|
59
|
+
export const formatGasFull = (value: number | null | undefined) => value == null ? MISSING_VALUE : fixed(value, 2);
|
|
59
60
|
/** Percentage points. */
|
|
60
|
-
export const formatGasPoints = (value: number | null | undefined) => value == null ?
|
|
61
|
+
export const formatGasPoints = (value: number | null | undefined) => value == null ? MISSING_VALUE : signed(value, 2);
|
|
61
62
|
/** TWh to the tenth. */
|
|
62
|
-
export const formatGasTwh = (value: number | null | undefined) => value == null ?
|
|
63
|
+
export const formatGasTwh = (value: number | null | undefined) => value == null ? MISSING_VALUE : fixed(value, 1);
|
|
63
64
|
/** GWh/day, whole. */
|
|
64
|
-
export const formatGasFlow = (value: number | null | undefined) => value == null ?
|
|
65
|
+
export const formatGasFlow = (value: number | null | undefined) => value == null ? MISSING_VALUE : fixed(value, 0);
|
|
65
66
|
|
|
66
67
|
/** Where the day sits in its five-year range: a percentile-like 0 to 100, or below and above it. */
|
|
67
68
|
export function gasRangePosition(row: GasStorageRow): { value: number | null; text: string } {
|
|
68
69
|
const position = row.fiveYear?.position;
|
|
69
|
-
if (position == null) return { value: null, text:
|
|
70
|
+
if (position == null) return { value: null, text: MISSING_VALUE };
|
|
70
71
|
if (position < 0) return { value: 0, text: "below" };
|
|
71
72
|
if (position > 100) return { value: 100, text: "above" };
|
|
72
73
|
return { value: Math.round(position), text: `${Math.round(position)}%` };
|
|
@@ -77,7 +78,7 @@ export const gasRangeLabel = (years: number) => `${years > 0 && years < 5 ? year
|
|
|
77
78
|
|
|
78
79
|
/** A gas day and its flag, the way a row is dated: `2026-10-12 est`. */
|
|
79
80
|
export const gasDayText = (row: Pick<GasStorageRow, "gasDay" | "status">) =>
|
|
80
|
-
row.gasDay ? `${row.gasDay}${row.status === "estimated" ? " est" : ""}` :
|
|
81
|
+
row.gasDay ? `${row.gasDay}${row.status === "estimated" ? " est" : ""}` : MISSING_VALUE;
|
|
81
82
|
|
|
82
83
|
/** The benchmark areas a search lists first; the rest follow by name. */
|
|
83
84
|
const LEAD_AREAS = ["EU", "DE", "IT", "FR", "NL", "AT"];
|
|
@@ -181,7 +182,7 @@ export function gasYearAxis(year: number) {
|
|
|
181
182
|
ticks: [0, 3, 6, 9].map((month) => ({ label: MONTHS[month]!, ratio: ratio(Date.UTC(year, month, 1)) })),
|
|
182
183
|
formatCursor: (xRatio: number) => {
|
|
183
184
|
const date = new Date(start + Math.round((xRatio * span) / DAY_MS) * DAY_MS);
|
|
184
|
-
return `${
|
|
185
|
+
return `${date.getUTCDate()} ${MONTHS[date.getUTCMonth()]}`;
|
|
185
186
|
},
|
|
186
187
|
},
|
|
187
188
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import { logFailure } from "../../../utils/log-failure";
|
|
2
3
|
import { useCallback, useMemo } from "react";
|
|
3
4
|
import type { GasStorageRow } from "../../../api-client/europe-energy";
|
|
@@ -72,7 +73,7 @@ function GasDetail({ row, width, height, focused }: { row: GasStorageRow; width:
|
|
|
72
73
|
{ id: "change", label: "1D pp", value: formatGasPoints(row.change), ...(row.previousGasDay ? { detail: `vs ${row.previousGasDay}` } : {}) },
|
|
73
74
|
{ id: "year", label: "1Y ago %", value: formatGasFull(row.yearAgo?.full), ...(row.yearAgo ? { detail: row.yearAgo.gasDay } : {}) },
|
|
74
75
|
{ id: "range", label: `${gasRangeLabel(five?.years.length ?? 0)} range %`,
|
|
75
|
-
value: five ? `${formatGasFull(five.min)} to ${formatGasFull(five.max)}` :
|
|
76
|
+
value: five ? `${formatGasFull(five.min)} to ${formatGasFull(five.max)}` : MISSING_VALUE,
|
|
76
77
|
...(five ? { detail: `avg ${formatGasFull(five.average)}${five.years.length < 5 ? `, ${five.years.length} of 5 years` : ""}` } : {}) },
|
|
77
78
|
];
|
|
78
79
|
return <StatChartDetail items={items} width={width} height={height} empty={!history.loading && (series[0]?.points.length ?? 0) < 2}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import type { DataTableColumn } from "../../../components";
|
|
2
3
|
import type { HeadlessPaneColumn, HeadlessPaneDefinition, HeadlessPaneRow } from "../../../types/plugin";
|
|
3
4
|
import { withoutQuietColumns } from "../shared/research-cells";
|
|
@@ -18,8 +19,8 @@ const isGasQuery = (input: string | undefined) => /^(?:gas|storage)\b/i.test(inp
|
|
|
18
19
|
const GRAPHIC_COLUMNS = new Set(["outcome", "pipeline"]);
|
|
19
20
|
/** Columns that only repeat a default on every row, as the pane leaves them out. */
|
|
20
21
|
const QUIET_COLUMNS: Record<string, readonly string[]> = { scope: ["Project"], unknownCapacity: ["0"], unknown: ["0"], fuel: ["Load"], role: ["Direct"], kind: ["Queue"] };
|
|
21
|
-
const text = (value: unknown) => value == null || value === "" ?
|
|
22
|
-
const coded = (value: unknown) => typeof value === "string" && value ? titleCase(value) :
|
|
22
|
+
const text = (value: unknown) => value == null || value === "" ? MISSING_VALUE : String(value);
|
|
23
|
+
const coded = (value: unknown) => typeof value === "string" && value ? titleCase(value) : MISSING_VALUE;
|
|
23
24
|
|
|
24
25
|
/** The tabs that list records, a page at a time. */
|
|
25
26
|
const RECORD_TABS: readonly PowerTab[] = ["queue", "loads", "capacity"];
|
|
@@ -47,16 +48,16 @@ function reportColumns(tab: PowerTab, context: unknown): HeadlessPaneColumn[] {
|
|
|
47
48
|
const columns: DataTableColumn[] = tab === "capacity" && context === "generation" ? GENERATION_COLUMNS : tab === "capacity" && context === "utility" ? UTILITY_COLUMNS
|
|
48
49
|
: ["queue", "loads", "capacity"].includes(tab) ? PROJECT_COLUMNS : tab === "history" ? HISTORY_COLUMNS : tab === "outcomes" ? RATE_COLUMNS : tab === "utilities" ? EXPOSURE_COLUMNS : COVERAGE_COLUMNS;
|
|
49
50
|
// The coverage list names its register by its own id; everything else by the record's source.
|
|
50
|
-
const region = (value: unknown, row: HeadlessPaneRow) => typeof value !== "string" ?
|
|
51
|
+
const region = (value: unknown, row: HeadlessPaneRow) => typeof value !== "string" ? MISSING_VALUE
|
|
51
52
|
: tab === "utilities" ? value : powerRegion(value, String((tab === "coverage" ? row.id : row.sourceId) ?? ""));
|
|
52
53
|
const format = (column: DataTableColumn): HeadlessPaneColumn["format"] => {
|
|
53
54
|
if (column.id === "region") return region;
|
|
54
55
|
if (["fuel", "status", "kind", "role"].includes(column.id)) return coded;
|
|
55
56
|
if (column.id === "ticker") return (value) => typeof value === "string" && value ? value : UNMAPPED;
|
|
56
57
|
if (column.id === "developer") return (value, row) => text(value ?? row.utility);
|
|
57
|
-
if (column.id === "observedAt") return (value) => typeof value === "string" ? value.slice(0, 16).replace("T", " ") :
|
|
58
|
-
if (/Rate$/.test(column.id)) return (value) => typeof value === "number" ? powerPercent(value) :
|
|
59
|
-
if (column.align === "right") return (value) => typeof value === "number" ? `${column.id === "changeMw" && value > 0 ? "+" : ""}${powerNumber(value)}` :
|
|
58
|
+
if (column.id === "observedAt") return (value) => typeof value === "string" ? value.slice(0, 16).replace("T", " ") : MISSING_VALUE;
|
|
59
|
+
if (/Rate$/.test(column.id)) return (value) => typeof value === "number" ? powerPercent(value) : MISSING_VALUE;
|
|
60
|
+
if (column.align === "right") return (value) => typeof value === "number" ? `${column.id === "changeMw" && value > 0 ? "+" : ""}${powerNumber(value)}` : MISSING_VALUE;
|
|
60
61
|
return text;
|
|
61
62
|
};
|
|
62
63
|
// The pane groups outcomes under region headings; the report names the region on each row.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import type { PowerAggregate, PowerBoard, PowerCoverage, PowerExposure, PowerHistoryPoint, PowerProject, PowerRates } from "../../../api-client/power";
|
|
2
3
|
import { staticSeries, type DataTableColumn } from "../../../components";
|
|
3
4
|
|
|
@@ -34,8 +35,8 @@ export function powerLoadedSources(tab: PowerTab, coverage: readonly PowerCovera
|
|
|
34
35
|
return tab === "capacity" ? "US EIA generation and utility filings" : names([...loaded.filter((c) => c.country === "US"), ...loaded.filter((c) => c.country !== "US")]);
|
|
35
36
|
}
|
|
36
37
|
export const titleCase = (value: string) => value.replace(/(^|[ _-])\w/g, (match) => match.toUpperCase());
|
|
37
|
-
export const powerNumber = (n: number | null | undefined) => n == null ?
|
|
38
|
-
export const powerPercent = (n: number | null) => n == null ?
|
|
38
|
+
export const powerNumber = (n: number | null | undefined) => n == null ? MISSING_VALUE : n.toLocaleString("en-US", { maximumFractionDigits: 1 });
|
|
39
|
+
export const powerPercent = (n: number | null) => n == null ? MISSING_VALUE : `${(n * 100).toFixed(1)}%`;
|
|
39
40
|
/** The listed companies a record names, or null when its register names none: the ticker map. */
|
|
40
41
|
export const tickerLabel = (row: { entities: PowerProject["entities"] }) => [...new Set(row.entities.flatMap((e) => e.tickers.map((t) => t.ticker)))].join(", ") || null;
|
|
41
42
|
/** What the ticker column says for a record no listed company is mapped to. */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import { apiClient } from "../../../api-client";
|
|
2
3
|
import type { CarbonBoard, EuropePowerBoard, GasStorageBoard, GasStorageRow, PowerPriceRow } from "../../../api-client/europe-energy";
|
|
3
4
|
import type { HeadlessBundleResult, HeadlessBundleSection, HeadlessPaneColumn, HeadlessPaneDefinition } from "../../../types/plugin";
|
|
@@ -11,21 +12,21 @@ import {
|
|
|
11
12
|
type PricesClient = Pick<typeof apiClient, "getCloudEuropePower" | "getCloudEuropePowerHistory" | "getCloudEuropeCarbon"
|
|
12
13
|
| "getCloudEuropeGas" | "getCloudEuropeGasHistory">;
|
|
13
14
|
|
|
14
|
-
const price = (value: unknown) => typeof value === "number" ? formatPowerPrice(value) :
|
|
15
|
-
const text = (value: unknown) => typeof value === "string" && value ? value :
|
|
15
|
+
const price = (value: unknown) => typeof value === "number" ? formatPowerPrice(value) : MISSING_VALUE;
|
|
16
|
+
const text = (value: unknown) => typeof value === "string" && value ? value : MISSING_VALUE;
|
|
16
17
|
|
|
17
18
|
/** A board's columns, in its words: prices to the cent in the board's unit, each row dated by its own day. */
|
|
18
19
|
const boardColumns = (unit: string, label = "Market"): HeadlessPaneColumn[] => [
|
|
19
20
|
{ key: "market", header: label },
|
|
20
21
|
{ key: "date", header: "As of", format: text, shrink: false },
|
|
21
22
|
{ key: "price", header: unit, align: "right", format: price },
|
|
22
|
-
{ key: "change", header: "1D", align: "right", format: (value) => typeof value === "number" ? formatPowerChange(value) :
|
|
23
|
+
{ key: "change", header: "1D", align: "right", format: (value) => typeof value === "number" ? formatPowerChange(value) : MISSING_VALUE },
|
|
23
24
|
{ key: "average7", header: "7D avg", align: "right", format: price },
|
|
24
25
|
{ key: "average30", header: "30D avg", align: "right", format: price },
|
|
25
26
|
{ key: "yearAgo", header: "1Y ago", align: "right", format: price },
|
|
26
27
|
{ key: "low52w", header: "52W low", align: "right", format: price },
|
|
27
28
|
{ key: "high52w", header: "52W high", align: "right", format: price },
|
|
28
|
-
{ key: "range", header: "In 1Y range", align: "right", format: (value) => typeof value === "number" ? `${value}%` :
|
|
29
|
+
{ key: "range", header: "In 1Y range", align: "right", format: (value) => typeof value === "number" ? `${value}%` : MISSING_VALUE },
|
|
29
30
|
];
|
|
30
31
|
const COLUMNS = boardColumns(POWER_PRICE_UNIT);
|
|
31
32
|
const AUCTION_COLUMNS: HeadlessPaneColumn[] = [
|
|
@@ -33,9 +34,9 @@ const AUCTION_COLUMNS: HeadlessPaneColumn[] = [
|
|
|
33
34
|
{ key: "zone", header: "Zone", format: text },
|
|
34
35
|
{ key: "status", header: "Status" },
|
|
35
36
|
{ key: "price", header: CARBON_PRICE_UNIT, align: "right", format: price },
|
|
36
|
-
{ key: "volume", header: "Volume tCO2", align: "right", format: (value) => typeof value === "number" ? value.toLocaleString("en-US") :
|
|
37
|
-
{ key: "coverRatio", header: "Cover", align: "right", format: (value) => typeof value === "number" ? `${value.toFixed(2)}x` :
|
|
38
|
-
{ key: "bidders", header: "Bidders", align: "right", format: (value) => typeof value === "number" ? String(value) :
|
|
37
|
+
{ key: "volume", header: "Volume tCO2", align: "right", format: (value) => typeof value === "number" ? value.toLocaleString("en-US") : MISSING_VALUE },
|
|
38
|
+
{ key: "coverRatio", header: "Cover", align: "right", format: (value) => typeof value === "number" ? `${value.toFixed(2)}x` : MISSING_VALUE },
|
|
39
|
+
{ key: "bidders", header: "Bidders", align: "right", format: (value) => typeof value === "number" ? String(value) : MISSING_VALUE },
|
|
39
40
|
];
|
|
40
41
|
|
|
41
42
|
function reportRow(row: Omit<PowerPriceRow, "code"> & { code: string }) {
|
|
@@ -82,7 +83,7 @@ function freshness(board: EuropePowerBoard | null, carbon: CarbonBoard | null, m
|
|
|
82
83
|
|
|
83
84
|
const failure = (error: unknown) => error instanceof Error ? error.message : String(error);
|
|
84
85
|
|
|
85
|
-
const number = (format: (value: number | null) => string) => (value: unknown) => typeof value === "number" ? format(value) :
|
|
86
|
+
const number = (format: (value: number | null) => string) => (value: unknown) => typeof value === "number" ? format(value) : MISSING_VALUE;
|
|
86
87
|
const GAS_COLUMNS: HeadlessPaneColumn[] = [
|
|
87
88
|
{ key: "area", header: "Area" },
|
|
88
89
|
{ key: "gasDay", header: "Gas day", format: text, shrink: false },
|
|
@@ -96,7 +97,7 @@ const GAS_COLUMNS: HeadlessPaneColumn[] = [
|
|
|
96
97
|
{ key: "fiveYearLow", header: "5Y low", align: "right", format: number(formatGasFull) },
|
|
97
98
|
{ key: "fiveYearAverage", header: "5Y avg", align: "right", format: number(formatGasFull) },
|
|
98
99
|
{ key: "fiveYearHigh", header: "5Y high", align: "right", format: number(formatGasFull) },
|
|
99
|
-
{ key: "fiveYearYears", header: "5Y years", align: "right", format: (value) => typeof value === "number" ? String(value) :
|
|
100
|
+
{ key: "fiveYearYears", header: "5Y years", align: "right", format: (value) => typeof value === "number" ? String(value) : MISSING_VALUE },
|
|
100
101
|
{ key: "range", header: "In 5Y range", align: "right", format: text },
|
|
101
102
|
];
|
|
102
103
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import type { PowerPriceRow } from "../../../api-client/europe-energy";
|
|
2
3
|
import type { SeriesDefinition } from "../../../series/types";
|
|
3
4
|
import { fetchCarbonHistory, fetchPowerPriceHistory } from "./prices-client";
|
|
@@ -50,9 +51,9 @@ export const isCarbonQuery = (input: string | null | undefined) =>
|
|
|
50
51
|
export const DEFAULT_PRICE_MARKET = "DE";
|
|
51
52
|
|
|
52
53
|
export const POWER_PRICE_UNIT = "EUR/MWh";
|
|
53
|
-
export const formatPowerPrice = (value: number | null | undefined) => value == null ?
|
|
54
|
+
export const formatPowerPrice = (value: number | null | undefined) => value == null ? MISSING_VALUE : value.toFixed(2);
|
|
54
55
|
export const formatPowerChange = (value: number | null | undefined) =>
|
|
55
|
-
value == null ?
|
|
56
|
+
value == null ? MISSING_VALUE : `${value > 0 ? "+" : ""}${value.toFixed(2)}`;
|
|
56
57
|
/** Where the latest price sits in its 52-week range, 0 at the low and 100 at the high. */
|
|
57
58
|
export function powerRangePosition(row: PowerPriceRow): number | null {
|
|
58
59
|
if (row.price == null || row.low52w == null || row.high52w == null || row.high52w <= row.low52w) return null;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import { logFailure } from "../../../utils/log-failure";
|
|
2
3
|
import { useCallback, useMemo } from "react";
|
|
3
4
|
import type { CarbonBoard, PowerPriceRow } from "../../../api-client/europe-energy";
|
|
@@ -33,7 +34,7 @@ function boardRow(row: PowerPriceRow): PriceBoardRow {
|
|
|
33
34
|
return {
|
|
34
35
|
id: row.code, label: row.name, value: row.price, valueText: formatPowerPrice(row.price),
|
|
35
36
|
change: row.change, changeText: formatPowerChange(row.change),
|
|
36
|
-
percentile: position, percentileText: position == null ?
|
|
37
|
+
percentile: position, percentileText: position == null ? MISSING_VALUE : `${position}%`,
|
|
37
38
|
asOf: row.date, status: row.price == null ? "unavailable" : "available",
|
|
38
39
|
history: row.trail.map((point) => ({ date: new Date(`${point.date}T00:00:00Z`), close: point.value })),
|
|
39
40
|
price: row,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DataTableColumn } from "../../../components";
|
|
2
2
|
import { fitChartTableColumns } from "../../../components/chart-table";
|
|
3
|
-
import { formatNumber } from "../../../utils/format";
|
|
3
|
+
import { MISSING_VALUE, formatNumber } from "../../../utils/format";
|
|
4
4
|
|
|
5
5
|
export const PRIMARY_DEALERS_PANE_ID = "primary-dealers";
|
|
6
6
|
|
|
@@ -215,14 +215,14 @@ export function pointsInRange(points: readonly SeriesPoint[], range: DealerRange
|
|
|
215
215
|
}
|
|
216
216
|
|
|
217
217
|
export function formatLevel(value: number | null): string {
|
|
218
|
-
if (value == null || !Number.isFinite(value)) return
|
|
218
|
+
if (value == null || !Number.isFinite(value)) return MISSING_VALUE;
|
|
219
219
|
const decimals = Number.isInteger(value) ? 0 : 2;
|
|
220
220
|
const text = formatNumber(Math.abs(value) === 0 ? 0 : value, decimals);
|
|
221
221
|
return text === "-0" ? "0" : text;
|
|
222
222
|
}
|
|
223
223
|
|
|
224
224
|
export function formatChange(value: number | null): string {
|
|
225
|
-
if (value == null || !Number.isFinite(value)) return
|
|
225
|
+
if (value == null || !Number.isFinite(value)) return MISSING_VALUE;
|
|
226
226
|
const text = formatLevel(Math.abs(value));
|
|
227
227
|
if (text === "0") return "0";
|
|
228
228
|
return value > 0 ? `+${text}` : `-${text}`;
|
|
@@ -19,7 +19,7 @@ import { useAsyncResource } from "../../../react/async-resource";
|
|
|
19
19
|
import { colors } from "../../../theme/colors";
|
|
20
20
|
import type { PaneProps } from "../../../types/plugin";
|
|
21
21
|
import { Box, TextAttributes } from "../../../ui";
|
|
22
|
-
import { formatNumber } from "../../../utils/format";
|
|
22
|
+
import { MISSING_VALUE, formatNumber } from "../../../utils/format";
|
|
23
23
|
import { isPlainKeyboardEvent } from "../../../utils/keyboard";
|
|
24
24
|
import { usePluginPaneState } from "../../runtime";
|
|
25
25
|
import { cachedDealerHistory, fetchPrimaryDealers, hasDealerHistory, loadDealerHistory } from "./client";
|
|
@@ -187,7 +187,7 @@ export function PrimaryDealersPane({ focused, width, height }: PaneProps) {
|
|
|
187
187
|
attributes: row.depth === 0 ? TextAttributes.BOLD : undefined,
|
|
188
188
|
};
|
|
189
189
|
case "asOf":
|
|
190
|
-
return { text: row.asOf ??
|
|
190
|
+
return { text: row.asOf ?? MISSING_VALUE, color: colors.textMuted };
|
|
191
191
|
case "latest":
|
|
192
192
|
return { text: formatLevel(row.latest), value: row.latest, color: colors.text };
|
|
193
193
|
case "previous":
|