@antv/g6 5.0.9 → 5.0.11

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 (247) hide show
  1. package/dist/g6.min.js +2 -2
  2. package/dist/lib/behaviors/drag-canvas.d.ts +1 -0
  3. package/dist/lib/behaviors/fix-element-size.d.ts +88 -0
  4. package/dist/lib/behaviors/index.d.ts +4 -0
  5. package/dist/lib/behaviors/optimize-viewport-transform.d.ts +54 -0
  6. package/dist/lib/constants/events/graph.d.ts +13 -1
  7. package/dist/lib/exports.d.ts +7 -5
  8. package/dist/lib/plugins/history/index.d.ts +3 -4
  9. package/dist/lib/plugins/index.d.ts +2 -0
  10. package/dist/lib/plugins/minimap/index.d.ts +131 -0
  11. package/dist/lib/registry/build-in.d.ts +4 -4
  12. package/dist/lib/registry/get.d.ts +22 -0
  13. package/dist/lib/registry/{index.d.ts → register.d.ts} +1 -26
  14. package/dist/lib/registry/store.d.ts +7 -0
  15. package/dist/lib/runtime/canvas.d.ts +28 -7
  16. package/dist/lib/runtime/element.d.ts +3 -1
  17. package/dist/lib/runtime/graph.d.ts +5 -5
  18. package/dist/lib/utils/animation.d.ts +1 -1
  19. package/dist/lib/utils/bbox.d.ts +10 -0
  20. package/dist/lib/utils/event/events.d.ts +4 -4
  21. package/dist/lib/utils/visibility.d.ts +2 -1
  22. package/dist/lib/version.d.ts +1 -1
  23. package/esm/behaviors/create-edge.js +6 -4
  24. package/esm/behaviors/create-edge.js.map +1 -1
  25. package/esm/behaviors/drag-canvas.d.ts +1 -0
  26. package/esm/behaviors/drag-canvas.js +20 -14
  27. package/esm/behaviors/drag-canvas.js.map +1 -1
  28. package/esm/behaviors/fix-element-size.d.ts +88 -0
  29. package/esm/behaviors/fix-element-size.js +107 -0
  30. package/esm/behaviors/fix-element-size.js.map +1 -0
  31. package/esm/behaviors/hover-activate.js +5 -1
  32. package/esm/behaviors/hover-activate.js.map +1 -1
  33. package/esm/behaviors/index.d.ts +4 -0
  34. package/esm/behaviors/index.js +2 -0
  35. package/esm/behaviors/index.js.map +1 -1
  36. package/esm/behaviors/optimize-viewport-transform.d.ts +54 -0
  37. package/esm/behaviors/optimize-viewport-transform.js +71 -0
  38. package/esm/behaviors/optimize-viewport-transform.js.map +1 -0
  39. package/esm/behaviors/zoom-canvas.js +8 -11
  40. package/esm/behaviors/zoom-canvas.js.map +1 -1
  41. package/esm/constants/events/graph.d.ts +13 -1
  42. package/esm/constants/events/graph.js +12 -0
  43. package/esm/constants/events/graph.js.map +1 -1
  44. package/esm/elements/nodes/base-node.js +23 -2
  45. package/esm/elements/nodes/base-node.js.map +1 -1
  46. package/esm/elements/nodes/html.js +1 -1
  47. package/esm/elements/nodes/html.js.map +1 -1
  48. package/esm/elements/shapes/base-shape.js +0 -1
  49. package/esm/elements/shapes/base-shape.js.map +1 -1
  50. package/esm/elements/shapes/label.js +1 -1
  51. package/esm/elements/shapes/label.js.map +1 -1
  52. package/esm/exports.d.ts +7 -5
  53. package/esm/exports.js +4 -3
  54. package/esm/exports.js.map +1 -1
  55. package/esm/plugins/history/index.d.ts +3 -4
  56. package/esm/plugins/history/index.js +6 -7
  57. package/esm/plugins/history/index.js.map +1 -1
  58. package/esm/plugins/index.d.ts +2 -0
  59. package/esm/plugins/index.js +1 -0
  60. package/esm/plugins/index.js.map +1 -1
  61. package/esm/plugins/minimap/index.d.ts +131 -0
  62. package/esm/plugins/minimap/index.js +349 -0
  63. package/esm/plugins/minimap/index.js.map +1 -0
  64. package/esm/preset.js +1 -1
  65. package/esm/preset.js.map +1 -1
  66. package/esm/registry/build-in.d.ts +4 -4
  67. package/esm/registry/build-in.js +27 -11
  68. package/esm/registry/build-in.js.map +1 -1
  69. package/esm/registry/extension/index.js +1 -1
  70. package/esm/registry/extension/index.js.map +1 -1
  71. package/esm/registry/get.d.ts +22 -0
  72. package/esm/registry/get.js +29 -0
  73. package/esm/registry/get.js.map +1 -0
  74. package/esm/registry/{index.d.ts → register.d.ts} +1 -26
  75. package/esm/registry/{index.js → register.js} +2 -58
  76. package/esm/registry/register.js.map +1 -0
  77. package/esm/registry/store.d.ts +7 -0
  78. package/esm/registry/store.js +18 -0
  79. package/esm/registry/store.js.map +1 -0
  80. package/esm/runtime/canvas.d.ts +28 -7
  81. package/esm/runtime/canvas.js +68 -30
  82. package/esm/runtime/canvas.js.map +1 -1
  83. package/esm/runtime/element.d.ts +3 -1
  84. package/esm/runtime/element.js +9 -3
  85. package/esm/runtime/element.js.map +1 -1
  86. package/esm/runtime/graph.d.ts +5 -5
  87. package/esm/runtime/graph.js +18 -16
  88. package/esm/runtime/graph.js.map +1 -1
  89. package/esm/runtime/layout.js +1 -1
  90. package/esm/runtime/layout.js.map +1 -1
  91. package/esm/runtime/viewport.js +2 -1
  92. package/esm/runtime/viewport.js.map +1 -1
  93. package/esm/themes/base.js +2 -0
  94. package/esm/themes/base.js.map +1 -1
  95. package/esm/utils/animation.d.ts +1 -1
  96. package/esm/utils/animation.js +1 -1
  97. package/esm/utils/animation.js.map +1 -1
  98. package/esm/utils/bbox.d.ts +10 -0
  99. package/esm/utils/bbox.js +15 -0
  100. package/esm/utils/bbox.js.map +1 -1
  101. package/esm/utils/event/events.d.ts +4 -4
  102. package/esm/utils/palette.js +1 -1
  103. package/esm/utils/palette.js.map +1 -1
  104. package/esm/utils/print.js +2 -0
  105. package/esm/utils/print.js.map +1 -1
  106. package/esm/utils/router/orth.js +4 -4
  107. package/esm/utils/router/orth.js.map +1 -1
  108. package/esm/utils/theme.js +1 -1
  109. package/esm/utils/theme.js.map +1 -1
  110. package/esm/utils/visibility.d.ts +2 -1
  111. package/esm/utils/visibility.js +5 -2
  112. package/esm/utils/visibility.js.map +1 -1
  113. package/esm/version.d.ts +1 -1
  114. package/esm/version.js +1 -1
  115. package/esm/version.js.map +1 -1
  116. package/lib/behaviors/create-edge.js +6 -4
  117. package/lib/behaviors/create-edge.js.map +1 -1
  118. package/lib/behaviors/drag-canvas.d.ts +1 -0
  119. package/lib/behaviors/drag-canvas.js +18 -12
  120. package/lib/behaviors/drag-canvas.js.map +1 -1
  121. package/lib/behaviors/fix-element-size.d.ts +88 -0
  122. package/lib/behaviors/fix-element-size.js +111 -0
  123. package/lib/behaviors/fix-element-size.js.map +1 -0
  124. package/lib/behaviors/hover-activate.js +5 -1
  125. package/lib/behaviors/hover-activate.js.map +1 -1
  126. package/lib/behaviors/index.d.ts +4 -0
  127. package/lib/behaviors/index.js +5 -1
  128. package/lib/behaviors/index.js.map +1 -1
  129. package/lib/behaviors/optimize-viewport-transform.d.ts +54 -0
  130. package/lib/behaviors/optimize-viewport-transform.js +75 -0
  131. package/lib/behaviors/optimize-viewport-transform.js.map +1 -0
  132. package/lib/behaviors/zoom-canvas.js +7 -10
  133. package/lib/behaviors/zoom-canvas.js.map +1 -1
  134. package/lib/constants/events/graph.d.ts +13 -1
  135. package/lib/constants/events/graph.js +12 -0
  136. package/lib/constants/events/graph.js.map +1 -1
  137. package/lib/elements/nodes/base-node.js +23 -2
  138. package/lib/elements/nodes/base-node.js.map +1 -1
  139. package/lib/elements/nodes/html.js +1 -1
  140. package/lib/elements/nodes/html.js.map +1 -1
  141. package/lib/elements/shapes/base-shape.js +0 -1
  142. package/lib/elements/shapes/base-shape.js.map +1 -1
  143. package/lib/elements/shapes/label.js +1 -1
  144. package/lib/elements/shapes/label.js.map +1 -1
  145. package/lib/exports.d.ts +7 -5
  146. package/lib/exports.js +10 -6
  147. package/lib/exports.js.map +1 -1
  148. package/lib/plugins/history/index.d.ts +3 -4
  149. package/lib/plugins/history/index.js +6 -7
  150. package/lib/plugins/history/index.js.map +1 -1
  151. package/lib/plugins/index.d.ts +2 -0
  152. package/lib/plugins/index.js +3 -1
  153. package/lib/plugins/index.js.map +1 -1
  154. package/lib/plugins/minimap/index.d.ts +131 -0
  155. package/lib/plugins/minimap/index.js +353 -0
  156. package/lib/plugins/minimap/index.js.map +1 -0
  157. package/lib/preset.js +2 -2
  158. package/lib/preset.js.map +1 -1
  159. package/lib/registry/build-in.d.ts +4 -4
  160. package/lib/registry/build-in.js +26 -10
  161. package/lib/registry/build-in.js.map +1 -1
  162. package/lib/registry/extension/index.js +2 -2
  163. package/lib/registry/extension/index.js.map +1 -1
  164. package/lib/registry/get.d.ts +22 -0
  165. package/lib/registry/get.js +33 -0
  166. package/lib/registry/get.js.map +1 -0
  167. package/lib/registry/{index.d.ts → register.d.ts} +1 -26
  168. package/lib/registry/{index.js → register.js} +4 -63
  169. package/lib/registry/register.js.map +1 -0
  170. package/lib/registry/store.d.ts +7 -0
  171. package/lib/registry/store.js +21 -0
  172. package/lib/registry/store.js.map +1 -0
  173. package/lib/runtime/canvas.d.ts +28 -7
  174. package/lib/runtime/canvas.js +68 -30
  175. package/lib/runtime/canvas.js.map +1 -1
  176. package/lib/runtime/element.d.ts +3 -1
  177. package/lib/runtime/element.js +10 -4
  178. package/lib/runtime/element.js.map +1 -1
  179. package/lib/runtime/graph.d.ts +5 -5
  180. package/lib/runtime/graph.js +18 -16
  181. package/lib/runtime/graph.js.map +1 -1
  182. package/lib/runtime/layout.js +3 -3
  183. package/lib/runtime/layout.js.map +1 -1
  184. package/lib/runtime/viewport.js +2 -1
  185. package/lib/runtime/viewport.js.map +1 -1
  186. package/lib/themes/base.js +2 -0
  187. package/lib/themes/base.js.map +1 -1
  188. package/lib/utils/animation.d.ts +1 -1
  189. package/lib/utils/animation.js +2 -2
  190. package/lib/utils/animation.js.map +1 -1
  191. package/lib/utils/bbox.d.ts +10 -0
  192. package/lib/utils/bbox.js +16 -0
  193. package/lib/utils/bbox.js.map +1 -1
  194. package/lib/utils/event/events.d.ts +4 -4
  195. package/lib/utils/palette.js +3 -3
  196. package/lib/utils/palette.js.map +1 -1
  197. package/lib/utils/print.js +2 -0
  198. package/lib/utils/print.js.map +1 -1
  199. package/lib/utils/router/orth.js +3 -3
  200. package/lib/utils/router/orth.js.map +1 -1
  201. package/lib/utils/theme.js +2 -2
  202. package/lib/utils/theme.js.map +1 -1
  203. package/lib/utils/visibility.d.ts +2 -1
  204. package/lib/utils/visibility.js +5 -2
  205. package/lib/utils/visibility.js.map +1 -1
  206. package/lib/version.d.ts +1 -1
  207. package/lib/version.js +1 -1
  208. package/lib/version.js.map +1 -1
  209. package/package.json +2 -1
  210. package/src/behaviors/create-edge.ts +6 -4
  211. package/src/behaviors/drag-canvas.ts +20 -14
  212. package/src/behaviors/fix-element-size.ts +190 -0
  213. package/src/behaviors/hover-activate.ts +8 -1
  214. package/src/behaviors/index.ts +4 -0
  215. package/src/behaviors/optimize-viewport-transform.ts +127 -0
  216. package/src/behaviors/zoom-canvas.ts +8 -10
  217. package/src/constants/events/graph.ts +12 -0
  218. package/src/elements/nodes/base-node.ts +27 -2
  219. package/src/elements/nodes/html.ts +1 -1
  220. package/src/elements/shapes/base-shape.ts +0 -1
  221. package/src/elements/shapes/label.ts +1 -1
  222. package/src/exports.ts +9 -1
  223. package/src/plugins/history/index.ts +9 -10
  224. package/src/plugins/index.ts +2 -0
  225. package/src/plugins/minimap/index.ts +512 -0
  226. package/src/preset.ts +1 -1
  227. package/src/registry/build-in.ts +31 -9
  228. package/src/registry/extension/index.ts +1 -1
  229. package/src/registry/get.ts +37 -0
  230. package/src/registry/{index.ts → register.ts} +2 -66
  231. package/src/registry/store.ts +19 -0
  232. package/src/runtime/canvas.ts +87 -29
  233. package/src/runtime/element.ts +20 -4
  234. package/src/runtime/graph.ts +19 -15
  235. package/src/runtime/layout.ts +1 -1
  236. package/src/runtime/viewport.ts +3 -2
  237. package/src/themes/base.ts +2 -0
  238. package/src/utils/animation.ts +1 -1
  239. package/src/utils/bbox.ts +21 -0
  240. package/src/utils/palette.ts +1 -1
  241. package/src/utils/print.ts +2 -0
  242. package/src/utils/router/orth.ts +5 -3
  243. package/src/utils/theme.ts +1 -1
  244. package/src/utils/visibility.ts +9 -2
  245. package/src/version.ts +1 -1
  246. package/esm/registry/index.js.map +0 -1
  247. package/lib/registry/index.js.map +0 -1
@@ -56,6 +56,7 @@ export declare class DragCanvas extends BaseBehavior<DragCanvasOptions> {
56
56
  static defaultOptions: Partial<DragCanvasOptions>;
57
57
  private shortcut;
58
58
  private defaultCursor;
59
+ private get canvas();
59
60
  constructor(context: RuntimeContext, options: DragCanvasOptions);
60
61
  /**
61
62
  * <zh/> 更新配置
@@ -0,0 +1,88 @@
1
+ import type { DisplayObject } from '@antv/g';
2
+ import type { RuntimeContext } from '../runtime/types';
3
+ import type { IViewportEvent, State } from '../types';
4
+ import type { BaseBehaviorOptions } from './base-behavior';
5
+ import { BaseBehavior } from './base-behavior';
6
+ export type FixShapeConfig = {
7
+ /**
8
+ * <zh/> 指定要固定大小的元素属性对应的图形。如果不指定,则固定整个元素
9
+ *
10
+ * <en/> Specify the shape corresponding to properties to be fixed in size. If not specified, fix the entire element
11
+ */
12
+ shape: (shapes: DisplayObject[]) => DisplayObject;
13
+ /**
14
+ * <zh/> 指定要固定大小的属性
15
+ *
16
+ * <en/> Specify properties to be fixed
17
+ */
18
+ fields: string[];
19
+ };
20
+ /**
21
+ * <zh/> 固定元素大小交互配置项
22
+ *
23
+ * <en/> Fix element size behavior options
24
+ */
25
+ export interface FixElementSizeOptions extends BaseBehaviorOptions {
26
+ /**
27
+ * <zh/> 是否启用固定元素大小交互。默认在缩小画布时启用
28
+ *
29
+ * <en/> Whether to enable the fix element size behavior. Enabled by default when zooming out
30
+ * @defaultValue `(event) => Boolean(event.data.scale < 1)`
31
+ */
32
+ enable?: boolean | ((event: IViewportEvent) => boolean);
33
+ /**
34
+ * <zh/> 指定要固定大小的元素状态
35
+ *
36
+ * <en/> Specify the state of elements to be fixed in size
37
+ */
38
+ state?: State;
39
+ /**
40
+ * <zh/> 节点配置项,用于定义哪些属性在视觉上保持固定大小。若未指定(即为 undefined),则整个节点将被固定
41
+ *
42
+ * <en/> Node configuration for defining which node attributes should remain fixed in size visually. If not specified (i.e., undefined), the entire node will be fixed in size.
43
+ * @example
44
+ * <zh/> 例如,在缩放过程中固定节点的 lineWidth 属性,可以配置如下:
45
+ *
46
+ * <en/> For example, to fix `lineWidth` attribute of a node during zooming, you can configure it as follows:
47
+ * ```ts
48
+ * {
49
+ * node: [
50
+ * {
51
+ * shape: (shapes: DisplayObject[]) => shapes.find((shape) => shape.className === 'key'),
52
+ * fields: ['lineWidth'],
53
+ * },
54
+ * ],
55
+ * }
56
+ * ```
57
+ */
58
+ node?: FixShapeConfig | FixShapeConfig[];
59
+ /**
60
+ * <zh/> 边配置项,用于定义哪些属性在视觉上保持固定大小。默认固定 lineWidth、labelFontSize 属性
61
+ *
62
+ * <en/> Edge configuration for defining which edge attributes should remain fixed in size visually. By default, the lineWidth and labelFontSize attributes are fixed
63
+ */
64
+ edge?: FixShapeConfig | FixShapeConfig[];
65
+ /**
66
+ * <zh/> Combo 配置项,用于定义哪些属性在视觉上保持固定大小。默认整个 Combo 将被固定
67
+ *
68
+ * <en/> Combo configuration for defining which combo attributes should remain fixed in size visually. By default, the entire combo will be fixed
69
+ */
70
+ combo?: FixShapeConfig | FixShapeConfig[];
71
+ }
72
+ /**
73
+ * <zh/> 缩放画布过程中固定元素大小
74
+ *
75
+ * <en/> Fix element size while zooming
76
+ */
77
+ export declare class FixElementSize extends BaseBehavior {
78
+ static defaultOptions: Partial<FixElementSizeOptions>;
79
+ private elementCache;
80
+ constructor(context: RuntimeContext, options: FixElementSizeOptions);
81
+ private isZoomEvent;
82
+ private fixElementSize;
83
+ private resetTransform;
84
+ private bindEvents;
85
+ private unbindEvents;
86
+ private validate;
87
+ destroy(): void;
88
+ }
@@ -6,9 +6,11 @@ export { CreateEdge } from './create-edge';
6
6
  export { DragCanvas } from './drag-canvas';
7
7
  export { DragElement } from './drag-element';
8
8
  export { DragElementForce } from './drag-element-force';
9
+ export { FixElementSize } from './fix-element-size';
9
10
  export { FocusElement } from './focus-element';
10
11
  export { HoverActivate } from './hover-activate';
11
12
  export { LassoSelect } from './lasso-select';
13
+ export { OptimizeViewportTransform } from './optimize-viewport-transform';
12
14
  export { ScrollCanvas } from './scroll-canvas';
13
15
  export { ZoomCanvas } from './zoom-canvas';
14
16
  export type { BaseBehaviorOptions } from './base-behavior';
@@ -19,8 +21,10 @@ export type { CreateEdgeOptions } from './create-edge';
19
21
  export type { DragCanvasOptions } from './drag-canvas';
20
22
  export type { DragElementOptions } from './drag-element';
21
23
  export type { DragElementForceOptions } from './drag-element-force';
24
+ export type { FixElementSizeOptions } from './fix-element-size';
22
25
  export type { FocusElementOptions } from './focus-element';
23
26
  export type { HoverActivateOptions } from './hover-activate';
24
27
  export type { LassoSelectOptions } from './lasso-select';
28
+ export type { OptimizeViewportTransformOptions } from './optimize-viewport-transform';
25
29
  export type { ScrollCanvasOptions } from './scroll-canvas';
26
30
  export type { ZoomCanvasOptions } from './zoom-canvas';
@@ -0,0 +1,54 @@
1
+ import type { RuntimeContext } from '../runtime/types';
2
+ import type { IViewportEvent } from '../types/event';
3
+ import type { BaseBehaviorOptions } from './base-behavior';
4
+ import { BaseBehavior } from './base-behavior';
5
+ /**
6
+ * <zh/> 画布优化交互配置项
7
+ *
8
+ * <en/> Canvas optimization behavior options
9
+ */
10
+ export interface OptimizeViewportTransformOptions extends BaseBehaviorOptions {
11
+ /**
12
+ * <zh/> 是否启用画布优化功能
13
+ *
14
+ * <en/> Whether to enable canvas optimization function
15
+ * @defaultValue true
16
+ */
17
+ enable?: boolean | ((event: IViewportEvent) => boolean);
18
+ /**
19
+ * <zh/> 始终保留的图形类名。操作画布过程中会隐藏元素reservedShapes(除了指定类名的图形),以提高性能
20
+ *
21
+ * <en/> Persistently reserved shape classnames. Elements are hidden during canvas manipulation (except for shapes with specified classnames) to enhance performance.
22
+ * @defaultValue `{ node: ['key'] }`
23
+ */
24
+ shapes?: {
25
+ node?: string[];
26
+ edge?: string[];
27
+ combo?: string[];
28
+ };
29
+ /**
30
+ * <zh/> 设置防抖时间
31
+ *
32
+ * <en/> Set debounce time
33
+ * @defaultValue 200
34
+ */
35
+ debounce?: number;
36
+ }
37
+ /**
38
+ * <zh/> 操作画布过程中隐藏元素
39
+ *
40
+ * <en/> Hide elements during canvas operations (dragging, zooming, scrolling)
41
+ */
42
+ export declare class OptimizeViewportTransform extends BaseBehavior<OptimizeViewportTransformOptions> {
43
+ static defaultOptions: Partial<OptimizeViewportTransformOptions>;
44
+ private isVisible;
45
+ constructor(context: RuntimeContext, options: OptimizeViewportTransformOptions);
46
+ private filterShapes;
47
+ private setElementsVisibility;
48
+ private hideShapes;
49
+ private showShapes;
50
+ private bindEvents;
51
+ private unbindEvents;
52
+ private validate;
53
+ destroy(): void;
54
+ }
@@ -166,5 +166,17 @@ export declare enum GraphEvent {
166
166
  *
167
167
  * <en/> After destruction
168
168
  */
169
- AFTER_DESTROY = "afterdestroy"
169
+ AFTER_DESTROY = "afterdestroy",
170
+ /**
171
+ * <zh/> 渲染器变更之前
172
+ *
173
+ * <en/> Before the renderer changes
174
+ */
175
+ BEFORE_RENDERER_CHANGE = "beforerendererchange",
176
+ /**
177
+ * <zh/> 渲染器变更之后
178
+ *
179
+ * <en/> After the renderer changes
180
+ */
181
+ AFTER_RENDERER_CHANGE = "afterrendererchange"
170
182
  }
@@ -1,12 +1,13 @@
1
- export { BaseBehavior, BrushSelect, ClickSelect, CollapseExpand, CreateEdge, DragCanvas, DragElement, DragElementForce, FocusElement, HoverActivate, LassoSelect, ScrollCanvas, ZoomCanvas, } from './behaviors';
1
+ export { BaseBehavior, BrushSelect, ClickSelect, CollapseExpand, CreateEdge, DragCanvas, DragElement, DragElementForce, FixElementSize, FocusElement, HoverActivate, LassoSelect, OptimizeViewportTransform, ScrollCanvas, ZoomCanvas, } from './behaviors';
2
2
  export { CanvasEvent, ComboEvent, CommonEvent, ContainerEvent, EdgeEvent, ExtensionCategory, GraphEvent, HistoryEvent, NodeEvent, } from './constants';
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
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
- export { BasePlugin, BubbleSets, CameraSetting, Contextmenu, Fullscreen, GridLine, History, Hull, Legend, Timebar, Toolbar, Tooltip, Watermark, } from './plugins';
9
- export { getExtension, getExtensions, register } from './registry';
8
+ export { BasePlugin, BubbleSets, CameraSetting, Contextmenu, Fullscreen, GridLine, History, Hull, Legend, Minimap, Timebar, Toolbar, Tooltip, Watermark, } from './plugins';
9
+ export { getExtension, getExtensions } from './registry/get';
10
+ export { register } from './registry/register';
10
11
  export { Graph } from './runtime/graph';
11
12
  export { BaseTransform } from './transforms';
12
13
  export { isCollapsed } from './utils/collapsibility';
@@ -20,7 +21,8 @@ export type { BaseStyleProps } from '@antv/g';
20
21
  export type { AntVDagreLayoutOptions, CircularLayoutOptions, ComboCombinedLayoutOptions, ConcentricLayoutOptions, D3Force3DLayoutOptions, D3ForceLayoutOptions, DagreLayoutOptions, ForceAtlas2LayoutOptions, ForceLayoutOptions, FruchtermanLayoutOptions, GridLayoutOptions, MDSLayoutOptions, RadialLayoutOptions, RandomLayoutOptions, } from '@antv/layout';
21
22
  export type { PathArray } from '@antv/util';
22
23
  export type { AnimationContext, AnimationEffectTiming, AnimationExecutor, AnimationOptions } from './animations/types';
23
- export type { BaseBehaviorOptions, BrushSelectOptions, ClickSelectOptions, CollapseExpandOptions, CreateEdgeOptions, DragCanvasOptions, DragElementForceOptions, DragElementOptions, FocusElementOptions, HoverActivateOptions, LassoSelectOptions, ScrollCanvasOptions, ZoomCanvasOptions, } from './behaviors';
24
+ export type { BaseBehaviorOptions, BrushSelectOptions, ClickSelectOptions, CollapseExpandOptions, CreateEdgeOptions, DragCanvasOptions, DragElementForceOptions, DragElementOptions, FixElementSizeOptions, FocusElementOptions, HoverActivateOptions, LassoSelectOptions, OptimizeViewportTransformOptions, ScrollCanvasOptions, ZoomCanvasOptions, } from './behaviors';
25
+ export type { FixShapeConfig } from './behaviors/fix-element-size';
24
26
  export type { BaseComboStyleProps, CircleComboStyleProps, RectComboStyleProps } from './elements/combos';
25
27
  export type { BaseEdgeStyleProps, CubicHorizontalStyleProps, CubicStyleProps, CubicVerticalStyleProps, LineStyleProps, PolylineStyleProps, QuadraticStyleProps, } from './elements/edges';
26
28
  export type { BaseNodeStyleProps, CircleStyleProps, DiamondStyleProps, DonutStyleProps, EllipseStyleProps, HTMLStyleProps, HexagonStyleProps, ImageStyleProps, RectStyleProps, StarStyleProps, TriangleStyleProps, } from './elements/nodes';
@@ -28,7 +30,7 @@ export type { BadgeStyleProps, BaseShapeStyleProps, IconStyleProps, LabelStylePr
28
30
  export type { ContourLabelStyleProps, ContourStyleProps } from './elements/shapes/contour';
29
31
  export type { BaseLayoutOptions, WebWorkerLayoutOptions } from './layouts/types';
30
32
  export type { CategoricalPalette } from './palettes/types';
31
- export type { BasePluginOptions, BubbleSetsOptions, CameraSettingOptions, ContextmenuOptions, FullscreenOptions, GridLineOptions, HistoryOptions, HullOptions, LegendOptions, TimebarOptions, ToolbarOptions, TooltipOptions, WatermarkOptions, } from './plugins';
33
+ export type { BasePluginOptions, BubbleSetsOptions, CameraSettingOptions, ContextmenuOptions, FullscreenOptions, GridLineOptions, HistoryOptions, HullOptions, LegendOptions, MinimapOptions, TimebarOptions, ToolbarOptions, TooltipOptions, WatermarkOptions, } from './plugins';
32
34
  export type { DataURLOptions } from './runtime/canvas';
33
35
  export type { RuntimeContext } from './runtime/types';
34
36
  export type { BehaviorOptions, CanvasOptions, ComboData, ComboOptions, EdgeData, EdgeOptions, GraphData, GraphOptions, NodeData, NodeOptions, PluginOptions, ThemeOptions, ViewportOptions, } from './spec';
@@ -22,13 +22,13 @@ export interface HistoryOptions extends BasePluginOptions {
22
22
  *
23
23
  * <en/> Called before a command is added to the Undo/Redo queue. If this method returns false, the command will not be added to the queue. revert is true for undo operations and false for redo operations
24
24
  */
25
- beforeAddCommand?: (cmd: Command, revert?: boolean) => boolean | void;
25
+ beforeAddCommand?: (cmd: Command, revert: boolean) => boolean | void;
26
26
  /**
27
27
  * <zh/> 当一个命令被添加到 Undo/Redo 队列后被调用。revert 为 true 时表示撤销操作,为 false 时表示重做操作
28
28
  *
29
29
  * <en/> Called after a command is added to the Undo/Redo queue. revert is true for undo operations and false for redo operations
30
30
  */
31
- afterAddCommand?: (cmd: Command, revert?: boolean) => void;
31
+ afterAddCommand?: (cmd: Command, revert: boolean) => void;
32
32
  /**
33
33
  * <zh/> 执行命令时的回调函数
34
34
  *
@@ -52,7 +52,6 @@ export declare class History extends BasePlugin<HistoryOptions> {
52
52
  private batchAnimation;
53
53
  undoStack: Command[];
54
54
  redoStack: Command[];
55
- private isFirstDraw;
56
55
  private freezed;
57
56
  constructor(context: RuntimeContext, options: HistoryOptions);
58
57
  /**
@@ -75,7 +74,7 @@ export declare class History extends BasePlugin<HistoryOptions> {
75
74
  * <en/> Execute undo
76
75
  * @returns <zh/> 返回当前实例 | <en/> Return the current instance
77
76
  */
78
- undo(): this;
77
+ undo(): this | undefined;
79
78
  /**
80
79
  * <zh/> 执行重做
81
80
  *
@@ -8,6 +8,7 @@ export { GridLine } from './grid-line';
8
8
  export { History } from './history';
9
9
  export { Hull } from './hull';
10
10
  export { Legend } from './legend';
11
+ export { Minimap } from './minimap';
11
12
  export { Timebar } from './timebar';
12
13
  export { Toolbar } from './toolbar';
13
14
  export { Tooltip } from './tooltip';
@@ -22,6 +23,7 @@ export type { GridLineOptions } from './grid-line';
22
23
  export type { HistoryOptions } from './history';
23
24
  export type { HullOptions } from './hull';
24
25
  export type { LegendOptions } from './legend';
26
+ export type { MinimapOptions } from './minimap';
25
27
  export type { TimebarOptions } from './timebar';
26
28
  export type { ToolbarOptions } from './toolbar';
27
29
  export type { TooltipOptions } from './tooltip';
@@ -0,0 +1,131 @@
1
+ import { DisplayObject, IRenderer } from '@antv/g';
2
+ import type { RuntimeContext } from '../../runtime/types';
3
+ import type { ElementType, Padding, Placement } from '../../types';
4
+ import type { BasePluginOptions } from '../base-plugin';
5
+ import { BasePlugin } from '../base-plugin';
6
+ /**
7
+ * <zh/> 缩略图插件的配置项
8
+ *
9
+ * <en/> The configuration item of the Minimap plugin
10
+ */
11
+ export interface MinimapOptions extends BasePluginOptions {
12
+ /**
13
+ * <zh/> 宽度和高度
14
+ *
15
+ * <en/> Width and height
16
+ */
17
+ size?: [number, number];
18
+ /**
19
+ * <zh/> 内边距
20
+ *
21
+ * <en/> Padding
22
+ * @defaultValue 10
23
+ */
24
+ padding?: Padding;
25
+ /**
26
+ * <zh/> 缩略图相对于画布的位置
27
+ *
28
+ * <en/> The position of the minimap relative to the canvas
29
+ * @defaultValue 'right-bottom'
30
+ */
31
+ position?: Placement;
32
+ /**
33
+ * <zh/> 过滤器,用于过滤不必显示的元素
34
+ *
35
+ * <en/> Filter, used to filter elements that do not need to be displayed
36
+ * @param id - <zh/> 元素的 id | <en/> The id of the element
37
+ * @param elementType - <zh/> 元素的类型 | <en/> The type of the element
38
+ * @returns <zh/> 是否显示 | <en/> Whether to display
39
+ */
40
+ filter?: (id: string, elementType: ElementType) => boolean;
41
+ /**
42
+ * <zh/> 元素缩略图形的生成方法
43
+ *
44
+ * <en/> The method of generating the thumbnail of the element
45
+ * @defaultValue 'key'
46
+ * @remarks
47
+ * <zh/>
48
+ * - 'key' 使用元素的主图形作为缩略图形
49
+ * - 也可以传入一个函数,接收元素的 id 和类型,返回一个图形
50
+ *
51
+ * <en/>
52
+ * - 'key' uses the key shape of the element as the thumbnail graphic
53
+ * - You can also pass in a function that receives the id and type of the element and returns a shape
54
+ */
55
+ shape?: 'key' | ((id: string, elementType: ElementType) => DisplayObject);
56
+ /**
57
+ * <zh/> 缩略图画布类名
58
+ *
59
+ * <en/> The class name of the minimap canvas
60
+ */
61
+ className?: string;
62
+ /**
63
+ * <zh/> 缩略图挂载的容器,无则挂载到 Graph 所在容器
64
+ *
65
+ * <en/> The container where the minimap is mounted, if not, it will be mounted to the container where the Graph is located
66
+ */
67
+ container?: HTMLElement | string;
68
+ /**
69
+ * <zh/> 缩略图的容器样式,传入外置容器时不生效
70
+ *
71
+ * <en/> The style of the minimap container, which does not take effect when an external container is passed in
72
+ */
73
+ containerStyle?: Partial<CSSStyleDeclaration>;
74
+ /**
75
+ * <zh/> 遮罩的样式
76
+ *
77
+ * <en/> The style of the mask
78
+ */
79
+ maskStyle?: Partial<CSSStyleDeclaration>;
80
+ /**
81
+ * <zh/> 渲染器,默认使用 Canvas 渲染器
82
+ *
83
+ * <en/> Renderer, default to use Canvas renderer
84
+ */
85
+ renderer?: IRenderer;
86
+ }
87
+ export declare class Minimap extends BasePlugin<MinimapOptions> {
88
+ static defaultOptions: Partial<MinimapOptions>;
89
+ private canvas;
90
+ constructor(context: RuntimeContext, options: MinimapOptions);
91
+ private bindEvents;
92
+ private unbindEvents;
93
+ private onDraw;
94
+ private onRender;
95
+ private shapes;
96
+ /**
97
+ * <zh/> 创建或更新缩略图
98
+ *
99
+ * <en/> Create or update the minimap
100
+ */
101
+ private renderMinimap;
102
+ private getElements;
103
+ private setShapes;
104
+ private container;
105
+ private calculatePosition;
106
+ private createContainer;
107
+ private initCanvas;
108
+ private setCamera;
109
+ private mask;
110
+ private get maskBBox();
111
+ /**
112
+ * <zh/> 计算遮罩包围盒
113
+ *
114
+ * <en/> Calculate the bounding box of the mask
115
+ * @returns <zh/> 遮罩包围盒 | <en/> Mask bounding box
116
+ */
117
+ private calculateMaskBBox;
118
+ /**
119
+ * <zh/> 创建或更新遮罩
120
+ *
121
+ * <en/> Create or update the mask
122
+ */
123
+ private renderMask;
124
+ private isMaskDragging;
125
+ private onMaskDragStart;
126
+ private onMaskDrag;
127
+ private onMaskDragEnd;
128
+ private onTransform;
129
+ private updateMask;
130
+ destroy(): void;
131
+ }
@@ -1,6 +1,6 @@
1
- import type { ExtensionRegistry } from './types';
2
1
  /**
3
- * <zh/> 内置插件统一在这里注册。
4
- * <en/> Built-in extensions are registered here.
2
+ * <zh/> 注册内置扩展
3
+ *
4
+ * <en/> Register built-in extensions
5
5
  */
6
- export declare const BUILT_IN_EXTENSIONS: ExtensionRegistry;
6
+ export declare function registerBuiltInExtensions(): void;
@@ -0,0 +1,22 @@
1
+ import { ExtensionCategory } from '../constants';
2
+ import type { Loosen } from '../types';
3
+ import type { ExtensionRegistry } from './types';
4
+ /**
5
+ * <zh/> 根据类别和类型获取扩展
6
+ *
7
+ * <en/> Get the extension by category and type
8
+ * @param category - <zh/> 扩展类别 | <en/> Extension category
9
+ * @param type - <zh/> 扩展类型 | <en/> Extension type
10
+ * @returns <zh/> 注册的扩展 | <en/> Registered extension
11
+ * @internal
12
+ */
13
+ export declare function getExtension<T extends ExtensionCategory>(category: Loosen<T>, type: string): ExtensionRegistry[T][string] | undefined;
14
+ /**
15
+ * <zh/> 根据类别获取扩展
16
+ *
17
+ * <en/> Get the extension by category and type
18
+ * @param category - <zh/> 扩展类别 | <en/> Extension category
19
+ * @returns <zh/> 注册的扩展 | <en/> Registered extension
20
+ * @internal
21
+ */
22
+ export declare function getExtensions<T extends Loosen<ExtensionCategory>>(category: T): ExtensionRegistry[T];
@@ -1,4 +1,4 @@
1
- import { ExtensionCategory } from '../constants';
1
+ import type { ExtensionCategory } from '../constants';
2
2
  import type { Loosen } from '../types';
3
3
  import type { ExtensionRegistry } from './types';
4
4
  /**
@@ -36,28 +36,3 @@ import type { ExtensionRegistry } from './types';
36
36
  * @public
37
37
  */
38
38
  export declare function register<T extends ExtensionCategory>(category: Loosen<T>, type: string, Ctor: ExtensionRegistry[T][string], override?: boolean): void;
39
- /**
40
- * <zh/> 根据类别和类型获取扩展
41
- *
42
- * <en/> Get the extension by category and type
43
- * @param category - <zh/> 扩展类别 | <en/> Extension category
44
- * @param type - <zh/> 扩展类型 | <en/> Extension type
45
- * @returns <zh/> 注册的扩展 | <en/> Registered extension
46
- * @internal
47
- */
48
- export declare function getExtension<T extends ExtensionCategory>(category: Loosen<T>, type: string): ExtensionRegistry[T][string] | undefined;
49
- /**
50
- * <zh/> 根据类别获取扩展
51
- *
52
- * <en/> Get the extension by category and type
53
- * @param category - <zh/> 扩展类别 | <en/> Extension category
54
- * @returns <zh/> 注册的扩展 | <en/> Registered extension
55
- * @internal
56
- */
57
- export declare function getExtensions<T extends Loosen<ExtensionCategory>>(category: T): ExtensionRegistry[T];
58
- /**
59
- * <zh/> 注册内置扩展
60
- *
61
- * <en/> Register built-in extensions
62
- */
63
- export declare function registerBuiltInExtensions(): void;
@@ -0,0 +1,7 @@
1
+ import type { ExtensionRegistry } from './types';
2
+ /**
3
+ * <zh/> 扩展注册表
4
+ *
5
+ * <en/> Extension registry
6
+ */
7
+ export declare const EXTENSION_REGISTRY: ExtensionRegistry;
@@ -1,8 +1,8 @@
1
- import type { CanvasConfig as GCanvasConfig, IChildNode } from '@antv/g';
1
+ import type { Cursor, CanvasConfig as GCanvasConfig, IChildNode } from '@antv/g';
2
2
  import { Canvas as GCanvas } from '@antv/g';
3
3
  import { Renderer as CanvasRenderer } from '@antv/g-canvas';
4
4
  import type { CanvasOptions } from '../spec/canvas';
5
- import type { CanvasLayer } from '../types';
5
+ import type { CanvasLayer, Point } from '../types';
6
6
  export interface CanvasConfig extends Pick<GCanvasConfig, 'container' | 'devicePixelRatio' | 'width' | 'height' | 'cursor' | 'background'> {
7
7
  renderer?: CanvasOptions['renderer'];
8
8
  }
@@ -31,9 +31,11 @@ export interface DataURLOptions {
31
31
  */
32
32
  encoderOptions: number;
33
33
  }
34
- export declare class Canvas extends GCanvas {
34
+ export declare class Canvas {
35
35
  private extends;
36
- getLayer(layer: CanvasLayer): GCanvas;
36
+ private config;
37
+ getConfig(): CanvasConfig;
38
+ getLayer(layer?: CanvasLayer): GCanvas;
37
39
  /**
38
40
  * <zh/> 获取所有图层
39
41
  *
@@ -49,14 +51,33 @@ export declare class Canvas extends GCanvas {
49
51
  * @returns <zh/> 渲染器 <en/> Renderer
50
52
  */
51
53
  getRenderer(layer: CanvasLayer): CanvasRenderer;
54
+ /**
55
+ * <zh/> 获取相机
56
+ *
57
+ * <en/> Get camera
58
+ * @param layer - <zh/> 图层 <en/> Layer
59
+ * @returns <zh/> 相机 <en/> Camera
60
+ */
61
+ getCamera(layer?: CanvasLayer): import("@antv/g").ICamera;
62
+ getRoot(layer?: CanvasLayer): import("@antv/g").Group;
63
+ getContextService(layer?: CanvasLayer): import("@antv/g").ContextService<unknown>;
64
+ setCursor(cursor: Cursor): void;
65
+ get document(): import("@antv/g").Document;
66
+ get context(): import("@antv/g").CanvasContext;
52
67
  constructor(config: CanvasConfig);
53
- get ready(): Promise<[any, ...any[]]>;
68
+ get ready(): Promise<any[]>;
54
69
  resize(width: number, height: number): void;
55
70
  getBounds(): import("@antv/g").AABB;
56
71
  getContainer(): HTMLElement | null;
57
72
  getSize(): [number, number];
58
73
  appendChild<T extends IChildNode>(child: T, index?: number): T;
59
- setRenderer(renderer: any): void;
74
+ setRenderer(renderer: CanvasOptions['renderer']): void;
75
+ getCanvasByViewport(point: Point): Point;
76
+ getViewportByCanvas(point: Point): Point;
77
+ getViewportByClient(point: Point): Point;
78
+ getClientByViewport(point: Point): Point;
79
+ getClientByCanvas(point: Point): Point;
80
+ getCanvasByClient(point: Point): Point;
60
81
  toDataURL(options?: Partial<DataURLOptions>): Promise<string>;
61
- destroy(cleanUp?: boolean, skipTriggerEvent?: boolean): void;
82
+ destroy(): void;
62
83
  }
@@ -108,11 +108,13 @@ export declare class ElementController {
108
108
  }
109
109
  export interface DrawContext {
110
110
  /** <zh/> 是否使用动画,默认为 true | <en/> Whether to use animation, default is true */
111
- animation: boolean;
111
+ animation?: boolean;
112
112
  /** <zh/> 当前绘制阶段 | <en/> Current draw stage */
113
113
  stage?: AnimationStage;
114
114
  /** <zh/> 是否不抛出事件 | <en/> Whether not to dispatch events */
115
115
  silence?: boolean;
116
116
  /** <zh/> 收起/展开的对象 ID | <en/> ID of the object to collapse/expand */
117
117
  collapseExpandTarget?: ID;
118
+ /** <zh/> 绘制类型 | <en/> Draw type */
119
+ type?: 'render' | 'draw';
118
120
  }
@@ -945,9 +945,9 @@ export declare class Graph extends EventEmitter {
945
945
  * <en/> Get the position of the graph
946
946
  * @returns <zh/> 图的位置 | <en/> position of the graph
947
947
  * @remarks
948
- * <zh/> 默认状态下,图的位置为 [0, 0]
948
+ * <zh/> 即画布原点在视口坐标系下的位置。默认状态下,图的位置为 [0, 0]
949
949
  *
950
- * <en/> By default, the position of the graph is [0, 0]
950
+ * <en/> That is, the position of the canvas origin in the viewport coordinate system. By default, the position of the graph is [0, 0]
951
951
  * @apiCategory viewport
952
952
  */
953
953
  getPosition(): Point;
@@ -1202,10 +1202,10 @@ export declare class Graph extends EventEmitter {
1202
1202
  */
1203
1203
  getViewportCenter(): Point;
1204
1204
  /**
1205
- * <zh/> 获取画布中心的画布坐标
1205
+ * <zh/> 获取视口中心的视口坐标
1206
1206
  *
1207
- * <en/> Get the canvas coordinates of the canvas center
1208
- * @returns <zh/> 画布中心的画布坐标 | <en/> Canvas coordinates of the canvas center
1207
+ * <en/> Get the viewport coordinates of the viewport center
1208
+ * @returns <zh/> 视口中心的视口坐标 | <en/> Viewport coordinates of the viewport center
1209
1209
  * @apiCategory viewport
1210
1210
  */
1211
1211
  getCanvasCenter(): Point;
@@ -24,7 +24,7 @@ export declare function preprocessKeyframes(keyframes: Keyframe[]): Keyframe[];
24
24
  *
25
25
  * <en/> During the animation, some attributes do not explicitly specify the attribute value, but in fact there is an attribute value in G, so use this method to get the actual default value
26
26
  */
27
- export declare function inferDefaultValue(name: string): false | 0 | 1 | never[] | "visible" | undefined;
27
+ export declare function inferDefaultValue(name: string): false | 0 | 1 | "visible" | never[] | undefined;
28
28
  /**
29
29
  * <zh/> 获取动画配置
30
30
  *
@@ -65,6 +65,16 @@ export declare function getCombinedBBox(bboxes: AABB[]): AABB;
65
65
  * @returns <zh/> 如果点在包围盒内返回 true,否则返回 false | <en/> Returns true if the point is inside the bounding box, false otherwise
66
66
  */
67
67
  export declare function isPointInBBox(point: Point, bbox: AABB): boolean;
68
+ /**
69
+ * <zh/> 判断点是否在给定的包围盒的边界或边界的延长线上
70
+ *
71
+ * <en/> Whether the point is on the boundary or extension line of the given box
72
+ * @param point - <zh/> 点 | <en/> Point
73
+ * @param bbox - <zh/> 包围盒 | <en/> Bounding box
74
+ * @param extended - <zh/> 是否判断边界的延长线 | <en/> Whether to judge the extension line of the boundary
75
+ * @returns <zh/> 如果点在包围盒的边界或边界的延长线上返回 true,否则返回 false | <en/> Returns true if the point is on the boundary or extension line of the bounding box, false otherwise
76
+ */
77
+ export declare function isPointOnBBoxBoundary(point: Point, bbox: AABB, extended?: boolean): boolean;
68
78
  /**
69
79
  * <zh/> 判断点是否在给定的包围盒外
70
80
  *
@@ -6,14 +6,14 @@ export declare class BaseEvent {
6
6
  constructor(type: string);
7
7
  }
8
8
  export declare class GraphLifeCycleEvent extends BaseEvent implements IGraphLifeCycleEvent {
9
- data?: any | undefined;
10
- constructor(type: GraphEvent.BEFORE_RENDER | GraphEvent.AFTER_RENDER | GraphEvent.BEFORE_DRAW | GraphEvent.AFTER_DRAW | GraphEvent.BEFORE_LAYOUT | GraphEvent.AFTER_LAYOUT | GraphEvent.BEFORE_STAGE_LAYOUT | GraphEvent.AFTER_STAGE_LAYOUT | GraphEvent.BEFORE_SIZE_CHANGE | GraphEvent.AFTER_SIZE_CHANGE | GraphEvent.BATCH_START | GraphEvent.BATCH_END | GraphEvent.BEFORE_DESTROY | GraphEvent.AFTER_DESTROY, data?: any | undefined);
9
+ data?: any;
10
+ constructor(type: GraphEvent.BEFORE_RENDER | GraphEvent.AFTER_RENDER | GraphEvent.BEFORE_DRAW | GraphEvent.AFTER_DRAW | GraphEvent.BEFORE_LAYOUT | GraphEvent.AFTER_LAYOUT | GraphEvent.BEFORE_STAGE_LAYOUT | GraphEvent.AFTER_STAGE_LAYOUT | GraphEvent.BEFORE_SIZE_CHANGE | GraphEvent.AFTER_SIZE_CHANGE | GraphEvent.BATCH_START | GraphEvent.BATCH_END | GraphEvent.BEFORE_DESTROY | GraphEvent.AFTER_DESTROY, data?: any);
11
11
  }
12
12
  export declare class AnimateEvent extends BaseEvent implements IAnimateEvent {
13
13
  animationType: AnimationType;
14
14
  animation: IAnimation | null;
15
- data?: any | undefined;
16
- constructor(type: GraphEvent.BEFORE_ANIMATE | GraphEvent.AFTER_ANIMATE, animationType: AnimationType, animation: IAnimation | null, data?: any | undefined);
15
+ data?: any;
16
+ constructor(type: GraphEvent.BEFORE_ANIMATE | GraphEvent.AFTER_ANIMATE, animationType: AnimationType, animation: IAnimation | null, data?: any);
17
17
  }
18
18
  export declare class ElementLifeCycleEvent extends BaseEvent implements IElementLifeCycleEvent {
19
19
  elementType: ElementType;