@gloom-sh/terminal 0.20.20 → 0.20.22
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 +6 -3
- package/patches/electrobun-devkit@2.0.5.patch +169 -3
- package/src/api-client/buybacks.ts +108 -0
- package/src/api-client/data.ts +214 -2
- package/src/api-client/dilution.ts +183 -0
- package/src/api-client/earnings.ts +2 -2
- package/src/api-client/equity-screener.ts +24 -0
- package/src/api-client/exchange-announcements.ts +16 -5
- package/src/api-client/exchange-short-balances.ts +24 -0
- package/src/api-client/futures-curve.ts +5 -0
- package/src/api-client/hk-cbbc.ts +134 -0
- package/src/api-client/hk-ccass.ts +233 -0
- package/src/api-client/index.ts +55 -3
- package/src/api-client/jpx-short-positions.ts +24 -0
- package/src/api-client/market-discovery.ts +42 -6
- package/src/api-client/members.ts +7 -0
- package/src/api-client/ownership-disclosures.ts +35 -0
- package/src/api-client/paths.ts +5 -2
- package/src/api-client/perps.ts +20 -0
- package/src/api-client/request.ts +92 -17
- package/src/api-client/revenue-breakdown.ts +6 -2
- package/src/api-client/sfc-short-positions.ts +19 -0
- package/src/api-client/supply-chain.ts +22 -0
- package/src/api-client/taiwan-revenue.ts +134 -0
- package/src/api-client/types/filings-and-calls.ts +2 -0
- package/src/api-client/types/jobs.ts +1 -0
- package/src/api-client/types/world-venues.ts +1 -0
- package/src/app/language-observer.tsx +6 -1
- package/src/app/pane-runtime/plugin-bindings.ts +15 -8
- package/src/app/pro-welcome/model.ts +15 -11
- package/src/app/pro-welcome/row.tsx +3 -3
- package/src/app/pro-welcome/use-pro-welcome.ts +2 -2
- package/src/app/runtime/plugin-bindings.ts +20 -2
- package/src/app/runtime/startup.ts +3 -2
- package/src/app.tsx +3 -2
- package/src/architecture/core-builtin-allowlist.json +2 -2
- package/src/architecture/dom-text-cuts-allowlist.json +2 -2
- package/src/architecture/floating-promise-allowlist.json +2 -2
- package/src/architecture/pane-tabs-allowlist.json +3 -0
- package/src/brokers/account-cache.ts +2 -1
- package/src/brokers/account-choice.ts +121 -0
- package/src/brokers/broker-portfolio-sync.ts +30 -5
- package/src/brokers/profile-form.ts +3 -0
- package/src/brokers/signed-in/adapter.ts +16 -5
- package/src/brokers/sync-broker-instance.ts +27 -3
- package/src/capabilities/asset-data-inputs.ts +13 -0
- package/src/capabilities/factories.ts +12 -3
- package/src/capabilities/registry.ts +1 -0
- package/src/capabilities/types.ts +1 -0
- package/src/cli/commands/market.ts +199 -103
- package/src/cli/commands/news-search.ts +12 -0
- package/src/cli/commands/options-chain.ts +11 -5
- package/src/cli/commands/options-leaps.ts +55 -30
- package/src/cli/commands/overview.ts +24 -24
- package/src/cli/commands/search.ts +2 -1
- package/src/cli/commands/ticker.ts +30 -16
- package/src/cli/csv-export.ts +9 -5
- package/src/cli/desktop-pane-shot-browser.ts +143 -53
- package/src/cli/desktop-pane-shot.ts +61 -67
- package/src/cli/export-source.ts +40 -2
- package/src/cli/glossary.ts +3 -2
- package/src/cli/helpers.ts +2 -1
- package/src/cli/history-demergers.ts +171 -17
- package/src/cli/history-rows.ts +47 -5
- package/src/cli/known-gaps.ts +21 -7
- package/src/cli/listing-arg.ts +22 -11
- package/src/cli/pane-functions/capabilities.ts +4 -9
- package/src/cli/pane-functions/catalog-snapshot.json +48 -44
- package/src/cli/pane-functions/catalog.ts +7 -20
- package/src/cli/pane-functions/data.ts +8 -4
- package/src/cli/pane-functions/dom.ts +8 -5
- package/src/cli/pane-functions/financial-ratio-shot.ts +20 -5
- package/src/cli/pane-functions/freshness.ts +57 -12
- package/src/cli/pane-functions/function-help.ts +36 -4
- package/src/cli/pane-functions/headless.ts +85 -27
- package/src/cli/pane-functions/index.ts +13 -5
- package/src/cli/pane-functions/market-session.ts +26 -1
- package/src/cli/pane-functions/report-notices.ts +10 -0
- package/src/cli/pane-functions/resolver.ts +79 -4
- package/src/cli/pane-functions/screenshot-assessment.ts +26 -10
- package/src/cli/pane-functions/screenshot-bridge.ts +5 -1
- package/src/cli/pane-functions/screenshot-data-evidence.ts +12 -5
- package/src/cli/pane-functions/screenshot-payload.ts +55 -6
- package/src/cli/pane-functions/screenshot-render.ts +22 -7
- package/src/cli/pane-functions/ticker-question.ts +52 -47
- package/src/cli/perpetual-contract.ts +14 -1
- package/src/cli/rendered-table-rows.ts +75 -0
- package/src/cli/report-tables.ts +18 -3
- package/src/cli/result.ts +14 -2
- package/src/cli/visible-key-values.ts +3 -2
- package/src/components/chart/composite/format.ts +14 -1
- package/src/components/chart/composite/panel-surface/panel-cursor.tsx +37 -14
- package/src/components/chart/composite/panel-surface.tsx +1 -0
- package/src/components/chart/composite/text-renderer.ts +104 -44
- package/src/components/chart/curve/model.ts +4 -1
- package/src/components/chart-table/layout.ts +8 -4
- package/src/components/command-bar/list/model.ts +2 -0
- package/src/components/command-bar/pane-templates/items.ts +5 -25
- package/src/components/command-bar/panel/index.tsx +7 -4
- package/src/components/command-bar/routes/root/provider-search.ts +4 -4
- package/src/components/command-bar/routes/root/results.ts +6 -2
- package/src/components/command-bar/routes/root/start-here.ts +1 -1
- package/src/components/command-bar/routes/ticker-search/results.ts +21 -1
- package/src/components/command-bar/routes/ticker-search/route.ts +3 -3
- package/src/components/command-bar/routes/ticker-search/title.ts +23 -0
- package/src/components/command-bar/routing/list-state.ts +17 -5
- package/src/components/command-bar/selection-runtime.ts +3 -2
- package/src/components/command-bar/surface/index.tsx +2 -0
- package/src/components/command-bar/workflow/alert.ts +6 -4
- package/src/components/command-bar/workflow/collection-actions.ts +2 -1
- package/src/components/data-table/export.ts +3 -1
- package/src/components/data-table/sections.ts +12 -1
- package/src/components/data-table/view.tsx +50 -8
- package/src/components/feed-data-table/stack-view.tsx +3 -0
- package/src/components/index.ts +3 -3
- package/src/components/layout/floating-pane.tsx +5 -2
- package/src/components/layout/pane/footer/index.tsx +1 -0
- package/src/components/layout/pane/footer/model.ts +20 -7
- package/src/components/layout/pane/header.tsx +21 -2
- package/src/components/layout/pane/index.tsx +6 -2
- package/src/components/layout/pane/link-note.ts +12 -0
- package/src/components/layout/pane/title.ts +12 -5
- package/src/components/market-board/index.tsx +8 -11
- package/src/components/price-selector-dialog.tsx +8 -4
- package/src/components/reader/reader-text.tsx +25 -2
- package/src/components/ticker/badge/list.tsx +4 -3
- package/src/components/ticker/list-table-view.tsx +16 -1
- package/src/components/ui/data-table/column-fit.ts +129 -0
- package/src/components/ui/data-table/display-columns.ts +28 -9
- package/src/components/ui/data-table/index.tsx +57 -15
- package/src/components/ui/data-table/opentui/index.tsx +5 -0
- package/src/components/ui/data-table/types.ts +96 -5
- package/src/components/ui/data-table/visible-range.ts +9 -1
- package/src/components/ui/day-cell.ts +30 -0
- package/src/components/ui/index.ts +3 -1
- package/src/components/ui/prose.tsx +3 -1
- package/src/components/ui/query-bar.tsx +20 -14
- package/src/components/ui/table-layout.ts +188 -6
- package/src/core/state/app/layout.ts +7 -2
- package/src/core/state/app/state.ts +6 -2
- package/src/data/cached-query.ts +20 -4
- package/src/data/config/store/legacy-tabs.ts +51 -0
- package/src/data/config/store/node.ts +2 -2
- package/src/data/config/store/normalize.ts +11 -5
- package/src/data/config/store/shared-file.ts +8 -7
- package/src/data/config/store/shared-layout.ts +146 -0
- package/src/data/news-pane-snapshots.ts +2 -1
- package/src/data/plugin-cache.ts +5 -1
- package/src/data/saved-copies.ts +68 -2
- package/src/data/sqlite/access.ts +76 -11
- package/src/data/sqlite/checkpointer.ts +73 -10
- package/src/data/sqlite/database.ts +14 -1
- package/src/data/sqlite/retry.ts +1 -1
- package/src/docs/load.ts +5 -2
- package/src/docs/snapshot.json +1665 -4362
- package/src/docs/topics.ts +11 -9
- package/src/i18n/es.ts +109 -0
- package/src/i18n/index.ts +74 -4
- package/src/i18n/ja.ts +109 -0
- package/src/i18n/ko.ts +109 -0
- package/src/i18n/react.ts +10 -2
- package/src/i18n/zh-cn.ts +109 -0
- package/src/i18n/zh-tw.ts +109 -0
- package/src/layout/pane-manager/dock-normalization.ts +61 -0
- package/src/market-data/ah-pair.ts +7 -2
- package/src/market-data/coordinator/index.ts +25 -5
- package/src/market-data/depositary-pair.ts +27 -10
- package/src/market-data/fund-actions.ts +21 -0
- package/src/market-data/futures-roll-returns.ts +54 -7
- package/src/market-data/fx-closes.ts +14 -0
- package/src/market-data/market/freshness.ts +37 -33
- package/src/market-data/market/futures-product-hours.ts +113 -0
- package/src/market-data/market/futures-week.ts +2 -0
- package/src/market-data/market/globex-day.ts +9 -2
- package/src/market-data/market/split-price-basis.ts +55 -0
- package/src/market-data/market/status.ts +30 -25
- package/src/market-data/market/venue-session.ts +18 -0
- package/src/market-data/options-alternatives.ts +49 -7
- package/src/market-data/perpetual-open-interest.ts +41 -0
- package/src/market-data/price-adjustments.ts +115 -0
- package/src/market-data/quotes/balance-sheet-rate.ts +6 -2
- package/src/market-data/quotes/contributions.ts +4 -2
- package/src/market-data/quotes/day-range.ts +24 -9
- package/src/market-data/quotes/export-identity.ts +11 -3
- package/src/market-data/quotes/freshness.ts +7 -5
- package/src/market-data/quotes/regular-session-valuation.ts +6 -0
- package/src/market-data/quotes/resolution.ts +20 -24
- package/src/market-data/quotes/tick-range.ts +22 -1
- package/src/market-data/quotes/time.ts +161 -7
- package/src/market-data/split-terms.ts +3 -2
- package/src/news/aggregator.ts +1 -0
- package/src/news/news-model.ts +12 -2
- package/src/news/query-presets.ts +6 -4
- package/src/news/types.ts +15 -0
- package/src/plugins/builtin/alerts/alert-engine.ts +2 -0
- package/src/plugins/builtin/alerts/cli-forms.ts +6 -2
- package/src/plugins/builtin/alerts/cli-move.ts +5 -2
- package/src/plugins/builtin/alerts/cli.ts +67 -30
- package/src/plugins/builtin/alerts/command.ts +51 -3
- package/src/plugins/builtin/alerts/event-rows.ts +1 -1
- package/src/plugins/builtin/alerts/events-pane.tsx +2 -1
- package/src/plugins/builtin/alerts/format.ts +87 -16
- package/src/plugins/builtin/alerts/headless.ts +29 -10
- package/src/plugins/builtin/alerts/history-pane.tsx +74 -33
- package/src/plugins/builtin/alerts/history-rows.ts +24 -1
- package/src/plugins/builtin/alerts/index.tsx +34 -35
- package/src/plugins/builtin/alerts/metric-data.ts +24 -6
- package/src/plugins/builtin/alerts/move-checks.ts +1 -0
- package/src/plugins/builtin/alerts/pane.tsx +24 -6
- package/src/plugins/builtin/alerts/pro-rules.ts +10 -4
- package/src/plugins/builtin/alerts/quotes.ts +10 -5
- package/src/plugins/builtin/alerts/research-builder.ts +6 -2
- package/src/plugins/builtin/alerts/research-rules.ts +12 -0
- package/src/plugins/builtin/alerts/session.ts +28 -0
- package/src/plugins/builtin/alerts/types.ts +2 -0
- package/src/plugins/builtin/analytics/pane-model.ts +2 -1
- package/src/plugins/builtin/analytics/risk-model.ts +2 -2
- package/src/plugins/builtin/attention/headless.ts +2 -2
- package/src/plugins/builtin/attention/model.ts +7 -2
- package/src/plugins/builtin/attention/pane.tsx +2 -1
- package/src/plugins/builtin/awards/detail.tsx +5 -4
- package/src/plugins/builtin/awards/headless.ts +14 -5
- package/src/plugins/builtin/awards/model.ts +36 -1
- package/src/plugins/builtin/awards/pane.tsx +29 -9
- package/src/plugins/builtin/backtest/pane.tsx +4 -2
- package/src/plugins/builtin/bond-calculator/pane.tsx +2 -1
- package/src/plugins/builtin/broker-manager/detail.tsx +67 -4
- package/src/plugins/builtin/broker-manager/index.tsx +35 -4
- package/src/plugins/builtin/broker-manager/keyboard.ts +10 -0
- package/src/plugins/builtin/broker-manager/pane-actions.tsx +35 -2
- package/src/plugins/builtin/broker-trading/orders.tsx +10 -3
- package/src/plugins/builtin/broker-trading/ticket.tsx +14 -5
- package/src/plugins/builtin/buildout/detail/company.tsx +0 -1
- package/src/plugins/builtin/buildout/detail/ui.tsx +7 -5
- package/src/plugins/builtin/buildout/format.ts +3 -1
- package/src/plugins/builtin/buildout/model/normalizers.ts +0 -1
- package/src/plugins/builtin/buildout/model/types.ts +0 -1
- package/src/plugins/builtin/buildout/pane/index.tsx +9 -0
- package/src/plugins/builtin/buildout/pane/status.tsx +11 -0
- package/src/plugins/builtin/buybacks/client.ts +48 -0
- package/src/plugins/builtin/buybacks/index.tsx +22 -0
- package/src/plugins/builtin/buybacks/model.ts +151 -0
- package/src/plugins/builtin/buybacks/pane.tsx +140 -0
- package/src/plugins/builtin/buybacks/series.ts +36 -0
- package/src/plugins/builtin/catalysts/detail.tsx +14 -8
- package/src/plugins/builtin/catalysts/evidence.ts +11 -3
- package/src/plugins/builtin/catalysts/headless.ts +52 -9
- package/src/plugins/builtin/catalysts/kinds.ts +413 -0
- package/src/plugins/builtin/catalysts/model.ts +61 -18
- package/src/plugins/builtin/catalysts/pane.tsx +85 -19
- package/src/plugins/builtin/cds/client.ts +9 -2
- package/src/plugins/builtin/cds/headless.ts +25 -10
- package/src/plugins/builtin/cds/model.ts +37 -12
- package/src/plugins/builtin/cds/pane.tsx +18 -10
- package/src/plugins/builtin/chart-composer/chart-spec-edit.ts +68 -7
- package/src/plugins/builtin/chart-composer/chart-title.ts +114 -0
- package/src/plugins/builtin/chart-composer/cli-options.ts +1 -1
- package/src/plugins/builtin/chart-composer/headless.ts +27 -7
- package/src/plugins/builtin/chart-composer/index.tsx +2 -68
- package/src/plugins/builtin/chart-composer/leverage-overlay.ts +2 -4
- package/src/plugins/builtin/chart-composer/pane.tsx +13 -4
- package/src/plugins/builtin/chart-composer/presets.ts +1 -1
- package/src/plugins/builtin/chart-composer/session-history.ts +14 -2
- package/src/plugins/builtin/chat/controller/draft-sync.ts +13 -7
- package/src/plugins/builtin/chat/controller/index.ts +5 -3
- package/src/plugins/builtin/chat/controller/session-runtime.ts +18 -8
- package/src/plugins/builtin/chat/controller/state.ts +4 -0
- package/src/plugins/builtin/chat/index.tsx +1 -1
- package/src/plugins/builtin/chat/pane-requests.ts +8 -4
- package/src/plugins/builtin/clinical-trials/model.ts +2 -2
- package/src/plugins/builtin/clinical-trials/pane.tsx +3 -3
- package/src/plugins/builtin/cloud/askg/pane.tsx +60 -50
- package/src/plugins/builtin/cloud/auth-actions.tsx +6 -3
- package/src/plugins/builtin/cloud/mcp-connect/dialog.tsx +4 -1
- package/src/plugins/builtin/cloud/thesis/ticker-tab.tsx +2 -1
- package/src/plugins/builtin/comment-letters/pane.tsx +4 -2
- package/src/plugins/builtin/commodity-balances/headless.ts +2 -1
- package/src/plugins/builtin/company-attention/building-model.ts +3 -4
- package/src/plugins/builtin/company-attention/building.tsx +2 -0
- package/src/plugins/builtin/company-attention/headless.ts +4 -3
- package/src/plugins/builtin/company-attention/model.ts +2 -0
- package/src/plugins/builtin/company-attention/moves-model.ts +2 -1
- package/src/plugins/builtin/company-attention/moves.tsx +2 -0
- package/src/plugins/builtin/company-attention/pane.tsx +17 -3
- package/src/plugins/builtin/company-attention/signals-model.ts +3 -4
- package/src/plugins/builtin/company-attention/signals.tsx +5 -0
- package/src/plugins/builtin/company-kpis/headless.ts +27 -11
- package/src/plugins/builtin/company-kpis/model.ts +47 -7
- package/src/plugins/builtin/company-kpis/pane.tsx +36 -19
- package/src/plugins/builtin/company-kpis/taiwan-monthly-model.ts +99 -0
- package/src/plugins/builtin/company-kpis/taiwan-monthly-view.tsx +327 -0
- package/src/plugins/builtin/composite/ownership-browser.ts +28 -0
- package/src/plugins/builtin/composite/ownership.ts +5 -1
- package/src/plugins/builtin/congress-trades/detail.tsx +44 -8
- package/src/plugins/builtin/congress-trades/headless.ts +15 -11
- package/src/plugins/builtin/congress-trades/model.ts +104 -11
- package/src/plugins/builtin/congress-trades/pane.tsx +11 -6
- package/src/plugins/builtin/congress-trades/table.tsx +17 -10
- package/src/plugins/builtin/congress-trades/use-feed.ts +13 -2
- package/src/plugins/builtin/correlation/headless.ts +5 -5
- package/src/plugins/builtin/correlation/history.ts +1 -0
- package/src/plugins/builtin/correlation/index.tsx +7 -5
- package/src/plugins/builtin/correlation/matrix/selection.ts +21 -3
- package/src/plugins/builtin/correlation/relationship/model.ts +5 -0
- package/src/plugins/builtin/correlation/relationship/pane.tsx +14 -10
- package/src/plugins/builtin/correlation/relationship/view-model.ts +4 -21
- package/src/plugins/builtin/cot/headless.ts +1 -1
- package/src/plugins/builtin/cot/pane.tsx +7 -2
- package/src/plugins/builtin/cpi/headless.ts +2 -1
- package/src/plugins/builtin/credit-conditions/headless.ts +2 -1
- package/src/plugins/builtin/credit-documents/detail.tsx +2 -1
- package/src/plugins/builtin/credit-documents/export.ts +18 -12
- package/src/plugins/builtin/credit-documents/headless.ts +1 -1
- package/src/plugins/builtin/credit-documents/model.ts +106 -25
- package/src/plugins/builtin/credit-documents/pane.tsx +9 -5
- package/src/plugins/builtin/crypto-board/defi-view.tsx +2 -1
- package/src/plugins/builtin/crypto-board/defi.ts +5 -4
- package/src/plugins/builtin/crypto-board/headless.ts +7 -2
- package/src/plugins/builtin/crypto-board/model.ts +6 -4
- package/src/plugins/builtin/crypto-board/pane.tsx +2 -1
- package/src/plugins/builtin/crypto-board/supply.ts +4 -3
- package/src/plugins/builtin/crypto-etf-flows/headless.ts +15 -8
- package/src/plugins/builtin/crypto-etf-flows/pane.tsx +6 -5
- package/src/plugins/builtin/debt-maturities/headless.ts +56 -38
- package/src/plugins/builtin/debt-maturities/model.ts +2 -1
- package/src/plugins/builtin/debt-maturities/pane.tsx +24 -22
- package/src/plugins/builtin/dilution/index.tsx +74 -0
- package/src/plugins/builtin/dilution/model.ts +159 -0
- package/src/plugins/builtin/dilution/pane.tsx +592 -0
- package/src/plugins/builtin/dividend-yield/client.ts +81 -10
- package/src/plugins/builtin/dividend-yield/headless.ts +44 -24
- package/src/plugins/builtin/dividend-yield/index.tsx +2 -1
- package/src/plugins/builtin/dividend-yield/model.ts +9 -6
- package/src/plugins/builtin/dividend-yield/pane.tsx +28 -15
- package/src/plugins/builtin/dividend-yield/ranking-view.tsx +6 -2
- package/src/plugins/builtin/dividend-yield/ranking.ts +22 -8
- package/src/plugins/builtin/dividend-yield/reference-price.ts +3 -0
- package/src/plugins/builtin/dividend-yield/types.ts +12 -0
- package/src/plugins/builtin/dividend-yield/view.ts +61 -12
- package/src/plugins/builtin/docs/index.tsx +1 -1
- package/src/plugins/builtin/docs/pane.tsx +7 -3
- package/src/plugins/builtin/docs/use-docs.ts +2 -1
- package/src/plugins/builtin/doe/headless.ts +1 -1
- package/src/plugins/builtin/doe/pane.tsx +16 -7
- package/src/plugins/builtin/earnings/board-model.ts +19 -6
- package/src/plugins/builtin/earnings/board-table.ts +64 -48
- package/src/plugins/builtin/earnings/board.tsx +93 -51
- package/src/plugins/builtin/earnings/headless.ts +71 -12
- package/src/plugins/builtin/earnings/history-model.ts +28 -15
- package/src/plugins/builtin/earnings/history.tsx +1 -1
- package/src/plugins/builtin/earnings-calls/calendar.tsx +23 -10
- package/src/plugins/builtin/earnings-calls/data.ts +8 -5
- package/src/plugins/builtin/earnings-calls/format.ts +34 -0
- package/src/plugins/builtin/earnings-calls/headless.ts +5 -4
- package/src/plugins/builtin/earnings-calls/pane.tsx +22 -17
- package/src/plugins/builtin/earnings-calls/transcript-view.tsx +14 -12
- package/src/plugins/builtin/earnings-ripple/headless.ts +1 -1
- package/src/plugins/builtin/earnings-ripple/pane.tsx +4 -3
- package/src/plugins/builtin/econ/calendar-model.ts +73 -4
- package/src/plugins/builtin/econ/index.tsx +32 -36
- package/src/plugins/builtin/econ-statistics/detail.tsx +2 -2
- package/src/plugins/builtin/econ-statistics/headless.ts +10 -5
- package/src/plugins/builtin/econ-statistics/pane.tsx +6 -3
- package/src/plugins/builtin/econ-statistics/view.ts +15 -4
- package/src/plugins/builtin/equity-screener/client.ts +1 -1
- package/src/plugins/builtin/equity-screener/headless.ts +149 -31
- package/src/plugins/builtin/equity-screener/live.ts +23 -5
- package/src/plugins/builtin/equity-screener/model.ts +38 -14
- package/src/plugins/builtin/equity-screener/pane.tsx +5 -5
- package/src/plugins/builtin/estimate-revisions/headless.ts +23 -2
- package/src/plugins/builtin/estimate-revisions/model.ts +63 -13
- package/src/plugins/builtin/estimate-revisions/pane.tsx +228 -225
- package/src/plugins/builtin/estimate-revisions/sorting.ts +8 -16
- package/src/plugins/builtin/exposure/drivers.ts +5 -2
- package/src/plugins/builtin/exposure/headless.ts +7 -4
- package/src/plugins/builtin/exposure/holdings.ts +2 -2
- package/src/plugins/builtin/exposure/model.ts +2 -1
- package/src/plugins/builtin/exposure/pane.tsx +16 -7
- package/src/plugins/builtin/fear-greed/format.ts +7 -7
- package/src/plugins/builtin/fear-greed/pane.tsx +21 -7
- package/src/plugins/builtin/futures/index.tsx +29 -1
- package/src/plugins/builtin/futures/model.ts +93 -10
- package/src/plugins/builtin/futures/returns.ts +54 -1
- package/src/plugins/builtin/futures/table.tsx +14 -2
- package/src/plugins/builtin/futures/use-front-returns.ts +20 -3
- package/src/plugins/builtin/futures-curve/client.ts +1 -1
- package/src/plugins/builtin/futures-curve/headless.ts +21 -10
- package/src/plugins/builtin/futures-curve/model.ts +31 -9
- package/src/plugins/builtin/futures-curve/pane.tsx +26 -17
- package/src/plugins/builtin/fx-matrix/headless.ts +3 -2
- package/src/plugins/builtin/gpu/headless.ts +11 -5
- package/src/plugins/builtin/gpu/model.ts +1 -1
- package/src/plugins/builtin/help/function-index.ts +16 -8
- package/src/plugins/builtin/help/functions-table.tsx +6 -4
- package/src/plugins/builtin/help/shortcut-model.ts +7 -2
- package/src/plugins/builtin/holders/beneficial-model.ts +1 -1
- package/src/plugins/builtin/holders/beneficial-view.tsx +3 -2
- package/src/plugins/builtin/holders/ccass-market-pane.tsx +363 -0
- package/src/plugins/builtin/holders/ccass-view.tsx +323 -0
- package/src/plugins/builtin/holders/disclosures-view.tsx +63 -0
- package/src/plugins/builtin/holders/disclosures.ts +33 -0
- package/src/plugins/builtin/holders/headless.ts +25 -7
- package/src/plugins/builtin/holders/index.tsx +75 -1
- package/src/plugins/builtin/holders/pane.tsx +79 -14
- package/src/plugins/builtin/holders/report-rows.ts +2 -0
- package/src/plugins/builtin/holders/table-model.ts +14 -6
- package/src/plugins/builtin/holders/types.ts +2 -2
- package/src/plugins/builtin/insider/activity-chart.ts +141 -0
- package/src/plugins/builtin/insider/client.ts +118 -11
- package/src/plugins/builtin/insider/filing-stories.ts +36 -20
- package/src/plugins/builtin/insider/headless.ts +2 -1
- package/src/plugins/builtin/insider/index.tsx +74 -12
- package/src/plugins/builtin/insider/issuer.ts +5 -2
- package/src/plugins/builtin/insider/signals-cells.tsx +15 -8
- package/src/plugins/builtin/insider/signals.tsx +6 -5
- package/src/plugins/builtin/insider/table-model.ts +17 -17
- package/src/plugins/builtin/insider/table.tsx +18 -10
- package/src/plugins/builtin/ipo-calendar/headless.ts +55 -11
- package/src/plugins/builtin/ipo-calendar/listing-ipo.ts +31 -4
- package/src/plugins/builtin/ipo-calendar/model.ts +208 -47
- package/src/plugins/builtin/ipo-calendar/pane.tsx +87 -25
- package/src/plugins/builtin/iv-history/client.ts +17 -8
- package/src/plugins/builtin/iv-history/format.ts +23 -12
- package/src/plugins/builtin/iv-history/headless.ts +11 -5
- package/src/plugins/builtin/iv-history/model.ts +15 -13
- package/src/plugins/builtin/iv-history/pane.tsx +5 -2
- package/src/plugins/builtin/iv-history/screen-pane.tsx +46 -24
- package/src/plugins/builtin/jobs/headless.ts +4 -3
- package/src/plugins/builtin/jobs/pane.tsx +6 -5
- package/src/plugins/builtin/jodi/headless.ts +15 -2
- package/src/plugins/builtin/jodi/model.ts +46 -5
- package/src/plugins/builtin/jodi/pane.tsx +17 -13
- package/src/plugins/builtin/kelly-sizer/headless.ts +3 -1
- package/src/plugins/builtin/kelly-sizer/sections.tsx +2 -1
- package/src/plugins/builtin/macro-day/client.ts +2 -3
- package/src/plugins/builtin/macro-day/comparison.ts +58 -0
- package/src/plugins/builtin/macro-day/headless.ts +47 -3
- package/src/plugins/builtin/macro-day/index.tsx +32 -9
- package/src/plugins/builtin/macro-day/model.ts +1 -1
- package/src/plugins/builtin/macro-day/pane.tsx +109 -15
- package/src/plugins/builtin/market-halts/model.ts +10 -8
- package/src/plugins/builtin/market-halts/pane.tsx +1 -1
- package/src/plugins/builtin/market-heatmap/data.ts +17 -2
- package/src/plugins/builtin/market-heatmap/headless.ts +56 -6
- package/src/plugins/builtin/market-heatmap/index.tsx +57 -3
- package/src/plugins/builtin/market-heatmap/model.ts +27 -1
- package/src/plugins/builtin/market-movers/footer.ts +29 -3
- package/src/plugins/builtin/market-movers/headless.ts +12 -5
- package/src/plugins/builtin/market-movers/index.tsx +3 -3
- package/src/plugins/builtin/market-movers/model.ts +7 -1
- package/src/plugins/builtin/market-movers/session-body.tsx +6 -3
- package/src/plugins/builtin/market-movers/session-table.ts +1 -0
- package/src/plugins/builtin/market-movers/session.ts +1 -1
- package/src/plugins/builtin/market-movers/table.ts +1 -1
- package/src/plugins/builtin/market-valuation/detail.tsx +3 -3
- package/src/plugins/builtin/market-valuation/headless.ts +6 -6
- package/src/plugins/builtin/market-valuation/pane.tsx +2 -3
- package/src/plugins/builtin/market-valuation/view.ts +6 -8
- package/src/plugins/builtin/members/client.ts +9 -2
- package/src/plugins/builtin/members/headless.ts +20 -14
- package/src/plugins/builtin/members/model.ts +64 -18
- package/src/plugins/builtin/members/pane.tsx +21 -15
- package/src/plugins/builtin/mna/distress/detail.tsx +7 -6
- package/src/plugins/builtin/mna/distress/model.ts +7 -7
- package/src/plugins/builtin/mna/distress/pane.tsx +8 -7
- package/src/plugins/builtin/mna/headless.ts +40 -7
- package/src/plugins/builtin/mna/model.ts +66 -6
- package/src/plugins/builtin/mna/pane.tsx +118 -60
- package/src/plugins/builtin/money-markets/headless.ts +1 -1
- package/src/plugins/builtin/news/headless.ts +4 -0
- package/src/plugins/builtin/news/index.tsx +3 -1
- package/src/plugins/builtin/news/wire/industry-pane.tsx +3 -1
- package/src/plugins/builtin/news/wire/news/preset-pane.tsx +1 -1
- package/src/plugins/builtin/news/wire/news/table.tsx +15 -4
- package/src/plugins/builtin/news/wire/persisted-articles.ts +8 -4
- package/src/plugins/builtin/notes/headless.ts +7 -0
- package/src/plugins/builtin/notes/index.tsx +3 -2
- package/src/plugins/builtin/notes/quick-notes-pane.tsx +18 -2
- package/src/plugins/builtin/openfda/model.ts +1 -1
- package/src/plugins/builtin/openfda/pane.tsx +37 -9
- package/src/plugins/builtin/options/analytics.ts +30 -6
- package/src/plugins/builtin/options/calc-seed.ts +38 -3
- package/src/plugins/builtin/options/footer.ts +18 -1
- package/src/plugins/builtin/options/live-quotes.ts +21 -6
- package/src/plugins/builtin/options/open-interest-as-of.ts +5 -0
- package/src/plugins/builtin/options/quote-context.tsx +21 -8
- package/src/plugins/builtin/options/table.ts +17 -2
- package/src/plugins/builtin/options/view.tsx +104 -52
- package/src/plugins/builtin/options-calculator/model.ts +65 -3
- package/src/plugins/builtin/options-calculator/pane.tsx +11 -3
- package/src/plugins/builtin/options-calculator/valuation.ts +33 -0
- package/src/plugins/builtin/options-positioning/cbbc-model.ts +160 -0
- package/src/plugins/builtin/options-positioning/cbbc-view.tsx +453 -0
- package/src/plugins/builtin/options-positioning/headless.ts +4 -4
- package/src/plugins/builtin/options-positioning/index.tsx +22 -1
- package/src/plugins/builtin/options-positioning/pane.tsx +23 -4
- package/src/plugins/builtin/options-scenario/charts.tsx +2 -1
- package/src/plugins/builtin/options-scenario/client.ts +20 -4
- package/src/plugins/builtin/options-scenario/csp-screen-headless.ts +5 -5
- package/src/plugins/builtin/options-scenario/csp-screen-pane.tsx +11 -14
- package/src/plugins/builtin/options-scenario/csp-screen.ts +9 -1
- package/src/plugins/builtin/options-scenario/headless.ts +4 -4
- package/src/plugins/builtin/options-scenario/index.tsx +1 -1
- package/src/plugins/builtin/options-scenario/model.ts +7 -0
- package/src/plugins/builtin/options-scenario/pane.tsx +24 -14
- package/src/plugins/builtin/pe-band/client.ts +5 -9
- package/src/plugins/builtin/pe-band/headless.ts +11 -13
- package/src/plugins/builtin/pe-band/model.ts +39 -60
- package/src/plugins/builtin/pe-band/pane.tsx +16 -16
- package/src/plugins/builtin/perps/cascade-tabs.tsx +2 -1
- package/src/plugins/builtin/perps/cascade.ts +4 -3
- package/src/plugins/builtin/perps/equity-row.tsx +3 -1
- package/src/plugins/builtin/perps/freshness.ts +16 -9
- package/src/plugins/builtin/perps/headless.ts +21 -11
- package/src/plugins/builtin/perps/markets-section.tsx +16 -10
- package/src/plugins/builtin/perps/model.ts +37 -5
- package/src/plugins/builtin/perps/pane.tsx +3 -2
- package/src/plugins/builtin/perps/status-line.ts +12 -3
- package/src/plugins/builtin/perps/venue-markets.ts +38 -0
- package/src/plugins/builtin/plugin-marketplace/pane.tsx +4 -3
- package/src/plugins/builtin/portfolio-list/cached-account.ts +3 -1
- package/src/plugins/builtin/portfolio-list/cell-version.ts +1 -1
- package/src/plugins/builtin/portfolio-list/cli/render.ts +46 -7
- package/src/plugins/builtin/portfolio-list/headless.ts +31 -8
- package/src/plugins/builtin/portfolio-list/settings.ts +4 -0
- package/src/plugins/builtin/portfolio-list/table.tsx +26 -3
- package/src/plugins/builtin/power/client.ts +2 -2
- package/src/plugins/builtin/power/detail.tsx +11 -8
- package/src/plugins/builtin/power/gas-model.ts +2 -1
- package/src/plugins/builtin/power/gas.tsx +3 -2
- package/src/plugins/builtin/power/headless.ts +5 -2
- package/src/plugins/builtin/power/model.ts +19 -0
- package/src/plugins/builtin/power/pane.tsx +5 -4
- package/src/plugins/builtin/power/prices-headless.ts +4 -3
- package/src/plugins/builtin/power/prices.tsx +7 -6
- package/src/plugins/builtin/primary-dealers/headless.ts +1 -1
- package/src/plugins/builtin/primary-dealers/model.ts +2 -1
- package/src/plugins/builtin/rate-path/headless.ts +5 -2
- package/src/plugins/builtin/rate-path/pane.tsx +13 -10
- package/src/plugins/builtin/realized-vol/fx-proxy.ts +7 -8
- package/src/plugins/builtin/realized-vol/headless.ts +4 -5
- package/src/plugins/builtin/realized-vol/pane.tsx +5 -4
- package/src/plugins/builtin/relative-rotation/headless.ts +2 -1
- package/src/plugins/builtin/research/analyst-model.ts +1 -1
- package/src/plugins/builtin/research/analyst-pane.tsx +2 -1
- package/src/plugins/builtin/research/earnings-estimates-pane.tsx +262 -0
- package/src/plugins/builtin/research/event-charts.ts +322 -0
- package/src/plugins/builtin/research/event-data.ts +138 -0
- package/src/plugins/builtin/research/event-detail.tsx +442 -0
- package/src/plugins/builtin/research/event-model.ts +328 -31
- package/src/plugins/builtin/research/event-sources.ts +58 -8
- package/src/plugins/builtin/research/event-views.tsx +397 -0
- package/src/plugins/builtin/research/events-headless.ts +60 -4
- package/src/plugins/builtin/research/headless-schema.ts +2 -2
- package/src/plugins/builtin/research/headless.ts +84 -7
- package/src/plugins/builtin/research/index.tsx +19 -17
- package/src/plugins/builtin/research/relative-valuation-columns.ts +20 -8
- package/src/plugins/builtin/research/relative-valuation-headless.ts +8 -4
- package/src/plugins/builtin/research/relative-valuation-model.ts +23 -8
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +10 -0
- package/src/plugins/builtin/revenue-breakdown/client.ts +9 -4
- package/src/plugins/builtin/revenue-breakdown/headless.ts +1 -1
- package/src/plugins/builtin/revenue-breakdown/index.tsx +2 -1
- package/src/plugins/builtin/revenue-breakdown/model.ts +2 -0
- package/src/plugins/builtin/revenue-breakdown/pane.tsx +10 -0
- package/src/plugins/builtin/risk-factors/pane.tsx +14 -9
- package/src/plugins/builtin/scanner/feed.ts +7 -4
- package/src/plugins/builtin/scanner/flow-pane.tsx +8 -4
- package/src/plugins/builtin/scanner/headless.ts +59 -26
- package/src/plugins/builtin/scanner/hilo-pane.tsx +6 -3
- package/src/plugins/builtin/scanner/lock-note.ts +7 -10
- package/src/plugins/builtin/scanner/us-session.ts +9 -0
- package/src/plugins/builtin/seasonality/client.ts +46 -10
- package/src/plugins/builtin/seasonality/headless.ts +29 -11
- package/src/plugins/builtin/seasonality/model.ts +101 -24
- package/src/plugins/builtin/seasonality/pane.tsx +10 -6
- package/src/plugins/builtin/sec/exchange-filings.ts +44 -0
- package/src/plugins/builtin/sec/filing-content.ts +13 -0
- package/src/plugins/builtin/sec/fund-facts.ts +10 -8
- package/src/plugins/builtin/sec/headless.ts +60 -8
- package/src/plugins/builtin/sec/index.tsx +144 -71
- package/src/plugins/builtin/sec/model.ts +10 -4
- package/src/plugins/builtin/sec/row-summaries.ts +1 -0
- package/src/plugins/builtin/sectors/client.ts +27 -5
- package/src/plugins/builtin/sectors/headless.ts +2 -1
- package/src/plugins/builtin/sectors/index.tsx +22 -10
- package/src/plugins/builtin/series-inventory.ts +4 -0
- package/src/plugins/builtin/shared/beat-miss-chart.ts +66 -0
- package/src/plugins/builtin/shared/cloud-resource.ts +3 -3
- package/src/plugins/builtin/shared/day-entries.ts +41 -0
- package/src/plugins/builtin/shared/earnings-calendar.ts +80 -53
- package/src/plugins/builtin/shared/earnings-report.ts +53 -15
- package/src/plugins/builtin/shared/extended-print.ts +38 -0
- package/src/plugins/builtin/shared/history-span.ts +2 -1
- package/src/plugins/builtin/shared/locked-rows.tsx +1 -1
- package/src/plugins/builtin/shared/pro-feature-wall.tsx +1 -1
- package/src/plugins/builtin/shared/pro-lock-note.ts +8 -12
- package/src/plugins/builtin/shared/report-freshness.ts +7 -3
- package/src/plugins/builtin/shared/scanner-capture.ts +16 -3
- package/src/plugins/builtin/shared/ticker-company.ts +17 -8
- package/src/plugins/builtin/shared/ticker-request.ts +4 -2
- package/src/plugins/builtin/shared/use-quote-board.ts +11 -4
- package/src/plugins/builtin/shared/volatility/live-session.ts +6 -7
- package/src/plugins/builtin/shared/volatility/option-snapshot.ts +30 -0
- package/src/plugins/builtin/shared/volatility/quote-session.ts +49 -0
- package/src/plugins/builtin/short-interest/exchange-balances.ts +76 -0
- package/src/plugins/builtin/short-interest/exchange-positions-pane.tsx +55 -0
- package/src/plugins/builtin/short-interest/headless.ts +15 -2
- package/src/plugins/builtin/short-interest/index.tsx +7 -3
- package/src/plugins/builtin/short-interest/jpx.ts +38 -0
- package/src/plugins/builtin/short-interest/model.ts +3 -2
- package/src/plugins/builtin/short-interest/pane.tsx +4 -3
- package/src/plugins/builtin/short-interest/publications-model.ts +73 -2
- package/src/plugins/builtin/short-interest/publications-pane.tsx +16 -4
- package/src/plugins/builtin/short-interest/sfc.ts +40 -0
- package/src/plugins/builtin/short-interest/surface.tsx +16 -2
- package/src/plugins/builtin/short-volume/headless.ts +18 -3
- package/src/plugins/builtin/short-volume/model.ts +6 -1
- package/src/plugins/builtin/short-volume/pane.tsx +8 -7
- package/src/plugins/builtin/short-volume/sgx.ts +23 -0
- package/src/plugins/builtin/social-mentions/client.ts +7 -3
- package/src/plugins/builtin/social-mentions/outliers-model.ts +2 -1
- package/src/plugins/builtin/social-mentions/outliers.tsx +9 -2
- package/src/plugins/builtin/social-mentions/pane.tsx +10 -8
- package/src/plugins/builtin/supply-chain/client.ts +10 -2
- package/src/plugins/builtin/supply-chain/directories.ts +18 -0
- package/src/plugins/builtin/supply-chain/evidence.ts +12 -4
- package/src/plugins/builtin/supply-chain/headless.ts +20 -7
- package/src/plugins/builtin/supply-chain/pane.tsx +40 -11
- package/src/plugins/builtin/thirteenf/api.ts +323 -34
- package/src/plugins/builtin/thirteenf/data.ts +147 -40
- package/src/plugins/builtin/thirteenf/format.ts +4 -6
- package/src/plugins/builtin/thirteenf/headless.ts +75 -32
- package/src/plugins/builtin/thirteenf/model.ts +24 -11
- package/src/plugins/builtin/thirteenf/overlap-pane.tsx +16 -8
- package/src/plugins/builtin/thirteenf/pane.tsx +45 -22
- package/src/plugins/builtin/thirteenf/report-notes.ts +52 -2
- package/src/plugins/builtin/thirteenf/session-scope.ts +57 -0
- package/src/plugins/builtin/thirteenf/signals-pane.tsx +27 -7
- package/src/plugins/builtin/thirteenf/signals.ts +22 -1
- package/src/plugins/builtin/thirteenf/split-history.ts +119 -0
- package/src/plugins/builtin/thirteenf/table.ts +6 -6
- package/src/plugins/builtin/thirteenf/types.ts +17 -1
- package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +4 -2
- package/src/plugins/builtin/ticker-detail/adr-pair/tab.tsx +11 -0
- package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +12 -8
- package/src/plugins/builtin/ticker-detail/data-panes/history-bars.ts +5 -4
- package/src/plugins/builtin/ticker-detail/data-panes/returns-model.ts +7 -0
- package/src/plugins/builtin/ticker-detail/data-panes/returns-pane.tsx +12 -5
- package/src/plugins/builtin/ticker-detail/financials/aggregation.ts +36 -5
- package/src/plugins/builtin/ticker-detail/financials/model.ts +179 -39
- package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +77 -14
- package/src/plugins/builtin/ticker-detail/financials/ratios.ts +69 -14
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +81 -37
- package/src/plugins/builtin/ticker-detail/headless.ts +65 -38
- package/src/plugins/builtin/ticker-detail/index.tsx +1 -1
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +80 -14
- package/src/plugins/builtin/ticker-detail/overview/model.ts +54 -25
- package/src/plugins/builtin/ticker-detail/overview/pane.tsx +28 -9
- package/src/plugins/builtin/ticker-detail/overview/types.ts +2 -0
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +52 -23
- package/src/plugins/builtin/ticker-detail/pane.tsx +19 -10
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +41 -23
- package/src/plugins/builtin/ticker-detail/quote-monitor/rows.ts +30 -13
- package/src/plugins/builtin/ticker-detail/research-groups.ts +15 -2
- package/src/plugins/builtin/ticker-detail/research-tabs.ts +2 -1
- package/src/plugins/builtin/ticker-detail/settings.ts +9 -2
- package/src/plugins/builtin/time-sales/headless.ts +52 -16
- package/src/plugins/builtin/time-sales/model.ts +2 -2
- package/src/plugins/builtin/time-sales/window.ts +84 -10
- package/src/plugins/builtin/trace-bonds/pane.tsx +3 -2
- package/src/plugins/builtin/treasury-auctions/cache.ts +44 -19
- package/src/plugins/builtin/treasury-auctions/client.ts +9 -4
- package/src/plugins/builtin/vol-surface/charts.tsx +7 -3
- package/src/plugins/builtin/vol-surface/events.ts +20 -10
- package/src/plugins/builtin/vol-surface/evidence.ts +2 -2
- package/src/plugins/builtin/vol-surface/headless.ts +47 -29
- package/src/plugins/builtin/vol-surface/heat-grid.tsx +2 -1
- package/src/plugins/builtin/vol-surface/model.ts +34 -9
- package/src/plugins/builtin/vol-surface/pane.tsx +50 -74
- package/src/plugins/builtin/vol-surface/quote-coverage.ts +68 -0
- package/src/plugins/builtin/vol-surface/tables.ts +57 -6
- package/src/plugins/builtin/volatility/charts.tsx +7 -3
- package/src/plugins/builtin/volatility/headless.ts +5 -5
- package/src/plugins/builtin/volatility/pane.tsx +8 -5
- package/src/plugins/builtin/world-indices/footer.ts +1 -1
- package/src/plugins/builtin/world-indices/headless.ts +5 -3
- package/src/plugins/builtin/world-venue-map/chokepoint-report.ts +3 -1
- package/src/plugins/builtin/world-venue-map/headless.ts +42 -14
- package/src/plugins/builtin/world-venue-map/layered-pane.tsx +5 -3
- package/src/plugins/builtin/world-venue-map/pane.tsx +4 -3
- package/src/plugins/builtin/world-venue-map/venue-exceptions.ts +72 -0
- package/src/plugins/builtin/world-venue-map/venue-header.tsx +20 -11
- package/src/plugins/builtin/yield-curve/client.ts +3 -1
- package/src/plugins/builtin/yield-curve/headless.ts +4 -2
- package/src/plugins/builtin/yield-curve/index.tsx +4 -3
- package/src/plugins/catalog-browser.ts +3 -34
- package/src/plugins/duplicates.ts +60 -0
- package/src/plugins/loader.ts +12 -3
- package/src/plugins/marketplace/feed.ts +3 -2
- package/src/plugins/marketplace/model.ts +10 -1
- package/src/plugins/registry/contributions.ts +37 -10
- package/src/plugins/registry/index.ts +2 -1
- package/src/portfolio/column-values.ts +51 -5
- package/src/public/__snapshots__/public-api.test.ts.snap +5 -0
- package/src/public/i18n.ts +3 -2
- package/src/react/async-resource.ts +8 -7
- package/src/renderers/browser/bundled-plugins.ts +2 -1
- package/src/renderers/dom/build-assets.ts +20 -0
- package/src/renderers/dom/css.d.ts +1 -0
- package/src/renderers/dom/data-table/index.tsx +96 -10
- package/src/renderers/dom/data-table/row.tsx +1 -1
- package/src/renderers/dom/es2023-array-methods.ts +57 -0
- package/src/renderers/dom/host/surface-fit.ts +64 -13
- package/src/renderers/dom/styles.css +6 -1
- package/src/renderers/electrobun/bun/desktop/backend.ts +12 -1
- package/src/renderers/electrobun/bun/external-plugins.ts +16 -6
- package/src/renderers/electrobun/shared/protocol.ts +2 -0
- package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +38 -8
- package/src/renderers/electrobun/view/cli-pane-shot-frame.tsx +15 -8
- package/src/renderers/electrobun/view/external-plugins.ts +1 -0
- package/src/renderers/electrobun/view/remote/asset-data-client.ts +3 -0
- package/src/series/types.ts +1 -0
- package/src/sources/gloomberb-cloud/batched-lookups.ts +12 -1
- package/src/sources/gloomberb-cloud/fred-attribution.ts +6 -5
- package/src/sources/gloomberb-cloud/index.ts +78 -8
- package/src/sources/gloomberb-cloud/news.ts +15 -2
- package/src/sources/gloomberb-cloud/normalizers.ts +10 -0
- package/src/sources/history-result.ts +2 -1
- package/src/sources/history-retention.ts +14 -2
- package/src/sources/listing-symbols.ts +1 -1
- package/src/sources/provider-router/cache.ts +32 -3
- package/src/sources/provider-router/cached-routes.ts +25 -0
- package/src/sources/provider-router/connection-health.ts +1 -0
- package/src/sources/provider-router/financials.ts +4 -4
- package/src/sources/provider-router/history.ts +2 -2
- package/src/sources/provider-router/index.ts +23 -1
- package/src/sources/provider-router/sec-filings-page.ts +25 -0
- package/src/sources/sec-edgar/content.ts +67 -36
- package/src/state/app/context/index.tsx +12 -4
- package/src/sync/broker-instances.ts +63 -11
- package/src/sync/config-merge.ts +1 -1
- package/src/sync/sanitize.ts +2 -0
- package/src/test-support/cloud-api.ts +34 -0
- package/src/test-support/strict-table-capture.tsx +83 -0
- package/src/tickers/listing-fate.ts +28 -0
- package/src/tickers/search/home-listing.ts +3 -0
- package/src/tickers/search/index-root-lead.ts +40 -0
- package/src/tickers/search/index.ts +23 -7
- package/src/tickers/terminal-codes.ts +7 -4
- package/src/time-series/alignment.ts +14 -4
- package/src/time-series/base-series.ts +20 -10
- package/src/time-series/chart-data.ts +2 -0
- package/src/time-series/chart-seed.ts +3 -1
- package/src/time-series/fundamentals/current-valuation.ts +22 -5
- package/src/time-series/fundamentals/historical-valuation.ts +2 -2
- package/src/time-series/fundamentals/history-link.ts +25 -0
- package/src/time-series/fundamentals/quarterly-ttm.ts +50 -5
- package/src/time-series/fundamentals/series.ts +15 -12
- package/src/time-series/history-acquisition.ts +2 -0
- package/src/time-series/market.ts +33 -5
- package/src/time-series/price-comparison.ts +42 -61
- package/src/time-series/resolve-context.ts +8 -0
- package/src/time-series/resolve.ts +67 -20
- package/src/time-series/spec.ts +2 -1
- package/src/time-series/studies/formula.ts +4 -2
- package/src/time-series/studies/indicators.ts +2 -0
- package/src/time-series/studies/pair.ts +4 -2
- package/src/time-series/studies/shared.ts +1 -0
- package/src/time-series/types.ts +3 -1
- package/src/time-series/use-chart-resolution.ts +34 -16
- package/src/time-series/valuation-currency.ts +40 -12
- package/src/types/config.ts +13 -61
- package/src/types/data-provider.ts +38 -1
- package/src/types/financials.ts +72 -6
- package/src/types/headless.ts +53 -0
- package/src/types/instrument.ts +1 -0
- package/src/types/plugin-context.ts +8 -1
- package/src/utils/crypto-pair.ts +26 -0
- package/src/utils/day-format.ts +104 -0
- package/src/utils/exchange-announcements.ts +36 -12
- package/src/utils/exchange-notation.generated.ts +58 -1
- package/src/utils/exchanges.ts +43 -1
- package/src/utils/financial-statements.ts +40 -46
- package/src/utils/format.ts +74 -12
- package/src/utils/forward-dividend.ts +2 -1
- package/src/utils/function-search.ts +38 -0
- package/src/utils/fuzzy-search.ts +10 -6
- package/src/utils/option-choice.ts +15 -0
- package/src/utils/price-history.ts +15 -1
- package/src/utils/reason-codes.ts +6 -3
- package/src/utils/trailing-dividend.ts +288 -28
- package/src/plugins/builtin/research/corporate-actions-pane.tsx +0 -757
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { HeadlessPaneDefinition } from "../../../types/plugin";
|
|
2
2
|
import { isProLock } from "../../../cli/pane-functions/access-gate";
|
|
3
|
-
import type { HeadlessPaneColumn, HeadlessPaneContext } from "../../../types/headless";
|
|
3
|
+
import type { HeadlessPaneColumn, HeadlessPaneContext, HeadlessPaneEntry } from "../../../types/headless";
|
|
4
4
|
import {
|
|
5
5
|
KPI_FIELDS,
|
|
6
6
|
NUMERIC_FIELDS,
|
|
@@ -14,8 +14,9 @@ import { EXTENDED_SESSION_LABELS, type ExtendedSession } from "../../../market-d
|
|
|
14
14
|
import { buildQuoteKey } from "../../../market-data/selectors";
|
|
15
15
|
import type { Quote } from "../../../types/financials";
|
|
16
16
|
import { MISSING_VALUE, formatCurrency, formatPercentRaw } from "../../../utils/format";
|
|
17
|
+
import { currencyPriceMinDigits, formatMarketPriceWithCurrency } from "../../../market-data/market/format";
|
|
17
18
|
import { fetchSavedScreens, fetchScreen, fetchScreenCheck } from "./client";
|
|
18
|
-
import { ideaMetricSetting, SCREEN_IDEAS, screenIdea } from "./ideas";
|
|
19
|
+
import { ideaMetricSetting, SCREEN_IDEAS, screenIdea, type ScreenIdea } from "./ideas";
|
|
19
20
|
import { checkRows, screenCheckSummary, screenCheckTicker } from "./screen-check";
|
|
20
21
|
import { overlayScreenQuotes, screenExtendedSessions, sortLiveScreenRows } from "./live";
|
|
21
22
|
import {
|
|
@@ -26,9 +27,11 @@ import {
|
|
|
26
27
|
unmatchedCategoryValues,
|
|
27
28
|
} from "./categories";
|
|
28
29
|
import { REPORT_ROWS } from "../shared/headless-options";
|
|
30
|
+
import { shellWord } from "../../../utils/shell-word";
|
|
29
31
|
import { findNamedCollection, readWatchlistArgument } from "../../../portfolio/collection-name";
|
|
30
32
|
import {
|
|
31
33
|
appendScreenPage,
|
|
34
|
+
criterionText,
|
|
32
35
|
DEFAULT_SCREEN,
|
|
33
36
|
EXAMPLE_SCREEN_DEFINITION,
|
|
34
37
|
formatScreenMetric,
|
|
@@ -99,8 +102,12 @@ async function loadRowQuotes(rows: readonly ScreenRow[], ctx: HeadlessPaneContex
|
|
|
99
102
|
}
|
|
100
103
|
}
|
|
101
104
|
|
|
105
|
+
// A line quoted in pence keeps the decimals it trades in (GCP's £0.828), as `quote` prints it.
|
|
102
106
|
const price = (value: unknown, row: Record<string, unknown>) =>
|
|
103
|
-
typeof value
|
|
107
|
+
typeof value !== "number" || typeof row.currency !== "string" || !row.currency ? MISSING_VALUE
|
|
108
|
+
: typeof row.quotedUnitDivisor === "number" && row.quotedUnitDivisor > 1
|
|
109
|
+
? formatMarketPriceWithCurrency(value, row.currency, { minimumFractionDigits: currencyPriceMinDigits(row.currency), quotedUnitDivisor: row.quotedUnitDivisor })
|
|
110
|
+
: formatCurrency(value, row.currency);
|
|
104
111
|
const percent = (value: unknown) => typeof value === "number" ? formatPercentRaw(value) : MISSING_VALUE;
|
|
105
112
|
|
|
106
113
|
/** The pre-market, after-hours or overnight print and its move from the close in Last, for the rows that have one. */
|
|
@@ -178,12 +185,86 @@ function extraMetricCell(field: NumericField, metric: ScreenMetric | undefined):
|
|
|
178
185
|
return metric.value != null && /^[A-Z]{3}$/.test(metric.unit) ? `${value} ${metric.unit}` : value;
|
|
179
186
|
}
|
|
180
187
|
|
|
181
|
-
/** What the State
|
|
188
|
+
/** What the State columns' words mean, said once under a report where a shown metric has them. */
|
|
182
189
|
const STATE_LEGEND: ReadonlyArray<{ state: ScreenMetric["state"]; text: string }> = [
|
|
183
190
|
{ state: "partial", text: "A partial State means the source gives no date for the figure, so As of is when it was collected, or that it covers part of what it measures." },
|
|
184
|
-
{ state: "stale", text: "A stale State means the figure is older than its field allows, such as a quote over 4 days old or fundamentals collected over 7 days ago." },
|
|
191
|
+
{ state: "stale", text: "A stale State means the figure is older than its field allows, such as a price from before its exchange's latest session, a quote over 4 days old or fundamentals collected over 7 days ago." },
|
|
185
192
|
];
|
|
186
193
|
|
|
194
|
+
/** A date as a report cell prints it: a day as it is, an instant to the minute in UTC. */
|
|
195
|
+
function stampText(stamp: unknown): string {
|
|
196
|
+
if (typeof stamp !== "string" || !stamp) return MISSING_VALUE;
|
|
197
|
+
if (/^\d{4}-\d{2}-\d{2}$/.test(stamp)) return stamp;
|
|
198
|
+
const time = Date.parse(stamp);
|
|
199
|
+
return Number.isFinite(time) ? `${new Date(time).toISOString().slice(0, 16).replace("T", " ")} UTC` : stamp;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* A metric's own As of and State, as the first metric's columns print them.
|
|
204
|
+
* A forecast is dated by when it was given, and names the period it is for
|
|
205
|
+
* apart, so a forward date never reads as when the figure was observed.
|
|
206
|
+
*/
|
|
207
|
+
function metricStamp(metric: ScreenMetric | undefined): { asOf: string; state: string } {
|
|
208
|
+
if (!metric) return { asOf: MISSING_VALUE, state: MISSING_VALUE };
|
|
209
|
+
const stamp = metricDate(metric);
|
|
210
|
+
const date = stamp.collected ? `${stamp.text} (collected)` : stamp.text;
|
|
211
|
+
return {
|
|
212
|
+
asOf: metric.periodEnd ? `${date} (for the period ending ${metric.periodEnd})` : date,
|
|
213
|
+
state: metric.access === "pro" ? "locked" : metric.state,
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* When the row's Last is from (the session it closed, the time it traded, or
|
|
219
|
+
* when a last price on record was printed), its state, and, when it is not a
|
|
220
|
+
* current price, why.
|
|
221
|
+
*/
|
|
222
|
+
function lastStamp(metric: ScreenMetric): { at: string | null; state: string; note: string | null } {
|
|
223
|
+
const at = metric.printedAt ?? metric.asOf ?? (metric.value != null ? metric.observedAt : null);
|
|
224
|
+
const note = metric.value == null || metric.state === "available" ? null
|
|
225
|
+
: metric.reason ?? (metric.state === "stale" ? "The last price on record: older than a current price allows" : null);
|
|
226
|
+
return { at, state: metric.state, note };
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/** The column the rows are ordered by: the first metric's, one every report prints, or the one `extraScreenColumns` adds for the sort. */
|
|
230
|
+
function sortedColumnKey(sortField: string, metric: NumericField): string {
|
|
231
|
+
return sortField === metric ? "value" : sortField;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* What the rows are: the screen as it ran, how they are ordered, and the
|
|
236
|
+
* snapshot they come from, so a saved report says how to get them again. The
|
|
237
|
+
* command is the definition exactly, as text an export keeps whole (a JSON
|
|
238
|
+
* cell would be flattened into words).
|
|
239
|
+
*/
|
|
240
|
+
function screenEntries(
|
|
241
|
+
data: ScreenPayload,
|
|
242
|
+
sortedBy: string,
|
|
243
|
+
source: { preset?: ScreenIdea; savedName?: string; metrics: readonly NumericField[] },
|
|
244
|
+
): HeadlessPaneEntry[] {
|
|
245
|
+
const { definition, snapshot, universe } = data;
|
|
246
|
+
const direction = definition.sort.direction === "desc" ? "descending" : "ascending";
|
|
247
|
+
return [
|
|
248
|
+
...(source.preset ? [{ key: "preset", label: "Preset", value: `${source.preset.name} (--preset ${source.preset.id})` }] : []),
|
|
249
|
+
...(source.savedName ? [{ key: "savedScreen", label: "Saved screen", value: source.savedName }] : []),
|
|
250
|
+
{ key: "criteria", label: "Criteria", value: definition.criteria.length ? definition.criteria.map(criterionText).join("; ") : "None" },
|
|
251
|
+
{ key: "currency", label: "Currency", value: definition.currency ?? "None: no criterion compares money" },
|
|
252
|
+
{ key: "sort", label: "Sorted by", value: `${sortedBy} (${definition.sort.field}), ${direction}` },
|
|
253
|
+
{ key: "command", label: "Command", value: `gloom fn EQS --definition ${shellWord(spacedJson(definition))} --metric ${source.metrics.join(",")}` },
|
|
254
|
+
{ key: "snapshot", label: "Snapshot", value: snapshot?.id ?? MISSING_VALUE },
|
|
255
|
+
{ key: "assembledAt", label: "Assembled", value: snapshot?.assembledAt ?? MISSING_VALUE },
|
|
256
|
+
{ key: "matched", label: "Matches", value: `${universe.matched.toLocaleString("en-US")} of ${universe.covered.toLocaleString("en-US")} covered listings` },
|
|
257
|
+
];
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/** The newest input the snapshot observed, as of its assembly or before; a later date is no observation. */
|
|
261
|
+
function newestInput(snapshot: ScreenPayload["snapshot"]): string | null {
|
|
262
|
+
const newest = snapshot?.sourceNewestAt;
|
|
263
|
+
if (!newest || !snapshot) return null;
|
|
264
|
+
const at = Date.parse(newest), assembled = Date.parse(snapshot.assembledAt);
|
|
265
|
+
return Number.isFinite(at) && Number.isFinite(assembled) && at <= assembled ? newest : null;
|
|
266
|
+
}
|
|
267
|
+
|
|
187
268
|
/** A typed `--definition`, checked; every error points at the worked example. */
|
|
188
269
|
function readDefinition(text: string): ScreenDefinition {
|
|
189
270
|
const pointer = "The example in gloom catalog EQS is a valid definition to start from.";
|
|
@@ -386,50 +467,83 @@ export const equityScreenerHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
386
467
|
const ytdBase = screenYtdBase(data.rows, data.snapshot?.assembledAt);
|
|
387
468
|
// The metrics after the first, then the field the rows are sorted by, so the order shown is explained by a column.
|
|
388
469
|
const extra = extraScreenColumns(metrics, data.definition.sort.field);
|
|
389
|
-
const
|
|
470
|
+
const extraMetrics = extra.filter(isNumericField);
|
|
471
|
+
// Last is the first metric's own column when it is the price; otherwise it carries its own date and state.
|
|
472
|
+
const lastShown = metric !== "price";
|
|
473
|
+
// Every State column a row shows: the first metric's, each other metric's, and Last's.
|
|
474
|
+
const stated = [...extraMetrics, ...lastShown ? ["price" as const] : []];
|
|
475
|
+
const states = new Set(rows.flatMap((row) => [row.metrics[metric].state,
|
|
476
|
+
...stated.flatMap((field) => row.metrics[field] && row.metrics[field].access !== "pro" ? [row.metrics[field].state] : [])]));
|
|
390
477
|
const legend = STATE_LEGEND.filter(({ state }) => states.has(state)).map(({ text }) => text);
|
|
391
478
|
const locked = rows.some((row) => metrics.some((field) => row.metrics[field]?.access === "pro"));
|
|
392
479
|
const notes = [...watchlistRead.notes, ...listingReadNotes(data.listings, data.definition.currency), ...kpiGaps, ...legend,
|
|
393
480
|
...(locked && !errors.some(isProLock) ? ["Locked figures require Gloom Pro access."] : [])];
|
|
481
|
+
const sortedKey = sortedColumnKey(data.definition.sort.field, metric);
|
|
482
|
+
const mark = data.definition.sort.direction === "desc" ? "▼" : "▲";
|
|
483
|
+
const columns: HeadlessPaneColumn[] = [
|
|
484
|
+
{ key: "symbol", header: "Symbol" },
|
|
485
|
+
{ key: "exchange", header: "Exchange" },
|
|
486
|
+
{ key: "name", header: "Name" },
|
|
487
|
+
// The focus metric says it once when it is the price or the move.
|
|
488
|
+
...(lastShown ? [{ key: "price", header: "Last", align: "right" as const, format: price }] : []),
|
|
489
|
+
...(metric === "changePercent" ? [] : [{ key: "changePercent", header: "Chg%", align: "right" as const, format: percent }]),
|
|
490
|
+
...extendedSessions.map(extendedColumn),
|
|
491
|
+
// When Last and its move are from, and whether that is a current price. Exports write these after their older
|
|
492
|
+
// columns, so none of those moves.
|
|
493
|
+
...(lastShown ? [
|
|
494
|
+
{ key: "priceAsOf", header: "Last as of", textFormat: stampText, optional: true, exportLast: true },
|
|
495
|
+
{ key: "priceState", header: "Last state", optional: true, exportLast: true },
|
|
496
|
+
] : []),
|
|
497
|
+
// YTD names the close it is measured from: `YTD% vs 31 Dec close`.
|
|
498
|
+
{ key: "value", header: screenColumnLabel(metric, ytdBase, "report"), align: "right" },
|
|
499
|
+
{ key: "unit", header: "Unit" },
|
|
500
|
+
{ key: "percentile", header: "Covered pctl", align: "right" },
|
|
501
|
+
{ key: "asOf", header: "As of" },
|
|
502
|
+
{ key: "state", header: "State" },
|
|
503
|
+
// Every metric after the first is dated and stated on its own, never by the first's columns.
|
|
504
|
+
...extra.flatMap((field): HeadlessPaneColumn[] => {
|
|
505
|
+
if (!isNumericField(field)) return [{ key: field, header: CATEGORY_HEADERS[field] }];
|
|
506
|
+
const label = screenColumnLabel(field, ytdBase, "report");
|
|
507
|
+
return [
|
|
508
|
+
{ key: field, header: label, align: "right" },
|
|
509
|
+
{ key: `${field}AsOf`, header: `${label} as of`, literalHeader: true, optional: true, exportLast: true },
|
|
510
|
+
{ key: `${field}State`, header: `${label} state`, literalHeader: true, optional: true, exportLast: true },
|
|
511
|
+
];
|
|
512
|
+
}),
|
|
513
|
+
// Why a row's Last is not a current price, under that row.
|
|
514
|
+
...(lastShown ? [{ key: "priceNote", header: "Last note", underRow: true, exportLast: true }] : []),
|
|
515
|
+
];
|
|
516
|
+
// The text report marks the column the rows are ordered by (`(sorted descending)` in plain text); exports name it in Screen.
|
|
517
|
+
const sortedColumn = columns.find((column) => column.key === sortedKey);
|
|
518
|
+
const sortedBy = sortedColumn?.header ?? screenLabel(data.definition.sort.field);
|
|
519
|
+
if (sortedColumn) sortedColumn.textHeader = `${sortedColumn.header} ${mark}`;
|
|
394
520
|
// Payload status also counts ordinary per-field sparsity; only generation
|
|
395
521
|
// warnings are failures, and more pages are not an error.
|
|
396
522
|
return {
|
|
397
|
-
freshness: { asOf: data.snapshot
|
|
523
|
+
freshness: { asOf: newestInput(data.snapshot) },
|
|
398
524
|
complete: !data.nextCursor && errors.length === 0,
|
|
399
525
|
errors,
|
|
400
526
|
...(notes.length ? { notes } : {}),
|
|
401
527
|
...(rows.length > 0 && unmatchedText ? { warnings: [unmatchedText] } : {}),
|
|
402
528
|
sections: [
|
|
529
|
+
// First, so a saved report opens with what it is a screen of and how its rows are ordered.
|
|
530
|
+
{ title: "Screen", entries: screenEntries(data, sortedBy, { preset, savedName, metrics }) },
|
|
403
531
|
{
|
|
404
532
|
title: "Matching equities",
|
|
405
533
|
...(empty ? { empty } : {}),
|
|
406
|
-
columns
|
|
407
|
-
{ key: "symbol", header: "Symbol" },
|
|
408
|
-
{ key: "exchange", header: "Exchange" },
|
|
409
|
-
{ key: "name", header: "Name" },
|
|
410
|
-
// The focus metric says it once when it is the price or the move.
|
|
411
|
-
...(metric === "price" ? [] : [{ key: "price", header: "Last", align: "right" as const, format: price }]),
|
|
412
|
-
...(metric === "changePercent" ? [] : [{ key: "changePercent", header: "Chg%", align: "right" as const, format: percent }]),
|
|
413
|
-
...extendedSessions.map(extendedColumn),
|
|
414
|
-
// YTD names the close it is measured from: `YTD% vs 31 Dec close`.
|
|
415
|
-
{ key: "value", header: screenColumnLabel(metric, ytdBase, "report"), align: "right" },
|
|
416
|
-
{ key: "unit", header: "Unit" },
|
|
417
|
-
{ key: "percentile", header: "Covered pctl", align: "right" },
|
|
418
|
-
{ key: "asOf", header: "As of" },
|
|
419
|
-
{ key: "state", header: "State" },
|
|
420
|
-
...extra.map((field): HeadlessPaneColumn => isNumericField(field)
|
|
421
|
-
? { key: field, header: screenColumnLabel(field, ytdBase, "report"), align: "right" }
|
|
422
|
-
: { key: field, header: CATEGORY_HEADERS[field] }),
|
|
423
|
-
],
|
|
534
|
+
columns,
|
|
424
535
|
rows: rows.map((row) => {
|
|
425
536
|
const observation = row.metrics[metric];
|
|
426
|
-
const
|
|
537
|
+
const focus = metricStamp(observation);
|
|
538
|
+
const last = lastStamp(row.metrics.price);
|
|
427
539
|
return {
|
|
428
540
|
symbol: row.symbol,
|
|
429
541
|
exchange: row.exchange,
|
|
430
542
|
name: row.name,
|
|
431
543
|
currency: row.currency,
|
|
432
544
|
price: row.metrics.price.value,
|
|
545
|
+
...(lastShown ? { priceAsOf: last.at, priceState: last.state } : {}),
|
|
546
|
+
...row.quotedUnitDivisor ? { quotedUnitDivisor: row.quotedUnitDivisor } : {},
|
|
433
547
|
changePercent: row.metrics.changePercent.value,
|
|
434
548
|
extendedSession: row.extended?.session ?? null,
|
|
435
549
|
extendedPrice: row.extended?.price ?? null,
|
|
@@ -441,11 +555,14 @@ export const equityScreenerHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
441
555
|
observation.percentile.value == null
|
|
442
556
|
? null
|
|
443
557
|
: Math.round(observation.percentile.value),
|
|
444
|
-
asOf:
|
|
445
|
-
state:
|
|
446
|
-
...Object.fromEntries(extra.
|
|
447
|
-
|
|
448
|
-
|
|
558
|
+
asOf: focus.asOf,
|
|
559
|
+
state: focus.state,
|
|
560
|
+
...Object.fromEntries(extra.flatMap((field): Array<[string, unknown]> => {
|
|
561
|
+
if (!isNumericField(field)) return [[field, row[field]]];
|
|
562
|
+
const own = metricStamp(row.metrics[field]);
|
|
563
|
+
return [[field, extraMetricCell(field, row.metrics[field])], [`${field}AsOf`, own.asOf], [`${field}State`, own.state]];
|
|
564
|
+
})),
|
|
565
|
+
...(lastShown ? { priceNote: last.note } : {}),
|
|
449
566
|
};
|
|
450
567
|
}),
|
|
451
568
|
},
|
|
@@ -459,6 +576,7 @@ export const equityScreenerHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
459
576
|
returned: data.rows.length,
|
|
460
577
|
hasMore: !!data.nextCursor,
|
|
461
578
|
metrics,
|
|
579
|
+
sort: { field: data.definition.sort.field, direction: data.definition.sort.direction, column: sortedBy },
|
|
462
580
|
...(unmatched.length > 0 ? { unmatchedValues: unmatchedCategoryValues(data.definition, data, rows) } : {}),
|
|
463
581
|
priceBasis: "price, changePercent and the market cap are the regular session, read from each row's quote as `quote` reads it: after the close, its close and that close's move. trailingPE, forwardPE and priceToBook are over that price, as `valuation` reprices them. A pre-market, after-hours or overnight print is in extendedPrice and extendedChangePercent, measured from that close. Membership and percentiles are the snapshot's, which ranks by the close; a sort on price, changePercent, volume, marketCap or those multiples orders these rows by the figures shown.",
|
|
464
582
|
notices: data.nextCursor
|
|
@@ -13,7 +13,11 @@ import { isValuationMultiple, screenRowId } from "./model";
|
|
|
13
13
|
* cap are the regular session's, and a pre-market, after-hours or overnight
|
|
14
14
|
* print rides beside them in `extended`, measured from that session's close.
|
|
15
15
|
*/
|
|
16
|
-
export type LiveScreenRow = ScreenRow & {
|
|
16
|
+
export type LiveScreenRow = ScreenRow & {
|
|
17
|
+
extended?: ExtendedSessionDisplay;
|
|
18
|
+
/** The quote's providerPriceDivisor (100 for a line quoted in pence): its price keeps the decimals it trades in. */
|
|
19
|
+
quotedUnitDivisor?: number;
|
|
20
|
+
};
|
|
17
21
|
|
|
18
22
|
function metricTime(metric: ScreenMetric | undefined): number | null {
|
|
19
23
|
const stamp = metric?.observedAt ?? metric?.asOf ?? null;
|
|
@@ -26,8 +30,14 @@ function screenRowQuoteKey(row: Pick<ScreenRow, "symbol" | "exchange">): string
|
|
|
26
30
|
return buildQuoteKey({ symbol: row.symbol, exchange: row.exchange });
|
|
27
31
|
}
|
|
28
32
|
|
|
33
|
+
/**
|
|
34
|
+
* The quote's figure in place of the snapshot's. A snapshot figure that was a
|
|
35
|
+
* last price on record goes with its print time and the reason it was stale;
|
|
36
|
+
* any other reason (a cap's share count) still holds.
|
|
37
|
+
*/
|
|
29
38
|
function liveMetric(metric: ScreenMetric, value: number, asOf: string, observedAt: string): ScreenMetric {
|
|
30
|
-
|
|
39
|
+
const { printedAt: _printedAt, ...rest } = metric;
|
|
40
|
+
return { ...rest, value, asOf, observedAt, state: "available", ...(metric.state === "stale" ? { reason: null } : {}) };
|
|
31
41
|
}
|
|
32
42
|
|
|
33
43
|
/**
|
|
@@ -37,10 +47,18 @@ function liveMetric(metric: ScreenMetric, value: number, asOf: string, observedA
|
|
|
37
47
|
*/
|
|
38
48
|
const PRICE_MULTIPLE_FIELDS = ["trailingPE", "forwardPE", "priceToBook"] as const;
|
|
39
49
|
|
|
40
|
-
/**
|
|
41
|
-
|
|
50
|
+
/**
|
|
51
|
+
* The company's name as its quote gives it, so a row reads as `quote` does
|
|
52
|
+
* (the snapshot's without one), and the unit its quote is in: a line quoted
|
|
53
|
+
* in pence keeps its pence decimals (GCP's £0.828).
|
|
54
|
+
*/
|
|
55
|
+
function quoteNamed(row: ScreenRow, quote: Quote): LiveScreenRow {
|
|
42
56
|
const name = quote.name?.trim();
|
|
43
|
-
|
|
57
|
+
const divisor = quote.providerPriceDivisor;
|
|
58
|
+
const quoted = divisor != null && Number.isFinite(divisor) && divisor > 1 && (!row.currency || quote.currency?.trim() === row.currency);
|
|
59
|
+
return name && name !== row.name || quoted
|
|
60
|
+
? { ...row, ...name && name !== row.name ? { name } : {}, ...quoted ? { quotedUnitDivisor: divisor } : {} }
|
|
61
|
+
: row;
|
|
44
62
|
}
|
|
45
63
|
|
|
46
64
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ATTENTION_FIELDS,
|
|
3
|
+
BUYBACK_FIELDS,
|
|
3
4
|
DIVIDEND_FIELDS,
|
|
4
5
|
HIRING_APP_FIELDS,
|
|
5
6
|
CATEGORY_FIELDS,
|
|
@@ -15,6 +16,7 @@ import {
|
|
|
15
16
|
SCORE_FIELDS,
|
|
16
17
|
SOCIAL_FIELDS,
|
|
17
18
|
TECHNICAL_FIELDS,
|
|
19
|
+
TRAILING_YIELD_FIELDS,
|
|
18
20
|
VOLATILITY_FIELDS,
|
|
19
21
|
type NumericField,
|
|
20
22
|
type ScreenMetric,
|
|
@@ -28,8 +30,9 @@ import {
|
|
|
28
30
|
} from "../../../api-client/equity-screener";
|
|
29
31
|
import { yearToDateBaseLabel } from "../../../market-data/market/year-to-date";
|
|
30
32
|
import { canonicalExchange, isUsListingExchange, parsePublicTickerKey } from "../../../utils/exchanges";
|
|
31
|
-
import { LATEST_DISTRIBUTION, TRAILING_DIVIDEND_BASIS } from "../../../utils/forward-dividend";
|
|
33
|
+
import { LATEST_DISTRIBUTION, TRAILING_DIVIDEND_BASIS, UNEVEN_REGULAR_PAYMENTS } from "../../../utils/forward-dividend";
|
|
32
34
|
import { MISSING_VALUE, formatCompact, formatNumber, formatPercentRaw } from "../../../utils/format";
|
|
35
|
+
import { formatMarketPrice } from "../../../market-data/market/format";
|
|
33
36
|
import { formatPriceEarnings, NOT_MEANINGFUL } from "../../../utils/price-earnings";
|
|
34
37
|
import { ATTENTION_LISTED } from "../attention/listing";
|
|
35
38
|
import { kpiFreeLimitNote } from "../company-kpis/model";
|
|
@@ -70,6 +73,7 @@ export const SHORT_LABELS: Record<NumericField, string> = {
|
|
|
70
73
|
forwardPE: "FWD P/E",
|
|
71
74
|
enterpriseToRevenue: "EV/REV",
|
|
72
75
|
dividendYieldPercent: "DIV YLD%",
|
|
76
|
+
trailingDividendYieldPercent: "TTM YLD%",
|
|
73
77
|
revenueGrowthPercent: "FY REV GR%",
|
|
74
78
|
earningsGrowthPercent: "FY EARN GR%",
|
|
75
79
|
grossMarginPercent: "FY GROSS MGN%",
|
|
@@ -81,6 +85,9 @@ export const SHORT_LABELS: Record<NumericField, string> = {
|
|
|
81
85
|
shortInterestShares: "SHORT INT",
|
|
82
86
|
shortInterestChangePercent: "SI CHG%",
|
|
83
87
|
daysToCover: "DAYS COVER",
|
|
88
|
+
buybackVolume5dPercent: "BUYBACK 5D %VOL",
|
|
89
|
+
buybackMandateLeftPercent: "MANDATE LEFT %AUTH",
|
|
90
|
+
buybackBlackoutDays: "TO BLACKOUT",
|
|
84
91
|
insiderPurchases90d: "INS BUYS 90D",
|
|
85
92
|
insiderSales90d: "INS SELLS 90D",
|
|
86
93
|
institutionalHolders: "13F HOLDERS",
|
|
@@ -228,7 +235,7 @@ export function screenSignValue(field: NumericField, value: number | null): numb
|
|
|
228
235
|
if (field === "gradeComposite") return value >= 3.5 ? 1 : value < 2.5 ? -1 : 0;
|
|
229
236
|
return null;
|
|
230
237
|
}
|
|
231
|
-
const COUNTS = new Set<NumericField>(["appRatingCountGrowth7d", "hiringNetAddsWeek", "hiringOpenRoles", "attentionResearchUnits", "insiderPurchases90d", "insiderSales90d", "institutionalHolders", "institutionalNewHolders", "institutionalExits", "ivRank", "ivPercentile", "hvRank",
|
|
238
|
+
const COUNTS = new Set<NumericField>(["buybackBlackoutDays", "appRatingCountGrowth7d", "hiringNetAddsWeek", "hiringOpenRoles", "attentionResearchUnits", "insiderPurchases90d", "insiderSales90d", "institutionalHolders", "institutionalNewHolders", "institutionalExits", "ivRank", "ivPercentile", "hvRank",
|
|
232
239
|
"macdBullishCrossDays", "macdBearishCrossDays", "goldenCrossDays", "deathCrossDays",
|
|
233
240
|
"newHigh20dDays", "newLow20dDays", "newHigh52wDays", "newLow52wDays", "bollingerWidthPercentile",
|
|
234
241
|
"piotroskiFScore", "magicFormulaRank", "rsRating", "profitableYears", "revenueGrowthYears", "dividendGrowthYears"]);
|
|
@@ -239,8 +246,14 @@ const MEMBERSHIP = new Set<NumericField>(MEMBERSHIP_FIELDS);
|
|
|
239
246
|
/** Shown after the screen's own criteria when the pane has room. */
|
|
240
247
|
const CONTEXT_FIELDS: NumericField[] = ["marketCap", "price", "changePercent", "trailingPE", "revenueGrowthPercent", "operatingMarginPercent", "dividendYieldPercent"];
|
|
241
248
|
|
|
242
|
-
|
|
249
|
+
/**
|
|
250
|
+
* A value as a cell prints it. A price of a line quoted in a sub-unit
|
|
251
|
+
* (`quotedUnitDivisor`, 100 for pence) keeps the decimals it trades in, as
|
|
252
|
+
* `quote` prints it: GCP's 82.8p is 0.828, not 0.83.
|
|
253
|
+
*/
|
|
254
|
+
export function formatScreenValue(field: NumericField, value: number | null, quotedUnitDivisor?: number): string {
|
|
243
255
|
if (value == null || !Number.isFinite(value)) return MISSING_VALUE;
|
|
256
|
+
if (field === "price" && quotedUnitDivisor != null && quotedUnitDivisor > 1) return formatMarketPrice(value, { quotedUnitDivisor, minimumFractionDigits: 2 });
|
|
244
257
|
if (COMPACT.has(field)) return formatCompact(value, { fixedDecimals: true });
|
|
245
258
|
if (DAILY_COUNTS.has(field)) return value < 1_000 ? value.toFixed(0) : formatCompact(value, { fixedDecimals: true });
|
|
246
259
|
if (RATIOS.has(field)) return `${value.toFixed(1)}x`;
|
|
@@ -249,6 +262,8 @@ export function formatScreenValue(field: NumericField, value: number | null): st
|
|
|
249
262
|
if (LETTER_GRADES.has(field)) return gradeLetter(value) ?? MISSING_VALUE;
|
|
250
263
|
if (field === "gradeComposite") return `${formatNumber(value, 2)} ${compositeLabel(value)}`;
|
|
251
264
|
if (HUNDREDTHS.has(field)) return formatNumber(value, 2);
|
|
265
|
+
// A buyback is often a fraction of a percent of the tape; one decimal would read 0.06% as 0.1.
|
|
266
|
+
if (field === "buybackVolume5dPercent") return formatNumber(value, 2);
|
|
252
267
|
// The day's move reads as every quote list's CHG% does (+2.04%), not +2.0 (review, 12 Nov 2026).
|
|
253
268
|
if (field === "changePercent") return formatPercentRaw(value);
|
|
254
269
|
// A value that rounds to zero prints 0.0, never -0.0.
|
|
@@ -257,16 +272,16 @@ export function formatScreenValue(field: NumericField, value: number | null): st
|
|
|
257
272
|
}
|
|
258
273
|
|
|
259
274
|
/** A row's metric as a cell prints it: N/M for a multiple that is not meaningful, as RV and `valuation` print it. */
|
|
260
|
-
export function formatScreenMetric(field: NumericField, metric: Pick<ScreenMetric, "value" | "notMeaningful"> & Partial<Pick<ScreenMetric, "reason"
|
|
261
|
-
const text = metric.value == null && metric.notMeaningful ? formatPriceEarnings(NOT_MEANINGFUL) : formatScreenValue(field, metric.value);
|
|
275
|
+
export function formatScreenMetric(field: NumericField, metric: Pick<ScreenMetric, "value" | "notMeaningful"> & Partial<Pick<ScreenMetric, "reason">>, quotedUnitDivisor?: number): string {
|
|
276
|
+
const text = metric.value == null && metric.notMeaningful ? formatPriceEarnings(NOT_MEANINGFUL) : formatScreenValue(field, metric.value, quotedUnitDivisor);
|
|
262
277
|
return field === "dividendGrowthYears" && metric.value != null && /^At least \d+: the stored history starts \d{4}-\d{2}-\d{2}$/.test(metric.reason ?? "") ? `${text}+` : text;
|
|
263
278
|
}
|
|
264
279
|
|
|
265
280
|
/** A metric as a company's detail prints it: with its unit, but a grade or the composite reads as itself (B+, 4.72 Top). */
|
|
266
|
-
export function screenDetailValue(field: NumericField, metric: Pick<ScreenMetric, "value" | "notMeaningful" | "unit"> & Partial<Pick<ScreenMetric, "reason"
|
|
281
|
+
export function screenDetailValue(field: NumericField, metric: Pick<ScreenMetric, "value" | "notMeaningful" | "unit"> & Partial<Pick<ScreenMetric, "reason">>, quotedUnitDivisor?: number): string {
|
|
267
282
|
// A missing value is just "--", without the unit it would have had; N/M says so.
|
|
268
283
|
if (metric.value == null) return metric.notMeaningful ? formatScreenMetric(field, metric) : formatScreenValue(field, null);
|
|
269
|
-
const text = formatScreenMetric(field, metric);
|
|
284
|
+
const text = formatScreenMetric(field, metric, quotedUnitDivisor);
|
|
270
285
|
if (GRADE_DISPLAY_FIELDS.has(field)) return text;
|
|
271
286
|
// A count of one is singular: 1 year, 1 day.
|
|
272
287
|
const unit = metric.value === 1 && COUNT_UNITS.has(metric.unit) ? metric.unit.slice(0, -1) : metric.unit;
|
|
@@ -294,13 +309,16 @@ export function gradeRankText(metric: Pick<ScreenMetric, "source">): string | nu
|
|
|
294
309
|
|
|
295
310
|
/**
|
|
296
311
|
* A row's dividend yield basis, in the words `ticker` and `DVD` use. Gloom
|
|
297
|
-
* Cloud serves
|
|
298
|
-
*
|
|
299
|
-
*
|
|
312
|
+
* Cloud serves the forward yield DVD and DES show, and names it in the
|
|
313
|
+
* metric's reason: the latest distribution annualized, or an uneven year's
|
|
314
|
+
* regular payments summed. A company with no forward rate has no value (its
|
|
315
|
+
* reason names its trailing yield). An older server's trailing row still
|
|
316
|
+
* reads as trailing; a row whose basis is not stated gets none.
|
|
300
317
|
*/
|
|
301
318
|
export function dividendYieldBasis(metric: ScreenMetric): string | null {
|
|
302
319
|
if (metric.value == null) return null;
|
|
303
|
-
if (/^forward yield\b/i.test(metric.reason ?? ""))
|
|
320
|
+
if (/^forward yield\b/i.test(metric.reason ?? ""))
|
|
321
|
+
return (metric.reason ?? "").includes(`(${UNEVEN_REGULAR_PAYMENTS})`) ? UNEVEN_REGULAR_PAYMENTS : LATEST_DISTRIBUTION;
|
|
304
322
|
if (/^trailing yield\b/i.test(metric.reason ?? "")) return TRAILING_DIVIDEND_BASIS;
|
|
305
323
|
return null;
|
|
306
324
|
}
|
|
@@ -357,6 +375,7 @@ export function screenYtdBase(rows: readonly ScreenRow[], assembledAt?: string |
|
|
|
357
375
|
* the pane is short of room.
|
|
358
376
|
*/
|
|
359
377
|
export function screenColumnLabel(field: NumericField, ytdBase: string | null, form: "report" | "pane" | "compact" = "pane"): string {
|
|
378
|
+
if (field === "beta") return form === "compact" ? "Beta 2Y wkly SPY" : "Beta 2Y weekly vs SPY";
|
|
360
379
|
if (field !== "returnYtdPercent" || !ytdBase) return SHORT_LABELS[field];
|
|
361
380
|
return form === "compact" ? `YTD% ${ytdBase}` : `YTD% vs ${ytdBase}${form === "report" ? " close" : ""}`;
|
|
362
381
|
}
|
|
@@ -482,7 +501,11 @@ export const screenLabel = (field: string) =>
|
|
|
482
501
|
averageVolume20d: "20D average volume",
|
|
483
502
|
changePercent: "Change %",
|
|
484
503
|
daysToCover: "Days to cover",
|
|
504
|
+
buybackVolume5dPercent: "Buyback, 5-day % of volume",
|
|
505
|
+
buybackMandateLeftPercent: "Buyback mandate left, % of authorised",
|
|
506
|
+
buybackBlackoutDays: "Days to buyback blackout",
|
|
485
507
|
dividendYieldPercent: "Dividend yield %",
|
|
508
|
+
trailingDividendYieldPercent: "Trailing dividend yield %",
|
|
486
509
|
xPostsPerDay: "X posts per day",
|
|
487
510
|
xPostsVsMedian: "X posts vs median",
|
|
488
511
|
payoutRatioPercent: "FY cash dividends / parent net income %",
|
|
@@ -961,7 +984,7 @@ export function pickerFields<Field extends { id: string }>(
|
|
|
961
984
|
}
|
|
962
985
|
|
|
963
986
|
/** Company KPIs, guidance, hiring and app attention: the server leaves them out of a screen for a caller without Gloom Pro. */
|
|
964
|
-
const PRO_FIELDS: ReadonlySet<string> = new Set([...KPI_FIELDS, ...HIRING_APP_FIELDS]);
|
|
987
|
+
const PRO_FIELDS: ReadonlySet<string> = new Set([...KPI_FIELDS, ...HIRING_APP_FIELDS, ...BUYBACK_FIELDS]);
|
|
965
988
|
const withheldMetric = (): ScreenMetric => ({ ...unavailableMetric(), reason: "Needs Gloom Pro", access: "pro" });
|
|
966
989
|
|
|
967
990
|
/**
|
|
@@ -1016,8 +1039,9 @@ export function validateScreenPayload(value: unknown): ScreenPayload {
|
|
|
1016
1039
|
ids.add(screenRowId(row));
|
|
1017
1040
|
for (const field of NUMERIC_FIELDS) {
|
|
1018
1041
|
// A server from before social, research, volatility, dividend, technical, option volatility, ownership, quality,
|
|
1019
|
-
// score or
|
|
1020
|
-
|
|
1042
|
+
// score, grade or trailing yield fields omits them; they read as unavailable. A Pro field it left out was held back
|
|
1043
|
+
// from this caller.
|
|
1044
|
+
if (!row.metrics[field] && ([...SOCIAL_FIELDS, ...RESEARCH_FIELDS, ...VOLATILITY_FIELDS, ...TECHNICAL_FIELDS, ...OPTION_VOLATILITY_FIELDS, ...OWNERSHIP_FIELDS, ...QUALITY_FIELDS, ...SCORE_FIELDS, ...GRADE_FIELDS, ...ATTENTION_FIELDS, ...HIRING_APP_FIELDS, ...KPI_FIELDS, ...DIVIDEND_FIELDS, ...TRAILING_YIELD_FIELDS, ...BUYBACK_FIELDS] as readonly string[]).includes(field))
|
|
1021
1045
|
row.metrics[field] = PRO_FIELDS.has(field) ? withheldMetric() : unavailableMetric();
|
|
1022
1046
|
const metric = row.metrics[field];
|
|
1023
1047
|
if (
|
|
@@ -108,7 +108,7 @@ import { liveScreenPlaces, overlayLiveScreenRows, placeLiveScreenRows, screenExt
|
|
|
108
108
|
import { useLiveQuoteEntries } from "../../../state/hooks/quote-streaming";
|
|
109
109
|
import { buildScreenerQuoteTargets } from "../../../market-data/quotes/screener-live-quotes";
|
|
110
110
|
import { useLiveStreamingSetting } from "../../../state/hooks/live-streaming";
|
|
111
|
-
import { getTableWidth } from "../../../components/ui/table-layout";
|
|
111
|
+
import { dropColumnsToFit, getTableWidth } from "../../../components/ui/table-layout";
|
|
112
112
|
|
|
113
113
|
/** How often a live sort re-reads the figures it orders by. */
|
|
114
114
|
const LIVE_ORDER_SAMPLE_MS = 5_000;
|
|
@@ -185,7 +185,7 @@ export function resultColumns(
|
|
|
185
185
|
const exchange = fits(build(compact.slice(0, shown), true, false, "compact"));
|
|
186
186
|
const sector = exchange && fits(build(compact.slice(0, shown), true, true, "compact"));
|
|
187
187
|
const named = build(extras("pane").slice(0, shown), exchange, sector, "pane");
|
|
188
|
-
return fits(named) ? named : build(compact.slice(0, shown), exchange, sector, "compact");
|
|
188
|
+
return fits(named) ? named : dropColumnsToFit(build(compact.slice(0, shown), exchange, sector, "compact"), width - 1, ["name", "percentile"]);
|
|
189
189
|
}
|
|
190
190
|
const loadFields = () => fetchScreenFields();
|
|
191
191
|
const criterionRowId = (row: { id: string }) => row.id;
|
|
@@ -236,7 +236,7 @@ function ScreenDetail({
|
|
|
236
236
|
<KeyValueRow
|
|
237
237
|
label={screenLabel(field)}
|
|
238
238
|
labelWidth={24}
|
|
239
|
-
value={screenDetailValue(field, metric)}
|
|
239
|
+
value={screenDetailValue(field, metric, row.quotedUnitDivisor)}
|
|
240
240
|
detail={
|
|
241
241
|
metric.value === null
|
|
242
242
|
? (reason ?? "unavailable")
|
|
@@ -252,7 +252,7 @@ function ScreenDetail({
|
|
|
252
252
|
<KeyValueRow
|
|
253
253
|
label={EXTENDED_SESSION_LABELS[extended.session]}
|
|
254
254
|
labelWidth={24}
|
|
255
|
-
value={`${formatScreenValue("price", extended.price)} ${row.metrics.price.unit}`}
|
|
255
|
+
value={`${formatScreenValue("price", extended.price, row.quotedUnitDivisor)} ${row.metrics.price.unit}`}
|
|
256
256
|
detail={`${formatPercentRaw(extended.changePercent)}${extended.mark ? " mid" : ""}`}
|
|
257
257
|
/>
|
|
258
258
|
) : null}
|
|
@@ -1127,7 +1127,7 @@ function EquityScreenView({
|
|
|
1127
1127
|
const sign = screenSignValue(field, observation.value);
|
|
1128
1128
|
const change = sign == null ? undefined : priceColor(sign, colors);
|
|
1129
1129
|
return {
|
|
1130
|
-
text: formatScreenMetric(field, observation),
|
|
1130
|
+
text: formatScreenMetric(field, observation, row.quotedUnitDivisor),
|
|
1131
1131
|
color: observation.state === "stale" ? colors.warning : change,
|
|
1132
1132
|
};
|
|
1133
1133
|
}
|
|
@@ -3,7 +3,28 @@ import { explainRefusal } from "../shared/cloud-denied";
|
|
|
3
3
|
import { DATE_OPTION_EXAMPLES } from "../../../utils/calendar-date";
|
|
4
4
|
import { fetchEstimates } from "./client";
|
|
5
5
|
import { estimateRevisionsLockNote } from "./lock-note";
|
|
6
|
-
import { estimateCurrent, periodLabel, pinnedEstimatePeriods } from "./model";
|
|
6
|
+
import { estimateCurrent, estimateDifference, estimateSurprise, periodLabel, pinnedEstimatePeriods } from "./model";
|
|
7
|
+
import type { EstimateSurprise } from "../../../api-client/estimate-revisions";
|
|
8
|
+
import { isNotMeaningful } from "../../../utils/growth";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* A report as the Surprises tab reads it: `percent` is the surprise the pane
|
|
12
|
+
* shows, the actual over the estimate (the source's own only when either is
|
|
13
|
+
* missing), and null with `percentNotMeaningful` against a loss or zero estimate;
|
|
14
|
+
* `difference` is its VS EST, the actual less the estimate.
|
|
15
|
+
*/
|
|
16
|
+
function surpriseRow(row: EstimateSurprise) {
|
|
17
|
+
const surprise = estimateSurprise(row);
|
|
18
|
+
const difference = estimateDifference(row);
|
|
19
|
+
return {
|
|
20
|
+
...row,
|
|
21
|
+
// Worked out from two cent figures, without the float's noise (2.10 - 1.98).
|
|
22
|
+
difference: difference == null ? null : Number(difference.toFixed(4)),
|
|
23
|
+
percent: typeof surprise === "number" ? Number((surprise * 100).toFixed(2)) : null,
|
|
24
|
+
...(isNotMeaningful(surprise) ? { percentNotMeaningful: true } : {}),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
7
28
|
export const estimateRevisionsHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
8
29
|
shape: "bundle",
|
|
9
30
|
freshness: { status: "not-a-feed", basis: "analyst estimates" },
|
|
@@ -88,7 +109,7 @@ export const estimateRevisionsHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
88
109
|
period.breadth.map((row) => ({ period: period.id, ...row })),
|
|
89
110
|
),
|
|
90
111
|
},
|
|
91
|
-
{ title: "Surprises", rows: data.surprises.map(
|
|
112
|
+
{ title: "Surprises", rows: data.surprises.map(surpriseRow) },
|
|
92
113
|
{
|
|
93
114
|
title: "Guidance",
|
|
94
115
|
rows: data.guidance ? [{ ...data.guidance }] : [],
|