@aiready/components 0.1.0 → 0.1.4
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/charts/ForceDirectedGraph.d.ts +19 -2
- package/dist/charts/ForceDirectedGraph.js +856 -207
- package/dist/charts/ForceDirectedGraph.js.map +1 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/hooks/useForceSimulation.d.ts +9 -1
- package/dist/hooks/useForceSimulation.js +210 -19
- package/dist/hooks/useForceSimulation.js.map +1 -1
- package/dist/index.d.ts +20 -1
- package/dist/index.js +989 -205
- package/dist/index.js.map +1 -1
- package/package.json +6 -3
- package/src/__tests__/smoke.test.js +4 -0
- package/src/__tests__/smoke.test.ts +5 -0
- package/src/charts/ForceDirectedGraph.tsx +601 -214
- package/src/charts/GraphControls.tsx +218 -0
- package/src/charts/LinkItem.tsx +74 -0
- package/src/charts/NodeItem.tsx +70 -0
- package/src/hooks/useForceSimulation.ts +259 -29
- package/src/index.ts +4 -0
|
@@ -8,12 +8,22 @@ interface GraphNode extends SimulationNode {
|
|
|
8
8
|
color?: string;
|
|
9
9
|
size?: number;
|
|
10
10
|
group?: string;
|
|
11
|
+
kind?: 'file' | 'package';
|
|
12
|
+
packageGroup?: string;
|
|
11
13
|
}
|
|
12
14
|
interface GraphLink extends SimulationLink {
|
|
13
15
|
color?: string;
|
|
14
16
|
width?: number;
|
|
15
17
|
label?: string;
|
|
16
18
|
}
|
|
19
|
+
interface ForceDirectedGraphHandle {
|
|
20
|
+
pinAll: () => void;
|
|
21
|
+
unpinAll: () => void;
|
|
22
|
+
resetLayout: () => void;
|
|
23
|
+
fitView: () => void;
|
|
24
|
+
getPinnedNodes: () => string[];
|
|
25
|
+
setDragMode: (enabled: boolean) => void;
|
|
26
|
+
}
|
|
17
27
|
interface ForceDirectedGraphProps {
|
|
18
28
|
nodes: GraphNode[];
|
|
19
29
|
links: GraphLink[];
|
|
@@ -34,7 +44,14 @@ interface ForceDirectedGraphProps {
|
|
|
34
44
|
showNodeLabels?: boolean;
|
|
35
45
|
showLinkLabels?: boolean;
|
|
36
46
|
className?: string;
|
|
47
|
+
manualLayout?: boolean;
|
|
48
|
+
onManualLayoutChange?: (enabled: boolean) => void;
|
|
49
|
+
packageBounds?: Record<string, {
|
|
50
|
+
x: number;
|
|
51
|
+
y: number;
|
|
52
|
+
r: number;
|
|
53
|
+
}>;
|
|
37
54
|
}
|
|
38
|
-
declare const ForceDirectedGraph: React__default.
|
|
55
|
+
declare const ForceDirectedGraph: React__default.ForwardRefExoticComponent<ForceDirectedGraphProps & React__default.RefAttributes<ForceDirectedGraphHandle>>;
|
|
39
56
|
|
|
40
|
-
export { ForceDirectedGraph, type ForceDirectedGraphProps, type GraphLink, type GraphNode };
|
|
57
|
+
export { ForceDirectedGraph, type ForceDirectedGraphHandle, type ForceDirectedGraphProps, type GraphLink, type GraphNode };
|