@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,6 +1,6 @@
|
|
|
1
1
|
import type { HeadlessPaneDefinition } from "../../../types/headless";
|
|
2
2
|
import type { TimeRange } from "../../../time-series/range";
|
|
3
|
-
import { formatNumber, formatSignificant, significantDecimals } from "../../../utils/format";
|
|
3
|
+
import { MISSING_VALUE, formatNumber, formatSignificant, significantDecimals } from "../../../utils/format";
|
|
4
4
|
import { logFailure } from "../../../utils/log-failure";
|
|
5
5
|
import { mixedSessionCloseNote } from "../../../market-data/market/session-close-note";
|
|
6
6
|
import { resolveHeadlessInstrument, loadHeadlessSymbols } from "../shared/headless-market-data";
|
|
@@ -53,7 +53,7 @@ export const correlationHeadless: HeadlessPaneDefinition<"rows"> = {
|
|
|
53
53
|
describe: ({ symbols, options }) => `Correlation Matrix | Daily returns | ${options.rangePreset ?? "1Y"} | ${symbols.join(", ")}`,
|
|
54
54
|
columns: [
|
|
55
55
|
{ key: "pair", header: "Pair", format: (_value, row) => `${row.left}/${row.right}` },
|
|
56
|
-
{ key: "correlation", header: "Correlation", align: "right", format: (value) => value == null ?
|
|
56
|
+
{ key: "correlation", header: "Correlation", align: "right", format: (value) => value == null ? MISSING_VALUE : formatNumber(Number(value), 3) },
|
|
57
57
|
{ key: "sampleSize", header: "Shared obs", align: "right" },
|
|
58
58
|
],
|
|
59
59
|
async load({ symbols, options }, ctx) {
|
|
@@ -13,6 +13,7 @@ import { useShortcut } from "../../../react/input";
|
|
|
13
13
|
import { buildChartKey } from "../../../market-data/selectors";
|
|
14
14
|
import { formatTickerListInput } from "../../../tickers/list";
|
|
15
15
|
import { isPlainKey } from "../../../utils/keyboard";
|
|
16
|
+
import { logFailure } from "../../../utils/log-failure";
|
|
16
17
|
import { useAsyncResource } from "../../../react/async-resource";
|
|
17
18
|
import { cloudGeoRequest } from "../world-venue-map/client";
|
|
18
19
|
import { geoSeriesToken, loadGeoCorrelationHistory } from "./geo";
|
|
@@ -188,7 +189,9 @@ function CorrelationMatrixPane({ focused, width, height }: PaneProps) {
|
|
|
188
189
|
|
|
189
190
|
const refresh = useCallback(() => {
|
|
190
191
|
const coordinator = getSharedMarketDataCoordinator();
|
|
191
|
-
for (const request of chartRequests)
|
|
192
|
+
for (const request of chartRequests) {
|
|
193
|
+
coordinator?.loadChart(request, { forceRefresh: true }).catch(logFailure("correlation", "Refreshing chart data failed"));
|
|
194
|
+
}
|
|
192
195
|
if (geoKey) geoHistory.reload();
|
|
193
196
|
}, [chartRequests, geoKey, geoHistory.reload]);
|
|
194
197
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../../utils/format";
|
|
1
2
|
import { chartTableLayout } from "../../../../components/chart-table/layout";
|
|
2
3
|
import { alignDailyCloses, pairedChanges } from "../compute";
|
|
3
4
|
import { buildRollingCorrelationPoints } from "../relationship/model";
|
|
@@ -74,6 +75,6 @@ export function matrixPairRead(
|
|
|
74
75
|
fullPeriod: number | null,
|
|
75
76
|
history: Pick<ReturnType<typeof buildMatrixPairHistory>, "window" | "latest" | "min" | "max">,
|
|
76
77
|
): string {
|
|
77
|
-
const value = (number: number | null) => number !== null && Number.isFinite(number) ? number.toFixed(2) :
|
|
78
|
+
const value = (number: number | null) => number !== null && Number.isFinite(number) ? number.toFixed(2) : MISSING_VALUE;
|
|
78
79
|
return `${pair[0]} and ${pair[1]}: full period ${value(fullPeriod)}, now ${value(history.latest)} (${history.window} day), range ${value(history.min)} to ${value(history.max)}`;
|
|
79
80
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ProjectedChartPoint } from "../../../../components/chart/core/data";
|
|
2
2
|
import type { ScatterChartPoint } from "../../../../components/chart/static";
|
|
3
3
|
import { colors } from "../../../../theme/colors";
|
|
4
|
-
import { formatNumber, formatSignificant } from "../../../../utils/format";
|
|
4
|
+
import { MISSING_VALUE, formatNumber, formatSignificant } from "../../../../utils/format";
|
|
5
5
|
import type { CompositeAxisDomain } from "../../../../components/chart/composite/types";
|
|
6
6
|
import type { StatItem } from "../../../../components/ui";
|
|
7
7
|
import type {
|
|
@@ -18,13 +18,13 @@ export interface MultiLineChartSeries {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
function formatNullableNumber(value: number | null | undefined, decimals: number): string {
|
|
21
|
-
return typeof value === "number" && Number.isFinite(value) ? formatNumber(value, decimals) :
|
|
21
|
+
return typeof value === "number" && Number.isFinite(value) ? formatNumber(value, decimals) : MISSING_VALUE;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
/** A figure in percentage points of daily return, as alpha reads: `1.997%`, or a bare dash when there is none. */
|
|
25
25
|
function formatNullablePercent(value: number | null | undefined, decimals: number): string {
|
|
26
26
|
const text = formatNullableNumber(value, decimals);
|
|
27
|
-
return text ===
|
|
27
|
+
return text === MISSING_VALUE ? text : `${text}%`;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import type { CotClass, CotClassSummary, CotContractPayload, CotFamily, CotHistoryPoint } from "../../../api-client/cot";
|
|
2
3
|
import type { HeadlessPaneColumn, HeadlessPaneDefinition } from "../../../types/plugin";
|
|
3
4
|
import { fetchCotBoard, fetchCotContract } from "./client";
|
|
@@ -10,8 +11,8 @@ const camelClass = (id: CotClass) => id.replace(/-(\w)/g, (_match, letter: strin
|
|
|
10
11
|
const rounded = (value: number | null, digits: number) => value == null ? null : Number(value.toFixed(digits));
|
|
11
12
|
const count = (value: unknown) => cotInteger(typeof value === "number" ? value : null);
|
|
12
13
|
const signed = (value: unknown) => cotInteger(typeof value === "number" ? value : null, true);
|
|
13
|
-
const percent = (value: unknown) => typeof value === "number" ? `${value > 0 ? "+" : ""}${value.toFixed(1)}%` :
|
|
14
|
-
const rank = (value: unknown) => typeof value === "number" ? value.toFixed(0) :
|
|
14
|
+
const percent = (value: unknown) => typeof value === "number" ? `${value > 0 ? "+" : ""}${value.toFixed(1)}%` : MISSING_VALUE;
|
|
15
|
+
const rank = (value: unknown) => typeof value === "number" ? value.toFixed(0) : MISSING_VALUE;
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* The report's release, by the CFTC's schedule, as Gloom Cloud states it (else
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import type { CotClass, CotContractPayload, CotFamily, CotHistoryPoint, CotPositions } from "../../../api-client/cot";
|
|
2
3
|
import { staticSeries } from "../../../components/chart/static/series";
|
|
3
4
|
import type { ResolvedSeries } from "../../../time-series/types";
|
|
@@ -304,7 +305,7 @@ export function cotContractUnitText(units: string | null | undefined): string |
|
|
|
304
305
|
return text ? `1 contract = ${PLAIN_UNITS.test(text) ? text.toLowerCase() : text}` : null;
|
|
305
306
|
}
|
|
306
307
|
export function cotInteger(value: number | null, signed = false): string {
|
|
307
|
-
return value == null ?
|
|
308
|
+
return value == null ? MISSING_VALUE : `${signed && value > 0 ? "+" : ""}${value.toLocaleString("en-US", { maximumFractionDigits: 0 })}`;
|
|
308
309
|
}
|
|
309
310
|
|
|
310
311
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import { useCallback, useMemo, useRef, useState } from "react";
|
|
2
3
|
import { ChartTableHeader, CompositeChart, DataTableStackView, spanDigits, DataTableView, PaneStatusBody, QueryBar, usePaneFooter, usePaneNoticeFooter, usePaneStatusFooter, usePaneTabs, useQueryBarSearch, type ChartTableChart, type DataTableColumn, type SelectControl } from "../../../components";
|
|
3
4
|
import { useAsyncResource, usePluginPaneState, useShortcut } from "../../../public/react";
|
|
@@ -40,7 +41,7 @@ const NET_PRICE_PANELS = [{ id: "net", height: 2 }, { id: "price", height: 1 }];
|
|
|
40
41
|
const NET_PANEL = [{ id: "net" }];
|
|
41
42
|
/** Legend, four net rows, two price rows and the axis; a shorter band keeps the net alone. */
|
|
42
43
|
const PRICE_PANEL_MIN_ROWS = 8;
|
|
43
|
-
const rank = (value: number | null | undefined) => value == null ?
|
|
44
|
+
const rank = (value: number | null | undefined) => value == null ? MISSING_VALUE : value.toFixed(0);
|
|
44
45
|
/** A class's rank in a percentile column: 1Y, 3Y, or against every stored report (`all`). */
|
|
45
46
|
const columnRank = (row: CotClassSummary, column: string) =>
|
|
46
47
|
(column === "one" ? row.percentile1Y : column === "three" ? row.percentile3Y : row.percentileAll)?.value ?? null;
|
|
@@ -110,7 +111,7 @@ function CotBoard({ width, height, focused, family, initialCode }: PaneProps & {
|
|
|
110
111
|
] : [] }), [boardShown, focusSearch]);
|
|
111
112
|
usePaneNoticeFooter({ registrationId: "cot:board-notices", focused, enabled: !open, notices: data?.gaps ?? [] });
|
|
112
113
|
usePaneStatusFooter({ registrationId: "cot:board", enabled: !open, loading: resource.loading, error: resource.error,
|
|
113
|
-
info: data ? [{ id: "as-of", parts: [{ text: `CFTC ${cotPositionsText(positions)} · ${data.asOf ??
|
|
114
|
+
info: data ? [{ id: "as-of", parts: [{ text: `CFTC ${cotPositionsText(positions)} · ${data.asOf ?? MISSING_VALUE} · contracts`, tone: "muted" }] }] : [] });
|
|
114
115
|
// A class change reloads under the query bar, which stays.
|
|
115
116
|
return <DataTableStackView<CotBoardRow> columns={BOARD_COLUMNS} items={rows} focused={focused && !searching}
|
|
116
117
|
status={data ? undefined : { loading: resource.loading, error: resource.error, empty: !resource.loading && !resource.error, subject: "COT history" }}
|
|
@@ -196,7 +197,7 @@ function CotDetail({ width, height, focused, code, family, positions, traderClas
|
|
|
196
197
|
usePaneStatusFooter({ registrationId: "cot:detail", loading: resource.loading, error: resource.error,
|
|
197
198
|
// The unit the net is counted in, as `fn COT` titles it: what one contract is, where the report says.
|
|
198
199
|
// Futures and options combined says so; futures only reads as it always has.
|
|
199
|
-
info: payload ? [{ id: "as-of", parts: [{ text: `CFTC ${positions === "combined" ? `${cotPositionsText(positions)} · ` : ""}${payload.asOf ??
|
|
200
|
+
info: payload ? [{ id: "as-of", parts: [{ text: `CFTC ${positions === "combined" ? `${cotPositionsText(positions)} · ` : ""}${payload.asOf ?? MISSING_VALUE} · ${cotContractUnitText(payload.contract?.contractUnits) ?? "contracts"}${data?.priceAsOf ? ` · ${data.priceSymbol} ${data.priceAsOf}` : ""}`, tone: "muted" }] }] : [] });
|
|
200
201
|
return <PaneStatusBody loading={resource.loading && !data} error={!data ? resource.error : null} empty={!!payload && !payload.contract} subject="COT contract">
|
|
201
202
|
{payload && data ? <DataTableView columns={POSITION_COLUMNS} items={payload.positions} focused={focused} rootWidth={width} rootHeight={height}
|
|
202
203
|
rootBefore={<ChartTableHeader width={width} height={height} tableRows={payload.positions.length} chart={chart}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import type { CpiRow } from "../../../api-client/cpi";
|
|
2
3
|
import type { HeadlessPaneDefinition } from "../../../types/plugin";
|
|
3
4
|
import { fetchCpiBoard } from "./client";
|
|
4
|
-
import { cpiHeaderLine, cpiMonth, cpiRowOption, cpiRows } from "./model";
|
|
5
|
+
import { cpiHeaderLine, cpiHeadlineYearGapLine, cpiMonth, cpiRowOption, cpiRows, cpiYearGapLine } from "./model";
|
|
5
6
|
|
|
6
7
|
/** Two decimals; a value that rounds to zero reads 0.00, never -0.00. */
|
|
7
|
-
const percent = (value: unknown) => typeof value === "number" ? (Number(value.toFixed(2)) === 0 ? "0.00" : value.toFixed(2)) :
|
|
8
|
-
const weight = (value: unknown) => typeof value === "number" ? value.toFixed(3) :
|
|
9
|
-
const text = (value: unknown) => typeof value === "string" ? value :
|
|
8
|
+
const percent = (value: unknown) => typeof value === "number" ? (Number(value.toFixed(2)) === 0 ? "0.00" : value.toFixed(2)) : MISSING_VALUE;
|
|
9
|
+
const weight = (value: unknown) => typeof value === "number" ? value.toFixed(3) : MISSING_VALUE;
|
|
10
|
+
const text = (value: unknown) => typeof value === "string" ? value : MISSING_VALUE;
|
|
10
11
|
|
|
11
12
|
/** One row per component in the release's order; numbers stay raw for JSON, rounded for text. */
|
|
12
13
|
function reportRow(row: CpiRow, indent = true) {
|
|
@@ -28,6 +29,8 @@ const SUMMARY_COLUMNS = [
|
|
|
28
29
|
{ key: "contributionYear", header: "Y/Y pts", align: "right" as const, format: percent },
|
|
29
30
|
];
|
|
30
31
|
|
|
32
|
+
const notesOf = (note: string | null) => note ? { notes: [note] } : {};
|
|
33
|
+
|
|
31
34
|
/** The selected row's months against the headline's year over year: the chart as a table. */
|
|
32
35
|
function historyRows(row: CpiRow, headline: CpiRow | null) {
|
|
33
36
|
const headlineYear = new Map((headline?.history ?? []).map(([month, , yoy]) => [month, yoy]));
|
|
@@ -72,6 +75,8 @@ export const cpiHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
72
75
|
rows: historyRows(row, headline) },
|
|
73
76
|
],
|
|
74
77
|
errors: data.gaps,
|
|
78
|
+
// Why the month's y/y is empty (no October 2025 index), and the latest the row has.
|
|
79
|
+
...notesOf(cpiYearGapLine(data, row)),
|
|
75
80
|
freshness,
|
|
76
81
|
metadata: { ...metadata, rows: [row] },
|
|
77
82
|
};
|
|
@@ -79,6 +84,7 @@ export const cpiHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
79
84
|
return {
|
|
80
85
|
sections: [{ title: header, columns: SUMMARY_COLUMNS, rows: cpiRows(data).map((row) => reportRow(row)) }],
|
|
81
86
|
errors: data.gaps,
|
|
87
|
+
...notesOf(cpiHeadlineYearGapLine(data)),
|
|
82
88
|
freshness,
|
|
83
89
|
metadata,
|
|
84
90
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import type { CpiBoardPayload, CpiReleaseStatus, CpiRow } from "../../../api-client/cpi";
|
|
2
3
|
import type { ChartStripSpec } from "../../../components/chart-table/header";
|
|
3
4
|
import { staticSeries } from "../../../components/chart/static/series";
|
|
4
5
|
import type { ResolvedSeries } from "../../../time-series/types";
|
|
6
|
+
import { cpiYearGapNote } from "../shared/cpi-year-gap";
|
|
5
7
|
|
|
6
8
|
/**
|
|
7
9
|
* The rows Gloom Cloud serves, by the ids its board uses, so `CPI shelter`
|
|
@@ -94,11 +96,11 @@ function signed(value: number, decimals: number): string {
|
|
|
94
96
|
}
|
|
95
97
|
|
|
96
98
|
/** Percent changes as the pane shows them: two decimals, signed, no unit (the header names it). */
|
|
97
|
-
export const formatCpiChange = (value: number | null) => value == null ?
|
|
99
|
+
export const formatCpiChange = (value: number | null) => value == null ? MISSING_VALUE : signed(value, 2);
|
|
98
100
|
/** Contributions in percentage points, two decimals, signed. */
|
|
99
|
-
export const formatCpiPoints = (value: number | null) => value == null ?
|
|
101
|
+
export const formatCpiPoints = (value: number | null) => value == null ? MISSING_VALUE : signed(value, 2);
|
|
100
102
|
/** Share of the basket, percent: one decimal. */
|
|
101
|
-
export const formatCpiWeight = (value: number | null) => value == null ?
|
|
103
|
+
export const formatCpiWeight = (value: number | null) => value == null ? MISSING_VALUE : value.toFixed(1);
|
|
102
104
|
|
|
103
105
|
const MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
104
106
|
|
|
@@ -107,19 +109,19 @@ export function cpiMonth(period: string): string {
|
|
|
107
109
|
return `${MONTHS[Number(period.slice(5, 7)) - 1]} ${period.slice(0, 4)}`;
|
|
108
110
|
}
|
|
109
111
|
|
|
110
|
-
/** A release instant on BLS's own clock: "Wed Oct
|
|
112
|
+
/** A release instant on BLS's own clock: "Wed 14 Oct 08:30 ET". */
|
|
111
113
|
function releaseTime(iso: string): string {
|
|
112
114
|
const parts = Object.fromEntries(new Intl.DateTimeFormat("en-US", {
|
|
113
115
|
timeZone: "America/New_York", weekday: "short", month: "short", day: "numeric",
|
|
114
116
|
hour: "2-digit", minute: "2-digit", hourCycle: "h23",
|
|
115
117
|
}).formatToParts(new Date(iso)).map((part) => [part.type, part.value]));
|
|
116
|
-
return `${parts.weekday} ${parts.
|
|
118
|
+
return `${parts.weekday} ${parts.day} ${parts.month} ${parts.hour}:${parts.minute} ET`;
|
|
117
119
|
}
|
|
118
120
|
|
|
119
121
|
/**
|
|
120
122
|
* The month the data covers, when it came out and when the next release is
|
|
121
|
-
* due, on one line: "Aug 2026 · released Fri Sep
|
|
122
|
-
* 14 08:30 ET". A release past its time and not in yet reads "due".
|
|
123
|
+
* due, on one line: "Aug 2026 · released Fri 11 Sep 08:30 ET · next Wed
|
|
124
|
+
* 14 Oct 08:30 ET". A release past its time and not in yet reads "due".
|
|
123
125
|
*/
|
|
124
126
|
export function cpiHeaderLine(release: CpiReleaseStatus, now = Date.now()): string | undefined {
|
|
125
127
|
if (!release.period) return undefined;
|
|
@@ -190,6 +192,22 @@ export function cpiChartSeries(row: CpiRow, headline: CpiRow | null, colors: Cpi
|
|
|
190
192
|
return series.filter((entry) => entry.points.length > 0);
|
|
191
193
|
}
|
|
192
194
|
|
|
195
|
+
/**
|
|
196
|
+
* Why a row's year-over-year change is empty for the release's month, with the
|
|
197
|
+
* latest month it has one for (`cpiYearGapNote`): "BLS published no October
|
|
198
|
+
* 2025 index, so no October 2026 y/y; All items 3.7% in September 2026." Null
|
|
199
|
+
* when the row has its change, or misses it for another reason.
|
|
200
|
+
*/
|
|
201
|
+
export function cpiYearGapLine(payload: Pick<CpiBoardPayload, "release">, row: CpiRow | null | undefined): string | null {
|
|
202
|
+
if (!payload.release.period || !row || row.yoy != null) return null;
|
|
203
|
+
const latest = row.history.findLast(([period, , yoy]) => yoy != null && period < payload.release.period!);
|
|
204
|
+
return cpiYearGapNote(payload.release.period, row.label, latest ? { period: latest[0], value: latest[2]! } : null);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/** The headline's gap line (`cpiYearGapLine`), which the table closes on. */
|
|
208
|
+
export const cpiHeadlineYearGapLine = (payload: CpiBoardPayload) =>
|
|
209
|
+
cpiYearGapLine(payload, payload.rows.find((row) => row.code === "SA0"));
|
|
210
|
+
|
|
193
211
|
/** One row for a short pane: the row's year-over-year line and its latest value. */
|
|
194
212
|
export function cpiChartStrip(row: CpiRow, color: string): ChartStripSpec | null {
|
|
195
213
|
const values = row.history.flatMap(([, , yoy]) => (yoy == null ? [] : [yoy]));
|
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
cpiChartSeries,
|
|
30
30
|
cpiChartStrip,
|
|
31
31
|
cpiHeaderLine,
|
|
32
|
+
cpiHeadlineYearGapLine,
|
|
32
33
|
cpiMonthDate,
|
|
33
34
|
cpiRowLabel,
|
|
34
35
|
cpiRows,
|
|
@@ -146,7 +147,8 @@ export function CpiPane({ width, height, focused }: PaneProps) {
|
|
|
146
147
|
useAutoRefresh(resource.updatedAt, resource.load);
|
|
147
148
|
usePaneRefreshKey(() => resource.reload(), { focused });
|
|
148
149
|
usePaneNoticeFooter({ registrationId: "cpi:notices", focused,
|
|
149
|
-
notices: [...(data?.gaps ?? []), ...(
|
|
150
|
+
notices: [...(data?.gaps ?? []), ...(data ? [cpiHeadlineYearGapLine(data)].filter((line): line is string => !!line) : []),
|
|
151
|
+
...(resource.data?.refreshError ? [resource.data.refreshError] : [])] });
|
|
150
152
|
usePaneStatusFooter({ registrationId: "cpi", loading: resource.loading, error: notAvailable ? null : resource.error,
|
|
151
153
|
stale: !!data && resource.data?.stale });
|
|
152
154
|
return (
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import { useMemo } from "react";
|
|
2
3
|
import {
|
|
3
4
|
DELAYED_SEGMENT,
|
|
@@ -75,7 +76,7 @@ function IndexDetail({ row, width, height, focused }: { row: CdxRow; width: numb
|
|
|
75
76
|
...(index.recovery != null ? [`${Math.round(index.recovery * 100)}% recovery`] : [])].join(" · ");
|
|
76
77
|
const items: StatItem[] = [
|
|
77
78
|
{ id: "level", label: index.quote === "spread" ? "5Y spread" : "5Y price", value: formatLevel(index.quote, index.level),
|
|
78
|
-
detail: [...(rankOnSpreadEq ? [] : [formatSpreadRank(rank)]), index.date ??
|
|
79
|
+
detail: [...(rankOnSpreadEq ? [] : [formatSpreadRank(rank)]), index.date ?? MISSING_VALUE, ...(index.kind === "settlement" ? [SETTLEMENT_TEXT] : [])].join(" · ") },
|
|
79
80
|
...(index.quote === "price" && index.spreadBp !== undefined ? [{ id: "spread", label: "Spread eq", value: formatLevel("spread", index.spreadBp ?? null),
|
|
80
81
|
...(spreadDetail ? { detail: spreadDetail } : {}) }] : []),
|
|
81
82
|
{ id: "1d", label: "1D", value: formatMove(index.quote, day.change1D), ...(through ? { detail: through } : {}) },
|
|
@@ -83,7 +84,7 @@ function IndexDetail({ row, width, height, focused }: { row: CdxRow; width: numb
|
|
|
83
84
|
{ id: "1m", label: "1M", value: formatMove(index.quote, day.change1M) },
|
|
84
85
|
{ id: "range", label: "1Y range", value: `${formatLevel(index.quote, year.low)} to ${formatLevel(index.quote, year.high)}` },
|
|
85
86
|
{ id: "contract", label: "Contract", value: formatContract(index.maturity), detail: `${index.couponBp}bp coupon` },
|
|
86
|
-
{ id: "prints", label: "Prints", value: index.prints == null ?
|
|
87
|
+
{ id: "prints", label: "Prints", value: index.prints == null ? MISSING_VALUE : String(index.prints),
|
|
87
88
|
// The value is the count already: the detail says only that the day is still trading, and its last print.
|
|
88
89
|
...(day.partial ? { detail: partialDayText(null, day.lastPrintAt) } : {}) },
|
|
89
90
|
];
|
|
@@ -160,7 +161,7 @@ export function CdxPane({ focused, width, height }: PaneProps) {
|
|
|
160
161
|
column: { id: "spread", label: "SPREAD EQ", width: 9, align: "right" as const },
|
|
161
162
|
sortValue: (row: CdxRow) => row.index.quote === "price" ? row.index.spreadBp ?? null : null,
|
|
162
163
|
renderCell: (row: CdxRow) => ({
|
|
163
|
-
text: row.index.quote === "price" ? formatLevel("spread", row.index.spreadBp ?? null) :
|
|
164
|
+
text: row.index.quote === "price" ? formatLevel("spread", row.index.spreadBp ?? null) : MISSING_VALUE,
|
|
164
165
|
color: theme.textMuted,
|
|
165
166
|
}),
|
|
166
167
|
}] : []),
|
|
@@ -168,7 +169,7 @@ export function CdxPane({ focused, width, height }: PaneProps) {
|
|
|
168
169
|
column: { id: "prints", label: "PRINTS", width: 7, align: "right" as const },
|
|
169
170
|
sortValue: (row: CdxRow) => row.index.prints,
|
|
170
171
|
renderCell: (row: CdxRow) => ({
|
|
171
|
-
text: row.index.prints == null ?
|
|
172
|
+
text: row.index.prints == null ? MISSING_VALUE : String(row.index.prints),
|
|
172
173
|
color: theme.textMuted,
|
|
173
174
|
}),
|
|
174
175
|
},
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import type { HeadlessPaneColumn, HeadlessPaneDefinition, HeadlessPaneRow } from "../../../types/plugin";
|
|
2
3
|
import type { CdxBoardIndex, CreditIndexQuote } from "../../../api-client/credit-boards";
|
|
3
4
|
import { boardPublisher, CDX_MAX_DAYS, fetchCdxBoard, fetchSovrBoard, loadCurrencyMoves } from "./client";
|
|
@@ -17,7 +18,7 @@ import {
|
|
|
17
18
|
sovrRows,
|
|
18
19
|
} from "./model";
|
|
19
20
|
|
|
20
|
-
const percentile = (value: unknown) => value == null ?
|
|
21
|
+
const percentile = (value: unknown) => value == null ? MISSING_VALUE : Number(value).toFixed(0);
|
|
21
22
|
/** A 1Y rank as the board draws it, a whole number, so exports do not carry 8.23293172691. */
|
|
22
23
|
const rank = (value: number | null) => value == null ? null : Math.round(value);
|
|
23
24
|
/** The series a row is of, as `history` and the data catalog name it: `cdx:hy`, `sovereign-cds:br`. */
|
|
@@ -10,7 +10,7 @@ import { historyStatistics } from "../../../components/chart/curve/model";
|
|
|
10
10
|
import type { MarketBoardRow } from "../../../components/market-board";
|
|
11
11
|
import type { PricePoint } from "../../../types/financials";
|
|
12
12
|
import type { HeadlessPaneColumn } from "../../../types/plugin";
|
|
13
|
-
import { formatPercentileRank } from "../../../utils/format";
|
|
13
|
+
import { MISSING_VALUE, formatPercentileRank } from "../../../utils/format";
|
|
14
14
|
|
|
15
15
|
const YEAR_DAYS = 365;
|
|
16
16
|
/** A level older than this is not the current market. */
|
|
@@ -135,13 +135,13 @@ export function partialDayText(prints: number | null, lastPrintAt: string | null
|
|
|
135
135
|
|
|
136
136
|
/** Spreads in bp with a decimal; prices as quoted, to the cent. */
|
|
137
137
|
export function formatLevel(quote: CreditIndexQuote, value: number | null): string {
|
|
138
|
-
if (value == null || !Number.isFinite(value)) return
|
|
138
|
+
if (value == null || !Number.isFinite(value)) return MISSING_VALUE;
|
|
139
139
|
return quote === "spread" ? `${value.toFixed(1)}bp` : value.toFixed(2);
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
/** A move in the quote's unit: `+1.2bp`, or `-0.13` points of price. */
|
|
143
143
|
export function formatMove(quote: CreditIndexQuote, value: number | null): string {
|
|
144
|
-
if (value == null || !Number.isFinite(value)) return
|
|
144
|
+
if (value == null || !Number.isFinite(value)) return MISSING_VALUE;
|
|
145
145
|
const digits = quote === "spread" ? 1 : 2;
|
|
146
146
|
const rounded = Number(value.toFixed(digits));
|
|
147
147
|
const sign = rounded > 0 ? "+" : "";
|
|
@@ -235,7 +235,7 @@ function stale(date: string | null, asOf: string | null): boolean {
|
|
|
235
235
|
|
|
236
236
|
/** `2031-12-20` as `Dec 2031`, how the contract is named on a desk. */
|
|
237
237
|
export function formatContract(maturity: string | null): string {
|
|
238
|
-
if (!maturity) return
|
|
238
|
+
if (!maturity) return MISSING_VALUE;
|
|
239
239
|
const date = new Date(`${maturity}T00:00:00Z`);
|
|
240
240
|
return Number.isNaN(date.getTime())
|
|
241
241
|
? maturity
|
|
@@ -336,7 +336,7 @@ export function sovrRows(
|
|
|
336
336
|
|
|
337
337
|
/** `BRL -1.2%`; a dollar or dollar-pegged currency still shows its code. */
|
|
338
338
|
export function formatCurrencyMove(currency: string, movePercent: number | null): string {
|
|
339
|
-
if (movePercent == null || !Number.isFinite(movePercent)) return `${currency}
|
|
339
|
+
if (movePercent == null || !Number.isFinite(movePercent)) return `${currency} ${MISSING_VALUE}`;
|
|
340
340
|
const rounded = Number(movePercent.toFixed(1));
|
|
341
341
|
const sign = rounded > 0 ? "+" : "";
|
|
342
342
|
return `${currency} ${sign}${rounded === 0 ? "0.0" : rounded.toFixed(1)}%`;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import type {
|
|
2
3
|
HeadlessPaneDefinition,
|
|
3
4
|
HeadlessPaneLoadArgs,
|
|
@@ -35,7 +36,7 @@ const COLUMNS = [
|
|
|
35
36
|
key: "dailyChangeBp",
|
|
36
37
|
header: "1D",
|
|
37
38
|
align: "right" as const,
|
|
38
|
-
format: (value: unknown) => value == null ?
|
|
39
|
+
format: (value: unknown) => value == null ? MISSING_VALUE : `${Number(value) > 0 ? "+" : ""}${Number(value).toFixed(1)}bp`,
|
|
39
40
|
},
|
|
40
41
|
{ key: "date", header: "As of" },
|
|
41
42
|
];
|
|
@@ -18,7 +18,7 @@ import { StatChartDetail } from "../../../components/market-board";
|
|
|
18
18
|
import { useAsyncResource } from "../../../react/async-resource";
|
|
19
19
|
import { colors } from "../../../theme/colors";
|
|
20
20
|
import type { PaneProps } from "../../../types/plugin";
|
|
21
|
-
import { formatPercentileRank } from "../../../utils/format";
|
|
21
|
+
import { MISSING_VALUE, formatPercentileRank } from "../../../utils/format";
|
|
22
22
|
import { usePaneSettingValue } from "../../../state/app/context";
|
|
23
23
|
import { usePluginPaneState } from "../../runtime";
|
|
24
24
|
import type { PluginModule } from "../plugin-module";
|
|
@@ -34,7 +34,7 @@ const EMPTY_ROWS: CreditConditionRow[] = [];
|
|
|
34
34
|
const PANELS = [{ id: "main" }];
|
|
35
35
|
|
|
36
36
|
function formatBp(value: number | null, signed = false): string {
|
|
37
|
-
if (value == null) return
|
|
37
|
+
if (value == null) return MISSING_VALUE;
|
|
38
38
|
const sign = signed && value > 0 ? "+" : "";
|
|
39
39
|
return `${sign}${value.toFixed(1)}bp`;
|
|
40
40
|
}
|
|
@@ -3,7 +3,7 @@ import type { DataTableColumn, StatItem } from "../../../components";
|
|
|
3
3
|
import { scalarPoint, staticSeries } from "../../../components/chart/static/series";
|
|
4
4
|
import { dropColumnsToFit } from "../../../components/ui/table-layout";
|
|
5
5
|
import type { ResolvedSeries } from "../../../time-series/types";
|
|
6
|
-
import { displayWidth } from "../../../utils/format";
|
|
6
|
+
import { MISSING_VALUE, displayWidth } from "../../../utils/format";
|
|
7
7
|
|
|
8
8
|
export const CREDIT_TABS = [{ value: "capital", label: "Capital" }, { value: "covenants", label: "Covenants" }, { value: "maturities", label: "Maturities" }, { value: "screen", label: "Screen" }] as const;
|
|
9
9
|
export type CreditTab = typeof CREDIT_TABS[number]["value"];
|
|
@@ -11,7 +11,7 @@ export const creditTab = (value: unknown): CreditTab => CREDIT_TABS.find((tab) =
|
|
|
11
11
|
/** `maintenance_covenant` and `adjustmentReason` both read as words. */
|
|
12
12
|
export const fieldLabel = (field: string) => field.replace(/_/g, " ").replace(/([a-z])([A-Z])/g, (_, a: string, b: string) => `${a} ${b.toLowerCase()}`).replace(/^./, (value) => value.toUpperCase());
|
|
13
13
|
/** The one placeholder for a value the documents do not support. */
|
|
14
|
-
export const NO_VALUE =
|
|
14
|
+
export const NO_VALUE = MISSING_VALUE;
|
|
15
15
|
export const sentence = (value: string) => value.replace(/^./, (first) => first.toUpperCase());
|
|
16
16
|
export const creditAmount = (value: number | null | undefined): string => value == null ? NO_VALUE : new Intl.NumberFormat("en-US", { notation: "compact", maximumFractionDigits: 2 }).format(value);
|
|
17
17
|
export const creditPercent = (value: number | null | undefined): string => value == null ? NO_VALUE : `${value.toFixed(1)}%`;
|
|
@@ -72,10 +72,15 @@ const validPeg = (peg: CryptoMarketAsset["peg"]) =>
|
|
|
72
72
|
&& (peg.price === null || (isFiniteNumber(peg.price) && peg.price > 0))
|
|
73
73
|
&& nullableInstant(peg.asOf);
|
|
74
74
|
|
|
75
|
+
const venueNames = (value: unknown) => value === undefined
|
|
76
|
+
|| Array.isArray(value) && value.every((name) => typeof name === "string" && name.length > 0 && name.length <= 24);
|
|
77
|
+
|
|
75
78
|
const validRange = (range: CryptoMarketAsset["range24h"]) =>
|
|
76
79
|
!!range
|
|
77
80
|
&& [range.low, range.high].every((value) => isFiniteNumber(value) && value > 0)
|
|
78
|
-
&& [range.lowAt, range.highAt, range.start, range.end].every(instant)
|
|
81
|
+
&& [range.lowAt, range.highAt, range.start, range.end].every(instant)
|
|
82
|
+
&& [range.lowVenues, range.highVenues, range.venuesChecked].every(venueNames)
|
|
83
|
+
&& (range.venuesPending === undefined || typeof range.venuesPending === "boolean");
|
|
79
84
|
|
|
80
85
|
/** A malformed peg or 24h range is dropped from its coin alone; the coin and the rest of the board stay. */
|
|
81
86
|
function withValidStablecoinFields(asset: CryptoMarketAsset): CryptoMarketAsset {
|
|
@@ -14,7 +14,7 @@ import { handleRefreshKey } from "../../../components/data-table/table-pane";
|
|
|
14
14
|
import type { DefiTvlPayload } from "../../../api-client/crypto-markets";
|
|
15
15
|
import { colors, priceColor } from "../../../theme/colors";
|
|
16
16
|
import { SERIES_COLORS } from "../../../theme/series-colors";
|
|
17
|
-
import { formatCompact, formatCompactAmount } from "../../../utils/format";
|
|
17
|
+
import { MISSING_VALUE, formatCompact, formatCompactAmount } from "../../../utils/format";
|
|
18
18
|
import { usePluginPaneState } from "../../runtime";
|
|
19
19
|
import {
|
|
20
20
|
buildDefiColumns,
|
|
@@ -47,7 +47,7 @@ function signedPercent(value: number | null): DataTableCell {
|
|
|
47
47
|
|
|
48
48
|
function signedAmount(value: number | null): DataTableCell {
|
|
49
49
|
return {
|
|
50
|
-
text: value == null ?
|
|
50
|
+
text: value == null ? MISSING_VALUE : formatCompactAmount(value, { signed: true }),
|
|
51
51
|
color: value == null ? colors.textDim : priceColor(value),
|
|
52
52
|
};
|
|
53
53
|
}
|
|
@@ -59,7 +59,7 @@ function renderDefiCell(row: DefiRow, column: DefiColumn): DataTableCell {
|
|
|
59
59
|
case "name":
|
|
60
60
|
return { text: row.name, color: colors.textBright };
|
|
61
61
|
case "detail":
|
|
62
|
-
return { text: row.detail ??
|
|
62
|
+
return { text: row.detail ?? MISSING_VALUE, color: colors.textDim };
|
|
63
63
|
case "tvl":
|
|
64
64
|
return { text: formatTvl(row.tvl) };
|
|
65
65
|
case "change1dPercent":
|
|
@@ -73,9 +73,9 @@ function renderDefiCell(row: DefiRow, column: DefiColumn): DataTableCell {
|
|
|
73
73
|
case "change30dPercent":
|
|
74
74
|
return signedPercent(row.change30dPercent);
|
|
75
75
|
case "share":
|
|
76
|
-
return { text: row.share == null ?
|
|
76
|
+
return { text: row.share == null ? MISSING_VALUE : `${row.share.toFixed(2)}%`, color: colors.textDim };
|
|
77
77
|
case "chains":
|
|
78
|
-
return { text: row.chains == null ?
|
|
78
|
+
return { text: row.chains == null ? MISSING_VALUE : String(row.chains), color: colors.textDim };
|
|
79
79
|
case "fees24h":
|
|
80
80
|
case "fees7d":
|
|
81
81
|
case "fees30d":
|
|
@@ -83,7 +83,7 @@ function renderDefiCell(row: DefiRow, column: DefiColumn): DataTableCell {
|
|
|
83
83
|
case "revenue7d":
|
|
84
84
|
case "revenue30d": {
|
|
85
85
|
const value = row[column.id];
|
|
86
|
-
return value == null ? { text:
|
|
86
|
+
return value == null ? { text: MISSING_VALUE, color: colors.textDim } : { text: formatTvl(value) };
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
}
|
|
@@ -93,7 +93,7 @@ function changeFigure(id: string, label: string, amount: number | null, percent:
|
|
|
93
93
|
return {
|
|
94
94
|
id,
|
|
95
95
|
label,
|
|
96
|
-
value: amount == null ?
|
|
96
|
+
value: amount == null ? MISSING_VALUE : formatCompactAmount(amount, { signed: true }),
|
|
97
97
|
detail: formatCryptoPercent(percent),
|
|
98
98
|
...(amount == null ? {} : { color: priceColor(amount) }),
|
|
99
99
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DefiTvlChain, DefiTvlPayload, DefiTvlProtocol } from "../../../api-client/crypto-markets";
|
|
2
2
|
import type { DataTableColumn } from "../../../components";
|
|
3
3
|
import { getTableWidth } from "../../../components/ui/table-layout";
|
|
4
|
-
import { formatCompact, formatCompactAmount } from "../../../utils/format";
|
|
4
|
+
import { MISSING_VALUE, formatCompact, formatCompactAmount } from "../../../utils/format";
|
|
5
5
|
import { compareSortValues, nextHeaderSort, type SortDirection } from "../../../utils/sort-values";
|
|
6
6
|
import { formatUtcTime } from "../../../utils/utc-time";
|
|
7
7
|
import { formatCryptoPercent, utcCloseAsOfText } from "./model";
|
|
@@ -139,7 +139,7 @@ export function defiHistoryRows(payload: DefiTvlPayload): Array<{ date: string;
|
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
const change = (amount: number | null, percent: number | null) =>
|
|
142
|
-
amount == null ?
|
|
142
|
+
amount == null ? MISSING_VALUE : `${formatCompactAmount(amount, { signed: true })} (${formatCryptoPercent(percent)})`;
|
|
143
143
|
|
|
144
144
|
/**
|
|
145
145
|
* How the total's days are dated: each by the UTC day it closes, which
|
|
@@ -36,6 +36,8 @@ const COIN_COLUMNS: HeadlessPaneColumn[] = [
|
|
|
36
36
|
{ key: "name", header: "Name" },
|
|
37
37
|
// Every coin is priced, traded and valued in US dollars: the text headers say so; an export keeps its headers.
|
|
38
38
|
{ key: "price", header: "Price", textHeader: "Price USD", align: "right", format: (_value, row) => String(row.priceText ?? "—") },
|
|
39
|
+
// Whose the price is: an exchange's own trade, the composite of several, or a composite held back.
|
|
40
|
+
{ key: "priceVenue", header: "Venue", literalHeader: true },
|
|
39
41
|
// Since 00:00 UTC, the day `quote` gives a coin (CRYPTO_CHANGE_BASIS_LABEL): the text says so, as the pane's
|
|
40
42
|
// CHG% UTC does, and an export keeps the header it has always had.
|
|
41
43
|
{ key: "changePercent", header: "Chg %", textHeader: "Chg % UTC", align: "right", format: percent },
|
|
@@ -52,14 +54,17 @@ const COIN_COLUMNS: HeadlessPaneColumn[] = [
|
|
|
52
54
|
* volume leave the table first.
|
|
53
55
|
*/
|
|
54
56
|
const STABLECOIN_COLUMNS: HeadlessPaneColumn[] = [
|
|
55
|
-
...COIN_COLUMNS.slice(0,
|
|
57
|
+
...COIN_COLUMNS.slice(0, 5),
|
|
56
58
|
{ key: "peg", header: "Peg", literalHeader: true, format: text("pegText") },
|
|
57
59
|
{ key: "offPegBp", header: "Off peg", literalHeader: true, align: "right", format: (value) => formatOffPeg(number(value)) },
|
|
58
60
|
{ key: "low24h", header: "24h low", literalHeader: true, align: "right", format: text("low24hText") },
|
|
59
61
|
{ key: "low24hAt", header: "Low UTC", literalHeader: true, shrink: false, format: isoMinute, textFormat: dayTime },
|
|
62
|
+
// The one exchange that alone reached the low or high, or how many did: one exchange's wick is not the market's.
|
|
63
|
+
{ key: "low24hVenue", header: "Low venue", literalHeader: true },
|
|
60
64
|
{ key: "high24h", header: "24h high", literalHeader: true, align: "right", format: text("high24hText") },
|
|
61
65
|
{ key: "high24hAt", header: "High UTC", literalHeader: true, shrink: false, format: isoMinute, textFormat: dayTime },
|
|
62
|
-
|
|
66
|
+
{ key: "high24hVenue", header: "High venue", literalHeader: true },
|
|
67
|
+
...COIN_COLUMNS.slice(5).map((column, index) => column.key === "marketCap"
|
|
63
68
|
? column
|
|
64
69
|
: { ...column, stackPriority: 4 - index, stackRows: 0 }),
|
|
65
70
|
];
|
|
@@ -400,6 +405,7 @@ export const cryptoBoardHeadless: HeadlessPaneDefinition<"rows"> = {
|
|
|
400
405
|
circulatingSupply: row.asset.circulatingSupply,
|
|
401
406
|
maxSupply: row.asset.maxSupply,
|
|
402
407
|
quoteTime: row.asset.quoteTime,
|
|
408
|
+
priceVenue: row.priceVenueText,
|
|
403
409
|
...(kind === "stablecoin" ? {
|
|
404
410
|
peg: row.peg,
|
|
405
411
|
pegText: row.pegText || "—",
|
|
@@ -410,6 +416,8 @@ export const cryptoBoardHeadless: HeadlessPaneDefinition<"rows"> = {
|
|
|
410
416
|
high24h: row.high24h,
|
|
411
417
|
high24hText: row.high24hText,
|
|
412
418
|
high24hAt: row.high24hAt == null ? null : new Date(row.high24hAt).toISOString(),
|
|
419
|
+
low24hVenue: row.low24hVenueText,
|
|
420
|
+
high24hVenue: row.high24hVenueText,
|
|
413
421
|
supply: row.supply,
|
|
414
422
|
supply7d: row.supply7d,
|
|
415
423
|
supply7dPercent: row.supply7dPercent,
|