@aiready/components 0.13.20 → 0.13.21
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/hooks/useForceSimulation.d.ts +2 -49
- package/dist/hooks/useForceSimulation.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js.map +1 -1
- package/dist/useForceSimulation-BNhxX4gH.d.ts +49 -0
- package/package.json +4 -4
- package/src/charts/{ForceDirectedGraph.tsx → ForceDirectedGraph/index.tsx} +2 -2
- package/src/hooks/useForceSimulation.ts +0 -8
- package/src/index.ts +2 -3
- package/src/components/icons.tsx +0 -3
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as d3 from 'd3';
|
|
2
|
+
|
|
3
|
+
interface SimulationNode extends d3.SimulationNodeDatum {
|
|
4
|
+
id: string;
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}
|
|
7
|
+
interface SimulationLink extends d3.SimulationLinkDatum<SimulationNode> {
|
|
8
|
+
source: string | SimulationNode;
|
|
9
|
+
target: string | SimulationNode;
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}
|
|
12
|
+
interface ForceSimulationOptions {
|
|
13
|
+
chargeStrength?: number;
|
|
14
|
+
linkDistance?: number;
|
|
15
|
+
linkStrength?: number;
|
|
16
|
+
collisionStrength?: number;
|
|
17
|
+
collisionRadius?: number;
|
|
18
|
+
centerStrength?: number;
|
|
19
|
+
width: number;
|
|
20
|
+
height: number;
|
|
21
|
+
alphaDecay?: number;
|
|
22
|
+
alphaTarget?: number;
|
|
23
|
+
warmAlpha?: number;
|
|
24
|
+
alphaMin?: number;
|
|
25
|
+
stabilizeOnStop?: boolean;
|
|
26
|
+
tickThrottleMs?: number;
|
|
27
|
+
maxSimulationTimeMs?: number;
|
|
28
|
+
velocityDecay?: number;
|
|
29
|
+
onTick?: (nodes: SimulationNode[], links: SimulationLink[], sim: d3.Simulation<SimulationNode, SimulationLink>) => void;
|
|
30
|
+
}
|
|
31
|
+
interface UseForceSimulationReturn {
|
|
32
|
+
nodes: SimulationNode[];
|
|
33
|
+
links: SimulationLink[];
|
|
34
|
+
restart: () => void;
|
|
35
|
+
stop: () => void;
|
|
36
|
+
isRunning: boolean;
|
|
37
|
+
alpha: number;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
declare function useForceSimulation(initialNodes: SimulationNode[], initialLinks: SimulationLink[], options: ForceSimulationOptions): UseForceSimulationReturn & {
|
|
41
|
+
setForcesEnabled: (enabled: boolean) => void;
|
|
42
|
+
};
|
|
43
|
+
declare function useDrag(simulation: d3.Simulation<SimulationNode, any> | null | undefined): {
|
|
44
|
+
onDragStart: (event: any, node: SimulationNode) => void;
|
|
45
|
+
onDrag: (event: any, node: SimulationNode) => void;
|
|
46
|
+
onDragEnd: (event: any, node: SimulationNode) => void;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export { type ForceSimulationOptions as F, type SimulationLink as S, type UseForceSimulationReturn as U, type SimulationNode as a, useForceSimulation as b, useDrag as u };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiready/components",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.21",
|
|
4
4
|
"description": "Unified shared components library (UI, charts, hooks, utilities) for AIReady",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -91,8 +91,8 @@
|
|
|
91
91
|
"import": "./dist/hooks/useForceSimulation.js"
|
|
92
92
|
},
|
|
93
93
|
"./charts/ForceDirectedGraph": {
|
|
94
|
-
"types": "./dist/charts/ForceDirectedGraph.d.ts",
|
|
95
|
-
"import": "./dist/charts/ForceDirectedGraph.js"
|
|
94
|
+
"types": "./dist/charts/ForceDirectedGraph/index.d.ts",
|
|
95
|
+
"import": "./dist/charts/ForceDirectedGraph/index.js"
|
|
96
96
|
},
|
|
97
97
|
"./tailwind-config": "./tailwind.config.js"
|
|
98
98
|
},
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
"framer-motion": "^12.35.0",
|
|
129
129
|
"lucide-react": "^0.577.0",
|
|
130
130
|
"tailwind-merge": "^3.0.0",
|
|
131
|
-
"@aiready/core": "0.23.
|
|
131
|
+
"@aiready/core": "0.23.22"
|
|
132
132
|
},
|
|
133
133
|
"devDependencies": {
|
|
134
134
|
"@testing-library/jest-dom": "^6.6.5",
|
|
@@ -6,7 +6,7 @@ export {
|
|
|
6
6
|
type GraphNode,
|
|
7
7
|
type GraphLink,
|
|
8
8
|
type LayoutType,
|
|
9
|
-
} from '
|
|
9
|
+
} from '../force-directed';
|
|
10
10
|
|
|
11
11
|
// Default export for backward compatibility
|
|
12
|
-
export { ForceDirectedGraph as default } from '
|
|
12
|
+
export { ForceDirectedGraph as default } from '../force-directed';
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
// Re-export types from separate module for backward compatibility
|
|
2
|
-
export {
|
|
3
|
-
type SimulationNode,
|
|
4
|
-
type SimulationLink,
|
|
5
|
-
type ForceSimulationOptions,
|
|
6
|
-
type UseForceSimulationReturn,
|
|
7
|
-
} from './simulation-types';
|
|
8
|
-
|
|
9
1
|
// Import helpers from separate module
|
|
10
2
|
import { stabilizeNodes, seedRandomPositions } from './simulation-helpers';
|
|
11
3
|
import type {
|
package/src/index.ts
CHANGED
|
@@ -96,14 +96,13 @@ export * from './utils/score';
|
|
|
96
96
|
// Hooks
|
|
97
97
|
export { useDebounce } from './hooks/useDebounce';
|
|
98
98
|
export { useD3, useD3WithResize } from './hooks/useD3';
|
|
99
|
+
export { useForceSimulation, useDrag } from './hooks/useForceSimulation';
|
|
99
100
|
export {
|
|
100
|
-
useForceSimulation,
|
|
101
|
-
useDrag,
|
|
102
101
|
type SimulationNode,
|
|
103
102
|
type SimulationLink,
|
|
104
103
|
type ForceSimulationOptions,
|
|
105
104
|
type UseForceSimulationReturn,
|
|
106
|
-
} from './hooks/
|
|
105
|
+
} from './hooks/simulation-types';
|
|
107
106
|
|
|
108
107
|
// Charts
|
|
109
108
|
export {
|
package/src/components/icons.tsx
DELETED