@modernrelay/orbit-react 0.13.6 → 0.14.0
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/dist/{chunk-DGFLU2SN.js → chunk-DTXFQLNP.js} +2 -2
- package/dist/chunk-DTXFQLNP.js.map +1 -0
- package/dist/{chunk-7XB47YST.js → chunk-NPOV5GA3.js} +2 -2
- package/dist/chunk-NPOV5GA3.js.map +1 -0
- package/dist/{chunk-QJ7JXQVK.js → chunk-ODOPSUI7.js} +4 -4
- package/dist/chunk-ODOPSUI7.js.map +1 -0
- package/dist/{chunk-JN7QCMFW.js → chunk-S36LHSNX.js} +2 -2
- package/dist/chunk-S36LHSNX.js.map +1 -0
- package/dist/components/ContextMenu.d.ts +4 -4
- package/dist/components/ContextMenu.js +2 -2
- package/dist/components/ContextMenu.js.map +1 -1
- package/dist/components/Histogram.d.ts +1 -1
- package/dist/components/Histogram.js +3 -3
- package/dist/components/Histogram.js.map +1 -1
- package/dist/components/Inspector.d.ts +20 -20
- package/dist/components/Inspector.js +1 -1
- package/dist/components/Inspector.js.map +1 -1
- package/dist/components/Legend.d.ts +9 -10
- package/dist/components/Legend.js +3 -3
- package/dist/components/Legend.js.map +1 -1
- package/dist/components/Minimap.d.ts +29 -29
- package/dist/components/Minimap.js +1 -1
- package/dist/components/Minimap.js.map +1 -1
- package/dist/components/Navigator.d.ts +24 -24
- package/dist/components/Navigator.js +3 -3
- package/dist/components/Navigator.js.map +1 -1
- package/dist/components/Search.d.ts +28 -28
- package/dist/components/Search.js +3 -3
- package/dist/components/Search.js.map +1 -1
- package/dist/components/SelectionActions.d.ts +3 -3
- package/dist/components/SelectionActions.js +1 -1
- package/dist/components/SelectionActions.js.map +1 -1
- package/dist/components/SimControls.d.ts +15 -16
- package/dist/components/SimControls.js +2 -2
- package/dist/components/SimControls.js.map +1 -1
- package/dist/components/Table.d.ts +4 -4
- package/dist/components/Table.js +1 -1
- package/dist/components/Table.js.map +1 -1
- package/dist/components/Timeline.d.ts +2 -2
- package/dist/components/Timeline.js +3 -3
- package/dist/components/Timeline.js.map +1 -1
- package/dist/components/Toolbar.d.ts +2 -2
- package/dist/components/Toolbar.js +1 -1
- package/dist/components/Toolbar.js.map +1 -1
- package/dist/components/Tooltip.d.ts +16 -16
- package/dist/components/Tooltip.js +1 -1
- package/dist/components/Tooltip.js.map +1 -1
- package/dist/index.d.ts +105 -106
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/dist/{shared-Bj3Gk219.d.ts → shared-n98tkXJe.d.ts} +3 -3
- package/package.json +2 -2
- package/dist/chunk-7XB47YST.js.map +0 -1
- package/dist/chunk-DGFLU2SN.js.map +0 -1
- package/dist/chunk-JN7QCMFW.js.map +0 -1
- package/dist/chunk-QJ7JXQVK.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -2,18 +2,18 @@ import { ReactNode, CSSProperties, RefAttributes, ReactElement } from 'react';
|
|
|
2
2
|
import { GraphSnapshotInput, Accessor, GraphNode, Scale, AcceptedEdge, LayoutKind, SimulationConfig, ThemeInput, MetricColumn, ScaleChannelInfo, GraphTheme, LabelConfig, AccessibilityConfig, NodeId, SubgraphSpec, FilterSpec, DimensionSpec, GroupSpec, GroupBySpec, ClusterSpec, ScaleLimits, WorkerFactoryOption, SearchResult, SearchUnavailableReason, CreateGraphInstanceOptions, SelectionState, DegradeEvent, GraphPerfSnapshot, ResolvedGroup, MetaEdge, JsonValue, ViewportState, GraphViewState, SetViewStateResult, PathOptions, PathResult, ExpandNodeResult, ResolvedCluster, BeginIngestOptions, IngestSession, TimelinePlayback, CrossfilterSession, MetricName, Revisions, GraphDiagnostic, GraphInstance, DimensionSummary, BrushState, EdgeId, InstanceStatus } from '@modernrelay/orbit-core';
|
|
3
3
|
import { EngineFactory, FitViewOptions } from '@modernrelay/orbit-core/engine';
|
|
4
4
|
export { G as GraphProvider, a as GraphProviderProps } from './GraphProvider-B8ITDXS0.js';
|
|
5
|
-
export { D as DEFAULT_CORNER_OFFSET, G as GraphCorner, a as GraphLabelsSurface, b as GraphOverlaySurface, u as useResolvedInstance } from './shared-
|
|
5
|
+
export { D as DEFAULT_CORNER_OFFSET, G as GraphCorner, a as GraphLabelsSurface, b as GraphOverlaySurface, u as useResolvedInstance } from './shared-n98tkXJe.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* <Graph> — the declarative React binding over a headless GraphInstance.
|
|
9
9
|
*
|
|
10
|
-
* Binding parity
|
|
10
|
+
* Binding parity: one committed render that changes multiple declarative
|
|
11
11
|
* props issues AT MOST ONE applyHostUpdate carrying exactly the changed keys,
|
|
12
12
|
* so a multi-prop commit produces exactly one store revision and at most one
|
|
13
13
|
* engine commit.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
/** Snapshot handed to `renderLegend
|
|
16
|
+
/** Snapshot handed to `renderLegend`: the active scale info per styling
|
|
17
17
|
* channel (null when the channel is not scale-valued) plus the resolved
|
|
18
18
|
* theme tokens. Recomputed on model/scope/render/theme store changes. */
|
|
19
19
|
interface GraphLegendRenderInfo<N = Record<string, unknown>> {
|
|
@@ -25,7 +25,7 @@ interface GraphProps<N = Record<string, unknown>, E = Record<string, unknown>> {
|
|
|
25
25
|
/** Engine factory; captured at first render — one factory per instance. */
|
|
26
26
|
engine: EngineFactory;
|
|
27
27
|
data?: GraphSnapshotInput<N, E>;
|
|
28
|
-
/** Constant, accessor, or
|
|
28
|
+
/** Constant, accessor, or Scale descriptor. Scale-valued props compare
|
|
29
29
|
* by canonical structural value — equal inline literals never reproject. */
|
|
30
30
|
nodeColor?: Accessor<GraphNode<N>, string> | Scale<string, N>;
|
|
31
31
|
nodeSize?: Accessor<GraphNode<N>, number> | Scale<number, N>;
|
|
@@ -33,127 +33,127 @@ interface GraphProps<N = Record<string, unknown>, E = Record<string, unknown>> {
|
|
|
33
33
|
linkWidth?: Accessor<AcceptedEdge<E>, number>;
|
|
34
34
|
layout?: LayoutKind;
|
|
35
35
|
simulation?: SimulationConfig;
|
|
36
|
-
/**
|
|
36
|
+
/** theme tokens: full GraphTheme, Partial over a named base, or the
|
|
37
37
|
* v0.1 `{background}` shorthand. Diffed structurally (JSON). */
|
|
38
38
|
theme?: ThemeInput;
|
|
39
|
-
/**
|
|
39
|
+
/** async metric columns, joined once with revision-gated admission.
|
|
40
40
|
* Diffed by array reference. */
|
|
41
41
|
metrics?: readonly MetricColumn[];
|
|
42
|
-
/**
|
|
42
|
+
/** image sprites: synchronous string-ref accessor (URL/blob ref/cache
|
|
43
43
|
* key — opaque to orbit). Diffed by reference. */
|
|
44
44
|
nodeImage?: (node: GraphNode<N>) => string | null;
|
|
45
|
-
/**
|
|
45
|
+
/** instanced arrowheads (capability-gated; inert when unsupported). */
|
|
46
46
|
edgeArrows?: boolean;
|
|
47
|
-
/**
|
|
47
|
+
/** runtime link-render toggle — a config-only commit. */
|
|
48
48
|
showLinks?: boolean;
|
|
49
|
-
/**
|
|
49
|
+
/** emphasis-ring toggle (default true). False clears the ring once and
|
|
50
50
|
* suppresses every driver (hover, focusNode, emphasizeNode). */
|
|
51
51
|
emphasisRing?: boolean;
|
|
52
|
-
/**
|
|
52
|
+
/** legend escape hatch: rendered inside the provider in a positioned
|
|
53
53
|
* wrapper (bottom-left) whenever provided; re-invoked when scale info or
|
|
54
54
|
* theme changes. Return custom JSX, or compose <GraphLegend> from
|
|
55
55
|
* '@modernrelay/orbit-react/components/Legend' for the built-in rendering. */
|
|
56
56
|
renderLegend?: (info: GraphLegendRenderInfo<N>) => ReactNode;
|
|
57
|
-
/**
|
|
57
|
+
/** DOM label lane; forwarded through applyHostUpdate. `enabled: false`
|
|
58
58
|
* also unmounts the <LabelLayer> overlay entirely. */
|
|
59
59
|
labels?: LabelConfig<N>;
|
|
60
|
-
/**
|
|
60
|
+
/** accessibility runtime options; forwarded through applyHostUpdate
|
|
61
61
|
* and mirrored onto the container ARIA surface / live region. */
|
|
62
62
|
accessibility?: AccessibilityConfig<N>;
|
|
63
|
-
/** Class hook applied to every DOM label div
|
|
63
|
+
/** Class hook applied to every DOM label div. */
|
|
64
64
|
labelClassName?: string;
|
|
65
65
|
/** Escape hatch: custom label content rendered INSIDE the positioned label
|
|
66
|
-
* div
|
|
66
|
+
* div, replacing the default text node. */
|
|
67
67
|
renderNodeLabel?: (ctx: {
|
|
68
68
|
node: GraphNode<N>;
|
|
69
69
|
text: string;
|
|
70
70
|
}) => ReactNode;
|
|
71
|
-
/** Class hook applied to
|
|
72
|
-
* `labelClassName
|
|
71
|
+
/** Class hook applied to cluster label divs, in addition to
|
|
72
|
+
* `labelClassName`. */
|
|
73
73
|
clusterLabelClassName?: string;
|
|
74
74
|
/** Escape hatch: custom cluster-label content (replaces the default text
|
|
75
|
-
* node;
|
|
76
|
-
* click selects
|
|
75
|
+
* node; text-node-only rendering otherwise). `memberIds` are the ids a
|
|
76
|
+
* click selects. */
|
|
77
77
|
renderClusterLabel?: (ctx: {
|
|
78
78
|
clusterKey: string;
|
|
79
79
|
text: string;
|
|
80
80
|
memberIds: readonly NodeId[];
|
|
81
81
|
}) => ReactNode;
|
|
82
82
|
/** Controlled selection of the NODE namespace; providing it once flips
|
|
83
|
-
* ownership permanently
|
|
83
|
+
* ownership permanently. Edge/group namespaces stay instance-owned. */
|
|
84
84
|
selection?: readonly NodeId[];
|
|
85
|
-
/**
|
|
85
|
+
/** hard scope: feed ONLY the resolved subset through the reconciler;
|
|
86
86
|
* `null` restores the full accepted model. Diffed STRUCTURALLY (specs are
|
|
87
87
|
* small), so a new-but-equal object is a no-op. UNCONTROLLED-ONLY in v0.5:
|
|
88
|
-
* this prop and isolateSelection
|
|
88
|
+
* this prop and isolateSelection/resetIsolation write the same
|
|
89
89
|
* instance-owned state — last writer wins, and omitting the prop leaves
|
|
90
90
|
* the last written scope in place. */
|
|
91
91
|
subgraph?: SubgraphSpec | null;
|
|
92
|
-
/**
|
|
92
|
+
/** soft filter: mask (hide/dim) with ZERO relayout; `null` clears.
|
|
93
93
|
* Diffed by canonical structural compare — serializable exprs by JSON,
|
|
94
94
|
* function predicates by reference — so a new-but-equal spec never
|
|
95
95
|
* re-publishes (and the core no-ops canonical-equal specs regardless). */
|
|
96
96
|
filter?: FilterSpec<N, E> | null;
|
|
97
|
-
/**
|
|
98
|
-
* — reach it via useGraphCrossfilter or handle.getCrossfilterSession
|
|
97
|
+
/** crossfilter dimensions (declarative; brushes live on the session
|
|
98
|
+
* — reach it via useGraphCrossfilter or handle.getCrossfilterSession).
|
|
99
99
|
* Forwarded on array-reference change; the core no-ops when every
|
|
100
100
|
* DimensionSpec element is reference-equal. */
|
|
101
101
|
crossfilter?: readonly DimensionSpec<N>[];
|
|
102
|
-
/**
|
|
102
|
+
/** manual groups; `null` clears. Diffed STRUCTURALLY (equal inline
|
|
103
103
|
* literals never re-forward). Providing it once flips the groups slice to
|
|
104
|
-
* CONTROLLED
|
|
104
|
+
* CONTROLLED: handle ops then fire onGroupsChange with the next
|
|
105
105
|
* array instead of writing — reflect it back here. Config error together
|
|
106
|
-
* with `groupBy
|
|
106
|
+
* with `groupBy`. */
|
|
107
107
|
groups?: readonly GroupSpec[] | null;
|
|
108
|
-
/**
|
|
108
|
+
/** derived grouping; `null` clears. Reference-diffed (the spec
|
|
109
109
|
* carries a function accessor); the core additionally no-ops structurally
|
|
110
|
-
* equal respecs. Membership under groupBy is derived and READ-ONLY
|
|
110
|
+
* equal respecs. Membership under groupBy is derived and READ-ONLY
|
|
111
111
|
* groupNodes/ungroup become config errors; setGroupCollapsed toggles the
|
|
112
|
-
* instance-owned per-key collapsed residue
|
|
112
|
+
* instance-owned per-key collapsed residue. */
|
|
113
113
|
groupBy?: GroupBySpec<N> | null;
|
|
114
|
-
/**
|
|
114
|
+
/** stage-4 non-collapsing clusters; `null` clears (D2).
|
|
115
115
|
* Reference-diffed (the spec carries a function accessor). Clusters PRESERVE
|
|
116
116
|
* every node and edge — they never collapse anything — so they coexist with
|
|
117
|
-
* `groups`/`groupBy`. Their labels ride the
|
|
117
|
+
* `groups`/`groupBy`. Their labels ride the overlay lane under
|
|
118
118
|
* `labels.maxZoom` and select their member nodes on click. */
|
|
119
119
|
clusters?: ClusterSpec<N> | null;
|
|
120
|
-
/**
|
|
120
|
+
/** PERSISTENT pins — independent of transient drag
|
|
121
121
|
* pinning: the engine receives the UNION, so releasing a drag on a
|
|
122
122
|
* persistently-pinned node leaves it pinned. Providing it once latches the
|
|
123
|
-
* slice controlled
|
|
123
|
+
* slice controlled: handle ops then fire onPinnedChange with the
|
|
124
124
|
* next array instead of writing. `null` clears (D2). */
|
|
125
125
|
pinnedNodeIds?: readonly NodeId[] | null;
|
|
126
|
-
/**
|
|
126
|
+
/** node attr fields the DEFAULT search service indexes (ids always).
|
|
127
127
|
* Absent = id-only search — the service never guesses attr names.
|
|
128
128
|
* CONSTRUCTION-ONLY (D7, spec host construction options): read once at
|
|
129
129
|
* mount; changing it requires a keyed remount (a changed prop warns once
|
|
130
130
|
* and is ignored). */
|
|
131
131
|
searchIndex?: readonly string[];
|
|
132
|
-
/**
|
|
132
|
+
/** Degradation-ladder thresholds. CONSTRUCTION-ONLY: read
|
|
133
133
|
* once at mount; a runtime change warns once and is ignored. */
|
|
134
134
|
limits?: Partial<ScaleLimits>;
|
|
135
|
-
/**
|
|
135
|
+
/** Execution mode. CONSTRUCTION-ONLY: read once
|
|
136
136
|
* at mount; a runtime change warns once and is ignored. Current worker
|
|
137
137
|
* cargo: columnar acceptance off-thread. */
|
|
138
138
|
execution?: 'auto' | 'main' | 'worker';
|
|
139
|
-
/**
|
|
139
|
+
/** Worker construction tri-option. CONSTRUCTION-ONLY. */
|
|
140
140
|
workerFactory?: WorkerFactoryOption;
|
|
141
|
-
/**
|
|
141
|
+
/** result contract: the instance-wide DEFAULT for an activated
|
|
142
142
|
* search result that cannot be focused ('not-loaded' | 'out-of-scope' |
|
|
143
143
|
* 'filtered'). `<GraphSearch onResultUnavailable>` overrides it locally;
|
|
144
144
|
* the host reacts explicitly (fetch/publish an overlay, reset isolation,
|
|
145
|
-
* alter filters) — search never mutates scope/filters itself
|
|
145
|
+
* alter filters) — search never mutates scope/filters itself. */
|
|
146
146
|
onSearchResultUnavailable?: (result: SearchResult, reason: SearchUnavailableReason) => void;
|
|
147
147
|
/** Captured at first render (instance construction option). Default true. */
|
|
148
148
|
fitViewOnFirstData?: boolean;
|
|
149
|
-
/**
|
|
149
|
+
/** service seam (instance construction option, D7): custom
|
|
150
150
|
* revision-aware services — most usefully an async `expansion` service
|
|
151
151
|
* backed by the host's own data source, so `expandNode`/the context menu's
|
|
152
152
|
* Expand run against the network instead of the built-in local-adjacency
|
|
153
153
|
* walk. CONSTRUCTION-ONLY: read once at mount; changing it requires a keyed
|
|
154
154
|
* remount. */
|
|
155
155
|
services?: CreateGraphInstanceOptions<N, E>['services'];
|
|
156
|
-
/** Shift+drag freeform lasso selection overlay
|
|
156
|
+
/** Shift+drag freeform lasso selection overlay. Default true. */
|
|
157
157
|
enableLasso?: boolean;
|
|
158
158
|
className?: string;
|
|
159
159
|
style?: CSSProperties;
|
|
@@ -181,31 +181,30 @@ interface GraphProps<N = Record<string, unknown>, E = Record<string, unknown>> {
|
|
|
181
181
|
x: number;
|
|
182
182
|
y: number;
|
|
183
183
|
}) => void;
|
|
184
|
-
/** Fires with the full namespaced SelectionState
|
|
184
|
+
/** Fires with the full namespaced SelectionState. */
|
|
185
185
|
onSelectionChange?: (payload: SelectionState) => void;
|
|
186
|
-
/**
|
|
186
|
+
/** ladder step engagement/disengagement (notification pattern). */
|
|
187
187
|
onDegrade?: (event: DegradeEvent) => void;
|
|
188
|
-
/**
|
|
188
|
+
/** throttled telemetry sample — never per frame. */
|
|
189
189
|
onPerfSample?: (snapshot: GraphPerfSnapshot) => void;
|
|
190
|
-
/**
|
|
191
|
-
* GraphNode (R-16.3-12). */
|
|
190
|
+
/** Fires on a super-node hit with the resolved group payload, never a GraphNode. */
|
|
192
191
|
onGroupClick?: (payload: {
|
|
193
192
|
group: ResolvedGroup;
|
|
194
193
|
metaKey?: boolean;
|
|
195
194
|
}) => void;
|
|
196
|
-
/**
|
|
195
|
+
/** Fires on a meta-edge hit with the MetaEdge record used by the count badge. */
|
|
197
196
|
onMetaEdgeClick?: (payload: {
|
|
198
197
|
metaEdge: MetaEdge;
|
|
199
198
|
}) => void;
|
|
200
|
-
/**
|
|
199
|
+
/** groups slice change callback: op results (uncontrolled), op
|
|
201
200
|
* INTENTS (controlled — reflect the array back into `groups`), and groupBy
|
|
202
201
|
* re-derivations (notification). Receives the resolved array. */
|
|
203
202
|
onGroupsChange?: (groups: readonly ResolvedGroup[]) => void;
|
|
204
|
-
/**
|
|
203
|
+
/** durable source coordinate — forwarded verbatim; serialized into
|
|
205
204
|
* view states and canonically compared on restore. Diffed by canonical
|
|
206
205
|
* JSON, so a new-but-equal object never re-forwards. */
|
|
207
206
|
dataRef?: JsonValue;
|
|
208
|
-
/**
|
|
207
|
+
/** aggregate restore intent (fires once per restore/history
|
|
209
208
|
* transaction touching a controlled slice or serialized styling): reflect
|
|
210
209
|
* every participating prop in ONE commit; matching values acknowledge. */
|
|
211
210
|
onViewStateRestore?: (intent: {
|
|
@@ -213,9 +212,9 @@ interface GraphProps<N = Record<string, unknown>, E = Record<string, unknown>> {
|
|
|
213
212
|
source: 'setViewState' | 'undo' | 'redo';
|
|
214
213
|
next: unknown;
|
|
215
214
|
}) => void;
|
|
216
|
-
/**
|
|
215
|
+
/** fired INSTEAD of applying a state whose dataRef mismatches. */
|
|
217
216
|
onViewStateMismatch?: (stored: JsonValue | undefined, current: JsonValue | undefined) => void;
|
|
218
|
-
/**
|
|
217
|
+
/** persistent-pin slice change: the applied set when
|
|
219
218
|
* uncontrolled, the INTENT when controlled. */
|
|
220
219
|
onPinnedChange?: (pinnedNodeIds: readonly NodeId[]) => void;
|
|
221
220
|
onViewportChange?: (v: ViewportState) => void;
|
|
@@ -234,24 +233,24 @@ interface GraphHandle<N = Record<string, unknown>, E = Record<string, unknown>>
|
|
|
234
233
|
durationMs?: number;
|
|
235
234
|
}): void;
|
|
236
235
|
focusNode(id: NodeId): void;
|
|
237
|
-
/**
|
|
236
|
+
/** ring-only emphasis, no camera move (null clears; unknown ids
|
|
238
237
|
* no-op). The keyboard-navigation analog of hover. */
|
|
239
238
|
emphasizeNode(id: NodeId | null): void;
|
|
240
|
-
/**
|
|
239
|
+
/** telemetry snapshot (never raw attrs or ids). */
|
|
241
240
|
getPerfSnapshot(): GraphPerfSnapshot;
|
|
242
241
|
/** Open the typed context menu for a node from host chrome (a list row, a
|
|
243
242
|
* custom label) — the same 'contextMenu' event the canvas gesture emits.
|
|
244
243
|
* `screen` is container-relative CSS px. */
|
|
245
244
|
requestNodeContextMenu(id: NodeId, screen: readonly [number, number]): void;
|
|
246
|
-
/**
|
|
245
|
+
/** serialize the exploration state (see core docs). */
|
|
247
246
|
getViewState(opts?: {
|
|
248
247
|
includePositions?: false;
|
|
249
248
|
}): GraphViewState;
|
|
250
|
-
/**
|
|
249
|
+
/** atomic restore; typed results, never partial. */
|
|
251
250
|
setViewState(raw: unknown, opts?: {
|
|
252
251
|
ignoreMismatch?: boolean;
|
|
253
252
|
}): Promise<SetViewStateResult>;
|
|
254
|
-
/**
|
|
253
|
+
/** picture export: 'png' via the engine screenshot; 'svg' via the
|
|
255
254
|
* engine-free exporter (typed export-too-large past the bound;
|
|
256
255
|
* raster-hybrid fallback available). */
|
|
257
256
|
exportImage(format: 'png'): Promise<Blob>;
|
|
@@ -259,20 +258,20 @@ interface GraphHandle<N = Record<string, unknown>, E = Record<string, unknown>>
|
|
|
259
258
|
maxSvgElements?: number;
|
|
260
259
|
fallback?: 'raster-hybrid';
|
|
261
260
|
}): Promise<string>;
|
|
262
|
-
/**
|
|
261
|
+
/** bounded object export; typed rejection past the limit. */
|
|
263
262
|
exportData(scope?: 'visible' | 'accepted', opts?: {
|
|
264
263
|
limit?: number;
|
|
265
264
|
}): Promise<{
|
|
266
265
|
nodes: readonly GraphNode<N>[];
|
|
267
266
|
edges: readonly AcceptedEdge<E>[];
|
|
268
267
|
}>;
|
|
269
|
-
/**
|
|
268
|
+
/** memory-bounded JSONL stream over one pinned revision. */
|
|
270
269
|
exportDataStream(scope?: 'visible' | 'accepted'): AsyncGenerator<string, void, undefined>;
|
|
271
|
-
/**
|
|
270
|
+
/** bounded id → [x, y] map (one position readback). */
|
|
272
271
|
exportLayout(opts?: {
|
|
273
272
|
limit?: number;
|
|
274
273
|
}): Promise<ReadonlyMap<NodeId, readonly [number, number]>>;
|
|
275
|
-
/**
|
|
274
|
+
/** layout JSONL stream over one pinned readback. */
|
|
276
275
|
exportLayoutStream(): AsyncGenerator<string, void, undefined>;
|
|
277
276
|
setSelection(ids: readonly NodeId[]): void;
|
|
278
277
|
clearSelection(): void;
|
|
@@ -299,16 +298,16 @@ interface GraphHandle<N = Record<string, unknown>, E = Record<string, unknown>>
|
|
|
299
298
|
clearPins(): void;
|
|
300
299
|
hideNodes(ids: readonly NodeId[]): void;
|
|
301
300
|
showAll(): void;
|
|
302
|
-
/** Hard-scope to the current node selection
|
|
301
|
+
/** Hard-scope to the current node selection; no-op when empty. */
|
|
303
302
|
isolateSelection(): void;
|
|
304
|
-
/** Clear the hard scope — the full accepted model returns
|
|
303
|
+
/** Clear the hard scope — the full accepted model returns. */
|
|
305
304
|
resetIsolation(): void;
|
|
306
|
-
/** Ego-expand `id` through the configured ExpansionService
|
|
305
|
+
/** Ego-expand `id` through the configured ExpansionService. */
|
|
307
306
|
expandNode(id: NodeId, opts?: {
|
|
308
307
|
hops?: number;
|
|
309
308
|
}): Promise<ExpandNodeResult>;
|
|
310
309
|
/** Abort `id`'s pending expansion and remove its committed expansion
|
|
311
|
-
* overlays
|
|
310
|
+
* overlays. */
|
|
312
311
|
retractExpansion(id: NodeId): void;
|
|
313
312
|
/** Add one group (same acyclic/singly-parented validation as the `groups` prop).
|
|
314
313
|
* Controlled mode fires onGroupsChange with the next array instead. */
|
|
@@ -332,14 +331,14 @@ interface GraphHandle<N = Record<string, unknown>, E = Record<string, unknown>>
|
|
|
332
331
|
/** Current clusters over the physical scene (keys, members, force center,
|
|
333
332
|
* settled centroid). Empty when no `clusters` prop is active. */
|
|
334
333
|
getClusters(): readonly ResolvedCluster[];
|
|
335
|
-
/** Select a cluster's MEMBER node ids
|
|
334
|
+
/** Select a cluster's MEMBER node ids; `additive` unions. */
|
|
336
335
|
selectCluster(key: string, opts?: {
|
|
337
336
|
additive?: boolean;
|
|
338
337
|
}): void;
|
|
339
|
-
/** Begin a bounded, cancellable ingest session
|
|
338
|
+
/** Begin a bounded, cancellable ingest session. */
|
|
340
339
|
beginIngest(opts: BeginIngestOptions): IngestSession<N, E>;
|
|
341
340
|
/** Atomically remove exactly one committed overlay; unknown ids are an
|
|
342
|
-
* idempotent `{ removed: false }
|
|
341
|
+
* idempotent `{ removed: false }`. */
|
|
343
342
|
removeOverlay(overlayId: string): {
|
|
344
343
|
removed: boolean;
|
|
345
344
|
};
|
|
@@ -355,11 +354,11 @@ interface GraphHandle<N = Record<string, unknown>, E = Record<string, unknown>>
|
|
|
355
354
|
/** The crossfilter session facade, or null until the `crossfilter` prop
|
|
356
355
|
* has configured dimensions over an accepted base. */
|
|
357
356
|
getCrossfilterSession(): CrossfilterSession | null;
|
|
358
|
-
/**
|
|
357
|
+
/** legend surface: the active Scale on a styling channel plus its
|
|
359
358
|
* resolved domain or categorical rows; null when not scale-valued. */
|
|
360
359
|
getScaleInfo(channel: 'nodeColor' | 'nodeSize'): ScaleChannelInfo<N> | null;
|
|
361
|
-
/**
|
|
362
|
-
* columns); null for unknown ids
|
|
360
|
+
/** metric read for one node id (built-in degree family + admitted
|
|
361
|
+
* columns); null for unknown ids or metrics and for null/non-finite values. */
|
|
363
362
|
getMetricValue(metric: MetricName, id: NodeId): number | null;
|
|
364
363
|
getRevisions(): Revisions;
|
|
365
364
|
getDiagnostics(): readonly GraphDiagnostic[];
|
|
@@ -370,20 +369,20 @@ type GraphComponent = <N = Record<string, unknown>, E = Record<string, unknown>>
|
|
|
370
369
|
declare const Graph: GraphComponent;
|
|
371
370
|
|
|
372
371
|
/**
|
|
373
|
-
* LabelLayer — the
|
|
372
|
+
* LabelLayer — the DOM label lane.
|
|
374
373
|
*
|
|
375
374
|
* Two-channel rendering against the pinned overlay interface:
|
|
376
|
-
*
|
|
377
|
-
*
|
|
378
|
-
*
|
|
379
|
-
*
|
|
380
|
-
*
|
|
381
|
-
*
|
|
382
|
-
*
|
|
375
|
+
* - `labels.subscribeCandidates` fires only when the candidate SET changes →
|
|
376
|
+
* React state → one absolutely-positioned <div> per candidate. Label text
|
|
377
|
+
* is rendered as a TEXT NODE only (never markup), so hostile strings in
|
|
378
|
+
* node attrs appear literally.
|
|
379
|
+
* - `labels.subscribePositions` fires on scheduler ticks with fresh x/y for
|
|
380
|
+
* the SAME set → imperative `style.transform` writes through refs keyed by
|
|
381
|
+
* id. No React re-render per tick (M0: the label lane is pure CPU O(k)).
|
|
383
382
|
*
|
|
384
|
-
* The layer is pointer-inert; label divs opt back in and drive the
|
|
383
|
+
* The layer is pointer-inert; label divs opt back in and drive the
|
|
385
384
|
* click-selection path through the same public mutators (replace on plain
|
|
386
|
-
* click
|
|
385
|
+
* click and toggle on meta/shift).
|
|
387
386
|
*/
|
|
388
387
|
|
|
389
388
|
interface LabelLayerProps {
|
|
@@ -394,11 +393,11 @@ interface LabelLayerProps {
|
|
|
394
393
|
node: GraphNode<any>;
|
|
395
394
|
text: string;
|
|
396
395
|
}) => ReactNode) | undefined;
|
|
397
|
-
/** Class hook applied to
|
|
396
|
+
/** Class hook applied to CLUSTER label divs (in addition to
|
|
398
397
|
* `labelClassName`), so the coarse layer can be styled apart. */
|
|
399
398
|
clusterLabelClassName?: string | undefined;
|
|
400
399
|
/** Escape hatch for cluster labels; `memberIds` are the ids a click
|
|
401
|
-
* selects
|
|
400
|
+
* selects. */
|
|
402
401
|
renderClusterLabel?: ((ctx: {
|
|
403
402
|
clusterKey: string;
|
|
404
403
|
text: string;
|
|
@@ -410,7 +409,7 @@ interface LabelLayerProps {
|
|
|
410
409
|
declare function LabelLayer(props: LabelLayerProps): ReactElement;
|
|
411
410
|
|
|
412
411
|
/**
|
|
413
|
-
* LiveRegion —
|
|
412
|
+
* LiveRegion — screen-reader announcements.
|
|
414
413
|
*
|
|
415
414
|
* A visually-hidden `aria-live="polite"` region adjacent to the canvas. It
|
|
416
415
|
* subscribes to the STORE (never the frame clock, so simulation frames can
|
|
@@ -437,61 +436,61 @@ declare function LiveRegion(props: LiveRegionProps): ReactElement;
|
|
|
437
436
|
*/
|
|
438
437
|
|
|
439
438
|
declare function useGraphInstance<N = Record<string, unknown>, E = Record<string, unknown>>(): GraphInstance<N, E>;
|
|
440
|
-
/** The full namespaced SelectionState
|
|
439
|
+
/** The full namespaced SelectionState; was `readonly NodeId[]` before
|
|
441
440
|
* v0.3 — read `.nodeIds` for the node namespace. */
|
|
442
441
|
declare function useGraphSelection(): SelectionState;
|
|
443
442
|
declare function useGraphHover(): NodeId | null;
|
|
444
443
|
declare function useGraphEdgeHover(): EdgeId | null;
|
|
445
|
-
/** The
|
|
444
|
+
/** The pin slice: node id → pinned space position. */
|
|
446
445
|
declare function useGraphPins(): ReadonlyMap<NodeId, readonly [number, number]>;
|
|
447
446
|
declare function useGraphViewport(): ViewportState | null;
|
|
448
447
|
declare function useGraphStatus(): InstanceStatus;
|
|
449
448
|
declare function useGraphDiagnostics(): readonly GraphDiagnostic[];
|
|
450
|
-
/** Whether the engine force simulation is currently running (
|
|
449
|
+
/** Whether the engine force simulation is currently running (drives the
|
|
451
450
|
* toolbar pause/resume affordance). */
|
|
452
451
|
declare function useGraphSimulationRunning(): boolean;
|
|
453
|
-
/** The active
|
|
452
|
+
/** The active hard scope (`subgraph`); null while the full accepted
|
|
454
453
|
* model is in view. Uncontrolled-only in v0.5: the `subgraph` prop and
|
|
455
|
-
* isolateSelection
|
|
454
|
+
* isolateSelection/resetIsolation write this same instance-owned state. */
|
|
456
455
|
declare function useGraphScope(): SubgraphSpec | null;
|
|
457
|
-
/** Node ids with an expansion in flight (
|
|
456
|
+
/** Node ids with an expansion in flight (loading affordance — drive
|
|
458
457
|
* spinners/ghost skeletons from this set). */
|
|
459
458
|
declare function useGraphPendingExpansions(): ReadonlySet<NodeId>;
|
|
460
|
-
/** Committed
|
|
459
|
+
/** Committed overlay ids for the current dataset. */
|
|
461
460
|
declare function useGraphOverlays(): readonly string[];
|
|
462
|
-
/**
|
|
461
|
+
/** soft-mask visibility counts: scene entities with zero hide-failures
|
|
463
462
|
* (equals the accepted counts when nothing masks). */
|
|
464
463
|
declare function useGraphVisible(): {
|
|
465
464
|
nodes: number;
|
|
466
465
|
edges: number;
|
|
467
466
|
};
|
|
468
|
-
/**
|
|
467
|
+
/** timeline playback state — at most one playing dimension key. */
|
|
469
468
|
declare function useGraphTimeline(): {
|
|
470
469
|
playingKey: string | null;
|
|
471
470
|
};
|
|
472
|
-
/**
|
|
471
|
+
/** History kernel depths for the full undo/redo walk. */
|
|
473
472
|
declare function useGraphHistory(): {
|
|
474
473
|
undoDepth: number;
|
|
475
474
|
redoDepth: number;
|
|
476
475
|
};
|
|
477
|
-
/**
|
|
476
|
+
/** Resolved theme tokens: the merged GraphTheme currently driving
|
|
478
477
|
* engine config, projection fallbacks, and mask dim alpha (`store.theme`).
|
|
479
478
|
* Style legend chrome, tooltips, and other host overlays from these tokens. */
|
|
480
479
|
declare function useGraphTheme(): GraphTheme;
|
|
481
|
-
/** The last completed
|
|
482
|
-
* a successful `instance.search`, null after `clearSearch
|
|
483
|
-
* swap. Drives `<GraphSearch>`'s result list and the
|
|
480
|
+
/** The last completed search (`store.search`): `{query, results}` after
|
|
481
|
+
* a successful `instance.search`, null after `clearSearch` / a dataset
|
|
482
|
+
* swap. Drives `<GraphSearch>`'s result list and the navigator's
|
|
484
483
|
* search-results section. */
|
|
485
484
|
declare function useGraphSearch(): {
|
|
486
485
|
query: string;
|
|
487
486
|
results: readonly SearchResult[];
|
|
488
487
|
} | null;
|
|
489
|
-
/**
|
|
490
|
-
*
|
|
491
|
-
* 'not-loaded' | 'out-of-scope' | 'filtered'. The host reacts explicitly
|
|
492
|
-
*
|
|
488
|
+
/** `onSearchResultUnavailable` callback type: fired when an activated result
|
|
489
|
+
* cannot be focused; `reason` is
|
|
490
|
+
* 'not-loaded' | 'out-of-scope' | 'filtered'. The host reacts explicitly;
|
|
491
|
+
* Orbit never changes scope/filters behind the user's back. */
|
|
493
492
|
type SearchResultUnavailableCallback = (result: SearchResult, reason: SearchUnavailableReason) => void;
|
|
494
|
-
/** One
|
|
493
|
+
/** One crossfilter dimension: live summary + brush + a setter. */
|
|
495
494
|
interface GraphCrossfilterDimension {
|
|
496
495
|
/** Null until the `crossfilter` prop builds the dimension over data. */
|
|
497
496
|
summary: DimensionSummary | null;
|
|
@@ -499,7 +498,7 @@ interface GraphCrossfilterDimension {
|
|
|
499
498
|
setBrush: (brush: BrushState) => void;
|
|
500
499
|
}
|
|
501
500
|
/**
|
|
502
|
-
* Subscribe to one crossfilter dimension by key
|
|
501
|
+
* Subscribe to one crossfilter dimension by key. Re-reads
|
|
503
502
|
* summarize/getBrush on session notify; resolves the session lazily (null
|
|
504
503
|
* summary until the `crossfilter` prop builds dimensions over an accepted
|
|
505
504
|
* base — the store publishes when they do).
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { setSearchResultUnavailableCallback, useScaleInfoSubscription } from './chunk-
|
|
2
|
-
export { useGraphCrossfilter, useGraphDiagnostics, useGraphEdgeHover, useGraphHistory, useGraphHover, useGraphInstance, useGraphOverlays, useGraphPendingExpansions, useGraphPins, useGraphScope, useGraphSearch, useGraphSelection, useGraphSimulationRunning, useGraphStatus, useGraphTheme, useGraphTimeline, useGraphViewport, useGraphVisible } from './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import { overlayLayerStyle, overlaySurface, GraphProvider, visuallyHiddenStyle, useAmbientGraphInstance } from './chunk-
|
|
5
|
-
export { DEFAULT_CORNER_OFFSET, GraphProvider, useResolvedInstance } from './chunk-
|
|
1
|
+
import { setSearchResultUnavailableCallback, useScaleInfoSubscription } from './chunk-ODOPSUI7.js';
|
|
2
|
+
export { useGraphCrossfilter, useGraphDiagnostics, useGraphEdgeHover, useGraphHistory, useGraphHover, useGraphInstance, useGraphOverlays, useGraphPendingExpansions, useGraphPins, useGraphScope, useGraphSearch, useGraphSelection, useGraphSimulationRunning, useGraphStatus, useGraphTheme, useGraphTimeline, useGraphViewport, useGraphVisible } from './chunk-ODOPSUI7.js';
|
|
3
|
+
import './chunk-S36LHSNX.js';
|
|
4
|
+
import { overlayLayerStyle, overlaySurface, GraphProvider, visuallyHiddenStyle, useAmbientGraphInstance } from './chunk-NPOV5GA3.js';
|
|
5
|
+
export { DEFAULT_CORNER_OFFSET, GraphProvider, useResolvedInstance } from './chunk-NPOV5GA3.js';
|
|
6
6
|
import { forwardRef, useState, useRef, useLayoutEffect, useEffect, useImperativeHandle, useId, useCallback, useMemo } from 'react';
|
|
7
7
|
import { createGraphInstance, canonicalJson, sameGroupSpecArrays, canonicalScaleKey } from '@modernrelay/orbit-core';
|
|
8
8
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
@@ -398,7 +398,7 @@ function GraphInner(props, ref) {
|
|
|
398
398
|
if (props.limits !== initialLimitsRef.current && !limitsWarnedRef.current) {
|
|
399
399
|
limitsWarnedRef.current = true;
|
|
400
400
|
console.warn(
|
|
401
|
-
"orbit: `limits` is a construction-only prop
|
|
401
|
+
"orbit: `limits` is a construction-only prop \u2014 the runtime change is ignored; remount with a key to apply new thresholds."
|
|
402
402
|
);
|
|
403
403
|
}
|
|
404
404
|
const executionWarnedRef = useRef(false);
|
|
@@ -406,7 +406,7 @@ function GraphInner(props, ref) {
|
|
|
406
406
|
if (props.execution !== initialExecutionRef.current && !executionWarnedRef.current) {
|
|
407
407
|
executionWarnedRef.current = true;
|
|
408
408
|
console.warn(
|
|
409
|
-
"orbit: `execution` is a construction-only prop
|
|
409
|
+
"orbit: `execution` is a construction-only prop \u2014 the runtime change is ignored; remount with a key to switch lanes."
|
|
410
410
|
);
|
|
411
411
|
}
|
|
412
412
|
const containerRef = useRef(null);
|
|
@@ -617,7 +617,7 @@ function GraphInner(props, ref) {
|
|
|
617
617
|
if (prev !== null && !sameIdArrays(prev.searchIndex ?? [], props.searchIndex ?? []) && !searchIndexWarnedRef.current) {
|
|
618
618
|
searchIndexWarnedRef.current = true;
|
|
619
619
|
console.warn(
|
|
620
|
-
"[orbit] searchIndex is construction-only
|
|
620
|
+
"[orbit] searchIndex is construction-only: the changed value was ignored \u2014 key-remount <Graph> to change it"
|
|
621
621
|
);
|
|
622
622
|
}
|
|
623
623
|
prevRef.current = {
|