@antv/g6 5.0.3 → 5.0.4

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 (242) hide show
  1. package/README.en-US.md +118 -0
  2. package/README.md +118 -0
  3. package/dist/g6.min.js +2 -2
  4. package/dist/lib/behaviors/base-behavior.d.ts +1 -1
  5. package/dist/lib/behaviors/scroll-canvas.d.ts +1 -1
  6. package/dist/lib/behaviors/types.d.ts +0 -4
  7. package/dist/lib/behaviors/zoom-canvas.d.ts +1 -1
  8. package/dist/lib/elements/shapes/badge.d.ts +1 -1
  9. package/dist/lib/index.d.ts +1 -1
  10. package/dist/lib/layouts/index.d.ts +0 -1
  11. package/dist/lib/plugins/types.d.ts +0 -2
  12. package/dist/lib/registry/extension/index.d.ts +17 -6
  13. package/dist/lib/registry/extension/types.d.ts +15 -33
  14. package/dist/lib/runtime/data.d.ts +1 -1
  15. package/dist/lib/runtime/element.d.ts +1 -1
  16. package/dist/lib/spec/behavior.d.ts +4 -5
  17. package/dist/lib/spec/element/combo.d.ts +8 -4
  18. package/dist/lib/spec/element/edge.d.ts +8 -4
  19. package/dist/lib/spec/element/node.d.ts +8 -4
  20. package/dist/lib/spec/plugin.d.ts +4 -5
  21. package/dist/lib/spec/transform.d.ts +5 -6
  22. package/dist/lib/transforms/types.d.ts +1 -2
  23. package/dist/lib/types/index.d.ts +0 -1
  24. package/dist/lib/types/style.d.ts +2 -0
  25. package/dist/lib/utils/event/events.d.ts +4 -4
  26. package/dist/lib/utils/extension.d.ts +5 -2
  27. package/dist/lib/utils/style.d.ts +5 -2
  28. package/dist/lib/utils/transform.d.ts +1 -1
  29. package/dist/lib/version.d.ts +1 -0
  30. package/esm/behaviors/base-behavior.d.ts +1 -1
  31. package/esm/behaviors/base-behavior.js.map +1 -1
  32. package/esm/behaviors/scroll-canvas.d.ts +1 -1
  33. package/esm/behaviors/scroll-canvas.js.map +1 -1
  34. package/esm/behaviors/types.d.ts +0 -4
  35. package/esm/behaviors/zoom-canvas.d.ts +1 -1
  36. package/esm/elements/shapes/badge.d.ts +1 -1
  37. package/esm/index.d.ts +1 -1
  38. package/esm/index.js +1 -1
  39. package/esm/index.js.map +1 -1
  40. package/esm/layouts/index.d.ts +0 -1
  41. package/esm/plugins/camera-setting.js.map +1 -1
  42. package/esm/plugins/types.d.ts +0 -2
  43. package/esm/registry/extension/index.d.ts +17 -6
  44. package/esm/registry/extension/index.js +1 -1
  45. package/esm/registry/extension/index.js.map +1 -1
  46. package/esm/registry/extension/types.d.ts +15 -33
  47. package/esm/runtime/data.d.ts +1 -1
  48. package/esm/runtime/element.d.ts +1 -1
  49. package/esm/runtime/element.js +7 -4
  50. package/esm/runtime/element.js.map +1 -1
  51. package/esm/runtime/graph.js +3 -3
  52. package/esm/runtime/graph.js.map +1 -1
  53. package/esm/spec/behavior.d.ts +4 -5
  54. package/esm/spec/element/combo.d.ts +8 -4
  55. package/esm/spec/element/edge.d.ts +8 -4
  56. package/esm/spec/element/node.d.ts +8 -4
  57. package/esm/spec/plugin.d.ts +4 -5
  58. package/esm/spec/transform.d.ts +5 -6
  59. package/esm/transforms/types.d.ts +1 -2
  60. package/esm/types/index.d.ts +0 -1
  61. package/esm/types/style.d.ts +2 -0
  62. package/esm/utils/event/events.d.ts +4 -4
  63. package/esm/utils/extension.d.ts +5 -2
  64. package/esm/utils/extension.js +5 -1
  65. package/esm/utils/extension.js.map +1 -1
  66. package/esm/utils/style.d.ts +5 -2
  67. package/esm/utils/style.js +5 -6
  68. package/esm/utils/style.js.map +1 -1
  69. package/esm/utils/transform.d.ts +1 -1
  70. package/esm/version.d.ts +1 -0
  71. package/esm/version.js +2 -0
  72. package/esm/version.js.map +1 -0
  73. package/lib/behaviors/base-behavior.d.ts +1 -1
  74. package/lib/behaviors/base-behavior.js.map +1 -1
  75. package/lib/behaviors/scroll-canvas.d.ts +1 -1
  76. package/lib/behaviors/scroll-canvas.js.map +1 -1
  77. package/lib/behaviors/types.d.ts +0 -4
  78. package/lib/behaviors/zoom-canvas.d.ts +1 -1
  79. package/lib/elements/effect.js +1 -2
  80. package/lib/elements/effect.js.map +1 -1
  81. package/lib/elements/shapes/badge.d.ts +1 -1
  82. package/lib/index.d.ts +1 -1
  83. package/lib/index.js +2 -1
  84. package/lib/index.js.map +1 -1
  85. package/lib/layouts/index.d.ts +0 -1
  86. package/lib/plugins/camera-setting.js.map +1 -1
  87. package/lib/plugins/contextmenu/util.js +2 -2
  88. package/lib/plugins/contextmenu/util.js.map +1 -1
  89. package/lib/plugins/history/util.js +2 -3
  90. package/lib/plugins/history/util.js.map +1 -1
  91. package/lib/plugins/hull/util.js +1 -2
  92. package/lib/plugins/hull/util.js.map +1 -1
  93. package/lib/plugins/toolbar/util.js +2 -2
  94. package/lib/plugins/toolbar/util.js.map +1 -1
  95. package/lib/plugins/types.d.ts +0 -2
  96. package/lib/plugins/watermark/util.js +2 -3
  97. package/lib/plugins/watermark/util.js.map +1 -1
  98. package/lib/registry/extension/index.d.ts +17 -6
  99. package/lib/registry/extension/index.js +1 -1
  100. package/lib/registry/extension/index.js.map +1 -1
  101. package/lib/registry/extension/types.d.ts +15 -33
  102. package/lib/registry/index.js +4 -5
  103. package/lib/registry/index.js.map +1 -1
  104. package/lib/runtime/data.d.ts +1 -1
  105. package/lib/runtime/element.d.ts +1 -1
  106. package/lib/runtime/element.js +7 -4
  107. package/lib/runtime/element.js.map +1 -1
  108. package/lib/runtime/graph.js +3 -3
  109. package/lib/runtime/graph.js.map +1 -1
  110. package/lib/spec/behavior.d.ts +4 -5
  111. package/lib/spec/element/combo.d.ts +8 -4
  112. package/lib/spec/element/edge.d.ts +8 -4
  113. package/lib/spec/element/node.d.ts +8 -4
  114. package/lib/spec/plugin.d.ts +4 -5
  115. package/lib/spec/transform.d.ts +5 -6
  116. package/lib/themes/base.js +1 -2
  117. package/lib/themes/base.js.map +1 -1
  118. package/lib/transforms/types.d.ts +1 -2
  119. package/lib/transforms/utils.js +1 -2
  120. package/lib/transforms/utils.js.map +1 -1
  121. package/lib/types/index.d.ts +0 -1
  122. package/lib/types/style.d.ts +2 -0
  123. package/lib/utils/anchor.js +1 -2
  124. package/lib/utils/anchor.js.map +1 -1
  125. package/lib/utils/animation.js +5 -6
  126. package/lib/utils/animation.js.map +1 -1
  127. package/lib/utils/array.js +1 -2
  128. package/lib/utils/array.js.map +1 -1
  129. package/lib/utils/bbox.js +13 -14
  130. package/lib/utils/bbox.js.map +1 -1
  131. package/lib/utils/cache.js +4 -5
  132. package/lib/utils/cache.js.map +1 -1
  133. package/lib/utils/change.js +2 -3
  134. package/lib/utils/change.js.map +1 -1
  135. package/lib/utils/collapsibility.js +1 -2
  136. package/lib/utils/collapsibility.js.map +1 -1
  137. package/lib/utils/data.js +3 -4
  138. package/lib/utils/data.js.map +1 -1
  139. package/lib/utils/diff.js +1 -2
  140. package/lib/utils/diff.js.map +1 -1
  141. package/lib/utils/dom.js +4 -5
  142. package/lib/utils/dom.js.map +1 -1
  143. package/lib/utils/edge.js +18 -18
  144. package/lib/utils/edge.js.map +1 -1
  145. package/lib/utils/element.js +26 -27
  146. package/lib/utils/element.js.map +1 -1
  147. package/lib/utils/event/events.d.ts +4 -4
  148. package/lib/utils/event/index.js +2 -3
  149. package/lib/utils/event/index.js.map +1 -1
  150. package/lib/utils/extension.d.ts +5 -2
  151. package/lib/utils/extension.js +6 -3
  152. package/lib/utils/extension.js.map +1 -1
  153. package/lib/utils/graphlib.js +3 -4
  154. package/lib/utils/graphlib.js.map +1 -1
  155. package/lib/utils/id.js +3 -4
  156. package/lib/utils/id.js.map +1 -1
  157. package/lib/utils/is.js +4 -5
  158. package/lib/utils/is.js.map +1 -1
  159. package/lib/utils/layout.js +7 -8
  160. package/lib/utils/layout.js.map +1 -1
  161. package/lib/utils/line.js +2 -3
  162. package/lib/utils/line.js.map +1 -1
  163. package/lib/utils/math.js +1 -2
  164. package/lib/utils/math.js.map +1 -1
  165. package/lib/utils/node.js +1 -2
  166. package/lib/utils/node.js.map +1 -1
  167. package/lib/utils/padding.js +1 -2
  168. package/lib/utils/padding.js.map +1 -1
  169. package/lib/utils/palette.js +3 -4
  170. package/lib/utils/palette.js.map +1 -1
  171. package/lib/utils/path.js +4 -4
  172. package/lib/utils/path.js.map +1 -1
  173. package/lib/utils/placement.js +1 -2
  174. package/lib/utils/placement.js.map +1 -1
  175. package/lib/utils/point.js +21 -22
  176. package/lib/utils/point.js.map +1 -1
  177. package/lib/utils/polygon.js +1 -2
  178. package/lib/utils/polygon.js.map +1 -1
  179. package/lib/utils/position.js +5 -5
  180. package/lib/utils/position.js.map +1 -1
  181. package/lib/utils/prefix.js +7 -8
  182. package/lib/utils/prefix.js.map +1 -1
  183. package/lib/utils/relation.js +2 -3
  184. package/lib/utils/relation.js.map +1 -1
  185. package/lib/utils/router/orth.js +9 -10
  186. package/lib/utils/router/orth.js.map +1 -1
  187. package/lib/utils/shape.js +1 -2
  188. package/lib/utils/shape.js.map +1 -1
  189. package/lib/utils/size.js +1 -2
  190. package/lib/utils/size.js.map +1 -1
  191. package/lib/utils/style.d.ts +5 -2
  192. package/lib/utils/style.js +8 -10
  193. package/lib/utils/style.js.map +1 -1
  194. package/lib/utils/text.js +3 -4
  195. package/lib/utils/text.js.map +1 -1
  196. package/lib/utils/theme.js +1 -2
  197. package/lib/utils/theme.js.map +1 -1
  198. package/lib/utils/transform.d.ts +1 -1
  199. package/lib/utils/transform.js +2 -2
  200. package/lib/utils/transform.js.map +1 -1
  201. package/lib/utils/traverse.js +2 -3
  202. package/lib/utils/traverse.js.map +1 -1
  203. package/lib/utils/tree.js +1 -2
  204. package/lib/utils/tree.js.map +1 -1
  205. package/lib/utils/vector.js +16 -17
  206. package/lib/utils/vector.js.map +1 -1
  207. package/lib/utils/visibility.js +1 -2
  208. package/lib/utils/visibility.js.map +1 -1
  209. package/lib/version.d.ts +1 -0
  210. package/lib/version.js +5 -0
  211. package/lib/version.js.map +1 -0
  212. package/package.json +6 -3
  213. package/src/behaviors/base-behavior.ts +1 -1
  214. package/src/behaviors/scroll-canvas.ts +1 -1
  215. package/src/behaviors/types.ts +0 -4
  216. package/src/index.ts +1 -1
  217. package/src/plugins/camera-setting.ts +2 -2
  218. package/src/plugins/types.ts +0 -2
  219. package/src/registry/extension/index.ts +15 -8
  220. package/src/registry/extension/types.ts +15 -40
  221. package/src/runtime/element.ts +7 -4
  222. package/src/runtime/graph.ts +3 -3
  223. package/src/spec/behavior.ts +4 -5
  224. package/src/spec/element/combo.ts +16 -4
  225. package/src/spec/element/edge.ts +16 -4
  226. package/src/spec/element/node.ts +16 -4
  227. package/src/spec/plugin.ts +4 -5
  228. package/src/spec/transform.ts +5 -6
  229. package/src/transforms/types.ts +1 -2
  230. package/src/types/index.ts +0 -1
  231. package/src/types/style.ts +2 -0
  232. package/src/utils/extension.ts +10 -3
  233. package/src/utils/style.ts +11 -6
  234. package/src/version.ts +1 -0
  235. package/dist/lib/types/callable.d.ts +0 -19
  236. package/esm/types/callable.d.ts +0 -19
  237. package/esm/types/callable.js +0 -2
  238. package/esm/types/callable.js.map +0 -1
  239. package/lib/types/callable.d.ts +0 -19
  240. package/lib/types/callable.js +0 -3
  241. package/lib/types/callable.js.map +0 -1
  242. package/src/types/callable.ts +0 -21
@@ -2,5 +2,5 @@ import { BaseExtension } from '../registry/extension';
2
2
  import type { CustomBehaviorOption } from '../spec/behavior';
3
3
  export interface BaseBehaviorOptions extends CustomBehaviorOption {
4
4
  }
5
- export declare abstract class BaseBehavior<T extends BaseBehaviorOptions> extends BaseExtension<T> {
5
+ export declare abstract class BaseBehavior<T extends BaseBehaviorOptions = BaseBehaviorOptions> extends BaseExtension<T> {
6
6
  }
@@ -59,7 +59,7 @@ export interface ScrollCanvasOptions extends BaseBehaviorOptions {
59
59
  * <en/> Scroll canvas behavior
60
60
  */
61
61
  export declare class ScrollCanvas extends BaseBehavior<ScrollCanvasOptions> {
62
- static defaultOptions: ScrollCanvasOptions;
62
+ static defaultOptions: Partial<ScrollCanvasOptions>;
63
63
  private shortcut;
64
64
  constructor(context: RuntimeContext, options: ScrollCanvasOptions);
65
65
  /**
@@ -1,6 +1,2 @@
1
1
  import type { BaseBehavior } from './base-behavior';
2
- import type { DragCanvasOptions } from './drag-canvas';
3
- import type { ScrollCanvasOptions } from './scroll-canvas';
4
- import type { ZoomCanvasOptions } from './zoom-canvas';
5
- export type BuiltInBehaviorOptions = DragCanvasOptions | ZoomCanvasOptions | ScrollCanvasOptions;
6
2
  export type Behavior = BaseBehavior<any>;
@@ -77,7 +77,7 @@ export declare class ZoomCanvas extends BaseBehavior<ZoomCanvasOptions> {
77
77
  * @param event - <zh/> 事件对象 | <en/> Event object
78
78
  * @param animation - <zh/> 缩放动画配置 | <en/> Zoom animation configuration
79
79
  */
80
- protected zoom: (value: number, event: IWheelEvent | IKeyboardEvent, animation: ZoomCanvasOptions['animation']) => Promise<void>;
80
+ protected zoom: (value: number, event: IWheelEvent | IKeyboardEvent, animation: ZoomCanvasOptions["animation"]) => Promise<void>;
81
81
  protected onReset: () => Promise<void>;
82
82
  /**
83
83
  * <zh/> 验证是否可以缩放
@@ -20,7 +20,7 @@ export interface BadgeStyleProps extends LabelStyleProps {
20
20
  export declare class Badge extends BaseShape<BadgeStyleProps> {
21
21
  static defaultStyleProps: Partial<BadgeStyleProps>;
22
22
  constructor(options: DisplayObjectConfig<BadgeStyleProps>);
23
- protected getBadgeStyle(attributes: Required<BadgeStyleProps>): Omit<Required<BadgeStyleProps>, "x" | "y" | "z" | "zIndex" | "class" | "transform" | "transformOrigin" | "context" | "className">;
23
+ protected getBadgeStyle(attributes: Required<BadgeStyleProps>): Omit<Required<BadgeStyleProps>, "x" | "y" | "z" | "class" | "transform" | "transformOrigin" | "zIndex" | "context" | "className">;
24
24
  render(attributes?: Required<BadgeStyleProps>, container?: Group): void;
25
25
  getGeometryBounds(): import("@antv/g").AABB;
26
26
  }
@@ -1,6 +1,6 @@
1
1
  import './preset';
2
2
  export * from './exports';
3
- export declare const version = "5.0.3";
3
+ export { version } from './version';
4
4
  export declare const iconfont: {
5
5
  css: string;
6
6
  js: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="src/layouts/hierarchy" />
2
1
  export { compactBox, dendrogram, indented, mindmap } from '@antv/hierarchy';
3
2
  export { AntVDagreLayout, CircularLayout, ComboCombinedLayout, ConcentricLayout, D3ForceLayout, DagreLayout, ForceAtlas2Layout, ForceLayout, FruchtermanLayout, GridLayout, MDSLayout, RadialLayout, RandomLayout, } from '@antv/layout';
4
3
  export { BaseLayout } from './base-layout';
@@ -1,4 +1,2 @@
1
1
  import type { BasePlugin } from './base-plugin';
2
- import type { GridLineOptions } from './grid-line';
3
- export type BuiltInPluginOptions = GridLineOptions;
4
2
  export type Plugin = BasePlugin<any>;
@@ -1,14 +1,21 @@
1
1
  import type EventEmitter from '@antv/event-emitter';
2
+ import type { Graph } from '../../runtime/graph';
2
3
  import type { RuntimeContext } from '../../runtime/types';
3
4
  import type { IEvent } from '../../types';
4
- import type { ExtensionOptions, LooselyExtensionOption, STDExtensionOption } from './types';
5
- export declare abstract class ExtensionController<Extension extends BaseExtension<LooselyExtensionOption>> {
5
+ import type { STDExtensionOption } from './types';
6
+ export declare abstract class ExtensionController<E extends BaseExtension<any>> {
6
7
  protected context: RuntimeContext;
7
8
  protected extensions: STDExtensionOption[];
8
- protected extensionMap: Record<string, Extension>;
9
+ protected extensionMap: Record<string, E>;
9
10
  abstract category: 'plugin' | 'behavior' | 'transform';
10
11
  constructor(context: RuntimeContext);
11
- setExtensions(extensions: ExtensionOptions): void;
12
+ setExtensions(extensions: (string | {
13
+ type: string;
14
+ [keys: string]: unknown;
15
+ } | ((this: Graph) => {
16
+ type: string;
17
+ [keys: string]: unknown;
18
+ }))[]): void;
12
19
  protected createExtension(extension: STDExtensionOption): void;
13
20
  protected createExtensions(extensions: STDExtensionOption[]): void;
14
21
  protected updateExtension(extension: STDExtensionOption): void;
@@ -22,12 +29,16 @@ export declare abstract class ExtensionController<Extension extends BaseExtensio
22
29
  *
23
30
  * <en/> Base class for extension instance
24
31
  */
25
- export declare class BaseExtension<T extends LooselyExtensionOption> {
32
+ export declare class BaseExtension<T extends {
33
+ type: string;
34
+ key?: string;
35
+ [key: string]: unknown;
36
+ }> {
26
37
  protected context: RuntimeContext;
27
38
  protected options: Required<T>;
28
39
  protected events: [EventEmitter | HTMLElement, string, (event: IEvent) => void][];
29
40
  destroyed: boolean;
30
- constructor(context: RuntimeContext, options: T);
41
+ constructor(context: RuntimeContext, options: Partial<T>);
31
42
  update(options: Partial<T>): void;
32
43
  destroy(): void;
33
44
  }
@@ -1,38 +1,20 @@
1
- interface ExtensionMetaOptions {
2
- type: string;
3
- key: string;
4
- }
5
- interface CustomExtensionOptions {
6
- [key: string]: any;
7
- }
8
- /**
9
- * <zh/> 扩展配置项
10
- *
11
- * <en/> Extension options
12
- */
13
- export type ExtensionOptions<Registry extends CustomExtensionOptions = CustomExtensionOptions> = ExtensionOption<Registry | LooselyExtensionOption>[];
14
- /**
15
- * <zh/> 扩展配置项
16
- *
17
- * <en/> Extension option
18
- */
19
- type ExtensionOption<Registry extends CustomExtensionOptions> = AbbrExtensionOption<Registry>;
20
1
  /**
21
2
  * <zh/> 标准扩展配置项
22
3
  *
23
4
  * <en/> Standard extension options
24
5
  */
25
- export type STDExtensionOption = ExtensionMetaOptions & CustomExtensionOptions;
26
- /**
27
- * <zh/> 宽松的扩展配置项,可以不传入 key
28
- *
29
- * <en/> Loosely extension option, key can be omitted
30
- */
31
- export type LooselyExtensionOption = Partial<ExtensionMetaOptions> & CustomExtensionOptions;
32
- /**
33
- * <zh/> 扩展配置项简写,支持直接传入 type 字符串
34
- *
35
- * <en/> Extension option abbreviation, support directly passing in type string
36
- */
37
- type AbbrExtensionOption<S extends LooselyExtensionOption> = S | S['type'];
38
- export {};
6
+ export interface STDExtensionOption {
7
+ /**
8
+ * <zh/> 扩展类型
9
+ *
10
+ * <en/> Extension type
11
+ */
12
+ type: string;
13
+ /**
14
+ * <zh/> 扩展 key,即唯一标识
15
+ *
16
+ * <en/> Extension key, that is, the unique identifier
17
+ */
18
+ key: string;
19
+ [key: string]: unknown;
20
+ }
@@ -104,7 +104,7 @@ export declare class DataController {
104
104
  * @returns <zh/> 节点和 combo 的数据 | <en/> node and combo data
105
105
  */
106
106
  getNodeLikeData(ids?: ID[]): NodeLikeData[];
107
- getElementDataByState(elementType: ElementType, state: string): (NodeData | EdgeData | ComboData)[];
107
+ getElementDataByState(elementType: ElementType, state: string): (NodeData | ComboData | EdgeData)[];
108
108
  getElementState(id: ID): State[];
109
109
  hasNode(id: ID): boolean;
110
110
  hasEdge(id: ID): boolean;
@@ -13,7 +13,7 @@ export declare class ElementController {
13
13
  private forEachElementData;
14
14
  getElementType(elementType: ElementType, datum: ElementDatum): string;
15
15
  private getTheme;
16
- getThemeStyle(elementType: ElementType): import("../spec/element/node").NodeStyle | import("../spec/element/edge").EdgeStyle | import("../spec/element/combo").ComboStyle;
16
+ getThemeStyle(elementType: ElementType): import("../spec/element/node").NodeStyle | import("../spec/element/combo").ComboStyle | import("../spec/element/edge").EdgeStyle;
17
17
  getThemeStateStyle(elementType: ElementType, states: State[]): any;
18
18
  private paletteStyle;
19
19
  private computePaletteStyle;
@@ -1,9 +1,8 @@
1
- import type { BuiltInBehaviorOptions } from '../behaviors/types';
2
- import type { ExtensionOptions } from '../registry/extension/types';
3
- export type BehaviorOptions = ExtensionOptions<BuiltInBehaviorOptions>;
1
+ import type { Graph } from '../runtime/graph';
2
+ export type BehaviorOptions = (string | CustomBehaviorOption | ((this: Graph) => CustomBehaviorOption))[];
4
3
  export interface UpdateBehaviorOption {
5
4
  key: string;
6
- [key: string]: any;
5
+ [key: string]: unknown;
7
6
  }
8
7
  export interface CustomBehaviorOption extends Record<string, any> {
9
8
  /**
@@ -11,7 +10,7 @@ export interface CustomBehaviorOption extends Record<string, any> {
11
10
  *
12
11
  * <en/> Behavior type
13
12
  */
14
- type?: string;
13
+ type: string;
15
14
  /**
16
15
  * <zh/> 交互 key,即唯一标识
17
16
  *
@@ -1,6 +1,6 @@
1
1
  import type { AnimationOptions } from '../../animations/types';
2
2
  import type { BaseComboStyleProps } from '../../elements/combos';
3
- import type { CallableObject } from '../../types';
3
+ import type { Graph } from '../../runtime/graph';
4
4
  import type { ComboData } from '../data';
5
5
  import type { AnimationStage } from './animation';
6
6
  import type { PaletteOptions } from './palette';
@@ -15,19 +15,23 @@ export interface ComboOptions {
15
15
  *
16
16
  * <en/> Combo type
17
17
  */
18
- type?: string | ((datum: ComboData) => string);
18
+ type?: string | ((this: Graph, datum: ComboData) => string);
19
19
  /**
20
20
  * <zh/> 组合样式
21
21
  *
22
22
  * <en/> Combo style
23
23
  */
24
- style?: CallableObject<ComboStyle, ComboData>;
24
+ style?: ComboStyle | ((this: Graph, data: ComboData) => ComboStyle) | {
25
+ [K in keyof ComboStyle]: ComboStyle[K] | ((this: Graph, data: ComboData) => ComboStyle[K]);
26
+ };
25
27
  /**
26
28
  * <zh/> 组合状态样式
27
29
  *
28
30
  * <en/> Combo state style
29
31
  */
30
- state?: Record<string, CallableObject<ComboStyle, ComboData>>;
32
+ state?: Record<string, ComboStyle | ((this: Graph, data: ComboData) => ComboStyle) | {
33
+ [K in keyof ComboStyle]: ComboStyle[K] | ((this: Graph, data: ComboData) => ComboStyle[K]);
34
+ }>;
31
35
  /**
32
36
  * <zh/> 组合动画
33
37
  *
@@ -1,6 +1,6 @@
1
1
  import type { AnimationOptions } from '../../animations/types';
2
2
  import type { BaseEdgeStyleProps } from '../../elements/edges';
3
- import type { CallableObject } from '../../types';
3
+ import type { Graph } from '../../runtime/graph';
4
4
  import type { EdgeData } from '../data';
5
5
  import type { AnimationStage } from './animation';
6
6
  import type { PaletteOptions } from './palette';
@@ -15,19 +15,23 @@ export interface EdgeOptions {
15
15
  *
16
16
  * <en/> Edge type
17
17
  */
18
- type?: string | ((datum: EdgeData) => string);
18
+ type?: string | ((this: Graph, datum: EdgeData) => string);
19
19
  /**
20
20
  * <zh/> 边样式
21
21
  *
22
22
  * <en/> Edge style
23
23
  */
24
- style?: CallableObject<EdgeStyle, EdgeData>;
24
+ style?: EdgeStyle | ((this: Graph, data: EdgeData) => EdgeStyle) | {
25
+ [K in keyof EdgeStyle]: EdgeStyle[K] | ((this: Graph, data: EdgeData) => EdgeStyle[K]);
26
+ };
25
27
  /**
26
28
  * <zh/> 边状态样式
27
29
  *
28
30
  * <en/> Edge state style
29
31
  */
30
- state?: Record<string, CallableObject<EdgeStyle, EdgeData>>;
32
+ state?: Record<string, EdgeStyle | ((this: Graph, data: EdgeData) => EdgeStyle) | {
33
+ [K in keyof EdgeStyle]: EdgeStyle[K] | ((this: Graph, data: EdgeData) => EdgeStyle[K]);
34
+ }>;
31
35
  /**
32
36
  * <zh/> 边动画
33
37
  *
@@ -1,6 +1,6 @@
1
1
  import type { AnimationOptions } from '../../animations/types';
2
2
  import type { BaseNodeStyleProps } from '../../elements/nodes';
3
- import type { CallableObject } from '../../types';
3
+ import type { Graph } from '../../runtime/graph';
4
4
  import type { NodeData } from '../data';
5
5
  import type { AnimationStage } from './animation';
6
6
  import type { PaletteOptions } from './palette';
@@ -15,19 +15,23 @@ export interface NodeOptions {
15
15
  *
16
16
  * <en/> Node type
17
17
  */
18
- type?: string | ((datum: NodeData) => string);
18
+ type?: string | ((this: Graph, datum: NodeData) => string);
19
19
  /**
20
20
  * <zh/> 节点样式
21
21
  *
22
22
  * <en/> Node style
23
23
  */
24
- style?: CallableObject<NodeStyle, NodeData>;
24
+ style?: NodeStyle | ((this: Graph, data: NodeData) => NodeStyle) | {
25
+ [K in keyof NodeStyle]: NodeStyle[K] | ((this: Graph, data: NodeData) => NodeStyle[K]);
26
+ };
25
27
  /**
26
28
  * <zh/> 节点状态样式
27
29
  *
28
30
  * <en/> Node state style
29
31
  */
30
- state?: Record<string, CallableObject<NodeStyle, NodeData>>;
32
+ state?: Record<string, NodeStyle | ((this: Graph, data: NodeData) => NodeStyle) | {
33
+ [K in keyof NodeStyle]: NodeStyle[K] | ((this: Graph, data: NodeData) => NodeStyle[K]);
34
+ }>;
31
35
  /**
32
36
  * <zh/> 节点动画
33
37
  *
@@ -1,9 +1,8 @@
1
- import type { BuiltInPluginOptions } from '../plugins/types';
2
- import type { ExtensionOptions } from '../registry/extension/types';
3
- export type PluginOptions = ExtensionOptions<BuiltInPluginOptions>;
1
+ import type { Graph } from '../runtime/graph';
2
+ export type PluginOptions = (string | CustomPluginOption | ((this: Graph) => CustomPluginOption))[];
4
3
  export interface UpdatePluginOption {
5
4
  key: string;
6
- [key: string]: any;
5
+ [key: string]: unknown;
7
6
  }
8
7
  export interface CustomPluginOption extends Record<string, any> {
9
8
  /**
@@ -11,7 +10,7 @@ export interface CustomPluginOption extends Record<string, any> {
11
10
  *
12
11
  * <en/> Plugin type
13
12
  */
14
- type?: string;
13
+ type: string;
15
14
  /**
16
15
  * <zh/> 插件 key,即唯一标识
17
16
  *
@@ -1,12 +1,11 @@
1
- import type { ExtensionOptions } from '../registry/extension/types';
2
- import type { BuiltInTransformOptions } from '../transforms/types';
3
- export type TransformOptions = ExtensionOptions<BuiltInTransformOptions>;
1
+ import type { Graph } from '../runtime/graph';
2
+ export type TransformOptions = (string | CustomTransformOption | ((this: Graph) => CustomTransformOption))[];
4
3
  export interface UpdateTransformOption {
5
4
  key: string;
6
- [key: string]: any;
5
+ [key: string]: unknown;
7
6
  }
8
7
  export interface CustomTransformOption {
9
- type?: string;
8
+ type: string;
10
9
  key?: string;
11
- [key: string]: any;
10
+ [key: string]: unknown;
12
11
  }
@@ -1,7 +1,6 @@
1
1
  import type { ComboData, EdgeData, NodeData } from '../spec';
2
2
  import type { ID } from '../types';
3
- import type { BaseTransform, BaseTransformOptions } from './base-transform';
4
- export type BuiltInTransformOptions = BaseTransformOptions;
3
+ import type { BaseTransform } from './base-transform';
5
4
  export type Transform = BaseTransform<any>;
6
5
  /**
7
6
  * <zh/> 在 Element Controller 中,为了提高查询性能,统一使用 Map 存储数据
@@ -1,6 +1,5 @@
1
1
  export type * from './anchor';
2
2
  export type * from './animation';
3
- export type * from './callable';
4
3
  export type * from './canvas';
5
4
  export type * from './change';
6
5
  export type * from './combo';
@@ -1,3 +1,4 @@
1
+ import type { Graph } from '../runtime/graph';
1
2
  import type { ElementDatum } from './data';
2
3
  /**
3
4
  * <zh/> 样式计算迭代上下文
@@ -6,4 +7,5 @@ import type { ElementDatum } from './data';
6
7
  */
7
8
  export type StyleIterationContext = {
8
9
  datum: ElementDatum;
10
+ graph: Graph;
9
11
  };
@@ -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;
10
- constructor(type: GraphEvent.BEFORE_RENDER | GraphEvent.AFTER_RENDER | GraphEvent.BEFORE_DRAW | GraphEvent.AFTER_DRAW | GraphEvent.BEFORE_LAYOUT | GraphEvent.AFTER_LAYOUT | GraphEvent.BEFORE_SIZE_CHANGE | GraphEvent.AFTER_SIZE_CHANGE | GraphEvent.BATCH_START | GraphEvent.BATCH_END | GraphEvent.BEFORE_DESTROY | GraphEvent.AFTER_DESTROY, data?: any);
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_SIZE_CHANGE | GraphEvent.AFTER_SIZE_CHANGE | GraphEvent.BATCH_START | GraphEvent.BATCH_END | GraphEvent.BEFORE_DESTROY | GraphEvent.AFTER_DESTROY, data?: any | undefined);
11
11
  }
12
12
  export declare class AnimateEvent extends BaseEvent implements IAnimateEvent {
13
13
  animationType: AnimationType;
14
14
  animation: IAnimation | null;
15
- data?: any;
16
- constructor(type: GraphEvent.BEFORE_ANIMATE | GraphEvent.AFTER_ANIMATE, animationType: AnimationType, animation: IAnimation | null, data?: any);
15
+ data?: any | undefined;
16
+ constructor(type: GraphEvent.BEFORE_ANIMATE | GraphEvent.AFTER_ANIMATE, animationType: AnimationType, animation: IAnimation | null, data?: any | undefined);
17
17
  }
18
18
  export declare class ElementLifeCycleEvent extends BaseEvent implements IElementLifeCycleEvent {
19
19
  elementType: ElementType;
@@ -1,10 +1,13 @@
1
- import type { ExtensionOptions, STDExtensionOption } from '../registry/extension/types';
1
+ import type { STDExtensionOption } from '../registry/extension/types';
2
+ import type { Graph } from '../runtime/graph';
3
+ import type { TransformOptions } from '../spec/transform';
2
4
  /**
3
5
  * <zh/> 将模块配置项转换为标准模块格式
4
6
  *
5
7
  * <en/> Convert extension options to standard format
8
+ * @param graph - <zh/> 图实例 <en/> graph instance
6
9
  * @param category - <zh/> 模块类型 <en/> extension type
7
10
  * @param extensions - <zh/> 模块配置项 <en/> extension options
8
11
  * @returns <zh/> 标准模块配置项 <en/> Standard extension options
9
12
  */
10
- export declare function parseExtensions(category: string, extensions: ExtensionOptions): STDExtensionOption[];
13
+ export declare function parseExtensions(graph: Graph, category: string, extensions: TransformOptions): STDExtensionOption[];
@@ -1,5 +1,6 @@
1
1
  import type { DisplayObjectConfig } from '@antv/g';
2
- import type { CallableObject, ElementDatum, StyleIterationContext } from '../types';
2
+ import type { Graph } from '../runtime/graph';
3
+ import type { ElementDatum, StyleIterationContext } from '../types';
3
4
  /**
4
5
  * <zh/> 计算支持回调的动态样式
5
6
  *
@@ -8,7 +9,9 @@ import type { CallableObject, ElementDatum, StyleIterationContext } from '../typ
8
9
  * @param context - <zh/> 样式计算迭代上下文 | <en/> style iteration context
9
10
  * @returns <zh/> 静态样式 | <en/> static style
10
11
  */
11
- export declare function computeElementCallbackStyle(callableStyle: CallableObject<Record<string, unknown>, ElementDatum>, context: StyleIterationContext): {
12
+ export declare function computeElementCallbackStyle(callableStyle: Record<string, unknown> | ((this: Graph, datum: ElementDatum) => Record<string, unknown>) | {
13
+ [key: string]: (this: Graph, datum: ElementDatum) => unknown;
14
+ }, context: StyleIterationContext): {
12
15
  [k: string]: any;
13
16
  };
14
17
  /**
@@ -21,4 +21,4 @@ export declare function replaceTranslateInTransform(x: number, y: number, z: num
21
21
  * @param datum - <zh>数据 | <en>data
22
22
  * @param merge - <zh>是否合并 | <en>whether to merge
23
23
  */
24
- export declare const reassignTo: (input: DrawData, type: 'add' | 'update' | 'remove', elementType: ElementType, datum: ElementDatum, merge?: boolean) => void;
24
+ export declare const reassignTo: (input: DrawData, type: "add" | "update" | "remove", elementType: ElementType, datum: ElementDatum, merge?: boolean) => void;
@@ -0,0 +1 @@
1
+ export declare const version = "5.0.4";
@@ -2,5 +2,5 @@ import { BaseExtension } from '../registry/extension';
2
2
  import type { CustomBehaviorOption } from '../spec/behavior';
3
3
  export interface BaseBehaviorOptions extends CustomBehaviorOption {
4
4
  }
5
- export declare abstract class BaseBehavior<T extends BaseBehaviorOptions> extends BaseExtension<T> {
5
+ export declare abstract class BaseBehavior<T extends BaseBehaviorOptions = BaseBehaviorOptions> extends BaseExtension<T> {
6
6
  }
@@ -1 +1 @@
1
- {"version":3,"file":"base-behavior.js","sourceRoot":"src/","sources":["behaviors/base-behavior.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAKtD,MAAM,OAAgB,YAA4C,SAAQ,aAAgB;CAAG"}
1
+ {"version":3,"file":"base-behavior.js","sourceRoot":"src/","sources":["behaviors/base-behavior.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAKtD,MAAM,OAAgB,YAAkE,SAAQ,aAAgB;CAAG"}
@@ -59,7 +59,7 @@ export interface ScrollCanvasOptions extends BaseBehaviorOptions {
59
59
  * <en/> Scroll canvas behavior
60
60
  */
61
61
  export declare class ScrollCanvas extends BaseBehavior<ScrollCanvasOptions> {
62
- static defaultOptions: ScrollCanvasOptions;
62
+ static defaultOptions: Partial<ScrollCanvasOptions>;
63
63
  private shortcut;
64
64
  constructor(context: RuntimeContext, options: ScrollC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KAAK,CAAC,CAAC;QAC/C,QAAQ,EAAE,EAAE,CAAC;IACf,CAAC;IAEO,QAAQ,CAAC,KAAkC;QACjD,IAAI,IAAI,CAAC,SAAS;YAAE,OAAO,KAAK,CAAC;QAEjC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC;QAChC,IAAI,UAAU,CAAC,MAAM,CAAC;YAAE,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;QAC7C,OAAO,CAAC,CAAC,MAAM,CAAC;IAClB,CAAC;IACD;;;;OAIG;IACI,OAAO;QACZ,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;QACxB,IAAI,CAAC,QAAQ,EAAE,mBAAmB,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACpE,KAAK,CAAC,OAAO,EAAE,CAAC;IAClB,CAAC"}
@@ -1,6 +1,2 @@
1
1
  import type { BaseBehavior } from './base-behavior';
2
- import type { DragCanvasOptions } from './drag-canvas';
3
- import type { ScrollCanvasOptions } from './scroll-canvas';
4
- import type { ZoomCanvasOptions } from './zoom-canvas';
5
- export type BuiltInBehaviorOptions = DragCanvasOptions | ZoomCanvasOptions | ScrollCanvasOptions;
6
2
  export type Behavior = BaseBehavior<any>;
@@ -77,7 +77,7 @@ export declare class ZoomCanvas extends BaseBehavior<ZoomCanvasOptions> {
77
77
  * @param event - <zh/> 事件对象 | <en/> Event object
78
78
  * @param animation - <zh/> 缩放动画配置 | <en/> Zoom animation configuration
79
79
  */
80
- protected zoom: (value: number, event: IWheelEvent | IKeyboardEvent, animation: ZoomCanvasOptions['animation']) => Promise<void>;
80
+ protected zoom: (value: number, event: IWheelEvent | IKeyboardEvent, animation: ZoomCanvasOptions["animation"]) => Promise<void>;
81
81
  protected onReset: () => Promise<void>;
82
82
  /**
83
83
  * <zh/> 验证是否可以缩放
@@ -20,7 +20,7 @@ export interface BadgeStyleProps extends LabelStyleProps {
20
20
  export declare class Badge extends BaseShape<BadgeStyleProps> {
21
21
  static defaultStyleProps: Partial<BadgeStyleProps>;
22
22
  constructor(options: DisplayObjectConfig<BadgeStyleProps>);
23
- protected getBadgeStyle(attributes: Required<BadgeStyleProps>): Omit<Required<BadgeStyleProps>, "x" | "y" | "z" | "zIndex" | "class" | "transform" | "transformOrigin" | "context" | "className">;
23
+ protected getBadgeStyle(attributes: Required<BadgeStyleProps>): Omit<Required<BadgeStyleProps>, "x" | "y" | "z" | "class" | "transform" | "transformOrigin" | "zIndex" | "context" | "className">;
24
24
  render(attributes?: Required<BadgeStyleProps>, container?: Group): void;
25
25
  getGeometryBounds(): import("@antv/g").AABB;
26
26
  }
package/esm/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import './preset';
2
2
  export * from './exports';
3
- export declare const version = "5.0.3";
3
+ export { version } from './version';
4
4
  export declare const iconfont: {
5
5
  css: string;
6
6
  js: string;
package/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import './preset';
2
2
  export * from './exports';
3
- export const version = '5.0.3';
3
+ export { version } from './version';
4
4
  export const iconfont = {
5
5
  css: '//at.alicdn.com/t/a/font_470089_8hnbbf8n4u8.css',
6
6
  js: '//at.alicdn.com/t/a/font_470089_8hnbbf8n4u8.js',
package/esm/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"src/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,CAAC;AAElB,cAAc,WAAW,CAAC;AAE1B,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC;AAC/B,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,GAAG,EAAE,iDAAiD;IACtD,EAAE,EAAE,gDAAgD;CACrD,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"src/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,CAAC;AAElB,cAAc,WAAW,CAAC;AAE1B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,GAAG,EAAE,iDAAiD;IACtD,EAAE,EAAE,gDAAgD;CACrD,CAAC"}
@@ -1,4 +1,3 @@
1
- /// <reference types="src/layouts/hierarchy" />
2
1
  export { compactBox, dendrogram, indented, mindmap } from '@antv/hierarchy';
3
2
  export { AntVDagreLayout, CircularLayout, ComboCombinedLayout, ConcentricLayout, D3ForceLayout, DagreLayout, ForceAtlas2Layout, ForceLayout, FruchtermanLayout, GridLayout, MDSLayout, RadialLayout, RandomLayout, } from '@antv/layout';
4
3
  export { BaseLayout } from './base-layout';
@@ -1 +1 @@
1
- {"version":3,"file":"camera-setting.js","sourceRoot":"src/","sources":["plugins/camera-setting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AA4F3C;;;;GAIG;AACH,MAAM,OAAO,aAAc,SAAQ,UAAgC;IACjE,YAAY,OAAuB,EAAE,OAA6B;QAChE,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;IACD;;;;;;OAMG;IACI,MAAM,CAAC,OAAsC;QAClD,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACzB,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACxB,CAAC;IAEO,UAAU;QAChB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IACvF,CAAC;IAEO,UAAU,GAAG,CAAC,OAAsC,EAAE,EAAE;QAC9D,MAAM,MAAM,GAAG;YACb,UAAU,EAAE,SAAS;YACrB,IAAI,EAAE,SAAS;YACf,GAAG,EAAE,QAAQ;YACb,GAAG,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
3
- export type BuiltInPluginOptions = GridLineOptions;
4
2
  export type Plugin = BasePlugin<any>;