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,876 @@
|
|
|
1
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
2
|
+
import {
|
|
3
|
+
Box,
|
|
4
|
+
ChartSurface,
|
|
5
|
+
Text,
|
|
6
|
+
useNativeRenderer,
|
|
7
|
+
useUiCapabilities,
|
|
8
|
+
type BoxRenderable,
|
|
9
|
+
type ChartSurfaceProps,
|
|
10
|
+
} from "../../../ui";
|
|
11
|
+
import { colors as themeColors } from "../../../theme/colors";
|
|
12
|
+
import { consumeChartMouseEvent, getGlobalMouseX, getLocalPlotPointer, type ChartMouseEvent } from "../core/pointer";
|
|
13
|
+
import { useStaticChartBitmapSize } from "./bitmap";
|
|
14
|
+
import { PriceAxisLabels } from "./price-axis-labels";
|
|
15
|
+
import { formatCompositeCursorValue, type CompositeAxisValueFormatter } from "./format";
|
|
16
|
+
import {
|
|
17
|
+
compositeViewportPositions,
|
|
18
|
+
resolveCompositeWheelPan,
|
|
19
|
+
resolveCompositeWheelZoom,
|
|
20
|
+
type CompositeNavigationFrame,
|
|
21
|
+
type CompositeViewportRange,
|
|
22
|
+
} from "./interactions";
|
|
23
|
+
import { buildCompositeColumnLayout } from "./column-layout";
|
|
24
|
+
import {
|
|
25
|
+
fitAxisLabels,
|
|
26
|
+
hitTestLevel,
|
|
27
|
+
levelGrabRatio,
|
|
28
|
+
levelVectors,
|
|
29
|
+
paintLevels,
|
|
30
|
+
projectLevels,
|
|
31
|
+
roundLevelValue,
|
|
32
|
+
writeLevelText,
|
|
33
|
+
type CompositeChartLevels,
|
|
34
|
+
type ProjectedLevel,
|
|
35
|
+
} from "./levels";
|
|
36
|
+
import {
|
|
37
|
+
buildChartToolVectors,
|
|
38
|
+
countMeasureBars,
|
|
39
|
+
drawChartToolOverlay,
|
|
40
|
+
resolveChartToolKind,
|
|
41
|
+
resolveMeasureAxisDomain,
|
|
42
|
+
resolveMeasureDirection,
|
|
43
|
+
hitTestDrawings,
|
|
44
|
+
isDrawingTool,
|
|
45
|
+
resolveDrawingFromDrag,
|
|
46
|
+
resolveZoomBoxRange,
|
|
47
|
+
shiftDrawing,
|
|
48
|
+
summarizeMeasure,
|
|
49
|
+
summarizeZoomRange,
|
|
50
|
+
summarizeZoomSelection,
|
|
51
|
+
type ChartDrawing,
|
|
52
|
+
type ChartToolDrag,
|
|
53
|
+
type ChartToolKind,
|
|
54
|
+
type ChartToolSpan,
|
|
55
|
+
} from "./tools";
|
|
56
|
+
import { compositeRightOffsetRatio, unprojectCompositeTimestamp } from "./time-scale";
|
|
57
|
+
import { resolveCompositeCursorDate, unprojectCompositeValue } from "./scene";
|
|
58
|
+
import { compositeAxisTickLabels, renderCompositeAxisText, renderCompositePanelText } from "./text-renderer";
|
|
59
|
+
import type { CompositeChartColors, CompositeChartScene, CompositePanelScene } from "./types";
|
|
60
|
+
import { useCompositePanelBitmap } from "./panel-bitmap";
|
|
61
|
+
import { nextDrawingId, nextLevelId } from "./drawing-store";
|
|
62
|
+
import {
|
|
63
|
+
COMPOSITE_PANEL_ROLE,
|
|
64
|
+
isVerticalWheelDirection,
|
|
65
|
+
startPanGesture,
|
|
66
|
+
releaseEditableFocus,
|
|
67
|
+
type PanGesture,
|
|
68
|
+
type PendingWheel,
|
|
69
|
+
} from "./panel-gestures";
|
|
70
|
+
import { resolvePanelCrosshair, axisLabelRows, cursorAxisLabel, resolveSeriesCursorYRatio } from "./panel-labels";
|
|
71
|
+
import type { KeyboardToolDrag } from "./use-composite-chart-keyboard";
|
|
72
|
+
|
|
73
|
+
const webFrame = globalThis as typeof globalThis & {
|
|
74
|
+
requestAnimationFrame?: (callback: () => void) => number;
|
|
75
|
+
cancelAnimationFrame?: (handle: number) => void;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const NO_LEVELS: readonly ProjectedLevel[] = [];
|
|
79
|
+
|
|
80
|
+
interface CompositePanelSurfaceProps {
|
|
81
|
+
panel: CompositePanelScene;
|
|
82
|
+
scene: CompositeChartScene;
|
|
83
|
+
plotWidth: number;
|
|
84
|
+
leftAxisWidth: number;
|
|
85
|
+
rightAxisWidth: number;
|
|
86
|
+
axisGap: number;
|
|
87
|
+
colors: CompositeChartColors;
|
|
88
|
+
interactive: boolean;
|
|
89
|
+
/** False keeps the hover cursor but removes pan, zoom, and the tools. */
|
|
90
|
+
navigable: boolean;
|
|
91
|
+
formatAxisValue?: CompositeAxisValueFormatter;
|
|
92
|
+
remoteKind?: string;
|
|
93
|
+
viewport: CompositeViewportRange;
|
|
94
|
+
frame: CompositeNavigationFrame;
|
|
95
|
+
armedTool: ChartToolKind | null;
|
|
96
|
+
drawings: readonly ChartDrawing[];
|
|
97
|
+
selectedDrawingId: string | null;
|
|
98
|
+
drawColor: string;
|
|
99
|
+
onDraw: (drawing: ChartDrawing) => void;
|
|
100
|
+
onEditDrawing: (id: string, update: (drawing: ChartDrawing) => ChartDrawing) => void;
|
|
101
|
+
onSelectDrawing: (id: string | null) => void;
|
|
102
|
+
onActivate?: () => void;
|
|
103
|
+
onCursorDateChange: (date: Date | null) => void;
|
|
104
|
+
/** Positive positions move toward older observations. A gesture supplies the frame and origin it started from. */
|
|
105
|
+
onPanViewport: (
|
|
106
|
+
deltaPositions: number,
|
|
107
|
+
gesture?: { frame: CompositeNavigationFrame; from: CompositeViewportRange },
|
|
108
|
+
) => void;
|
|
109
|
+
onZoomViewport: (zoomFactor: number, anchorRatio: number) => void;
|
|
110
|
+
onSetViewport: (range: CompositeViewportRange) => void;
|
|
111
|
+
onToolSpanChange: (span: ChartToolSpan | null) => void;
|
|
112
|
+
/** The tool being placed from the keyboard, when it lives in this panel. */
|
|
113
|
+
keyboardToolDrag: KeyboardToolDrag | null;
|
|
114
|
+
/** A press on the plot: the pointer takes over from a keyboard placement. */
|
|
115
|
+
onPointerPress: () => void;
|
|
116
|
+
showTextFallback: boolean;
|
|
117
|
+
/** Set while the owner is picking a bar: a press picks instead of panning. */
|
|
118
|
+
onPickTime?: (date: Date) => void;
|
|
119
|
+
/** The chart's levels when they draw on this panel. */
|
|
120
|
+
levels: CompositeChartLevels | null;
|
|
121
|
+
selectedLevelId: string | null;
|
|
122
|
+
onSelectLevel: (id: string | null) => void;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export function CompositePanelSurface({
|
|
126
|
+
panel,
|
|
127
|
+
scene,
|
|
128
|
+
plotWidth,
|
|
129
|
+
leftAxisWidth,
|
|
130
|
+
rightAxisWidth,
|
|
131
|
+
axisGap,
|
|
132
|
+
colors,
|
|
133
|
+
interactive,
|
|
134
|
+
navigable,
|
|
135
|
+
formatAxisValue,
|
|
136
|
+
remoteKind,
|
|
137
|
+
viewport,
|
|
138
|
+
frame,
|
|
139
|
+
armedTool,
|
|
140
|
+
drawings,
|
|
141
|
+
selectedDrawingId,
|
|
142
|
+
drawColor,
|
|
143
|
+
onDraw,
|
|
144
|
+
onEditDrawing,
|
|
145
|
+
onSelectDrawing,
|
|
146
|
+
onActivate,
|
|
147
|
+
onCursorDateChange,
|
|
148
|
+
onPanViewport,
|
|
149
|
+
onZoomViewport,
|
|
150
|
+
onSetViewport,
|
|
151
|
+
onToolSpanChange,
|
|
152
|
+
keyboardToolDrag,
|
|
153
|
+
onPointerPress,
|
|
154
|
+
showTextFallback,
|
|
155
|
+
onPickTime,
|
|
156
|
+
levels,
|
|
157
|
+
selectedLevelId,
|
|
158
|
+
onSelectLevel,
|
|
159
|
+
}: CompositePanelSurfaceProps) {
|
|
160
|
+
const isDesktopWeb = useUiCapabilities().nativePaneChrome === true;
|
|
161
|
+
const { cellHeightPx = 18, cellWidthPx = 8, fractionalViewport = false } = useUiCapabilities();
|
|
162
|
+
const renderer = useNativeRenderer();
|
|
163
|
+
const plotRef = useRef<BoxRenderable | null>(null);
|
|
164
|
+
const [cursorYRatio, setCursorYRatio] = useState<number | null>(null);
|
|
165
|
+
const [toolDrag, setToolDrag] = useState<ChartToolDrag | null>(null);
|
|
166
|
+
// A pointer drag owns the plot while it lasts; otherwise a tool placed from
|
|
167
|
+
// the keyboard draws and reads out exactly like one.
|
|
168
|
+
const keyboardDrag = toolDrag ? null : keyboardToolDrag;
|
|
169
|
+
const activeDrag = toolDrag ?? keyboardDrag?.drag ?? null;
|
|
170
|
+
// A keyboard placement's end sits at the level the user put it, so it
|
|
171
|
+
// draws a level line where otherwise only the pointer would.
|
|
172
|
+
const heldCursorYRatio = keyboardDrag ? keyboardDrag.drag.endYRatio : cursorYRatio;
|
|
173
|
+
const seriesCursorYRatio = useMemo(
|
|
174
|
+
() => resolveSeriesCursorYRatio(panel, scene),
|
|
175
|
+
[panel, scene],
|
|
176
|
+
);
|
|
177
|
+
const activeCursorYRatio = scene.cursorXRatio === null
|
|
178
|
+
? null
|
|
179
|
+
: heldCursorYRatio ?? seriesCursorYRatio;
|
|
180
|
+
const dragRef = useRef<
|
|
181
|
+
| PanGesture
|
|
182
|
+
| {
|
|
183
|
+
kind: "edit";
|
|
184
|
+
drawingId: string;
|
|
185
|
+
pointIndex: number | null;
|
|
186
|
+
lastXRatio: number;
|
|
187
|
+
lastYRatio: number;
|
|
188
|
+
}
|
|
189
|
+
| { kind: "level-move"; id: string }
|
|
190
|
+
| ChartToolDrag
|
|
191
|
+
| null
|
|
192
|
+
>(null);
|
|
193
|
+
const plotAspect = (plotWidth * cellWidthPx) / Math.max(panel.height * cellHeightPx, 1);
|
|
194
|
+
// The plot is wider than the viewport by the reserved right offset. Gestures
|
|
195
|
+
// read the pointer in plot space, so they convert through this.
|
|
196
|
+
const plotSpanFactor = 1 + compositeRightOffsetRatio(scene.timeScale);
|
|
197
|
+
const bitmapSize = useStaticChartBitmapSize(plotWidth, panel.height);
|
|
198
|
+
const bitmap = useCompositePanelBitmap({ panel, bitmapSize, colors, isDesktopWeb });
|
|
199
|
+
const columnLayout = useMemo(() => buildCompositeColumnLayout(panel), [panel]);
|
|
200
|
+
// The level line follows the pointer only. A keyboard or shared cursor knows
|
|
201
|
+
// its column, and the series markers and axis readout already say the value.
|
|
202
|
+
// A tool placed from the keyboard is the exception: its end is a level.
|
|
203
|
+
const pointerCursorYRatio = scene.cursorXRatio === null ? null : heldCursorYRatio;
|
|
204
|
+
const crosshair = useMemo(
|
|
205
|
+
() => resolvePanelCrosshair(panel, columnLayout, bitmap, scene.cursorXRatio, pointerCursorYRatio, colors.crosshair),
|
|
206
|
+
[bitmap, colors.crosshair, columnLayout, panel, pointerCursorYRatio, scene.cursorXRatio],
|
|
207
|
+
);
|
|
208
|
+
const measureDomain = useMemo(() => resolveMeasureAxisDomain(panel), [panel]);
|
|
209
|
+
const toolReadout = useMemo(() => {
|
|
210
|
+
if (!activeDrag) return null;
|
|
211
|
+
// A keyboard placement knows its data points exactly, even off screen; a
|
|
212
|
+
// pointer drag reads them back from the plot.
|
|
213
|
+
const startTime = keyboardDrag?.start.time
|
|
214
|
+
?? unprojectCompositeTimestamp(scene.timeScale, activeDrag.startXRatio);
|
|
215
|
+
const endTime = keyboardDrag?.end.time
|
|
216
|
+
?? unprojectCompositeTimestamp(scene.timeScale, activeDrag.endXRatio);
|
|
217
|
+
if (activeDrag.kind === "zoom") {
|
|
218
|
+
return {
|
|
219
|
+
direction: "up" as const,
|
|
220
|
+
summary: keyboardDrag
|
|
221
|
+
? summarizeZoomRange(scene, startTime, endTime)
|
|
222
|
+
: summarizeZoomSelection(scene, activeDrag),
|
|
223
|
+
startTime,
|
|
224
|
+
startValueLabel: null,
|
|
225
|
+
endValueLabel: null,
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
const startValue = keyboardDrag
|
|
229
|
+
? keyboardDrag.start.value
|
|
230
|
+
: measureDomain ? unprojectCompositeValue(activeDrag.startYRatio, measureDomain) : null;
|
|
231
|
+
const endValue = keyboardDrag
|
|
232
|
+
? keyboardDrag.end.value
|
|
233
|
+
: measureDomain ? unprojectCompositeValue(activeDrag.endYRatio, measureDomain) : null;
|
|
234
|
+
return {
|
|
235
|
+
direction: resolveMeasureDirection(startValue, endValue),
|
|
236
|
+
summary: summarizeMeasure({
|
|
237
|
+
startValue,
|
|
238
|
+
endValue,
|
|
239
|
+
startTime,
|
|
240
|
+
endTime,
|
|
241
|
+
// Cross-market cursor stops include every listing's observations;
|
|
242
|
+
// measured bars still follow the primary market's session scale.
|
|
243
|
+
bars: countMeasureBars(scene.timeScale.kind === "market"
|
|
244
|
+
? scene.timeScale.anchors.map(({ timestamp }) => new Date(timestamp))
|
|
245
|
+
: scene.dates, startTime, endTime),
|
|
246
|
+
domain: measureDomain,
|
|
247
|
+
}),
|
|
248
|
+
startTime,
|
|
249
|
+
startValueLabel: measureDomain && startValue !== null
|
|
250
|
+
? formatCompositeCursorValue(startValue, measureDomain)
|
|
251
|
+
: null,
|
|
252
|
+
endValueLabel: measureDomain && endValue !== null
|
|
253
|
+
? formatCompositeCursorValue(endValue, measureDomain)
|
|
254
|
+
: null,
|
|
255
|
+
};
|
|
256
|
+
}, [activeDrag, keyboardDrag, measureDomain, scene]);
|
|
257
|
+
const toolSummary = toolReadout?.summary ?? null;
|
|
258
|
+
const toolStartTime = toolReadout?.startTime ?? null;
|
|
259
|
+
const toolSpan = useMemo(() => {
|
|
260
|
+
if (!activeDrag || !toolSummary || toolStartTime === null) return null;
|
|
261
|
+
return {
|
|
262
|
+
startXRatio: activeDrag.startXRatio,
|
|
263
|
+
endXRatio: activeDrag.endXRatio,
|
|
264
|
+
startTime: toolStartTime,
|
|
265
|
+
color: activeDrag.kind === "zoom"
|
|
266
|
+
? colors.crosshair
|
|
267
|
+
: toolReadout?.direction === "down" ? colors.negative : themeColors.positive,
|
|
268
|
+
};
|
|
269
|
+
}, [activeDrag, colors.crosshair, colors.negative, toolReadout?.direction, toolStartTime, toolSummary]);
|
|
270
|
+
useEffect(() => {
|
|
271
|
+
onToolSpanChange(toolSpan);
|
|
272
|
+
}, [onToolSpanChange, toolSpan]);
|
|
273
|
+
const panelDrawings = useMemo(
|
|
274
|
+
() => drawings.filter((drawing) => drawing.panelId === panel.id),
|
|
275
|
+
[drawings, panel.id],
|
|
276
|
+
);
|
|
277
|
+
// A dragged level moves here and is saved once, when the pointer lets go.
|
|
278
|
+
const [levelDraft, setLevelDraft] = useState<{ id: string; value: number } | null>(null);
|
|
279
|
+
const levelDraftRef = useRef(levelDraft);
|
|
280
|
+
levelDraftRef.current = levelDraft;
|
|
281
|
+
const levelDomain = useMemo(() => {
|
|
282
|
+
const series = levels ? panel.series.find((entry) => entry.source.id === levels.seriesId) : undefined;
|
|
283
|
+
return series ? panel.axes[series.source.axis] ?? null : null;
|
|
284
|
+
}, [levels, panel]);
|
|
285
|
+
const projectedLevels = useMemo(
|
|
286
|
+
() => levels && levelDomain ? projectLevels(levels.items, levelDomain, levelDraft) : NO_LEVELS,
|
|
287
|
+
[levelDomain, levelDraft, levels],
|
|
288
|
+
);
|
|
289
|
+
const bitmapLayers = useMemo(() => {
|
|
290
|
+
if (!bitmap) return null;
|
|
291
|
+
// The desktop composites overlays as vectors, so the plot raster stays put
|
|
292
|
+
// while a tool drags. Copying and reblending it per frame is what made the
|
|
293
|
+
// ruler feel heavy.
|
|
294
|
+
if (isDesktopWeb) return [bitmap];
|
|
295
|
+
const base = !activeDrag && panelDrawings.length === 0 ? bitmap : drawChartToolOverlay(
|
|
296
|
+
bitmap,
|
|
297
|
+
activeDrag,
|
|
298
|
+
{
|
|
299
|
+
positive: themeColors.positive,
|
|
300
|
+
negative: colors.negative,
|
|
301
|
+
zoom: colors.crosshair,
|
|
302
|
+
draw: drawColor,
|
|
303
|
+
},
|
|
304
|
+
toolReadout?.direction ?? "up",
|
|
305
|
+
{ scene, panel, items: panelDrawings, selectedId: selectedDrawingId },
|
|
306
|
+
);
|
|
307
|
+
return [projectedLevels.length > 0 ? paintLevels(base, projectedLevels, selectedLevelId) : base];
|
|
308
|
+
}, [
|
|
309
|
+
activeDrag,
|
|
310
|
+
bitmap,
|
|
311
|
+
colors.crosshair,
|
|
312
|
+
colors.negative,
|
|
313
|
+
drawColor,
|
|
314
|
+
isDesktopWeb,
|
|
315
|
+
panel,
|
|
316
|
+
panelDrawings,
|
|
317
|
+
projectedLevels,
|
|
318
|
+
scene,
|
|
319
|
+
selectedDrawingId,
|
|
320
|
+
selectedLevelId,
|
|
321
|
+
toolReadout?.direction,
|
|
322
|
+
]);
|
|
323
|
+
const vectors = useMemo<ChartSurfaceProps["vectors"]>(() => {
|
|
324
|
+
if (!isDesktopWeb) return null;
|
|
325
|
+
const shapes = [...levelVectors(projectedLevels, selectedLevelId), ...buildChartToolVectors({
|
|
326
|
+
scene,
|
|
327
|
+
panel,
|
|
328
|
+
drawings: panelDrawings,
|
|
329
|
+
selectedId: selectedDrawingId,
|
|
330
|
+
drag: activeDrag,
|
|
331
|
+
colors: {
|
|
332
|
+
positive: themeColors.positive,
|
|
333
|
+
negative: colors.negative,
|
|
334
|
+
zoom: colors.crosshair,
|
|
335
|
+
draw: drawColor,
|
|
336
|
+
},
|
|
337
|
+
direction: toolReadout?.direction ?? "up",
|
|
338
|
+
})];
|
|
339
|
+
return shapes.length > 0 ? shapes : null;
|
|
340
|
+
}, [
|
|
341
|
+
activeDrag,
|
|
342
|
+
colors.crosshair,
|
|
343
|
+
colors.negative,
|
|
344
|
+
drawColor,
|
|
345
|
+
isDesktopWeb,
|
|
346
|
+
panel,
|
|
347
|
+
panelDrawings,
|
|
348
|
+
projectedLevels,
|
|
349
|
+
scene,
|
|
350
|
+
selectedDrawingId,
|
|
351
|
+
selectedLevelId,
|
|
352
|
+
toolReadout?.direction,
|
|
353
|
+
]);
|
|
354
|
+
const textLines = useMemo(
|
|
355
|
+
() => isDesktopWeb || !showTextFallback
|
|
356
|
+
? []
|
|
357
|
+
: writeLevelText(
|
|
358
|
+
renderCompositePanelText(panel, plotWidth, scene.cursorXRatio, pointerCursorYRatio),
|
|
359
|
+
projectedLevels,
|
|
360
|
+
selectedLevelId,
|
|
361
|
+
),
|
|
362
|
+
[isDesktopWeb, panel, plotWidth, pointerCursorYRatio, projectedLevels, scene.cursorXRatio, selectedLevelId, showTextFallback],
|
|
363
|
+
);
|
|
364
|
+
const leftAxisLabels = useMemo(
|
|
365
|
+
() => axisLabelRows(
|
|
366
|
+
renderCompositeAxisText(panel.axes.left, panel.height, leftAxisWidth, "left", formatAxisValue),
|
|
367
|
+
),
|
|
368
|
+
[formatAxisValue, leftAxisWidth, panel],
|
|
369
|
+
);
|
|
370
|
+
const rightAxisLabels = useMemo(
|
|
371
|
+
() => axisLabelRows(
|
|
372
|
+
renderCompositeAxisText(panel.axes.right, panel.height, rightAxisWidth, "right", formatAxisValue),
|
|
373
|
+
),
|
|
374
|
+
[formatAxisValue, panel, rightAxisWidth],
|
|
375
|
+
);
|
|
376
|
+
const leftAxisTicks = useMemo(
|
|
377
|
+
() => compositeAxisTickLabels(panel.axes.left, leftAxisWidth, formatAxisValue),
|
|
378
|
+
[formatAxisValue, leftAxisWidth, panel],
|
|
379
|
+
);
|
|
380
|
+
const rightAxisTicks = useMemo(
|
|
381
|
+
() => compositeAxisTickLabels(panel.axes.right, rightAxisWidth, formatAxisValue),
|
|
382
|
+
[formatAxisValue, panel, rightAxisWidth],
|
|
383
|
+
);
|
|
384
|
+
const cursorRow = activeCursorYRatio === null
|
|
385
|
+
? null
|
|
386
|
+
: Math.round(activeCursorYRatio * Math.max(panel.height - 1, 0));
|
|
387
|
+
const cursorPixelY = activeCursorYRatio === null
|
|
388
|
+
? null
|
|
389
|
+
: activeCursorYRatio * Math.max(panel.height * cellHeightPx - 1, 0);
|
|
390
|
+
const leftCursorLabel = cursorAxisLabel(panel, "left", activeCursorYRatio, formatAxisValue);
|
|
391
|
+
const rightCursorLabel = cursorAxisLabel(panel, "right", activeCursorYRatio, formatAxisValue);
|
|
392
|
+
const measureReadout = useMemo(() => {
|
|
393
|
+
if (!activeDrag || !toolReadout?.summary) return null;
|
|
394
|
+
const text = toolReadout.summary;
|
|
395
|
+
const centreX = (activeDrag.startXRatio + activeDrag.endXRatio) / 2;
|
|
396
|
+
const centreY = activeDrag.kind === "zoom"
|
|
397
|
+
? 0.5
|
|
398
|
+
: (activeDrag.startYRatio + activeDrag.endYRatio) / 2;
|
|
399
|
+
const width = Math.min([...text].length, plotWidth);
|
|
400
|
+
return {
|
|
401
|
+
text,
|
|
402
|
+
width,
|
|
403
|
+
color: activeDrag.kind === "zoom"
|
|
404
|
+
? colors.text
|
|
405
|
+
: toolReadout.direction === "down" ? colors.negative : themeColors.positive,
|
|
406
|
+
left: leftAxisWidth + (leftAxisWidth ? axisGap : 0)
|
|
407
|
+
+ Math.max(0, Math.min(plotWidth - width, Math.round(centreX * plotWidth - width / 2))),
|
|
408
|
+
top: Math.max(0, Math.min(panel.height - 1, Math.round(centreY * (panel.height - 1)))),
|
|
409
|
+
};
|
|
410
|
+
}, [
|
|
411
|
+
activeDrag,
|
|
412
|
+
axisGap,
|
|
413
|
+
colors.negative,
|
|
414
|
+
colors.text,
|
|
415
|
+
leftAxisWidth,
|
|
416
|
+
panel.height,
|
|
417
|
+
plotWidth,
|
|
418
|
+
toolReadout,
|
|
419
|
+
]);
|
|
420
|
+
const axisMarkers = useMemo(() => {
|
|
421
|
+
// The crosshair already marks the moving end, so the axes only need the
|
|
422
|
+
// anchor the drag started from.
|
|
423
|
+
if (!activeDrag || activeDrag.kind === "zoom" || !toolReadout?.startValueLabel) return null;
|
|
424
|
+
return {
|
|
425
|
+
side: null,
|
|
426
|
+
// A keyboard anchor can leave the value range once the view moves.
|
|
427
|
+
yRatio: Math.max(0, Math.min(1, activeDrag.startYRatio)),
|
|
428
|
+
label: toolReadout.startValueLabel,
|
|
429
|
+
color: toolReadout.direction === "down" ? colors.negative : themeColors.positive,
|
|
430
|
+
};
|
|
431
|
+
}, [activeDrag, colors.negative, toolReadout]);
|
|
432
|
+
const lastPriceMarker = useMemo(() => {
|
|
433
|
+
const marker = panel.lastPrice;
|
|
434
|
+
const domain = marker ? panel.axes[marker.axis] : undefined;
|
|
435
|
+
if (!marker || !domain) return null;
|
|
436
|
+
return {
|
|
437
|
+
side: marker.axis,
|
|
438
|
+
yRatio: marker.yRatio,
|
|
439
|
+
label: formatAxisValue
|
|
440
|
+
? formatAxisValue(marker.value, domain)
|
|
441
|
+
: formatCompositeCursorValue(marker.value, domain),
|
|
442
|
+
color: marker.color,
|
|
443
|
+
};
|
|
444
|
+
}, [formatAxisValue, panel]);
|
|
445
|
+
const priorCloseMarker = useMemo(() => {
|
|
446
|
+
const marker = panel.priorClose;
|
|
447
|
+
const domain = marker ? panel.axes[marker.axis] : undefined;
|
|
448
|
+
if (!marker || !domain) return null;
|
|
449
|
+
return {
|
|
450
|
+
side: marker.axis,
|
|
451
|
+
yRatio: marker.yRatio,
|
|
452
|
+
label: formatAxisValue ? formatAxisValue(marker.value, domain) : formatCompositeCursorValue(marker.value, domain),
|
|
453
|
+
color: colors.textDim,
|
|
454
|
+
};
|
|
455
|
+
}, [colors.textDim, formatAxisValue, panel]);
|
|
456
|
+
const levelMarkers = useMemo(() => levelDomain ? [...projectedLevels]
|
|
457
|
+
// The picked level's label first, then alerts', when they compete for room.
|
|
458
|
+
.sort((left, right) => Number(right.level.id === selectedLevelId) - Number(left.level.id === selectedLevelId)
|
|
459
|
+
|| Number(left.level.editable) - Number(right.level.editable))
|
|
460
|
+
.map(({ level, yRatio }) => ({
|
|
461
|
+
side: levelDomain.side,
|
|
462
|
+
yRatio,
|
|
463
|
+
label: formatAxisValue ? formatAxisValue(level.value, levelDomain) : formatCompositeCursorValue(level.value, levelDomain),
|
|
464
|
+
color: level.color,
|
|
465
|
+
})) : [], [formatAxisValue, levelDomain, projectedLevels, selectedLevelId]);
|
|
466
|
+
const buildAxisMarkers = (side: "left" | "right") => {
|
|
467
|
+
if (!panel.axes[side]) return undefined;
|
|
468
|
+
const toAxisMarker = (marker: { yRatio: number; label: string; color: string }) => ({
|
|
469
|
+
row: Math.round(marker.yRatio * Math.max(panel.height - 1, 0)),
|
|
470
|
+
pixelY: marker.yRatio * Math.max(panel.height * cellHeightPx - 1, 0),
|
|
471
|
+
label: marker.label,
|
|
472
|
+
color: marker.color,
|
|
473
|
+
});
|
|
474
|
+
const onSide = <T extends { side: string | null }>(marker: T | null): marker is T => (
|
|
475
|
+
!!marker && (marker.side === null || marker.side === side)
|
|
476
|
+
);
|
|
477
|
+
const fixed = [lastPriceMarker, axisMarkers].filter(onSide).map(toAxisMarker);
|
|
478
|
+
// The prior close's label yields to every level's.
|
|
479
|
+
const levelLabels = [...levelMarkers, priorCloseMarker].filter(onSide).map(toAxisMarker);
|
|
480
|
+
// A label is a row tall, so close levels would stack into an unreadable
|
|
481
|
+
// pile and hide the last price: each keeps its line, and only the labels
|
|
482
|
+
// with a row to themselves show. Desktop badges sit between rows.
|
|
483
|
+
const markers = [
|
|
484
|
+
...fitAxisLabels(levelLabels, fixed, (marker) => fractionalViewport ? marker.pixelY / cellHeightPx : marker.row),
|
|
485
|
+
...fixed,
|
|
486
|
+
];
|
|
487
|
+
return markers.length > 0 ? markers : undefined;
|
|
488
|
+
};
|
|
489
|
+
const leftAxisMarkers = buildAxisMarkers("left");
|
|
490
|
+
const rightAxisMarkers = buildAxisMarkers("right");
|
|
491
|
+
|
|
492
|
+
const pointerRatios = useCallback((event: ChartMouseEvent) => {
|
|
493
|
+
const pointerTarget = plotRef.current as unknown as Parameters<typeof getLocalPlotPointer>[1];
|
|
494
|
+
const pointer = getLocalPlotPointer(event, pointerTarget, renderer);
|
|
495
|
+
if (!pointer) return null;
|
|
496
|
+
return {
|
|
497
|
+
xRatio: plotWidth <= 1 ? 0 : Math.max(0, Math.min(1, pointer.cellX / (plotWidth - 1))),
|
|
498
|
+
yRatio: panel.height <= 1 ? 0.5 : Math.max(0, Math.min(1, pointer.cellY / (panel.height - 1))),
|
|
499
|
+
};
|
|
500
|
+
}, [panel.height, plotWidth, renderer]);
|
|
501
|
+
const updateCursor = useCallback((event: ChartMouseEvent): boolean => {
|
|
502
|
+
const pointerTarget = plotRef.current as unknown as Parameters<typeof getLocalPlotPointer>[1];
|
|
503
|
+
const pointer = getLocalPlotPointer(event, pointerTarget, renderer);
|
|
504
|
+
if (!pointer) return false;
|
|
505
|
+
const nextDate = resolveCompositeCursorDate(scene, pointer.cellX);
|
|
506
|
+
if (!nextDate) return false;
|
|
507
|
+
const nextYRatio = panel.height <= 1
|
|
508
|
+
? 0.5
|
|
509
|
+
: Math.max(0, Math.min(1, pointer.cellY / (panel.height - 1)));
|
|
510
|
+
setCursorYRatio((current) => current === nextYRatio ? current : nextYRatio);
|
|
511
|
+
onCursorDateChange(nextDate);
|
|
512
|
+
consumeChartMouseEvent(event);
|
|
513
|
+
return true;
|
|
514
|
+
}, [onCursorDateChange, panel.height, renderer, scene]);
|
|
515
|
+
const clearCursor = useCallback(() => {
|
|
516
|
+
setCursorYRatio(null);
|
|
517
|
+
onCursorDateChange(null);
|
|
518
|
+
}, [onCursorDateChange]);
|
|
519
|
+
const startDrag = useCallback((event: ChartMouseEvent) => {
|
|
520
|
+
onActivate?.();
|
|
521
|
+
onPointerPress();
|
|
522
|
+
// The plot consumes the press, so the browser never moves focus off a text
|
|
523
|
+
// field for us. Hand it back, but only for a press that truly landed here:
|
|
524
|
+
// a dialog over the plot must keep the focus it just took.
|
|
525
|
+
if (isDesktopWeb) releaseEditableFocus(event);
|
|
526
|
+
consumeChartMouseEvent(event);
|
|
527
|
+
if (onPickTime) {
|
|
528
|
+
const pointer = getLocalPlotPointer(event, plotRef.current as unknown as Parameters<typeof getLocalPlotPointer>[1], renderer);
|
|
529
|
+
const date = pointer ? resolveCompositeCursorDate(scene, pointer.cellX) : null;
|
|
530
|
+
if (date) onPickTime(date);
|
|
531
|
+
return;
|
|
532
|
+
}
|
|
533
|
+
// A keyboard-armed tool covers terminals that never forward modifier drags.
|
|
534
|
+
const tool = resolveChartToolKind(event.modifiers) ?? armedTool;
|
|
535
|
+
if (tool === "level" && levels?.onEdit && levelDomain) {
|
|
536
|
+
const ratios = pointerRatios(event);
|
|
537
|
+
if (!ratios) return;
|
|
538
|
+
const hit = hitTestLevel(projectedLevels, ratios.yRatio, levelGrabRatio(panel.height));
|
|
539
|
+
if (hit) {
|
|
540
|
+
onSelectLevel(hit.id);
|
|
541
|
+
if (hit.editable) dragRef.current = { kind: "level-move", id: hit.id };
|
|
542
|
+
} else {
|
|
543
|
+
const value = unprojectCompositeValue(ratios.yRatio, levelDomain);
|
|
544
|
+
if (value !== null) {
|
|
545
|
+
const id = nextLevelId();
|
|
546
|
+
levels.onEdit({ kind: "add", id, value: roundLevelValue(value, levelDomain) });
|
|
547
|
+
onSelectLevel(id);
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
updateCursor(event);
|
|
551
|
+
return;
|
|
552
|
+
}
|
|
553
|
+
if (tool) {
|
|
554
|
+
const ratios = pointerRatios(event);
|
|
555
|
+
if (!ratios) return;
|
|
556
|
+
// With a drawing tool in hand, grabbing an existing shape edits it
|
|
557
|
+
// instead of starting a new one on top of it.
|
|
558
|
+
const hit = isDrawingTool(tool)
|
|
559
|
+
? hitTestDrawings(drawings, scene, panel, ratios, plotAspect)
|
|
560
|
+
: null;
|
|
561
|
+
if (hit) {
|
|
562
|
+
onSelectDrawing(hit.drawing.id);
|
|
563
|
+
dragRef.current = {
|
|
564
|
+
kind: "edit",
|
|
565
|
+
drawingId: hit.drawing.id,
|
|
566
|
+
pointIndex: hit.pointIndex,
|
|
567
|
+
lastXRatio: ratios.xRatio,
|
|
568
|
+
lastYRatio: ratios.yRatio,
|
|
569
|
+
};
|
|
570
|
+
updateCursor(event);
|
|
571
|
+
return;
|
|
572
|
+
}
|
|
573
|
+
const started: ChartToolDrag = {
|
|
574
|
+
kind: tool,
|
|
575
|
+
startXRatio: ratios.xRatio,
|
|
576
|
+
startYRatio: ratios.yRatio,
|
|
577
|
+
endXRatio: ratios.xRatio,
|
|
578
|
+
endYRatio: ratios.yRatio,
|
|
579
|
+
path: [{ xRatio: ratios.xRatio, yRatio: ratios.yRatio }],
|
|
580
|
+
};
|
|
581
|
+
if (isDrawingTool(tool)) onSelectDrawing(null);
|
|
582
|
+
dragRef.current = { ...started, path: [...started.path] };
|
|
583
|
+
setToolDrag(started);
|
|
584
|
+
updateCursor(event);
|
|
585
|
+
return;
|
|
586
|
+
}
|
|
587
|
+
if (!updateCursor(event)) return;
|
|
588
|
+
dragRef.current = startPanGesture(
|
|
589
|
+
frame,
|
|
590
|
+
viewport,
|
|
591
|
+
plotWidth,
|
|
592
|
+
getGlobalMouseX(event, renderer),
|
|
593
|
+
plotSpanFactor,
|
|
594
|
+
);
|
|
595
|
+
}, [
|
|
596
|
+
armedTool,
|
|
597
|
+
drawings,
|
|
598
|
+
frame,
|
|
599
|
+
levelDomain,
|
|
600
|
+
levels,
|
|
601
|
+
onActivate,
|
|
602
|
+
onPickTime,
|
|
603
|
+
onPointerPress,
|
|
604
|
+
onSelectDrawing,
|
|
605
|
+
onSelectLevel,
|
|
606
|
+
panel,
|
|
607
|
+
plotAspect,
|
|
608
|
+
projectedLevels,
|
|
609
|
+
plotSpanFactor,
|
|
610
|
+
plotWidth,
|
|
611
|
+
pointerRatios,
|
|
612
|
+
renderer,
|
|
613
|
+
scene,
|
|
614
|
+
updateCursor,
|
|
615
|
+
viewport,
|
|
616
|
+
]);
|
|
617
|
+
const pressCursor = useCallback((event: ChartMouseEvent) => {
|
|
618
|
+
onActivate?.();
|
|
619
|
+
updateCursor(event);
|
|
620
|
+
}, [onActivate, updateCursor]);
|
|
621
|
+
const dragViewport = useCallback((event: ChartMouseEvent) => {
|
|
622
|
+
const drag = dragRef.current;
|
|
623
|
+
if (!drag) return;
|
|
624
|
+
consumeChartMouseEvent(event);
|
|
625
|
+
updateCursor(event);
|
|
626
|
+
if (drag.kind === "level-move") {
|
|
627
|
+
const ratios = pointerRatios(event);
|
|
628
|
+
const value = ratios && levelDomain ? unprojectCompositeValue(ratios.yRatio, levelDomain) : null;
|
|
629
|
+
if (value !== null && levelDomain) setLevelDraft({ id: drag.id, value: roundLevelValue(value, levelDomain) });
|
|
630
|
+
return;
|
|
631
|
+
}
|
|
632
|
+
if (drag.kind === "edit") {
|
|
633
|
+
const ratios = pointerRatios(event);
|
|
634
|
+
if (!ratios) return;
|
|
635
|
+
// Read the deltas before advancing the ref: the state updater runs later,
|
|
636
|
+
// and a mutable capture would hand it a zero move every time.
|
|
637
|
+
const deltaXRatio = ratios.xRatio - drag.lastXRatio;
|
|
638
|
+
const deltaYRatio = ratios.yRatio - drag.lastYRatio;
|
|
639
|
+
const { drawingId, pointIndex } = drag;
|
|
640
|
+
drag.lastXRatio = ratios.xRatio;
|
|
641
|
+
drag.lastYRatio = ratios.yRatio;
|
|
642
|
+
onEditDrawing(
|
|
643
|
+
drawingId,
|
|
644
|
+
(drawing) => shiftDrawing(drawing, scene, panel, deltaXRatio, deltaYRatio, pointIndex),
|
|
645
|
+
);
|
|
646
|
+
return;
|
|
647
|
+
}
|
|
648
|
+
if (drag.kind !== "pan") {
|
|
649
|
+
const ratios = pointerRatios(event);
|
|
650
|
+
if (!ratios) return;
|
|
651
|
+
drag.endXRatio = ratios.xRatio;
|
|
652
|
+
drag.endYRatio = ratios.yRatio;
|
|
653
|
+
if (drag.kind === "pencil") drag.path.push({ xRatio: ratios.xRatio, yRatio: ratios.yRatio });
|
|
654
|
+
setToolDrag({ ...drag, path: [...drag.path] });
|
|
655
|
+
return;
|
|
656
|
+
}
|
|
657
|
+
const globalX = getGlobalMouseX(event, renderer);
|
|
658
|
+
if (drag.frame !== frame) {
|
|
659
|
+
// Data refreshed mid-drag. The new frame maps positions differently, so
|
|
660
|
+
// continue from where the plot is now instead of replaying the drag.
|
|
661
|
+
Object.assign(drag, startPanGesture(frame, viewport, plotWidth, globalX, plotSpanFactor));
|
|
662
|
+
}
|
|
663
|
+
onPanViewport(
|
|
664
|
+
(globalX - drag.startGlobalX) * drag.positionsPerCell,
|
|
665
|
+
{ frame: drag.frame, from: drag.startViewport },
|
|
666
|
+
);
|
|
667
|
+
}, [
|
|
668
|
+
frame,
|
|
669
|
+
levelDomain,
|
|
670
|
+
onEditDrawing,
|
|
671
|
+
onPanViewport,
|
|
672
|
+
panel,
|
|
673
|
+
plotSpanFactor,
|
|
674
|
+
plotWidth,
|
|
675
|
+
pointerRatios,
|
|
676
|
+
renderer,
|
|
677
|
+
scene,
|
|
678
|
+
updateCursor,
|
|
679
|
+
viewport,
|
|
680
|
+
]);
|
|
681
|
+
const finishToolDrag = useCallback(() => {
|
|
682
|
+
const drag = dragRef.current;
|
|
683
|
+
if (!drag || drag.kind === "pan") return;
|
|
684
|
+
dragRef.current = null;
|
|
685
|
+
if (drag.kind === "edit") return;
|
|
686
|
+
if (drag.kind === "level-move") {
|
|
687
|
+
const draft = levelDraftRef.current;
|
|
688
|
+
setLevelDraft(null);
|
|
689
|
+
if (draft) levels?.onEdit?.({ kind: "move", id: draft.id, value: draft.value });
|
|
690
|
+
return;
|
|
691
|
+
}
|
|
692
|
+
setToolDrag(null);
|
|
693
|
+
if (isDrawingTool(drag.kind)) {
|
|
694
|
+
const drawing = resolveDrawingFromDrag(scene, panel, drag, drawColor, nextDrawingId());
|
|
695
|
+
if (drawing) onDraw(drawing);
|
|
696
|
+
return;
|
|
697
|
+
}
|
|
698
|
+
if (drag.kind !== "zoom") return;
|
|
699
|
+
const range = resolveZoomBoxRange(scene, drag, frame.minimumSpanMs);
|
|
700
|
+
if (range) onSetViewport(range);
|
|
701
|
+
}, [drawColor, frame.minimumSpanMs, levels, onDraw, onSetViewport, panel, scene]);
|
|
702
|
+
const resetDrag = useCallback(() => {
|
|
703
|
+
if (dragRef.current?.kind === "pan") {
|
|
704
|
+
dragRef.current = null;
|
|
705
|
+
return;
|
|
706
|
+
}
|
|
707
|
+
finishToolDrag();
|
|
708
|
+
}, [finishToolDrag]);
|
|
709
|
+
const handleMouseMove = useCallback((event: ChartMouseEvent) => {
|
|
710
|
+
// A release over a neighbouring pane never reaches this surface, so treat a
|
|
711
|
+
// plain move, which only fires with no button held, as the missing release.
|
|
712
|
+
finishToolDrag();
|
|
713
|
+
updateCursor(event);
|
|
714
|
+
}, [finishToolDrag, updateCursor]);
|
|
715
|
+
// Trackpads fire wheel events faster than the plot can paint, so one frame
|
|
716
|
+
// absorbs every event that arrived since the last one.
|
|
717
|
+
const pendingWheelRef = useRef<PendingWheel | null>(null);
|
|
718
|
+
const wheelFrameRef = useRef<number | null>(null);
|
|
719
|
+
const latestWheelStateRef = useRef({ frame, viewport, onPanViewport, onZoomViewport, plotSpanFactor });
|
|
720
|
+
latestWheelStateRef.current = { frame, viewport, onPanViewport, onZoomViewport, plotSpanFactor };
|
|
721
|
+
const flushWheel = useCallback(() => {
|
|
722
|
+
wheelFrameRef.current = null;
|
|
723
|
+
const pending = pendingWheelRef.current;
|
|
724
|
+
pendingWheelRef.current = null;
|
|
725
|
+
if (!pending) return;
|
|
726
|
+
const latest = latestWheelStateRef.current;
|
|
727
|
+
if (pending.panRatio !== 0) {
|
|
728
|
+
const positions = compositeViewportPositions(latest.frame, latest.viewport);
|
|
729
|
+
const span = positions ? Math.max(positions.end - positions.start, Number.EPSILON) : 0;
|
|
730
|
+
latest.onPanViewport(pending.panRatio * span * latest.plotSpanFactor);
|
|
731
|
+
}
|
|
732
|
+
if (pending.zoomLog !== 0) {
|
|
733
|
+
latest.onZoomViewport(Math.exp(pending.zoomLog), pending.anchorRatio);
|
|
734
|
+
}
|
|
735
|
+
}, []);
|
|
736
|
+
useEffect(() => () => {
|
|
737
|
+
pendingWheelRef.current = null;
|
|
738
|
+
if (wheelFrameRef.current !== null) {
|
|
739
|
+
webFrame.cancelAnimationFrame?.(wheelFrameRef.current);
|
|
740
|
+
wheelFrameRef.current = null;
|
|
741
|
+
}
|
|
742
|
+
}, []);
|
|
743
|
+
const panFromWheel = useCallback((event: ChartMouseEvent) => {
|
|
744
|
+
const scroll = event.scroll;
|
|
745
|
+
if (!scroll) return;
|
|
746
|
+
onActivate?.();
|
|
747
|
+
consumeChartMouseEvent(event);
|
|
748
|
+
const pointerTarget = plotRef.current as unknown as Parameters<typeof getLocalPlotPointer>[1];
|
|
749
|
+
const pointer = getLocalPlotPointer(event, pointerTarget, renderer);
|
|
750
|
+
updateCursor(event);
|
|
751
|
+
const pending = pendingWheelRef.current ?? { panRatio: 0, zoomLog: 0, anchorRatio: 0.5 };
|
|
752
|
+
if (event.modifiers.ctrl && pointer && isVerticalWheelDirection(scroll.direction)) {
|
|
753
|
+
pending.zoomLog += Math.log(resolveCompositeWheelZoom(scroll));
|
|
754
|
+
// The anchor is a fraction of the viewport, so a pointer over the empty
|
|
755
|
+
// right offset anchors on the newest observation instead of past it.
|
|
756
|
+
pending.anchorRatio = Math.min(
|
|
757
|
+
1,
|
|
758
|
+
pointer.cellX / Math.max(plotWidth - 1, 1) * plotSpanFactor,
|
|
759
|
+
);
|
|
760
|
+
} else {
|
|
761
|
+
pending.panRatio += resolveCompositeWheelPan(scroll, plotWidth * cellWidthPx);
|
|
762
|
+
}
|
|
763
|
+
pendingWheelRef.current = pending;
|
|
764
|
+
if (!isDesktopWeb || typeof webFrame.requestAnimationFrame !== "function") {
|
|
765
|
+
flushWheel();
|
|
766
|
+
return;
|
|
767
|
+
}
|
|
768
|
+
if (wheelFrameRef.current === null) {
|
|
769
|
+
wheelFrameRef.current = webFrame.requestAnimationFrame(flushWheel);
|
|
770
|
+
}
|
|
771
|
+
}, [
|
|
772
|
+
cellWidthPx,
|
|
773
|
+
flushWheel,
|
|
774
|
+
isDesktopWeb,
|
|
775
|
+
onActivate,
|
|
776
|
+
plotSpanFactor,
|
|
777
|
+
plotWidth,
|
|
778
|
+
renderer,
|
|
779
|
+
updateCursor,
|
|
780
|
+
]);
|
|
781
|
+
|
|
782
|
+
return (
|
|
783
|
+
<Box
|
|
784
|
+
flexDirection="row"
|
|
785
|
+
height={panel.height}
|
|
786
|
+
width={plotWidth + leftAxisWidth + rightAxisWidth + axisGap * ((leftAxisWidth ? 1 : 0) + (rightAxisWidth ? 1 : 0))}
|
|
787
|
+
position="relative"
|
|
788
|
+
>
|
|
789
|
+
{measureReadout ? (
|
|
790
|
+
<Box
|
|
791
|
+
position="absolute"
|
|
792
|
+
left={measureReadout.left}
|
|
793
|
+
top={measureReadout.top}
|
|
794
|
+
width={measureReadout.width}
|
|
795
|
+
height={1}
|
|
796
|
+
zIndex={25}
|
|
797
|
+
backgroundColor={colors.background}
|
|
798
|
+
style={isDesktopWeb
|
|
799
|
+
? {
|
|
800
|
+
width: "auto",
|
|
801
|
+
paddingInline: 4,
|
|
802
|
+
borderRadius: 4,
|
|
803
|
+
backgroundColor: `color-mix(in srgb, ${colors.background} 82%, transparent)`,
|
|
804
|
+
}
|
|
805
|
+
: undefined}
|
|
806
|
+
data-gloom-role="composite-chart-measure"
|
|
807
|
+
>
|
|
808
|
+
<Text fg={measureReadout.color}>{measureReadout.text}</Text>
|
|
809
|
+
</Box>
|
|
810
|
+
) : null}
|
|
811
|
+
{leftAxisWidth > 0 ? (
|
|
812
|
+
<>
|
|
813
|
+
<PriceAxisLabels
|
|
814
|
+
axisLabels={leftAxisLabels}
|
|
815
|
+
axisTicks={leftAxisTicks}
|
|
816
|
+
axisWidth={leftAxisWidth}
|
|
817
|
+
axisSectionWidth={leftAxisWidth}
|
|
818
|
+
side="left"
|
|
819
|
+
height={panel.height}
|
|
820
|
+
cursorRow={cursorRow}
|
|
821
|
+
cursorPixelY={cursorPixelY}
|
|
822
|
+
cursorLabel={leftCursorLabel}
|
|
823
|
+
cursorColor={colors.crosshair}
|
|
824
|
+
cursorBackgroundColor={colors.background}
|
|
825
|
+
axisColor={colors.textDim}
|
|
826
|
+
extraMarkers={leftAxisMarkers}
|
|
827
|
+
/>
|
|
828
|
+
<Box width={axisGap} />
|
|
829
|
+
</>
|
|
830
|
+
) : null}
|
|
831
|
+
<ChartSurface
|
|
832
|
+
ref={plotRef}
|
|
833
|
+
width={plotWidth}
|
|
834
|
+
height={panel.height}
|
|
835
|
+
flexDirection="column"
|
|
836
|
+
bitmaps={bitmapLayers}
|
|
837
|
+
crosshair={crosshair}
|
|
838
|
+
vectors={vectors}
|
|
839
|
+
onMouseMove={interactive ? handleMouseMove : undefined}
|
|
840
|
+
onMouseDown={interactive ? navigable ? startDrag : pressCursor : undefined}
|
|
841
|
+
onMouseDrag={interactive && navigable ? dragViewport : undefined}
|
|
842
|
+
onMouseUp={interactive && navigable ? resetDrag : undefined}
|
|
843
|
+
onMouseDragEnd={interactive && navigable ? resetDrag : undefined}
|
|
844
|
+
onMouseScroll={interactive && navigable ? panFromWheel : undefined}
|
|
845
|
+
onMouseOut={interactive ? clearCursor : undefined}
|
|
846
|
+
cursor={interactive ? toolDrag || !navigable || onPickTime ? "crosshair" : "grab" : undefined}
|
|
847
|
+
data-gloom-interactive={interactive ? "true" : undefined}
|
|
848
|
+
data-gloom-role={COMPOSITE_PANEL_ROLE}
|
|
849
|
+
data-gloom-remote-kind={remoteKind}
|
|
850
|
+
data-gloom-label={panel.label ?? panel.id}
|
|
851
|
+
>
|
|
852
|
+
{textLines.map((line, index) => <Text key={index} fg={colors.text}>{line}</Text>)}
|
|
853
|
+
</ChartSurface>
|
|
854
|
+
{rightAxisWidth > 0 ? (
|
|
855
|
+
<>
|
|
856
|
+
<Box width={axisGap} />
|
|
857
|
+
<PriceAxisLabels
|
|
858
|
+
axisLabels={rightAxisLabels}
|
|
859
|
+
axisTicks={rightAxisTicks}
|
|
860
|
+
axisWidth={rightAxisWidth}
|
|
861
|
+
axisSectionWidth={rightAxisWidth}
|
|
862
|
+
side="right"
|
|
863
|
+
height={panel.height}
|
|
864
|
+
cursorRow={cursorRow}
|
|
865
|
+
cursorPixelY={cursorPixelY}
|
|
866
|
+
cursorLabel={rightCursorLabel}
|
|
867
|
+
cursorColor={colors.crosshair}
|
|
868
|
+
cursorBackgroundColor={colors.background}
|
|
869
|
+
axisColor={colors.textDim}
|
|
870
|
+
extraMarkers={rightAxisMarkers}
|
|
871
|
+
/>
|
|
872
|
+
</>
|
|
873
|
+
) : null}
|
|
874
|
+
</Box>
|
|
875
|
+
);
|
|
876
|
+
}
|