@moxa/graph 2.8.1 → 2.9.0
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 +321 -0
- package/assets/icon-sprite.svg +1 -0
- package/assets/worker-CycNXNsJ.js +13 -0
- package/graph-tokens.json +160 -0
- package/index.cjs +486 -0
- package/index.d.ts +10 -0
- package/index.d.ts.map +1 -0
- package/index.js +74907 -0
- package/lib/behavior/brush-select.d.ts +10 -0
- package/lib/behavior/brush-select.d.ts.map +1 -0
- package/lib/behavior/click-select.d.ts +129 -0
- package/lib/behavior/click-select.d.ts.map +1 -0
- package/lib/behavior/collapse-expand.d.ts +4 -0
- package/lib/behavior/collapse-expand.d.ts.map +1 -0
- package/lib/behavior/create-edge.d.ts +52 -0
- package/lib/behavior/create-edge.d.ts.map +1 -0
- package/lib/behavior/drag-canvas.d.ts +7 -0
- package/lib/behavior/drag-canvas.d.ts.map +1 -0
- package/lib/behavior/drag-element.d.ts +6 -0
- package/lib/behavior/drag-element.d.ts.map +1 -0
- package/lib/behavior/fix-element-size.d.ts +9 -0
- package/lib/behavior/fix-element-size.d.ts.map +1 -0
- package/lib/behavior/focus-element.d.ts +4 -0
- package/lib/behavior/focus-element.d.ts.map +1 -0
- package/lib/behavior/helper/behavior.mapper.d.ts +9 -0
- package/lib/behavior/helper/behavior.mapper.d.ts.map +1 -0
- package/lib/behavior/helper/index.d.ts +2 -0
- package/lib/behavior/helper/index.d.ts.map +1 -0
- package/lib/behavior/hover-activate.d.ts +4 -0
- package/lib/behavior/hover-activate.d.ts.map +1 -0
- package/lib/behavior/index.d.ts +13 -0
- package/lib/behavior/index.d.ts.map +1 -0
- package/lib/behavior/scroll-canvas.d.ts +4 -0
- package/lib/behavior/scroll-canvas.d.ts.map +1 -0
- package/lib/behavior/select-all.d.ts +14 -0
- package/lib/behavior/select-all.d.ts.map +1 -0
- package/lib/behavior/zoom-canvas.d.ts +4 -0
- package/lib/behavior/zoom-canvas.d.ts.map +1 -0
- package/lib/edge/custom/index.d.ts +4 -0
- package/lib/edge/custom/index.d.ts.map +1 -0
- package/lib/edge/custom/line-edge.d.ts +15 -0
- package/lib/edge/custom/line-edge.d.ts.map +1 -0
- package/lib/edge/custom/polyline-edge.d.ts +21 -0
- package/lib/edge/custom/polyline-edge.d.ts.map +1 -0
- package/lib/edge/custom/quadratic-edge.d.ts +15 -0
- package/lib/edge/custom/quadratic-edge.d.ts.map +1 -0
- package/lib/edge/helper/custom-edge.helper.d.ts +12 -0
- package/lib/edge/helper/custom-edge.helper.d.ts.map +1 -0
- package/lib/edge/helper/edge-g6.mapper.d.ts +19 -0
- package/lib/edge/helper/edge-g6.mapper.d.ts.map +1 -0
- package/lib/edge/helper/edge.mapper.d.ts +20 -0
- package/lib/edge/helper/edge.mapper.d.ts.map +1 -0
- package/lib/edge/helper/edge.theme.d.ts +10 -0
- package/lib/edge/helper/edge.theme.d.ts.map +1 -0
- package/lib/edge/helper/index.d.ts +5 -0
- package/lib/edge/helper/index.d.ts.map +1 -0
- package/lib/edge/index.d.ts +3 -0
- package/lib/edge/index.d.ts.map +1 -0
- package/lib/graph/graph.d.ts +506 -0
- package/lib/graph/graph.d.ts.map +1 -0
- package/lib/graph/graph.mapper.d.ts +15 -0
- package/lib/graph/graph.mapper.d.ts.map +1 -0
- package/lib/graph/index.d.ts +3 -0
- package/lib/graph/index.d.ts.map +1 -0
- package/lib/group/custom/device-group.d.ts +33 -0
- package/lib/group/custom/device-group.d.ts.map +1 -0
- package/lib/group/custom/index.d.ts +2 -0
- package/lib/group/custom/index.d.ts.map +1 -0
- package/lib/group/helper/group-g6.mapper.d.ts +16 -0
- package/lib/group/helper/group-g6.mapper.d.ts.map +1 -0
- package/lib/group/helper/group.mapper.d.ts +21 -0
- package/lib/group/helper/group.mapper.d.ts.map +1 -0
- package/lib/group/helper/index.d.ts +3 -0
- package/lib/group/helper/index.d.ts.map +1 -0
- package/lib/group/index.d.ts +3 -0
- package/lib/group/index.d.ts.map +1 -0
- package/lib/layout/align.d.ts +18 -0
- package/lib/layout/align.d.ts.map +1 -0
- package/lib/layout/force.d.ts +10 -0
- package/lib/layout/force.d.ts.map +1 -0
- package/lib/layout/grid.d.ts +17 -0
- package/lib/layout/grid.d.ts.map +1 -0
- package/lib/layout/helper/index.d.ts +2 -0
- package/lib/layout/helper/index.d.ts.map +1 -0
- package/lib/layout/helper/layout.helper.d.ts +4 -0
- package/lib/layout/helper/layout.helper.d.ts.map +1 -0
- package/lib/layout/helper/layout.mapper.d.ts +6 -0
- package/lib/layout/helper/layout.mapper.d.ts.map +1 -0
- package/lib/layout/index.d.ts +7 -0
- package/lib/layout/index.d.ts.map +1 -0
- package/lib/layout/ring.d.ts +10 -0
- package/lib/layout/ring.d.ts.map +1 -0
- package/lib/layout/tree.d.ts +12 -0
- package/lib/layout/tree.d.ts.map +1 -0
- package/lib/model/background.model.d.ts +8 -0
- package/lib/model/background.model.d.ts.map +1 -0
- package/lib/model/behavior.model.d.ts +27 -0
- package/lib/model/behavior.model.d.ts.map +1 -0
- package/lib/model/edge.model.d.ts +80 -0
- package/lib/model/edge.model.d.ts.map +1 -0
- package/lib/model/element.model.d.ts +2 -0
- package/lib/model/element.model.d.ts.map +1 -0
- package/lib/model/event.model.d.ts +216 -0
- package/lib/model/event.model.d.ts.map +1 -0
- package/lib/model/extension.model.d.ts +15 -0
- package/lib/model/extension.model.d.ts.map +1 -0
- package/lib/model/graph.model.d.ts +34 -0
- package/lib/model/graph.model.d.ts.map +1 -0
- package/lib/model/group.model.d.ts +43 -0
- package/lib/model/group.model.d.ts.map +1 -0
- package/lib/model/icon.model.d.ts +11 -0
- package/lib/model/icon.model.d.ts.map +1 -0
- package/lib/model/image.model.d.ts +8 -0
- package/lib/model/image.model.d.ts.map +1 -0
- package/lib/model/index.d.ts +17 -0
- package/lib/model/index.d.ts.map +1 -0
- package/lib/model/label.model.d.ts +19 -0
- package/lib/model/label.model.d.ts.map +1 -0
- package/lib/model/layout.model.d.ts +22 -0
- package/lib/model/layout.model.d.ts.map +1 -0
- package/lib/model/node.model.d.ts +35 -0
- package/lib/model/node.model.d.ts.map +1 -0
- package/lib/model/plugin.model.d.ts +19 -0
- package/lib/model/plugin.model.d.ts.map +1 -0
- package/lib/model/shape.model.d.ts +8 -0
- package/lib/model/shape.model.d.ts.map +1 -0
- package/lib/model/state.model.d.ts +6 -0
- package/lib/model/state.model.d.ts.map +1 -0
- package/lib/model/theme.model.d.ts +62 -0
- package/lib/model/theme.model.d.ts.map +1 -0
- package/lib/model/viewport.model.d.ts +12 -0
- package/lib/model/viewport.model.d.ts.map +1 -0
- package/lib/node/custom/device-node.d.ts +36 -0
- package/lib/node/custom/device-node.d.ts.map +1 -0
- package/lib/node/custom/index.d.ts +2 -0
- package/lib/node/custom/index.d.ts.map +1 -0
- package/lib/node/helper/icon-style.d.ts +4 -0
- package/lib/node/helper/icon-style.d.ts.map +1 -0
- package/lib/node/helper/index.d.ts +5 -0
- package/lib/node/helper/index.d.ts.map +1 -0
- package/lib/node/helper/key-style.d.ts +5 -0
- package/lib/node/helper/key-style.d.ts.map +1 -0
- package/lib/node/helper/node-g6.mapper.d.ts +15 -0
- package/lib/node/helper/node-g6.mapper.d.ts.map +1 -0
- package/lib/node/helper/node.mapper.d.ts +26 -0
- package/lib/node/helper/node.mapper.d.ts.map +1 -0
- package/lib/node/index.d.ts +3 -0
- package/lib/node/index.d.ts.map +1 -0
- package/lib/plugin/context-menu.d.ts +6 -0
- package/lib/plugin/context-menu.d.ts.map +1 -0
- package/lib/plugin/element-toolbar.d.ts +51 -0
- package/lib/plugin/element-toolbar.d.ts.map +1 -0
- package/lib/plugin/fixed-toolbar.d.ts +28 -0
- package/lib/plugin/fixed-toolbar.d.ts.map +1 -0
- package/lib/plugin/graph-background.d.ts +33 -0
- package/lib/plugin/graph-background.d.ts.map +1 -0
- package/lib/plugin/helper/index.d.ts +2 -0
- package/lib/plugin/helper/index.d.ts.map +1 -0
- package/lib/plugin/helper/plugin.mapper.d.ts +8 -0
- package/lib/plugin/helper/plugin.mapper.d.ts.map +1 -0
- package/lib/plugin/history.d.ts +7 -0
- package/lib/plugin/history.d.ts.map +1 -0
- package/lib/plugin/index.d.ts +10 -0
- package/lib/plugin/index.d.ts.map +1 -0
- package/lib/plugin/minimap.d.ts +13 -0
- package/lib/plugin/minimap.d.ts.map +1 -0
- package/lib/plugin/snapline.d.ts +9 -0
- package/lib/plugin/snapline.d.ts.map +1 -0
- package/lib/plugin/tooltip.d.ts +11 -0
- package/lib/plugin/tooltip.d.ts.map +1 -0
- package/lib/themes/dark.d.ts +3 -0
- package/lib/themes/dark.d.ts.map +1 -0
- package/lib/themes/index.d.ts +4 -0
- package/lib/themes/index.d.ts.map +1 -0
- package/lib/themes/light.d.ts +3 -0
- package/lib/themes/light.d.ts.map +1 -0
- package/lib/themes/theme.mapper.d.ts +65 -0
- package/lib/themes/theme.mapper.d.ts.map +1 -0
- package/lib/utils/edge.helper.d.ts +19 -0
- package/lib/utils/edge.helper.d.ts.map +1 -0
- package/lib/utils/element.helper.d.ts +5 -0
- package/lib/utils/element.helper.d.ts.map +1 -0
- package/lib/utils/graph.helper.d.ts +5 -0
- package/lib/utils/graph.helper.d.ts.map +1 -0
- package/lib/utils/icon.helper.d.ts +3 -0
- package/lib/utils/icon.helper.d.ts.map +1 -0
- package/lib/utils/index.d.ts +10 -0
- package/lib/utils/index.d.ts.map +1 -0
- package/lib/utils/platform.helper.d.ts +3 -0
- package/lib/utils/platform.helper.d.ts.map +1 -0
- package/lib/utils/rect.helper.d.ts +16 -0
- package/lib/utils/rect.helper.d.ts.map +1 -0
- package/lib/utils/state.helper.d.ts +4 -0
- package/lib/utils/state.helper.d.ts.map +1 -0
- package/lib/utils/theme.helper.d.ts +3 -0
- package/lib/utils/theme.helper.d.ts.map +1 -0
- package/lib/utils/tree.helper.d.ts +4 -0
- package/lib/utils/tree.helper.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,506 @@
|
|
|
1
|
+
import { BaseBehavior, BaseBehaviorOptions, Graph, IEvent, State } from '@antv/g6';
|
|
2
|
+
import { BehaviorController } from '@antv/g6/lib/runtime/behavior';
|
|
3
|
+
import { DataController } from '@antv/g6/lib/runtime/data';
|
|
4
|
+
import { ElementController } from '@antv/g6/lib/runtime/element';
|
|
5
|
+
import { ViewportController } from '@antv/g6/lib/runtime/viewport';
|
|
6
|
+
import { DesignTokenConfig, MxEdgeData, MxElementType, MxGraphConfig, MxGraphData, MxGraphRenderer, MxGroupData, MxLayoutConfig, MxNodeData, MxPartialEdgeData, MxPartialGroupData, MxPartialNodeData, MxTokenConfig, MxTokenValues, MxUserBehavior, MxUserPlugin, MxUserThemeType, MxZoomRange } from '../model';
|
|
7
|
+
declare class MxGraph {
|
|
8
|
+
private config;
|
|
9
|
+
private _graph;
|
|
10
|
+
private renderType;
|
|
11
|
+
iconSpriteText: string;
|
|
12
|
+
tokenConfig: MxTokenConfig;
|
|
13
|
+
graphReady: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* 獲取圖形實例
|
|
16
|
+
* @returns 圖形實例
|
|
17
|
+
*/
|
|
18
|
+
get graph(): Graph;
|
|
19
|
+
/**
|
|
20
|
+
* 獲取容器元素
|
|
21
|
+
* @returns 容器元素
|
|
22
|
+
*/
|
|
23
|
+
get container(): HTMLElement;
|
|
24
|
+
/**
|
|
25
|
+
* 獲取畫布元素
|
|
26
|
+
* @returns 畫布元素
|
|
27
|
+
*/
|
|
28
|
+
get canvas(): HTMLCanvasElement | SVGAElement;
|
|
29
|
+
/**
|
|
30
|
+
* 獲取元素控制器
|
|
31
|
+
* @returns 元素控制器
|
|
32
|
+
*/
|
|
33
|
+
get elementController(): ElementController;
|
|
34
|
+
/**
|
|
35
|
+
* 獲取數據控制器
|
|
36
|
+
* @returns 數據控制器
|
|
37
|
+
*/
|
|
38
|
+
get dataController(): DataController;
|
|
39
|
+
/**
|
|
40
|
+
* 獲取行為控制器
|
|
41
|
+
* @returns 行為控制器
|
|
42
|
+
*/
|
|
43
|
+
get behaviorController(): BehaviorController;
|
|
44
|
+
/**
|
|
45
|
+
* 獲取視野控制器
|
|
46
|
+
* @returns 視野控制器
|
|
47
|
+
*/
|
|
48
|
+
get viewportController(): ViewportController;
|
|
49
|
+
/**
|
|
50
|
+
* 建構函數
|
|
51
|
+
* @param config - 圖形配置
|
|
52
|
+
*/
|
|
53
|
+
constructor(config: MxGraphConfig);
|
|
54
|
+
/**
|
|
55
|
+
* 初始化圖形
|
|
56
|
+
* @param options - 圖形選項
|
|
57
|
+
*/
|
|
58
|
+
private initGraph;
|
|
59
|
+
/**
|
|
60
|
+
* 載入圖示精靈
|
|
61
|
+
* @returns 是否成功載入圖示精靈
|
|
62
|
+
*/
|
|
63
|
+
private loadIconSprite;
|
|
64
|
+
private loadTokenConfig;
|
|
65
|
+
/**
|
|
66
|
+
* 檢查元素是否存在
|
|
67
|
+
* @param id - 元素ID
|
|
68
|
+
* @returns 元素是否存在
|
|
69
|
+
*/
|
|
70
|
+
isElementExist(id: string): boolean;
|
|
71
|
+
/**
|
|
72
|
+
* 檢查元素是否顯示
|
|
73
|
+
* @param id - 元素ID
|
|
74
|
+
* @returns 元素是否顯示
|
|
75
|
+
*/
|
|
76
|
+
isElementShow(id: string): boolean;
|
|
77
|
+
/**
|
|
78
|
+
* 檢查元素是否在視野內
|
|
79
|
+
* @param id - 元素ID
|
|
80
|
+
* @returns 元素是否在視野內
|
|
81
|
+
*/
|
|
82
|
+
isElementInView(id: string): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* 獲取元素的邊界框
|
|
85
|
+
* @param id - 元素ID或元素ID列表
|
|
86
|
+
* @returns 元素的邊界框
|
|
87
|
+
*/
|
|
88
|
+
getElementBoundingBox(id: string | string[]): {
|
|
89
|
+
width: number;
|
|
90
|
+
height: number;
|
|
91
|
+
center: import('@antv/g').Tuple3Number;
|
|
92
|
+
halfExtents: import('@antv/g').Tuple3Number;
|
|
93
|
+
min: import('@antv/g').Tuple3Number;
|
|
94
|
+
max: import('@antv/g').Tuple3Number;
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* 獲取圖形配置
|
|
98
|
+
* @returns 當前圖形配置
|
|
99
|
+
*/
|
|
100
|
+
getConfig(): MxGraphConfig;
|
|
101
|
+
/**
|
|
102
|
+
* 獲取圖形大小
|
|
103
|
+
* @returns 圖形的寬度和高度
|
|
104
|
+
*/
|
|
105
|
+
getSize(): {
|
|
106
|
+
width: number;
|
|
107
|
+
height: number;
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* 獲取元素類型
|
|
111
|
+
* @param id - 元素ID
|
|
112
|
+
* @returns 元素類型
|
|
113
|
+
*/
|
|
114
|
+
getElementType(id: string): MxElementType | null;
|
|
115
|
+
/**
|
|
116
|
+
* 獲取元素狀態
|
|
117
|
+
* @param id - 元素ID
|
|
118
|
+
* @returns 元素狀態
|
|
119
|
+
*/
|
|
120
|
+
getElementState(id: string): string[];
|
|
121
|
+
/**
|
|
122
|
+
* 根據狀態獲取元素
|
|
123
|
+
* @param type - 元素類型
|
|
124
|
+
* @param state - 元素狀態
|
|
125
|
+
* @returns 元素數據
|
|
126
|
+
*/
|
|
127
|
+
getElementByState(type: 'node', state: string): MxNodeData[];
|
|
128
|
+
getElementByState(type: 'edge', state: string): MxEdgeData[];
|
|
129
|
+
getElementByState(type: 'group', state: string): MxGroupData[];
|
|
130
|
+
/**
|
|
131
|
+
* 根據元素類型獲取元素數據
|
|
132
|
+
* @param types - 元素類型列表
|
|
133
|
+
* @returns 元素數據列表
|
|
134
|
+
*/
|
|
135
|
+
getElementByTypes(types: MxElementType[]): (MxNodeData | MxEdgeData | MxGroupData)[];
|
|
136
|
+
/**
|
|
137
|
+
* 設置渲染器
|
|
138
|
+
* @param renderer - 渲染器類型
|
|
139
|
+
*/
|
|
140
|
+
setRenderer(renderer: MxGraphRenderer): void;
|
|
141
|
+
/**
|
|
142
|
+
* 獲取主題
|
|
143
|
+
* @returns 當前主題
|
|
144
|
+
*/
|
|
145
|
+
getTheme(): MxUserThemeType;
|
|
146
|
+
getThemeTokens(): MxTokenValues;
|
|
147
|
+
/**
|
|
148
|
+
* 設置主題
|
|
149
|
+
* @param theme - 主題類型
|
|
150
|
+
*/
|
|
151
|
+
setTheme(theme: MxUserThemeType): void;
|
|
152
|
+
setThemeTokens(config: DesignTokenConfig | any): void;
|
|
153
|
+
/**
|
|
154
|
+
* 獲取佈局配置
|
|
155
|
+
* @returns 佈局配置
|
|
156
|
+
*/
|
|
157
|
+
getLayout(): MxLayoutConfig[];
|
|
158
|
+
/**
|
|
159
|
+
* 設置佈局配置
|
|
160
|
+
* @param config - 佈局配置
|
|
161
|
+
*/
|
|
162
|
+
setLayout(config: MxLayoutConfig | MxLayoutConfig[] | ((pre: MxLayoutConfig[]) => MxLayoutConfig[])): void;
|
|
163
|
+
/**
|
|
164
|
+
* 執行佈局
|
|
165
|
+
*/
|
|
166
|
+
layout(): Promise<void>;
|
|
167
|
+
/**
|
|
168
|
+
* 調整圖形大小
|
|
169
|
+
* @param width - 寬度
|
|
170
|
+
* @param height - 高度
|
|
171
|
+
*/
|
|
172
|
+
resize(): void;
|
|
173
|
+
resize(width?: number, height?: number): void;
|
|
174
|
+
/**
|
|
175
|
+
* 刷新圖形
|
|
176
|
+
*/
|
|
177
|
+
refresh(): void;
|
|
178
|
+
/**
|
|
179
|
+
* 設置是否自動調整大小
|
|
180
|
+
* @param auto - 是否自動調整大小
|
|
181
|
+
*/
|
|
182
|
+
autoSize(auto: boolean): void;
|
|
183
|
+
/**
|
|
184
|
+
* 縮放圖形
|
|
185
|
+
* @param ratio - 縮放比例
|
|
186
|
+
*/
|
|
187
|
+
zoom(ratio: number): void;
|
|
188
|
+
/**
|
|
189
|
+
* 縮放到指定比例
|
|
190
|
+
* @param ratio - 縮放比例
|
|
191
|
+
*/
|
|
192
|
+
zoomTo(ratio: number): void;
|
|
193
|
+
/**
|
|
194
|
+
* 獲取當前縮放比例
|
|
195
|
+
* @returns 縮放比例
|
|
196
|
+
*/
|
|
197
|
+
getZoom(): number;
|
|
198
|
+
/**
|
|
199
|
+
* @param zoomRange - 設定縮放比例範圍
|
|
200
|
+
* @example [0.5, 5] - [min, max] 包含最小和最大縮放比例
|
|
201
|
+
*/
|
|
202
|
+
setZoomRange(zoomRange: MxZoomRange): void;
|
|
203
|
+
/**
|
|
204
|
+
* 獲取縮放比例範圍
|
|
205
|
+
* @returns {MxZoomRange} 取得縮放比例範圍
|
|
206
|
+
*/
|
|
207
|
+
getZoomRange(): MxZoomRange;
|
|
208
|
+
/**
|
|
209
|
+
* 獲取常用點
|
|
210
|
+
* @returns 常用點
|
|
211
|
+
*/
|
|
212
|
+
getCommonPoints(): {
|
|
213
|
+
middle: {
|
|
214
|
+
x: number;
|
|
215
|
+
y: number;
|
|
216
|
+
};
|
|
217
|
+
leftTop: {
|
|
218
|
+
x: number;
|
|
219
|
+
y: number;
|
|
220
|
+
};
|
|
221
|
+
rightTop: {
|
|
222
|
+
x: number;
|
|
223
|
+
y: number;
|
|
224
|
+
};
|
|
225
|
+
rightBottom: {
|
|
226
|
+
x: number;
|
|
227
|
+
y: number;
|
|
228
|
+
};
|
|
229
|
+
leftBottom: {
|
|
230
|
+
x: number;
|
|
231
|
+
y: number;
|
|
232
|
+
};
|
|
233
|
+
};
|
|
234
|
+
/**
|
|
235
|
+
* 獲取圖形邊界矩形
|
|
236
|
+
* @returns 邊界矩形
|
|
237
|
+
*/
|
|
238
|
+
getBoundingRect(): DOMRect;
|
|
239
|
+
/**
|
|
240
|
+
* 將畫布坐標轉換為視口坐標
|
|
241
|
+
* @param point - 畫布坐標
|
|
242
|
+
* @returns 視口坐標
|
|
243
|
+
*/
|
|
244
|
+
canvasToViewport(point: {
|
|
245
|
+
x: number;
|
|
246
|
+
y: number;
|
|
247
|
+
}): {
|
|
248
|
+
x: number;
|
|
249
|
+
y: number;
|
|
250
|
+
};
|
|
251
|
+
/**
|
|
252
|
+
* 將視口坐標轉換為畫布坐標
|
|
253
|
+
* @param point - 視口坐標
|
|
254
|
+
* @returns 畫布坐標
|
|
255
|
+
*/
|
|
256
|
+
viewportToCanvas(point: {
|
|
257
|
+
x: number;
|
|
258
|
+
y: number;
|
|
259
|
+
}): {
|
|
260
|
+
x: number;
|
|
261
|
+
y: number;
|
|
262
|
+
};
|
|
263
|
+
/**
|
|
264
|
+
* 適應視口
|
|
265
|
+
*/
|
|
266
|
+
fitView(): void;
|
|
267
|
+
/**
|
|
268
|
+
* 適應中心
|
|
269
|
+
*/
|
|
270
|
+
fitCenter(): void;
|
|
271
|
+
/**
|
|
272
|
+
* 聚焦元素
|
|
273
|
+
* @param id - 元素ID
|
|
274
|
+
*/
|
|
275
|
+
focusItem(id: string): void;
|
|
276
|
+
/**
|
|
277
|
+
* 撤銷上一步操作
|
|
278
|
+
*/
|
|
279
|
+
undo(): void;
|
|
280
|
+
/**
|
|
281
|
+
* 重做上一步操作
|
|
282
|
+
*/
|
|
283
|
+
redo(): void;
|
|
284
|
+
/**
|
|
285
|
+
* 渲染圖形
|
|
286
|
+
*/
|
|
287
|
+
render(): Promise<void>;
|
|
288
|
+
/**
|
|
289
|
+
* 設置圖形數據
|
|
290
|
+
* @param data - 圖形數據
|
|
291
|
+
*/
|
|
292
|
+
setData(data: MxGraphData): void;
|
|
293
|
+
/**
|
|
294
|
+
* 清空圖形
|
|
295
|
+
*/
|
|
296
|
+
clear(): Promise<void>;
|
|
297
|
+
destroy(): Promise<void>;
|
|
298
|
+
/**
|
|
299
|
+
* 獲取事件
|
|
300
|
+
* @returns 事件對象
|
|
301
|
+
*/
|
|
302
|
+
getEvent(): Record<string, any>;
|
|
303
|
+
/**
|
|
304
|
+
* 檢查是否有指定事件
|
|
305
|
+
* @param eventName - 事件名稱
|
|
306
|
+
* @returns 是否有指定事件
|
|
307
|
+
*/
|
|
308
|
+
hasEvent(eventName: string): boolean;
|
|
309
|
+
/**
|
|
310
|
+
* 獲取行為
|
|
311
|
+
* @returns 行為列表
|
|
312
|
+
*/
|
|
313
|
+
getBehavior(): MxUserBehavior[];
|
|
314
|
+
/**
|
|
315
|
+
* 獲取行為實例
|
|
316
|
+
* @param key - 行為的唯一識別符
|
|
317
|
+
* @returns 行為實例
|
|
318
|
+
*/
|
|
319
|
+
getBehaviorInstance<T extends BaseBehaviorOptions = any>(key: string): BaseBehavior<T>;
|
|
320
|
+
/**
|
|
321
|
+
* 設置行為
|
|
322
|
+
* @param behavior - 行為
|
|
323
|
+
*/
|
|
324
|
+
setBehavior(behavior: MxUserBehavior | MxUserBehavior[] | ((pre: MxUserBehavior[]) => MxUserBehavior[])): void;
|
|
325
|
+
/**
|
|
326
|
+
* 監聽事件
|
|
327
|
+
* @param eventName - 事件名稱
|
|
328
|
+
* @param callback - 回調函數
|
|
329
|
+
*/
|
|
330
|
+
on<T extends IEvent>(eventName: string, callback: (e: T) => void): void;
|
|
331
|
+
/**
|
|
332
|
+
* 監聽事件(一次性)
|
|
333
|
+
* @param eventName - 事件名稱
|
|
334
|
+
* @param callback - 回調函數
|
|
335
|
+
*/
|
|
336
|
+
once<T extends IEvent>(eventName: string, callback: (e: T) => void): void;
|
|
337
|
+
/**
|
|
338
|
+
* 取消監聽事件
|
|
339
|
+
* @param eventName - 事件名稱
|
|
340
|
+
* @param callback - 回調函數
|
|
341
|
+
*/
|
|
342
|
+
off(): void;
|
|
343
|
+
off(eventName: string): void;
|
|
344
|
+
/**
|
|
345
|
+
* 獲取節點數據
|
|
346
|
+
* @param id - 節點ID
|
|
347
|
+
* @returns 節點數據
|
|
348
|
+
*/
|
|
349
|
+
getNodeData(): MxNodeData[];
|
|
350
|
+
getNodeData(id: string): MxNodeData;
|
|
351
|
+
getNodeData(id: string[]): MxNodeData[];
|
|
352
|
+
/**
|
|
353
|
+
* 添加節點
|
|
354
|
+
* @param node - 節點數據
|
|
355
|
+
*/
|
|
356
|
+
addNode(node: MxNodeData | MxNodeData[]): void;
|
|
357
|
+
/**
|
|
358
|
+
* 更新節點
|
|
359
|
+
* @param node - 節點數據
|
|
360
|
+
*/
|
|
361
|
+
updateNode(node: MxPartialNodeData | MxPartialNodeData[]): void;
|
|
362
|
+
/**
|
|
363
|
+
* 移除節點
|
|
364
|
+
* @param id - 節點ID
|
|
365
|
+
*/
|
|
366
|
+
removeNode(id: string | string[]): void;
|
|
367
|
+
/**
|
|
368
|
+
* 顯示元素
|
|
369
|
+
* @param id - 元素ID
|
|
370
|
+
*/
|
|
371
|
+
showElement(id: string | string[]): void;
|
|
372
|
+
/**
|
|
373
|
+
* 隱藏元素
|
|
374
|
+
* @param id - 元素ID
|
|
375
|
+
*/
|
|
376
|
+
hideElement(id: string | string[]): void;
|
|
377
|
+
/**
|
|
378
|
+
* 移除任一元素
|
|
379
|
+
* @param id - 元素ID,可以是字符串或字符串数组
|
|
380
|
+
*/
|
|
381
|
+
removeElement(id: string | string[]): void;
|
|
382
|
+
/**
|
|
383
|
+
* 設置元素狀態
|
|
384
|
+
* @param stateMap - 狀態映射
|
|
385
|
+
*/
|
|
386
|
+
setElementState(stateMap: Record<string, State | State[]>): void;
|
|
387
|
+
/**
|
|
388
|
+
* 清除元素狀態
|
|
389
|
+
* @param id - 元素ID
|
|
390
|
+
*/
|
|
391
|
+
clearElementState(id: string | string[]): void;
|
|
392
|
+
/**
|
|
393
|
+
* 獲取邊數據
|
|
394
|
+
* @param id - 邊ID
|
|
395
|
+
* @returns 邊數據
|
|
396
|
+
*/
|
|
397
|
+
getEdgeData(): MxEdgeData[];
|
|
398
|
+
getEdgeData(id: string): MxEdgeData;
|
|
399
|
+
getEdgeData(id: string[]): MxEdgeData[];
|
|
400
|
+
/**
|
|
401
|
+
* 檢查節點是否孤立
|
|
402
|
+
* @param nodeId - 節點ID
|
|
403
|
+
* @returns 是否孤立
|
|
404
|
+
*/
|
|
405
|
+
isIsolated(nodeId: string): boolean;
|
|
406
|
+
/**
|
|
407
|
+
* 添加邊
|
|
408
|
+
* @param edge - 邊數據
|
|
409
|
+
*/
|
|
410
|
+
addEdge(edge: MxEdgeData | MxEdgeData[]): void;
|
|
411
|
+
/**
|
|
412
|
+
* 移除邊
|
|
413
|
+
* @param id - 邊ID
|
|
414
|
+
*/
|
|
415
|
+
removeEdge(id: string | string[]): void;
|
|
416
|
+
/**
|
|
417
|
+
* 更新邊
|
|
418
|
+
* @param edge - 邊數據
|
|
419
|
+
*/
|
|
420
|
+
updateEdge(edge: MxPartialEdgeData | MxPartialEdgeData[]): void;
|
|
421
|
+
/**
|
|
422
|
+
* 獲取組數據
|
|
423
|
+
* @param id - 組ID
|
|
424
|
+
* @returns 組數據
|
|
425
|
+
*/
|
|
426
|
+
getGroupData(): MxGroupData[];
|
|
427
|
+
getGroupData(id: string): MxGroupData;
|
|
428
|
+
getGroupData(id: string[]): MxGroupData[];
|
|
429
|
+
/**
|
|
430
|
+
* 獲取子元素數據
|
|
431
|
+
* @param id - 元素ID
|
|
432
|
+
* @param option - 選項
|
|
433
|
+
* @param option.level - 遞迴層級
|
|
434
|
+
* @returns 子元素數據
|
|
435
|
+
*/
|
|
436
|
+
getChildrenData(id: string, option?: {
|
|
437
|
+
level?: number;
|
|
438
|
+
}): (MxNodeData | MxGroupData)[];
|
|
439
|
+
/**
|
|
440
|
+
* 添加組
|
|
441
|
+
* @param group - 組數據
|
|
442
|
+
*/
|
|
443
|
+
addGroup(group: MxGroupData | MxGroupData[]): void;
|
|
444
|
+
/**
|
|
445
|
+
* 將一組元素分配到指定的組。
|
|
446
|
+
*
|
|
447
|
+
* 此方法將 `ids` 數組中每個元素的父組更新為提供的 `groupId`。它首先檢查 `ids` 數組中的任何元素是否是 `groupId` 的子元素,如果是,則記錄警告並退出而不進行任何更改。
|
|
448
|
+
*
|
|
449
|
+
* @param ids - 要分配到組的元素ID數組。
|
|
450
|
+
* @param groupId - 要分配元素的組ID。
|
|
451
|
+
*
|
|
452
|
+
* @remarks
|
|
453
|
+
* - 如果 `ids` 數組中的某個元素已經是 `groupId` 的子元素,該方法將記錄警告並且不會對任何元素進行分配。
|
|
454
|
+
* - 該方法確定每個元素的類型('node' 或 'group'),並相應地進行更新。
|
|
455
|
+
*
|
|
456
|
+
* @example
|
|
457
|
+
* ```typescript
|
|
458
|
+
* const ids = ['node1', 'node2', 'group1'];
|
|
459
|
+
* const groupId = 'group2';
|
|
460
|
+
* graph.assignGroup(ids, groupId);
|
|
461
|
+
* ```
|
|
462
|
+
*/
|
|
463
|
+
assignGroup(ids: string[], groupId: string): void;
|
|
464
|
+
/**
|
|
465
|
+
* 移除組
|
|
466
|
+
* @param id - 組ID,可以是單個字符串或字符串数组
|
|
467
|
+
* @param option - 選項
|
|
468
|
+
* @param option.recursive - 是否遞迴移除子組,默認為false
|
|
469
|
+
*/
|
|
470
|
+
removeGroup(id: string | string[], option?: {
|
|
471
|
+
recursive?: boolean;
|
|
472
|
+
}): void;
|
|
473
|
+
/**
|
|
474
|
+
* 更新組
|
|
475
|
+
* @param group - 組數據
|
|
476
|
+
*/
|
|
477
|
+
updateGroup(group: MxPartialGroupData | MxPartialGroupData[]): void;
|
|
478
|
+
/**
|
|
479
|
+
* 展開組
|
|
480
|
+
* @param id - 組ID
|
|
481
|
+
*/
|
|
482
|
+
expandGroup(id: string | string[]): void;
|
|
483
|
+
/**
|
|
484
|
+
* 折疊組
|
|
485
|
+
* @param id - 組ID
|
|
486
|
+
*/
|
|
487
|
+
collapseGroup(id: string | string[]): void;
|
|
488
|
+
/**
|
|
489
|
+
* 獲取插件
|
|
490
|
+
* @returns 插件列表
|
|
491
|
+
*/
|
|
492
|
+
getPlugin(): MxUserPlugin[];
|
|
493
|
+
/**
|
|
494
|
+
* 獲取插件實例
|
|
495
|
+
* @param keyOrType - 插件的鍵或類型
|
|
496
|
+
* @returns 插件實例
|
|
497
|
+
*/
|
|
498
|
+
getPluginInstance<T>(keyOrType: string): T;
|
|
499
|
+
/**
|
|
500
|
+
* 設置插件
|
|
501
|
+
* @param plugin - 插件
|
|
502
|
+
*/
|
|
503
|
+
setPlugin(plugin: MxUserPlugin | MxUserPlugin[] | ((pre: MxUserPlugin[]) => MxUserPlugin[])): void;
|
|
504
|
+
}
|
|
505
|
+
export { MxGraph };
|
|
506
|
+
//# sourceMappingURL=graph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../../../libs/graph/src/lib/graph/graph.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,KAAK,EACL,MAAM,EAGN,KAAK,EACN,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAUnE,OAAO,EACL,iBAAiB,EACjB,UAAU,EACV,aAAa,EAEb,aAAa,EACb,WAAW,EACX,eAAe,EACf,WAAW,EACX,cAAc,EACd,UAAU,EACV,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EAEjB,aAAa,EACb,aAAa,EACb,cAAc,EACd,YAAY,EACZ,eAAe,EACf,WAAW,EACZ,MAAM,UAAU,CAAC;AAOlB,cAAM,OAAO;IAqEC,OAAO,CAAC,MAAM;IApE1B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,UAAU,CAA0B;IAC5C,cAAc,SAAM;IACpB,WAAW,EAAG,aAAa,CAAC;IAC5B,UAAU,UAAS;IAEnB;;;OAGG;IACH,IAAI,KAAK,IAAI,KAAK,CAEjB;IAED;;;OAGG;IACH,IAAI,SAAS,IAAI,WAAW,CAE3B;IAED;;;OAGG;IACH,IAAI,MAAM,IAAI,iBAAiB,GAAG,WAAW,CAI5C;IAED;;;OAGG;IACH,IAAI,iBAAiB,IAAI,iBAAiB,CAEzC;IAED;;;OAGG;IACH,IAAI,cAAc,IAAI,cAAc,CAEnC;IAED;;;OA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EAAE,GAAG,WAAW,EAAE;IAgBzC;;;;;;OAMG;IACH,eAAe,CACb,EAAE,EAAE,MAAM,EACV,MAAM,GAAE;QACN,KAAK,CAAC,EAAE,MAAM,CAAC;KACX,GACL,CAAC,UAAU,GAAG,WAAW,CAAC,EAAE;IAuB/B;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW,EAAE,GAAG,IAAI;IAOlD;;;;;;;;;;;;;;;;;;OAkBG;IACH,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAiBjD;;;;;OAKG;IACH,WAAW,CACT,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE,EACrB,MAAM,GAAE;QACN,SAAS,CAAC,EAAE,OAAO,CAAC;KACE,GACvB,IAAI;IAsBP;;;OAGG;IACH,WAAW,CAAC,KAAK,EAAE,kBAAkB,GAAG,kBAAkB,EAAE,GAAG,IAAI;IAKnE;;;OAGG;IACH,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI;IAOxC;;;OAGG;IACH,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI;IAS1C;;;OAGG;IACH,SAAS,IAAI,YAAY,EAAE;IAe3B;;;;OAIG;IACH,iBAAiB,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,GAAG,CAAC;IAI1C;;;OAGG;IACH,SAAS,CACP,MAAM,EACF,YAAY,GACZ,YAAY,EAAE,GACd,CAAC,CAAC,GAAG,EAAE,YAAY,EAAE,KAAK,YAAY,EAAE,CAAC,GAC5C,IAAI;CAeR;AAED,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { GraphOptions } from '@antv/g6';
|
|
2
|
+
import { MxGraphConfig } from '../model';
|
|
3
|
+
import { MxGraph } from './graph';
|
|
4
|
+
export declare const MxGraphMapper: {
|
|
5
|
+
toGraphOptions: (graph: MxGraph, config: MxGraphConfig) => GraphOptions;
|
|
6
|
+
toRenderer: (renderer: MxGraphConfig["renderer"]) => GraphOptions;
|
|
7
|
+
toGraphData: (data: MxGraphConfig["data"]) => GraphOptions;
|
|
8
|
+
toContainer: (container: MxGraphConfig["container"]) => GraphOptions;
|
|
9
|
+
toBehaviors: (behaviors: MxGraphConfig["behaviors"]) => GraphOptions;
|
|
10
|
+
toLayout: (mxGraph: MxGraph, configs: MxGraphConfig["layouts"]) => GraphOptions;
|
|
11
|
+
toPlugin: (graph: MxGraph, plugins: MxGraphConfig["plugins"], theme?: MxGraphConfig["theme"]) => GraphOptions;
|
|
12
|
+
toAnimation: (animation: MxGraphConfig["animation"]) => GraphOptions;
|
|
13
|
+
toTheme: (theme: MxGraphConfig["theme"]) => GraphOptions;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=graph.mapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph.mapper.d.ts","sourceRoot":"","sources":["../../../../libs/graph/src/lib/graph/graph.mapper.ts"],"names":[],"mappings":"AAEA,OAAO,EAAuB,YAAY,EAAmB,MAAM,UAAU,CAAC;AAM9E,OAAO,EAAqB,aAAa,EAAE,MAAM,UAAU,CAAC;AAK5D,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAkKlC,eAAO,MAAM,aAAa;4BA/JjB,OAAO,UACN,aAAa,KACpB,YAAY;2BA0Ce,aAAa,CAAC,UAAU,CAAC,KAAG,YAAY;wBAW3C,aAAa,CAAC,MAAM,CAAC,KAAG,YAAY;6BArB/B,aAAa,CAAC,WAAW,CAAC,KAAG,YAAY;6BAsE1C,aAAa,CAAC,WAAW,CAAC,KAAG,YAAY;wBAO7D,OAAO,WACP,aAAa,CAAC,SAAS,CAAC,KAChC,YAAY;sBASN,OAAO,WACL,aAAa,CAAC,SAAS,CAAC,UAC1B,aAAa,CAAC,OAAO,CAAC,KAC5B,YAAY;6BA0BiB,aAAa,CAAC,WAAW,CAAC,KAAG,YAAY;qBAPjD,aAAa,CAAC,OAAO,CAAC,KAAG,YAAY;CAyB5D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../libs/graph/src/lib/graph/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { CircleStyleProps as GCircleStyleProps, Group, Image, ImageStyleProps, Rect, RectStyleProps, Text, TextStyleProps } from '@antv/g';
|
|
2
|
+
import { CircleCombo, CircleComboStyleProps, IconStyleProps, State } from '@antv/g6';
|
|
3
|
+
import { STDSize } from '@antv/g6/lib/types';
|
|
4
|
+
import { MxGroupConfig, MxGroupLabel } from '../../../index.ts';
|
|
5
|
+
export interface DeviceGroupStyleProps extends CircleComboStyleProps {
|
|
6
|
+
title: boolean;
|
|
7
|
+
highlight: MxGroupConfig['highlight'];
|
|
8
|
+
labelStatus: MxGroupLabel['status'];
|
|
9
|
+
labelCustomBackground: MxGroupLabel['background'];
|
|
10
|
+
}
|
|
11
|
+
export declare class DeviceGroup extends CircleCombo {
|
|
12
|
+
static defaultProps: Partial<DeviceGroupStyleProps>;
|
|
13
|
+
get states(): State[];
|
|
14
|
+
get isExist(): boolean;
|
|
15
|
+
private getElementOffsets;
|
|
16
|
+
getKeyStyle(attrs: Required<DeviceGroupStyleProps>): GCircleStyleProps;
|
|
17
|
+
protected getKeySize(attributes: Required<CircleComboStyleProps>): STDSize;
|
|
18
|
+
getHaloStyle(attrs: Required<DeviceGroupStyleProps>): GCircleStyleProps | false;
|
|
19
|
+
getIconStyle(attrs: Required<DeviceGroupStyleProps>): IconStyleProps | false;
|
|
20
|
+
getLabelStyle(attrs: Required<DeviceGroupStyleProps>): TextStyleProps;
|
|
21
|
+
getTitleStyle(attrs: Required<DeviceGroupStyleProps>): TextStyleProps | false;
|
|
22
|
+
getStatusStyle(attrs: Required<DeviceGroupStyleProps>): ImageStyleProps | false;
|
|
23
|
+
getTitleBackgroundStyle(attrs: Required<DeviceGroupStyleProps>): RectStyleProps | false;
|
|
24
|
+
getLabelBackgroundStyle(attrs: Required<DeviceGroupStyleProps>): RectStyleProps | false;
|
|
25
|
+
drawTitleShape(attrs: Required<DeviceGroupStyleProps>, container: Group): Text | undefined;
|
|
26
|
+
drawStatusShape(attrs: Required<DeviceGroupStyleProps>, container: Group): Image | undefined;
|
|
27
|
+
drawTitleBackgroundShape(attrs: Required<DeviceGroupStyleProps>, container: Group): Rect | undefined;
|
|
28
|
+
drawLabelBackgroundShape(attrs: Required<DeviceGroupStyleProps>, container: Group): Rect | undefined;
|
|
29
|
+
render(attrs: Required<DeviceGroupStyleProps>, container: Group): void;
|
|
30
|
+
onframe(): void;
|
|
31
|
+
animate(keyframes: Keyframe[], options?: number | KeyframeAnimationOptions): import('@antv/g').IAnimation | null;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=device-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"device-group.d.ts","sourceRoot":"","sources":["../../../../../libs/graph/src/lib/group/custom/device-group.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,IAAI,iBAAiB,EACrC,KAAK,EACL,KAAK,EACL,eAAe,EACf,IAAI,EACJ,cAAc,EACd,IAAI,EACJ,cAAc,EACf,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,WAAW,EACX,qBAAqB,EAErB,cAAc,EAEd,KAAK,EAEN,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAGL,aAAa,EACb,YAAY,EAEb,MAAM,aAAa,CAAC;AAarB,MAAM,WAAW,qBAAsB,SAAQ,qBAAqB;IAClE,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,aAAa,CAAC,WAAW,CAAC,CAA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qBAAqB,CAAC,EACtC,SAAS,EAAE,KAAK;IAUlB,wBAAwB,CACtB,KAAK,EAAE,QAAQ,CAAC,qBAAqB,CAAC,EACtC,SAAS,EAAE,KAAK;IAUT,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,qBAAqB,CAAC,EAAE,SAAS,EAAE,KAAK;IAO/D,OAAO;IAQP,OAAO,CACd,SAAS,EAAE,QAAQ,EAAE,EACrB,OAAO,CAAC,EAAE,MAAM,GAAG,wBAAwB;CAI9C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../libs/graph/src/lib/group/custom/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ComboData } from '@antv/g6';
|
|
2
|
+
import { ComboStyle } from '@antv/g6/lib/spec/element/combo';
|
|
3
|
+
import { PartialNodeLikeData } from '@antv/g6/lib/types';
|
|
4
|
+
import { MxGroupConfig, MxGroupData } from '../../../index.ts';
|
|
5
|
+
/**
|
|
6
|
+
* internal
|
|
7
|
+
*/
|
|
8
|
+
export declare const G6GroupMapper: {
|
|
9
|
+
toGroupData: (group: PartialNodeLikeData<ComboData>) => MxGroupData;
|
|
10
|
+
toGroupCommon: (style: ComboData) => MxGroupConfig;
|
|
11
|
+
toGroupType: (type?: string) => MxGroupConfig;
|
|
12
|
+
toIcon: (style: ComboStyle) => MxGroupConfig;
|
|
13
|
+
toLabel: (style: ComboStyle, type: "title" | "label") => MxGroupConfig;
|
|
14
|
+
toPoints: (style: ComboStyle) => MxGroupConfig;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=group-g6.mapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-g6.mapper.d.ts","sourceRoot":"","sources":["../../../../../libs/graph/src/lib/group/helper/group-g6.mapper.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAIV,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EACL,aAAa,EACb,WAAW,EAKZ,MAAM,aAAa,CAAC;AAqIrB;;GAEG;AACH,eAAO,MAAM,aAAa;yBAtIE,mBAAmB,CAAC,SAAS,CAAC,KAAG,WAAW;2BAyB1C,SAAS,KAAG,aAAa;yBAiB3B,MAAM,KAAG,aAAa;oBAuD3B,UAAU,KAAG,aAAa;qBA5CzB,UAAU,QAAQ,OAAO,GAAG,OAAO,KAAG,aAAa;sBApBlD,UAAU,KAAG,aAAa;CA4GlD,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComboData } from '@antv/g6';
|
|
2
|
+
import { ComboStyle } from '@antv/g6/lib/spec/element/combo';
|
|
3
|
+
import { MxGroupConfig, MxGroupLabel, MxGroupType, MxIconConfig, MxPartialGroupData } from '../../../index.ts';
|
|
4
|
+
/**
|
|
5
|
+
* internal
|
|
6
|
+
*/
|
|
7
|
+
export declare const MxGroupMapper: {
|
|
8
|
+
toGroupData: (data: MxPartialGroupData, option?: {
|
|
9
|
+
full: boolean;
|
|
10
|
+
}) => ComboData;
|
|
11
|
+
toCollapsed: (config: MxGroupConfig) => ComboStyle;
|
|
12
|
+
toGroupType: (type: MxGroupType) => ComboStyle;
|
|
13
|
+
toIcon: (icon: MxIconConfig, option?: {
|
|
14
|
+
full: boolean;
|
|
15
|
+
}) => ComboStyle;
|
|
16
|
+
toLabel: (label: MxGroupLabel, option?: {
|
|
17
|
+
full: boolean;
|
|
18
|
+
}) => ComboStyle;
|
|
19
|
+
toPoints: (point: MxGroupConfig["point"]) => ComboStyle;
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=group.mapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group.mapper.d.ts","sourceRoot":"","sources":["../../../../../libs/graph/src/lib/group/helper/group.mapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA+B,MAAM,UAAU,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EACL,aAAa,EACb,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAoLrB;;GAEG;AACH,eAAO,MAAM,aAAa;wBApLlB,kBAAkB,WACf;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,KACzB,SAAS;0BA+JiB,aAAa,KAAG,UAAU;wBA7G5B,WAAW,KAAG,UAAU;mBA+F7B,YAAY,WAAW;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,KAAG,UAAU;qBAzClE,YAAY,WACV;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,KACzB,UAAU;sBA/DY,aAAa,CAAC,OAAO,CAAC,KAAG,UAAU;CA8I3D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../libs/graph/src/lib/group/helper/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../libs/graph/src/lib/group/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BaseLayout, GraphData, SingleLayoutOptions } from '@antv/g6';
|
|
2
|
+
import { MxGraph } from '../graph';
|
|
3
|
+
import { MxLayoutConfigBase } from '../model';
|
|
4
|
+
export type MxAlignLayoutConfig = MxLayoutConfigBase & {
|
|
5
|
+
alignment?: 'horizontal-center' | 'vertical-center' | 'horizontal-space' | 'vertical-space';
|
|
6
|
+
};
|
|
7
|
+
export declare const getAlignLayoutOptions: (graph: MxGraph, config?: Partial<MxAlignLayoutConfig>) => MxAlignLayoutConfig;
|
|
8
|
+
export type MxAlignLayoutOptions = SingleLayoutOptions & Pick<MxAlignLayoutConfig, 'alignment'>;
|
|
9
|
+
export declare class AlignLayout extends BaseLayout<MxAlignLayoutOptions> {
|
|
10
|
+
id: string;
|
|
11
|
+
execute(data: GraphData): Promise<GraphData>;
|
|
12
|
+
private getCenterAlignment;
|
|
13
|
+
private getSpaceAlignment;
|
|
14
|
+
private sortNodesByDirection;
|
|
15
|
+
private getMinMaxPoints;
|
|
16
|
+
private getCenterPoint;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=align.d.ts.map
|