@gloom-sh/terminal 0.20.12 → 0.20.14
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 +2 -1
- package/patches/@opentui%2Fcore@0.3.2.patch +22 -4
- package/src/account/auth-dialog.tsx +22 -4
- package/src/account/auth-form.tsx +6 -1
- package/src/account/billing.ts +3 -2
- package/src/account/checkout-handoff.tsx +7 -14
- package/src/account/device-signin-dialog.tsx +35 -24
- package/src/account/upgrade-dialog.tsx +8 -8
- package/src/api-client/crypto-markets.ts +10 -0
- package/src/api-client/errors.ts +3 -1
- package/src/api-client/index.ts +10 -2
- package/src/api-client/install-experiments.ts +146 -0
- package/src/api-client/money-markets.ts +7 -0
- package/src/api-client/request.ts +12 -2
- 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 -34
- package/src/brokers/signed-in/adapter.ts +2 -2
- package/src/brokers/signed-in/catalog.ts +13 -4
- package/src/brokers/signed-in/sign-in-dialog.tsx +38 -38
- package/src/cli/commands/market.ts +146 -55
- package/src/cli/commands/overview.ts +21 -7
- 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/errors.ts +3 -1
- package/src/cli/freshness.ts +7 -2
- package/src/cli/glossary.ts +10 -5
- package/src/cli/helpers.ts +8 -16
- package/src/cli/history-export.ts +4 -0
- package/src/cli/history-rows.ts +18 -1
- package/src/cli/known-gaps.ts +11 -2
- package/src/cli/listing-arg.ts +183 -28
- package/src/cli/not-a-ticker.ts +4 -0
- package/src/cli/pane-functions/catalog.ts +81 -12
- 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 +13 -10
- package/src/cli/pane-functions/index.ts +1 -1
- package/src/cli/pane-functions/options.ts +7 -0
- package/src/cli/pane-functions/report.ts +4 -1
- package/src/cli/pane-functions/resolver.ts +61 -15
- package/src/cli/perpetual-contract.ts +4 -4
- package/src/cli/quote-answer.ts +6 -2
- package/src/cli/result.ts +24 -5
- package/src/cli/symbol-args.ts +5 -3
- package/src/cli/symbol-list.ts +23 -10
- package/src/cli/symbol-rows.ts +135 -3
- package/src/cli/treasury-yields.ts +15 -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 +103 -16
- package/src/components/chart/composite/legend.tsx +60 -25
- package/src/components/chart/composite/panel-surface/axis-markers.ts +133 -0
- package/src/components/chart/composite/panel-surface/level-labels.tsx +78 -0
- package/src/components/chart/composite/panel-surface/overlays.ts +108 -0
- package/src/components/chart/composite/panel-surface/pan-coast.ts +54 -0
- package/src/components/chart/composite/panel-surface/panel-cursor.tsx +138 -0
- package/src/components/chart/composite/panel-surface/panel-levels.ts +47 -0
- package/src/components/chart/composite/panel-surface/plot-gestures.ts +403 -0
- package/src/components/chart/composite/panel-surface/plot-pointer.ts +65 -0
- package/src/components/chart/composite/panel-surface/plot-wheel.ts +102 -0
- package/src/components/chart/composite/panel-surface/pointer.ts +12 -0
- package/src/components/chart/composite/panel-surface/props.ts +79 -0
- package/src/components/chart/composite/panel-surface/tool-readout.ts +151 -0
- package/src/components/chart/composite/panel-surface/value-axis-gestures.ts +152 -0
- package/src/components/chart/composite/panel-surface.tsx +81 -1177
- 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/commands/collection-list.ts +1 -0
- 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 +23 -11
- package/src/components/command-bar/routes/root/runtime.ts +3 -2
- package/src/components/command-bar/routes/root/selection.ts +3 -2
- package/src/components/command-bar/routes/root/shortcuts.ts +15 -0
- 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/layout/pane/title.ts +10 -4
- 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/pane-settings-dialog/tui.tsx +6 -3
- package/src/components/pane-settings-dialog.tsx +2 -1
- package/src/components/pane-template-wizard.tsx +2 -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 +102 -33
- package/src/components/ui/confirm-dialog.tsx +3 -2
- package/src/components/ui/frame.tsx +7 -3
- package/src/components/ui/icon.tsx +4 -2
- package/src/components/ui/list-view.tsx +8 -0
- package/src/components/ui/multi-select/dialog.tsx +1 -7
- package/src/components/ui/not-meaningful.ts +16 -0
- package/src/components/ui/number-prompt-dialog.tsx +2 -1
- package/src/components/ui/query-bar.tsx +16 -4
- package/src/components/ui/stat-grid.tsx +27 -6
- package/src/components/use-pane-notice-footer.tsx +3 -1
- package/src/data/config/store/normalize.ts +2 -0
- package/src/docs/snapshot.json +3 -3
- package/src/i18n/es.ts +6 -2
- package/src/i18n/ja.ts +6 -2
- package/src/i18n/ko.ts +6 -2
- package/src/i18n/zh-cn.ts +6 -2
- package/src/i18n/zh-tw.ts +6 -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 +48 -14
- package/src/market-data/quotes/contributions.ts +13 -0
- package/src/market-data/quotes/export-identity.ts +36 -1
- package/src/market-data/quotes/listing-enterprise-value.ts +3 -3
- package/src/market-data/quotes/resolution.ts +16 -0
- 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/account-management/password-dialog.tsx +2 -2
- 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-client.ts +12 -2
- package/src/plugins/builtin/analytics/risk-headless.ts +66 -6
- package/src/plugins/builtin/analytics/risk-math.ts +23 -6
- package/src/plugins/builtin/analytics/risk-model.ts +26 -15
- package/src/plugins/builtin/analytics/risk-pane.tsx +8 -7
- 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/catalog-inventory.ts +5 -2
- package/src/plugins/builtin/chart-composer/editor.tsx +1 -0
- package/src/plugins/builtin/chart-composer/index.tsx +4 -2
- package/src/plugins/builtin/chart-composer/pane.tsx +8 -4
- package/src/plugins/builtin/chart-composer/quick-add.tsx +4 -1
- package/src/plugins/builtin/chart-composer/series-catalog.ts +17 -1
- 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/plugin.tsx +2 -0
- 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/thesis/module.tsx +2 -0
- package/src/plugins/builtin/cloud/upgrade-status-widget.tsx +6 -2
- 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 +10 -4
- package/src/plugins/builtin/cpi/model.ts +25 -7
- package/src/plugins/builtin/cpi/pane.tsx +3 -1
- 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/client.ts +6 -1
- 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/headless.ts +10 -2
- package/src/plugins/builtin/crypto-board/model.ts +93 -14
- package/src/plugins/builtin/crypto-board/pane.tsx +28 -13
- 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 +31 -5
- package/src/plugins/builtin/dividend-yield/headless.ts +20 -13
- 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 +21 -12
- package/src/plugins/builtin/dividend-yield/types.ts +4 -0
- package/src/plugins/builtin/dividend-yield/view.ts +8 -4
- 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 +22 -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/index.tsx +2 -0
- 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 +19 -3
- package/src/plugins/builtin/econ/detail-view.tsx +2 -2
- package/src/plugins/builtin/econ/fred-catalog.ts +33 -4
- 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 +25 -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 +27 -15
- package/src/plugins/builtin/macro-day/model.ts +42 -4
- package/src/plugins/builtin/macro-day/pane.tsx +30 -12
- package/src/plugins/builtin/macro-day/releases.ts +24 -1
- 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/client.ts +4 -1
- package/src/plugins/builtin/money-markets/headless.ts +17 -5
- package/src/plugins/builtin/money-markets/index.tsx +1 -1
- package/src/plugins/builtin/money-markets/model.ts +3 -2
- package/src/plugins/builtin/money-markets/pane.tsx +11 -5
- 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/cli/bulk-symbols.ts +4 -2
- package/src/plugins/builtin/portfolio-list/cli/period-report.ts +61 -11
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +11 -3
- package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +2 -0
- package/src/plugins/builtin/portfolio-list/header.tsx +2 -2
- package/src/plugins/builtin/portfolio-list/headless.ts +33 -6
- 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/index.tsx +5 -3
- package/src/plugins/builtin/portfolio-list/pane/period-pnl.ts +26 -7
- package/src/plugins/builtin/portfolio-list/pane/purchase-date-fx.ts +4 -2
- package/src/plugins/builtin/portfolio-list/period-pnl.ts +16 -1
- 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 +8 -5
- package/src/plugins/builtin/portfolio-list/summary/totals.ts +6 -4
- package/src/plugins/builtin/portfolio-list/table.tsx +25 -15
- 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/cloud-upgrade.ts +4 -2
- package/src/plugins/builtin/shared/cpi-year-gap.ts +67 -0
- 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/headless.ts +45 -2
- 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 +33 -6
- package/src/plugins/builtin/ticker-detail/overview/chart-scale.ts +52 -0
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +8 -9
- package/src/plugins/builtin/ticker-detail/overview/model.ts +28 -14
- 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 +43 -9
- 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/collection-name.ts +2 -1
- package/src/portfolio/column-values.ts +61 -45
- package/src/portfolio/futures-positions.ts +2 -1
- package/src/portfolio/listed-symbol.ts +4 -2
- package/src/portfolio/period-pnl.ts +51 -1
- package/src/renderers/dom/dialog-host.tsx +5 -5
- package/src/renderers/electrobun/bun/desktop/backend-requests.ts +7 -1
- package/src/renderers/electrobun/view/remote/capability-invoker.ts +1 -1
- package/src/renderers/opentui/dialog-host.tsx +3 -4
- 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 +7 -0
- package/src/sources/provider-router/history.ts +5 -2
- 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/test-support/plugin-persistence.ts +12 -0
- package/src/tickers/company-name-listing.ts +6 -5
- package/src/tickers/company-name.ts +36 -2
- package/src/tickers/instrument-coverage.ts +27 -0
- package/src/tickers/listing-venues.ts +26 -1
- package/src/tickers/renamed-listings.ts +2 -1
- package/src/tickers/search/home-listing.ts +38 -1
- package/src/tickers/search/index.ts +22 -2
- package/src/tickers/search/ranking.ts +21 -2
- package/src/tickers/starter-symbols.ts +7 -0
- package/src/time-series/base-series.ts +4 -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/time-series/types.ts +5 -2
- package/src/types/config.ts +9 -0
- package/src/types/data-provider.ts +3 -2
- package/src/types/financials.ts +28 -0
- package/src/types/headless.ts +2 -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/ui/dialog-stack.ts +17 -0
- package/src/ui/dialog.tsx +6 -2
- package/src/utils/crypto-pair.ts +9 -0
- package/src/utils/datetime-format.ts +74 -33
- package/src/utils/exchanges.ts +13 -0
- package/src/utils/financial-statements.ts +98 -17
- package/src/utils/format.ts +4 -9
- package/src/utils/fundamentals.ts +38 -16
- package/src/utils/futures-generic.ts +14 -0
- 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/trailing-dividend.ts +13 -3
- package/src/utils/zoned-date-time.ts +47 -22
|
@@ -1,12 +1,8 @@
|
|
|
1
|
+
import { revenueMargin } from "../../../../utils/growth";
|
|
1
2
|
import type { FinancialSubTab } from "./model";
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
denominator: number | undefined,
|
|
6
|
-
): number | undefined {
|
|
7
|
-
if (numerator == null || denominator == null || denominator === 0) return undefined;
|
|
8
|
-
return numerator / denominator;
|
|
9
|
-
}
|
|
4
|
+
/** A line over revenue: N/M where revenue is zero or negative. */
|
|
5
|
+
const financialRatio = revenueMargin;
|
|
10
6
|
|
|
11
7
|
const LOWER_IS_BETTER = "lower" as const;
|
|
12
8
|
const NEUTRAL_GROWTH = "neutral" as const;
|
|
@@ -136,7 +132,7 @@ export const FINANCIAL_SUB_TABS: FinancialSubTab[] = [
|
|
|
136
132
|
defaultExpanded: true,
|
|
137
133
|
children: [
|
|
138
134
|
{ label: "Operating CF", key: "operatingCashFlow", format: "compact" },
|
|
139
|
-
{ label: "CapEx", key: "capitalExpenditure", format: "compact" },
|
|
135
|
+
{ label: "CapEx", key: "capitalExpenditure", format: "compact", outflow: true },
|
|
140
136
|
],
|
|
141
137
|
},
|
|
142
138
|
{
|
|
@@ -183,13 +179,13 @@ export const FINANCIAL_SUB_TABS: FinancialSubTab[] = [
|
|
|
183
179
|
summaryKey: "investingCashFlow",
|
|
184
180
|
defaultExpanded: true,
|
|
185
181
|
children: [
|
|
186
|
-
{ label: "Purchase PPE", key: "purchaseOfPPE", format: "compact" },
|
|
182
|
+
{ label: "Purchase PPE", key: "purchaseOfPPE", format: "compact", outflow: true },
|
|
187
183
|
{ label: "Sale PPE", key: "saleOfPPE", format: "compact" },
|
|
188
184
|
{ label: "Net PPE", key: "netPPEPurchaseAndSale", format: "compact" },
|
|
189
|
-
{ label: "Acquisitions", key: "purchaseOfBusiness", format: "compact" },
|
|
185
|
+
{ label: "Acquisitions", key: "purchaseOfBusiness", format: "compact", outflow: true },
|
|
190
186
|
{ label: "Business Sales", key: "saleOfBusiness", format: "compact" },
|
|
191
187
|
{ label: "Net Business", key: "netBusinessPurchaseAndSale", format: "compact" },
|
|
192
|
-
{ label: "Buy Investments", key: "purchaseOfInvestment", format: "compact" },
|
|
188
|
+
{ label: "Buy Investments", key: "purchaseOfInvestment", format: "compact", outflow: true },
|
|
193
189
|
{ label: "Sell Investments", key: "saleOfInvestment", format: "compact" },
|
|
194
190
|
{ label: "Net Investments", key: "netInvestmentPurchaseAndSale", format: "compact" },
|
|
195
191
|
{ label: "Other Investing", key: "netOtherInvestingChanges", format: "compact" },
|
|
@@ -204,20 +200,20 @@ export const FINANCIAL_SUB_TABS: FinancialSubTab[] = [
|
|
|
204
200
|
defaultExpanded: true,
|
|
205
201
|
children: [
|
|
206
202
|
{ label: "Debt Issuance", key: "issuanceOfDebt", format: "compact" },
|
|
207
|
-
{ label: "Debt Repayment", key: "repaymentOfDebt", format: "compact" },
|
|
203
|
+
{ label: "Debt Repayment", key: "repaymentOfDebt", format: "compact", outflow: true },
|
|
208
204
|
{ label: "Net Debt", key: "netIssuancePaymentsOfDebt", format: "compact" },
|
|
209
205
|
{ label: "LT Debt Issuance", key: "longTermDebtIssuance", format: "compact" },
|
|
210
|
-
{ label: "LT Debt Payments", key: "longTermDebtPayments", format: "compact" },
|
|
206
|
+
{ label: "LT Debt Payments", key: "longTermDebtPayments", format: "compact", outflow: true },
|
|
211
207
|
{ label: "Net LT Debt", key: "netLongTermDebtIssuance", format: "compact" },
|
|
212
208
|
{ label: "ST Debt Issuance", key: "shortTermDebtIssuance", format: "compact" },
|
|
213
|
-
{ label: "ST Debt Payments", key: "shortTermDebtPayments", format: "compact" },
|
|
209
|
+
{ label: "ST Debt Payments", key: "shortTermDebtPayments", format: "compact", outflow: true },
|
|
214
210
|
{ label: "Net ST Debt", key: "netShortTermDebtIssuance", format: "compact" },
|
|
215
|
-
{ label: "Buybacks", key: "repurchaseOfCapitalStock", format: "compact" },
|
|
211
|
+
{ label: "Buybacks", key: "repurchaseOfCapitalStock", format: "compact", outflow: true },
|
|
216
212
|
{ label: "Stock Issuance", key: "commonStockIssuance", format: "compact" },
|
|
217
|
-
{ label: "Stock Payments", key: "commonStockPayments", format: "compact" },
|
|
213
|
+
{ label: "Stock Payments", key: "commonStockPayments", format: "compact", outflow: true },
|
|
218
214
|
{ label: "Net Stock", key: "netCommonStockIssuance", format: "compact" },
|
|
219
|
-
{ label: "Dividends Paid", key: "cashDividendsPaid", format: "compact" },
|
|
220
|
-
{ label: "Common Dividends", key: "commonStockDividendPaid", format: "compact" },
|
|
215
|
+
{ label: "Dividends Paid", key: "cashDividendsPaid", format: "compact", outflow: true },
|
|
216
|
+
{ label: "Common Dividends", key: "commonStockDividendPaid", format: "compact", outflow: true },
|
|
221
217
|
{ label: "Other Financing", key: "netOtherFinancingCharges", format: "compact" },
|
|
222
218
|
{ label: "Continuing Fin CF", key: "cashFlowFromContinuingFinancingActivities", format: "compact" },
|
|
223
219
|
],
|
|
@@ -14,6 +14,8 @@ import {
|
|
|
14
14
|
type DataTableColumn,
|
|
15
15
|
} from "../../../../components";
|
|
16
16
|
import { colors, priceColor } from "../../../../theme/colors";
|
|
17
|
+
import { notMeaningfulColor } from "../../../../components/ui/not-meaningful";
|
|
18
|
+
import { isNotMeaningful } from "../../../../utils/growth";
|
|
17
19
|
import { fiscalYearEndMonth } from "../../../../utils/fiscal-period";
|
|
18
20
|
import { displayWidth, padTo } from "../../../../utils/format";
|
|
19
21
|
import { filledPeriodPublications, filledPeriodsNote, stalePeriodNote } from "../../../../utils/financial-statements";
|
|
@@ -23,18 +25,16 @@ import {
|
|
|
23
25
|
financialPeriodWidth,
|
|
24
26
|
FINANCIAL_SUB_TABS,
|
|
25
27
|
buildFinancialRows,
|
|
26
|
-
canCompareFinancialRow,
|
|
27
28
|
collectDefaultCollapsedGroupIds,
|
|
28
29
|
collectGroupIds,
|
|
29
|
-
|
|
30
|
-
financialCellValue,
|
|
30
|
+
financialCellParts,
|
|
31
31
|
financialColumnLabel,
|
|
32
32
|
formatFinancialCell,
|
|
33
|
+
formatFinancialCellValue,
|
|
33
34
|
financialStatementCurrency,
|
|
34
35
|
financialStatementLimitations,
|
|
35
36
|
financialStatementPeriods,
|
|
36
37
|
financialSubTabFields,
|
|
37
|
-
formatFinancialValue,
|
|
38
38
|
latestFinancialPeriodEnd,
|
|
39
39
|
notInYetNote,
|
|
40
40
|
resolveFinancialPeriod,
|
|
@@ -359,7 +359,7 @@ export function ResolvedFinancialsTab({
|
|
|
359
359
|
if (nativePaneChrome || ratioTab) return FINANCIAL_COL_W;
|
|
360
360
|
const everyRow = shareFinancialUnit(buildFinancialRows(subTab.rows, displayStatements, NO_COLLAPSED_GROUPS)).rows;
|
|
361
361
|
const values = [...everyRow, ...rows].flatMap((row) => displayStatements.map((statement) => (
|
|
362
|
-
|
|
362
|
+
formatFinancialCellValue(row, statement)
|
|
363
363
|
)));
|
|
364
364
|
return financialPeriodWidth(values, periodHeaders);
|
|
365
365
|
}, [displayStatements, nativePaneChrome, periodHeaders, ratioTab, rows, subTab.rows]);
|
|
@@ -414,13 +414,7 @@ export function ResolvedFinancialsTab({
|
|
|
414
414
|
text: "",
|
|
415
415
|
};
|
|
416
416
|
|
|
417
|
-
const
|
|
418
|
-
const value = financialCellValue(row, column.statement);
|
|
419
|
-
const previousValue = previous ? financialCellValue(row, previous) : undefined;
|
|
420
|
-
const growth = (row.kind === "metric" && !row.showGrowth)
|
|
421
|
-
|| !canCompareFinancialRow(row, column.statement, previous, comparisonCurrency)
|
|
422
|
-
? undefined : computeGrowth(value, previousValue);
|
|
423
|
-
const formattedValue = formatFinancialValue(value, row, column.statement);
|
|
417
|
+
const { formattedValue, growth } = financialCellParts(row, column.statement, previousStatementMap.get(column.statement.date), comparisonCurrency);
|
|
424
418
|
const cell = formatFinancialCell(formattedValue, growth, column.width);
|
|
425
419
|
const growthColorValue = semanticGrowthValue(growth, row.growthDirection);
|
|
426
420
|
|
|
@@ -436,7 +430,8 @@ export function ResolvedFinancialsTab({
|
|
|
436
430
|
</Text>
|
|
437
431
|
<Text
|
|
438
432
|
attributes={row.kind === "group" ? TextAttributes.BOLD : TextAttributes.NONE}
|
|
439
|
-
|
|
433
|
+
// N/M growth as every pane draws it.
|
|
434
|
+
fg={growthColorValue != null ? priceColor(growthColorValue) : isNotMeaningful(growth) ? notMeaningfulColor() : colors.text}
|
|
440
435
|
>
|
|
441
436
|
{cell.growthText}
|
|
442
437
|
</Text>
|
|
@@ -7,7 +7,7 @@ import { hasValidQuoteObservationTime } from "../../../market-data/quotes/freshn
|
|
|
7
7
|
import { quoteMonitorColumns, quoteMonitorRow, QUOTE_MONITOR_BASE_COLUMNS, QUOTE_MONITOR_ROW_KEYS } from "./quote-monitor/rows";
|
|
8
8
|
import type { HeadlessPaneColumn, HeadlessPaneDefinition, HeadlessPaneFreshness, HeadlessPaneOptionValues } from "../../../types/headless";
|
|
9
9
|
import type { TimeRange } from "../../../time-series/range";
|
|
10
|
-
import { formatNumber } from "../../../utils/format";
|
|
10
|
+
import { MISSING_VALUE, formatNumber } from "../../../utils/format";
|
|
11
11
|
import { formatPriceObservation, penceFigure, quoteFormatOptions } from "../../../market-data/market/format";
|
|
12
12
|
import {
|
|
13
13
|
MISSING_VOLUME_TEXT, missingVolumeCount, missingVolumeNotice, pricePointOpenWithheld, pricePointWickFlags, priceHistoryIntegrityNotice,
|
|
@@ -46,7 +46,7 @@ import {
|
|
|
46
46
|
import { barHistoryFreshness, REPORTED_DATA } from "../shared/report-freshness";
|
|
47
47
|
import {
|
|
48
48
|
BAR_INTERVAL_LABELS, barPriceDecimals, cleanBarPrice, cleanFloat32Price, formatBarPrice, historyAllStart, historyAllStartNote, historyBarFlags,
|
|
49
|
-
historyBarValues, historyMissingPeriodsNote, historyPriceDecimals, priceTableIntegrityNotice, quotedPriceDivisor,
|
|
49
|
+
historyBarValues, historyExportUnit, historyMissingPeriodsNote, historyPriceDecimals, historyUnit, priceTableIntegrityNotice, quotedPriceDivisor,
|
|
50
50
|
} from "../../../cli/history-rows";
|
|
51
51
|
import { formatUtcTime } from "../../../utils/utc-time";
|
|
52
52
|
import { closeMoves } from "../../../utils/max-drawdown";
|
|
@@ -84,6 +84,22 @@ function reportWindowText(options: HeadlessPaneOptionValues): string | null {
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
+
/**
|
|
88
|
+
* What a listing's bars are priced in, as `history` exports it in `currency_or_unit` (`GBP`, `JPY per USD`, `index
|
|
89
|
+
* points`): by its quote, else by the listing facts research reads, as `history` falls back to them. Null when neither says.
|
|
90
|
+
*/
|
|
91
|
+
async function barPriceUnit(
|
|
92
|
+
ctx: Pick<HeadlessContext, "marketData">,
|
|
93
|
+
key: string,
|
|
94
|
+
listing: string,
|
|
95
|
+
exchange: string | undefined,
|
|
96
|
+
quote: { currency?: string; instrumentType?: string } | null,
|
|
97
|
+
): Promise<string | null> {
|
|
98
|
+
const listed = quote?.currency ? quote
|
|
99
|
+
: await ctx.marketData.getQuoteMetadata?.(listing, exchange ?? "").catch(logFailure("ticker-detail.headless", "Read listing facts for a bar unit failed", null));
|
|
100
|
+
return historyExportUnit(historyUnit(key, listed ?? quote));
|
|
101
|
+
}
|
|
102
|
+
|
|
87
103
|
/** Bars of a window that closed before today: the history asked for, which no later bar makes stale. */
|
|
88
104
|
function pastWindowFreshness(window: PriceWindow, size: HistoryBarSize, observedKey: string): HeadlessPaneFreshness {
|
|
89
105
|
return { status: "not-a-feed", basis: `${historyBarSizeWord(size)} bars, ${priceWindowText(window)}`, observedKey, oldest: null };
|
|
@@ -164,7 +180,9 @@ export const financialStatementsHeadless: HeadlessPaneDefinition<"rows"> = {
|
|
|
164
180
|
{ key: "metric", header: "Metric" },
|
|
165
181
|
...dates.map(({ date, label }, index) => ({
|
|
166
182
|
key: date, header: label, align: "right" as const,
|
|
167
|
-
|
|
183
|
+
// Exports write the amount alone, every digit; its growth (or N/M) is in the JSON and on the text table.
|
|
184
|
+
format: (_value: unknown, row: Record<string, unknown>) => (row.cells as Array<{ formatted: string }>)[index]!.formatted,
|
|
185
|
+
textFormat: (_value: unknown, row: Record<string, unknown>) => {
|
|
168
186
|
const cell = (row.cells as Array<{ formatted: string; growthFormatted: string }>)[index]!;
|
|
169
187
|
return [cell.formatted, cell.growthFormatted].filter(Boolean).join(" ");
|
|
170
188
|
},
|
|
@@ -397,7 +415,7 @@ export const quoteComparisonHeadless: HeadlessPaneDefinition<"rows"> = {
|
|
|
397
415
|
const historyPriceColumns = (volumeMissing: boolean, decimals?: number, pence?: (close: number) => string | null): HeadlessPaneColumn[] => ["open", "high", "low", "close", "volume"].map((key) => ({
|
|
398
416
|
key, header: key, align: "right" as const,
|
|
399
417
|
format: (value: unknown) => {
|
|
400
|
-
if (value == null || !Number.isFinite(Number(value))) return key === "volume" && volumeMissing ? MISSING_VOLUME_TEXT :
|
|
418
|
+
if (value == null || !Number.isFinite(Number(value))) return key === "volume" && volumeMissing ? MISSING_VOLUME_TEXT : MISSING_VALUE;
|
|
401
419
|
if (key === "volume") return formatNumber(Number(value), 0);
|
|
402
420
|
if (decimals == null) return formatPriceObservation(Number(value), { minimumFractionDigits: 2 });
|
|
403
421
|
// A London line's close also reads in pence, as the pane's close notes it: 6.385 638.5p.
|
|
@@ -526,8 +544,13 @@ export const historicalPricesHeadless: HeadlessPaneDefinition<"rows"> = {
|
|
|
526
544
|
const openNotice = priceHistoryOpenNotice(points.filter(pricePointOpenWithheld).length);
|
|
527
545
|
const reportNotices = [...moveLines, notice, openNotice, wickNotice, priceHistoryRescaleNotice(points)].filter((line): line is string => line != null);
|
|
528
546
|
const flagged = rows.some((row) => row.flag);
|
|
547
|
+
// Every exported bar names what it is priced in and its size, as `history --csv` does.
|
|
548
|
+
const unit = await barPriceUnit(ctx, symbol, listing, exchange, quote);
|
|
549
|
+
const barInterval = size === "intraday" ? isIntradayResolution(requested) ? requested : null : size;
|
|
529
550
|
return {
|
|
530
551
|
rows: shown,
|
|
552
|
+
...(unit ? { unit } : {}),
|
|
553
|
+
...(barInterval ? { interval: barInterval } : {}),
|
|
531
554
|
columns: historyColumns(size, marked, false, false, decimals, undefined, flagged),
|
|
532
555
|
textColumns: historyColumns(size, marked, true, volumeMissing > 0, decimals,
|
|
533
556
|
(close) => penceFigure(Number(close.toFixed(Math.min(20, decimals))), quote, decimals), flagged),
|
|
@@ -544,7 +567,7 @@ export const historicalPricesHeadless: HeadlessPaneDefinition<"rows"> = {
|
|
|
544
567
|
|
|
545
568
|
/** A percent with its sign, two decimals: `+0.63%`; a dash for a gap. */
|
|
546
569
|
function signedPercentCell(value: unknown): string {
|
|
547
|
-
if (typeof value !== "number" || !Number.isFinite(value)) return
|
|
570
|
+
if (typeof value !== "number" || !Number.isFinite(value)) return MISSING_VALUE;
|
|
548
571
|
return `${value >= 0 ? "+" : ""}${value.toFixed(2)}%`;
|
|
549
572
|
}
|
|
550
573
|
|
|
@@ -594,7 +617,7 @@ export const returnsHeadless: HeadlessPaneDefinition<"rows"> = {
|
|
|
594
617
|
// Today's daily bar is the session still trading, not a close: marked partial (DTD), as `history` marks it.
|
|
595
618
|
const dayToDate = isTodayReturnRow(returns.at(-1), series.resolution, venue, now);
|
|
596
619
|
const rows = forming || dayToDate ? [...unmarked.slice(0, -1), { ...unmarked.at(-1)!, partial: true }] : unmarked;
|
|
597
|
-
const price = (value: unknown) => typeof value === "number" && Number.isFinite(value) ? value.toFixed(decimals) :
|
|
620
|
+
const price = (value: unknown) => typeof value === "number" && Number.isFinite(value) ? value.toFixed(decimals) : MISSING_VALUE;
|
|
598
621
|
// The largest fall from a close to a later one in the window, said under the title; a yield's in bp, with its largest rise.
|
|
599
622
|
// A week's or month's close is dated by its last session, not the 1st its bar is dated by ("peak 35.70 on 2026-03-31").
|
|
600
623
|
const closes = unmarked.map((row) => ({ date: intraday ? row.time : barCloseSession(series.resolution, row.time, venue, now), close: row.close }));
|
|
@@ -625,6 +648,8 @@ export const returnsHeadless: HeadlessPaneDefinition<"rows"> = {
|
|
|
625
648
|
const textFigures = figures.map((column) => column.key === "intervalChange" ? { ...column, optional: true, dropPriority: 2 }
|
|
626
649
|
: column.key === "totalChange" ? { ...column, optional: true, dropPriority: 1 } : column);
|
|
627
650
|
const textColumns: HeadlessPaneColumn[] = [timeColumn(true), ...textFigures];
|
|
651
|
+
// Every exported row names what its prices are in and the bars' size, as `history --csv` does.
|
|
652
|
+
const unit = rows.length ? await barPriceUnit(ctx, key, symbol, exchange, null) : null;
|
|
628
653
|
// An interval the range is too long for is served in the nearest longer bar; say so rather than switch silently.
|
|
629
654
|
const notices = [
|
|
630
655
|
...moveLines,
|
|
@@ -639,6 +664,8 @@ export const returnsHeadless: HeadlessPaneDefinition<"rows"> = {
|
|
|
639
664
|
rows,
|
|
640
665
|
columns,
|
|
641
666
|
textColumns,
|
|
667
|
+
...(unit ? { unit } : {}),
|
|
668
|
+
interval: series.resolution,
|
|
642
669
|
unavailableSymbols: rows.length ? [] : [key],
|
|
643
670
|
...(rows.length ? {} : { errors: [`${key}: No bars in this window.`] }),
|
|
644
671
|
freshness: pastWindow ? pastWindowFreshness(window, series.resolution, "time") : {
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { PanelScale } from "../../../../time-series/types";
|
|
2
|
+
|
|
3
|
+
/** The Overview chart's value axis: picked from the history's range, or set by hand. */
|
|
4
|
+
export type OverviewChartScaleChoice = "auto" | PanelScale;
|
|
5
|
+
|
|
6
|
+
/** The research pane setting that remembers a scale set by hand. */
|
|
7
|
+
export const OVERVIEW_CHART_SCALE_SETTING = "overviewChartScale";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* A history whose highest close is at least this many times its lowest opens
|
|
11
|
+
* on a log axis: on a linear one its early years lie flat along the floor.
|
|
12
|
+
*/
|
|
13
|
+
export const AUTO_LOG_RANGE = 3;
|
|
14
|
+
|
|
15
|
+
export function parseOverviewChartScaleChoice(value: unknown): OverviewChartScaleChoice {
|
|
16
|
+
return value === "linear" || value === "log" ? value : "auto";
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The scale a history's own range calls for. A close at zero or below, which
|
|
21
|
+
* a log axis cannot place, keeps it linear, and so does a rate (a Treasury
|
|
22
|
+
* yield index), whose level does not compound.
|
|
23
|
+
*/
|
|
24
|
+
export function autoOverviewChartScale(
|
|
25
|
+
points: ReadonlyArray<{ value: number | null }>,
|
|
26
|
+
options: { rate?: boolean } = {},
|
|
27
|
+
): PanelScale {
|
|
28
|
+
if (options.rate) return "linear";
|
|
29
|
+
let low = Number.POSITIVE_INFINITY;
|
|
30
|
+
let high = Number.NEGATIVE_INFINITY;
|
|
31
|
+
for (const { value } of points) {
|
|
32
|
+
if (value === null || !Number.isFinite(value)) continue;
|
|
33
|
+
if (value <= 0) return "linear";
|
|
34
|
+
if (value < low) low = value;
|
|
35
|
+
if (value > high) high = value;
|
|
36
|
+
}
|
|
37
|
+
return high >= low * AUTO_LOG_RANGE ? "log" : "linear";
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function resolveOverviewChartScale(choice: OverviewChartScaleChoice, auto: PanelScale): PanelScale {
|
|
41
|
+
return choice === "auto" ? auto : choice;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The choice after switching the scale shown: the other scale, kept for every
|
|
46
|
+
* ticker the pane shows, or auto again once that is the one the history calls
|
|
47
|
+
* for, so switching back never leaves a choice behind.
|
|
48
|
+
*/
|
|
49
|
+
export function toggledOverviewChartScale(choice: OverviewChartScaleChoice, auto: PanelScale): OverviewChartScaleChoice {
|
|
50
|
+
const next: PanelScale = resolveOverviewChartScale(choice, auto) === "log" ? "linear" : "log";
|
|
51
|
+
return next === auto ? "auto" : next;
|
|
52
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
import { ActionRow, ColumnGrid, ColumnGridPair, RangeTrack, usePaneLinkMenuEntry, type ColumnGridCell, type ColumnGridColumn } from "../../../../components";
|
|
3
3
|
import { t, tf } from "../../../../i18n";
|
|
4
|
-
import { formatMarketPrice, formatMarketPriceWithCurrency, liveQuoteFormatOptions, type MarketFormatOptions } from "../../../../market-data/market/format";
|
|
4
|
+
import { formatMarketPrice, formatMarketPriceRange, formatMarketPriceWithCurrency, liveQuoteFormatOptions, type MarketFormatOptions } from "../../../../market-data/market/format";
|
|
5
5
|
import { colors, hoverBg, priceColor } from "../../../../theme/colors";
|
|
6
6
|
import type { Quote } from "../../../../types/financials";
|
|
7
7
|
import { Box, Text, useUiCapabilities } from "../../../../ui";
|
|
8
|
-
import { displayWidth, formatNumber, truncateToDisplayWidth } from "../../../../utils/format";
|
|
8
|
+
import { MISSING_VALUE, displayWidth, formatNumber, truncateToDisplayWidth } from "../../../../utils/format";
|
|
9
9
|
import type { OverviewFunctionLink, PositionTableRow, StatField } from "./types";
|
|
10
10
|
import { portfolioPnlLabel } from "../../../../portfolio/position-metrics";
|
|
11
11
|
|
|
@@ -60,7 +60,7 @@ function compactRangeOptions(low: number, high: number, priceOptions: MarketForm
|
|
|
60
60
|
return priceOptions;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
/** A range's two ends, in `style
|
|
63
|
+
/** A range's two ends, in `style`, both to one number of decimals. */
|
|
64
64
|
function formatRangeEndpoints(
|
|
65
65
|
low: number,
|
|
66
66
|
high: number,
|
|
@@ -68,9 +68,8 @@ function formatRangeEndpoints(
|
|
|
68
68
|
priceOptions: MarketFormatOptions,
|
|
69
69
|
style: RangeEndpointStyle = "price",
|
|
70
70
|
): [string, string] {
|
|
71
|
-
if (style === "price") return
|
|
72
|
-
|
|
73
|
-
return [formatMarketPrice(low, options), formatMarketPrice(high, options)];
|
|
71
|
+
if (style === "price") return formatMarketPriceRange(low, high, priceOptions, currency);
|
|
72
|
+
return formatMarketPriceRange(low, high, compactRangeOptions(low, high, priceOptions));
|
|
74
73
|
}
|
|
75
74
|
|
|
76
75
|
/** The longest endpoint among ranges drawn together, so stacked tracks start and end in one column. */
|
|
@@ -213,11 +212,11 @@ export function QuoteBook({ quote, assetCategory, width, desktopWidth }: {
|
|
|
213
212
|
const { nativePaneChrome } = useUiCapabilities();
|
|
214
213
|
// Bid, ask and spread keep the instrument's decimals on every tick ($224.58 / $224.60 / $0.02).
|
|
215
214
|
const priceOptions = liveQuoteFormatOptions(quote, quote.currency, assetCategory);
|
|
216
|
-
const bidPrice = quote.bid != null ? formatMarketPriceWithCurrency(quote.bid, quote.currency, priceOptions) :
|
|
217
|
-
const askPrice = quote.ask != null ? formatMarketPriceWithCurrency(quote.ask, quote.currency, priceOptions) :
|
|
215
|
+
const bidPrice = quote.bid != null ? formatMarketPriceWithCurrency(quote.bid, quote.currency, priceOptions) : MISSING_VALUE;
|
|
216
|
+
const askPrice = quote.ask != null ? formatMarketPriceWithCurrency(quote.ask, quote.currency, priceOptions) : MISSING_VALUE;
|
|
218
217
|
const bidText = quote.bidSize != null && quote.bidSize > 0 ? `${formatNumber(quote.bidSize, 0)} x ${bidPrice}` : bidPrice;
|
|
219
218
|
const askText = quote.askSize != null && quote.askSize > 0 ? `${formatNumber(quote.askSize, 0)} x ${askPrice}` : askPrice;
|
|
220
|
-
let spreadText =
|
|
219
|
+
let spreadText = MISSING_VALUE;
|
|
221
220
|
// A crossed book (a closing auction's last bid above its ask, Tencent's HK$430.80 / HK$430.40) has no spread to show.
|
|
222
221
|
if (quote.bid != null && quote.ask != null && quote.ask >= quote.bid) {
|
|
223
222
|
const spread = quote.ask - quote.bid;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { forwardFiscalYear, forwardPEAsked, formatPriceEarnings, NOT_MEANINGFUL } from "../../../../utils/price-earnings";
|
|
2
2
|
import { convertMarketCapitalization } from "../../../../utils/market-capitalization";
|
|
3
3
|
import { priceColor } from "../../../../theme/colors";
|
|
4
|
+
import { notMeaningfulColor } from "../../../../components/ui/not-meaningful";
|
|
5
|
+
import { NOT_MEANINGFUL_TEXT } from "../../../../utils/growth";
|
|
6
|
+
import type { ServedRate } from "../../../../utils/served-rates";
|
|
4
7
|
import type { CedearRatio, CompanyProfile, DepositaryPair, NextEarnings, Quote, TickerFinancials } from "../../../../types/financials";
|
|
5
8
|
import { adrRatioText } from "../../../../utils/depositary-receipt";
|
|
6
9
|
import { cedearRatioText, ratioCount } from "../../../../market-data/depositary-pair";
|
|
@@ -9,6 +12,7 @@ import type { Portfolio, TickerPosition, TickerRecord } from "../../../../types/
|
|
|
9
12
|
import type { BrokerInstanceConfig } from "../../../../types/config";
|
|
10
13
|
import type { BrokerAccount } from "../../../../types/trading";
|
|
11
14
|
import {
|
|
15
|
+
MISSING_VALUE,
|
|
12
16
|
formatCompact,
|
|
13
17
|
formatCompactCurrency,
|
|
14
18
|
formatCurrency,
|
|
@@ -31,11 +35,12 @@ import { getPortfolioPositionMetrics, getPortfolioQuoteDisplay, resolvePortfolio
|
|
|
31
35
|
import { listingDividendYield, liveForwardPE, liveMarketCapitalization, liveTrailingPE } from "../../../../market-data/quotes/live-valuation";
|
|
32
36
|
import { atRegularSessionPrice } from "../../../../market-data/quotes/regular-session-valuation";
|
|
33
37
|
import { formatReportedMoney, REPORTING_CURRENCY_NOT_SOURCED } from "../../../../utils/reported-money";
|
|
34
|
-
import { enterpriseValueCheck, enterpriseValueComputed, enterpriseValueNotMeaningful, fundamentalsCurrency,
|
|
38
|
+
import { enterpriseValueCheck, enterpriseValueComputed, enterpriseValueNotMeaningful, fundamentalsCurrency, financialEnterpriseValue, fundamentalsEpsCurrency, reportedEnterpriseValue } from "../../../../utils/fundamentals";
|
|
35
39
|
import { formatShortDate } from "../../../../utils/datetime-format";
|
|
36
40
|
import { safeExternalUrl } from "../../../../utils/external-url";
|
|
37
41
|
import type { FundBondFacts } from "../../../../api-client/fund-facts";
|
|
38
42
|
import { bondFigures } from "../../../../market-data/bond-funds";
|
|
43
|
+
import { quoteStatsBasisText } from "../../../../market-data/quotes/export-identity";
|
|
39
44
|
import { formatRunwayMonths, type CashRunway, type RunwayEstimate } from "../../../../utils/cash-runway";
|
|
40
45
|
|
|
41
46
|
type CurrencyConverter = (value: number, fromCurrency: string) => number;
|
|
@@ -63,7 +68,7 @@ function daysUntil(date: string, today: string): number {
|
|
|
63
68
|
return Math.round((Date.parse(`${date}T00:00:00Z`) - Date.parse(`${today}T00:00:00Z`)) / 86_400_000);
|
|
64
69
|
}
|
|
65
70
|
|
|
66
|
-
/** "Sep
|
|
71
|
+
/** "10 Sep", or "12 Dec '25" in another year. */
|
|
67
72
|
function calendarDate(date: string, today: string): string {
|
|
68
73
|
return formatShortDate(`${date}T00:00:00Z`, { year: date.slice(0, 4) === today.slice(0, 4) ? false : "2-digit", utc: true });
|
|
69
74
|
}
|
|
@@ -158,6 +163,7 @@ export function buildOverviewStats({
|
|
|
158
163
|
bond = null,
|
|
159
164
|
runway = null,
|
|
160
165
|
trailingEpsYear,
|
|
166
|
+
notMeaningful = {},
|
|
161
167
|
}: {
|
|
162
168
|
quote: Quote | undefined;
|
|
163
169
|
fundamentals: TickerFinancials["fundamentals"] | undefined;
|
|
@@ -187,6 +193,8 @@ export function buildOverviewStats({
|
|
|
187
193
|
runway?: CashRunway | null;
|
|
188
194
|
/** The fiscal year the trailing EPS is ("FY Mar-26"), when it is a year's a quarter or more old (trailingEpsFiscalYear). */
|
|
189
195
|
trailingEpsYear?: string;
|
|
196
|
+
/** Why a served margin or revenue growth is N/M (servedRatesNotMeaningful): read N/M, as RV and `ticker` read it. */
|
|
197
|
+
notMeaningful?: Partial<Record<ServedRate, string>>;
|
|
190
198
|
}): StatField[] {
|
|
191
199
|
const stats: StatField[] = [];
|
|
192
200
|
// Amounts no source names the currency of are bare; the first says so after it, once for all of them.
|
|
@@ -203,7 +211,9 @@ export function buildOverviewStats({
|
|
|
203
211
|
const volume = reportedQuoteVolume(quote);
|
|
204
212
|
if (volume != null) {
|
|
205
213
|
// Live figures keep their decimals (12.30M, not 12.3M) so the digits hold still.
|
|
206
|
-
|
|
214
|
+
// A coin's volume is the composite's or one exchange's own day, said beside it as its range's is.
|
|
215
|
+
const basis = quoteStatsBasisText(quote, false);
|
|
216
|
+
stats.push({ label: "Volume", value: formatCompact(volume, { fixedDecimals: true }), ...(basis ? { detail: basis } : {}) });
|
|
207
217
|
}
|
|
208
218
|
// Price-derived statistics follow the quote; see live-valuation for when a stored figure is kept.
|
|
209
219
|
// Market cap and EV read in the currency they are reported in, as the revenue and income beside them do, with
|
|
@@ -316,14 +326,16 @@ export function buildOverviewStats({
|
|
|
316
326
|
}
|
|
317
327
|
const runwayField = runwayStat(runway);
|
|
318
328
|
if (runwayField) stats.push(runwayField);
|
|
329
|
+
// A margin over revenue at or below zero, and growth off it, read N/M in N/M's own colour, never a sign's.
|
|
330
|
+
const notMeaningfulStat = (label: string): StatField => ({ label, value: NOT_MEANINGFUL_TEXT, valueColor: notMeaningfulColor() });
|
|
319
331
|
if (fundamentals?.operatingMargin != null) {
|
|
320
|
-
stats.push({ label: "Op Margin", value: formatLevelPercent(fundamentals.operatingMargin) });
|
|
332
|
+
stats.push(notMeaningful.operatingMargin ? notMeaningfulStat("Op Margin") : { label: "Op Margin", value: formatLevelPercent(fundamentals.operatingMargin) });
|
|
321
333
|
}
|
|
322
334
|
if (fundamentals?.profitMargin != null) {
|
|
323
|
-
stats.push({ label: "Profit Marg", value: formatLevelPercent(fundamentals.profitMargin) });
|
|
335
|
+
stats.push(notMeaningful.profitMargin ? notMeaningfulStat("Profit Marg") : { label: "Profit Marg", value: formatLevelPercent(fundamentals.profitMargin) });
|
|
324
336
|
}
|
|
325
337
|
if (fundamentals?.revenueGrowth != null) {
|
|
326
|
-
stats.push({
|
|
338
|
+
stats.push(notMeaningful.revenueGrowth ? notMeaningfulStat("Rev Growth") : {
|
|
327
339
|
label: "Rev Growth",
|
|
328
340
|
value: formatPercent(fundamentals.revenueGrowth),
|
|
329
341
|
valueColor: priceColor(fundamentals.revenueGrowth),
|
|
@@ -334,11 +346,13 @@ export function buildOverviewStats({
|
|
|
334
346
|
const enterpriseValue = reportedEnterpriseValue(priced);
|
|
335
347
|
// At or below zero, N/M as a P/E over a loss reads, with why in the space a stat has; valuation gives the full reason.
|
|
336
348
|
if (enterpriseValueNotMeaningful(priced)) {
|
|
337
|
-
// A bank's deposits are funding, not debt (
|
|
349
|
+
// A bank's deposits and an insurer's float are funding, not debt (withFinancialEnterpriseValue);
|
|
350
|
+
// any other's cash exceeds the rest.
|
|
351
|
+
const financial = financialEnterpriseValue(priced);
|
|
338
352
|
stats.push({ label: "EV", value: formatPriceEarnings(NOT_MEANINGFUL),
|
|
339
|
-
detail:
|
|
353
|
+
detail: financial ? financial.replace(/^n\/m /, "") : ["cash > cap + debt", "cash > cap"] });
|
|
340
354
|
} else if (fundamentals?.unavailableFields?.includes("enterpriseValue")) {
|
|
341
|
-
stats.push({ label: "EV", value:
|
|
355
|
+
stats.push({ label: "EV", value: MISSING_VALUE });
|
|
342
356
|
} else if (enterpriseValue != null) {
|
|
343
357
|
// Market cap + debt - cash (+ minority interest) where the provider's is more than 5% from it, as every view
|
|
344
358
|
// shows it; the notice under the pane gives its inputs where the provider's is far off (enterpriseValueGapIsLarge).
|
|
@@ -444,7 +458,7 @@ export function buildPositionRows({
|
|
|
444
458
|
currentPrice != null ? toBase(currentPrice, quoteCurrency) : null);
|
|
445
459
|
const pnlValue = selectedPnl.value;
|
|
446
460
|
const percent = portfolioPnlPercent(pnlValue, costBasisBase != null ? Math.abs(costBasisBase) : Number.NaN);
|
|
447
|
-
const returnPercent = percent === null ?
|
|
461
|
+
const returnPercent = percent === null ? MISSING_VALUE : formatPercentRaw(percent);
|
|
448
462
|
const unit = metrics.priceBasis === "percent-of-par" ? "" : ticker.metadata.assetCategory === "BOND" ? " units" : metrics.multiplierHint > 1 ? " ct" : " sh";
|
|
449
463
|
|
|
450
464
|
return {
|
|
@@ -465,10 +479,10 @@ export function buildPositionRows({
|
|
|
465
479
|
priceBasis: currentPrice != null ? quote?.priceBasis : metrics.priceBasis,
|
|
466
480
|
maxWidth: 9,
|
|
467
481
|
}, fallbackMarkCurrency))
|
|
468
|
-
:
|
|
469
|
-
cost: costBasisBase != null ? formatCurrency(costBasisBase, baseCurrency) :
|
|
470
|
-
value: marketValueBase != null ? formatCurrency(marketValueBase, baseCurrency) :
|
|
471
|
-
pnl: pnlValue != null ? `${pnlValue >= 0 ? "+" : ""}${formatCurrency(pnlValue, baseCurrency)}` :
|
|
482
|
+
: MISSING_VALUE,
|
|
483
|
+
cost: costBasisBase != null ? formatCurrency(costBasisBase, baseCurrency) : MISSING_VALUE,
|
|
484
|
+
value: marketValueBase != null ? formatCurrency(marketValueBase, baseCurrency) : MISSING_VALUE,
|
|
485
|
+
pnl: pnlValue != null ? `${pnlValue >= 0 ? "+" : ""}${formatCurrency(pnlValue, baseCurrency)}` : MISSING_VALUE,
|
|
472
486
|
ret: returnPercent,
|
|
473
487
|
pnlValue,
|
|
474
488
|
pnlBasis: selectedPnl.basis,
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
useAppDispatch,
|
|
10
10
|
useOptionalPaneInstanceId,
|
|
11
11
|
usePaneInstance,
|
|
12
|
+
usePaneSettingValue,
|
|
12
13
|
usePaneTicker,
|
|
13
14
|
} from "../../../../state/app/context";
|
|
14
15
|
import { usePluginAppActions } from "../../../runtime";
|
|
@@ -21,6 +22,7 @@ import { useTickerSnapshotState } from "../../../../market-data/hooks";
|
|
|
21
22
|
import { taxRatesFromSettings } from "../../../../market-data/tax-equivalent";
|
|
22
23
|
import { PaneLinkMenu } from "../../../../components";
|
|
23
24
|
import { FunctionLinkRow } from "./components";
|
|
25
|
+
import { OVERVIEW_CHART_SCALE_SETTING, parseOverviewChartScaleChoice } from "./chart-scale";
|
|
24
26
|
|
|
25
27
|
/** Registered by the chart composer, in the same plugin as this tab. */
|
|
26
28
|
const CHART_TAB_ID = "chart";
|
|
@@ -38,6 +40,8 @@ export function OverviewResearchTab({ width, height, focused }: TickerResearchTa
|
|
|
38
40
|
const dividend = useOverviewDividend(ticker?.metadata.ticker ?? null, ticker?.metadata.exchange ?? "", financials?.fundamentals);
|
|
39
41
|
// A pane locked to one tab has nowhere to go.
|
|
40
42
|
const lockedToOneTab = getTickerResearchPaneSettings(paneInstance?.settings).hideTabs;
|
|
43
|
+
// The chart's scale, once set from the pane menu, holds for every ticker the pane shows.
|
|
44
|
+
const [chartScale, setChartScale] = usePaneSettingValue<unknown>(OVERVIEW_CHART_SCALE_SETTING, "auto");
|
|
41
45
|
const openChart = useCallback(() => {
|
|
42
46
|
if (paneId) dispatch({ type: "UPDATE_PANE_STATE", paneId, patch: { activeTabId: CHART_TAB_ID } });
|
|
43
47
|
}, [dispatch, paneId]);
|
|
@@ -61,6 +65,8 @@ export function OverviewResearchTab({ width, height, focused }: TickerResearchTa
|
|
|
61
65
|
dividend={dividend}
|
|
62
66
|
snapshot={snapshot}
|
|
63
67
|
tax={taxRatesFromSettings(paneInstance?.settings)}
|
|
68
|
+
chartScale={parseOverviewChartScaleChoice(chartScale)}
|
|
69
|
+
onChartScaleChange={paneId ? setChartScale : undefined}
|
|
64
70
|
news={ticker ? (contentWidth: number) => (
|
|
65
71
|
<TickerNewsHeadlines ticker={ticker} width={contentWidth} openNewsView={openNewsView}>
|
|
66
72
|
<PaneLinkMenu><FunctionLinkRow link={NEWS} onOpen={openFunction} /></PaneLinkMenu>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../../utils/format";
|
|
1
2
|
import { useCallback } from "react";
|
|
2
3
|
import type { FundBondFacts } from "../../../../api-client/fund-facts";
|
|
3
4
|
import {
|
|
@@ -44,7 +45,7 @@ export function useOverviewTaxEquivalent(input: {
|
|
|
44
45
|
* cut to fit; DVD and fundamentals give the formulas whole.
|
|
45
46
|
*/
|
|
46
47
|
export function taxEquivalentFields(analysis: TaxEquivalentAnalysis | { error: string }): StatField[] {
|
|
47
|
-
const missing = (label: string, why: string): StatField => ({ label, value:
|
|
48
|
+
const missing = (label: string, why: string): StatField => ({ label, value: MISSING_VALUE, detail: why, clipDetail: true });
|
|
48
49
|
if ("error" in analysis) return [missing("Tax-Eq Yld", analysis.error)];
|
|
49
50
|
const lines = taxEquivalentLines(analysis);
|
|
50
51
|
const line = (key: string) => lines.find((entry) => entry.key === key);
|