@gloom-sh/terminal 0.20.10 → 0.20.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -1
- package/patches/@opentui%2Fcore@0.3.2.patch +16 -0
- package/src/api-client/awards.ts +16 -0
- package/src/api-client/central-bank-rates.ts +5 -0
- package/src/api-client/data.ts +55 -2
- package/src/api-client/index.ts +18 -1
- package/src/api-client/request.ts +86 -3
- package/src/api-client/socket-connection.ts +366 -0
- package/src/api-client/socket-features.ts +75 -0
- package/src/api-client/socket-frames.ts +161 -0
- package/src/api-client/socket-listeners.ts +207 -0
- package/src/api-client/socket-quotes.ts +332 -0
- package/src/api-client/socket.ts +168 -983
- package/src/api-client/supply-chain-graph.ts +4 -2
- package/src/api-client/supply-chain.ts +8 -0
- package/src/api-client/types/econ.ts +10 -7
- package/src/api-client/types/filings-and-calls.ts +8 -0
- package/src/app/global-shortcuts.ts +2 -1
- package/src/app/keybindings/actions.ts +19 -0
- package/src/app/pane-runtime/index.tsx +18 -3
- package/src/app/pane-runtime/layout-placement.ts +63 -0
- package/src/app/pane-runtime/ticker-open-runtime.ts +10 -2
- package/src/brokers/signed-in/adapter.ts +19 -5
- package/src/brokers/signed-in/client.ts +13 -1
- package/src/brokers/signed-in/sign-in-dialog.tsx +33 -9
- package/src/capabilities/chart-series.ts +4 -1
- package/src/cli/board-coins.ts +10 -1
- package/src/cli/commands/crypto-hints.ts +3 -2
- package/src/cli/commands/fred-series.ts +0 -54
- package/src/cli/commands/market.ts +209 -31
- package/src/cli/commands/overview.ts +47 -14
- package/src/cli/commands/search.ts +37 -8
- package/src/cli/commands/ticker.ts +15 -4
- package/src/cli/desktop-pane-shot.ts +27 -2
- package/src/cli/fx-quote-rate.ts +1 -1
- package/src/cli/glossary.ts +14 -5
- package/src/cli/history-catalog-series.ts +85 -0
- package/src/cli/index.ts +1 -1
- package/src/cli/list-progress.ts +45 -0
- package/src/cli/listing-arg.ts +71 -7
- package/src/cli/name-entries.ts +8 -4
- package/src/cli/not-a-ticker.ts +2 -2
- package/src/cli/pane-functions/freshness.ts +50 -3
- package/src/cli/pane-functions/index.ts +7 -4
- package/src/cli/pane-functions/market-session.ts +66 -14
- package/src/cli/pane-functions/options.ts +5 -0
- package/src/cli/pane-functions/resolver.ts +9 -2
- package/src/cli/pane-functions/screenshot-assessment.ts +28 -3
- package/src/cli/pane-functions/screenshot-types.ts +6 -0
- package/src/cli/quote-answer.ts +49 -10
- package/src/cli/quote-list-reads.ts +87 -0
- package/src/cli/report-tables.ts +70 -13
- package/src/cli/result.ts +24 -2
- package/src/cli/symbol-list.ts +31 -4
- package/src/cli/terminal-code-hints.ts +83 -0
- package/src/cli/ticker-resolution.ts +2 -1
- package/src/cli/treasury-yields.ts +5 -0
- package/src/components/chart/native/kitty/manager.ts +2 -0
- package/src/components/chart/native/surface/manager.ts +211 -11
- package/src/components/command-bar/action-runtime.ts +2 -0
- package/src/components/command-bar/panel/index.tsx +2 -13
- package/src/components/command-bar/panel/layout.ts +1 -7
- package/src/components/command-bar/panel/runtime.ts +0 -1
- package/src/components/command-bar/panel/types.ts +0 -2
- package/src/components/command-bar/routing/launch-request.ts +2 -1
- package/src/components/command-bar/routing/navigation-state.ts +4 -2
- package/src/components/command-bar/workflow/types.ts +6 -0
- package/src/components/data-table/column-menu.tsx +89 -0
- package/src/components/data-table/sort-menu.tsx +9 -2
- package/src/components/data-table/view.tsx +33 -6
- package/src/components/form-modal/content.tsx +10 -0
- package/src/components/index.ts +1 -1
- package/src/components/layout/detached-pane-shell.tsx +3 -0
- package/src/components/layout/double-escape-close.ts +34 -3
- package/src/components/layout/floating-pane.tsx +10 -4
- package/src/components/layout/pane/cycle-order.ts +66 -2
- package/src/components/layout/pane/footer/index.tsx +25 -11
- package/src/components/layout/pane/footer/model.ts +62 -20
- package/src/components/layout/pane/header.tsx +140 -31
- package/src/components/layout/pane/sidebar.tsx +138 -20
- package/src/components/layout/pane/status-footer.ts +3 -1
- package/src/components/layout/shell/active-drag.ts +18 -13
- package/src/components/layout/shell/drag/magnets.ts +34 -18
- package/src/components/layout/shell/drag/runtime.ts +5 -0
- package/src/components/layout/shell/index.tsx +25 -0
- package/src/components/layout/shell/menu.ts +9 -0
- package/src/components/layout/shell/pane/actions.ts +36 -0
- package/src/components/layout/shell/pane/management-shortcuts.ts +27 -3
- package/src/components/layout/shell/pane-occlusion.ts +40 -0
- package/src/components/layout/shell/shortcuts.ts +17 -1
- package/src/components/layout/shell/terminal-pointer-runtime.ts +39 -6
- package/src/components/layout/shell/window-mode/index.ts +5 -16
- package/src/components/layout/shell/window-mode/overlays.tsx +3 -1
- package/src/components/market-board/index.tsx +14 -5
- package/src/components/metric-treemap/index.tsx +3 -1
- package/src/components/ticker/list-table-view.tsx +5 -0
- package/src/components/ui/button.tsx +48 -4
- package/src/components/ui/data-table/column-order.ts +180 -0
- package/src/components/ui/data-table/index.tsx +12 -1
- package/src/components/ui/data-table/opentui/index.tsx +291 -32
- package/src/components/ui/data-table/opentui/model.ts +43 -4
- package/src/components/ui/data-table/types.ts +56 -0
- package/src/components/ui/data-table/use-column-order.ts +135 -0
- package/src/components/ui/index.ts +1 -1
- package/src/components/ui/inline-quick-add.tsx +19 -3
- package/src/components/ui/list-view.tsx +11 -5
- package/src/components/ui/query-bar.tsx +16 -1
- package/src/components/ui/selection-fill.ts +39 -0
- package/src/components/ui/table-layout.ts +120 -0
- package/src/core/state/app/layout-reducer.ts +2 -1
- package/src/core/state/app/pane-choices.ts +68 -0
- package/src/core/state/app/state.ts +14 -6
- package/src/core/state/app/types.ts +8 -0
- package/src/docs/snapshot.json +3 -2
- package/src/i18n/es.ts +2 -0
- package/src/i18n/ja.ts +2 -0
- package/src/i18n/ko.ts +2 -0
- package/src/i18n/zh-cn.ts +2 -0
- package/src/i18n/zh-tw.ts +2 -0
- package/src/layout/pane-manager/dock-tree.ts +19 -0
- package/src/layout/pane-manager/index.ts +3 -0
- package/src/market-data/coordinator/index.ts +4 -3
- package/src/market-data/coordinator/quotes.ts +12 -4
- package/src/market-data/market/freshness.ts +33 -0
- package/src/market-data/market/status.ts +5 -1
- package/src/market-data/quotes/contributions.ts +10 -0
- package/src/market-data/quotes/freshness.ts +31 -0
- package/src/market-data/quotes/live-valuation.ts +32 -5
- package/src/market-data/quotes/regular-session-valuation.ts +1 -1
- package/src/market-data/quotes/resolution.ts +4 -0
- package/src/market-data/quotes/time.ts +0 -14
- package/src/plugins/builtin/account-management/index.tsx +1 -0
- package/src/plugins/builtin/awards/detail.tsx +12 -4
- package/src/plugins/builtin/awards/headless.ts +29 -8
- package/src/plugins/builtin/awards/model.ts +36 -2
- package/src/plugins/builtin/awards/pane.tsx +7 -4
- package/src/plugins/builtin/broker-manager/detail.tsx +5 -3
- package/src/plugins/builtin/broker-manager/index.tsx +7 -6
- package/src/plugins/builtin/broker-manager/model.ts +15 -6
- package/src/plugins/builtin/broker-manager/pane-actions.tsx +11 -4
- package/src/plugins/builtin/broker-manager/sign-in-end.ts +50 -19
- package/src/plugins/builtin/broker-manager/table.ts +10 -4
- package/src/plugins/builtin/broker-trading/index.tsx +1 -1
- package/src/plugins/builtin/central-bank-rates/headless.ts +6 -6
- package/src/plugins/builtin/central-bank-rates/index.tsx +1 -1
- package/src/plugins/builtin/central-bank-rates/model.ts +21 -3
- package/src/plugins/builtin/central-bank-rates/pane.tsx +15 -5
- package/src/plugins/builtin/chart-composer/headless.ts +5 -1
- package/src/plugins/builtin/chart-composer/pane.tsx +1 -0
- package/src/plugins/builtin/chat/content/handle-prompt.tsx +4 -0
- package/src/plugins/builtin/chat/controller/realtime.ts +17 -1
- package/src/plugins/builtin/chat/message/terminal.tsx +4 -1
- package/src/plugins/builtin/chat/sidebar.tsx +35 -19
- package/src/plugins/builtin/cloud/askg/pane.tsx +4 -0
- package/src/plugins/builtin/cloud/askg/tool-timeline.tsx +2 -0
- 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/detail.tsx +9 -4
- package/src/plugins/builtin/commodity-balances/pane.tsx +13 -5
- package/src/plugins/builtin/company-kpis/model.ts +3 -3
- package/src/plugins/builtin/connections/index.ts +1 -0
- package/src/plugins/builtin/credit-boards/cdx-pane.tsx +9 -5
- package/src/plugins/builtin/credit-boards/client.ts +5 -0
- package/src/plugins/builtin/credit-boards/headless.ts +1 -6
- package/src/plugins/builtin/credit-boards/model.ts +0 -6
- package/src/plugins/builtin/credit-boards/series.ts +19 -8
- package/src/plugins/builtin/credit-boards/sovr-pane.tsx +9 -5
- package/src/plugins/builtin/crypto-etf-flows/headless.ts +23 -13
- package/src/plugins/builtin/crypto-etf-flows/pane.tsx +8 -3
- package/src/plugins/builtin/debt-maturities/headless.ts +16 -7
- package/src/plugins/builtin/debt-maturities/model.ts +9 -15
- package/src/plugins/builtin/debt-maturities/pane.tsx +9 -10
- package/src/plugins/builtin/earnings/board-model.ts +33 -4
- package/src/plugins/builtin/earnings/board.tsx +15 -3
- package/src/plugins/builtin/earnings/calendar.tsx +10 -6
- package/src/plugins/builtin/earnings/client.ts +0 -9
- package/src/plugins/builtin/earnings/headless.ts +10 -7
- package/src/plugins/builtin/earnings/history.tsx +21 -14
- package/src/plugins/builtin/earnings-calls/data.ts +24 -4
- package/src/plugins/builtin/earnings-calls/format.ts +23 -5
- package/src/plugins/builtin/earnings-calls/headless.ts +23 -3
- package/src/plugins/builtin/earnings-calls/index.tsx +1 -0
- package/src/plugins/builtin/earnings-calls/model.ts +11 -1
- package/src/plugins/builtin/earnings-calls/pane.tsx +2 -5
- package/src/plugins/builtin/econ/calendar-model.ts +27 -0
- package/src/plugins/builtin/econ/fred-catalog.ts +3 -0
- package/src/plugins/builtin/econ/index.tsx +9 -2
- package/src/plugins/builtin/econ-statistics/headless.ts +3 -1
- package/src/plugins/builtin/econ-statistics/index.tsx +1 -1
- package/src/plugins/builtin/equity-screener/live.ts +74 -18
- package/src/plugins/builtin/equity-screener/model.ts +19 -4
- package/src/plugins/builtin/equity-screener/pane.tsx +19 -14
- package/src/plugins/builtin/equity-screener/refresh-anchor.ts +45 -0
- package/src/plugins/builtin/equity-screener/results.ts +22 -2
- package/src/plugins/builtin/equity-screener/screen-check.ts +9 -3
- package/src/plugins/builtin/fear-greed/headless.ts +16 -13
- package/src/plugins/builtin/fear-greed/pane.tsx +12 -4
- package/src/plugins/builtin/filing-events/index.tsx +1 -0
- package/src/plugins/builtin/futures/index.tsx +15 -1
- package/src/plugins/builtin/futures/table.tsx +1 -1
- package/src/plugins/builtin/fx-matrix/index.tsx +32 -19
- package/src/plugins/builtin/holders/pane.tsx +30 -20
- package/src/plugins/builtin/insider/table.tsx +10 -7
- package/src/plugins/builtin/insider/tickers.tsx +1 -1
- package/src/plugins/builtin/iv-history/events.ts +5 -0
- package/src/plugins/builtin/iv-history/headless.ts +15 -9
- package/src/plugins/builtin/jobs/index.tsx +1 -0
- package/src/plugins/builtin/kelly-sizer/sections.tsx +2 -0
- package/src/plugins/builtin/macro-day/headless.ts +15 -6
- package/src/plugins/builtin/macro-day/model.ts +1 -1
- package/src/plugins/builtin/macro-day/releases.ts +25 -16
- package/src/plugins/builtin/market-movers/index.tsx +20 -8
- package/src/plugins/builtin/market-movers/model.ts +5 -0
- package/src/plugins/builtin/market-movers/session-body.tsx +2 -1
- package/src/plugins/builtin/money-markets/headless.ts +12 -2
- package/src/plugins/builtin/money-markets/pane.tsx +10 -1
- package/src/plugins/builtin/options/view.tsx +3 -0
- package/src/plugins/builtin/options-positioning/pane.tsx +1 -1
- package/src/plugins/builtin/options-scenario/pane.tsx +2 -1
- package/src/plugins/builtin/perps/cascade-tabs.tsx +2 -1
- package/src/plugins/builtin/portfolio-list/cli/bulk-symbols.ts +4 -31
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +19 -1
- package/src/plugins/builtin/portfolio-list/quick-add/index.tsx +22 -8
- package/src/plugins/builtin/portfolio-list/summary/index.tsx +6 -8
- package/src/plugins/builtin/portfolio-list/table.tsx +15 -1
- package/src/plugins/builtin/rate-path/pane.tsx +2 -0
- package/src/plugins/builtin/realized-vol/headless.ts +28 -2
- package/src/plugins/builtin/revenue-breakdown/pane.tsx +2 -0
- package/src/plugins/builtin/reverse-dcf/pane.tsx +2 -1
- package/src/plugins/builtin/risk-factors/index.tsx +1 -0
- package/src/plugins/builtin/seasonality/pane.tsx +2 -1
- package/src/plugins/builtin/shared/source-footer.ts +70 -0
- package/src/plugins/builtin/short-interest/publications-pane.tsx +5 -1
- package/src/plugins/builtin/short-volume/pane.tsx +5 -1
- package/src/plugins/builtin/social-mentions/outliers.tsx +10 -1
- package/src/plugins/builtin/social-mentions/pane.tsx +7 -0
- package/src/plugins/builtin/supply-chain/client.ts +3 -1
- package/src/plugins/builtin/supply-chain/flow.tsx +25 -8
- package/src/plugins/builtin/supply-chain/graph-client.ts +1 -1
- package/src/plugins/builtin/supply-chain/graph-evidence.ts +1 -1
- package/src/plugins/builtin/supply-chain/graph-model.ts +12 -1
- package/src/plugins/builtin/supply-chain/graph-pane.tsx +9 -8
- package/src/plugins/builtin/supply-chain/graph.tsx +12 -6
- package/src/plugins/builtin/supply-chain/headless.ts +13 -7
- package/src/plugins/builtin/supply-chain/model.ts +68 -11
- package/src/plugins/builtin/supply-chain/pane.tsx +9 -6
- package/src/plugins/builtin/supply-chain/row-evidence.tsx +5 -5
- package/src/plugins/builtin/thirteenf/pane.tsx +2 -0
- package/src/plugins/builtin/ticker-detail/financials/model.ts +28 -6
- package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +26 -9
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +58 -35
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +14 -1
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +2 -0
- package/src/plugins/builtin/ticker-detail/pane.tsx +48 -24
- package/src/plugins/builtin/ticker-detail/quote-footer.ts +5 -0
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +6 -3
- package/src/plugins/builtin/treasury-auctions/after.ts +50 -23
- package/src/plugins/builtin/treasury-auctions/cache.ts +23 -5
- package/src/plugins/builtin/treasury-auctions/headless.ts +226 -37
- package/src/plugins/builtin/treasury-auctions/hk-headless.ts +11 -5
- package/src/plugins/builtin/treasury-auctions/hk-view.tsx +27 -25
- package/src/plugins/builtin/treasury-auctions/hk.ts +60 -8
- package/src/plugins/builtin/treasury-auctions/index.tsx +3 -0
- package/src/plugins/builtin/treasury-auctions/keys.ts +27 -0
- package/src/plugins/builtin/treasury-auctions/like.ts +137 -0
- package/src/plugins/builtin/treasury-auctions/model.ts +100 -22
- package/src/plugins/builtin/treasury-auctions/pane.tsx +39 -11
- package/src/plugins/builtin/vol-surface/heat-grid.tsx +6 -3
- package/src/plugins/builtin/vol-surface/pane.tsx +7 -3
- package/src/plugins/builtin/world-indices/index.tsx +5 -1
- package/src/plugins/builtin/yield-curve/index.tsx +2 -1
- package/src/plugins/runtime/index.tsx +1 -0
- package/src/plugins/runtime/state.ts +20 -0
- package/src/portfolio/column-values.ts +8 -2
- package/src/public/__snapshots__/public-api.test.ts.snap +5 -0
- package/src/public/react.ts +7 -0
- package/src/react/auto-refresh.ts +29 -0
- package/src/renderers/browser/deeplink-bridge.ts +24 -3
- package/src/renderers/dom/data-table/column-drag.ts +147 -0
- package/src/renderers/dom/data-table/index.tsx +22 -0
- package/src/renderers/dom/data-table/row.tsx +27 -5
- package/src/renderers/dom/desktop/query-bar.tsx +229 -60
- package/src/renderers/dom/host/overflow-fade-px.ts +2 -0
- package/src/renderers/dom/host/overflow-fade.ts +1 -2
- package/src/renderers/dom/styles.css +47 -5
- package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +2 -1
- package/src/renderers/opentui/chart-surface.tsx +1 -0
- package/src/renderers/opentui/frame-hits.ts +33 -0
- package/src/renderers/opentui/host.tsx +2 -0
- package/src/renderers/opentui/native-surface.ts +14 -21
- package/src/renderers/opentui/test-utils.tsx +3 -0
- package/src/series/types.ts +2 -0
- package/src/sources/gloomberb-cloud/fred-attribution.ts +86 -0
- package/src/sources/gloomberb-cloud/index.ts +25 -1
- package/src/sources/gloomberb-cloud/normalizers.ts +22 -3
- package/src/sources/provider-errors.ts +64 -1
- package/src/sources/provider-router/batches.ts +19 -0
- package/src/sources/provider-router/index.ts +7 -1
- package/src/state/app/context/index.tsx +46 -1
- package/src/state/pane-unsent-work.ts +47 -0
- package/src/test-support/app-store.ts +24 -1
- package/src/test-support/shell-pane-keys.tsx +5 -0
- package/src/test-support/telemetry-guard.ts +83 -0
- package/src/test-support/test-env.ts +12 -0
- package/src/theme/colors.ts +17 -1
- package/src/theme/ui-tokens.ts +50 -1
- package/src/tickers/listing-venues.ts +11 -1
- package/src/tickers/search/japanese-names.json +1 -0
- package/src/tickers/search/japanese-names.ts +152 -0
- package/src/tickers/terminal-codes.ts +55 -6
- package/src/time-series/base-series.ts +3 -0
- package/src/time-series/live-quotes.ts +3 -9
- package/src/types/data-provider.ts +6 -0
- package/src/types/financials.ts +11 -0
- package/src/types/plugin-contributions.ts +7 -0
- package/src/types/plugin-panes.ts +7 -0
- package/src/ui/host.tsx +24 -0
- package/src/ui/pointer-drag.ts +11 -2
- package/src/utils/double-escape-close.ts +42 -0
- package/src/utils/fundamentals.ts +14 -3
- package/src/utils/fx-status.ts +30 -7
- package/src/utils/network-failure.ts +23 -0
- package/src/utils/share-multiples.cases.json +780 -2
- package/src/utils/share-multiples.ts +154 -24
|
@@ -214,9 +214,20 @@ export function QuickAddTickerInput({
|
|
|
214
214
|
keepFailureRef.current = false;
|
|
215
215
|
listMemoRef.current = createQuickAddListMemo();
|
|
216
216
|
setInputValue("");
|
|
217
|
+
// The field keeps its own text, cursor and scroll until told: an add that left them read the next symbol
|
|
218
|
+
// scrolled by one ("+ SDTRY=X" for USDTRY=X).
|
|
219
|
+
inputRef.current?.editBuffer?.setText?.("");
|
|
220
|
+
inputRef.current?.setCursorOffset?.(0);
|
|
217
221
|
setValidation(IDLE_VALIDATION);
|
|
218
222
|
}, []);
|
|
219
223
|
|
|
224
|
+
/** An add is done: the row closes, empty, and `a` opens it again. */
|
|
225
|
+
const closeAfterAdd = useCallback(() => {
|
|
226
|
+
resetInput();
|
|
227
|
+
inputRef.current?.blur?.();
|
|
228
|
+
setInputFocused(false);
|
|
229
|
+
}, [resetInput]);
|
|
230
|
+
|
|
220
231
|
const clearFailedInput = useCallback((failure: QuickAddValidation) => {
|
|
221
232
|
keepFailureRef.current = true;
|
|
222
233
|
validationSeqRef.current += 1;
|
|
@@ -393,10 +404,13 @@ export function QuickAddTickerInput({
|
|
|
393
404
|
...skipped,
|
|
394
405
|
].join(" "),
|
|
395
406
|
});
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
407
|
+
// Something added, or nothing left to fix: done. Entries left out keep the row open on what to fix.
|
|
408
|
+
if (added.length > 0 || left.length === 0) closeAfterAdd();
|
|
409
|
+
else {
|
|
410
|
+
setValidation(list);
|
|
411
|
+
queueMicrotask(() => inputRef.current?.focus?.());
|
|
412
|
+
}
|
|
413
|
+
}, [addReady, closeAfterAdd, collectionKind, collectionName, notify, onAdded]);
|
|
400
414
|
|
|
401
415
|
const submitInput = useCallback(async (submittedValue?: string) => {
|
|
402
416
|
// Before any lookup: consent to count the add cannot be given after it.
|
|
@@ -435,7 +449,7 @@ export function QuickAddTickerInput({
|
|
|
435
449
|
collection: collectionName,
|
|
436
450
|
}),
|
|
437
451
|
});
|
|
438
|
-
|
|
452
|
+
closeAfterAdd();
|
|
439
453
|
return;
|
|
440
454
|
}
|
|
441
455
|
if (currentValidation.status !== "ready") {
|
|
@@ -463,6 +477,7 @@ export function QuickAddTickerInput({
|
|
|
463
477
|
collection: collectionName,
|
|
464
478
|
}),
|
|
465
479
|
});
|
|
480
|
+
closeAfterAdd();
|
|
466
481
|
return;
|
|
467
482
|
}
|
|
468
483
|
|
|
@@ -472,8 +487,7 @@ export function QuickAddTickerInput({
|
|
|
472
487
|
collection: collectionName,
|
|
473
488
|
});
|
|
474
489
|
notify({ type: "success", body: added.note ? `${body} ${added.note}.` : body });
|
|
475
|
-
|
|
476
|
-
queueMicrotask(() => inputRef.current?.focus?.());
|
|
490
|
+
closeAfterAdd();
|
|
477
491
|
} catch {
|
|
478
492
|
setValidation({ status: "error", query, message: "Ticker add failed" });
|
|
479
493
|
notify({ type: "error", body: tf("Failed to add {symbol}.", { symbol: query }) });
|
|
@@ -483,12 +497,12 @@ export function QuickAddTickerInput({
|
|
|
483
497
|
}, [
|
|
484
498
|
addReady,
|
|
485
499
|
clearFailedInput,
|
|
500
|
+
closeAfterAdd,
|
|
486
501
|
collectionName,
|
|
487
502
|
handOffListingChoice,
|
|
488
503
|
inputValue,
|
|
489
504
|
notify,
|
|
490
505
|
onAdded,
|
|
491
|
-
resetInput,
|
|
492
506
|
submitList,
|
|
493
507
|
submitting,
|
|
494
508
|
validateInput,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
} from "../account-metrics";
|
|
21
21
|
import { formatPortfolioAmount, type PortfolioSummaryTotals } from "./totals";
|
|
22
22
|
import { formatAllocationDrift, formatAllocationWeight, type PortfolioCashLine } from "../../../../portfolio/allocation";
|
|
23
|
-
import {
|
|
23
|
+
import { quoteSourceFooterSegment } from "../../shared/source-footer";
|
|
24
24
|
import { fxStatusLabel, type FxRateStatus } from "../../../../utils/fx-status";
|
|
25
25
|
import { t } from "../../../../i18n";
|
|
26
26
|
import type { PortfolioValuationBasis } from "../../../../portfolio/valuation-basis";
|
|
@@ -490,13 +490,11 @@ export function buildPortfolioFooterSegments({
|
|
|
490
490
|
if (savedAt != null) return [...accountStatus, savedCopyFooterSegment("refresh", savedAt)];
|
|
491
491
|
if (isPortfolioTab ? !totals.hasPositions && !accountStatusText : totals.watchlistCount === 0) return [];
|
|
492
492
|
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
: "-";
|
|
499
|
-
return [...accountStatus, { id: "refresh", parts: [{ text: refreshText, tone: "muted" }] }];
|
|
493
|
+
// Where the quotes are from and the newest's time, as `quote` ends (`Gloom Cloud · 14:44 UTC · markets open`):
|
|
494
|
+
// a bare local time ("Thu 12:25") named neither.
|
|
495
|
+
const quoted = refreshingSize > 0 ? null : quoteSourceFooterSegment(quotes, { id: "refresh" });
|
|
496
|
+
const refresh: PaneFooterSegment = quoted ?? { id: "refresh", parts: [{ text: refreshingSize > 0 ? "Refreshing..." : "-", tone: "muted" }] };
|
|
497
|
+
return [...accountStatus, refresh];
|
|
500
498
|
}
|
|
501
499
|
|
|
502
500
|
const MAX_NOTICE_SYMBOLS = 12;
|
|
@@ -10,12 +10,14 @@ import { PRICE_SPARKLINE_COLUMN_ID } from "../../../components/price-sparkline/v
|
|
|
10
10
|
import type { QuoteFlashDirection } from "../../../components/quote-flash";
|
|
11
11
|
import type { TickerTableCell, TickerTableSummaryRow } from "../../../components/ticker/list-table-view";
|
|
12
12
|
import { createRowValueCache } from "../../../components/ui/row-value-cache";
|
|
13
|
+
import type { DataTableColumnReorder } from "../../../components/ui";
|
|
13
14
|
import type { ColumnConfig } from "../../../types/config";
|
|
14
15
|
import type { PricePoint, TickerFinancials } from "../../../types/financials";
|
|
15
16
|
import type { TickerRecord } from "../../../types/ticker";
|
|
16
17
|
import { objectVersion } from "../../../utils/object-version";
|
|
17
18
|
import { columnContextVersion, PERPETUAL_COLUMN_IDS } from "./cell-version";
|
|
18
19
|
import { getColumnValue, type ColumnContext } from "./metrics";
|
|
20
|
+
import { RANGE_FROM_BARS_NOTE } from "../../../portfolio/column-values";
|
|
19
21
|
import { periodPnlFigure, tickerDisplayName } from "../../../portfolio/column-values";
|
|
20
22
|
import { listedSymbol } from "../../../portfolio/listed-symbol";
|
|
21
23
|
import { displayWidth } from "../../../utils/format";
|
|
@@ -204,6 +206,7 @@ export function PortfolioTickerTable({
|
|
|
204
206
|
answeredSnapshots,
|
|
205
207
|
exportName,
|
|
206
208
|
allocationRows,
|
|
209
|
+
columnReorder,
|
|
207
210
|
}: {
|
|
208
211
|
columns: ColumnConfig[];
|
|
209
212
|
focused?: boolean;
|
|
@@ -240,6 +243,8 @@ export function PortfolioTickerTable({
|
|
|
240
243
|
exportName?: string;
|
|
241
244
|
/** The book's CASH and TOTAL rows under its holdings (`allocationSummaryRows`). */
|
|
242
245
|
allocationRows?: readonly TickerTableSummaryRow[];
|
|
246
|
+
/** Header drags rewrite the pane's Columns setting (`DataTableProps.columnReorder`). */
|
|
247
|
+
columnReorder?: DataTableColumnReorder;
|
|
243
248
|
}) {
|
|
244
249
|
const cellCacheRef = useRef(createRowValueCache<string, ReturnType<typeof getColumnValue> & TickerTableCell>(5000));
|
|
245
250
|
const openPerpetualRef = useRef(onOpenPerpetual);
|
|
@@ -293,6 +298,12 @@ export function PortfolioTickerTable({
|
|
|
293
298
|
priceColumn.width,
|
|
294
299
|
))
|
|
295
300
|
: 0, [columnContext.valuationBasis, priceColumn, resolveCell, sortedTickers, tableFinancialsMap]);
|
|
301
|
+
// 52W% grows to show a range read from daily bars as one ("+45.30% bars"), as LAST grows for its session mark.
|
|
302
|
+
const rangeColumn = columns.find((column) => column.id === "range_52w");
|
|
303
|
+
const rangeWidth = useMemo(() => rangeColumn && sortedTickers.some((ticker) =>
|
|
304
|
+
tableFinancialsMap.get(ticker.metadata.ticker)?.quote?.yearRangeBasis === "daily-bars")
|
|
305
|
+
? rangeColumn.width + displayWidth(RANGE_FROM_BARS_NOTE) + 1
|
|
306
|
+
: 0, [rangeColumn, sortedTickers, tableFinancialsMap]);
|
|
296
307
|
// The Ticker column grows to its longest symbol, so ETH-USD and BA:LSE show whole beside their market-state dot.
|
|
297
308
|
const tickerWidth = useMemo(() => Math.min(MAX_TICKER_COLUMN_WIDTH, sortedTickers.reduce(
|
|
298
309
|
(widest, ticker) => Math.max(widest, TICKER_DOT_WIDTH + displayWidth(listedSymbol(ticker, tickerDisplayName(ticker), columnContext.homeMarket))),
|
|
@@ -307,13 +318,15 @@ export function PortfolioTickerTable({
|
|
|
307
318
|
: column.id === "weight" && grossWeights ? { ...column, label: GROSS_WEIGHT_LABEL }
|
|
308
319
|
: column.id === "ticker" && tickerWidth > column.width ? { ...column, width: tickerWidth }
|
|
309
320
|
: column.id === "price" && priceWidth > column.width ? { ...column, width: priceWidth }
|
|
321
|
+
: column.id === "range_52w" && rangeWidth > column.width ? { ...column, width: rangeWidth }
|
|
310
322
|
: column.id === "pnl_pct" && period ? { ...column, label: CONTRIBUTION_LABEL }
|
|
311
323
|
: pnlLabel !== "P&L" && (column.id === "pnl" || column.id === "pnl_pct") ? {
|
|
312
324
|
...column,
|
|
313
325
|
label: column.id === "pnl_pct" ? pnlLabel.replace("P&L", "%") : pnlLabel,
|
|
314
326
|
} : column).map((column) => BOOK_CURRENCY_COLUMN_IDS.has(column.id) ? bookCurrencyColumn(column, capCurrency) : column)
|
|
315
327
|
.map((column) => hasFrontReference && column.id === noteColumnId ? { ...column, flexGrow: 1 } : column),
|
|
316
|
-
[capCurrency, columns, grossWeights, hasFrontReference, hasNonShareQuantity, noteColumnId, period, pnlLabel, priceWidth, sharesWidth,
|
|
328
|
+
[capCurrency, columns, grossWeights, hasFrontReference, hasNonShareQuantity, noteColumnId, period, pnlLabel, priceWidth, rangeWidth, sharesWidth,
|
|
329
|
+
tickerWidth]);
|
|
317
330
|
// Read again as the rows' data moves, from the cells the rows show; the columns change only when what is hidden does.
|
|
318
331
|
// The company columns hidden last time, per list, stay hidden while a row added since settles.
|
|
319
332
|
const hiddenCompanyRef = useRef<{ list: string | undefined; ids: ReadonlySet<string> }>({ list: undefined, ids: new Set() });
|
|
@@ -389,6 +402,7 @@ export function PortfolioTickerTable({
|
|
|
389
402
|
summaryRows={summaryRows}
|
|
390
403
|
rootHeight={rootHeight}
|
|
391
404
|
exportName={exportName}
|
|
405
|
+
columnReorder={columnReorder}
|
|
392
406
|
/>
|
|
393
407
|
);
|
|
394
408
|
}
|
|
@@ -194,6 +194,8 @@ export function RatePathPane({ width, height, focused }: PaneProps) {
|
|
|
194
194
|
rootBefore={header(meetingColumns, meetings.length, pathChart)} />
|
|
195
195
|
: tab === "probabilities" ? <DataTableView
|
|
196
196
|
columns={probabilityColumns}
|
|
197
|
+
// Target ranges in rate order.
|
|
198
|
+
columnReorder={false}
|
|
197
199
|
items={data.meetings} selection={selection} focused={focused} sortColumnId={null} sortDirection="asc"
|
|
198
200
|
getItemKey={meetingKey} rootWidth={width} rootHeight={bodyHeight} emptyStateTitle="Meeting probabilities unavailable"
|
|
199
201
|
rootBefore={header(probabilityColumns, data.meetings.length)}
|
|
@@ -3,7 +3,7 @@ import type { HeadlessPaneDefinition } from "../../../types/plugin";
|
|
|
3
3
|
import { createSurfaceDependencies } from "../vol-surface/client";
|
|
4
4
|
import { resolveHeadlessInstrument } from "../shared/headless-market-data";
|
|
5
5
|
import { createRealizedVolatilityDependencies, loadCurrentAtmIv, loadRealizedVolatilityHistory } from "./client";
|
|
6
|
-
import { atmIvObservedLabel, projectRealizedVolatility, type CurrentAtmIvSnapshot } from "./model";
|
|
6
|
+
import { atmIvObservedLabel, projectRealizedVolatility, type CurrentAtmIvSnapshot, type RealizedVolatilityModel } from "./model";
|
|
7
7
|
import { ESTIMATOR_OPTIONS, selectedWindows } from "./settings";
|
|
8
8
|
import { DAILY_CLOSES } from "../shared/report-freshness";
|
|
9
9
|
import { listingAbroadVenue } from "../../../utils/sec";
|
|
@@ -30,10 +30,35 @@ function fxProxySection(proxy: FxVolProxy, reading: FxProxyReading): HeadlessBun
|
|
|
30
30
|
formatted: proxy.iv30 ? `${proxy.iv30.date}${proxy.iv30.method === "quote-mid" ? " (quote mid)" : ""}${stale ? ", stale" : ""}` : "--" },
|
|
31
31
|
{ label: fxProxyChainLabel(proxy), value: proxy.expiries?.usable ?? null, formatted: fxProxyChainText(proxy, Date.now()) },
|
|
32
32
|
{ label: "Pair HV20", value: hv20, formatted: percent(hv20) },
|
|
33
|
-
|
|
33
|
+
// In points of volatility, which the label names, so an export writes the bare number.
|
|
34
|
+
{ label: "IV30 - HV20 (pts)", value: spread, formatted: spread == null ? "--" : `${spread >= 0 ? "+" : ""}${(spread * 100).toFixed(2)}` },
|
|
34
35
|
] };
|
|
35
36
|
}
|
|
36
37
|
|
|
38
|
+
/** Sessions of the history the text report prints; exports write every session of the lookback. */
|
|
39
|
+
const HISTORY_TEXT_SESSIONS = 10;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Each session's estimate for the windows shown, newest first, as HIVG's daily
|
|
43
|
+
* history is: the series the graph draws, which exports write as numbers in
|
|
44
|
+
* percent under one column per window (HV20 (%)). The text report prints the
|
|
45
|
+
* latest sessions.
|
|
46
|
+
*/
|
|
47
|
+
function historySection(model: RealizedVolatilityModel): HeadlessBundleSection {
|
|
48
|
+
const rows = model.series.map((point) => ({
|
|
49
|
+
date: point.date.toISOString().slice(0, 10),
|
|
50
|
+
...Object.fromEntries(model.windows.map((window) => [`hv${window}`, point.values[window] ?? null])),
|
|
51
|
+
})).reverse();
|
|
52
|
+
return {
|
|
53
|
+
title: "History",
|
|
54
|
+
textTitle: `History, latest ${Math.min(HISTORY_TEXT_SESSIONS, rows.length)} sessions`,
|
|
55
|
+
columns: [{ key: "date", header: "Date" }, ...model.windows.map((window) => ({ key: `hv${window}`, header: `HV${window}`,
|
|
56
|
+
format: (value: unknown) => typeof value === "number" ? `${(value * 100).toFixed(2)}%` : "--" }))],
|
|
57
|
+
rows,
|
|
58
|
+
textRows: rows.slice(0, HISTORY_TEXT_SESSIONS),
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
37
62
|
export function realizedVolHeadless(initialView: "graph" | "cone"): HeadlessPaneDefinition<"bundle"> {
|
|
38
63
|
return {
|
|
39
64
|
shape: "bundle", argument: { kind: "ticker", description: "Underlying ticker" }, currencyPairs: true,
|
|
@@ -102,6 +127,7 @@ export function realizedVolHeadless(initialView: "graph" | "cone"): HeadlessPane
|
|
|
102
127
|
{ key: "percentile", header: "Percentile", format: (value) => typeof value === "number" ? `${value.toFixed(1)}%` : "--" },
|
|
103
128
|
{ key: "sampleSize", header: "Samples" },
|
|
104
129
|
], rows: model.cone.map((row) => ({ ...row })) },
|
|
130
|
+
...model.series.length > 0 ? [historySection(model)] : [],
|
|
105
131
|
...proxy && proxyReading ? [fxProxySection(proxy, proxyReading)] : fx || !args.options.showIv ? [] : [{ title: "Current IV", entries: [
|
|
106
132
|
{ label: "ATM IV", value: iv?.reference?.value ?? null, formatted: iv?.reference ? `${(iv.reference.value * 100).toFixed(2)}%` : "--" },
|
|
107
133
|
{ label: "Expiry", value: iv?.reference?.expiration ?? null,
|
|
@@ -214,6 +214,8 @@ function RevenueBreakdownView({ width, height, focused }: { width: number; heigh
|
|
|
214
214
|
{payload ? (
|
|
215
215
|
<DataTableView<Item>
|
|
216
216
|
columns={columns}
|
|
217
|
+
// Reporting quarters in time order, then the latest and TTM.
|
|
218
|
+
columnReorder={false}
|
|
217
219
|
items={items}
|
|
218
220
|
focused={focused}
|
|
219
221
|
rootWidth={width}
|
|
@@ -145,7 +145,8 @@ export function ReverseDcfPane({ width, height, focused }: PaneProps) {
|
|
|
145
145
|
<Box paddingX={1}><Notice variant="callout" tone="muted">{missingInputsText(model.missing)}</Notice></Box>
|
|
146
146
|
</> : model && !model.error ? <>
|
|
147
147
|
<StatGrid items={stats} width={width} maxLines={statMaxLines} />
|
|
148
|
-
|
|
148
|
+
{/* Terminal growth rates in order: a sensitivity grid's axis. */}
|
|
149
|
+
<DataTableView<Row> focused={focused} columns={COLUMNS} columnReorder={false} items={model.sensitivity} rootWidth={width} rootHeight={contentHeight}
|
|
149
150
|
getItemKey={(row) => String(row.discountRate)} emptyStateTitle="No implied growth." sortColumnId={null} sortDirection="desc"
|
|
150
151
|
selection={{ kind: "id", selectedId, getId: (row) => String(row.discountRate),
|
|
151
152
|
onChange: (id) => { if (id) setDiscount(String(Math.round(Number(id) * 100))); } }}
|
|
@@ -220,7 +220,8 @@ export function SeasonalityPane({ width, height, focused }: PaneProps) {
|
|
|
220
220
|
formatCursor: (ratio) => new Date(Date.UTC(OVERLAY_YEAR, 0, 1) + ratio * 365 * 86_400_000).toISOString().slice(5, 10) }}
|
|
221
221
|
colors={{ background: palette.bgColor, grid: palette.gridColor, crosshair: palette.crosshairColor, text: colors.text,
|
|
222
222
|
textDim: palette.axisColor, negative: colors.negative }} />
|
|
223
|
-
:
|
|
223
|
+
// January to December: the grid is a calendar.
|
|
224
|
+
: <DataTableView<Row> focused={focused} columns={COLUMNS} columnReorder={false} items={rows} rootWidth={width} rootHeight={contentHeight}
|
|
224
225
|
getItemKey={(row) => row.id} emptyStateTitle="No monthly returns." sortColumnId={null} sortDirection="desc"
|
|
225
226
|
selection={{ kind: "id", selectedId: selectedRow, getId: (row) => row.id, onChange: (id) => setSelectedRow(id) }}
|
|
226
227
|
getExportMetadata={() => [["symbol", model.symbol], ["as of", model.asOf?.toISOString()], ["units", "percent, local-price close to close"]]}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { PaneFooterSegment } from "../../../components/layout/pane/footer";
|
|
2
|
+
import { deriveHeadlessFreshness, paneSourceLineVariants, type ReportFreshness } from "../../../cli/pane-functions/freshness";
|
|
3
|
+
import { quotesFreshness } from "../../../cli/freshness";
|
|
4
|
+
import { quoteSourceName } from "../../../market-data/quotes/export-identity";
|
|
5
|
+
import { quoteHeadlineTime } from "../../../market-data/market/status";
|
|
6
|
+
import type { Quote } from "../../../types/financials";
|
|
7
|
+
import type { HeadlessPaneDefinition, HeadlessPaneResult } from "../../../types/headless";
|
|
8
|
+
import { getSharedRegistry } from "../../registry";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The footer's one form for where a pane's data comes from and how current it
|
|
12
|
+
* is, the line its `fn` report ends with (paneSourceLineVariants): `DTCC · Thu
|
|
13
|
+
* 12 Nov 2026 · not a live feed (daily levels of public trades)`. A narrow row
|
|
14
|
+
* shortens it to the source and the date, then the date alone. `feed: false`
|
|
15
|
+
* leaves out the delay a pane's clock already shows.
|
|
16
|
+
*/
|
|
17
|
+
function sourceFooterSegment(
|
|
18
|
+
freshness: ReportFreshness,
|
|
19
|
+
{ id = "source", feed = true, time }: {
|
|
20
|
+
id?: string;
|
|
21
|
+
feed?: boolean;
|
|
22
|
+
/** The data's time in its fewest cells (`12:25 UTC`), for a row too narrow for the line's own date: after the sourced lines and last. */
|
|
23
|
+
time?: string;
|
|
24
|
+
} = {},
|
|
25
|
+
): PaneFooterSegment {
|
|
26
|
+
const lines = paneSourceLineVariants(freshness, { feed });
|
|
27
|
+
const sourced = freshness.source ? lines.filter((line) => line.startsWith(`${freshness.source} · `)) : [];
|
|
28
|
+
const ordered = time
|
|
29
|
+
? [...sourced, ...freshness.source ? [`${freshness.source} · ${time}`] : [], ...lines.filter((line) => !sourced.includes(line)), time]
|
|
30
|
+
: lines;
|
|
31
|
+
const [line, ...shorter] = [...new Set(ordered)].map((text) => [{ text, tone: "muted" as const }]);
|
|
32
|
+
return { id, asOf: true, parts: line!, ...(shorter.length ? { variants: shorter } : {}) };
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** `12:25 UTC` on the day it is read, `Thu 12 Nov 12:25 UTC` before. */
|
|
36
|
+
function compactTime(time: number, now: number): string {
|
|
37
|
+
const at = new Date(time);
|
|
38
|
+
const clock = `${at.toISOString().slice(11, 16)} UTC`;
|
|
39
|
+
if (at.toISOString().slice(0, 10) === new Date(now).toISOString().slice(0, 10)) return clock;
|
|
40
|
+
return `${at.toLocaleDateString("en-GB", { weekday: "short", day: "numeric", month: "short", timeZone: "UTC" }).replace(",", "")} ${clock}`;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** {@link sourceFooterSegment} for a pane's data read as its report reads it: the definition's freshness over `result`. */
|
|
44
|
+
export function reportFooterSegment(
|
|
45
|
+
definition: Pick<HeadlessPaneDefinition, "shape" | "freshness">,
|
|
46
|
+
result: HeadlessPaneResult,
|
|
47
|
+
options: { id?: string; feed?: boolean; now?: number } = {},
|
|
48
|
+
): PaneFooterSegment {
|
|
49
|
+
return sourceFooterSegment(deriveHeadlessFreshness(definition, result, options.now), options);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* {@link sourceFooterSegment} for the quotes a pane shows, as `quote` ends: where they are from (Gloom Cloud, a
|
|
54
|
+
* broker by its name) and the newest's session or time, `Gloom Cloud · EGX trading day Thu 12 Nov 2026 close`,
|
|
55
|
+
* down to `Gloom Cloud · 12:25 UTC` and the time alone in a narrow pane. Its delay is left to the pane's clock.
|
|
56
|
+
* A quote whose source has no name to give leaves the source out rather than calling it Gloom Cloud. Null with
|
|
57
|
+
* no quote.
|
|
58
|
+
*/
|
|
59
|
+
export function quoteSourceFooterSegment(
|
|
60
|
+
quotes: Iterable<Quote | null | undefined>,
|
|
61
|
+
{ id = "source", now = Date.now() }: { id?: string; now?: number } = {},
|
|
62
|
+
): PaneFooterSegment | null {
|
|
63
|
+
const shown = [...quotes].filter((quote): quote is Quote => quote != null && quote.lastUpdated > 0);
|
|
64
|
+
const names = [...new Set(shown.map((quote) => quoteSourceName(quote, (providerId) => getSharedRegistry()?.getBrokerAdapter(providerId)?.name)))];
|
|
65
|
+
const source = names.length > 0 && names.every(Boolean) ? names.join(" and ") : "";
|
|
66
|
+
const freshness = quotesFreshness(shown, undefined, now);
|
|
67
|
+
if (!freshness) return null;
|
|
68
|
+
const newest = Math.max(...shown.map((quote) => quoteHeadlineTime(quote)));
|
|
69
|
+
return sourceFooterSegment({ ...freshness, source }, { id, feed: false, ...Number.isFinite(newest) && newest > 0 ? { time: compactTime(newest, now) } : {} });
|
|
70
|
+
}
|
|
@@ -10,6 +10,8 @@ import type { PaneProps } from "../../../types/plugin";
|
|
|
10
10
|
import { isKnownNonUsEquityTicker } from "../../../utils/sec";
|
|
11
11
|
import { listingIdentity } from "../shared/ticker-request";
|
|
12
12
|
import { cachedPublication, loadPublication, type PublicationKind } from "./publications-client";
|
|
13
|
+
import { publicationHeadless } from "./publications-headless";
|
|
14
|
+
import { reportFooterSegment } from "../shared/source-footer";
|
|
13
15
|
import { publicationCell, publicationColumns, publicationRows, sharedFailIdentity, type PublicationColumn, type PublicationRow } from "./publications-model";
|
|
14
16
|
|
|
15
17
|
function renderCell(row: PublicationRow, column: PublicationColumn, _index: number, state: { selected: boolean }): DataTableCell {
|
|
@@ -48,7 +50,9 @@ export function ShortSidePublicationPane({ kind, width, height, focused }: Pick<
|
|
|
48
50
|
notices: [...(data?.warnings ?? []), ...(resource.data?.refreshError ? [resource.data.refreshError] : [])] });
|
|
49
51
|
usePaneStatusLinkFooter({ registrationId: kind, focused, loading: resource.loading, error: resource.error,
|
|
50
52
|
url: selected?.sourceUrl ?? data?.source.url ?? null, showOpenHint: true,
|
|
51
|
-
|
|
53
|
+
// Its source and newest date, as `fn FTD` and `fn ATS` end; how long ago it loaded goes first on a narrow row.
|
|
54
|
+
info: data ? [reportFooterSegment(publicationHeadless(kind), { sections: [{ title: "", columns: [], rows: publicationRows(data) }] }),
|
|
55
|
+
...(updatedAgo ? [ageFooterSegment(updatedAgo)] : [])] : [],
|
|
52
56
|
stale: !!data && resource.data?.stale,
|
|
53
57
|
});
|
|
54
58
|
if (!symbol) return <EmptyState title="No ticker selected." message={`Select a US stock to view ${subject}.`} />;
|
|
@@ -14,6 +14,8 @@ import { usePaneRefreshKey } from "../../../components/data-table/table-pane";
|
|
|
14
14
|
import { SignInWall } from "../cloud/auth-actions";
|
|
15
15
|
import { isCloudSessionRequired, useResearchCloudSession } from "../shared/research-cloud-session";
|
|
16
16
|
import { cachedShortVolume, loadShortVolume } from "./client";
|
|
17
|
+
import { shortVolumeHeadless } from "./headless";
|
|
18
|
+
import { reportFooterSegment } from "../shared/source-footer";
|
|
17
19
|
import { exactQuantity, sortedVolumeHistory, VOLUME_COLUMNS, volumeChange, volumeHistoryPoints, volumePercent, volumePointStatus, volumeQuantity, type VolumeColumn, type VolumeSort } from "./model";
|
|
18
20
|
import { usePaneTickerIdentity } from "../../../state/hooks/pane-ticker";
|
|
19
21
|
|
|
@@ -84,7 +86,9 @@ export function ShortVolumePane({ width, height, focused }: Pick<PaneProps, "wid
|
|
|
84
86
|
notices: [...(data?.warnings ?? []), ...(resource.data?.refreshError ? [resource.data.refreshError] : [])] });
|
|
85
87
|
usePaneStatusLinkFooter({ registrationId: "short-volume", focused, loading: resource.loading, error: resource.error,
|
|
86
88
|
url: selected?.sourceUrl ?? data?.source.url ?? null, showOpenHint: true,
|
|
87
|
-
|
|
89
|
+
// Its source and newest day, as `fn SIV` ends; how long ago it loaded goes first on a narrow row.
|
|
90
|
+
info: data ? [reportFooterSegment(shortVolumeHeadless, { sections: [{ title: "", columns: [], rows: data.history.map((point) => ({ date: point.date })) }] }),
|
|
91
|
+
...(updatedAgo ? [ageFooterSegment(updatedAgo)] : [])] : [],
|
|
88
92
|
stale: !!data && resource.data?.stale,
|
|
89
93
|
});
|
|
90
94
|
if (!data && isCloudSessionRequired(resource.error)) return <SignInWall placement="short-volume-signin" action="view daily short volume" needsVerification={session.needsVerification} />;
|
|
@@ -11,6 +11,9 @@ import {
|
|
|
11
11
|
} from "../../../components";
|
|
12
12
|
import { usePaneRefreshKey } from "../../../components/data-table/table-pane";
|
|
13
13
|
import { ageFooterSegment } from "../../../components/layout/pane/footer";
|
|
14
|
+
import { useUtcDay } from "../../../react/auto-refresh";
|
|
15
|
+
import { reportFooterSegment } from "../shared/source-footer";
|
|
16
|
+
import { socialMentionsHeadless } from "./headless";
|
|
14
17
|
import { useAsyncResource, useAutoRefresh, useMarketData, usePluginPaneState, useUpdatedAgo } from "../../../public/react";
|
|
15
18
|
import { useThemeColors } from "../../../theme/theme-context";
|
|
16
19
|
import { Box } from "../../../ui";
|
|
@@ -154,13 +157,19 @@ export function SocialOutliersView({ width, height, focused, renderTicker }: {
|
|
|
154
157
|
}, [setOpenName, setOpenSymbol]);
|
|
155
158
|
|
|
156
159
|
const updatedAgo = useUpdatedAgo(resource.updatedAt);
|
|
160
|
+
const utcDay = useUtcDay();
|
|
161
|
+
// Its source and when the posts were counted, as `fn BUZZ` ends; how long ago it loaded goes first on a narrow row.
|
|
162
|
+
const footerInfo = useMemo(() => data ? [
|
|
163
|
+
reportFooterSegment(socialMentionsHeadless, { sections: [], metadata: { asOf: data.asOf } }),
|
|
164
|
+
...(updatedAgo ? [ageFooterSegment(updatedAgo)] : []),
|
|
165
|
+
] : [], [data, updatedAgo, utcDay]);
|
|
157
166
|
usePaneStatusFooter({
|
|
158
167
|
registrationId: "social-mentions:outliers",
|
|
159
168
|
enabled: !detailOpen,
|
|
160
169
|
loading: resource.loading,
|
|
161
170
|
error: data ? resource.error : null,
|
|
162
171
|
stale: !!data && !!shown?.stale,
|
|
163
|
-
info:
|
|
172
|
+
info: footerInfo,
|
|
164
173
|
});
|
|
165
174
|
usePaneNoticeFooter({
|
|
166
175
|
registrationId: "social-mentions:outliers:notices",
|
|
@@ -4,6 +4,9 @@ import { Box, ScrollBox, Text, useUiCapabilities } from "../../../ui";
|
|
|
4
4
|
import { useAsyncResource, useAutoRefresh, usePaneSettingValue, usePluginPaneState, useShortcut, useUpdatedAgo } from "../../../public/react";
|
|
5
5
|
import { CompositeChart, DataTableStackView, EmptyState, PaneStatusBody, usePaneNoticeFooter, usePaneStatusLinkFooter, type DataTableCell, StatGrid } from "../../../components";
|
|
6
6
|
import { ageFooterSegment } from "../../../components/layout/pane/footer";
|
|
7
|
+
import { useUtcDay } from "../../../react/auto-refresh";
|
|
8
|
+
import { reportFooterSegment } from "../shared/source-footer";
|
|
9
|
+
import { socialMentionsHeadless } from "./headless";
|
|
7
10
|
import { colors } from "../../../theme/colors";
|
|
8
11
|
import type { SocialMentionPost, SocialMentionsRange } from "../../../api-client/social-mentions";
|
|
9
12
|
import { staticSeries } from "../../../components/chart/static/series";
|
|
@@ -119,6 +122,8 @@ function SocialMentionsTickerView({ width, height, focused, listingKey, onDetail
|
|
|
119
122
|
return () => clearTimeout(timer);
|
|
120
123
|
}, [pending, resource.updatedAt, resource.reload]);
|
|
121
124
|
useAutoRefresh(resource.updatedAt, resource.load);
|
|
125
|
+
// The footer leaves the day off a time of today; the next day it names it.
|
|
126
|
+
useUtcDay();
|
|
122
127
|
const dayOpen = !!openRow;
|
|
123
128
|
useEffect(() => onDetailChange?.(dayOpen), [dayOpen, onDetailChange]);
|
|
124
129
|
useEffect(() => () => onDetailChange?.(false), [onDetailChange]);
|
|
@@ -129,7 +134,9 @@ function SocialMentionsTickerView({ width, height, focused, listingKey, onDetail
|
|
|
129
134
|
const signInWall = !data && isCloudSessionRequired(resource.error);
|
|
130
135
|
usePaneStatusLinkFooter({ registrationId: "social-mentions", focused, loading: resource.loading || pending, error: signInWall ? null : resource.error,
|
|
131
136
|
url: selected?.topPost?.url ?? (symbol ? `https://x.com/search?q=%24${symbol}` : null), showOpenHint: true,
|
|
137
|
+
// Its source and when the posts were counted, as `fn BUZZ` ends; how long ago it loaded goes first on a narrow row.
|
|
132
138
|
info: data ? [
|
|
139
|
+
reportFooterSegment(socialMentionsHeadless, { sections: [], metadata: { asOf: data.asOf } }),
|
|
133
140
|
...(updatedAgo ? [ageFooterSegment(updatedAgo)] : []),
|
|
134
141
|
...(resource.data?.stale ? [{ id: "stale", parts: [{ text: "stale", tone: "warning" as const }] }] : []),
|
|
135
142
|
] : [],
|
|
@@ -32,7 +32,8 @@ function evidence(value: SupplyEvidenceItem): boolean {
|
|
|
32
32
|
&& finite(value.confidence) && value.confidence >= 0 && value.confidence <= 1
|
|
33
33
|
&& ["active", "superseded", "rejected", "stale"].includes(value.status)
|
|
34
34
|
&& (value.verificationStatus === undefined || ["verified", "lead"].includes(value.verificationStatus))
|
|
35
|
-
&& nullableText(value.valueKind) && (value.value === null || finite(value.value)) && nullableText(value.valueUnit) && nullableText(value.currency)
|
|
35
|
+
&& nullableText(value.valueKind) && (value.value === null || finite(value.value)) && nullableText(value.valueUnit) && nullableText(value.currency)
|
|
36
|
+
&& (value.relatedParty === undefined || typeof value.relatedParty === "boolean");
|
|
36
37
|
}
|
|
37
38
|
export function validSupplyEntity(value: SupplyEntity): boolean {
|
|
38
39
|
return !!value && text(value.id) && text(value.name) && nullableText(value.ticker) && nullableText(value.exchange)
|
|
@@ -53,6 +54,7 @@ export function validSupplyRow(value: SupplyRow): boolean {
|
|
|
53
54
|
&& (value.nativeAmount == null || (value.nativeCurrency != null && value.nativeScale != null && Number.isFinite(value.nativeAmount * value.nativeScale)))
|
|
54
55
|
&& (value.jurisdiction == null || (text(value.jurisdiction) && /^[A-Z]{2}$/.test(value.jurisdiction)))
|
|
55
56
|
&& [undefined, null, "entity", "group", "anonymous", "aggregate"].includes(value.entityScope)
|
|
57
|
+
&& (value.relatedParty === undefined || typeof value.relatedParty === "boolean")
|
|
56
58
|
&& (value.pctOfRevenue === null || value.pctBasis !== null) && (value.usd === null || value.usdBasis !== null)
|
|
57
59
|
&& text(value.period) && validPeriodMonths(value.periodMonths) && nullableText(value.fiscalYear) && ["xbrl", "filing_text", "call", "news", "web", "import", "press_release"].includes(value.sourceKind)
|
|
58
60
|
&& nullableText(value.form) && (value.filedDate === null || date(value.filedDate)) && date(value.asOf)
|
|
@@ -10,9 +10,10 @@ import { cardSurfaceStyle } from "../../../components/ui/card";
|
|
|
10
10
|
import { TOOLTIP_SURFACE_STYLE } from "../../../components/ui/frame";
|
|
11
11
|
import { blendHex } from "../../../theme/colors";
|
|
12
12
|
import { useThemeColors } from "../../../theme/theme-context";
|
|
13
|
+
import { useSelectionFill } from "../../../components/ui/selection-fill";
|
|
13
14
|
import { useStaticChartBitmapSize } from "../../../components/chart/composite/bitmap";
|
|
14
15
|
import { fillOpaque, fillRect, parseHex } from "../../../components/chart/native/raster/primitives";
|
|
15
|
-
import { counterpartyKind, counterpartyLabel, disclosedValue, dollars, nativeValue, periodText, roleLabel, ROLE_COLORS, scopeWords, shareParts, fitShareBasis, type FlowBand, type ShareParts } from "./model";
|
|
16
|
+
import { counterpartyKind, counterpartyKindLabel, counterpartyLabel, disclosedValue, dollars, isRelatedParty, nativeValue, periodText, relationshipLabel, roleLabel, ROLE_COLORS, scopeWords, shareParts, fitShareBasis, type FlowBand, type ShareParts } from "./model";
|
|
16
17
|
import { entityTicker } from "./graph-model";
|
|
17
18
|
import { flowChipLabel, flowGeometry, RELATED_LABEL_CELLS, ribbonY, type FlowRibbon, type PositionedNode } from "./flow-layout";
|
|
18
19
|
import { evidenceDate, evidenceLabel, trustTier } from "./trust";
|
|
@@ -35,8 +36,21 @@ function shareText(share: ShareParts, cells: number): string {
|
|
|
35
36
|
return `${share.value} ${fitShareBasis(share, cells - displayWidth(share.value) - 1)}`;
|
|
36
37
|
}
|
|
37
38
|
|
|
38
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* The line a card shows under the name, in `cells` cells: a related party
|
|
41
|
+
* says so first ("related group · 9,515,093.66 CNY"), on the card itself and
|
|
42
|
+
* not only in its tooltip, then the disclosed figure. A card too narrow for
|
|
43
|
+
* both whole says "related ·" so the figure keeps its digits.
|
|
44
|
+
*/
|
|
39
45
|
function nodeMetric(node: PositionedNode, focusId: string | undefined, cells: number): string {
|
|
46
|
+
const row = node.row!;
|
|
47
|
+
if (!isRelatedParty(row)) return nodeFigure(node, focusId, cells);
|
|
48
|
+
const lines = [`${counterpartyKindLabel(row, true)} · `, "related · "].map((label) => `${label}${nodeFigure(node, focusId, cells - displayWidth(label))}`);
|
|
49
|
+
return lines.find((line) => displayWidth(line) <= cells) ?? lines.at(-1)!;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** The disclosed figure a card shows under the name, in the reporting company's own terms, in `cells` cells. */
|
|
53
|
+
function nodeFigure(node: PositionedNode, focusId: string | undefined, cells: number): string {
|
|
40
54
|
const row = node.row!;
|
|
41
55
|
if (trustTier(row) !== 1) return `${evidenceLabel(row)} · ${evidenceDate(row)}`;
|
|
42
56
|
if (node.weight !== null && node.weightBasis === "usd") return dollars(row);
|
|
@@ -248,7 +262,7 @@ export function SupplyFlow({ rows, symbol, focusName, focusId, width, height, fo
|
|
|
248
262
|
function flowNodeName(node: PositionedNode): string {
|
|
249
263
|
if (node.more) return `Show ${node.more} more ${node.role ? ROLE_PLURAL[node.role].toLowerCase() : node.band}`;
|
|
250
264
|
const name = node.row ? counterpartyLabel(node.row) : node.label;
|
|
251
|
-
const role = node.role ? roleLabel(node.role) : node.band;
|
|
265
|
+
const role = node.row ? relationshipLabel(node.row) : node.role ? roleLabel(node.role) : node.band;
|
|
252
266
|
return `Open ${name}, ${role}`;
|
|
253
267
|
}
|
|
254
268
|
|
|
@@ -297,6 +311,9 @@ function FlowCard({ node, focusId, desktop, active, onPress, onHover }: {
|
|
|
297
311
|
node: PositionedNode; focusId?: string; desktop: boolean; active: boolean; onPress: () => void; onHover: (on: boolean) => void;
|
|
298
312
|
}) {
|
|
299
313
|
const colors = useThemeColors();
|
|
314
|
+
// The chosen card is the flow's cursor: quieter while the pane does not have the keys.
|
|
315
|
+
const selectionFill = useSelectionFill();
|
|
316
|
+
const chosenText = (own: string) => (selectionFill.lit ? colors.selectedText : selectionFill.ink(own));
|
|
300
317
|
const role = node.role;
|
|
301
318
|
const accent = role ? ROLE_COLORS[role] : colors.textMuted;
|
|
302
319
|
const company = node.row ? counterpartyKind(node.row) === "company" : false;
|
|
@@ -307,7 +324,7 @@ function FlowCard({ node, focusId, desktop, active, onPress, onHover }: {
|
|
|
307
324
|
const nameWidth = Math.max(4, inner - (ticker ? displayWidth(ticker) + 1 : 0));
|
|
308
325
|
const titleColor = node.more ? colors.textDim : company ? colors.textBright : colors.text;
|
|
309
326
|
return <Box position="absolute" left={node.x} top={node.y} width={node.width} height={node.more ? 1 : node.height} flexDirection="column"
|
|
310
|
-
backgroundColor={desktop ? undefined : node.more ? undefined : active ?
|
|
327
|
+
backgroundColor={desktop ? undefined : node.more ? undefined : active ? selectionFill.bg : blendHex(colors.bg, accent, 0.12)}
|
|
311
328
|
// The card, in the relationship's colour; "+N more" is the same card without a fill, its rule dotted.
|
|
312
329
|
style={desktop ? { ...cardSurfaceStyle({ selected: active, accent, padding: "0 var(--gloom-space-sm)" }),
|
|
313
330
|
...(node.more ? { background: "transparent", borderLeftStyle: "dotted" } : {}), cursor: "pointer" } : undefined}
|
|
@@ -316,12 +333,12 @@ function FlowCard({ node, focusId, desktop, active, onPress, onHover }: {
|
|
|
316
333
|
{/* The ticker shows only beside the whole name. On the desktop that is CSS: the row wraps, one line shows, and a ticker that does not fit goes to the hidden line. */}
|
|
317
334
|
<Box flexDirection="row" height={1} overflow="hidden" style={desktop ? { flexWrap: "wrap" } : undefined}>
|
|
318
335
|
{!desktop ? <Text fg={node.more ? colors.textMuted : accent}>▍</Text> : null}
|
|
319
|
-
<ClippedText fg={active && !desktop ?
|
|
336
|
+
<ClippedText fg={active && !desktop ? chosenText(titleColor) : titleColor} attributes={company ? TextAttributes.BOLD : 0} text={name} width={nameWidth} />
|
|
320
337
|
{ticker && (desktop || displayWidth(name) + displayWidth(ticker) + 1 <= inner)
|
|
321
|
-
? <Text fg={colors.textDim} style={desktop ? { flex: "0 0 auto" } : undefined}>{` ${ticker}`}</Text> : null}
|
|
338
|
+
? <Text fg={active && !desktop ? selectionFill.ink(colors.textDim) : colors.textDim} style={desktop ? { flex: "0 0 auto" } : undefined}>{` ${ticker}`}</Text> : null}
|
|
322
339
|
</Box>
|
|
323
340
|
{metric ? <Box height={1} paddingLeft={desktop ? 0 : 1} overflow="hidden">
|
|
324
|
-
<ClippedText fg={active && !desktop ? colors.
|
|
341
|
+
<ClippedText fg={active && !desktop ? chosenText(colors.textDim) : colors.textDim} text={metric} width={inner - (desktop ? 0 : 1)} />
|
|
325
342
|
</Box> : null}
|
|
326
343
|
</Box>;
|
|
327
344
|
}
|
|
@@ -350,7 +367,7 @@ function FlowTooltip({ node, focusId, width, desktop, anchor }: { node: Position
|
|
|
350
367
|
const share = shareParts(row, focusId);
|
|
351
368
|
const lines = [
|
|
352
369
|
share ? `${share.value} ${share.basis}` : nativeValue(row) !== null || row.usd !== null ? disclosedValue(row) : "No figure disclosed",
|
|
353
|
-
`${
|
|
370
|
+
`${relationshipLabel(row)} · ${periodText(row)}`,
|
|
354
371
|
trustTier(row) === 1
|
|
355
372
|
? `${evidenceLabel(row)} · ${entityTicker(row.reportingEntity) ?? row.reportingEntity.name} ${row.form ?? "filing"}${row.filedDate ? ` filed ${row.filedDate}` : ""}`
|
|
356
373
|
: `${evidenceLabel(row)} · ${evidenceDate(row)}`,
|
|
@@ -39,7 +39,7 @@ export function validateGraph(data: GraphPayload): GraphPayload {
|
|
|
39
39
|
const link = links.get(key), a = entry.nodeIds[index], b = entry.nodeIds[index + 1];
|
|
40
40
|
if (!link || !(link.from === a && link.to === b || link.to === a && link.from === b)) throw 0;
|
|
41
41
|
});
|
|
42
|
-
if (entry.exposure && (entry.linkIds.some(id => graphEvidenceRow(links.get(id)!.evidence.find(item => item.id === links.get(id)!.primaryEvidenceId)!).tier !== 1) || entry.exposure.estimated !==
|
|
42
|
+
if (entry.exposure && (entry.linkIds.some(id => graphEvidenceRow(links.get(id)!.evidence.find(item => item.id === links.get(id)!.primaryEvidenceId)!).tier !== 1) || entry.exposure.estimated !== entry.hops > 1 || !Number.isFinite(entry.exposure.pct) || entry.exposure.pct < 0 || entry.exposure.pct > 100
|
|
43
43
|
|| !entry.nodeIds.includes(entry.exposure.denominatorEntityId) || !["revenue", "receivables", "cost", "purchases"].includes(entry.exposure.basis) || !validPeriodMonths(entry.exposure.periodMonths))) throw 0;
|
|
44
44
|
};
|
|
45
45
|
data.paths.forEach(path);
|
|
@@ -12,7 +12,7 @@ export function graphEvidenceRow(evidence: GraphEvidence): SupplyRow {
|
|
|
12
12
|
pctOfRevenue: evidence.pctOfRevenue ?? null, pctBasis: evidence.pctBasis ?? null, pctScope: evidence.pctScope ?? null,
|
|
13
13
|
usd: evidence.usd ?? null, usdBasis: evidence.usdBasis ?? null,
|
|
14
14
|
nativeAmount: evidence.nativeAmount ?? null, nativeCurrency: evidence.nativeCurrency ?? null, nativeScale: evidence.nativeScale ?? null,
|
|
15
|
-
jurisdiction: evidence.jurisdiction, entityScope: evidence.entityScope,
|
|
15
|
+
jurisdiction: evidence.jurisdiction, entityScope: evidence.entityScope, ...(evidence.relatedParty ? { relatedParty: true } : {}),
|
|
16
16
|
confidence: evidence.confidence, quote: evidence.quote, quoteLanguage: evidence.quoteLanguage ?? null,
|
|
17
17
|
quoteGloss: evidence.quoteGloss, sectionRef: evidence.sectionRef, sourceAttribution: evidence.sourceAttribution,
|
|
18
18
|
quoteMatchMode: evidence.quoteMatchMode ?? null, filingUrl: evidence.filingUrl, accession: evidence.accession ?? null,
|
|
@@ -12,6 +12,13 @@ export const entityKey = (entity: SupplyEntity) => entity.ticker ? publicTickerK
|
|
|
12
12
|
export const entityTicker = (entity: Pick<SupplyEntity, "ticker" | "exchange">) =>
|
|
13
13
|
entity.ticker && entity.exchange && !isUsListingExchange(entity.exchange) ? getListingSymbol(entity.ticker, entity.exchange) : entity.ticker;
|
|
14
14
|
export const entityLabel = (entity: SupplyEntity) => entityTicker(entity) ?? entity.name;
|
|
15
|
+
/**
|
|
16
|
+
* A trade link whose every disclosure is a related-party (connected) trade,
|
|
17
|
+
* as the server labels a table row: the graph names it one rather than a
|
|
18
|
+
* plain supplier or customer.
|
|
19
|
+
*/
|
|
20
|
+
export const relatedPartyLink = (link: Pick<GraphPayload["links"][number], "relationship" | "evidence">) =>
|
|
21
|
+
link.relationship === "commerce" && link.evidence.length > 0 && link.evidence.every(item => item.relatedParty === true);
|
|
15
22
|
/**
|
|
16
23
|
* A route in the direction goods move: a supplier's route ends at the focus
|
|
17
24
|
* company ("WPM → NEM" for a streamer buying from a miner), a customer's
|
|
@@ -22,11 +29,15 @@ export function pathLabel(path: GraphPath, data: GraphPayload) {
|
|
|
22
29
|
const labels = path.nodeIds.map(id => nodes.get(id) ? entityLabel(nodes.get(id)!) : id);
|
|
23
30
|
return (path.id.startsWith("upstream|") ? labels.reverse() : labels).join(" → ");
|
|
24
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* "6% est. of A revenue" for a product of shares along a route; one hop's
|
|
34
|
+
* share is the one its report files, "4.5% of A revenue", never an estimate.
|
|
35
|
+
*/
|
|
25
36
|
export function exposureLabel(path: GraphPath, data: GraphPayload) {
|
|
26
37
|
const exposure = path.exposure;
|
|
27
38
|
if (!exposure) return "--";
|
|
28
39
|
const denominator = data.nodes.find(node => node.id === exposure.denominatorEntityId);
|
|
29
|
-
return `${Number(exposure.pct.toPrecision(4))}
|
|
40
|
+
return `${Number(exposure.pct.toPrecision(4))}%${exposure.estimated ? " est." : ""} of ${denominator ? entityLabel(denominator) : exposure.denominatorEntityId} ${exposure.basis}`;
|
|
30
41
|
}
|
|
31
42
|
export interface GraphNode { entity: SupplyEntity; column: number; hops: number; path: GraphPath | null; related: boolean; }
|
|
32
43
|
/** A selected path has priority over other positions so every highlighted hop remains connected. */
|