@aiready/components 0.13.18 → 0.13.20
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 +7 -13
- package/dist/charts/ForceDirectedGraph.js +451 -337
- package/dist/charts/ForceDirectedGraph.js.map +1 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +728 -586
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
- package/src/charts/ForceDirectedGraph.tsx +12 -509
- package/src/charts/LinkItem.tsx +1 -1
- package/src/charts/NodeItem.tsx +1 -1
- package/src/charts/force-directed/ControlButton.tsx +39 -0
- package/src/charts/force-directed/ForceDirectedGraph.tsx +250 -0
- package/src/charts/force-directed/GraphCanvas.tsx +129 -0
- package/src/charts/{GraphControls.tsx → force-directed/GraphControls.tsx} +3 -110
- package/src/charts/force-directed/index.ts +31 -0
- package/src/charts/force-directed/types.ts +102 -0
- package/src/charts/{hooks.ts → force-directed/useGraphInteractions.ts} +64 -1
- package/src/charts/force-directed/useGraphLayout.ts +54 -0
- package/src/charts/force-directed/useImperativeHandle.ts +131 -0
- package/src/charts/layout-utils.ts +1 -1
- package/src/components/feedback/__tests__/badge.test.tsx +92 -0
- package/src/components/ui/__tests__/button.test.tsx +203 -0
- package/src/data-display/__tests__/ScoreBar.test.tsx +215 -0
- package/src/index.ts +4 -1
- package/src/utils/__tests__/score.test.ts +28 -7
- package/src/utils/score.ts +67 -29
- package/src/charts/types.ts +0 -24
|
@@ -1,28 +1,21 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { BaseGraphNode, BaseGraphLink } from '@aiready/core/client';
|
|
2
|
+
import * as React from 'react';
|
|
2
3
|
|
|
3
|
-
interface GraphNode {
|
|
4
|
-
id: string;
|
|
4
|
+
interface GraphNode extends BaseGraphNode {
|
|
5
5
|
label?: string;
|
|
6
6
|
color?: string;
|
|
7
7
|
size?: number;
|
|
8
8
|
group?: string;
|
|
9
9
|
kind?: 'file' | 'package';
|
|
10
10
|
packageGroup?: string;
|
|
11
|
-
x?: number;
|
|
12
|
-
y?: number;
|
|
13
|
-
fx?: number | null;
|
|
14
|
-
fy?: number | null;
|
|
15
11
|
}
|
|
16
|
-
interface GraphLink {
|
|
17
|
-
source: string | GraphNode;
|
|
18
|
-
target: string | GraphNode;
|
|
12
|
+
interface GraphLink extends BaseGraphLink {
|
|
19
13
|
color?: string;
|
|
20
14
|
width?: number;
|
|
21
15
|
label?: string;
|
|
22
16
|
type?: string;
|
|
23
17
|
}
|
|
24
18
|
type LayoutType = 'force' | 'hierarchical' | 'circular';
|
|
25
|
-
|
|
26
19
|
interface ForceDirectedGraphHandle {
|
|
27
20
|
pinAll: () => void;
|
|
28
21
|
unpinAll: () => void;
|
|
@@ -62,6 +55,7 @@ interface ForceDirectedGraphProps {
|
|
|
62
55
|
layout?: LayoutType;
|
|
63
56
|
onLayoutChange?: (layout: LayoutType) => void;
|
|
64
57
|
}
|
|
65
|
-
declare const ForceDirectedGraph: React__default.ForwardRefExoticComponent<ForceDirectedGraphProps & React__default.RefAttributes<ForceDirectedGraphHandle>>;
|
|
66
58
|
|
|
67
|
-
|
|
59
|
+
declare const ForceDirectedGraph: React.ForwardRefExoticComponent<ForceDirectedGraphProps & React.RefAttributes<ForceDirectedGraphHandle>>;
|
|
60
|
+
|
|
61
|
+
export { ForceDirectedGraph, type ForceDirectedGraphHandle, type ForceDirectedGraphProps, type GraphLink, type GraphNode, type LayoutType, ForceDirectedGraph as default };
|