@cocorof/graphier 0.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/index.cjs +378 -77
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +43 -2
- package/dist/index.js +378 -77
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -38,6 +38,12 @@ export declare interface ConnectionGroup {
|
|
|
38
38
|
nodes: GraphNode[];
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
/** Context menu event: node + screen position for rendering custom menu */
|
|
42
|
+
export declare type ContextMenuHandler = (node: GraphNode, position: {
|
|
43
|
+
x: number;
|
|
44
|
+
y: number;
|
|
45
|
+
}) => void;
|
|
46
|
+
|
|
41
47
|
export declare const DEFAULT_LAYOUT: Required<LayoutConfig>;
|
|
42
48
|
|
|
43
49
|
export declare const DEFAULT_STYLE: Required<StyleConfig>;
|
|
@@ -98,6 +104,12 @@ export declare interface LayoutConfig {
|
|
|
98
104
|
settledThreshold?: number;
|
|
99
105
|
}
|
|
100
106
|
|
|
107
|
+
/** Layout settled callback */
|
|
108
|
+
export declare type LayoutSettledHandler = () => void;
|
|
109
|
+
|
|
110
|
+
/** Layout tick callback with simulation alpha */
|
|
111
|
+
export declare type LayoutTickHandler = (alpha: number) => void;
|
|
112
|
+
|
|
101
113
|
export declare type LinkEventHandler = (link: GraphLink) => void;
|
|
102
114
|
|
|
103
115
|
export declare const minimal: ThemeConfig;
|
|
@@ -115,6 +127,20 @@ export declare interface NetworkGraph3DProps {
|
|
|
115
127
|
onNodeDoubleClick?: NodeEventHandler;
|
|
116
128
|
/** Hover on a node (null = hover out) */
|
|
117
129
|
onNodeHover?: NullableNodeEventHandler;
|
|
130
|
+
/** Right-click on a node — receives node + screen position for custom menu */
|
|
131
|
+
onContextMenu?: ContextMenuHandler;
|
|
132
|
+
/** Click on an edge/link */
|
|
133
|
+
onLinkClick?: LinkEventHandler;
|
|
134
|
+
/** Hover on an edge/link (null = hover out) */
|
|
135
|
+
onLinkHover?: NullableLinkEventHandler;
|
|
136
|
+
/** Node drag (fires continuously during drag) */
|
|
137
|
+
onNodeDrag?: NodeDragHandler;
|
|
138
|
+
/** Node drag end */
|
|
139
|
+
onNodeDragEnd?: NodeDragHandler;
|
|
140
|
+
/** Fired when force simulation converges */
|
|
141
|
+
onLayoutSettled?: LayoutSettledHandler;
|
|
142
|
+
/** Fired on each layout tick with current alpha */
|
|
143
|
+
onLayoutTick?: LayoutTickHandler;
|
|
118
144
|
/** Currently selected node ID (controlled mode) */
|
|
119
145
|
selectedNodeId?: string | null;
|
|
120
146
|
/** Number of hops to highlight around selected node (default: 3) */
|
|
@@ -164,8 +190,8 @@ export declare interface NetworkGraph3DRef {
|
|
|
164
190
|
getRenderer(): THREE.WebGLRenderer | null;
|
|
165
191
|
/** Access the Three.js camera */
|
|
166
192
|
getCamera(): THREE.PerspectiveCamera | null;
|
|
167
|
-
/** Capture a screenshot as a
|
|
168
|
-
|
|
193
|
+
/** Capture a screenshot as a PNG data URL string (synchronous, matches original) */
|
|
194
|
+
captureScreenshot(): string | null;
|
|
169
195
|
}
|
|
170
196
|
|
|
171
197
|
export declare function NodeDetailPanel(props: NodeDetailPanelProps): JSX_2.Element;
|
|
@@ -189,8 +215,17 @@ export declare interface NodeDetailPanelProps {
|
|
|
189
215
|
style?: CSSProperties;
|
|
190
216
|
}
|
|
191
217
|
|
|
218
|
+
/** Node drag event (fires during drag) */
|
|
219
|
+
export declare type NodeDragHandler = (node: GraphNode, position: {
|
|
220
|
+
x: number;
|
|
221
|
+
y: number;
|
|
222
|
+
z: number;
|
|
223
|
+
}) => void;
|
|
224
|
+
|
|
192
225
|
export declare type NodeEventHandler = (node: GraphNode) => void;
|
|
193
226
|
|
|
227
|
+
export declare type NullableLinkEventHandler = (link: GraphLink | null) => void;
|
|
228
|
+
|
|
194
229
|
export declare type NullableNodeEventHandler = (node: GraphNode | null) => void;
|
|
195
230
|
|
|
196
231
|
/** Runtime node with layout positions (internal) */
|
|
@@ -205,6 +240,12 @@ export declare interface RendererConfig {
|
|
|
205
240
|
antialias?: boolean;
|
|
206
241
|
/** Max device pixel ratio (default: 1.5) */
|
|
207
242
|
pixelRatioMax?: number;
|
|
243
|
+
/**
|
|
244
|
+
* Camera control mode:
|
|
245
|
+
* - "fly" (default): WASD/arrow thrust-based flight with inertia (matches original)
|
|
246
|
+
* - "orbit": z/x zoom, arrow keys orbit around target
|
|
247
|
+
*/
|
|
248
|
+
cameraMode?: "fly" | "orbit";
|
|
208
249
|
}
|
|
209
250
|
|
|
210
251
|
export declare interface ResolvedTheme {
|