@petrarca/sonnet-graph 0.1.6
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/LICENSE.md +190 -0
- package/dist/index.d.ts +858 -0
- package/dist/index.js +4074 -0
- package/dist/index.js.map +1 -0
- package/package.json +56 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,858 @@
|
|
|
1
|
+
import * as zustand from 'zustand';
|
|
2
|
+
import { UseBoundStore, StoreApi } from 'zustand';
|
|
3
|
+
import * as react from 'react';
|
|
4
|
+
import react__default, { ReactNode } from 'react';
|
|
5
|
+
import { GraphEdge, GraphNode } from 'reagraph';
|
|
6
|
+
import cytoscape from 'cytoscape';
|
|
7
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Visual Graph Model - Domain types combining API data with UI enrichment.
|
|
11
|
+
*
|
|
12
|
+
* These types are the canonical graph representation used throughout the application.
|
|
13
|
+
* They combine backend API data (GraphNode/GraphEdge DTOs) with visual enrichment
|
|
14
|
+
* (colors, display names, etc.) computed once at the data boundary.
|
|
15
|
+
*
|
|
16
|
+
* This is an internal refactoring - NO functional changes to the application.
|
|
17
|
+
* All behavior, visuals, and capabilities remain identical.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Visual enrichment data for a node.
|
|
21
|
+
* Computed once during data ingress, then reused everywhere.
|
|
22
|
+
*/
|
|
23
|
+
interface NodeVisual {
|
|
24
|
+
/** User-friendly name extracted from properties (name, title, label, etc.) */
|
|
25
|
+
displayName: string;
|
|
26
|
+
/** Color from unified palette based on node label */
|
|
27
|
+
color: string;
|
|
28
|
+
/** Optional: Node size (can be computed from degree, importance, etc.) */
|
|
29
|
+
size?: number;
|
|
30
|
+
/** Optional: Icon URL for the node */
|
|
31
|
+
icon?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Visual enrichment data for an edge.
|
|
35
|
+
*/
|
|
36
|
+
interface EdgeVisual {
|
|
37
|
+
/** Edge color (typically based on type or neutral color) */
|
|
38
|
+
color: string;
|
|
39
|
+
/** Optional: Edge thickness/width */
|
|
40
|
+
size?: number;
|
|
41
|
+
/** Optional: Whether to render as dashed line */
|
|
42
|
+
dashed?: boolean;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* VisualGraphNode - The canonical node type for the application.
|
|
46
|
+
*
|
|
47
|
+
* Combines API data (aligned with backend GraphNode DTO) with visual enrichment.
|
|
48
|
+
* This replaces the previous pattern of using reagraph GraphNode types throughout
|
|
49
|
+
* the application, which caused coupling to the visualization library.
|
|
50
|
+
*
|
|
51
|
+
* Structure matches backend API exactly:
|
|
52
|
+
* - id_: Unique node identifier
|
|
53
|
+
* - label_: Node type/class (e.g., "Person", "Movie")
|
|
54
|
+
* - properties_: Key-value pairs from the database
|
|
55
|
+
*
|
|
56
|
+
* Plus visual enrichment for UI consistency:
|
|
57
|
+
* - visual.displayName: Computed once from properties
|
|
58
|
+
* - visual.color: Assigned once from unified palette
|
|
59
|
+
*/
|
|
60
|
+
interface VisualGraphNode {
|
|
61
|
+
id_: number;
|
|
62
|
+
label_: string;
|
|
63
|
+
properties_: Record<string, string | number | Array<string | number>>;
|
|
64
|
+
visual: NodeVisual;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* VisualGraphEdge - The canonical edge type for the application.
|
|
68
|
+
*
|
|
69
|
+
* Combines API data (aligned with backend GraphEdge DTO) with visual enrichment.
|
|
70
|
+
*
|
|
71
|
+
* Structure matches backend API exactly:
|
|
72
|
+
* - id_: Unique edge identifier
|
|
73
|
+
* - label_: Relationship type (e.g., "ACTED_IN", "DIRECTED")
|
|
74
|
+
* - start_id_: Source node ID
|
|
75
|
+
* - end_id_: Target node ID
|
|
76
|
+
* - properties_: Optional key-value pairs
|
|
77
|
+
*
|
|
78
|
+
* Plus visual enrichment for UI consistency.
|
|
79
|
+
*/
|
|
80
|
+
interface VisualGraphEdge {
|
|
81
|
+
id_: number;
|
|
82
|
+
label_: string;
|
|
83
|
+
start_id_: number;
|
|
84
|
+
end_id_: number;
|
|
85
|
+
properties_?: Record<string, string | number | Array<string | number>>;
|
|
86
|
+
visual: EdgeVisual;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Normalized graph structure using visual models.
|
|
90
|
+
*
|
|
91
|
+
* Provides O(1) lookup by ID for efficient access in components.
|
|
92
|
+
* This is the internal representation used by the application after
|
|
93
|
+
* data is fetched and enriched.
|
|
94
|
+
*/
|
|
95
|
+
interface VisualGraphNormalized {
|
|
96
|
+
/** Nodes indexed by string ID for O(1) lookup */
|
|
97
|
+
nodesById: Record<string, VisualGraphNode>;
|
|
98
|
+
/** Edges indexed by string ID for O(1) lookup */
|
|
99
|
+
edgesById: Record<string, VisualGraphEdge>;
|
|
100
|
+
/** Array of all node IDs (for iteration) */
|
|
101
|
+
nodeIds: string[];
|
|
102
|
+
/** Array of all edge IDs (for iteration) */
|
|
103
|
+
edgeIds: string[];
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Type guard to check if an object is a VisualGraphNode.
|
|
107
|
+
*
|
|
108
|
+
* @param obj - Object to check
|
|
109
|
+
* @returns true if obj is a valid VisualGraphNode
|
|
110
|
+
*/
|
|
111
|
+
declare function isVisualNode(obj: unknown): obj is VisualGraphNode;
|
|
112
|
+
/**
|
|
113
|
+
* Type guard to check if an object is a VisualGraphEdge.
|
|
114
|
+
*
|
|
115
|
+
* @param obj - Object to check
|
|
116
|
+
* @returns true if obj is a valid VisualGraphEdge
|
|
117
|
+
*/
|
|
118
|
+
declare function isVisualEdge(obj: unknown): obj is VisualGraphEdge;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Package-local raw graph types.
|
|
122
|
+
*
|
|
123
|
+
* These are the minimal structural types needed by the graph visualization layer.
|
|
124
|
+
* They are structurally compatible with the API DTO types in `api/types.ts`
|
|
125
|
+
* (GraphNode, GraphEdge) but live in the domain layer so graph-generic code
|
|
126
|
+
* does not depend on API/transport types.
|
|
127
|
+
*/
|
|
128
|
+
type GraphProperty = string | number | Array<string | number>;
|
|
129
|
+
type GraphProperties = Record<string, GraphProperty>;
|
|
130
|
+
type RawGraphNode = {
|
|
131
|
+
id_?: number;
|
|
132
|
+
label_: string;
|
|
133
|
+
properties_?: GraphProperties;
|
|
134
|
+
};
|
|
135
|
+
type RawGraphEdge = {
|
|
136
|
+
id_?: number;
|
|
137
|
+
label_: string;
|
|
138
|
+
start_id_: number;
|
|
139
|
+
end_id_: number;
|
|
140
|
+
properties_?: GraphProperties;
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* Type guard to check if an object is a RawGraphNode (vs RawGraphEdge).
|
|
144
|
+
* Edges have start_id_ and end_id_ properties, nodes don't.
|
|
145
|
+
*/
|
|
146
|
+
declare function isRawGraphNode(obj: RawGraphNode | RawGraphEdge): obj is RawGraphNode;
|
|
147
|
+
/**
|
|
148
|
+
* Display configuration from schema metadata.
|
|
149
|
+
* Mirrors api/types.ts DisplayConfig but lives in the domain layer so
|
|
150
|
+
* graph-generic code (enrichment, extraction) does not depend on API types.
|
|
151
|
+
*/
|
|
152
|
+
type GraphDisplayConfig = {
|
|
153
|
+
labelTemplate?: string;
|
|
154
|
+
labelProperty?: string;
|
|
155
|
+
fallbackProperty?: string;
|
|
156
|
+
sortProperty?: string;
|
|
157
|
+
sortOrder?: "ASC" | "DESC";
|
|
158
|
+
filterProperty?: string;
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* Resolved display config map: node label → GraphDisplayConfig.
|
|
162
|
+
* Built once from schema data and passed into enrichNodes().
|
|
163
|
+
* Only labels with explicit display config appear in this map.
|
|
164
|
+
*/
|
|
165
|
+
type LabelDisplayMap = Record<string, GraphDisplayConfig>;
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Graph data enrichment - Converts API DTOs to Visual Graph Models.
|
|
169
|
+
*
|
|
170
|
+
* This is where API data gets transformed into the domain model with UI enrichment.
|
|
171
|
+
* Enrichment happens ONCE at the data boundary (in useLiveGraphData), then the
|
|
172
|
+
* enriched models are used throughout the application.
|
|
173
|
+
*/
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Color palette mapping node labels to colors.
|
|
177
|
+
* Built once from label counts, then used for all nodes.
|
|
178
|
+
*/
|
|
179
|
+
type ColorPalette = Record<string, string>;
|
|
180
|
+
/**
|
|
181
|
+
* Builds a unified color palette from label counts.
|
|
182
|
+
*
|
|
183
|
+
* Colors are assigned to labels based on their order, cycling through BASE_COLORS.
|
|
184
|
+
* Includes 'neutral' and 'faded' colors for edges and unlabeled nodes.
|
|
185
|
+
*
|
|
186
|
+
* @param labelCounts - Object mapping label names to counts
|
|
187
|
+
* @returns Color palette mapping labels to hex colors
|
|
188
|
+
*
|
|
189
|
+
* @example
|
|
190
|
+
* const counts = { Person: 10, Movie: 5 };
|
|
191
|
+
* const palette = buildColorPalette(counts);
|
|
192
|
+
* // { Person: '#f94144', Movie: '#118ab2', neutral: '#6c757d', faded: '#adb5bd' }
|
|
193
|
+
*/
|
|
194
|
+
declare function buildColorPalette(labelCounts: Record<string, number>): ColorPalette;
|
|
195
|
+
/**
|
|
196
|
+
* Convenience: build a color palette directly from an array of nodes.
|
|
197
|
+
* Counts labels, then delegates to buildColorPalette.
|
|
198
|
+
*
|
|
199
|
+
* @param nodes - Array of nodes (any object with a `label_` string property)
|
|
200
|
+
* @returns Color palette mapping labels to hex colors
|
|
201
|
+
*/
|
|
202
|
+
declare function buildColorPaletteFromNodes(nodes: {
|
|
203
|
+
label_: string;
|
|
204
|
+
}[]): ColorPalette;
|
|
205
|
+
/**
|
|
206
|
+
* Enriches an API node with visual data to create a VisualGraphNode.
|
|
207
|
+
*
|
|
208
|
+
* This is the primary transformation from API DTO to domain model.
|
|
209
|
+
* Extracts displayName from node properties, assigns color from the palette,
|
|
210
|
+
* and provides fallback to neutral color for unlabeled nodes.
|
|
211
|
+
*
|
|
212
|
+
* @param apiNode - Node from backend API
|
|
213
|
+
* @param colorPalette - Unified color palette
|
|
214
|
+
* @param displayConfig - Optional resolved GraphDisplayConfig for this node's label
|
|
215
|
+
* @returns Enriched VisualGraphNode
|
|
216
|
+
*/
|
|
217
|
+
declare function enrichNode(apiNode: RawGraphNode, colorPalette: ColorPalette, displayConfig?: GraphDisplayConfig): VisualGraphNode;
|
|
218
|
+
/**
|
|
219
|
+
* Enriches an API edge with visual data to create a VisualGraphEdge.
|
|
220
|
+
*
|
|
221
|
+
* Adds neutral color and default size to edges for consistent visualization.
|
|
222
|
+
*
|
|
223
|
+
* @param apiEdge - Edge from backend API
|
|
224
|
+
* @param colorPalette - Optional unified color palette (for neutral color)
|
|
225
|
+
* @returns Enriched VisualGraphEdge
|
|
226
|
+
*/
|
|
227
|
+
declare function enrichEdge(apiEdge: RawGraphEdge, colorPalette?: ColorPalette): VisualGraphEdge;
|
|
228
|
+
/**
|
|
229
|
+
* Batch enrichment for multiple nodes.
|
|
230
|
+
* More efficient than calling enrichNode repeatedly.
|
|
231
|
+
*
|
|
232
|
+
* @param apiNodes - Array of nodes from backend API
|
|
233
|
+
* @param colorPalette - Unified color palette
|
|
234
|
+
* @param labelDisplayMap - Optional resolved display config map (label → GraphDisplayConfig)
|
|
235
|
+
* @returns Array of enriched VisualGraphNodes
|
|
236
|
+
*/
|
|
237
|
+
declare function enrichNodes(apiNodes: RawGraphNode[], colorPalette: ColorPalette, labelDisplayMap?: LabelDisplayMap): VisualGraphNode[];
|
|
238
|
+
/**
|
|
239
|
+
* Batch enrichment for multiple edges.
|
|
240
|
+
* More efficient than calling enrichEdge repeatedly.
|
|
241
|
+
*
|
|
242
|
+
* @param apiEdges - Array of edges from backend API
|
|
243
|
+
* @param colorPalette - Optional unified color palette
|
|
244
|
+
* @returns Array of enriched VisualGraphEdges
|
|
245
|
+
*/
|
|
246
|
+
declare function enrichEdges(apiEdges: RawGraphEdge[], colorPalette?: ColorPalette): VisualGraphEdge[];
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Type alias for backward compatibility during refactoring.
|
|
250
|
+
* This allows existing code to continue working while we migrate.
|
|
251
|
+
*/
|
|
252
|
+
type NormalizedGraph = VisualGraphNormalized;
|
|
253
|
+
/**
|
|
254
|
+
* Normalizes visual graph data into an indexed structure for efficient lookups.
|
|
255
|
+
*
|
|
256
|
+
* This function converts arrays of nodes and edges into a Record structure
|
|
257
|
+
* for O(1) lookup by ID, which is essential for performance in graph operations.
|
|
258
|
+
*
|
|
259
|
+
* INTERNAL REFACTORING: Function signature changed to use VisualGraph types,
|
|
260
|
+
* but behavior is identical - same normalization logic, same performance.
|
|
261
|
+
*
|
|
262
|
+
* @param nodes - Array of VisualGraphNodes
|
|
263
|
+
* @param edges - Array of VisualGraphEdges
|
|
264
|
+
* @returns Normalized graph with indexed nodes and edges
|
|
265
|
+
*/
|
|
266
|
+
declare function normalizeGraph(nodes: VisualGraphNode[], edges: VisualGraphEdge[]): VisualGraphNormalized;
|
|
267
|
+
/**
|
|
268
|
+
* Empty normalized graph constant for initial state.
|
|
269
|
+
*/
|
|
270
|
+
declare const EMPTY_NORMALIZED: VisualGraphNormalized;
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Extract display label from a node or edge using resolved display config.
|
|
274
|
+
*
|
|
275
|
+
* @param item - RawGraphNode or RawGraphEdge
|
|
276
|
+
* @param displayConfig - Optional resolved GraphDisplayConfig for this label
|
|
277
|
+
*/
|
|
278
|
+
declare function extractDisplayLabel(item: RawGraphNode | RawGraphEdge, displayConfig?: GraphDisplayConfig): string;
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* Graph Data Hook Interface
|
|
282
|
+
*
|
|
283
|
+
* Contract for providing graph data to visualizer components.
|
|
284
|
+
* Host applications that bring their own data pipeline implement this
|
|
285
|
+
* instead of (or in addition to) using useLiveGraphData.
|
|
286
|
+
*/
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Graph statistics summary
|
|
290
|
+
*/
|
|
291
|
+
interface GraphStatistics {
|
|
292
|
+
nodes: number;
|
|
293
|
+
edges: number;
|
|
294
|
+
node_labels?: Record<string, number>;
|
|
295
|
+
edge_labels?: Record<string, number>;
|
|
296
|
+
/** Non-zero for tabular (non-graph) query results */
|
|
297
|
+
values?: number;
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Contract for providing graph data to visualizer components.
|
|
301
|
+
*
|
|
302
|
+
* Implement this in your application when you want to use the graph
|
|
303
|
+
* visualization without the built-in useLiveGraphData pipeline.
|
|
304
|
+
*
|
|
305
|
+
* @example
|
|
306
|
+
* ```tsx
|
|
307
|
+
* function useMyGraphData(): GraphDataHook {
|
|
308
|
+
* const [nodes, setNodes] = useState<VisualGraphNode[]>([]);
|
|
309
|
+
* const [edges, setEdges] = useState<VisualGraphEdge[]>([]);
|
|
310
|
+
* // ... fetch and enrich data
|
|
311
|
+
* return {
|
|
312
|
+
* nodes,
|
|
313
|
+
* edges,
|
|
314
|
+
* normalized: normalizeGraph(nodes, edges),
|
|
315
|
+
* baseNormalized: normalizeGraph(allNodes, allEdges),
|
|
316
|
+
* stats: { nodes: nodes.length, edges: edges.length },
|
|
317
|
+
* colorPalette: buildColorPalette(labelCounts),
|
|
318
|
+
* labelCounts,
|
|
319
|
+
* edgeLabelCounts,
|
|
320
|
+
* };
|
|
321
|
+
* }
|
|
322
|
+
* ```
|
|
323
|
+
*/
|
|
324
|
+
interface GraphDataHook {
|
|
325
|
+
nodes: VisualGraphNode[];
|
|
326
|
+
edges: VisualGraphEdge[];
|
|
327
|
+
normalized: NormalizedGraph;
|
|
328
|
+
baseNormalized: NormalizedGraph;
|
|
329
|
+
stats?: GraphStatistics;
|
|
330
|
+
colorPalette: ColorPalette;
|
|
331
|
+
labelCounts: Record<string, number>;
|
|
332
|
+
edgeLabelCounts: Record<string, number>;
|
|
333
|
+
/** Value rows for tabular (non-graph) query results */
|
|
334
|
+
values?: string[][];
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
interface SelectionStore {
|
|
338
|
+
selectedNodeIds: string[];
|
|
339
|
+
setSelectedNodeIds: (ids: string[]) => void;
|
|
340
|
+
selectedEdge: VisualGraphEdge | null;
|
|
341
|
+
setSelectedEdge: (edge: VisualGraphEdge | null) => void;
|
|
342
|
+
clear: () => void;
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Factory function to create a new Selection store instance.
|
|
346
|
+
* Used by workspace system to create isolated store instances per workspace.
|
|
347
|
+
*
|
|
348
|
+
* For backward compatibility, the default export is a singleton instance.
|
|
349
|
+
* Existing code continues to work without changes.
|
|
350
|
+
*/
|
|
351
|
+
declare function createSelectionStore(): zustand.UseBoundStore<zustand.StoreApi<SelectionStore>>;
|
|
352
|
+
|
|
353
|
+
interface GraphDataStore {
|
|
354
|
+
/** All nodes (from query + expansions) */
|
|
355
|
+
nodes: VisualGraphNode[];
|
|
356
|
+
/** All edges (from query + expansions) */
|
|
357
|
+
edges: VisualGraphEdge[];
|
|
358
|
+
/** Query statistics from the last query execution */
|
|
359
|
+
stats: GraphStatistics | undefined;
|
|
360
|
+
/** Tabular values from value-set queries */
|
|
361
|
+
values: string[][];
|
|
362
|
+
/** Whether the last query was a value-set (tabular) query */
|
|
363
|
+
isValueSet: boolean;
|
|
364
|
+
/** IDs of nodes from the original query */
|
|
365
|
+
queryNodeIds: Set<string>;
|
|
366
|
+
/** IDs of nodes from expansion operations */
|
|
367
|
+
expandedNodeIds: Set<string>;
|
|
368
|
+
/** IDs of edges from the original query */
|
|
369
|
+
queryEdgeIds: Set<string>;
|
|
370
|
+
/** IDs of edges from expansion operations */
|
|
371
|
+
expandedEdgeIds: Set<string>;
|
|
372
|
+
/**
|
|
373
|
+
* Set graph data from a query execution.
|
|
374
|
+
* Replaces all existing data.
|
|
375
|
+
*
|
|
376
|
+
* @param nodes - Enriched nodes from query
|
|
377
|
+
* @param edges - Enriched edges from query
|
|
378
|
+
* @param stats - Query statistics
|
|
379
|
+
* @param values - Tabular values for value-set queries
|
|
380
|
+
* @param isValueSet - Whether this is a value-set query
|
|
381
|
+
*/
|
|
382
|
+
setQueryData: (nodes: VisualGraphNode[], edges: VisualGraphEdge[], stats?: GraphStatistics, values?: string[][], isValueSet?: boolean) => void;
|
|
383
|
+
/**
|
|
384
|
+
* Merge expanded nodes/edges into existing graph.
|
|
385
|
+
* Deduplicates by ID - existing elements are preserved.
|
|
386
|
+
*
|
|
387
|
+
* @param nodes - New nodes from expansion
|
|
388
|
+
* @param edges - New edges from expansion
|
|
389
|
+
*/
|
|
390
|
+
mergeExpandedData: (nodes: VisualGraphNode[], edges: VisualGraphEdge[]) => void;
|
|
391
|
+
/**
|
|
392
|
+
* Clear all graph data
|
|
393
|
+
*/
|
|
394
|
+
clear: () => void;
|
|
395
|
+
/**
|
|
396
|
+
* Get statistics about data sources
|
|
397
|
+
*/
|
|
398
|
+
getStats: () => {
|
|
399
|
+
totalNodes: number;
|
|
400
|
+
totalEdges: number;
|
|
401
|
+
queryNodes: number;
|
|
402
|
+
expandedNodes: number;
|
|
403
|
+
queryEdges: number;
|
|
404
|
+
expandedEdges: number;
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* Factory function to create a new GraphData store instance.
|
|
409
|
+
* Used by workspace system to create isolated store instances per workspace.
|
|
410
|
+
*
|
|
411
|
+
* For backward compatibility, the default export is a singleton instance.
|
|
412
|
+
* Existing code continues to work without changes.
|
|
413
|
+
*/
|
|
414
|
+
declare function createGraphDataStore(): zustand.UseBoundStore<zustand.StoreApi<GraphDataStore>>;
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* GraphFilterStore - Node/edge label filtering and data-change tracking.
|
|
418
|
+
*
|
|
419
|
+
* Graph-generic filtering store. Separated from Cypher-specific
|
|
420
|
+
* query editing (QueryEditorStore stays in the consumer).
|
|
421
|
+
*/
|
|
422
|
+
interface GraphFilterStore {
|
|
423
|
+
nodeLabelFilters: string[];
|
|
424
|
+
allLabelsDisabled: boolean;
|
|
425
|
+
toggleNodeLabelFilter: (label: string, allAvailableLabels?: string[]) => void;
|
|
426
|
+
clearNodeLabelFilters: () => void;
|
|
427
|
+
setNodeLabelFilters: (labels: string[]) => void;
|
|
428
|
+
toggleAllLabelsDisabled: () => void;
|
|
429
|
+
edgeLabelFilters: string[];
|
|
430
|
+
allEdgeLabelsDisabled: boolean;
|
|
431
|
+
toggleEdgeLabelFilter: (label: string, allAvailableLabels?: string[], edgeToNodeLabels?: Record<string, string[]>) => void;
|
|
432
|
+
clearEdgeLabelFilters: () => void;
|
|
433
|
+
setEdgeLabelFilters: (labels: string[]) => void;
|
|
434
|
+
toggleAllEdgeLabelsDisabled: () => void;
|
|
435
|
+
lastDataChangeTime: number;
|
|
436
|
+
notifyDataChange: () => void;
|
|
437
|
+
resetFilters: () => void;
|
|
438
|
+
}
|
|
439
|
+
declare function createGraphFilterStore(): zustand.UseBoundStore<zustand.StoreApi<GraphFilterStore>>;
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* GraphFocus Store
|
|
443
|
+
*
|
|
444
|
+
* Manages graph element focus/zoom actions across different renderers (Cytoscape, Reagraph).
|
|
445
|
+
* Provides a decoupled way for tools to request focus on specific elements without
|
|
446
|
+
* needing direct access to the renderer instance.
|
|
447
|
+
*
|
|
448
|
+
* Pattern: tools dispatch focus actions → store holds state → renderers subscribe and react
|
|
449
|
+
*/
|
|
450
|
+
/** Descriptor for a pending focus action */
|
|
451
|
+
interface GraphFocusAction {
|
|
452
|
+
/** ID of the node or edge to focus on */
|
|
453
|
+
elementId: string;
|
|
454
|
+
/** Type of element */
|
|
455
|
+
elementType: "node" | "edge";
|
|
456
|
+
/** Action to perform: focus only or focus and select */
|
|
457
|
+
action: "focus" | "focus-and-select";
|
|
458
|
+
/** Timestamp ensures uniqueness — triggers subscription even for same element */
|
|
459
|
+
timestamp: number;
|
|
460
|
+
}
|
|
461
|
+
interface GraphFocusStore {
|
|
462
|
+
/** Current focus action (null when no action is pending) */
|
|
463
|
+
focusAction: GraphFocusAction | null;
|
|
464
|
+
/** Element IDs to show despite active filters (temporary override) */
|
|
465
|
+
overrideElementIds: Set<string>;
|
|
466
|
+
/**
|
|
467
|
+
* Request focus on a graph element.
|
|
468
|
+
* @param elementId - ID of the node or edge
|
|
469
|
+
* @param elementType - 'node' or 'edge'
|
|
470
|
+
* @param shouldSelect - Also select the element after focusing
|
|
471
|
+
*/
|
|
472
|
+
requestFocus: (elementId: string, elementType: "node" | "edge", shouldSelect: boolean) => void;
|
|
473
|
+
/** Clear the current focus action and all overrides */
|
|
474
|
+
clear: () => void;
|
|
475
|
+
/** Clear filter overrides only (keeps the current focus action) */
|
|
476
|
+
clearOverrides: () => void;
|
|
477
|
+
}
|
|
478
|
+
/** Create an isolated GraphFocus store instance (use for multi-workspace scenarios). */
|
|
479
|
+
declare function createGraphFocusStore(): zustand.UseBoundStore<zustand.StoreApi<GraphFocusStore>>;
|
|
480
|
+
/** Global singleton — sufficient for single-workspace applications. */
|
|
481
|
+
declare const useGraphFocus: zustand.UseBoundStore<zustand.StoreApi<GraphFocusStore>>;
|
|
482
|
+
|
|
483
|
+
/**
|
|
484
|
+
* GraphExploration Store
|
|
485
|
+
*
|
|
486
|
+
* Manages visual exploration state for the graph visualizer:
|
|
487
|
+
* - Focus mode: Show only selected nodes
|
|
488
|
+
* - Hidden elements: Temporarily hide nodes/edges from view
|
|
489
|
+
* - Expansion tracking: Track which nodes have been expanded
|
|
490
|
+
*
|
|
491
|
+
* This state is separate from:
|
|
492
|
+
* - Selection (which elements are selected)
|
|
493
|
+
* - GraphFocus (zoom/pan actions)
|
|
494
|
+
* - GraphFilter (label filters)
|
|
495
|
+
*/
|
|
496
|
+
|
|
497
|
+
/**
|
|
498
|
+
* Store dependencies for GraphExploration.
|
|
499
|
+
* Allows workspace-specific or global store injection.
|
|
500
|
+
*/
|
|
501
|
+
interface GraphExplorationDeps {
|
|
502
|
+
graphData: UseBoundStore<StoreApi<GraphDataStore>>;
|
|
503
|
+
selection: UseBoundStore<StoreApi<SelectionStore>>;
|
|
504
|
+
graphFocus: UseBoundStore<StoreApi<GraphFocusStore>>;
|
|
505
|
+
graphFilter: UseBoundStore<StoreApi<GraphFilterStore>>;
|
|
506
|
+
expandNode: (id: number) => Promise<{
|
|
507
|
+
nodes: RawGraphNode[];
|
|
508
|
+
edges: RawGraphEdge[];
|
|
509
|
+
}>;
|
|
510
|
+
getNodes: (ids: number[]) => Promise<RawGraphNode[]>;
|
|
511
|
+
getLabelDisplayMap?: () => LabelDisplayMap;
|
|
512
|
+
}
|
|
513
|
+
interface GraphExplorationStore {
|
|
514
|
+
/** Node IDs to show in focus mode (empty = not in focus mode) */
|
|
515
|
+
focusedNodeIds: Set<string>;
|
|
516
|
+
/** Whether focus mode is active */
|
|
517
|
+
isFocusMode: boolean;
|
|
518
|
+
/** Element IDs (nodes + edges) to hide from view */
|
|
519
|
+
hiddenElementIds: Set<string>;
|
|
520
|
+
/** Node IDs that have been expanded (for UI feedback) */
|
|
521
|
+
expandedNodeIds: Set<string>;
|
|
522
|
+
/**
|
|
523
|
+
* Enter focus mode showing only specified nodes
|
|
524
|
+
* @param nodeIds - IDs of nodes to focus on
|
|
525
|
+
*/
|
|
526
|
+
setFocusMode: (nodeIds: string[]) => void;
|
|
527
|
+
/**
|
|
528
|
+
* Enter focus mode on a node and its immediate neighborhood
|
|
529
|
+
* (includes the node itself + all directly connected nodes)
|
|
530
|
+
* @param nodeId - ID of the node to focus on
|
|
531
|
+
*/
|
|
532
|
+
setFocusModeWithNeighborhood: (nodeId: string) => void;
|
|
533
|
+
/**
|
|
534
|
+
* Exit focus mode (show all label-filtered nodes)
|
|
535
|
+
*/
|
|
536
|
+
clearFocusMode: () => void;
|
|
537
|
+
/**
|
|
538
|
+
* Hide elements from the graph
|
|
539
|
+
* @param elementIds - IDs of nodes and/or edges to hide
|
|
540
|
+
*/
|
|
541
|
+
hideElements: (elementIds: string[]) => void;
|
|
542
|
+
/**
|
|
543
|
+
* Show previously hidden elements
|
|
544
|
+
* @param elementIds - IDs of nodes and/or edges to show
|
|
545
|
+
*/
|
|
546
|
+
showElements: (elementIds: string[]) => void;
|
|
547
|
+
/**
|
|
548
|
+
* Hide all nodes that have paths leading TO the specified node (predecessors/ancestors).
|
|
549
|
+
* The clicked node itself remains VISIBLE as a boundary marker.
|
|
550
|
+
* Uses recursive traversal with cycle protection.
|
|
551
|
+
* @param nodeId - ID of the node (kept visible)
|
|
552
|
+
*/
|
|
553
|
+
hideNodeIncoming: (nodeId: string) => void;
|
|
554
|
+
/**
|
|
555
|
+
* Hide all nodes that have paths FROM the specified node (successors/descendants).
|
|
556
|
+
* The clicked node itself remains VISIBLE as a boundary marker.
|
|
557
|
+
* Uses recursive traversal with cycle protection.
|
|
558
|
+
* @param nodeId - ID of the node (kept visible)
|
|
559
|
+
*/
|
|
560
|
+
hideNodeOutgoing: (nodeId: string) => void;
|
|
561
|
+
/**
|
|
562
|
+
* Hide the edge AND the forward path (target node + all its outgoing connections).
|
|
563
|
+
* The source node of the edge remains VISIBLE as a boundary marker.
|
|
564
|
+
* Uses recursive traversal with cycle protection.
|
|
565
|
+
* @param edgeId - ID of the edge to hide
|
|
566
|
+
*/
|
|
567
|
+
hideEdgeForwardPath: (edgeId: string) => void;
|
|
568
|
+
/**
|
|
569
|
+
* Hide the edge AND the reverse path (source node + all its incoming connections).
|
|
570
|
+
* The target node of the edge remains VISIBLE as a boundary marker.
|
|
571
|
+
* Uses recursive traversal with cycle protection.
|
|
572
|
+
* @param edgeId - ID of the edge to hide
|
|
573
|
+
*/
|
|
574
|
+
hideEdgeReversePath: (edgeId: string) => void;
|
|
575
|
+
/**
|
|
576
|
+
* Focus on edges of a specific type, automatically determining direction from selection state.
|
|
577
|
+
*
|
|
578
|
+
* Behavior:
|
|
579
|
+
* - If 1 node + edge selected: Uses the selected node as reference (outgoing if source, incoming if target)
|
|
580
|
+
* - If 2 nodes + edge selected: Defaults to outgoing from start node
|
|
581
|
+
* - Shows all nodes connected via edges of the same type in the determined direction
|
|
582
|
+
*
|
|
583
|
+
* @param edgeId - ID of the edge (to get type and endpoints)
|
|
584
|
+
*/
|
|
585
|
+
focusEdge: (edgeId: string) => void;
|
|
586
|
+
/**
|
|
587
|
+
* Focus on a specific edge type: show only edges of this type and their connected nodes.
|
|
588
|
+
* All other nodes and edges are hidden.
|
|
589
|
+
*
|
|
590
|
+
* @param edgeId - ID of the edge (to determine the edge type/label)
|
|
591
|
+
*/
|
|
592
|
+
focusOnEdgeType: (edgeId: string) => void;
|
|
593
|
+
/**
|
|
594
|
+
* Reset all exploration state (clear focus + hidden)
|
|
595
|
+
* Note: Keeps expandedNodeIds since those nodes are still in the data
|
|
596
|
+
*/
|
|
597
|
+
resetView: () => void;
|
|
598
|
+
/**
|
|
599
|
+
* Reset ALL exploration state including expanded nodes.
|
|
600
|
+
* Should be called when new query data is loaded to ensure clean state.
|
|
601
|
+
*/
|
|
602
|
+
resetForNewQuery: () => void;
|
|
603
|
+
/**
|
|
604
|
+
* Mark a node as expanded (for UI feedback)
|
|
605
|
+
* @param nodeId - ID of expanded node
|
|
606
|
+
*/
|
|
607
|
+
markNodeExpanded: (nodeId: string) => void;
|
|
608
|
+
/**
|
|
609
|
+
* Check if a node has been expanded
|
|
610
|
+
* @param nodeId - ID to check
|
|
611
|
+
*/
|
|
612
|
+
isNodeExpanded: (nodeId: string) => boolean;
|
|
613
|
+
/**
|
|
614
|
+
* Expand a node by fetching connected nodes/edges from backend
|
|
615
|
+
* and merging them into the graph data.
|
|
616
|
+
* @param nodeId - ID of the node to expand
|
|
617
|
+
* @returns Promise that resolves when expansion is complete
|
|
618
|
+
*/
|
|
619
|
+
expandNode: (nodeId: string) => Promise<void>;
|
|
620
|
+
/**
|
|
621
|
+
* Add a node to the graph by ID.
|
|
622
|
+
* If the node already exists in the graph, just focuses it (if autoFocus=true).
|
|
623
|
+
* If not, fetches it from the API, enriches it with visual data,
|
|
624
|
+
* adds it to the graph, and optionally focuses it.
|
|
625
|
+
*
|
|
626
|
+
* @param nodeId - ID of the node to add
|
|
627
|
+
* @param autoFocus - Whether to automatically focus the node after adding (default: false)
|
|
628
|
+
* @returns Promise that resolves when the node is added/focused
|
|
629
|
+
*/
|
|
630
|
+
addNodeById: (nodeId: number, autoFocus?: boolean) => Promise<void>;
|
|
631
|
+
}
|
|
632
|
+
/**
|
|
633
|
+
* Factory function to create a new GraphExploration store instance.
|
|
634
|
+
* Used by workspace system to create isolated store instances per workspace.
|
|
635
|
+
*
|
|
636
|
+
* @param deps - Store and service dependencies (graphData, selection, graphFocus, graphFilter, expandNode, getNodes)
|
|
637
|
+
*/
|
|
638
|
+
declare function createGraphExplorationStore(deps: GraphExplorationDeps): UseBoundStore<StoreApi<GraphExplorationStore>>;
|
|
639
|
+
|
|
640
|
+
type ActionPanelState = "hidden" | "visible";
|
|
641
|
+
interface ActionPanelStore {
|
|
642
|
+
state: ActionPanelState;
|
|
643
|
+
setState: (state: ActionPanelState) => void;
|
|
644
|
+
hide: () => void;
|
|
645
|
+
show: () => void;
|
|
646
|
+
isHidden: () => boolean;
|
|
647
|
+
}
|
|
648
|
+
/** Create an isolated ActionPanel store instance. */
|
|
649
|
+
declare function createActionPanelStore(): zustand.UseBoundStore<zustand.StoreApi<ActionPanelStore>>;
|
|
650
|
+
/** Global singleton — sufficient for single-workspace applications. */
|
|
651
|
+
declare const useActionPanelStore: zustand.UseBoundStore<zustand.StoreApi<ActionPanelStore>>;
|
|
652
|
+
|
|
653
|
+
/**
|
|
654
|
+
* Store factory types for workspace-isolated store instances.
|
|
655
|
+
*/
|
|
656
|
+
|
|
657
|
+
/**
|
|
658
|
+
* Generic store factory type that creates new store instances.
|
|
659
|
+
*/
|
|
660
|
+
type StoreFactory<T> = () => UseBoundStore<StoreApi<T>>;
|
|
661
|
+
/**
|
|
662
|
+
* Bundle of graph-related workspace-scoped store instances.
|
|
663
|
+
* Each workspace gets its own isolated set of these stores.
|
|
664
|
+
*
|
|
665
|
+
* Note: QueryEditorStore stays in the consumer (e.g., explorer) since
|
|
666
|
+
* it is Cypher/query-specific, not part of generic graph visualization.
|
|
667
|
+
*/
|
|
668
|
+
interface WorkspaceStores {
|
|
669
|
+
graphFilter: UseBoundStore<StoreApi<GraphFilterStore>>;
|
|
670
|
+
graphData: UseBoundStore<StoreApi<GraphDataStore>>;
|
|
671
|
+
graphExploration: UseBoundStore<StoreApi<GraphExplorationStore>>;
|
|
672
|
+
selection: UseBoundStore<StoreApi<SelectionStore>>;
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
/**
|
|
676
|
+
* Context for providing graph stores to visualization components.
|
|
677
|
+
* Must be set by the host application (e.g., explorer, Atlas).
|
|
678
|
+
*/
|
|
679
|
+
declare const GraphStoresContext: react.Context<WorkspaceStores | null>;
|
|
680
|
+
/** Get GraphFilter store from context. */
|
|
681
|
+
declare function useWorkspaceGraphFilter(): UseBoundStore<StoreApi<GraphFilterStore>>;
|
|
682
|
+
/** Get GraphData store from context. */
|
|
683
|
+
declare function useWorkspaceGraphData(): UseBoundStore<StoreApi<GraphDataStore>>;
|
|
684
|
+
/** Get GraphExploration store from context. */
|
|
685
|
+
declare function useWorkspaceGraphExploration(): UseBoundStore<StoreApi<GraphExplorationStore>>;
|
|
686
|
+
/** Get Selection store from context. */
|
|
687
|
+
declare function useWorkspaceSelection(): UseBoundStore<StoreApi<SelectionStore>>;
|
|
688
|
+
|
|
689
|
+
/**
|
|
690
|
+
* Result type for useLiveGraphData hook.
|
|
691
|
+
*
|
|
692
|
+
* Returns enriched VisualGraph data with color palette and statistics.
|
|
693
|
+
*/
|
|
694
|
+
interface LiveGraphDataResult {
|
|
695
|
+
nodes: VisualGraphNode[];
|
|
696
|
+
edges: VisualGraphEdge[];
|
|
697
|
+
stats: GraphStatistics | undefined;
|
|
698
|
+
/** Node label counts after hidden/focus filters, before label-checkbox filters */
|
|
699
|
+
labelCounts: Record<string, number>;
|
|
700
|
+
/** Edge label counts after node visibility filters, before edge-label-checkbox filters */
|
|
701
|
+
edgeLabelCounts: Record<string, number>;
|
|
702
|
+
/** Value rows for non-graph (tabular) query results */
|
|
703
|
+
values: string[][];
|
|
704
|
+
colorPalette: ColorPalette;
|
|
705
|
+
/** Filtered graph for visualization (respects all active filters) */
|
|
706
|
+
normalized: NormalizedGraph;
|
|
707
|
+
/** Unfiltered graph containing all nodes/edges from the last query */
|
|
708
|
+
baseNormalized: NormalizedGraph;
|
|
709
|
+
}
|
|
710
|
+
declare function useLiveGraphData(): {
|
|
711
|
+
nodes: VisualGraphNode[];
|
|
712
|
+
edges: VisualGraphEdge[];
|
|
713
|
+
stats: {
|
|
714
|
+
nodes: number;
|
|
715
|
+
edges: number;
|
|
716
|
+
node_labels?: Record<string, number>;
|
|
717
|
+
edge_labels?: Record<string, number>;
|
|
718
|
+
values?: number;
|
|
719
|
+
} | undefined;
|
|
720
|
+
labelCounts: Record<string, number>;
|
|
721
|
+
edgeLabelCounts: Record<string, number>;
|
|
722
|
+
values: string[][];
|
|
723
|
+
colorPalette: ColorPalette;
|
|
724
|
+
normalized: VisualGraphNormalized;
|
|
725
|
+
baseNormalized: VisualGraphNormalized;
|
|
726
|
+
};
|
|
727
|
+
|
|
728
|
+
/**
|
|
729
|
+
* Converts a VisualGraphNode to reagraph's node format.
|
|
730
|
+
* Exported for use in tests and custom renderers.
|
|
731
|
+
*/
|
|
732
|
+
declare function toReagraphNode(visualNode: VisualGraphNode): GraphNode;
|
|
733
|
+
/**
|
|
734
|
+
* Converts a VisualGraphEdge to reagraph's edge format.
|
|
735
|
+
* Exported for use in tests and custom renderers.
|
|
736
|
+
*/
|
|
737
|
+
declare function toReagraphEdge(visualEdge: VisualGraphEdge): GraphEdge;
|
|
738
|
+
/**
|
|
739
|
+
* Returns live graph data converted to reagraph's node/edge format.
|
|
740
|
+
* Consumes the workspace GraphData + filter stores via useLiveGraphData.
|
|
741
|
+
*/
|
|
742
|
+
declare function useReagraphData(): {
|
|
743
|
+
nodes: GraphNode[];
|
|
744
|
+
edges: GraphEdge[];
|
|
745
|
+
stats: {
|
|
746
|
+
nodes: number;
|
|
747
|
+
edges: number;
|
|
748
|
+
node_labels?: Record<string, number>;
|
|
749
|
+
edge_labels?: Record<string, number>;
|
|
750
|
+
values?: number;
|
|
751
|
+
} | undefined;
|
|
752
|
+
colorPalette: ColorPalette;
|
|
753
|
+
};
|
|
754
|
+
|
|
755
|
+
/**
|
|
756
|
+
* Converts a VisualGraphNode to Cytoscape's element format.
|
|
757
|
+
* Exported for use in tests and custom renderers.
|
|
758
|
+
*/
|
|
759
|
+
declare function toCytoscapeNode(visualNode: VisualGraphNode): {
|
|
760
|
+
data: {
|
|
761
|
+
id: string;
|
|
762
|
+
label: string;
|
|
763
|
+
id_: number;
|
|
764
|
+
label_: string;
|
|
765
|
+
properties_: Record<string, string | number | (string | number)[]>;
|
|
766
|
+
displayName: string;
|
|
767
|
+
color: string;
|
|
768
|
+
size: number;
|
|
769
|
+
icon: string | undefined;
|
|
770
|
+
visualGraph: VisualGraphNode;
|
|
771
|
+
};
|
|
772
|
+
};
|
|
773
|
+
/**
|
|
774
|
+
* Converts a VisualGraphEdge to Cytoscape's element format.
|
|
775
|
+
* Exported for use in tests and custom renderers.
|
|
776
|
+
*/
|
|
777
|
+
declare function toCytoscapeEdge(visualEdge: VisualGraphEdge): {
|
|
778
|
+
data: {
|
|
779
|
+
id: string;
|
|
780
|
+
source: string;
|
|
781
|
+
target: string;
|
|
782
|
+
label: string;
|
|
783
|
+
id_: number;
|
|
784
|
+
label_: string;
|
|
785
|
+
start_id_: number;
|
|
786
|
+
end_id_: number;
|
|
787
|
+
properties_: Record<string, string | number | (string | number)[]> | undefined;
|
|
788
|
+
color: string;
|
|
789
|
+
size: number;
|
|
790
|
+
dashed: true | undefined;
|
|
791
|
+
};
|
|
792
|
+
};
|
|
793
|
+
/**
|
|
794
|
+
* Returns live graph data converted to Cytoscape's element format.
|
|
795
|
+
* Consumes the workspace GraphData + filter stores via useLiveGraphData.
|
|
796
|
+
*/
|
|
797
|
+
declare function useCytoscapeData(): {
|
|
798
|
+
elements: cytoscape.ElementsDefinition;
|
|
799
|
+
stats: {
|
|
800
|
+
nodes: number;
|
|
801
|
+
edges: number;
|
|
802
|
+
node_labels?: Record<string, number>;
|
|
803
|
+
edge_labels?: Record<string, number>;
|
|
804
|
+
values?: number;
|
|
805
|
+
} | undefined;
|
|
806
|
+
colorPalette: ColorPalette;
|
|
807
|
+
};
|
|
808
|
+
|
|
809
|
+
type GraphRenderer = "reagraph" | "cytoscape";
|
|
810
|
+
type GraphRendererContextType = {
|
|
811
|
+
renderer: GraphRenderer;
|
|
812
|
+
setRenderer: (renderer: GraphRenderer) => void;
|
|
813
|
+
};
|
|
814
|
+
declare function useGraphRenderer(): GraphRendererContextType;
|
|
815
|
+
|
|
816
|
+
type ProviderProps = {
|
|
817
|
+
children: react__default.ReactNode;
|
|
818
|
+
/**
|
|
819
|
+
* Initial renderer to use. Defaults to 'cytoscape'.
|
|
820
|
+
* The host application controls which renderer is active — typically
|
|
821
|
+
* driven by route state, user preference, or local storage.
|
|
822
|
+
*/
|
|
823
|
+
defaultRenderer?: GraphRenderer;
|
|
824
|
+
/**
|
|
825
|
+
* Optional callback invoked when the user switches renderer via the toolbar.
|
|
826
|
+
* Use this to persist the choice (e.g. URL, localStorage, zustand store).
|
|
827
|
+
*/
|
|
828
|
+
onRendererChange?: (renderer: GraphRenderer) => void;
|
|
829
|
+
};
|
|
830
|
+
declare function GraphRendererProvider({ children, defaultRenderer, onRendererChange, }: ProviderProps): react__default.ReactElement;
|
|
831
|
+
|
|
832
|
+
interface GraphVisualizerProps {
|
|
833
|
+
/** Callback when a node is copied (e.g. to clipboard). Decouples renderers from clipboard store. */
|
|
834
|
+
onCopyNode?: (node: VisualGraphNode) => void;
|
|
835
|
+
/** Extra toolbar content (e.g. clipboard UI) injected into the renderer toolbar. */
|
|
836
|
+
extraToolbarContent?: ReactNode;
|
|
837
|
+
}
|
|
838
|
+
declare function GraphVisualizer({ onCopyNode, extraToolbarContent, }: GraphVisualizerProps): react_jsx_runtime.JSX.Element;
|
|
839
|
+
|
|
840
|
+
interface ActionPanelProps {
|
|
841
|
+
/** Optional actions rendered at the top of the panel (e.g. CRUD buttons) */
|
|
842
|
+
actions?: ReactNode;
|
|
843
|
+
}
|
|
844
|
+
declare function ActionPanel({ actions }: ActionPanelProps): react_jsx_runtime.JSX.Element;
|
|
845
|
+
|
|
846
|
+
type Props$1 = {
|
|
847
|
+
node: VisualGraphNode;
|
|
848
|
+
};
|
|
849
|
+
declare function NodeInfoCard({ node }: Props$1): react_jsx_runtime.JSX.Element;
|
|
850
|
+
|
|
851
|
+
type Props = {
|
|
852
|
+
edge: VisualGraphEdge;
|
|
853
|
+
};
|
|
854
|
+
declare function EdgeInfoCard({ edge }: Props): react_jsx_runtime.JSX.Element;
|
|
855
|
+
|
|
856
|
+
declare function Overview(): react_jsx_runtime.JSX.Element | null;
|
|
857
|
+
|
|
858
|
+
export { ActionPanel, type ActionPanelState, type ActionPanelStore, type ColorPalette, EMPTY_NORMALIZED, EdgeInfoCard, type EdgeVisual, type GraphDataHook, type GraphDataStore, type GraphDisplayConfig, type GraphExplorationDeps, type GraphExplorationStore, type GraphFilterStore, type GraphFocusAction, type GraphFocusStore, type GraphProperties, type GraphProperty, type GraphRenderer, GraphRendererProvider, type GraphStatistics, type WorkspaceStores as GraphStoreBundle, GraphStoresContext, GraphVisualizer, type GraphVisualizerProps, type LabelDisplayMap, type LiveGraphDataResult, NodeInfoCard, type NodeVisual, type NormalizedGraph, Overview, type RawGraphEdge, type RawGraphNode, type SelectionStore, type StoreFactory, type VisualGraphEdge, type VisualGraphNode, type VisualGraphNormalized, type WorkspaceStores, buildColorPalette, buildColorPaletteFromNodes, createActionPanelStore, createGraphDataStore, createGraphExplorationStore, createGraphFilterStore, createGraphFocusStore, createSelectionStore, enrichEdge, enrichEdges, enrichNode, enrichNodes, extractDisplayLabel, isRawGraphNode, isVisualEdge, isVisualNode, normalizeGraph, toCytoscapeEdge, toCytoscapeNode, toReagraphEdge, toReagraphNode, useActionPanelStore, useCytoscapeData, useGraphFocus, useGraphRenderer, useLiveGraphData, useReagraphData, useWorkspaceGraphData, useWorkspaceGraphExploration, useWorkspaceGraphFilter, useWorkspaceSelection };
|