@cyber-harbour/ui 1.0.45 → 1.0.47
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/index.d.mts +89 -22
- package/dist/index.d.ts +89 -22
- package/dist/index.js +121 -123
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +149 -151
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -3
- package/src/Core/IconComponents/BusIcon.tsx +16 -0
- package/src/Core/IconComponents/CarIcon.tsx +16 -0
- package/src/Core/IconComponents/FileIcon.tsx +16 -0
- package/src/Core/IconComponents/PlaneIcon.tsx +16 -0
- package/src/Core/IconComponents/ShipIcon.tsx +33 -0
- package/src/Core/IconComponents/WayIcon.tsx +24 -0
- package/src/Core/IconComponents/index.ts +6 -0
- package/src/Graph2D/Graph2D.tsx +1439 -913
- package/src/Graph2D/GraphLoader.tsx +0 -4
- package/src/Graph2D/json_test.json +44443 -3684
- package/src/Graph2D/types.ts +69 -21
- package/src/Theme/themes/dark.ts +1 -0
- package/src/Theme/themes/light.ts +1 -0
- package/src/Theme/types.ts +1 -0
- package/dist/eye_light-3WS4REO5.png +0 -0
- package/dist/eye_light_hover-PVS4UAB4.png +0 -0
- package/dist/group_light-RVCSCGRJ.png +0 -0
- package/dist/group_light_hover-LVI5PRZM.png +0 -0
- /package/src/Graph2D/{eye_light.png → icons/eye_light.png} +0 -0
- /package/src/Graph2D/{eye_light_hover.png → icons/eye_light_hover.png} +0 -0
- /package/src/Graph2D/{group_light.png → icons/group_light.png} +0 -0
- /package/src/Graph2D/{group_light_hover.png → icons/group_light_hover.png} +0 -0
package/src/Graph2D/types.ts
CHANGED
|
@@ -1,29 +1,77 @@
|
|
|
1
|
-
|
|
1
|
+
export interface Graph2DRef {
|
|
2
|
+
/**
|
|
3
|
+
* Масштабирует график так, чтобы все узлы были видны
|
|
4
|
+
* @param duration Длительность анимации масштабирования в миллисекундах
|
|
5
|
+
* @param padding Отступ от краев в пикселях
|
|
6
|
+
*/
|
|
7
|
+
zoomToFit: (duration?: number, padding?: number) => void;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Добавляет новые узлы и связи на график
|
|
11
|
+
* @param newNodes Массив новых узлов для добавления
|
|
12
|
+
* @param newLinks Массив новых связей для добавления
|
|
13
|
+
* @param options Опции для настройки поведения при добавлении
|
|
14
|
+
* - smoothAppearance: если true, существующие узлы не будут двигаться,
|
|
15
|
+
* а новые появятся плавно рядом со связанными узлами
|
|
16
|
+
* - transitionDuration: длительность анимации появления новых узлов в миллисекундах
|
|
17
|
+
*/
|
|
18
|
+
addNodes: (
|
|
19
|
+
newNodes: NodeObject[],
|
|
20
|
+
newLinks?: LinkObject[],
|
|
21
|
+
options?: {
|
|
22
|
+
smoothAppearance?: boolean;
|
|
23
|
+
transitionDuration?: number;
|
|
24
|
+
}
|
|
25
|
+
) => void;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Удаляет узлы и связанные с ними связи из графа
|
|
29
|
+
* @param nodeIds Массив идентификаторов узлов для удаления
|
|
30
|
+
*/
|
|
31
|
+
removeNodes: (nodeIds: (string | number)[]) => void;
|
|
32
|
+
}
|
|
2
33
|
|
|
3
34
|
export interface Graph2DProps {
|
|
4
|
-
graphData
|
|
5
|
-
linkSource?: string;
|
|
6
|
-
linkTarget?: string;
|
|
35
|
+
graphData: GraphData;
|
|
7
36
|
loading?: boolean;
|
|
8
37
|
|
|
9
38
|
// Container layout
|
|
10
|
-
width
|
|
11
|
-
height
|
|
12
|
-
|
|
13
|
-
//
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
nodeSizeBase: number;
|
|
18
|
-
nodeAreaFactor: number;
|
|
19
|
-
textPaddingFactor: number;
|
|
20
|
-
gridSpacing: number;
|
|
21
|
-
dotSize: number;
|
|
22
|
-
};
|
|
39
|
+
width: number;
|
|
40
|
+
height: number;
|
|
41
|
+
|
|
42
|
+
// Button controls
|
|
43
|
+
buttons?: NodeButton[];
|
|
44
|
+
|
|
45
|
+
// Event handlers
|
|
23
46
|
onNodeClick?: (node: NodeObject) => void;
|
|
24
|
-
onLinkClick?: (link: NodeObject) => void;
|
|
25
|
-
onNodeHover?: (node: NodeObject | null) => void;
|
|
26
|
-
onLinkHover?: (link: NodeObject | null) => void;
|
|
27
47
|
onBackgroundClick?: () => void;
|
|
28
|
-
|
|
48
|
+
onNodeHover?: (node: NodeObject | null) => void;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface NodeButton {
|
|
52
|
+
img: string;
|
|
53
|
+
hoverImg: string;
|
|
54
|
+
onClick: (node: NodeObject) => void;
|
|
29
55
|
}
|
|
56
|
+
|
|
57
|
+
export type GraphData<NodeType = {}, LinkType = {}> = {
|
|
58
|
+
nodes: NodeObject<NodeType>[];
|
|
59
|
+
links: LinkObject<NodeType, LinkType>[];
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export type NodeObject<NodeType = {}> = NodeType & {
|
|
63
|
+
id?: string | number;
|
|
64
|
+
x?: number;
|
|
65
|
+
y?: number;
|
|
66
|
+
vx?: number;
|
|
67
|
+
vy?: number;
|
|
68
|
+
fx?: number;
|
|
69
|
+
fy?: number;
|
|
70
|
+
[others: string]: any;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export type LinkObject<NodeType = {}, LinkType = {}> = LinkType & {
|
|
74
|
+
source: string | number | NodeObject<NodeType>;
|
|
75
|
+
target: string | number | NodeObject<NodeType>;
|
|
76
|
+
[others: string]: any;
|
|
77
|
+
};
|
package/src/Theme/themes/dark.ts
CHANGED
package/src/Theme/types.ts
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|