gloomberb 0.16.1 → 0.16.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/package.json +2 -1
- package/src/api-client/beneficial-owners.ts +92 -0
- package/src/api-client/data.ts +26 -8
- package/src/api-client/errors.ts +12 -0
- package/src/api-client/geo.ts +363 -0
- package/src/api-client/index.ts +2 -0
- package/src/api-client/market-discovery.ts +10 -0
- package/src/api-client/paths.ts +30 -1
- package/src/api-client/perps.ts +37 -0
- package/src/api-client/request.ts +5 -2
- package/src/api-client/types.ts +2 -0
- package/src/brokers/account-cache.ts +24 -0
- package/src/cli/commands/command-utils.ts +8 -0
- package/src/cli/commands/crypto-hints.ts +75 -0
- package/src/cli/commands/market.ts +414 -106
- package/src/cli/commands/overview.ts +77 -32
- package/src/cli/commands/ticker.ts +101 -43
- package/src/cli/desktop-pane-shot.ts +34 -4
- package/src/cli/freshness.ts +61 -0
- package/src/cli/help.ts +1 -0
- package/src/cli/helpers.ts +4 -8
- package/src/cli/index.ts +12 -2
- package/src/cli/listing-arg.ts +321 -0
- package/src/cli/pane-functions/access-gate.ts +42 -0
- package/src/cli/pane-functions/catalog.ts +28 -1
- package/src/cli/pane-functions/data.ts +3 -1
- package/src/cli/pane-functions/dom.ts +20 -2
- package/src/cli/pane-functions/freshness.ts +400 -0
- package/src/cli/pane-functions/function-help.ts +27 -20
- package/src/cli/pane-functions/headless.ts +39 -11
- package/src/cli/pane-functions/index.ts +15 -4
- package/src/cli/pane-functions/options.ts +3 -0
- package/src/cli/pane-functions/report.ts +4 -0
- package/src/cli/pane-functions/resolver.ts +35 -7
- package/src/cli/pane-functions/screenshot-evidence.ts +2 -0
- package/src/cli/pane-functions/screenshot.ts +7 -3
- package/src/cli/result.ts +41 -27
- package/src/cli/ticker-resolution.ts +7 -5
- package/src/components/chart/composite/composite-chart.tsx +88 -2536
- package/src/components/chart/composite/drawing-store.ts +59 -0
- package/src/components/chart/composite/legend.tsx +319 -0
- package/src/components/chart/composite/panel-bitmap.ts +139 -0
- package/src/components/chart/composite/panel-gestures.ts +59 -0
- package/src/components/chart/composite/panel-labels.ts +107 -0
- package/src/components/chart/composite/panel-surface.tsx +876 -0
- package/src/components/chart/composite/tool-catalog.ts +98 -0
- package/src/components/chart/composite/toolbar.tsx +186 -0
- package/src/components/chart/composite/tools.ts +8 -0
- package/src/components/chart/composite/use-composite-chart-keyboard.ts +703 -0
- package/src/components/chart/composite/use-composite-viewport.ts +143 -0
- package/src/components/command-bar/list/model.ts +5 -0
- package/src/components/command-bar/list/view.tsx +16 -3
- package/src/components/command-bar/pane-templates/workflow.ts +1 -0
- package/src/components/command-bar/routes/ticker-search/actions.ts +5 -0
- package/src/components/command-bar/workflow/ops.ts +1 -1
- package/src/components/command-bar/workflow/tickers.ts +6 -0
- package/src/components/data-table/view.tsx +29 -10
- package/src/components/feedback-dialog.tsx +2 -1
- package/src/components/form-modal/field-row.tsx +2 -2
- package/src/components/layout/detached-pane-shell.tsx +6 -3
- package/src/components/layout/pane/content.tsx +23 -10
- package/src/components/layout/pane/error-boundary.tsx +103 -0
- package/src/components/layout/pane/footer/registration.tsx +68 -23
- package/src/components/layout/pane/header.tsx +11 -11
- package/src/components/layout/shell/menu.ts +2 -1
- package/src/components/layout/shell/pane/actions.ts +2 -1
- package/src/components/layout/shell/pane/layers.tsx +14 -3
- package/src/components/metric-treemap/heat-surface.tsx +43 -16
- package/src/components/metric-treemap/heat-tiles.ts +18 -0
- package/src/components/metric-treemap/layout.ts +2 -0
- package/src/components/onboarding/onboarding-keyboard.ts +311 -0
- package/src/components/onboarding/onboarding-wizard.tsx +101 -788
- package/src/components/onboarding/use-onboarding-broker-form.ts +263 -0
- package/src/components/onboarding/use-onboarding-progress.ts +298 -0
- package/src/components/onboarding/use-onboarding-upgrade.ts +83 -0
- package/src/components/ticker/list-table-view.tsx +13 -1
- package/src/components/ui/fields.tsx +8 -0
- package/src/components/ui/range-track.tsx +10 -3
- package/src/components/ui/status.tsx +8 -2
- package/src/components/ui/tabs.tsx +7 -4
- package/src/components/ui/text-prompt-dialog.tsx +4 -2
- package/src/data/config/store/normalize.ts +17 -1
- package/src/i18n/es.ts +19 -1
- package/src/i18n/ja.ts +19 -1
- package/src/i18n/ko.ts +19 -1
- package/src/i18n/zh-cn.ts +19 -1
- package/src/i18n/zh-tw.ts +19 -1
- package/src/market-data/coordinator/chart.ts +1 -1
- package/src/market-data/coordinator/quotes.ts +23 -4
- package/src/market-data/fx-closes.ts +72 -0
- package/src/market-data/market/freshness.ts +78 -6
- package/src/market-data/market/session-close-note.ts +57 -0
- package/src/market-data/market/status.ts +151 -0
- package/src/market-data/published-apac-sessions.ts +66 -0
- package/src/market-data/quotes/contributions.ts +2 -0
- package/src/market-data/quotes/resolution.ts +2 -0
- package/src/market-data/quotes/screener-live-quotes.ts +49 -4
- package/src/plugins/builtin/account-management/pane.tsx +4 -0
- package/src/plugins/builtin/alerts/cli.ts +10 -5
- package/src/plugins/builtin/alerts/index.tsx +1 -0
- package/src/plugins/builtin/analytics/metrics.ts +8 -3
- package/src/plugins/builtin/analytics/risk-client.ts +191 -66
- package/src/plugins/builtin/analytics/risk-fx.ts +102 -0
- package/src/plugins/builtin/analytics/risk-headless.ts +19 -13
- package/src/plugins/builtin/analytics/risk-model.ts +45 -17
- package/src/plugins/builtin/analytics/risk-pane.tsx +1 -0
- package/src/plugins/builtin/analytics/risk-test-data.ts +25 -1
- package/src/plugins/builtin/attention/headless.ts +6 -4
- package/src/plugins/builtin/attention/index.tsx +1 -1
- package/src/plugins/builtin/attention/pane.tsx +1 -1
- package/src/plugins/builtin/awards/headless.ts +1 -0
- package/src/plugins/builtin/awards/pane.tsx +1 -1
- package/src/plugins/builtin/backtest/headless.ts +1 -0
- package/src/plugins/builtin/bond-calculator/headless.ts +1 -0
- package/src/plugins/builtin/buildout/index.tsx +1 -0
- package/src/plugins/builtin/catalysts/headless.ts +3 -1
- package/src/plugins/builtin/cds/headless.ts +2 -0
- package/src/plugins/builtin/central-bank-rates/headless.ts +1 -0
- package/src/plugins/builtin/chart-composer/headless.ts +38 -3
- package/src/plugins/builtin/chart-composer/index.tsx +3 -1
- package/src/plugins/builtin/chart-composer/series-expression.ts +18 -2
- package/src/plugins/builtin/chat/channels.ts +19 -3
- package/src/plugins/builtin/chat/content/composer-runtime.ts +28 -13
- package/src/plugins/builtin/chat/content/footer.tsx +15 -6
- package/src/plugins/builtin/chat/content/index.tsx +120 -21
- package/src/plugins/builtin/chat/content/new-dm-dialog.tsx +261 -113
- package/src/plugins/builtin/chat/content/transcript.tsx +20 -2
- package/src/plugins/builtin/chat/direct-messages.ts +200 -0
- package/src/plugins/builtin/chat/index.tsx +1 -0
- package/src/plugins/builtin/chat/message/desktop.tsx +3 -0
- package/src/plugins/builtin/chat/message/header.tsx +16 -6
- package/src/plugins/builtin/chat/message/inline-tokens.tsx +72 -32
- package/src/plugins/builtin/chat/message/profile-popover.tsx +96 -12
- package/src/plugins/builtin/chat/message/terminal.tsx +3 -0
- package/src/plugins/builtin/chat/message/types.ts +14 -2
- package/src/plugins/builtin/chat/profile-popover.ts +18 -13
- package/src/plugins/builtin/clinical-trials/index.tsx +1 -0
- package/src/plugins/builtin/cloud/askg/executor.ts +2 -1
- package/src/plugins/builtin/cloud/plugin.tsx +1 -0
- package/src/plugins/builtin/cloud/team/module.tsx +1 -0
- package/src/plugins/builtin/cloud/thesis/module.tsx +1 -0
- package/src/plugins/builtin/cloud-tweets/registration.ts +1 -0
- package/src/plugins/builtin/comment-letters/index.tsx +1 -0
- package/src/plugins/builtin/company-attention/headless.ts +5 -1
- package/src/plugins/builtin/company-attention/pane.tsx +1 -1
- package/src/plugins/builtin/company-kpis/headless.ts +1 -0
- package/src/plugins/builtin/congress-trades/headless.ts +1 -0
- package/src/plugins/builtin/correlation/compute.ts +59 -16
- package/src/plugins/builtin/correlation/geo.ts +34 -0
- package/src/plugins/builtin/correlation/headless-schema.ts +4 -1
- package/src/plugins/builtin/correlation/headless.ts +42 -8
- package/src/plugins/builtin/correlation/history.ts +2 -0
- package/src/plugins/builtin/correlation/index.tsx +68 -14
- package/src/plugins/builtin/correlation/matrix/model.ts +17 -2
- package/src/plugins/builtin/correlation/matrix/selection.ts +5 -3
- package/src/plugins/builtin/correlation/relationship/model.ts +1 -1
- package/src/plugins/builtin/correlation/relationship/pane.tsx +4 -2
- package/src/plugins/builtin/correlation/relationship/view-model.ts +16 -1
- package/src/plugins/builtin/correlation/settings.ts +1 -1
- package/src/plugins/builtin/cot/headless.ts +6 -3
- package/src/plugins/builtin/cot/index.tsx +3 -3
- package/src/plugins/builtin/cot/model.ts +36 -3
- package/src/plugins/builtin/cpi/headless.ts +4 -0
- package/src/plugins/builtin/credit-boards/headless.ts +2 -0
- package/src/plugins/builtin/credit-conditions/headless.ts +1 -0
- package/src/plugins/builtin/credit-documents/gauge.tsx +5 -8
- package/src/plugins/builtin/credit-documents/headless.ts +2 -0
- package/src/plugins/builtin/crypto-board/headless.ts +3 -0
- package/src/plugins/builtin/custom-view/loader.ts +1 -1
- package/src/plugins/builtin/debt-maturities/headless.ts +4 -0
- package/src/plugins/builtin/dividend-yield/headless.ts +1 -0
- package/src/plugins/builtin/doe/headless.ts +7 -0
- package/src/plugins/builtin/doe/range-bar.tsx +7 -37
- package/src/plugins/builtin/earnings/headless.ts +5 -0
- package/src/plugins/builtin/earnings-calls/headless.ts +1 -0
- package/src/plugins/builtin/earnings-ripple/client.ts +91 -18
- package/src/plugins/builtin/earnings-ripple/headless.ts +28 -8
- package/src/plugins/builtin/earnings-ripple/index.tsx +2 -2
- package/src/plugins/builtin/earnings-ripple/model.ts +97 -7
- package/src/plugins/builtin/earnings-ripple/pane.tsx +148 -23
- package/src/plugins/builtin/econ/index.tsx +1 -0
- package/src/plugins/builtin/econ-statistics/headless.ts +2 -0
- package/src/plugins/builtin/equity-screener/headless.ts +2 -0
- package/src/plugins/builtin/estimate-revisions/headless.ts +1 -0
- package/src/plugins/builtin/executives/index.tsx +1 -0
- package/src/plugins/builtin/exposure/headless.ts +3 -1
- package/src/plugins/builtin/fear-greed/headless.ts +2 -0
- package/src/plugins/builtin/filing-events/index.tsx +1 -0
- package/src/plugins/builtin/futures-curve/client.ts +12 -3
- package/src/plugins/builtin/futures-curve/headless.ts +39 -10
- package/src/plugins/builtin/futures-curve/index.tsx +3 -3
- package/src/plugins/builtin/futures-curve/model.ts +188 -4
- package/src/plugins/builtin/futures-curve/pane.tsx +51 -9
- package/src/plugins/builtin/gpu/headless.ts +7 -3
- package/src/plugins/builtin/gpu/ladder.tsx +26 -30
- package/src/plugins/builtin/gpu/model.ts +27 -1
- package/src/plugins/builtin/holders/beneficial-client.ts +209 -0
- package/src/plugins/builtin/holders/beneficial-model.ts +279 -0
- package/src/plugins/builtin/holders/beneficial-report.ts +126 -0
- package/src/plugins/builtin/holders/beneficial-view.tsx +241 -0
- package/src/plugins/builtin/holders/headless.ts +139 -5
- package/src/plugins/builtin/holders/index.tsx +10 -3
- package/src/plugins/builtin/holders/pane.tsx +20 -3
- package/src/plugins/builtin/holders/report-header.ts +95 -0
- package/src/plugins/builtin/holders/table-model.ts +20 -5
- package/src/plugins/builtin/holders/thirteenf-match.ts +29 -1
- package/src/plugins/builtin/holders/types.ts +2 -1
- package/src/plugins/builtin/insider/headless.ts +2 -0
- package/src/plugins/builtin/ipo-calendar/headless.ts +1 -0
- package/src/plugins/builtin/iv-history/headless.ts +4 -1
- package/src/plugins/builtin/jobs/headless.ts +1 -0
- package/src/plugins/builtin/kelly-sizer/index.tsx +1 -0
- package/src/plugins/builtin/macro-day/headless.ts +2 -0
- package/src/plugins/builtin/market-halts/index.tsx +1 -0
- package/src/plugins/builtin/market-heatmap/data.ts +2 -0
- package/src/plugins/builtin/market-heatmap/headless.ts +135 -0
- package/src/plugins/builtin/market-heatmap/index.tsx +39 -46
- package/src/plugins/builtin/market-heatmap/model.ts +146 -0
- package/src/plugins/builtin/market-heatmap/portfolio.ts +23 -4
- package/src/plugins/builtin/market-movers/headless.ts +2 -0
- package/src/plugins/builtin/market-valuation/headless.ts +2 -0
- package/src/plugins/builtin/members/client.ts +20 -3
- package/src/plugins/builtin/members/headless.ts +5 -3
- package/src/plugins/builtin/members/model.ts +10 -2
- package/src/plugins/builtin/members/pane.tsx +13 -6
- package/src/plugins/builtin/mna/distress/headless.ts +1 -0
- package/src/plugins/builtin/mna/headless.ts +1 -0
- package/src/plugins/builtin/money-markets/headless.ts +1 -0
- package/src/plugins/builtin/news/headless.ts +2 -0
- package/src/plugins/builtin/news/wire/index.tsx +8 -1
- package/src/plugins/builtin/notes/cli.ts +14 -6
- package/src/plugins/builtin/notes/index.tsx +1 -0
- package/src/plugins/builtin/openfda/index.tsx +1 -0
- package/src/plugins/builtin/options-calculator/headless.ts +2 -0
- package/src/plugins/builtin/options-positioning/headless.ts +3 -0
- package/src/plugins/builtin/options-scenario/headless.ts +5 -0
- package/src/plugins/builtin/pe-band/client.ts +48 -3
- package/src/plugins/builtin/pe-band/headless.ts +25 -7
- package/src/plugins/builtin/pe-band/model.ts +92 -16
- package/src/plugins/builtin/pe-band/pane.tsx +33 -16
- package/src/plugins/builtin/perps/client.ts +50 -3
- package/src/plugins/builtin/perps/headless.ts +144 -16
- package/src/plugins/builtin/perps/index.tsx +6 -6
- package/src/plugins/builtin/perps/model.ts +189 -12
- package/src/plugins/builtin/perps/pane.tsx +248 -47
- package/src/plugins/builtin/portfolio-list/allocation.ts +245 -0
- package/src/plugins/builtin/portfolio-list/cached-account.ts +33 -0
- package/src/plugins/builtin/portfolio-list/cell-version.ts +19 -1
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +328 -29
- package/src/plugins/builtin/portfolio-list/cli/render.ts +230 -39
- package/src/plugins/builtin/portfolio-list/cli/shared.ts +67 -2
- package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +35 -31
- package/src/plugins/builtin/portfolio-list/column-values.ts +124 -47
- package/src/plugins/builtin/portfolio-list/headless.ts +98 -16
- package/src/plugins/builtin/portfolio-list/index.tsx +14 -3
- package/src/plugins/builtin/portfolio-list/live-valuation.ts +7 -5
- package/src/plugins/builtin/portfolio-list/mutations.ts +55 -1
- package/src/plugins/builtin/portfolio-list/pane/data.ts +6 -0
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +47 -13
- package/src/plugins/builtin/portfolio-list/settings.ts +33 -2
- package/src/plugins/builtin/portfolio-list/summary/index.tsx +24 -1
- package/src/plugins/builtin/portfolio-list/summary/totals.ts +26 -7
- package/src/plugins/builtin/power/headless.ts +3 -1
- package/src/plugins/builtin/rate-path/headless.ts +2 -0
- package/src/plugins/builtin/realized-vol/headless.ts +2 -0
- package/src/plugins/builtin/relative-rotation/headless.ts +2 -0
- package/src/plugins/builtin/research/analyst-headless.ts +3 -0
- package/src/plugins/builtin/research/events-headless.ts +2 -0
- package/src/plugins/builtin/research/headless.ts +2 -0
- package/src/plugins/builtin/research/index.tsx +1 -0
- package/src/plugins/builtin/research/relative-valuation-headless.ts +10 -5
- package/src/plugins/builtin/research/relative-valuation-model.ts +11 -3
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +3 -3
- package/src/plugins/builtin/research-search/index.tsx +1 -0
- package/src/plugins/builtin/revenue-breakdown/headless.ts +2 -0
- package/src/plugins/builtin/reverse-dcf/headless.ts +2 -0
- package/src/plugins/builtin/risk-factors/headless.ts +2 -0
- package/src/plugins/builtin/scanner/flow-history.ts +2 -13
- package/src/plugins/builtin/scanner/headless.ts +14 -0
- package/src/plugins/builtin/seasonality/headless.ts +2 -0
- package/src/plugins/builtin/sec/command-bar-search.ts +14 -4
- package/src/plugins/builtin/sec/filing-content.ts +42 -17
- package/src/plugins/builtin/sec/forms.ts +12 -0
- package/src/plugins/builtin/sec/headless.ts +2 -0
- package/src/plugins/builtin/sectors/client.ts +1 -0
- package/src/plugins/builtin/sectors/headless.ts +9 -1
- package/src/plugins/builtin/sectors/sector-model.ts +2 -0
- package/src/plugins/builtin/shared/crypto-pair.ts +14 -0
- package/src/plugins/builtin/shared/locked-rows.tsx +1 -1
- package/src/plugins/builtin/shared/report-freshness.ts +57 -0
- package/src/plugins/builtin/shared/research-cells.tsx +4 -9
- package/src/plugins/builtin/short-interest/headless.ts +2 -0
- package/src/plugins/builtin/short-interest/watch-headless.ts +1 -0
- package/src/plugins/builtin/short-volume/headless.ts +1 -0
- package/src/plugins/builtin/social-mentions/headless.ts +1 -0
- package/src/plugins/builtin/supply-chain/headless.ts +7 -1
- package/src/plugins/builtin/supply-chain/index.tsx +10 -1
- package/src/plugins/builtin/supply-chain/model.ts +27 -2
- package/src/plugins/builtin/supply-chain/pane.tsx +71 -32
- package/src/plugins/builtin/themes/headless.ts +3 -0
- package/src/plugins/builtin/thirteenf/headless.ts +110 -25
- package/src/plugins/builtin/thirteenf/report-notes.ts +149 -0
- package/src/plugins/builtin/ticker-detail/headless.ts +7 -1
- package/src/plugins/builtin/ticker-detail/index.tsx +1 -0
- package/src/plugins/builtin/ticker-detail/overview/model.ts +9 -2
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +26 -26
- package/src/plugins/builtin/time-sales/headless.ts +5 -1
- package/src/plugins/builtin/treasury-auctions/headless.ts +1 -0
- package/src/plugins/builtin/volatility/headless.ts +6 -1
- package/src/plugins/builtin/world-indices/headless.ts +2 -0
- package/src/plugins/builtin/world-venue-map/basemap-layer.tsx +157 -0
- package/src/plugins/builtin/world-venue-map/basemap.ts +214 -0
- package/src/plugins/builtin/world-venue-map/client.ts +45 -0
- package/src/plugins/builtin/world-venue-map/entity-detail.tsx +147 -0
- package/src/plugins/builtin/world-venue-map/entity-table.ts +59 -0
- package/src/plugins/builtin/world-venue-map/evidence.ts +77 -0
- package/src/plugins/builtin/world-venue-map/feed.ts +293 -0
- package/src/plugins/builtin/world-venue-map/geo-draw.tsx +248 -0
- package/src/plugins/builtin/world-venue-map/geo-series.ts +142 -0
- package/src/plugins/builtin/world-venue-map/geo-svg.tsx +447 -0
- package/src/plugins/builtin/world-venue-map/headless.ts +146 -0
- package/src/plugins/builtin/world-venue-map/ids.ts +1 -0
- package/src/plugins/builtin/world-venue-map/index.ts +67 -4
- package/src/plugins/builtin/world-venue-map/layered-pane.tsx +552 -0
- package/src/plugins/builtin/world-venue-map/layers.ts +348 -0
- package/src/plugins/builtin/world-venue-map/map-symbols.ts +220 -0
- package/src/plugins/builtin/world-venue-map/map.tsx +381 -45
- package/src/plugins/builtin/world-venue-map/model.ts +7 -4
- package/src/plugins/builtin/world-venue-map/natural-earth/index.chunk.ts +199 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e000n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e000n15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e000n30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e000n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e000n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e000n75.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e000s15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e000s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e000s60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e015n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e015n15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e015n30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e015n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e015n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e015n75.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e015s15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e015s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e015s45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e030n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e030n15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e030n30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e030n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e030n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e030n75.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e030s15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e030s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e030s45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e030s60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e045n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e045n15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e045n30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e045n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e045n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e045n75.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e045s15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e045s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e045s60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e060n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e060n15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e060n30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e060n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e060n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e060n75.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e060s15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e060s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e060s60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e075n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e075n15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e075n30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e075n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e075n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e075n75.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e075s45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e090n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e090n15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e090n30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e090n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e090n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e090n75.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e090s15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e105n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e105n15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e105n30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e105n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e105n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e105n75.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e105s15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e105s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e105s45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e120n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e120n15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e120n30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e120n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e120n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e120s15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e120s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e120s45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e135n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e135n15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e135n30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e135n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e135n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e135n75.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e135s15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e135s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e135s45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e150n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e150n15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e150n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e150n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e150n75.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e150s15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e150s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e150s45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e150s60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e165n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e165n15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e165n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e165n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e165s15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e165s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e165s45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e165s60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w015n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w015n15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w015n30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w015n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w015n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w015n75.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w015s15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w015s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w015s45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w030n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w030n15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w030n30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w030n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w030n75.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w030s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w030s60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w045n30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w045n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w045n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w045n75.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w045s15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w045s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w045s60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w060n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w060n30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w060n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w060n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w060n75.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w060s15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w060s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w060s45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w060s60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w075n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w075n15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w075n30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w075n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w075n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w075n75.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w075s15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w075s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w075s45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w075s60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w090n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w090n15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w090n30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w090n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w090n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w090n75.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w090s15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w090s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w090s45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w090s60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w105n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w105n15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w105n30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w105n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w105n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w105n75.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w105s15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w120n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w120n15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w120n30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w120n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w120n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w120n75.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w120s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w135n30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w135n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w135n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w135n75.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w135s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w150n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w150n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w150s15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w150s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w165n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w165n15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w165n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w165n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w165s15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w165s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w180n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w180n15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w180n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w180n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w180s15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w180s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w180s45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/world-50m.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/pane.tsx +28 -43
- package/src/plugins/builtin/world-venue-map/use-geo.ts +55 -0
- package/src/plugins/builtin/world-venue-map/venue-header.tsx +32 -0
- package/src/plugins/builtin/yield-curve/headless.ts +16 -0
- package/src/plugins/loader.ts +13 -1
- package/src/plugins/registry/pane-settings.ts +1 -0
- package/src/renderers/dom/build-assets.ts +81 -3
- package/src/renderers/dom/data-table/row.tsx +2 -0
- package/src/renderers/dom/desktop/controls.tsx +7 -3
- package/src/renderers/dom/desktop/list-view.tsx +35 -10
- package/src/renderers/dom/desktop/popover.tsx +73 -14
- package/src/renderers/dom/host/input.tsx +14 -3
- package/src/renderers/dom/styles.css +6 -7
- package/src/renderers/electrobun/view/backend-rpc.ts +10 -4
- package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +1 -0
- package/src/renderers/electrobun/view/rpc-timeout.ts +14 -3
- package/src/renderers/opentui/host.tsx +5 -0
- package/src/sources/gloomberb-cloud/index.ts +25 -4
- package/src/sources/gloomberb-cloud/normalizers.ts +27 -3
- package/src/sources/provider-router/cached-routes.ts +4 -1
- package/src/sources/provider-router/financials.ts +8 -7
- package/src/sources/provider-router/history.ts +15 -10
- package/src/sources/sec-registrant.ts +75 -0
- package/src/state/app/context/index.tsx +24 -8
- package/src/state/hooks/quote-streaming.ts +41 -26
- package/src/sync/core-contributors.ts +4 -0
- package/src/telemetry/crash-reports.ts +4 -1
- package/src/test-support/cli-context.ts +10 -2
- package/src/theme/heat-colors.ts +266 -84
- package/src/time-series/resolve.ts +1 -1
- package/src/time-series/use-chart-resolution.ts +1 -1
- package/src/types/context-menu.ts +6 -0
- package/src/types/data-provider.ts +2 -0
- package/src/types/financials.ts +3 -0
- package/src/types/headless.ts +79 -2
- package/src/types/plugin.ts +20 -1
- package/src/types/ticker.ts +15 -0
- package/src/ui/host.tsx +14 -0
- package/src/updater/index.ts +9 -11
- package/src/utils/async-deadline.ts +21 -0
- package/src/utils/cli-output.ts +5 -1
- package/src/utils/crypto-pair.ts +41 -0
- package/src/utils/currency-units.ts +14 -0
- package/src/utils/depositary-receipt.ts +26 -0
- package/src/utils/exchanges.ts +72 -0
- package/src/utils/fire-and-forget.ts +24 -0
- package/src/utils/format.ts +13 -0
- package/src/utils/price-earnings.ts +70 -3
- package/src/utils/price-history.ts +58 -13
- package/src/utils/rpc-timeout-error.ts +27 -0
- package/src/utils/sec.ts +13 -1
- package/src/utils/utc-time.ts +79 -0
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import type { RefObject } from "react";
|
|
2
|
+
import type {
|
|
3
|
+
GeoColumnFormat,
|
|
4
|
+
GeoEntityPayload,
|
|
5
|
+
GeoEntityRow,
|
|
6
|
+
GeoLayerInfo,
|
|
7
|
+
GeoPropValue,
|
|
8
|
+
GeoSeriesInfo,
|
|
9
|
+
GeoTickerLink,
|
|
10
|
+
} from "../../../api-client/geo";
|
|
11
|
+
import { ActionRow, DetailScrollBody, KeyValueRow, Section, StatGrid, type StatItem } from "../../../components";
|
|
12
|
+
import { useThemeColors } from "../../../theme/theme-context";
|
|
13
|
+
import { Box, Text, type ScrollBoxRenderable } from "../../../ui";
|
|
14
|
+
import { clipToDisplayWidth, displayWidth } from "../../../utils/format";
|
|
15
|
+
import { formatGeoValue, isChangeColumn, tickerLinkKey } from "./layers";
|
|
16
|
+
|
|
17
|
+
interface EntityDetailProps {
|
|
18
|
+
layer: GeoLayerInfo;
|
|
19
|
+
row: GeoEntityRow | null;
|
|
20
|
+
detail: GeoEntityPayload | null;
|
|
21
|
+
/** The entity's series, main one first. */
|
|
22
|
+
series: readonly GeoSeriesInfo[];
|
|
23
|
+
width: number;
|
|
24
|
+
now: number;
|
|
25
|
+
scrollRef: RefObject<ScrollBoxRenderable | null>;
|
|
26
|
+
onOpenTicker: (link: GeoTickerLink) => void;
|
|
27
|
+
onOpenSeries: (series: GeoSeriesInfo) => void;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const SHORT_KEYS = new Set(["mmsi", "imo", "iata", "icao", "id"]);
|
|
31
|
+
|
|
32
|
+
/** A number stored as a code (`shipType`, `navStatus`) means nothing on its own, so the detail leaves it out. */
|
|
33
|
+
function isNumericCode(key: string, value: GeoPropValue): boolean {
|
|
34
|
+
return typeof value === "number" && /(Type|Status|Code)$/.test(key);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** The unit a key carries that no column format draws: metres and degrees. */
|
|
38
|
+
function detailText(key: string, value: GeoPropValue, now: number): string {
|
|
39
|
+
if (typeof value === "number" && /Deg$/.test(key)) return `${Math.round(value)}°`;
|
|
40
|
+
if (typeof value === "number" && /[a-z]M$/.test(key)) return `${formatGeoValue(value, Number.isInteger(value) ? "int" : "decimal1", now)} m`;
|
|
41
|
+
return formatGeoValue(value, detailFormat(key, value), now);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** Detail fields carry no column format; the server puts units in the key (`lastSeen`, `importSharePct`). */
|
|
45
|
+
function detailFormat(key: string, value: GeoPropValue): GeoColumnFormat | undefined {
|
|
46
|
+
if (SHORT_KEYS.has(key.toLowerCase())) return "text";
|
|
47
|
+
if (typeof value === "string" && /(At|Seen|Time)$/.test(key)) return "datetime";
|
|
48
|
+
if (typeof value !== "number") return undefined;
|
|
49
|
+
if (/Pct$/.test(key)) return "percent1";
|
|
50
|
+
if (/Km$/.test(key)) return "km";
|
|
51
|
+
if (/Kn$/.test(key)) return "knots";
|
|
52
|
+
return Number.isInteger(value) ? "int" : "decimal1";
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** `lastSeen` reads "Last seen", `mmsi` reads "MMSI". */
|
|
56
|
+
function humanizeKey(key: string): string {
|
|
57
|
+
if (SHORT_KEYS.has(key.toLowerCase())) return key.toUpperCase();
|
|
58
|
+
// The unit suffix moves into the value: "importSharePct" reads "Import share", "lengthM" "Length".
|
|
59
|
+
const words = key.replace(/(Pct|Km|Kn|Deg|M)$/, "")
|
|
60
|
+
.replace(/([a-z0-9])([A-Z])/g, "$1 $2")
|
|
61
|
+
.replace(/([a-z])(\d)/g, "$1 $2")
|
|
62
|
+
.replace(/[_-]+/g, " ")
|
|
63
|
+
.trim()
|
|
64
|
+
.toLowerCase()
|
|
65
|
+
.replace(/\b(\d+)d\b/g, "$1D");
|
|
66
|
+
return words.charAt(0).toUpperCase() + words.slice(1);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function trailSpan(trail: GeoEntityPayload["trail"]): string | null {
|
|
70
|
+
if (!trail || trail.length < 2) return null;
|
|
71
|
+
const start = Date.parse(trail[0]![2]);
|
|
72
|
+
const end = Date.parse(trail.at(-1)![2]);
|
|
73
|
+
if (!Number.isFinite(start) || !Number.isFinite(end) || end <= start) return null;
|
|
74
|
+
const minutes = Math.round((end - start) / 60_000);
|
|
75
|
+
return minutes < 90 ? `Last ${minutes}m` : `Last ${Math.round(minutes / 60)}h`;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const VIA_WORDS: Record<GeoTickerLink["via"], string> = {
|
|
79
|
+
owner: "Owner",
|
|
80
|
+
operator: "Operator",
|
|
81
|
+
route: "Route",
|
|
82
|
+
sector: "Sector",
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
/** One row, one line: a label and what it is, clipped so a long note never wraps over the next row. */
|
|
86
|
+
function LinkRow({ label, detail, width, onPress }: { label: string; detail: string; width: number; onPress: () => void }) {
|
|
87
|
+
const colors = useThemeColors();
|
|
88
|
+
const room = Math.max(0, width - displayWidth(label) - 3);
|
|
89
|
+
return (
|
|
90
|
+
<ActionRow label={label} onPress={onPress} width={width}>
|
|
91
|
+
{room > 3 ? <Text fg={colors.textDim}>{clipToDisplayWidth(detail, room)}</Text> : null}
|
|
92
|
+
</ActionRow>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** One entity: its figures, the companies it links to, its series and the rest of its fields. */
|
|
97
|
+
export function EntityDetail({ layer, row, detail, series, width, now, scrollRef, onOpenTicker, onOpenSeries }: EntityDetailProps) {
|
|
98
|
+
const props: Record<string, GeoPropValue> = { ...row?.props, ...detail?.feature.props, ...detail?.detail };
|
|
99
|
+
const columns = layer.columns.filter((column) => column.key !== "label");
|
|
100
|
+
const shown = new Set(["label", ...columns.map((column) => column.key)]);
|
|
101
|
+
const figures: StatItem[] = columns.flatMap((column) => {
|
|
102
|
+
const value = formatGeoValue(props[column.key], column.format, now, isChangeColumn(column));
|
|
103
|
+
return value ? [{ id: column.key, label: column.label, value }] : [];
|
|
104
|
+
});
|
|
105
|
+
const tickers = detail?.feature.tickers ?? row?.tickers ?? [];
|
|
106
|
+
const track = trailSpan(detail?.trail);
|
|
107
|
+
const title = row?.label ?? detail?.feature.label;
|
|
108
|
+
// The stack header already names the entity, so a `name` field that repeats it is left out.
|
|
109
|
+
const rest = Object.entries(props).filter(([key, value]) => !shown.has(key) && value !== null && value !== "" && value !== title && !isNumericCode(key, value));
|
|
110
|
+
const innerWidth = Math.max(10, width - 2);
|
|
111
|
+
const labelWidth = Math.min(16, Math.max(8, ...rest.map(([key]) => displayWidth(humanizeKey(key)) + 1), track ? 6 : 0));
|
|
112
|
+
return (
|
|
113
|
+
<DetailScrollBody ref={scrollRef} resetScrollKey={`${layer.id}:${row?.id ?? detail?.feature.id ?? ""}`}>
|
|
114
|
+
{figures.length ? <StatGrid items={figures} width={innerWidth} /> : null}
|
|
115
|
+
{tickers.length ? (
|
|
116
|
+
<Section title="Linked Tickers" width={innerWidth}>
|
|
117
|
+
{tickers.map((link) => (
|
|
118
|
+
<LinkRow
|
|
119
|
+
key={`${tickerLinkKey(link)}:${link.via}`}
|
|
120
|
+
label={link.symbol}
|
|
121
|
+
detail={[VIA_WORDS[link.via] ?? link.via, link.confidence === "inferred" ? "inferred" : null, link.note ?? null].filter(Boolean).join(" · ")}
|
|
122
|
+
width={innerWidth}
|
|
123
|
+
onPress={() => onOpenTicker(link)}
|
|
124
|
+
/>
|
|
125
|
+
))}
|
|
126
|
+
</Section>
|
|
127
|
+
) : null}
|
|
128
|
+
{series.length ? (
|
|
129
|
+
<Section title="Series" width={innerWidth}>
|
|
130
|
+
{series.map((entry) => (
|
|
131
|
+
<LinkRow key={entry.id} label={entry.name} detail={entry.frequency} width={innerWidth} onPress={() => onOpenSeries(entry)} />
|
|
132
|
+
))}
|
|
133
|
+
</Section>
|
|
134
|
+
) : null}
|
|
135
|
+
{track || rest.length ? (
|
|
136
|
+
<Section title="Details" width={innerWidth}>
|
|
137
|
+
<Box flexDirection="column">
|
|
138
|
+
{track ? <KeyValueRow label="Track" value={track} width={innerWidth} labelWidth={labelWidth} /> : null}
|
|
139
|
+
{rest.map(([key, value]) => (
|
|
140
|
+
<KeyValueRow key={key} label={humanizeKey(key)} value={detailText(key, value, now)} width={innerWidth} labelWidth={labelWidth} />
|
|
141
|
+
))}
|
|
142
|
+
</Box>
|
|
143
|
+
</Section>
|
|
144
|
+
) : null}
|
|
145
|
+
</DetailScrollBody>
|
|
146
|
+
);
|
|
147
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/** The entity table: the layer's own columns fitted to the width, plus the linked ticker. */
|
|
2
|
+
import type { GeoColumn, GeoColumnFormat, GeoEntityRow } from "../../../api-client/geo";
|
|
3
|
+
import type { DataTableColumn } from "../../../components";
|
|
4
|
+
import { getTableWidth } from "../../../components/ui/table-layout";
|
|
5
|
+
import { columnValue, formatGeoValue, isChangeColumn, plainGeoValue } from "./layers";
|
|
6
|
+
|
|
7
|
+
export const TICKER_COLUMN_ID = "__ticker";
|
|
8
|
+
|
|
9
|
+
export type EntityColumn = DataTableColumn & {
|
|
10
|
+
geo: GeoColumn | null;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const FORMAT_WIDTH: Record<GeoColumnFormat, number> = {
|
|
14
|
+
text: 10,
|
|
15
|
+
int: 6,
|
|
16
|
+
decimal1: 6,
|
|
17
|
+
percent1: 6,
|
|
18
|
+
datetime: 7,
|
|
19
|
+
knots: 7,
|
|
20
|
+
km: 8,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const TICKER_WIDTH = 6;
|
|
24
|
+
const MIN_LABEL_WIDTH = 14;
|
|
25
|
+
|
|
26
|
+
/** A right-aligned text column is a code (an MMSI, an IMO number): kept only when there is room left. */
|
|
27
|
+
function isIdentifier(column: GeoColumn): boolean {
|
|
28
|
+
return column.align === "right" && (column.format ?? "text") === "text";
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The label first and the ticker last, then the layer's columns in its order
|
|
33
|
+
* while they fit, codes after everything else; a narrow pane keeps the label
|
|
34
|
+
* and the ticker.
|
|
35
|
+
*/
|
|
36
|
+
export function entityColumns(columns: readonly GeoColumn[], width: number): EntityColumn[] {
|
|
37
|
+
const [first, ...rest] = columns.length ? columns : [{ key: "label", label: "Name" } satisfies GeoColumn];
|
|
38
|
+
const label: EntityColumn = { id: first!.key, label: first!.label, width: MIN_LABEL_WIDTH, flexGrow: 1, align: "left", geo: first! };
|
|
39
|
+
const ticker: EntityColumn = { id: TICKER_COLUMN_ID, label: "Ticker", width: TICKER_WIDTH, align: "left", geo: null };
|
|
40
|
+
const fits = (candidate: EntityColumn[]) => getTableWidth(candidate) <= width;
|
|
41
|
+
const tail = fits([label, ticker]) ? [ticker] : [];
|
|
42
|
+
const picked = new Set<GeoColumn>();
|
|
43
|
+
const inOrder = () => rest.filter((column) => picked.has(column)).map((column): EntityColumn => ({
|
|
44
|
+
id: column.key, label: column.label, width: FORMAT_WIDTH[column.format ?? "text"], align: column.align ?? "left", geo: column,
|
|
45
|
+
}));
|
|
46
|
+
for (const column of [...rest.filter((entry) => !isIdentifier(entry)), ...rest.filter(isIdentifier)]) {
|
|
47
|
+
picked.add(column);
|
|
48
|
+
if (!fits([label, ...inOrder(), ...tail])) picked.delete(column);
|
|
49
|
+
}
|
|
50
|
+
const middle = inOrder();
|
|
51
|
+
const spare = Math.max(0, width - getTableWidth([label, ...middle, ...tail]));
|
|
52
|
+
return [{ ...label, width: MIN_LABEL_WIDTH + spare }, ...middle, ...tail];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** A cell's text and the plain value an export writes. */
|
|
56
|
+
export function entityCellText(row: GeoEntityRow, column: GeoColumn, now: number): { text: string; value: number | string | null } {
|
|
57
|
+
const raw = columnValue(row, column);
|
|
58
|
+
return { text: formatGeoValue(raw, column.format, now, isChangeColumn(column)), value: plainGeoValue(raw) };
|
|
59
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What `gloomberb shot MAP <layers>` certifies: the layers the map drew and
|
|
3
|
+
* what each held, so a capture taken before the features arrived is refused.
|
|
4
|
+
*/
|
|
5
|
+
import type { PaneScreenshotEvidenceHook } from "../../../cli/pane-functions/screenshot-evidence";
|
|
6
|
+
import { useRemoteUiNode } from "../../../remote/semantic-tree";
|
|
7
|
+
import { isRecord } from "../../../utils/guards";
|
|
8
|
+
import type { GeoLayerState } from "./feed";
|
|
9
|
+
import { WORLD_VENUE_MAP_PANE_ID } from "./ids";
|
|
10
|
+
import { parseLayerTokens } from "./layers";
|
|
11
|
+
|
|
12
|
+
interface WorldMapEvidenceLayer {
|
|
13
|
+
id: string;
|
|
14
|
+
phase: GeoLayerState["phase"];
|
|
15
|
+
features: number;
|
|
16
|
+
clusters: number;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface WorldMapEvidence {
|
|
20
|
+
kind: "world-map";
|
|
21
|
+
version: 1;
|
|
22
|
+
complete: boolean;
|
|
23
|
+
plottedValueCount: number;
|
|
24
|
+
tokens: string[];
|
|
25
|
+
layers: WorldMapEvidenceLayer[];
|
|
26
|
+
tableRows: number;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const SETTLED = new Set<GeoLayerState["phase"]>(["ready", "unavailable", "zoom", "locked", "error"]);
|
|
30
|
+
|
|
31
|
+
export function useWorldMapEvidence(tokens: readonly string[], states: readonly GeoLayerState[], tableRows: number, tableLoading: boolean) {
|
|
32
|
+
useRemoteUiNode({
|
|
33
|
+
role: "chart-data",
|
|
34
|
+
label: "Rendered world map layers",
|
|
35
|
+
getMetadata: () => {
|
|
36
|
+
const layers = states.map((state) => ({ id: state.layer.id, phase: state.phase, features: state.features.length, clusters: state.clusters.length }));
|
|
37
|
+
const complete = !tableLoading && states.every((state) => SETTLED.has(state.phase) && !state.loading);
|
|
38
|
+
return {
|
|
39
|
+
kind: "world-map",
|
|
40
|
+
version: 1,
|
|
41
|
+
complete,
|
|
42
|
+
ready: complete,
|
|
43
|
+
plottedValueCount: layers.reduce((sum, layer) => sum + layer.features + layer.clusters, 0) + tableRows,
|
|
44
|
+
tokens: [...tokens],
|
|
45
|
+
layers,
|
|
46
|
+
tableRows,
|
|
47
|
+
} satisfies WorldMapEvidence & { ready: boolean };
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function requestedTokens(request: Parameters<PaneScreenshotEvidenceHook["mismatches"]>[1]): string[] {
|
|
53
|
+
const fromOption = parseLayerTokens(request.resolved.options.layer);
|
|
54
|
+
return fromOption.length ? fromOption : parseLayerTokens(request.resolved.createOptions?.arg ?? "");
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export const worldMapScreenshotEvidence: PaneScreenshotEvidenceHook<WorldMapEvidence> = {
|
|
58
|
+
paneId: WORLD_VENUE_MAP_PANE_ID,
|
|
59
|
+
kind: "world-map",
|
|
60
|
+
label: "world map layers",
|
|
61
|
+
read(value) {
|
|
62
|
+
if (!isRecord(value) || value.kind !== "world-map" || value.version !== 1 || typeof value.complete !== "boolean"
|
|
63
|
+
|| !Number.isSafeInteger(value.plottedValueCount) || !Array.isArray(value.layers) || !Array.isArray(value.tokens)) return null;
|
|
64
|
+
return value as unknown as WorldMapEvidence;
|
|
65
|
+
},
|
|
66
|
+
mismatches(evidence, request) {
|
|
67
|
+
const asked = requestedTokens(request);
|
|
68
|
+
return asked.join(",") === evidence.tokens.join(",") ? [] : ["Map layers differ from the request"];
|
|
69
|
+
},
|
|
70
|
+
unavailable(evidence) {
|
|
71
|
+
if (!evidence) return ["world map layers"];
|
|
72
|
+
return evidence.layers.filter((layer) => layer.phase === "error").map((layer) => layer.id);
|
|
73
|
+
},
|
|
74
|
+
symbols() {
|
|
75
|
+
return [];
|
|
76
|
+
},
|
|
77
|
+
};
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Features for the layers on the map. Each layer asks for what the view
|
|
3
|
+
* covers, waits for the view to settle before asking again, drops an answer a
|
|
4
|
+
* newer request replaced, refreshes on its own cadence while the pane can be
|
|
5
|
+
* seen, and asks nothing below its minimum zoom or while it is unavailable.
|
|
6
|
+
*/
|
|
7
|
+
import { ApiRequestError } from "../../../api-client/errors";
|
|
8
|
+
import {
|
|
9
|
+
getGeoFeatures,
|
|
10
|
+
GEO_FEATURE_LIMIT,
|
|
11
|
+
type GeoCluster,
|
|
12
|
+
type GeoFeature,
|
|
13
|
+
type GeoLayerInfo,
|
|
14
|
+
type GeoRequest,
|
|
15
|
+
} from "../../../api-client/geo";
|
|
16
|
+
import { geoViewKey, MAX_RENDERED_CLUSTERS, MAX_RENDERED_FEATURES, type GeoView } from "./layers";
|
|
17
|
+
|
|
18
|
+
type GeoLayerPhase = "loading" | "ready" | "error" | "zoom" | "unavailable" | "locked";
|
|
19
|
+
|
|
20
|
+
export interface GeoLayerState {
|
|
21
|
+
layer: GeoLayerInfo;
|
|
22
|
+
phase: GeoLayerPhase;
|
|
23
|
+
/** Asking for a new view (or the first one); a timed refresh stays quiet. */
|
|
24
|
+
loading: boolean;
|
|
25
|
+
features: GeoFeature[];
|
|
26
|
+
clusters: GeoCluster[];
|
|
27
|
+
truncated: boolean;
|
|
28
|
+
asOf: string | null;
|
|
29
|
+
fetchedAt: number | null;
|
|
30
|
+
error: string | null;
|
|
31
|
+
/** The server's words for a layer that cannot serve right now. */
|
|
32
|
+
note: string | null;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
interface Timers {
|
|
36
|
+
setTimeout: (callback: () => void, ms: number) => unknown;
|
|
37
|
+
clearTimeout: (handle: unknown) => void;
|
|
38
|
+
now: () => number;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
interface FeedEntry {
|
|
42
|
+
state: GeoLayerState;
|
|
43
|
+
/** View the drawn features (or the request in flight) belong to. */
|
|
44
|
+
key: string | null;
|
|
45
|
+
controller: AbortController | null;
|
|
46
|
+
debounce: unknown;
|
|
47
|
+
refresh: unknown;
|
|
48
|
+
/** After a 429, nothing is asked before this time. */
|
|
49
|
+
blockedUntil: number;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface GeoFeedOptions {
|
|
53
|
+
debounceMs?: number;
|
|
54
|
+
timers?: Partial<Timers>;
|
|
55
|
+
/** Whether this viewer may read a layer; a Pro layer without Pro is drawn as locked. */
|
|
56
|
+
canAccess?: (layer: GeoLayerInfo) => boolean;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const DEFAULT_TIMERS: Timers = {
|
|
60
|
+
setTimeout: (callback, ms) => globalThis.setTimeout(callback, ms),
|
|
61
|
+
clearTimeout: (handle) => globalThis.clearTimeout(handle as ReturnType<typeof setTimeout>),
|
|
62
|
+
now: () => Date.now(),
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
function isAbort(error: unknown): boolean {
|
|
66
|
+
return error instanceof DOMException ? error.name === "AbortError" : (error as { name?: string } | null)?.name === "AbortError";
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export class GeoLayerFeed {
|
|
70
|
+
private readonly entries = new Map<string, FeedEntry>();
|
|
71
|
+
private readonly timers: Timers;
|
|
72
|
+
private readonly debounceMs: number;
|
|
73
|
+
private readonly canAccess: (layer: GeoLayerInfo) => boolean;
|
|
74
|
+
private view: GeoView | null = null;
|
|
75
|
+
private active = true;
|
|
76
|
+
private snapshotCache: GeoLayerState[] | null = null;
|
|
77
|
+
|
|
78
|
+
constructor(
|
|
79
|
+
private readonly request: GeoRequest,
|
|
80
|
+
private readonly onChange: () => void,
|
|
81
|
+
options: GeoFeedOptions = {},
|
|
82
|
+
) {
|
|
83
|
+
this.timers = { ...DEFAULT_TIMERS, ...options.timers };
|
|
84
|
+
this.debounceMs = options.debounceMs ?? 250;
|
|
85
|
+
this.canAccess = options.canAccess ?? (() => true);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** The layers on, in drawing order. */
|
|
89
|
+
snapshot(): GeoLayerState[] {
|
|
90
|
+
this.snapshotCache ??= [...this.entries.values()].map((entry) => entry.state);
|
|
91
|
+
return this.snapshotCache;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
update(layers: readonly GeoLayerInfo[], view: GeoView, active: boolean): void {
|
|
95
|
+
const viewChanged = !this.view || geoViewKey(this.view) !== geoViewKey(view);
|
|
96
|
+
const resumed = active && !this.active;
|
|
97
|
+
this.view = view;
|
|
98
|
+
this.active = active;
|
|
99
|
+
const ids = new Set(layers.map((layer) => layer.id));
|
|
100
|
+
for (const [id, entry] of this.entries) {
|
|
101
|
+
if (ids.has(id)) continue;
|
|
102
|
+
this.stop(entry);
|
|
103
|
+
this.entries.delete(id);
|
|
104
|
+
this.changed();
|
|
105
|
+
}
|
|
106
|
+
for (const layer of layers) {
|
|
107
|
+
const existing = this.entries.get(layer.id);
|
|
108
|
+
const entry = existing ?? this.create(layer);
|
|
109
|
+
if (!existing) this.entries.set(layer.id, entry);
|
|
110
|
+
entry.state = { ...entry.state, layer };
|
|
111
|
+
this.plan(entry, view, { fresh: !existing, viewChanged, resumed });
|
|
112
|
+
}
|
|
113
|
+
this.reorder(layers);
|
|
114
|
+
this.changed();
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/** Aborts and forgets everything; a later update starts over. */
|
|
118
|
+
dispose(): void {
|
|
119
|
+
for (const entry of this.entries.values()) this.stop(entry);
|
|
120
|
+
this.entries.clear();
|
|
121
|
+
this.view = null;
|
|
122
|
+
this.snapshotCache = null;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
private create(layer: GeoLayerInfo): FeedEntry {
|
|
126
|
+
return {
|
|
127
|
+
state: { layer, phase: "loading", loading: false, features: [], clusters: [], truncated: false, asOf: layer.asOf, fetchedAt: null, error: null, note: null },
|
|
128
|
+
key: null,
|
|
129
|
+
controller: null,
|
|
130
|
+
debounce: null,
|
|
131
|
+
refresh: null,
|
|
132
|
+
blockedUntil: 0,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
private reorder(layers: readonly GeoLayerInfo[]): void {
|
|
137
|
+
const ordered = layers.map((layer) => [layer.id, this.entries.get(layer.id)!] as const);
|
|
138
|
+
this.entries.clear();
|
|
139
|
+
for (const [id, entry] of ordered) this.entries.set(id, entry);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
private plan(entry: FeedEntry, view: GeoView, change: { fresh: boolean; viewChanged: boolean; resumed: boolean }): void {
|
|
143
|
+
const { layer } = entry.state;
|
|
144
|
+
if (layer.status === "unavailable" || !this.canAccess(layer)) {
|
|
145
|
+
this.stop(entry);
|
|
146
|
+
entry.key = null;
|
|
147
|
+
entry.state = { ...entry.state, phase: layer.status === "unavailable" ? "unavailable" : "locked", loading: false, features: [], clusters: [], truncated: false, error: null };
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
if (layer.minZoom !== undefined && view.zoom < layer.minZoom) {
|
|
151
|
+
this.stop(entry);
|
|
152
|
+
entry.key = null;
|
|
153
|
+
entry.state = { ...entry.state, phase: "zoom", loading: false, features: [], clusters: [], truncated: false, error: null };
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
const key = geoViewKey(view);
|
|
157
|
+
if (!this.active) {
|
|
158
|
+
// Hidden: keep what is drawn, ask nothing, and catch up on return.
|
|
159
|
+
this.clearRefresh(entry);
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
if (entry.key === key && !change.resumed) return;
|
|
163
|
+
if (entry.key === key && change.resumed) {
|
|
164
|
+
if (this.isDue(entry)) this.fetch(entry, key, true);
|
|
165
|
+
else this.scheduleRefresh(entry);
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
// A new view supersedes whatever was in flight for the old one.
|
|
169
|
+
this.abort(entry);
|
|
170
|
+
this.clearRefresh(entry);
|
|
171
|
+
if (entry.debounce !== null) this.timers.clearTimeout(entry.debounce);
|
|
172
|
+
entry.debounce = null;
|
|
173
|
+
entry.key = key;
|
|
174
|
+
// A layer just turned on asks at once; a moving view waits until it settles.
|
|
175
|
+
if (change.fresh || !change.viewChanged) {
|
|
176
|
+
this.fetch(entry, key);
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
entry.state = { ...entry.state, loading: true };
|
|
180
|
+
entry.debounce = this.timers.setTimeout(() => {
|
|
181
|
+
entry.debounce = null;
|
|
182
|
+
this.fetch(entry, key);
|
|
183
|
+
}, this.debounceMs);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
private isDue(entry: FeedEntry): boolean {
|
|
187
|
+
const seconds = entry.state.layer.refreshSeconds;
|
|
188
|
+
if (!seconds || entry.state.fetchedAt === null) return entry.state.fetchedAt === null;
|
|
189
|
+
return this.timers.now() - entry.state.fetchedAt >= seconds * 1000;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
private fetch(entry: FeedEntry, key: string, silent = false): void {
|
|
193
|
+
const view = this.view;
|
|
194
|
+
if (!view) return;
|
|
195
|
+
this.abort(entry);
|
|
196
|
+
this.clearRefresh(entry);
|
|
197
|
+
const wait = entry.blockedUntil - this.timers.now();
|
|
198
|
+
if (wait > 0) {
|
|
199
|
+
entry.refresh = this.timers.setTimeout(() => {
|
|
200
|
+
entry.refresh = null;
|
|
201
|
+
if (entry.key === key) this.fetch(entry, key, silent);
|
|
202
|
+
}, wait);
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
const controller = new AbortController();
|
|
206
|
+
entry.controller = controller;
|
|
207
|
+
if (!silent || entry.state.fetchedAt === null) {
|
|
208
|
+
entry.state = { ...entry.state, loading: true, phase: entry.state.fetchedAt === null ? "loading" : entry.state.phase };
|
|
209
|
+
this.changed();
|
|
210
|
+
}
|
|
211
|
+
const layerId = entry.state.layer.id;
|
|
212
|
+
getGeoFeatures(this.request, layerId, { bbox: view.bbox, zoom: view.zoom, limit: GEO_FEATURE_LIMIT }, controller.signal)
|
|
213
|
+
.then((payload) => {
|
|
214
|
+
if (controller.signal.aborted || entry.controller !== controller || entry.key !== key) return;
|
|
215
|
+
entry.controller = null;
|
|
216
|
+
// A layer the catalog listed can still answer that it cannot serve (no positions yet).
|
|
217
|
+
if (payload.status === "unavailable") {
|
|
218
|
+
entry.state = { ...entry.state, phase: "unavailable", loading: false, features: [], clusters: [], truncated: false, fetchedAt: this.timers.now(), error: null, note: payload.statusNote ?? null };
|
|
219
|
+
this.scheduleRefresh(entry);
|
|
220
|
+
this.changed();
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
entry.state = {
|
|
224
|
+
...entry.state,
|
|
225
|
+
phase: "ready",
|
|
226
|
+
loading: false,
|
|
227
|
+
note: payload.status === "partial" ? payload.statusNote ?? null : null,
|
|
228
|
+
features: (payload.features ?? []).slice(0, MAX_RENDERED_FEATURES),
|
|
229
|
+
clusters: (payload.clusters ?? []).slice(0, MAX_RENDERED_CLUSTERS),
|
|
230
|
+
truncated: payload.truncated === true || (payload.features?.length ?? 0) > MAX_RENDERED_FEATURES,
|
|
231
|
+
asOf: payload.asOf ?? entry.state.layer.asOf,
|
|
232
|
+
fetchedAt: this.timers.now(),
|
|
233
|
+
error: null,
|
|
234
|
+
};
|
|
235
|
+
this.scheduleRefresh(entry);
|
|
236
|
+
this.changed();
|
|
237
|
+
})
|
|
238
|
+
.catch((error: unknown) => {
|
|
239
|
+
if (controller.signal.aborted || entry.controller !== controller || isAbort(error)) return;
|
|
240
|
+
entry.controller = null;
|
|
241
|
+
if (error instanceof ApiRequestError && error.status === 403) {
|
|
242
|
+
entry.state = { ...entry.state, phase: "locked", loading: false, features: [], clusters: [], truncated: false, error: null };
|
|
243
|
+
this.changed();
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
// Keep drawn features through a failed refresh; the footer says it failed.
|
|
247
|
+
entry.state = {
|
|
248
|
+
...entry.state,
|
|
249
|
+
phase: entry.state.fetchedAt === null ? "error" : entry.state.phase,
|
|
250
|
+
loading: false,
|
|
251
|
+
error: error instanceof Error ? error.message : String(error),
|
|
252
|
+
};
|
|
253
|
+
// Over the request limit: wait as long as the server asks before trying again.
|
|
254
|
+
const backoff = error instanceof ApiRequestError && error.status === 429 ? error.retryAfterMs ?? 30_000 : null;
|
|
255
|
+
if (backoff !== null) entry.blockedUntil = this.timers.now() + backoff;
|
|
256
|
+
this.scheduleRefresh(entry, backoff);
|
|
257
|
+
this.changed();
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
private scheduleRefresh(entry: FeedEntry, retryAfterMs: number | null = null): void {
|
|
262
|
+
this.clearRefresh(entry);
|
|
263
|
+
const seconds = entry.state.layer.refreshSeconds;
|
|
264
|
+
if ((!seconds && retryAfterMs === null) || !this.active) return;
|
|
265
|
+
const key = entry.key;
|
|
266
|
+
entry.refresh = this.timers.setTimeout(() => {
|
|
267
|
+
entry.refresh = null;
|
|
268
|
+
if (key && entry.key === key) this.fetch(entry, key, true);
|
|
269
|
+
}, Math.max(retryAfterMs ?? 0, (seconds ?? 0) * 1000));
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
private clearRefresh(entry: FeedEntry): void {
|
|
273
|
+
if (entry.refresh !== null) this.timers.clearTimeout(entry.refresh);
|
|
274
|
+
entry.refresh = null;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
private abort(entry: FeedEntry): void {
|
|
278
|
+
entry.controller?.abort();
|
|
279
|
+
entry.controller = null;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
private stop(entry: FeedEntry): void {
|
|
283
|
+
this.abort(entry);
|
|
284
|
+
this.clearRefresh(entry);
|
|
285
|
+
if (entry.debounce !== null) this.timers.clearTimeout(entry.debounce);
|
|
286
|
+
entry.debounce = null;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
private changed(): void {
|
|
290
|
+
this.snapshotCache = null;
|
|
291
|
+
this.onChange();
|
|
292
|
+
}
|
|
293
|
+
}
|