@antv/g6 5.0.1-beta.2 → 5.0.2

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.
Files changed (282) hide show
  1. package/dist/g6.min.js +2 -2
  2. package/dist/lib/behaviors/click-select.d.ts +4 -5
  3. package/dist/lib/elements/base-element.d.ts +1 -22
  4. package/dist/lib/elements/combos/base-combo.d.ts +4 -4
  5. package/dist/lib/elements/edges/base-edge.d.ts +4 -2
  6. package/dist/lib/elements/effect.d.ts +17 -0
  7. package/dist/lib/elements/nodes/base-node.d.ts +5 -4
  8. package/dist/lib/elements/nodes/diamond.d.ts +0 -1
  9. package/dist/lib/elements/shapes/badge.d.ts +17 -6
  10. package/dist/lib/elements/shapes/base-shape.d.ts +9 -3
  11. package/dist/lib/elements/shapes/icon.d.ts +15 -3
  12. package/dist/lib/elements/shapes/label.d.ts +18 -7
  13. package/dist/lib/exports.d.ts +3 -2
  14. package/dist/lib/index.d.ts +5 -1
  15. package/dist/lib/layouts/base-layout.d.ts +3 -1
  16. package/dist/lib/plugins/bubble-sets.d.ts +2 -2
  17. package/dist/lib/plugins/hull/index.d.ts +2 -2
  18. package/dist/lib/runtime/canvas.d.ts +15 -2
  19. package/dist/lib/runtime/data.d.ts +7 -16
  20. package/dist/lib/runtime/element.d.ts +18 -2
  21. package/dist/lib/runtime/graph.d.ts +372 -108
  22. package/dist/lib/spec/element/edge.d.ts +1 -1
  23. package/dist/lib/spec/element/node.d.ts +1 -1
  24. package/dist/lib/transforms/process-parallel-edges.d.ts +2 -2
  25. package/dist/lib/types/callable.d.ts +0 -11
  26. package/dist/lib/types/data.d.ts +12 -0
  27. package/dist/lib/types/edge.d.ts +11 -0
  28. package/dist/lib/types/element.d.ts +100 -9
  29. package/dist/lib/types/index.d.ts +0 -1
  30. package/dist/lib/types/point.d.ts +0 -1
  31. package/dist/lib/utils/element.d.ts +2 -2
  32. package/dist/lib/utils/layout.d.ts +2 -2
  33. package/dist/lib/utils/path.d.ts +3 -3
  34. package/dist/lib/utils/position.d.ts +8 -8
  35. package/dist/lib/utils/style.d.ts +13 -8
  36. package/esm/behaviors/click-select.d.ts +4 -5
  37. package/esm/behaviors/click-select.js +59 -50
  38. package/esm/behaviors/click-select.js.map +1 -1
  39. package/esm/behaviors/lasso-select.js.map +1 -1
  40. package/esm/elements/base-element.d.ts +1 -22
  41. package/esm/elements/base-element.js +0 -21
  42. package/esm/elements/base-element.js.map +1 -1
  43. package/esm/elements/combos/base-combo.d.ts +4 -4
  44. package/esm/elements/combos/base-combo.js +27 -4
  45. package/esm/elements/combos/base-combo.js.map +1 -1
  46. package/esm/elements/edges/base-edge.d.ts +4 -2
  47. package/esm/elements/edges/base-edge.js +41 -7
  48. package/esm/elements/edges/base-edge.js.map +1 -1
  49. package/esm/elements/effect.d.ts +17 -0
  50. package/esm/elements/effect.js +70 -0
  51. package/esm/elements/effect.js.map +1 -0
  52. package/esm/elements/nodes/base-node.d.ts +5 -4
  53. package/esm/elements/nodes/base-node.js +33 -14
  54. package/esm/elements/nodes/base-node.js.map +1 -1
  55. package/esm/elements/nodes/circle.js +1 -1
  56. package/esm/elements/nodes/circle.js.map +1 -1
  57. package/esm/elements/nodes/diamond.d.ts +0 -1
  58. package/esm/elements/nodes/diamond.js +0 -6
  59. package/esm/elements/nodes/diamond.js.map +1 -1
  60. package/esm/elements/nodes/ellipse.js +1 -1
  61. package/esm/elements/nodes/ellipse.js.map +1 -1
  62. package/esm/elements/nodes/image.js +2 -2
  63. package/esm/elements/nodes/image.js.map +1 -1
  64. package/esm/elements/nodes/rect.js +1 -1
  65. package/esm/elements/nodes/rect.js.map +1 -1
  66. package/esm/elements/shapes/badge.d.ts +17 -6
  67. package/esm/elements/shapes/badge.js +9 -0
  68. package/esm/elements/shapes/badge.js.map +1 -1
  69. package/esm/elements/shapes/base-shape.d.ts +9 -3
  70. package/esm/elements/shapes/base-shape.js +33 -15
  71. package/esm/elements/shapes/base-shape.js.map +1 -1
  72. package/esm/elements/shapes/icon.d.ts +15 -3
  73. package/esm/elements/shapes/icon.js +12 -4
  74. package/esm/elements/shapes/icon.js.map +1 -1
  75. package/esm/elements/shapes/label.d.ts +18 -7
  76. package/esm/elements/shapes/label.js +10 -0
  77. package/esm/elements/shapes/label.js.map +1 -1
  78. package/esm/elements/shapes/polygon.js +1 -1
  79. package/esm/elements/shapes/polygon.js.map +1 -1
  80. package/esm/exports.d.ts +3 -2
  81. package/esm/exports.js +1 -1
  82. package/esm/exports.js.map +1 -1
  83. package/esm/index.d.ts +5 -1
  84. package/esm/index.js +5 -1
  85. package/esm/index.js.map +1 -1
  86. package/esm/layouts/base-layout.d.ts +3 -1
  87. package/esm/layouts/base-layout.js +3 -1
  88. package/esm/layouts/base-layout.js.map +1 -1
  89. package/esm/plugins/bubble-sets.d.ts +2 -2
  90. package/esm/plugins/bubble-sets.js.map +1 -1
  91. package/esm/plugins/hull/index.d.ts +2 -2
  92. package/esm/plugins/hull/index.js.map +1 -1
  93. package/esm/runtime/canvas.d.ts +15 -2
  94. package/esm/runtime/canvas.js.map +1 -1
  95. package/esm/runtime/data.d.ts +7 -16
  96. package/esm/runtime/data.js +14 -34
  97. package/esm/runtime/data.js.map +1 -1
  98. package/esm/runtime/element.d.ts +18 -2
  99. package/esm/runtime/element.js +68 -20
  100. package/esm/runtime/element.js.map +1 -1
  101. package/esm/runtime/graph.d.ts +372 -108
  102. package/esm/runtime/graph.js +271 -76
  103. package/esm/runtime/graph.js.map +1 -1
  104. package/esm/runtime/layout.js +1 -1
  105. package/esm/runtime/layout.js.map +1 -1
  106. package/esm/spec/element/edge.d.ts +1 -1
  107. package/esm/spec/element/node.d.ts +1 -1
  108. package/esm/themes/base.js +2 -0
  109. package/esm/themes/base.js.map +1 -1
  110. package/esm/transforms/collapse-expand-node.js +14 -4
  111. package/esm/transforms/collapse-expand-node.js.map +1 -1
  112. package/esm/transforms/process-parallel-edges.d.ts +2 -2
  113. package/esm/types/callable.d.ts +0 -11
  114. package/esm/types/data.d.ts +12 -0
  115. package/esm/types/edge.d.ts +11 -0
  116. package/esm/types/element.d.ts +100 -9
  117. package/esm/types/index.d.ts +0 -1
  118. package/esm/types/point.d.ts +0 -1
  119. package/esm/utils/element.d.ts +2 -2
  120. package/esm/utils/element.js.map +1 -1
  121. package/esm/utils/layout.d.ts +2 -2
  122. package/esm/utils/layout.js +4 -4
  123. package/esm/utils/layout.js.map +1 -1
  124. package/esm/utils/path.d.ts +3 -3
  125. package/esm/utils/path.js +1 -1
  126. package/esm/utils/path.js.map +1 -1
  127. package/esm/utils/position.d.ts +8 -8
  128. package/esm/utils/position.js +2 -2
  129. package/esm/utils/position.js.map +1 -1
  130. package/esm/utils/style.d.ts +13 -8
  131. package/esm/utils/style.js +16 -11
  132. package/esm/utils/style.js.map +1 -1
  133. package/lib/behaviors/click-select.d.ts +4 -5
  134. package/lib/behaviors/click-select.js +59 -50
  135. package/lib/behaviors/click-select.js.map +1 -1
  136. package/lib/behaviors/lasso-select.js.map +1 -1
  137. package/lib/elements/base-element.d.ts +1 -22
  138. package/lib/elements/base-element.js +0 -21
  139. package/lib/elements/base-element.js.map +1 -1
  140. package/lib/elements/combos/base-combo.d.ts +4 -4
  141. package/lib/elements/combos/base-combo.js +27 -4
  142. package/lib/elements/combos/base-combo.js.map +1 -1
  143. package/lib/elements/edges/base-edge.d.ts +4 -2
  144. package/lib/elements/edges/base-edge.js +41 -7
  145. package/lib/elements/edges/base-edge.js.map +1 -1
  146. package/lib/elements/effect.d.ts +17 -0
  147. package/lib/elements/effect.js +74 -0
  148. package/lib/elements/effect.js.map +1 -0
  149. package/lib/elements/nodes/base-node.d.ts +5 -4
  150. package/lib/elements/nodes/base-node.js +33 -14
  151. package/lib/elements/nodes/base-node.js.map +1 -1
  152. package/lib/elements/nodes/circle.js +1 -1
  153. package/lib/elements/nodes/circle.js.map +1 -1
  154. package/lib/elements/nodes/diamond.d.ts +0 -1
  155. package/lib/elements/nodes/diamond.js +0 -6
  156. package/lib/elements/nodes/diamond.js.map +1 -1
  157. package/lib/elements/nodes/ellipse.js +1 -1
  158. package/lib/elements/nodes/ellipse.js.map +1 -1
  159. package/lib/elements/nodes/image.js +2 -2
  160. package/lib/elements/nodes/image.js.map +1 -1
  161. package/lib/elements/nodes/rect.js +1 -1
  162. package/lib/elements/nodes/rect.js.map +1 -1
  163. package/lib/elements/shapes/badge.d.ts +17 -6
  164. package/lib/elements/shapes/badge.js +9 -0
  165. package/lib/elements/shapes/badge.js.map +1 -1
  166. package/lib/elements/shapes/base-shape.d.ts +9 -3
  167. package/lib/elements/shapes/base-shape.js +33 -15
  168. package/lib/elements/shapes/base-shape.js.map +1 -1
  169. package/lib/elements/shapes/icon.d.ts +15 -3
  170. package/lib/elements/shapes/icon.js +12 -4
  171. package/lib/elements/shapes/icon.js.map +1 -1
  172. package/lib/elements/shapes/label.d.ts +18 -7
  173. package/lib/elements/shapes/label.js +10 -0
  174. package/lib/elements/shapes/label.js.map +1 -1
  175. package/lib/elements/shapes/polygon.js +1 -1
  176. package/lib/elements/shapes/polygon.js.map +1 -1
  177. package/lib/exports.d.ts +3 -2
  178. package/lib/exports.js +5 -2
  179. package/lib/exports.js.map +1 -1
  180. package/lib/index.d.ts +5 -1
  181. package/lib/index.js +6 -2
  182. package/lib/index.js.map +1 -1
  183. package/lib/layouts/base-layout.d.ts +3 -1
  184. package/lib/layouts/base-layout.js +3 -1
  185. package/lib/layouts/base-layout.js.map +1 -1
  186. package/lib/plugins/bubble-sets.d.ts +2 -2
  187. package/lib/plugins/bubble-sets.js.map +1 -1
  188. package/lib/plugins/hull/index.d.ts +2 -2
  189. package/lib/plugins/hull/index.js.map +1 -1
  190. package/lib/runtime/canvas.d.ts +15 -2
  191. package/lib/runtime/canvas.js.map +1 -1
  192. package/lib/runtime/data.d.ts +7 -16
  193. package/lib/runtime/data.js +14 -34
  194. package/lib/runtime/data.js.map +1 -1
  195. package/lib/runtime/element.d.ts +18 -2
  196. package/lib/runtime/element.js +68 -20
  197. package/lib/runtime/element.js.map +1 -1
  198. package/lib/runtime/graph.d.ts +372 -108
  199. package/lib/runtime/graph.js +271 -76
  200. package/lib/runtime/graph.js.map +1 -1
  201. package/lib/runtime/layout.js +1 -1
  202. package/lib/runtime/layout.js.map +1 -1
  203. package/lib/spec/element/edge.d.ts +1 -1
  204. package/lib/spec/element/node.d.ts +1 -1
  205. package/lib/themes/base.js +2 -0
  206. package/lib/themes/base.js.map +1 -1
  207. package/lib/transforms/collapse-expand-node.js +14 -4
  208. package/lib/transforms/collapse-expand-node.js.map +1 -1
  209. package/lib/transforms/process-parallel-edges.d.ts +2 -2
  210. package/lib/types/callable.d.ts +0 -11
  211. package/lib/types/data.d.ts +12 -0
  212. package/lib/types/edge.d.ts +11 -0
  213. package/lib/types/element.d.ts +100 -9
  214. package/lib/types/index.d.ts +0 -1
  215. package/lib/types/point.d.ts +0 -1
  216. package/lib/utils/element.d.ts +2 -2
  217. package/lib/utils/element.js.map +1 -1
  218. package/lib/utils/layout.d.ts +2 -2
  219. package/lib/utils/layout.js +4 -4
  220. package/lib/utils/layout.js.map +1 -1
  221. package/lib/utils/path.d.ts +3 -3
  222. package/lib/utils/path.js +1 -1
  223. package/lib/utils/path.js.map +1 -1
  224. package/lib/utils/position.d.ts +8 -8
  225. package/lib/utils/position.js +2 -2
  226. package/lib/utils/position.js.map +1 -1
  227. package/lib/utils/style.d.ts +13 -8
  228. package/lib/utils/style.js +18 -13
  229. package/lib/utils/style.js.map +1 -1
  230. package/package.json +10 -12
  231. package/src/behaviors/click-select.ts +59 -60
  232. package/src/behaviors/lasso-select.ts +2 -2
  233. package/src/elements/base-element.ts +1 -25
  234. package/src/elements/combos/base-combo.ts +27 -11
  235. package/src/elements/edges/base-edge.ts +28 -8
  236. package/src/elements/effect.ts +74 -0
  237. package/src/elements/nodes/base-node.ts +23 -18
  238. package/src/elements/nodes/circle.ts +1 -1
  239. package/src/elements/nodes/diamond.ts +0 -7
  240. package/src/elements/nodes/ellipse.ts +1 -1
  241. package/src/elements/nodes/image.ts +2 -2
  242. package/src/elements/nodes/rect.ts +1 -1
  243. package/src/elements/shapes/badge.ts +17 -5
  244. package/src/elements/shapes/base-shape.ts +35 -15
  245. package/src/elements/shapes/icon.ts +18 -7
  246. package/src/elements/shapes/label.ts +19 -6
  247. package/src/elements/shapes/polygon.ts +1 -1
  248. package/src/exports.ts +6 -2
  249. package/src/index.ts +6 -2
  250. package/src/layouts/base-layout.ts +5 -1
  251. package/src/plugins/bubble-sets.ts +2 -2
  252. package/src/plugins/hull/index.ts +2 -2
  253. package/src/runtime/canvas.ts +15 -10
  254. package/src/runtime/data.ts +22 -44
  255. package/src/runtime/element.ts +80 -26
  256. package/src/runtime/graph.ts +398 -126
  257. package/src/runtime/layout.ts +2 -2
  258. package/src/spec/element/edge.ts +1 -1
  259. package/src/spec/element/node.ts +1 -1
  260. package/src/themes/base.ts +2 -0
  261. package/src/transforms/collapse-expand-node.ts +13 -4
  262. package/src/transforms/process-parallel-edges.ts +2 -2
  263. package/src/types/callable.ts +0 -12
  264. package/src/types/data.ts +13 -0
  265. package/src/types/edge.ts +11 -0
  266. package/src/types/element.ts +106 -10
  267. package/src/types/index.ts +0 -1
  268. package/src/types/point.ts +0 -1
  269. package/src/utils/element.ts +3 -13
  270. package/src/utils/layout.ts +6 -6
  271. package/src/utils/path.ts +3 -3
  272. package/src/utils/position.ts +8 -8
  273. package/src/utils/style.ts +19 -12
  274. package/dist/lib/types/position.d.ts +0 -2
  275. package/esm/types/position.d.ts +0 -2
  276. package/esm/types/position.js +0 -2
  277. package/esm/types/position.js.map +0 -1
  278. package/lib/types/position.d.ts +0 -2
  279. package/lib/types/position.js +0 -3
  280. package/lib/types/position.js.map +0 -1
  281. package/scripts/tips.js +0 -6
  282. package/src/types/position.ts +0 -3
@@ -99,17 +99,16 @@ export interface ClickSelectOptions extends BaseBehaviorOptions {
99
99
  * <en/> When the mouse clicks on an element, you can activate the state of the element, such as selecting nodes or edges. When the degree is 1, clicking on a node will highlight the current node and its directly adjacent nodes and edges.
100
100
  */
101
101
  export declare class ClickSelect extends BaseBehavior<ClickSelectOptions> {
102
- private selectedElementIds;
103
- private neighborSelectedElementIds;
102
+ private select;
103
+ private neighbor;
104
104
  private shortcut;
105
105
  static defaultOptions: Partial<ClickSelectOptions>;
106
106
  constructor(context: RuntimeContext, options: ClickSelectOptions);
107
107
  private bindEvents;
108
108
  private onClickSelect;
109
109
  private onClickCanvas;
110
- private updateElementsState;
111
- private updateNeighborSelectedElementIds;
112
- private getElementsState;
110
+ private get isMultipleSelect();
111
+ private updateState;
113
112
  private validate;
114
113
  private unbindEvents;
115
114
  destroy(): void;
@@ -3,7 +3,7 @@ import { Keyframe } from '../types';
3
3
  import type { BaseShapeStyleProps } from './shapes';
4
4
  import { BaseShape } from './shapes';
5
5
  export declare abstract class BaseElement<T extends BaseShapeStyleProps> extends BaseShape<T> {
6
- get parsedAttributes(): Required<T>;
6
+ protected get parsedAttributes(): Required<T>;
7
7
  /**
8
8
  * <zh/> 动画帧执行函数
9
9
  *
@@ -11,25 +11,4 @@ export declare abstract class BaseElement<T extends BaseShapeStyleProps> extends
11
11
  */
12
12
  protected onframe(): void;
13
13
  animate(keyframes: Keyframe[], options?: number | KeyframeAnimationOptions | undefined): IAnimation | null;
14
- /**
15
- * <zh/> 在元素完成创建并执行完入场动画后调用
16
- *
17
- * <en/> Called after the element is created and the entrance animation is completed
18
- * @override
19
- */
20
- onCreate(): void;
21
- /**
22
- * <zh/> 在元素更新并执行完过渡动画后调用
23
- *
24
- * <en/> Called after the element is updated and the transition animation is completed
25
- * @override
26
- */
27
- onUpdate(): void;
28
- /**
29
- * <zh/> 在元素完成退场动画并销毁后调用
30
- *
31
- * <en/> Called after the element completes the exit animation and is destroyed
32
- * @override
33
- */
34
- onDestroy(): void;
35
14
  }
@@ -1,5 +1,5 @@
1
1
  import { AABB, BaseStyleProps, DisplayObject, DisplayObjectConfig, Group } from '@antv/g';
2
- import type { CollapsedMarkerStyleProps, ID, NodeLikeData, Padding, Position, Prefix, STDSize, Size } from '../../types';
2
+ import type { CollapsedMarkerStyleProps, Combo, ID, NodeLikeData, Padding, Point, Prefix, STDSize, Size } from '../../types';
3
3
  import type { BaseNodeStyleProps } from '../nodes';
4
4
  import { BaseNode } from '../nodes';
5
5
  import { IconStyleProps } from '../shapes';
@@ -59,7 +59,7 @@ export interface BaseComboStyleProps extends BaseNodeStyleProps, Prefix<'collaps
59
59
  *
60
60
  * <en/> When customizing a combo, it is recommended to use this class as the base class. In this way, users only need to focus on the logic of drawing keyShape
61
61
  */
62
- export declare abstract class BaseCombo<S extends BaseComboStyleProps = BaseComboStyleProps> extends BaseNode<S> {
62
+ export declare abstract class BaseCombo<S extends BaseComboStyleProps = BaseComboStyleProps> extends BaseNode<S> implements Combo {
63
63
  type: string;
64
64
  static defaultStyleProps: Partial<BaseComboStyleProps>;
65
65
  constructor(options: DisplayObjectConfig<BaseComboStyleProps>);
@@ -76,7 +76,7 @@ export declare abstract class BaseCombo<S extends BaseComboStyleProps = BaseComb
76
76
  protected getCollapsedMarkerStyle(attributes: Required<S>): IconStyleProps | false;
77
77
  protected getCollapsedMarkerText(type: CollapsedMarkerStyleProps['type'], attributes: Required<S>): string;
78
78
  protected getComboZIndex(attributes: Required<S>): number;
79
- getComboPosition(attributes: Required<S>): Position;
79
+ getComboPosition(attributes: Required<S>): Point;
80
80
  protected getComboStyle(attributes: Required<S>): {
81
81
  x: number;
82
82
  y: number;
@@ -85,7 +85,7 @@ export declare abstract class BaseCombo<S extends BaseComboStyleProps = BaseComb
85
85
  };
86
86
  protected updateComboPosition(attributes: Required<S>): void;
87
87
  render(attributes: Required<S>, container?: Group): void;
88
- protected hostingAnimation: boolean;
88
+ update(attr?: Partial<S>): void;
89
89
  protected onframe(): void;
90
90
  animate(keyframes: Keyframe[], options?: number | KeyframeAnimationOptions): import("@antv/g").IAnimation | null;
91
91
  }
@@ -1,7 +1,7 @@
1
1
  import type { DisplayObject, DisplayObjectConfig, Group, PathStyleProps } from '@antv/g';
2
2
  import { Path } from '@antv/g';
3
3
  import type { PathArray } from '@antv/util';
4
- import type { BaseElementStyleProps, EdgeArrowStyleProps, EdgeBadgeStyleProps, EdgeLabelStyleProps, ID, Keyframe, LoopStyleProps, Node, Point, Prefix } from '../../types';
4
+ import type { BaseElementStyleProps, Edge, EdgeArrowStyleProps, EdgeBadgeStyleProps, EdgeLabelStyleProps, ID, Keyframe, LoopStyleProps, Node, Point, Prefix } from '../../types';
5
5
  import { BaseElement } from '../base-element';
6
6
  import type { BadgeStyleProps, LabelStyleProps } from '../shapes';
7
7
  /**
@@ -138,7 +138,7 @@ type ParsedBaseEdgeStyleProps = Required<BaseEdgeStyleProps>;
138
138
  *
139
139
  * <en/> Base class of the edge
140
140
  */
141
- export declare abstract class BaseEdge extends BaseElement<BaseEdgeStyleProps> {
141
+ export declare abstract class BaseEdge extends BaseElement<BaseEdgeStyleProps> implements Edge {
142
142
  type: string;
143
143
  static defaultStyleProps: Partial<BaseEdgeStyleProps>;
144
144
  constructor(options: DisplayObjectConfig<BaseEdgeStyleProps>);
@@ -156,6 +156,8 @@ export declare abstract class BaseEdge extends BaseElement<BaseEdgeStyleProps> {
156
156
  protected drawLabelShape(attributes: ParsedBaseEdgeStyleProps, container: Group): void;
157
157
  protected drawHaloShape(attributes: ParsedBaseEdgeStyleProps, container: Group): void;
158
158
  protected drawBadgeShape(attributes: ParsedBaseEdgeStyleProps, container: Group): void;
159
+ protected drawSourceArrow(attributes: ParsedBaseEdgeStyleProps): void;
160
+ protected drawTargetArrow(attributes: ParsedBaseEdgeStyleProps): void;
159
161
  protected drawKeyShape(attributes: ParsedBaseEdgeStyleProps, container: Group): Path | undefined;
160
162
  render(attributes?: Required<BaseEdgeStyleProps>, container?: Group): void;
161
163
  protected onframe(): void;
@@ -0,0 +1,17 @@
1
+ import type { Element } from '../types';
2
+ /**
3
+ * <zh/> 基于样式属性是否变化控制函数是否执行
4
+ *
5
+ * <en/> Control whether the function is executed based on whether the style attribute changes
6
+ * @param styler - <zh/> 获取样式属性函数 | <en/> Get style attribute function
7
+ * @returns <zh/> 装饰器 | <en/> Decorator
8
+ * @remarks
9
+ * <zh/> 仅指定 getStyle 的情况下,会分别使用当前的 attributes 和 新的 attributes 调用函数,若两者相同,则不执行函数。
10
+ *
11
+ * 如果指定了 shapeKey, 则会直接获取该图形的 attributes 作为原始样式属性,通常在 getStyle 函数中获取了包围盒时使用。
12
+ *
13
+ * <en/> Only when getStyle is specified, the function will be called with the current attributes and the new attributes respectively. If they are the same, the function will not be executed.
14
+ *
15
+ * If shapeKey is specified, the attributes of the shape will be directly obtained as the original style attributes, which is usually used when the bounding box of the element is used in the getStyle function.
16
+ */
17
+ export declare function effect(styler: (self: any, attributes: Record<string, unknown>) => Record<string, unknown>): (target: Element, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
@@ -1,7 +1,7 @@
1
1
  import type { BaseStyleProps, DisplayObject, DisplayObjectConfig, Group } from '@antv/g';
2
2
  import type { CategoricalPalette } from '../../palettes/types';
3
3
  import type { NodeData } from '../../spec';
4
- import type { BaseElementStyleProps, ID, NodeBadgeStyleProps, NodeLabelStyleProps, NodePortStyleProps, Point, Port, PortStyleProps, Prefix, Size } from '../../types';
4
+ import type { BaseElementStyleProps, ID, Node, NodeBadgeStyleProps, NodeLabelStyleProps, NodePortStyleProps, Point, Port, PortStyleProps, Prefix, Size } from '../../types';
5
5
  import { BaseElement } from '../base-element';
6
6
  import type { BadgeStyleProps, IconStyleProps, LabelStyleProps } from '../shapes';
7
7
  /**
@@ -15,13 +15,13 @@ export interface BaseNodeStyleProps extends BaseElementStyleProps, Prefix<'label
15
15
  *
16
16
  * <en/> The x-coordinate of node
17
17
  */
18
- x?: number | string;
18
+ x?: number;
19
19
  /**
20
20
  * <zh/> y 坐标
21
21
  *
22
22
  * <en/> The y-coordinate of node
23
23
  */
24
- y?: number | string;
24
+ y?: number;
25
25
  /**
26
26
  * <zh/> z 坐标
27
27
  *
@@ -153,7 +153,7 @@ export interface BaseNodeStyleProps extends BaseElementStyleProps, Prefix<'label
153
153
  *
154
154
  * <en/> Design document: https://www.yuque.com/antv/g6/gl1iof1xpzg6ed98
155
155
  */
156
- export declare abstract class BaseNode<S extends BaseNodeStyleProps = BaseNodeStyleProps> extends BaseElement<S> {
156
+ export declare abstract class BaseNode<S extends BaseNodeStyleProps = BaseNodeStyleProps> extends BaseElement<S> implements Node {
157
157
  type: string;
158
158
  static defaultStyleProps: Partial<BaseNodeStyleProps>;
159
159
  constructor(options: DisplayObjectConfig<S>);
@@ -188,6 +188,7 @@ export declare abstract class BaseNode<S extends BaseNodeStyleProps = BaseNodeSt
188
188
  protected drawPortShapes(attributes: Required<S>, container: Group): void;
189
189
  protected drawLabelShape(attributes: Required<S>, container: Group): void;
190
190
  protected abstract drawKeyShape(attributes: Required<S>, container: Group): DisplayObject | undefined;
191
+ private _drawKeyShape;
191
192
  render(attributes?: Required<S>, container?: Group): void;
192
193
  protected onframe(): void;
193
194
  }
@@ -17,5 +17,4 @@ export interface DiamondStyleProps extends PolygonStyleProps {
17
17
  export declare class Diamond extends Polygon {
18
18
  constructor(options: DisplayObjectConfig<DiamondStyleProps>);
19
19
  protected getPoints(attributes: Required<DiamondStyleProps>): Point[];
20
- getIntersectPoint(point: Point): Point;
21
20
  }
@@ -1,15 +1,26 @@
1
1
  import type { DisplayObjectConfig, Group } from '@antv/g';
2
2
  import { BaseShape } from './base-shape';
3
3
  import type { LabelStyleProps } from './label';
4
+ /**
5
+ * <zh/> 徽标样式
6
+ *
7
+ * <en/> Badge style
8
+ */
4
9
  export interface BadgeStyleProps extends LabelStyleProps {
5
10
  }
6
- type ParsedBadgeStyleProps = Required<BadgeStyleProps>;
7
- type BadgeOptions = DisplayObjectConfig<BadgeStyleProps>;
11
+ /**
12
+ * <zh/> 徽标
13
+ *
14
+ * <en/> Badge
15
+ * @remarks
16
+ * <zh/> 徽标是一种特殊的标签,通常用于展示数量或状态信息。
17
+ *
18
+ * <en/> Badge is a special label, usually used to display quantity or status information.
19
+ */
8
20
  export declare class Badge extends BaseShape<BadgeStyleProps> {
9
21
  static defaultStyleProps: Partial<BadgeStyleProps>;
10
- constructor(options: BadgeOptions);
11
- protected getBadgeStyle(attributes: ParsedBadgeStyleProps): Omit<Required<BadgeStyleProps>, "x" | "y" | "z" | "zIndex" | "class" | "transform" | "transformOrigin" | "context" | "className">;
12
- render(attributes?: ParsedBadgeStyleProps, container?: Group): void;
22
+ constructor(options: DisplayObjectConfig<BadgeStyleProps>);
23
+ protected getBadgeStyle(attributes: Required<BadgeStyleProps>): Omit<Required<BadgeStyleProps>, "x" | "y" | "z" | "zIndex" | "class" | "transform" | "transformOrigin" | "context" | "className">;
24
+ render(attributes?: Required<BadgeStyleProps>, container?: Group): void;
13
25
  getGeometryBounds(): import("@antv/g").AABB;
14
26
  }
15
- export {};
@@ -31,6 +31,13 @@ export declare abstract class BaseShape<StyleProps extends BaseShapeStyleProps>
31
31
  protected upsert<T extends DisplayObject>(className: string, Ctor: {
32
32
  new (...args: any[]): T;
33
33
  }, style: T['attributes'] | false, container: DisplayObject): T | undefined;
34
+ /**
35
+ * <zh/> 使用 transform 更新图形位置
36
+ *
37
+ * <en/> Update the position of the shape using transform
38
+ * @param attributes - <zh/> 样式属性 | <en/> style attributes
39
+ */
40
+ protected transformPosition(attributes: Partial<StyleProps>): void;
34
41
  update(attr?: Partial<StyleProps>): void;
35
42
  /**
36
43
  * <zh> 在初始化时会被自动调用
@@ -46,16 +53,15 @@ export declare abstract class BaseShape<StyleProps extends BaseShapeStyleProps>
46
53
  *
47
54
  * <en/> Extracts the graphic style properties from a given attribute object.
48
55
  * Removes specific properties like position, transformation, and class name.
49
- * @param attributes - <zh/> 属性对象 | <en/> attribute object
56
+ * @param style - <zh/> 属性对象 | <en/> attribute object
50
57
  * @returns <zh/> 仅包含样式属性的对象 | <en/> An object containing only the style properties.
51
58
  */
52
- getGraphicStyle<T extends Record<string, any>>(attributes: T): Omit<T, 'x' | 'y' | 'z' | 'transform' | 'transformOrigin' | 'className' | 'class' | 'context' | 'zIndex'>;
59
+ getGraphicStyle<T extends Record<string, any>>(style: T): Omit<T, 'x' | 'y' | 'z' | 'transform' | 'transformOrigin' | 'className' | 'class' | 'context' | 'zIndex'>;
53
60
  /**
54
61
  * Get the prefix pairs for composite shapes used to handle animation
55
62
  * @returns tuples array where each tuple contains a key corresponding to a method `get${key}Style` and its shape prefix
56
63
  */
57
64
  protected get compositeShapes(): [string, string][];
58
- protected hostingAnimation: boolean;
59
65
  animate(keyframes: Keyframe[], options?: number | KeyframeAnimationOptions): IAnimation | null;
60
66
  getShape<T extends DisplayObject>(name: string): T;
61
67
  private setVisibility;
@@ -1,13 +1,25 @@
1
1
  import { DisplayObjectConfig, Group, ImageStyleProps, TextStyleProps } from '@antv/g';
2
2
  import type { BaseShapeStyleProps } from './base-shape';
3
3
  import { BaseShape } from './base-shape';
4
+ /**
5
+ * <zh/> 图标样式
6
+ *
7
+ * <en/> Icon style
8
+ */
4
9
  export interface IconStyleProps extends BaseShapeStyleProps, Partial<TextStyleProps>, Omit<ImageStyleProps, 'z'> {
5
10
  }
6
- type IconOptions = DisplayObjectConfig<IconStyleProps>;
11
+ /**
12
+ * <zh/> 图标
13
+ *
14
+ * <en/> Icon
15
+ * @remarks
16
+ * <zh/> 图标是一种特殊的图形,可以是图片或者文字。传入 src 属性时,会渲染图片;传入 text 属性时,会渲染文字。
17
+ *
18
+ * <en/> Icon is a special shape, which can be an image or text. When the src attribute is passed in, an image will be rendered; when the text attribute is passed in, text will be rendered.
19
+ */
7
20
  export declare class Icon extends BaseShape<IconStyleProps> {
8
- constructor(options: IconOptions);
21
+ constructor(options: DisplayObjectConfig<IconStyleProps>);
9
22
  private isGImage;
10
23
  protected getIconStyle(attributes?: IconStyleProps): IconStyleProps;
11
24
  render(attributes?: IconStyleProps & import("@antv/g").BaseCustomElementStyleProps, container?: Group): void;
12
25
  }
13
- export {};
@@ -2,6 +2,11 @@ import { DisplayObjectConfig, Group, RectStyleProps, TextStyleProps } from '@ant
2
2
  import type { Padding } from '../../types/padding';
3
3
  import type { Prefix } from '../../types/prefix';
4
4
  import { BaseShape } from './base-shape';
5
+ /**
6
+ * <zh/> 标签样式
7
+ *
8
+ * <en/> Label style
9
+ */
5
10
  export interface LabelStyleProps extends TextStyleProps, Prefix<'background', RectStyleProps> {
6
11
  /**
7
12
  * <zh/> 是否显示背景
@@ -17,16 +22,22 @@ export interface LabelStyleProps extends TextStyleProps, Prefix<'background', Re
17
22
  */
18
23
  padding?: Padding;
19
24
  }
20
- type ParsedLabelStyleProps = Required<LabelStyleProps>;
21
- type LabelOptions = DisplayObjectConfig<LabelStyleProps>;
25
+ /**
26
+ * <zh/> 标签
27
+ *
28
+ * <en/> Label
29
+ * @remarks
30
+ * <zh/> 标签是一种具有背景的文本图形。
31
+ *
32
+ * <en/> Label is a text shape with background.
33
+ */
22
34
  export declare class Label extends BaseShape<LabelStyleProps> {
23
35
  static defaultStyleProps: Partial<LabelStyleProps>;
24
- constructor(options: LabelOptions);
36
+ constructor(options: DisplayObjectConfig<LabelStyleProps>);
25
37
  protected isTextStyle(key: string): boolean;
26
38
  protected isBackgroundStyle(key: string): boolean;
27
- protected getTextStyle(attributes: ParsedLabelStyleProps): TextStyleProps;
28
- protected getBackgroundStyle(attributes: ParsedLabelStyleProps): false | RectStyleProps;
29
- render(attributes?: ParsedLabelStyleProps, container?: Group): void;
39
+ protected getTextStyle(attributes: Required<LabelStyleProps>): TextStyleProps;
40
+ protected getBackgroundStyle(attributes: Required<LabelStyleProps>): false | RectStyleProps;
41
+ render(attributes?: Required<LabelStyleProps>, container?: Group): void;
30
42
  getGeometryBounds(): import("@antv/g").AABB;
31
43
  }
32
- export {};
@@ -3,7 +3,7 @@ export { CanvasEvent, ComboEvent, CommonEvent, ContainerEvent, EdgeEvent, Extens
3
3
  export { BaseCombo, CircleCombo, RectCombo } from './elements/combos';
4
4
  export { BaseEdge, Cubic, CubicHorizontal, CubicVertical, Line, Polyline, Quadratic } from './elements/edges';
5
5
  export { BaseNode, Circle, Diamond, Donut, Ellipse, HTML, Hexagon, Image, Rect, Star, Triangle, } from './elements/nodes';
6
- export { BaseShape } from './elements/shapes';
6
+ export { Badge, BaseShape, Icon, Label } from './elements/shapes';
7
7
  export { AntVDagreLayout, BaseLayout, CircularLayout, ComboCombinedLayout, ConcentricLayout, D3ForceLayout, DagreLayout, ForceAtlas2Layout, ForceLayout, FruchtermanLayout, GridLayout, MDSLayout, RadialLayout, RandomLayout, compactBox, dendrogram, indented, mindmap, } from './layouts';
8
8
  export { BasePlugin, BubbleSets, CameraSetting, Contextmenu, Fullscreen, GridLine, History, Hull, Legend, Timebar, Toolbar, Tooltip, Watermark, } from './plugins';
9
9
  export { getExtension, getExtensions, register } from './registry';
@@ -28,6 +28,7 @@ export type { ContourLabelStyleProps, ContourStyleProps } from './elements/shape
28
28
  export type { BaseLayoutOptions, WebWorkerLayoutOptions } from './layouts/types';
29
29
  export type { CategoricalPalette } from './palettes/types';
30
30
  export type { BasePluginOptions, BubbleSetsOptions, CameraSettingOptions, ContextmenuOptions, FullscreenOptions, GridLineOptions, HistoryOptions, HullOptions, LegendOptions, TimebarOptions, ToolbarOptions, TooltipOptions, WatermarkOptions, } from './plugins';
31
+ export type { DataURLOptions } from './runtime/canvas';
31
32
  export type { RuntimeContext } from './runtime/types';
32
33
  export type { BehaviorOptions, CanvasOptions, ComboData, ComboOptions, EdgeData, EdgeOptions, GraphData, GraphOptions, NodeData, NodeOptions, PluginOptions, ThemeOptions, ViewportOptions, } from './spec';
33
34
  export type { CustomBehaviorOption } from './spec/behavior';
@@ -35,6 +36,6 @@ export type { AnimationStage } from './spec/element/animation';
35
36
  export type { LayoutOptions, STDLayoutOptions, SingleLayoutOptions } from './spec/layout';
36
37
  export type { CustomPluginOption } from './spec/plugin';
37
38
  export type { BaseTransformOptions } from './transforms';
38
- export type { BaseElementStyleProps, CallableValue, CardinalPlacement, CollapsedMarkerStyleProps, Combo, CornerPlacement, DirectionalPlacement, Edge, EdgeArrowStyleProps, EdgeLabelStyleProps, Element, ElementDatum, ElementType, FitViewOptions, IAnimateEvent, ID, IDragEvent, IElementDragEvent, IElementEvent, IElementLifeCycleEvent, IEvent, IGraphLifeCycleEvent, IKeyboardEvent, IPointerEvent, IViewportEvent, IWheelEvent, LoopPlacement, LoopStyleProps, Node, NodeBadgeStyleProps, NodeLabelStyleProps, NodeLikeData, NodePortStyleProps, Padding, Placement, Point, PortStyleProps, Prefix, PrefixKey, RelativePlacement, Size, State, TransformOptions, TriangleDirection, Vector2, Vector3, ViewportAnimationEffectTiming, } from './types';
39
+ export type { BaseElementStyleProps, CardinalPlacement, CollapsedMarkerStyleProps, Combo, CornerPlacement, DirectionalPlacement, Edge, EdgeArrowStyleProps, EdgeDirection, EdgeLabelStyleProps, Element, ElementDatum, ElementHooks, ElementMethods, ElementType, FitViewOptions, HierarchyKey, IAnimateEvent, ID, IDragEvent, IElementDragEvent, IElementEvent, IElementLifeCycleEvent, IEvent, IGraphLifeCycleEvent, IKeyboardEvent, IPointerEvent, IViewportEvent, IWheelEvent, LoopPlacement, LoopStyleProps, Node, NodeBadgeStyleProps, NodeLabelStyleProps, NodeLikeData, NodePortStyleProps, Padding, Placement, Point, PortStyleProps, Prefix, PrefixKey, RelativePlacement, Size, State, TransformOptions, TriangleDirection, Vector2, Vector3, ViewportAnimationEffectTiming, } from './types';
39
40
  export type { Command, CommandData } from './types/history';
40
41
  export type { ShortcutKey } from './utils/shortcut';
@@ -1,3 +1,7 @@
1
1
  import './preset';
2
- export declare const version = "5.0.0";
3
2
  export * from './exports';
3
+ export declare const version = "5.0.2";
4
+ export declare const iconfont: {
5
+ css: string;
6
+ js: string;
7
+ };
@@ -1,9 +1,11 @@
1
+ import type { RuntimeContext } from '../runtime/types';
1
2
  import type { GraphData } from '../spec';
2
3
  import type { BaseLayoutOptions } from './types';
3
4
  export declare abstract class BaseLayout<O extends BaseLayoutOptions = any> {
4
5
  abstract id: string;
5
6
  options: O;
6
- constructor(options?: O);
7
+ protected context: RuntimeContext;
8
+ constructor(context: RuntimeContext, options?: O);
7
9
  stop?: () => void;
8
10
  tick?: (iterations?: number) => GraphData;
9
11
  abstract execute(model: GraphData, options?: O): Promise<GraphData>;
@@ -1,7 +1,7 @@
1
1
  import type { IBubbleSetOptions } from 'bubblesets-js';
2
2
  import type { ContourStyleProps } from '../elements/shapes';
3
3
  import type { RuntimeContext } from '../runtime/types';
4
- import type { CallableValue, ID } from '../types';
4
+ import type { ID } from '../types';
5
5
  import type { BasePluginOptions } from './base-plugin';
6
6
  import { BasePlugin } from './base-plugin';
7
7
  /**
@@ -71,7 +71,7 @@ export declare class BubbleSets extends BasePlugin<BubbleSetsOptions> {
71
71
  * <en/> Update member elements
72
72
  * @param members - <zh/> 值或者回调函数 | <en/> value or callback function
73
73
  */
74
- updateMember(members: CallableValue<ID[]>): void;
74
+ updateMember(members: ID[] | ((prev: ID[]) => ID[])): void;
75
75
  /**
76
76
  * <zh/> 获取成员元素
77
77
  *
@@ -1,6 +1,6 @@
1
1
  import type { ContourStyleProps } from '../../elements/shapes';
2
2
  import type { RuntimeContext } from '../../runtime/types';
3
- import type { CallableValue, ID } from '../../types';
3
+ import type { ID } from '../../types';
4
4
  import type { BasePluginOptions } from '../base-plugin';
5
5
  import { BasePlugin } from '../base-plugin';
6
6
  /**
@@ -97,7 +97,7 @@ export declare class Hull extends BasePlugin<HullOptions> {
97
97
  * <en/> Update Hull member
98
98
  * @param members - <zh/> 元素 Ids | <en/> Element Ids
99
99
  */
100
- updateMember(members: CallableValue<ID[]>): void;
100
+ updateMember(members: ID[] | ((prev: ID[]) => ID[])): void;
101
101
  /**
102
102
  * <zh/> 获取 Hull 成员
103
103
  *
@@ -1,4 +1,4 @@
1
- import type { Cursor, DisplayObject, CanvasConfig as GCanvasConfig, DataURLOptions as GDataURLOptions, IRenderer, PointLike } from '@antv/g';
1
+ import type { Cursor, DisplayObject, CanvasConfig as GCanvasConfig, IRenderer, PointLike } from '@antv/g';
2
2
  import { Canvas as GCanvas } from '@antv/g';
3
3
  import type { CanvasOptions } from '../spec/canvas';
4
4
  import type { CanvasLayer } from '../types/canvas';
@@ -6,7 +6,7 @@ export interface CanvasConfig extends Pick<GCanvasConfig, 'container' | 'deviceP
6
6
  renderer?: CanvasOptions['renderer'];
7
7
  background?: string;
8
8
  }
9
- export interface DataURLOptions extends GDataURLOptions {
9
+ export interface DataURLOptions {
10
10
  /**
11
11
  * <zh/> 导出模式
12
12
  * - viewport: 导出视口内容
@@ -17,6 +17,19 @@ export interface DataURLOptions extends GDataURLOptions {
17
17
  * - overall: export the entire canvas
18
18
  */
19
19
  mode?: 'viewport' | 'overall';
20
+ /**
21
+ * <zh/> 图片类型
22
+ *
23
+ * <en/> image type
24
+ * @defaultValue 'image/png'
25
+ */
26
+ type: 'image/png' | 'image/jpeg' | 'image/webp' | 'image/bmp';
27
+ /**
28
+ * <zh/> 图片质量, 仅对 image/jpeg 和 image/webp 有效,取值范围 0 ~ 1
29
+ *
30
+ * <en/> image quality, only valid for image/jpeg and image/webp, range 0 ~ 1
31
+ */
32
+ encoderOptions: number;
20
33
  }
21
34
  /**
22
35
  * @deprecated this canvas will be replace by layered canvas
@@ -1,7 +1,6 @@
1
1
  import { Graph as GraphLib } from '@antv/graphlib';
2
- import { COMBO_KEY, TREE_KEY } from '../constants';
3
2
  import type { ComboData, EdgeData, GraphData, NodeData } from '../spec';
4
- import type { DataChange, DataID, ElementDatum, ID, NodeLikeData, PartialEdgeData, PartialGraphData, PartialNodeLikeData, Position, State } from '../types';
3
+ import type { DataChange, DataID, ElementDatum, HierarchyKey, ID, NodeLikeData, PartialEdgeData, PartialGraphData, PartialNodeLikeData, Point, State } from '../types';
5
4
  import type { EdgeDirection } from '../types/edge';
6
5
  import type { ElementType } from '../types/element';
7
6
  export declare class DataController {
@@ -117,6 +116,7 @@ export declare class DataController {
117
116
  addNodeData(nodes?: NodeData[]): void;
118
117
  addEdgeData(edges?: EdgeData[]): void;
119
118
  addComboData(combos?: ComboData[]): void;
119
+ addChildrenData(parentId: ID, childrenData: NodeData[]): void;
120
120
  protected updateNodeLikeHierarchy(data: NodeLikeData[]): void;
121
121
  private enableUpdateNodeLikeHierarchy;
122
122
  /**
@@ -165,11 +165,11 @@ export declare class DataController {
165
165
  * @param datum - <zh/> combo 数据 | <en/> combo data
166
166
  */
167
167
  syncComboDatum(datum: PartialNodeLikeData<ComboData>): void;
168
- getElementPosition(id: ID): Position;
169
- translateNodeBy(id: ID, offset: Position): void;
170
- translateNodeTo(id: ID, position: Position): void;
171
- translateComboBy(id: ID, offset: Position): void;
172
- translateComboTo(id: ID, position: Position): void;
168
+ getElementPosition(id: ID): Point;
169
+ translateNodeBy(id: ID, offset: Point): void;
170
+ translateNodeTo(id: ID, position: Point): void;
171
+ translateComboBy(id: ID, offset: Point): void;
172
+ translateComboTo(id: ID, position: Point): void;
173
173
  removeData(data: DataID): void;
174
174
  removeNodeData(ids?: ID[]): void;
175
175
  removeEdgeData(ids?: ID[]): void;
@@ -189,14 +189,5 @@ export declare class DataController {
189
189
  * @returns <zh/> 元素类型 | <en/> type of the element
190
190
  */
191
191
  getElementType(id: ID): ElementType;
192
- /**
193
- * <zh/> 计算元素置顶后的 zIndex
194
- *
195
- * <en/> Calculate the zIndex after the element is placed on top
196
- * @param id - <zh/> 元素 ID | <en/> ID of the element
197
- * @returns <zh/> zIndex | <en/> zIndex
198
- */
199
- getFrontZIndex(id: ID): number;
200
192
  destroy(): void;
201
193
  }
202
- export type HierarchyKey = typeof TREE_KEY | typeof COMBO_KEY;
@@ -1,6 +1,6 @@
1
1
  import type { BaseStyleProps } from '@antv/g';
2
2
  import type { AnimationStage } from '../spec/element/animation';
3
- import type { Combo, Element, ElementDatum, ElementType, ID, Node, State } from '../types';
3
+ import type { Combo, Edge, Element, ElementDatum, ElementType, ID, Node, State } from '../types';
4
4
  import type { RuntimeContext } from './types';
5
5
  export declare class ElementController {
6
6
  private context;
@@ -51,8 +51,9 @@ export declare class ElementController {
51
51
  getStateStyle(id: ID): Record<string, unknown>;
52
52
  private computeStyle;
53
53
  getElement<T extends Element>(id: ID): T | undefined;
54
+ getElementZIndex(id: ID): any;
54
55
  getNodes(): Node[];
55
- getEdges(): import("..").BaseEdge[];
56
+ getEdges(): Edge[];
56
57
  getCombos(): Combo[];
57
58
  getElementComputedStyle(elementType: ElementType, datum: ElementDatum): any;
58
59
  /**
@@ -67,6 +68,13 @@ export declare class ElementController {
67
68
  private createElements;
68
69
  private updateElement;
69
70
  private updateElements;
71
+ /**
72
+ * <zh/> 标记销毁元素
73
+ *
74
+ * <en/> mark destroy element
75
+ * @param data - <zh/> 绘制数据 | <en/> draw data
76
+ */
77
+ private markDestroyElement;
70
78
  private destroyElement;
71
79
  private destroyElements;
72
80
  private clearElement;
@@ -88,6 +96,14 @@ export declare class ElementController {
88
96
  expandNode(id: ID, animation: boolean): Promise<void>;
89
97
  collapseCombo(id: ID, animation: boolean): Promise<void>;
90
98
  expandCombo(id: ID, animation: boolean): Promise<void>;
99
+ /**
100
+ * <zh/> 计算元素置顶后的 zIndex
101
+ *
102
+ * <en/> Calculate the zIndex after the element is placed on top
103
+ * @param id - <zh/> 元素 ID | <en/> ID of the element
104
+ * @returns <zh/> zIndex | <en/> zIndex
105
+ */
106
+ getFrontZIndex(id: ID): number;
91
107
  destroy(): void;
92
108
  }
93
109
  export interface DrawContext {