@antv/g6 5.0.0-beta.34 → 5.0.0-beta.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/g6.min.js +2 -2
- package/dist/lib/animations/types.d.ts +3 -4
- package/dist/lib/behaviors/base-behavior.d.ts +2 -1
- package/dist/lib/behaviors/brush-select.d.ts +31 -13
- package/dist/lib/behaviors/click-element.d.ts +28 -5
- package/dist/lib/behaviors/collapse-expand.d.ts +2 -0
- package/dist/lib/behaviors/drag-canvas.d.ts +7 -0
- package/dist/lib/behaviors/drag-element.d.ts +2 -2
- package/dist/lib/behaviors/index.d.ts +2 -0
- package/dist/lib/behaviors/lasso-select.d.ts +2 -1
- package/dist/lib/behaviors/scroll-canvas.d.ts +64 -0
- package/dist/lib/behaviors/types.d.ts +2 -1
- package/dist/lib/behaviors/zoom-canvas.d.ts +1 -1
- package/dist/lib/constants/events/graph.d.ts +5 -1
- package/dist/lib/elements/combos/base-combo.d.ts +1 -1
- package/dist/lib/elements/edges/base-edge.d.ts +0 -5
- package/dist/lib/elements/nodes/base-node.d.ts +1 -7
- package/dist/lib/elements/shapes/badge.d.ts +1 -1
- package/dist/lib/{plugins/hull/shape.d.ts → elements/shapes/contour.d.ts} +17 -17
- package/dist/lib/elements/shapes/index.d.ts +2 -0
- package/dist/lib/exports.d.ts +12 -20
- package/dist/lib/plugins/bubble-sets.d.ts +45 -0
- package/dist/lib/plugins/camera-setting.d.ts +4 -2
- package/dist/lib/plugins/contextmenu.d.ts +1 -0
- package/dist/lib/plugins/grid-line.d.ts +51 -8
- package/dist/lib/plugins/hull/index.d.ts +43 -11
- package/dist/lib/plugins/index.d.ts +4 -0
- package/dist/lib/plugins/timebar.d.ts +225 -0
- package/dist/lib/plugins/tooltip.d.ts +2 -2
- package/dist/lib/registry/index.d.ts +1 -1
- package/dist/lib/runtime/data.d.ts +9 -3
- package/dist/lib/runtime/element.d.ts +3 -7
- package/dist/lib/runtime/graph.d.ts +530 -42
- package/dist/lib/runtime/types.d.ts +3 -3
- package/dist/lib/runtime/viewport.d.ts +2 -2
- package/dist/lib/spec/canvas.d.ts +6 -2
- package/{lib/spec/spec.d.ts → dist/lib/spec/graph.d.ts} +12 -4
- package/dist/lib/spec/index.d.ts +1 -1
- package/dist/lib/spec/theme.d.ts +1 -4
- package/dist/lib/spec/viewport.d.ts +1 -1
- package/dist/lib/themes/types.d.ts +0 -1
- package/dist/lib/transforms/process-parallel-edges.d.ts +1 -1
- package/dist/lib/types/data.d.ts +2 -2
- package/dist/lib/types/viewport.d.ts +4 -4
- package/dist/lib/utils/animation.d.ts +5 -5
- package/dist/lib/utils/data.d.ts +2 -2
- package/dist/lib/utils/element.d.ts +1 -1
- package/dist/lib/utils/event/events.d.ts +1 -1
- package/dist/lib/utils/event/index.d.ts +1 -1
- package/dist/lib/utils/palette.d.ts +1 -1
- package/dist/lib/utils/relation.d.ts +2 -2
- package/dist/lib/utils/visibility.d.ts +1 -1
- package/esm/animations/types.d.ts +3 -4
- package/esm/behaviors/base-behavior.d.ts +2 -1
- package/esm/behaviors/brush-select.d.ts +31 -13
- package/esm/behaviors/brush-select.js +7 -2
- package/esm/behaviors/brush-select.js.map +1 -1
- package/esm/behaviors/click-element.d.ts +28 -5
- package/esm/behaviors/click-element.js +11 -0
- package/esm/behaviors/click-element.js.map +1 -1
- package/esm/behaviors/collapse-expand.d.ts +2 -0
- package/esm/behaviors/collapse-expand.js +2 -2
- package/esm/behaviors/collapse-expand.js.map +1 -1
- package/esm/behaviors/drag-canvas.d.ts +7 -0
- package/esm/behaviors/drag-canvas.js.map +1 -1
- package/esm/behaviors/drag-element.d.ts +2 -2
- package/esm/behaviors/index.d.ts +2 -0
- package/esm/behaviors/index.js +1 -0
- package/esm/behaviors/index.js.map +1 -1
- package/esm/behaviors/lasso-select.d.ts +2 -1
- package/esm/behaviors/lasso-select.js +1 -1
- package/esm/behaviors/lasso-select.js.map +1 -1
- package/esm/behaviors/scroll-canvas.d.ts +64 -0
- package/esm/behaviors/scroll-canvas.js +80 -0
- package/esm/behaviors/scroll-canvas.js.map +1 -0
- package/esm/behaviors/types.d.ts +2 -1
- package/esm/behaviors/zoom-canvas.d.ts +1 -1
- package/esm/constants/events/graph.d.ts +5 -1
- package/esm/constants/events/graph.js +4 -0
- package/esm/constants/events/graph.js.map +1 -1
- package/esm/elements/combos/base-combo.d.ts +1 -1
- package/esm/elements/edges/base-edge.d.ts +0 -5
- package/esm/elements/edges/base-edge.js +1 -2
- package/esm/elements/edges/base-edge.js.map +1 -1
- package/esm/elements/nodes/base-node.d.ts +1 -7
- package/esm/elements/nodes/base-node.js +2 -2
- package/esm/elements/nodes/base-node.js.map +1 -1
- package/esm/elements/shapes/badge.d.ts +1 -1
- package/{lib/plugins/hull/shape.d.ts → esm/elements/shapes/contour.d.ts} +17 -17
- package/esm/{plugins/hull/shape.js → elements/shapes/contour.js} +12 -11
- package/esm/elements/shapes/contour.js.map +1 -0
- package/esm/elements/shapes/index.d.ts +2 -0
- package/esm/elements/shapes/index.js +1 -0
- package/esm/elements/shapes/index.js.map +1 -1
- package/esm/exports.d.ts +12 -20
- package/esm/exports.js +6 -17
- package/esm/exports.js.map +1 -1
- package/esm/plugins/bubble-sets.d.ts +45 -0
- package/esm/plugins/bubble-sets.js +212 -0
- package/esm/plugins/bubble-sets.js.map +1 -0
- package/esm/plugins/camera-setting.d.ts +4 -2
- package/esm/plugins/camera-setting.js.map +1 -1
- package/esm/plugins/contextmenu.d.ts +1 -0
- package/esm/plugins/contextmenu.js +1 -0
- package/esm/plugins/contextmenu.js.map +1 -1
- package/esm/plugins/grid-line.d.ts +51 -8
- package/esm/plugins/grid-line.js.map +1 -1
- package/esm/plugins/history/utils.js +6 -2
- package/esm/plugins/history/utils.js.map +1 -1
- package/esm/plugins/hull/index.d.ts +43 -11
- package/esm/plugins/hull/index.js +46 -16
- package/esm/plugins/hull/index.js.map +1 -1
- package/esm/plugins/index.d.ts +4 -0
- package/esm/plugins/index.js +2 -0
- package/esm/plugins/index.js.map +1 -1
- package/esm/plugins/legend.js +2 -1
- package/esm/plugins/legend.js.map +1 -1
- package/esm/plugins/timebar.d.ts +225 -0
- package/esm/plugins/timebar.js +253 -0
- package/esm/plugins/timebar.js.map +1 -0
- package/esm/plugins/tooltip.d.ts +2 -2
- package/esm/registry/build-in.js +10 -7
- package/esm/registry/build-in.js.map +1 -1
- package/esm/registry/index.d.ts +1 -1
- package/esm/registry/index.js +1 -1
- package/esm/runtime/canvas.js +2 -2
- package/esm/runtime/canvas.js.map +1 -1
- package/esm/runtime/data.d.ts +9 -3
- package/esm/runtime/data.js +20 -3
- package/esm/runtime/data.js.map +1 -1
- package/esm/runtime/element.d.ts +3 -7
- package/esm/runtime/element.js +6 -4
- package/esm/runtime/element.js.map +1 -1
- package/esm/runtime/graph.d.ts +530 -42
- package/esm/runtime/graph.js +409 -33
- package/esm/runtime/graph.js.map +1 -1
- package/esm/runtime/types.d.ts +3 -3
- package/esm/runtime/viewport.d.ts +2 -2
- package/esm/runtime/viewport.js +2 -2
- package/esm/spec/canvas.d.ts +6 -2
- package/{dist/lib/spec/spec.d.ts → esm/spec/graph.d.ts} +12 -4
- package/esm/spec/graph.js +2 -0
- package/esm/spec/graph.js.map +1 -0
- package/esm/spec/index.d.ts +1 -1
- package/esm/spec/theme.d.ts +1 -4
- package/esm/spec/viewport.d.ts +1 -1
- package/esm/themes/base.js +9 -9
- package/esm/themes/base.js.map +1 -1
- package/esm/themes/types.d.ts +0 -1
- package/esm/transforms/process-parallel-edges.d.ts +1 -1
- package/esm/types/data.d.ts +2 -2
- package/esm/types/viewport.d.ts +4 -4
- package/esm/utils/animation.d.ts +5 -5
- package/esm/utils/animation.js +2 -2
- package/esm/utils/animation.js.map +1 -1
- package/esm/utils/change.js +8 -1
- package/esm/utils/change.js.map +1 -1
- package/esm/utils/data.d.ts +2 -2
- package/esm/utils/data.js +2 -2
- package/esm/utils/element.d.ts +1 -1
- package/esm/utils/element.js +2 -2
- package/esm/utils/event/events.d.ts +1 -1
- package/esm/utils/event/events.js.map +1 -1
- package/esm/utils/event/index.d.ts +1 -1
- package/esm/utils/event/index.js +1 -1
- package/esm/utils/palette.d.ts +1 -1
- package/esm/utils/palette.js +1 -1
- package/esm/utils/relation.d.ts +2 -2
- package/esm/utils/relation.js +2 -2
- package/esm/utils/visibility.d.ts +1 -1
- package/esm/utils/visibility.js +1 -1
- package/lib/animations/types.d.ts +3 -4
- package/lib/behaviors/base-behavior.d.ts +2 -1
- package/lib/behaviors/brush-select.d.ts +31 -13
- package/lib/behaviors/brush-select.js +7 -2
- package/lib/behaviors/brush-select.js.map +1 -1
- package/lib/behaviors/click-element.d.ts +28 -5
- package/lib/behaviors/click-element.js +11 -0
- package/lib/behaviors/click-element.js.map +1 -1
- package/lib/behaviors/collapse-expand.d.ts +2 -0
- package/lib/behaviors/collapse-expand.js +2 -2
- package/lib/behaviors/collapse-expand.js.map +1 -1
- package/lib/behaviors/drag-canvas.d.ts +7 -0
- package/lib/behaviors/drag-canvas.js.map +1 -1
- package/lib/behaviors/drag-element.d.ts +2 -2
- package/lib/behaviors/index.d.ts +2 -0
- package/lib/behaviors/index.js +3 -1
- package/lib/behaviors/index.js.map +1 -1
- package/lib/behaviors/lasso-select.d.ts +2 -1
- package/lib/behaviors/lasso-select.js +1 -1
- package/lib/behaviors/lasso-select.js.map +1 -1
- package/lib/behaviors/scroll-canvas.d.ts +64 -0
- package/lib/behaviors/scroll-canvas.js +84 -0
- package/lib/behaviors/scroll-canvas.js.map +1 -0
- package/lib/behaviors/types.d.ts +2 -1
- package/lib/behaviors/zoom-canvas.d.ts +1 -1
- package/lib/constants/events/graph.d.ts +5 -1
- package/lib/constants/events/graph.js +4 -0
- package/lib/constants/events/graph.js.map +1 -1
- package/lib/elements/combos/base-combo.d.ts +1 -1
- package/lib/elements/edges/base-edge.d.ts +0 -5
- package/lib/elements/edges/base-edge.js +1 -2
- package/lib/elements/edges/base-edge.js.map +1 -1
- package/lib/elements/nodes/base-node.d.ts +1 -7
- package/lib/elements/nodes/base-node.js +2 -2
- package/lib/elements/nodes/base-node.js.map +1 -1
- package/lib/elements/shapes/badge.d.ts +1 -1
- package/{esm/plugins/hull/shape.d.ts → lib/elements/shapes/contour.d.ts} +17 -17
- package/lib/{plugins/hull/shape.js → elements/shapes/contour.js} +15 -14
- package/lib/elements/shapes/contour.js.map +1 -0
- package/lib/elements/shapes/index.d.ts +2 -0
- package/lib/elements/shapes/index.js +3 -1
- package/lib/elements/shapes/index.js.map +1 -1
- package/lib/exports.d.ts +12 -20
- package/lib/exports.js +46 -17
- package/lib/exports.js.map +1 -1
- package/lib/plugins/bubble-sets.d.ts +45 -0
- package/lib/plugins/bubble-sets.js +216 -0
- package/lib/plugins/bubble-sets.js.map +1 -0
- package/lib/plugins/camera-setting.d.ts +4 -2
- package/lib/plugins/camera-setting.js.map +1 -1
- package/lib/plugins/contextmenu.d.ts +1 -0
- package/lib/plugins/contextmenu.js +1 -0
- package/lib/plugins/contextmenu.js.map +1 -1
- package/lib/plugins/grid-line.d.ts +51 -8
- package/lib/plugins/grid-line.js.map +1 -1
- package/lib/plugins/history/utils.js +6 -2
- package/lib/plugins/history/utils.js.map +1 -1
- package/lib/plugins/hull/index.d.ts +43 -11
- package/lib/plugins/hull/index.js +46 -16
- package/lib/plugins/hull/index.js.map +1 -1
- package/lib/plugins/index.d.ts +4 -0
- package/lib/plugins/index.js +5 -1
- package/lib/plugins/index.js.map +1 -1
- package/lib/plugins/legend.js +2 -1
- package/lib/plugins/legend.js.map +1 -1
- package/lib/plugins/timebar.d.ts +225 -0
- package/lib/plugins/timebar.js +257 -0
- package/lib/plugins/timebar.js.map +1 -0
- package/lib/plugins/tooltip.d.ts +2 -2
- package/lib/registry/build-in.js +8 -5
- package/lib/registry/build-in.js.map +1 -1
- package/lib/registry/index.d.ts +1 -1
- package/lib/registry/index.js +1 -1
- package/lib/runtime/canvas.js +2 -2
- package/lib/runtime/canvas.js.map +1 -1
- package/lib/runtime/data.d.ts +9 -3
- package/lib/runtime/data.js +20 -3
- package/lib/runtime/data.js.map +1 -1
- package/lib/runtime/element.d.ts +3 -7
- package/lib/runtime/element.js +6 -4
- package/lib/runtime/element.js.map +1 -1
- package/lib/runtime/graph.d.ts +530 -42
- package/lib/runtime/graph.js +409 -33
- package/lib/runtime/graph.js.map +1 -1
- package/lib/runtime/types.d.ts +3 -3
- package/lib/runtime/viewport.d.ts +2 -2
- package/lib/runtime/viewport.js +2 -2
- package/lib/spec/canvas.d.ts +6 -2
- package/{esm/spec/spec.d.ts → lib/spec/graph.d.ts} +12 -4
- package/lib/spec/{spec.js → graph.js} +1 -1
- package/lib/spec/graph.js.map +1 -0
- package/lib/spec/index.d.ts +1 -1
- package/lib/spec/theme.d.ts +1 -4
- package/lib/spec/viewport.d.ts +1 -1
- package/lib/themes/base.js +9 -9
- package/lib/themes/base.js.map +1 -1
- package/lib/themes/types.d.ts +0 -1
- package/lib/transforms/process-parallel-edges.d.ts +1 -1
- package/lib/types/data.d.ts +2 -2
- package/lib/types/viewport.d.ts +4 -4
- package/lib/utils/animation.d.ts +5 -5
- package/lib/utils/animation.js +2 -2
- package/lib/utils/animation.js.map +1 -1
- package/lib/utils/change.js +8 -1
- package/lib/utils/change.js.map +1 -1
- package/lib/utils/data.d.ts +2 -2
- package/lib/utils/data.js +2 -2
- package/lib/utils/element.d.ts +1 -1
- package/lib/utils/element.js +2 -2
- package/lib/utils/event/events.d.ts +1 -1
- package/lib/utils/event/events.js.map +1 -1
- package/lib/utils/event/index.d.ts +1 -1
- package/lib/utils/event/index.js +1 -1
- package/lib/utils/palette.d.ts +1 -1
- package/lib/utils/palette.js +1 -1
- package/lib/utils/relation.d.ts +2 -2
- package/lib/utils/relation.js +2 -2
- package/lib/utils/visibility.d.ts +1 -1
- package/lib/utils/visibility.js +1 -1
- package/package.json +2 -1
- package/src/animations/types.ts +3 -4
- package/src/behaviors/base-behavior.ts +1 -1
- package/src/behaviors/brush-select.ts +33 -14
- package/src/behaviors/click-element.ts +28 -5
- package/src/behaviors/collapse-expand.ts +4 -2
- package/src/behaviors/drag-canvas.ts +7 -0
- package/src/behaviors/drag-element.ts +2 -2
- package/src/behaviors/index.ts +2 -0
- package/src/behaviors/lasso-select.ts +2 -2
- package/src/behaviors/scroll-canvas.ts +143 -0
- package/src/behaviors/types.ts +2 -1
- package/src/behaviors/zoom-canvas.ts +1 -1
- package/src/constants/events/graph.ts +4 -0
- package/src/elements/combos/base-combo.ts +1 -1
- package/src/elements/edges/base-edge.ts +1 -7
- package/src/elements/nodes/base-node.ts +3 -12
- package/src/{plugins/hull/shape.ts → elements/shapes/contour.ts} +27 -34
- package/src/elements/shapes/index.ts +2 -0
- package/src/exports.ts +104 -24
- package/src/plugins/bubble-sets.ts +268 -0
- package/src/plugins/camera-setting.ts +4 -2
- package/src/plugins/contextmenu.ts +1 -0
- package/src/plugins/grid-line.ts +51 -8
- package/src/plugins/history/utils.ts +6 -2
- package/src/plugins/hull/index.ts +57 -20
- package/src/plugins/index.ts +4 -0
- package/src/plugins/legend.ts +3 -1
- package/src/plugins/timebar.ts +450 -0
- package/src/plugins/tooltip.ts +2 -2
- package/src/registry/build-in.ts +21 -6
- package/src/registry/index.ts +1 -1
- package/src/runtime/canvas.ts +2 -2
- package/src/runtime/data.ts +21 -3
- package/src/runtime/element.ts +5 -4
- package/src/runtime/graph.ts +543 -48
- package/src/runtime/types.ts +3 -3
- package/src/runtime/viewport.ts +2 -2
- package/src/spec/canvas.ts +6 -2
- package/src/spec/{spec.ts → graph.ts} +12 -4
- package/src/spec/index.ts +1 -1
- package/src/spec/theme.ts +1 -5
- package/src/spec/viewport.ts +1 -1
- package/src/themes/base.ts +9 -9
- package/src/themes/types.ts +0 -2
- package/src/transforms/process-parallel-edges.ts +1 -1
- package/src/types/data.ts +2 -2
- package/src/types/viewport.ts +4 -4
- package/src/utils/animation.ts +4 -4
- package/src/utils/change.ts +6 -1
- package/src/utils/data.ts +2 -2
- package/src/utils/element.ts +2 -2
- package/src/utils/event/events.ts +3 -1
- package/src/utils/event/index.ts +1 -1
- package/src/utils/palette.ts +1 -1
- package/src/utils/relation.ts +2 -2
- package/src/utils/visibility.ts +1 -1
- package/esm/plugins/hull/shape.js.map +0 -1
- package/esm/spec/spec.js +0 -2
- package/esm/spec/spec.js.map +0 -1
- package/lib/plugins/hull/shape.js.map +0 -1
- package/lib/spec/spec.js.map +0 -1
package/lib/runtime/graph.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import EventEmitter from '@antv/event-emitter';
|
|
2
2
|
import type { AABB, BaseStyleProps } from '@antv/g';
|
|
3
3
|
import type { Plugin } from '../plugins/types';
|
|
4
|
-
import type { BehaviorOptions, ComboData, ComboOptions, EdgeData, EdgeOptions,
|
|
4
|
+
import type { BehaviorOptions, ComboData, ComboOptions, EdgeData, EdgeOptions, GraphData, GraphOptions, LayoutOptions, NodeData, NodeOptions, PluginOptions, ThemeOptions, TransformOptions } from '../spec';
|
|
5
5
|
import type { UpdateBehaviorOption } from '../spec/behavior';
|
|
6
6
|
import type { UpdatePluginOption } from '../spec/plugin';
|
|
7
7
|
import type { UpdateTransformOption } from '../spec/transform';
|
|
@@ -11,46 +11,149 @@ import { Canvas } from './canvas';
|
|
|
11
11
|
import type { HierarchyKey } from './data';
|
|
12
12
|
export declare class Graph extends EventEmitter {
|
|
13
13
|
private options;
|
|
14
|
-
|
|
14
|
+
/**
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
static defaultOptions: GraphOptions;
|
|
18
|
+
/**
|
|
19
|
+
* <zh/> 当前图实例是否已经被销毁
|
|
20
|
+
*
|
|
21
|
+
* <en/> Whether the current graph instance has been destroyed
|
|
22
|
+
*/
|
|
15
23
|
destroyed: boolean;
|
|
16
24
|
private context;
|
|
17
|
-
constructor(options:
|
|
25
|
+
constructor(options: GraphOptions);
|
|
18
26
|
/**
|
|
19
27
|
* <zh/> 获取配置项
|
|
20
28
|
*
|
|
21
29
|
* <en/> Get options
|
|
22
30
|
* @returns <zh/> 配置项 | <en/> options
|
|
31
|
+
* @apiCategory option
|
|
23
32
|
*/
|
|
24
|
-
getOptions():
|
|
33
|
+
getOptions(): GraphOptions;
|
|
25
34
|
/**
|
|
26
35
|
* <zh/> 设置配置项
|
|
27
36
|
*
|
|
28
37
|
* <en/> Set options
|
|
29
38
|
* @param options - <zh/> 配置项 | <en/> options
|
|
30
|
-
* @
|
|
39
|
+
* @remarks
|
|
31
40
|
* <zh/> 要更新 devicePixelRatio、container 属性请销毁后重新创建实例
|
|
32
41
|
*
|
|
33
42
|
* <en/> To update devicePixelRatio and container properties, please destroy and recreate the instance
|
|
43
|
+
* @apiCategory option
|
|
44
|
+
*/
|
|
45
|
+
setOptions(options: GraphOptions): void;
|
|
46
|
+
/**
|
|
47
|
+
* <zh/> 设置画布背景色
|
|
48
|
+
*
|
|
49
|
+
* <en/> Set canvas background color
|
|
50
|
+
* @param background - <zh/> 背景色 | <en/> background color
|
|
51
|
+
* @apiCategory canvas
|
|
52
|
+
*/
|
|
53
|
+
setBackground(background: GraphOptions['background']): void;
|
|
54
|
+
/**
|
|
55
|
+
* <zh/> 获取画布背景色
|
|
56
|
+
*
|
|
57
|
+
* <en/> Get canvas background color
|
|
58
|
+
* @returns <zh/> 背景色 | <en/> background color
|
|
59
|
+
* @apiCategory canvas
|
|
60
|
+
*/
|
|
61
|
+
getBackground(): GraphOptions['background'];
|
|
62
|
+
/**
|
|
63
|
+
* <zh/> 获取当前图容器的大小
|
|
64
|
+
*
|
|
65
|
+
* <en/> Get the size of the current canvas container
|
|
66
|
+
* @returns <zh/> 画布尺寸 | <en/> canvas size
|
|
67
|
+
* @apiCategory canvas
|
|
34
68
|
*/
|
|
35
|
-
setOptions(options: G6Spec): void;
|
|
36
|
-
setBackground(background: G6Spec['background']): void;
|
|
37
|
-
getBackground(): G6Spec['background'];
|
|
38
69
|
getSize(): [number, number];
|
|
70
|
+
/**
|
|
71
|
+
* <zh/> 获取当前图容器的大小
|
|
72
|
+
*
|
|
73
|
+
* <en/> Get the size of the current canvas container
|
|
74
|
+
* @param width - <zh/> 画布宽度 | <en/> canvas width
|
|
75
|
+
* @param height - <zh/> 画布高度 | <en/> canvas height
|
|
76
|
+
* @apiCategory canvas
|
|
77
|
+
*/
|
|
39
78
|
setSize(width: number, height: number): void;
|
|
40
|
-
|
|
41
|
-
|
|
79
|
+
/**
|
|
80
|
+
* <zh/> 获取当前图的缩放区间
|
|
81
|
+
*
|
|
82
|
+
* <en/> Get the zoom range of the current graph
|
|
83
|
+
* @param zoomRange - <zh/> 缩放区间 | <en/> zoom range
|
|
84
|
+
* @apiCategory viewport
|
|
85
|
+
*/
|
|
86
|
+
setZoomRange(zoomRange: GraphOptions['zoomRange']): void;
|
|
87
|
+
/**
|
|
88
|
+
* <zh/> 获取当前图的缩放区间
|
|
89
|
+
*
|
|
90
|
+
* <en/> Get the zoom range of the current graph
|
|
91
|
+
* @returns <zh/> 缩放区间 | <en/> zoom range
|
|
92
|
+
* @apiCategory viewport
|
|
93
|
+
*/
|
|
94
|
+
getZoomRange(): GraphOptions['zoomRange'];
|
|
95
|
+
/**
|
|
96
|
+
* <zh/> 设置节点样式映射
|
|
97
|
+
*
|
|
98
|
+
* <en/> Set node mapper
|
|
99
|
+
* @param node - <zh/> 节点配置 | <en/> node configuration
|
|
100
|
+
* @apiCategory element
|
|
101
|
+
*/
|
|
42
102
|
setNode(node: NodeOptions): void;
|
|
103
|
+
/**
|
|
104
|
+
* <zh/> 设置边样式映射
|
|
105
|
+
*
|
|
106
|
+
* <en/> Set edge mapper
|
|
107
|
+
* @param edge - <zh/> 边配置 | <en/> edge configuration
|
|
108
|
+
* @apiCategory element
|
|
109
|
+
*/
|
|
43
110
|
setEdge(edge: EdgeOptions): void;
|
|
111
|
+
/**
|
|
112
|
+
* <zh/> 设置组合样式映射
|
|
113
|
+
*
|
|
114
|
+
* <en/> Set combo mapper
|
|
115
|
+
* @param combo - <zh/> 组合配置 | <en/> combo configuration
|
|
116
|
+
* @apiCategory element
|
|
117
|
+
*/
|
|
44
118
|
setCombo(combo: ComboOptions): void;
|
|
119
|
+
/**
|
|
120
|
+
* <zh/> 获取主题
|
|
121
|
+
*
|
|
122
|
+
* <en/> Get theme
|
|
123
|
+
* @returns <zh/> 主题配置 | <en/> theme configuration
|
|
124
|
+
* @apiCategory theme
|
|
125
|
+
*/
|
|
45
126
|
getTheme(): ThemeOptions;
|
|
127
|
+
/**
|
|
128
|
+
* <zh/> 设置主题
|
|
129
|
+
*
|
|
130
|
+
* <en/> Set theme
|
|
131
|
+
* @param theme - <zh/> 主题配置 | <en/> theme configuration
|
|
132
|
+
* @apiCategory theme
|
|
133
|
+
*/
|
|
46
134
|
setTheme(theme: CallableValue<ThemeOptions>): void;
|
|
135
|
+
/**
|
|
136
|
+
* <zh/> 设置布局
|
|
137
|
+
*
|
|
138
|
+
* <en/> Set layout
|
|
139
|
+
* @param layout - <zh/> 布局配置 | <en/> layout configuration
|
|
140
|
+
* @apiCategory layout
|
|
141
|
+
*/
|
|
47
142
|
setLayout(layout: CallableValue<LayoutOptions>): void;
|
|
143
|
+
/**
|
|
144
|
+
* <zh/> 获取布局
|
|
145
|
+
*
|
|
146
|
+
* <en/> Get layout
|
|
147
|
+
* @returns <zh/> 布局配置 | <en/> layout configuration
|
|
148
|
+
* @apiCategory layout
|
|
149
|
+
*/
|
|
48
150
|
getLayout(): LayoutOptions;
|
|
49
151
|
/**
|
|
50
152
|
* <zh/> 设置交互
|
|
51
153
|
*
|
|
52
154
|
* <en/> Set behaviors
|
|
53
155
|
* @param behaviors - <zh/> 交互配置 | <en/> behavior configuration
|
|
156
|
+
* @apiCategory behavior
|
|
54
157
|
*/
|
|
55
158
|
setBehaviors(behaviors: CallableValue<BehaviorOptions>): void;
|
|
56
159
|
/**
|
|
@@ -58,6 +161,7 @@ export declare class Graph extends EventEmitter {
|
|
|
58
161
|
*
|
|
59
162
|
* <en/> Update behavior
|
|
60
163
|
* @param behavior - <zh/> 交互配置 | <en/> behavior configuration
|
|
164
|
+
* @apiCategory behavior
|
|
61
165
|
*/
|
|
62
166
|
updateBehavior(behavior: UpdateBehaviorOption): void;
|
|
63
167
|
/**
|
|
@@ -65,6 +169,7 @@ export declare class Graph extends EventEmitter {
|
|
|
65
169
|
*
|
|
66
170
|
* <en/> Get behaviors
|
|
67
171
|
* @returns <zh/> 交互配置 | <en/> behavior configuration
|
|
172
|
+
* @apiCategory behavior
|
|
68
173
|
*/
|
|
69
174
|
getBehaviors(): BehaviorOptions;
|
|
70
175
|
/**
|
|
@@ -72,6 +177,7 @@ export declare class Graph extends EventEmitter {
|
|
|
72
177
|
*
|
|
73
178
|
* <en/> Set plugins
|
|
74
179
|
* @param plugins - <zh/> 插件配置 | <en/> plugin configuration
|
|
180
|
+
* @apiCategory plugin
|
|
75
181
|
*/
|
|
76
182
|
setPlugins(plugins: CallableValue<PluginOptions>): void;
|
|
77
183
|
/**
|
|
@@ -79,6 +185,7 @@ export declare class Graph extends EventEmitter {
|
|
|
79
185
|
*
|
|
80
186
|
* <en/> Update plugin
|
|
81
187
|
* @param plugin - <zh/> 插件配置 | <en/> plugin configuration
|
|
188
|
+
* @apiCategory plugin
|
|
82
189
|
*/
|
|
83
190
|
updatePlugin(plugin: UpdatePluginOption): void;
|
|
84
191
|
/**
|
|
@@ -86,6 +193,7 @@ export declare class Graph extends EventEmitter {
|
|
|
86
193
|
*
|
|
87
194
|
* <en/> Get plugins
|
|
88
195
|
* @returns <zh/> 插件配置 | <en/> plugin configuration
|
|
196
|
+
* @apiCategory plugin
|
|
89
197
|
*/
|
|
90
198
|
getPlugins(): PluginOptions;
|
|
91
199
|
/**
|
|
@@ -94,6 +202,7 @@ export declare class Graph extends EventEmitter {
|
|
|
94
202
|
* <en/> Get plugin instance
|
|
95
203
|
* @param key - <zh/> 插件 key | <en/> plugin key
|
|
96
204
|
* @returns <zh/> 插件实例 | <en/> plugin instance
|
|
205
|
+
* @apiCategory plugin
|
|
97
206
|
*/
|
|
98
207
|
getPluginInstance<T extends Plugin>(key: string): T;
|
|
99
208
|
/**
|
|
@@ -101,6 +210,7 @@ export declare class Graph extends EventEmitter {
|
|
|
101
210
|
*
|
|
102
211
|
* <en/> Set data transforms
|
|
103
212
|
* @param transforms - <zh/> 数据转换配置 | <en/> data transform configuration
|
|
213
|
+
* @apiCategory transform
|
|
104
214
|
*/
|
|
105
215
|
setTransforms(transforms: CallableValue<TransformOptions>): void;
|
|
106
216
|
/**
|
|
@@ -108,6 +218,7 @@ export declare class Graph extends EventEmitter {
|
|
|
108
218
|
*
|
|
109
219
|
* <en/> Update data transform
|
|
110
220
|
* @param transform - <zh/> 数据转换配置 | <en/> data transform configuration
|
|
221
|
+
* @apiCategory transform
|
|
111
222
|
*/
|
|
112
223
|
updateTransform(transform: UpdateTransformOption): void;
|
|
113
224
|
/**
|
|
@@ -115,66 +226,286 @@ export declare class Graph extends EventEmitter {
|
|
|
115
226
|
*
|
|
116
227
|
* <en/> Get data transforms
|
|
117
228
|
* @returns <zh/> 数据转换器实例 | <en/> data transform instance
|
|
229
|
+
* @apiCategory transform
|
|
118
230
|
*/
|
|
119
231
|
getTransforms(): TransformOptions;
|
|
232
|
+
/**
|
|
233
|
+
* <zh/> 获取数据
|
|
234
|
+
*
|
|
235
|
+
* <en/> Get data
|
|
236
|
+
* @returns <zh/> 数据 | <en/> data
|
|
237
|
+
* @apiCategory data
|
|
238
|
+
*/
|
|
120
239
|
getData(): GraphData;
|
|
240
|
+
/**
|
|
241
|
+
* <zh/> 获取所有节点数据
|
|
242
|
+
*
|
|
243
|
+
* <en/> Get all node data
|
|
244
|
+
* @returns <zh/> 节点数据 | <en/> node data
|
|
245
|
+
* @apiCategory data
|
|
246
|
+
*/
|
|
121
247
|
getNodeData(): NodeData[];
|
|
248
|
+
/**
|
|
249
|
+
* <zh/> 获取单个节点数据
|
|
250
|
+
*
|
|
251
|
+
* <en/> Get single node data
|
|
252
|
+
* @param id - <zh/> 节点 ID | <en/> node ID
|
|
253
|
+
* @returns <zh/> 节点数据 | <en/> node data
|
|
254
|
+
* @apiCategory data
|
|
255
|
+
*/
|
|
122
256
|
getNodeData(id: ID): NodeData;
|
|
257
|
+
/**
|
|
258
|
+
* <zh/> 批量获取多个节点数据
|
|
259
|
+
*
|
|
260
|
+
* <en/> Get multiple node data in batch
|
|
261
|
+
* @param ids - <zh/> 节点 ID 数组 | <en/> node ID array
|
|
262
|
+
* @returns <zh/> 节点数据 | <en/> node data
|
|
263
|
+
* @apiCategory data
|
|
264
|
+
*/
|
|
123
265
|
getNodeData(ids: ID[]): NodeData[];
|
|
266
|
+
/**
|
|
267
|
+
* <zh/> 获取所有边数据
|
|
268
|
+
*
|
|
269
|
+
* <en/> Get all edge data
|
|
270
|
+
* @returns <zh/> 边数据 | <en/> edge data
|
|
271
|
+
* @apiCategory data
|
|
272
|
+
*/
|
|
124
273
|
getEdgeData(): EdgeData[];
|
|
274
|
+
/**
|
|
275
|
+
* <zh/> 获取单条边数据
|
|
276
|
+
*
|
|
277
|
+
* <en/> Get single edge data
|
|
278
|
+
* @param id - <zh/> 边 ID | <en/> edge ID
|
|
279
|
+
* @returns <zh/> 边数据 | <en/> edge data
|
|
280
|
+
* @apiCategory data
|
|
281
|
+
*/
|
|
125
282
|
getEdgeData(id: ID): EdgeData;
|
|
283
|
+
/**
|
|
284
|
+
* <zh/> 批量获取多条边数据
|
|
285
|
+
*
|
|
286
|
+
* <en/> Get multiple edge data in batch
|
|
287
|
+
* @param ids - <zh/> 边 ID 数组 | <en/> edge ID array
|
|
288
|
+
* @returns <zh/> 边数据 | <en/> edge data
|
|
289
|
+
* @apiCategory data
|
|
290
|
+
*/
|
|
126
291
|
getEdgeData(ids: ID[]): EdgeData[];
|
|
292
|
+
/**
|
|
293
|
+
* <zh/> 获取所有组合数据
|
|
294
|
+
*
|
|
295
|
+
* <en/> Get all combo data
|
|
296
|
+
* @returns <zh/> 组合数据 | <en/> combo data
|
|
297
|
+
* @apiCategory data
|
|
298
|
+
*/
|
|
127
299
|
getComboData(): ComboData[];
|
|
300
|
+
/**
|
|
301
|
+
* <zh/> 获取单个组合数据
|
|
302
|
+
*
|
|
303
|
+
* <en/> Get single combo data
|
|
304
|
+
* @param id - <zh/> 组合ID | <en/> combo ID
|
|
305
|
+
* @returns <zh/> 组合数据 | <en/> combo data
|
|
306
|
+
* @apiCategory data
|
|
307
|
+
*/
|
|
128
308
|
getComboData(id: ID): ComboData;
|
|
309
|
+
/**
|
|
310
|
+
* <zh/> 批量获取多个组合数据
|
|
311
|
+
*
|
|
312
|
+
* <en/> Get multiple combo data in batch
|
|
313
|
+
* @param ids - <zh/> 组合ID 数组 | <en/> combo ID array
|
|
314
|
+
* @returns <zh/> 组合数据 | <en/> combo data
|
|
315
|
+
* @apiCategory data
|
|
316
|
+
*/
|
|
129
317
|
getComboData(ids: ID[]): ComboData[];
|
|
318
|
+
/**
|
|
319
|
+
* <zh/> 设置全量数据
|
|
320
|
+
*
|
|
321
|
+
* <en/> Set full data
|
|
322
|
+
* @param data - <zh/> 数据 | <en/> data
|
|
323
|
+
* @apiCategory data
|
|
324
|
+
*/
|
|
130
325
|
setData(data: CallableValue<GraphData>): void;
|
|
326
|
+
/**
|
|
327
|
+
* <zh/> 新增元素数据
|
|
328
|
+
*
|
|
329
|
+
* <en/> Add element data
|
|
330
|
+
* @param data - <zh/> 元素数据 | <en/> element data
|
|
331
|
+
* @apiCategory data
|
|
332
|
+
*/
|
|
131
333
|
addData(data: CallableValue<GraphData>): void;
|
|
334
|
+
/**
|
|
335
|
+
* <zh/> 新增节点数据
|
|
336
|
+
*
|
|
337
|
+
* <en/> Add node data
|
|
338
|
+
* @param data - <zh/> 节点数据 | <en/> node data
|
|
339
|
+
* @apiCategory data
|
|
340
|
+
*/
|
|
132
341
|
addNodeData(data: CallableValue<NodeData[]>): void;
|
|
342
|
+
/**
|
|
343
|
+
* <zh/> 新增边数据
|
|
344
|
+
*
|
|
345
|
+
* <en/> Add edge data
|
|
346
|
+
* @param data - <zh/> 边数据 | <en/> edge data
|
|
347
|
+
* @apiCategory data
|
|
348
|
+
*/
|
|
133
349
|
addEdgeData(data: CallableValue<EdgeData[]>): void;
|
|
350
|
+
/**
|
|
351
|
+
* <zh/> 新增组合数据
|
|
352
|
+
*
|
|
353
|
+
* <en/> Add combo data
|
|
354
|
+
* @param data - <zh/> 组合数据 | <en/> combo data
|
|
355
|
+
* @apiCategory data
|
|
356
|
+
*/
|
|
134
357
|
addComboData(data: CallableValue<ComboData[]>): void;
|
|
358
|
+
/**
|
|
359
|
+
* <zh/> 更新元素数据
|
|
360
|
+
*
|
|
361
|
+
* <en/> Update element data
|
|
362
|
+
* @param data - <zh/> 元素数据 | <en/> element data
|
|
363
|
+
* @apiCategory data
|
|
364
|
+
*/
|
|
135
365
|
updateData(data: CallableValue<PartialGraphData>): void;
|
|
366
|
+
/**
|
|
367
|
+
* <zh/> 更新节点数据
|
|
368
|
+
*
|
|
369
|
+
* <en/> Update node data
|
|
370
|
+
* @param data - <zh/> 节点数据 | <en/> node data
|
|
371
|
+
* @apiCategory data
|
|
372
|
+
*/
|
|
136
373
|
updateNodeData(data: CallableValue<PartialNodeLikeData<NodeData>[]>): void;
|
|
374
|
+
/**
|
|
375
|
+
* <zh/> 更新边数据
|
|
376
|
+
*
|
|
377
|
+
* <en/> Update edge data
|
|
378
|
+
* @param data - <zh/> 边数据 | <en/> edge data
|
|
379
|
+
* @apiCategory data
|
|
380
|
+
*/
|
|
137
381
|
updateEdgeData(data: CallableValue<PartialEdgeData<EdgeData>[]>): void;
|
|
382
|
+
/**
|
|
383
|
+
* <zh/> 更新 组合数据
|
|
384
|
+
*
|
|
385
|
+
* <en/> Update combo data
|
|
386
|
+
* @param data - <zh/> 组合数据 | <en/> combo data
|
|
387
|
+
* @apiCategory data
|
|
388
|
+
*/
|
|
138
389
|
updateComboData(data: CallableValue<PartialNodeLikeData<ComboData>[]>): void;
|
|
139
|
-
|
|
390
|
+
/**
|
|
391
|
+
* <zh/> 删除多条元素数据
|
|
392
|
+
*
|
|
393
|
+
* <en/> Remove multiple element data
|
|
394
|
+
* @param ids - <zh/> 元素 ID 数组 | <en/> element ID array
|
|
395
|
+
* @apiCategory data
|
|
396
|
+
*/
|
|
397
|
+
removeData(ids: DataID | ((data: GraphData) => DataID)): void;
|
|
398
|
+
/**
|
|
399
|
+
* <zh/> 删除多条节点数据
|
|
400
|
+
*
|
|
401
|
+
* <en/> Remove multiple node data
|
|
402
|
+
* @param ids - <zh/> 节点 ID 数组 | <en/> node ID array
|
|
403
|
+
* @apiCategory data
|
|
404
|
+
*/
|
|
140
405
|
removeNodeData(ids: ID[] | ((data: NodeData[]) => ID[])): void;
|
|
406
|
+
/**
|
|
407
|
+
* <zh/> 删除多条边数据
|
|
408
|
+
*
|
|
409
|
+
* <en/> Remove multiple edge data
|
|
410
|
+
* @param ids - <zh/> 边 ID 数组 | <en/> edge ID array
|
|
411
|
+
* @apiCategory data
|
|
412
|
+
*/
|
|
141
413
|
removeEdgeData(ids: ID[] | ((data: EdgeData[]) => ID[])): void;
|
|
414
|
+
/**
|
|
415
|
+
* <zh/> 删除多条组合数据
|
|
416
|
+
*
|
|
417
|
+
* <en/> Remove multiple combo data
|
|
418
|
+
* @param ids - <zh/> 组合 ID 数组 | <en/> 组合 ID array
|
|
419
|
+
* @apiCategory data
|
|
420
|
+
*/
|
|
142
421
|
removeComboData(ids: ID[] | ((data: ComboData[]) => ID[])): void;
|
|
422
|
+
/**
|
|
423
|
+
* <zh/> 获取元素类型
|
|
424
|
+
*
|
|
425
|
+
* <en/> Get element type
|
|
426
|
+
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
427
|
+
* @returns <zh/> 元素类型 | <en/> element type
|
|
428
|
+
* @apiCategory element
|
|
429
|
+
*/
|
|
143
430
|
getElementType(id: ID): ElementType;
|
|
431
|
+
/**
|
|
432
|
+
* <zh/> 获取节点或组合相关的边数据
|
|
433
|
+
*
|
|
434
|
+
* <en/> Get the edge data related to the node or combo
|
|
435
|
+
* @param id - <zh/> 节点或组合ID | <en/> node or combo ID
|
|
436
|
+
* @param direction - <zh/> 边的方向 | <en/> edge direction
|
|
437
|
+
* @returns <zh/> 边数据 | <en/> edge data
|
|
438
|
+
* @apiCategory data
|
|
439
|
+
*/
|
|
144
440
|
getRelatedEdgesData(id: ID, direction?: EdgeDirection): EdgeData[];
|
|
441
|
+
/**
|
|
442
|
+
* <zh/> 获取节点或组合的一跳邻居节点数据
|
|
443
|
+
*
|
|
444
|
+
* <en/> Get the one-hop neighbor node data of the node or combo
|
|
445
|
+
* @param id - <zh/> 节点或组合ID | <en/> node or combo ID
|
|
446
|
+
* @returns <zh/> 邻居节点数据 | <en/> neighbor node data
|
|
447
|
+
* @apiCategory data
|
|
448
|
+
*/
|
|
145
449
|
getNeighborNodesData(id: ID): NodeData[];
|
|
146
450
|
/**
|
|
147
|
-
* <zh/>
|
|
451
|
+
* <zh/> 获取节点或组合的祖先元素数据
|
|
148
452
|
*
|
|
149
453
|
* <en/> Get the ancestor element data of the node or combo
|
|
150
|
-
* @param id - <zh/>
|
|
151
|
-
* @param hierarchy - <zh/>
|
|
454
|
+
* @param id - <zh/> 节点或组合ID | <en/> node or combo ID
|
|
455
|
+
* @param hierarchy - <zh/> 指定树图层级关系还是组合层级关系 | <en/> specify tree or combo hierarchy relationship
|
|
152
456
|
* @returns <zh/> 祖先元素数据 | <en/> ancestor element data
|
|
153
|
-
* @
|
|
457
|
+
* @remarks
|
|
154
458
|
* <zh/> 数组中的顺序是从父节点到祖先节点
|
|
155
459
|
*
|
|
156
460
|
* <en/> The order in the array is from the parent node to the ancestor node
|
|
461
|
+
* @apiCategory data
|
|
157
462
|
*/
|
|
158
463
|
getAncestorsData(id: ID, hierarchy: HierarchyKey): NodeLikeData[];
|
|
159
464
|
/**
|
|
160
|
-
* <zh/>
|
|
465
|
+
* <zh/> 获取节点或组合的父元素数据
|
|
161
466
|
*
|
|
162
467
|
* <en/> Get the parent element data of the node or combo
|
|
163
|
-
* @param id - <zh/>
|
|
164
|
-
* @param hierarchy - <zh/>
|
|
468
|
+
* @param id - <zh/> 节点或组合ID | <en/> node or combo ID
|
|
469
|
+
* @param hierarchy - <zh/> 指定树图层级关系还是组合层级关系 | <en/> specify tree or combo hierarchy relationship
|
|
165
470
|
* @returns <zh/> 父元素数据 | <en/> parent element data
|
|
471
|
+
* @apiCategory data
|
|
166
472
|
*/
|
|
167
473
|
getParentData(id: ID, hierarchy: HierarchyKey): NodeLikeData | undefined;
|
|
168
474
|
/**
|
|
169
|
-
* <zh/>
|
|
475
|
+
* <zh/> 获取节点或组合的子元素数据
|
|
170
476
|
*
|
|
171
477
|
* <en/> Get the child element data of the node or combo
|
|
172
|
-
* @param id - <zh/>
|
|
478
|
+
* @param id - <zh/> 节点或组合ID | <en/> node or combo ID
|
|
173
479
|
* @returns <zh/> 子元素数据 | <en/> child element data
|
|
480
|
+
* @apiCategory data
|
|
174
481
|
*/
|
|
175
482
|
getChildrenData(id: ID): NodeLikeData[];
|
|
483
|
+
/**
|
|
484
|
+
* <zh/> 获取具体某一状态下的节点数据
|
|
485
|
+
*
|
|
486
|
+
* <en/> Get node data in a specific state
|
|
487
|
+
* @param state - <zh/> 状态 | <en/> state
|
|
488
|
+
* @returns <zh/> 节点数据 | <en/> node data
|
|
489
|
+
* @apiCategory data
|
|
490
|
+
*/
|
|
176
491
|
getElementDataByState(elementType: 'node', state: State): NodeData[];
|
|
492
|
+
/**
|
|
493
|
+
* <zh/> 获取具体某一状态下的边数据
|
|
494
|
+
*
|
|
495
|
+
* <en/> Get edge data in a specific state
|
|
496
|
+
* @param state - <zh/> 状态 | <en/> state
|
|
497
|
+
* @returns <zh/> 边数据 | <en/> edge data
|
|
498
|
+
* @apiCategory data
|
|
499
|
+
*/
|
|
177
500
|
getElementDataByState(elementType: 'edge', state: State): EdgeData[];
|
|
501
|
+
/**
|
|
502
|
+
* <zh/> 获取具体某一状态下的组合数据
|
|
503
|
+
*
|
|
504
|
+
* <en/> Get combo data in a specific state
|
|
505
|
+
* @param state - <zh/> 状态 | <en/> state
|
|
506
|
+
* @returns <zh/> 组合数据 | <en/> combo data
|
|
507
|
+
* @apiCategory data
|
|
508
|
+
*/
|
|
178
509
|
getElementDataByState(elementType: 'combo', state: State): ComboData[];
|
|
179
510
|
private initCanvas;
|
|
180
511
|
private initRuntime;
|
|
@@ -183,10 +514,11 @@ export declare class Graph extends EventEmitter {
|
|
|
183
514
|
* <zh/> 执行渲染
|
|
184
515
|
*
|
|
185
516
|
* <en/> Render
|
|
186
|
-
* @
|
|
517
|
+
* @remarks
|
|
187
518
|
* <zh/> 此过程会执行数据更新、绘制元素、执行布局
|
|
188
519
|
*
|
|
189
520
|
* <en/> This process will execute data update, element rendering, and layout execution
|
|
521
|
+
* @apiCategory render
|
|
190
522
|
*/
|
|
191
523
|
render(): Promise<void>;
|
|
192
524
|
/**
|
|
@@ -194,19 +526,64 @@ export declare class Graph extends EventEmitter {
|
|
|
194
526
|
*
|
|
195
527
|
* <en/> Draw elements
|
|
196
528
|
* @returns <zh/> 渲染结果 | <en/> draw result
|
|
529
|
+
* @apiCategory element
|
|
197
530
|
*/
|
|
198
531
|
draw(): Promise<void>;
|
|
199
|
-
|
|
532
|
+
/**
|
|
533
|
+
* <zh/> 执行布局
|
|
534
|
+
*
|
|
535
|
+
* <en/> Execute layout
|
|
536
|
+
* @apiCategory layout
|
|
537
|
+
*/
|
|
538
|
+
layout(): void;
|
|
539
|
+
/**
|
|
540
|
+
* <zh/> 停止布局
|
|
541
|
+
*
|
|
542
|
+
* <en/> Stop layout
|
|
543
|
+
* @remarks
|
|
544
|
+
* <zh/> 适用于带有迭代动画的布局,目前有 `force` 属于此类布局,即停止力导布局的迭代,一般用于布局迭代时间过长情况下的手动停止迭代动画,例如在点击画布/节点的监听中调用
|
|
545
|
+
*
|
|
546
|
+
* <en/> Suitable for layouts with iterative animations. Currently, `force` belongs to this type of layout, that is, stop the iteration of the force-directed layout. It is generally used to manually stop the iteration animation when the layout iteration time is too long, such as calling in the click canvas/node listener
|
|
547
|
+
* @apiCategory layout
|
|
548
|
+
*/
|
|
200
549
|
stopLayout(): void;
|
|
201
550
|
/**
|
|
202
551
|
* <zh/> 清空画布元素
|
|
203
552
|
*
|
|
204
553
|
* <en/> Clear canvas elements
|
|
554
|
+
* @apiCategory canvas
|
|
205
555
|
*/
|
|
206
556
|
clear(): Promise<void>;
|
|
557
|
+
/**
|
|
558
|
+
* <zh/> 销毁当前图实例
|
|
559
|
+
*
|
|
560
|
+
* <en/> Destroy the current graph instance
|
|
561
|
+
* @apiCategory instance
|
|
562
|
+
*/
|
|
207
563
|
destroy(): void;
|
|
564
|
+
/**
|
|
565
|
+
* <zh/> 获取画布实例
|
|
566
|
+
*
|
|
567
|
+
* <en/> Get canvas instance
|
|
568
|
+
* @returns - <zh/> 画布实例 | <en/> canvas instance
|
|
569
|
+
* @apiCategory canvas
|
|
570
|
+
*/
|
|
208
571
|
getCanvas(): Canvas;
|
|
572
|
+
/**
|
|
573
|
+
* <zh/> 调整画布大小为图容器大小
|
|
574
|
+
*
|
|
575
|
+
* <en/> Resize the canvas to the size of the graph container
|
|
576
|
+
* @apiCategory viewport
|
|
577
|
+
*/
|
|
209
578
|
resize(): void;
|
|
579
|
+
/**
|
|
580
|
+
* <zh/> 调整画布大小为指定宽高
|
|
581
|
+
*
|
|
582
|
+
* <en/> Resize the canvas to the specified width and height
|
|
583
|
+
* @param width - <zh/> 宽度 | <en/> width
|
|
584
|
+
* @param height - <zh/> 高度 | <en/> height
|
|
585
|
+
* @apiCategory viewport
|
|
586
|
+
*/
|
|
210
587
|
resize(width: number, height: number): void;
|
|
211
588
|
/**
|
|
212
589
|
* <zh/> 将图缩放至合适大小并平移至视口中心
|
|
@@ -214,6 +591,7 @@ export declare class Graph extends EventEmitter {
|
|
|
214
591
|
* <en/> Zoom the graph to fit the viewport and move it to the center of the viewport
|
|
215
592
|
* @param options - <zh/> 适配配置 | <en/> fit options
|
|
216
593
|
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
594
|
+
* @apiCategory viewport
|
|
217
595
|
*/
|
|
218
596
|
fitView(options?: FitViewOptions, animation?: ViewportAnimationEffectTiming): Promise<void>;
|
|
219
597
|
/**
|
|
@@ -221,9 +599,18 @@ export declare class Graph extends EventEmitter {
|
|
|
221
599
|
*
|
|
222
600
|
* <en/> Move the graph to the center of the viewport
|
|
223
601
|
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
602
|
+
* @apiCategory viewport
|
|
224
603
|
*/
|
|
225
604
|
fitCenter(animation?: ViewportAnimationEffectTiming): Promise<void>;
|
|
226
605
|
private autoFit;
|
|
606
|
+
/**
|
|
607
|
+
* <zh/> 移动图,使得元素对齐到视口中心
|
|
608
|
+
*
|
|
609
|
+
* <en/> Move the graph so that the element is aligned to the center of the viewport
|
|
610
|
+
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
611
|
+
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
612
|
+
* @apiCategory viewport
|
|
613
|
+
*/
|
|
227
614
|
focusElement(id: ID | ID[], animation?: ViewportAnimationEffectTiming): Promise<void>;
|
|
228
615
|
/**
|
|
229
616
|
* <zh/> 基于当前缩放比例进行缩放
|
|
@@ -232,13 +619,15 @@ export declare class Graph extends EventEmitter {
|
|
|
232
619
|
* @param ratio - <zh/> 缩放比例 | <en/> zoom ratio
|
|
233
620
|
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
234
621
|
* @param origin - <zh/> 缩放中心(视口坐标) | <en/> zoom center(viewport coordinates)
|
|
235
|
-
* @
|
|
622
|
+
* @remarks
|
|
236
623
|
* <zh/>
|
|
237
624
|
* - ratio > 1 放大
|
|
238
625
|
* - ratio < 1 缩小
|
|
626
|
+
*
|
|
239
627
|
* <en/>
|
|
240
628
|
* - ratio > 1 zoom in
|
|
241
629
|
* - ratio < 1 zoom out
|
|
630
|
+
* @apiCategory viewport
|
|
242
631
|
*/
|
|
243
632
|
zoomBy(ratio: number, animation?: ViewportAnimationEffectTiming, origin?: Point): Promise<void>;
|
|
244
633
|
/**
|
|
@@ -248,15 +637,17 @@ export declare class Graph extends EventEmitter {
|
|
|
248
637
|
* @param zoom - <zh/> 指定缩放比例 | <en/> specified zoom ratio
|
|
249
638
|
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
250
639
|
* @param origin - <zh/> 缩放中心(视口坐标) | <en/> zoom center(viewport coordinates)
|
|
251
|
-
* @
|
|
640
|
+
* @remarks
|
|
252
641
|
* <zh/>
|
|
253
642
|
* - zoom = 1 默认大小
|
|
254
643
|
* - zoom > 1 放大
|
|
255
644
|
* - zoom < 1 缩小
|
|
645
|
+
*
|
|
256
646
|
* <en/>
|
|
257
647
|
* - zoom = 1 default size
|
|
258
648
|
* - zoom > 1 zoom in
|
|
259
649
|
* - zoom < 1 zoom out
|
|
650
|
+
* @apiCategory viewport
|
|
260
651
|
*/
|
|
261
652
|
zoomTo(zoom: number, animation?: ViewportAnimationEffectTiming, origin?: Point): Promise<void>;
|
|
262
653
|
/**
|
|
@@ -264,6 +655,7 @@ export declare class Graph extends EventEmitter {
|
|
|
264
655
|
*
|
|
265
656
|
* <en/> Get the current zoom ratio
|
|
266
657
|
* @returns <zh/> 缩放比例 | <en/> zoom ratio
|
|
658
|
+
* @apiCategory viewport
|
|
267
659
|
*/
|
|
268
660
|
getZoom(): number;
|
|
269
661
|
/**
|
|
@@ -273,6 +665,7 @@ export declare class Graph extends EventEmitter {
|
|
|
273
665
|
* @param angle - <zh/> 旋转角度 | <en/> rotation angle
|
|
274
666
|
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
275
667
|
* @param origin - <zh/> 旋转中心(视口坐标) | <en/> rotation center(viewport coordinates)
|
|
668
|
+
* @apiCategory viewport
|
|
276
669
|
*/
|
|
277
670
|
rotateBy(angle: number, animation?: ViewportAnimationEffectTiming, origin?: Point): Promise<void>;
|
|
278
671
|
/**
|
|
@@ -282,6 +675,7 @@ export declare class Graph extends EventEmitter {
|
|
|
282
675
|
* @param angle - <zh/> 目标角度 | <en/> target angle
|
|
283
676
|
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
284
677
|
* @param origin - <zh/> 旋转中心(视口坐标) | <en/> rotation center(viewport coordinates)
|
|
678
|
+
* @apiCategory viewport
|
|
285
679
|
*/
|
|
286
680
|
rotateTo(angle: number, animation?: ViewportAnimationEffectTiming, origin?: Point): Promise<void>;
|
|
287
681
|
/**
|
|
@@ -289,6 +683,7 @@ export declare class Graph extends EventEmitter {
|
|
|
289
683
|
*
|
|
290
684
|
* <en/> Get the current rotation angle
|
|
291
685
|
* @returns <zh/> 旋转角度 | <en/> rotation angle
|
|
686
|
+
* @apiCategory viewport
|
|
292
687
|
*/
|
|
293
688
|
getRotation(): number;
|
|
294
689
|
/**
|
|
@@ -297,6 +692,7 @@ export declare class Graph extends EventEmitter {
|
|
|
297
692
|
* <en/> Translate the graph by the specified distance
|
|
298
693
|
* @param offset - <zh/> 偏移量 | <en/> offset
|
|
299
694
|
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
695
|
+
* @apiCategory viewport
|
|
300
696
|
*/
|
|
301
697
|
translateBy(offset: Point, animation?: ViewportAnimationEffectTiming): Promise<void>;
|
|
302
698
|
/**
|
|
@@ -305,7 +701,7 @@ export declare class Graph extends EventEmitter {
|
|
|
305
701
|
* <en/> Translate the graph to the specified position
|
|
306
702
|
* @param position - <zh/> 指定位置 | <en/> specified position
|
|
307
703
|
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
308
|
-
* @
|
|
704
|
+
* @apiCategory viewport
|
|
309
705
|
*/
|
|
310
706
|
translateTo(position: Point, animation?: ViewportAnimationEffectTiming): Promise<void>;
|
|
311
707
|
/**
|
|
@@ -313,10 +709,11 @@ export declare class Graph extends EventEmitter {
|
|
|
313
709
|
*
|
|
314
710
|
* <en/> Get the position of the graph
|
|
315
711
|
* @returns <zh/> 图的位置 | <en/> position of the graph
|
|
316
|
-
* @
|
|
712
|
+
* @remarks
|
|
317
713
|
* <zh/> 默认状态下,图的位置为 [0, 0]
|
|
318
714
|
*
|
|
319
715
|
* <en/> By default, the position of the graph is [0, 0]
|
|
716
|
+
* @apiCategory viewport
|
|
320
717
|
*/
|
|
321
718
|
getPosition(): Point;
|
|
322
719
|
/**
|
|
@@ -325,7 +722,8 @@ export declare class Graph extends EventEmitter {
|
|
|
325
722
|
* <en/> Translate the element by the specified distance
|
|
326
723
|
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
327
724
|
* @param offset - <zh/> 偏移量 | <en/> offset
|
|
328
|
-
* @param animation - <zh/>
|
|
725
|
+
* @param animation - <zh/> 是否启用动画 | <en/> whether to enable animation
|
|
726
|
+
* @apiCategory element
|
|
329
727
|
*/
|
|
330
728
|
translateElementBy(id: ID, offset: Position, animation?: boolean): Promise<void>;
|
|
331
729
|
/**
|
|
@@ -333,7 +731,8 @@ export declare class Graph extends EventEmitter {
|
|
|
333
731
|
*
|
|
334
732
|
* <en/> Batch translate elements by the specified distance
|
|
335
733
|
* @param offsets - <zh/> 偏移量配置 | <en/> offset configuration
|
|
336
|
-
* @param animation - <zh/>
|
|
734
|
+
* @param animation - <zh/> 是否启用动画 | <en/> whether to enable animation
|
|
735
|
+
* @apiCategory element
|
|
337
736
|
*/
|
|
338
737
|
translateElementBy(offsets: Record<ID, Position>, animation?: boolean): Promise<void>;
|
|
339
738
|
/**
|
|
@@ -342,7 +741,8 @@ export declare class Graph extends EventEmitter {
|
|
|
342
741
|
* <en/> Translate the element to the specified position
|
|
343
742
|
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
344
743
|
* @param position - <zh/> 指定位置 | <en/> specified position
|
|
345
|
-
* @param animation - <zh/>
|
|
744
|
+
* @param animation - <zh/> 是否启用动画 | <en/> whether to enable animation
|
|
745
|
+
* @apiCategory element
|
|
346
746
|
*/
|
|
347
747
|
translateElementTo(id: ID, position: Position, animation?: boolean): Promise<void>;
|
|
348
748
|
/**
|
|
@@ -350,10 +750,27 @@ export declare class Graph extends EventEmitter {
|
|
|
350
750
|
*
|
|
351
751
|
* <en/> Batch translate elements to the specified position
|
|
352
752
|
* @param positions - <zh/> 位置配置 | <en/> position configuration
|
|
353
|
-
* @param animation - <zh/>
|
|
753
|
+
* @param animation - <zh/> 是否启用动画 | <en/> whether to enable animation
|
|
754
|
+
* @apiCategory element
|
|
354
755
|
*/
|
|
355
756
|
translateElementTo(positions: Record<ID, Position>, animation?: boolean): Promise<void>;
|
|
757
|
+
/**
|
|
758
|
+
* <zh/> 获取元素位置
|
|
759
|
+
*
|
|
760
|
+
* <en/> Get element position
|
|
761
|
+
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
762
|
+
* @returns <zh/> 元素位置 | <en/> element position
|
|
763
|
+
* @apiCategory element
|
|
764
|
+
*/
|
|
356
765
|
getElementPosition(id: ID): Position;
|
|
766
|
+
/**
|
|
767
|
+
* <zh/> 获取元素渲染样式
|
|
768
|
+
*
|
|
769
|
+
* <en/> Get element rendering style
|
|
770
|
+
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
771
|
+
* @returns <zh/> 元素渲染样式 | <en/> element rendering style
|
|
772
|
+
* @apiCategory element
|
|
773
|
+
*/
|
|
357
774
|
getElementRenderStyle(id: ID): import("@antv/util/lib/lodash/types").ObjectType<unknown>;
|
|
358
775
|
/**
|
|
359
776
|
* <zh/> 设置元素可见性
|
|
@@ -362,6 +779,7 @@ export declare class Graph extends EventEmitter {
|
|
|
362
779
|
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
363
780
|
* @param visibility - <zh/> 可见性 | <en/> visibility
|
|
364
781
|
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
782
|
+
* @apiCategory element
|
|
365
783
|
*/
|
|
366
784
|
setElementVisibility(id: ID, visibility: BaseStyleProps['visibility'], animation?: boolean): Promise<void>;
|
|
367
785
|
/**
|
|
@@ -370,6 +788,7 @@ export declare class Graph extends EventEmitter {
|
|
|
370
788
|
* <en/> Batch set element visibility
|
|
371
789
|
* @param visibility - <zh/> 可见性配置 | <en/> visibility configuration
|
|
372
790
|
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
791
|
+
* @apiCategory element
|
|
373
792
|
*/
|
|
374
793
|
setElementVisibility(visibility: Record<ID, BaseStyleProps['visibility']>, animation?: boolean): Promise<void>;
|
|
375
794
|
/**
|
|
@@ -377,7 +796,8 @@ export declare class Graph extends EventEmitter {
|
|
|
377
796
|
*
|
|
378
797
|
* <en/> Show element
|
|
379
798
|
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
380
|
-
* @param animation - <zh/>
|
|
799
|
+
* @param animation - <zh/> 是否启用动画 | <en/> whether to enable animation
|
|
800
|
+
* @apiCategory element
|
|
381
801
|
*/
|
|
382
802
|
showElement(id: ID | ID[], animation?: boolean): Promise<void>;
|
|
383
803
|
/**
|
|
@@ -385,7 +805,8 @@ export declare class Graph extends EventEmitter {
|
|
|
385
805
|
*
|
|
386
806
|
* <en/> Hide element
|
|
387
807
|
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
388
|
-
* @param animation - <zh/>
|
|
808
|
+
* @param animation - <zh/> 是否启用动画 | <en/> whether to enable animation
|
|
809
|
+
* @apiCategory element
|
|
389
810
|
*/
|
|
390
811
|
hideElement(id: ID | ID[], animation?: boolean): Promise<void>;
|
|
391
812
|
/**
|
|
@@ -394,6 +815,7 @@ export declare class Graph extends EventEmitter {
|
|
|
394
815
|
* <en/> Get element visibility
|
|
395
816
|
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
396
817
|
* @returns <zh/> 元素可见性 | <en/> element visibility
|
|
818
|
+
* @apiCategory element
|
|
397
819
|
*/
|
|
398
820
|
getElementVisibility(id: ID): BaseStyleProps['visibility'];
|
|
399
821
|
/**
|
|
@@ -402,6 +824,7 @@ export declare class Graph extends EventEmitter {
|
|
|
402
824
|
* <en/> Set element z-index
|
|
403
825
|
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
404
826
|
* @param zIndex - <zh/> 层级 | <en/> z-index
|
|
827
|
+
* @apiCategory element
|
|
405
828
|
*/
|
|
406
829
|
setElementZIndex(id: ID, zIndex: number): Promise<void>;
|
|
407
830
|
/**
|
|
@@ -409,6 +832,7 @@ export declare class Graph extends EventEmitter {
|
|
|
409
832
|
*
|
|
410
833
|
* <en/> Batch set element z-index
|
|
411
834
|
* @param zIndex - <zh/> 层级配置 | <en/> z-index configuration
|
|
835
|
+
* @apiCategory element
|
|
412
836
|
*/
|
|
413
837
|
setElementZIndex(zIndex: Record<ID, number>): Promise<void>;
|
|
414
838
|
/**
|
|
@@ -416,6 +840,7 @@ export declare class Graph extends EventEmitter {
|
|
|
416
840
|
*
|
|
417
841
|
* <en/> Bring the element to the front
|
|
418
842
|
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
843
|
+
* @apiCategory element
|
|
419
844
|
*/
|
|
420
845
|
frontElement(id: ID | ID[]): Promise<void>;
|
|
421
846
|
/**
|
|
@@ -424,6 +849,7 @@ export declare class Graph extends EventEmitter {
|
|
|
424
849
|
* <en/> Get element z-index
|
|
425
850
|
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
426
851
|
* @returns <zh/> 元素层级 | <en/> element z-index
|
|
852
|
+
* @apiCategory element
|
|
427
853
|
*/
|
|
428
854
|
getElementZIndex(id: ID): number;
|
|
429
855
|
/**
|
|
@@ -433,6 +859,7 @@ export declare class Graph extends EventEmitter {
|
|
|
433
859
|
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
434
860
|
* @param state - <zh/> 状态 | <en/> state
|
|
435
861
|
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
862
|
+
* @apiCategory element
|
|
436
863
|
*/
|
|
437
864
|
setElementState(id: ID, state: State | State[], animation?: boolean): Promise<void>;
|
|
438
865
|
/**
|
|
@@ -441,6 +868,7 @@ export declare class Graph extends EventEmitter {
|
|
|
441
868
|
* <en/> Batch set element state
|
|
442
869
|
* @param state - <zh/> 状态配置 | <en/> state configuration
|
|
443
870
|
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
871
|
+
* @apiCategory element
|
|
444
872
|
*/
|
|
445
873
|
setElementState(state: Record<ID, State | State[]>, animation?: boolean): Promise<void>;
|
|
446
874
|
/**
|
|
@@ -449,39 +877,97 @@ export declare class Graph extends EventEmitter {
|
|
|
449
877
|
* <en/> Get element state
|
|
450
878
|
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
451
879
|
* @returns <zh/> 元素状态 | <en/> element state
|
|
880
|
+
* @apiCategory element
|
|
452
881
|
*/
|
|
453
882
|
getElementState(id: ID): State[];
|
|
883
|
+
/**
|
|
884
|
+
* <zh/> 获取元素自身以及子节点在世界坐标系下的渲染包围盒
|
|
885
|
+
*
|
|
886
|
+
* <en/> Get the rendering bounding box of the element itself and its child nodes in the world coordinate system
|
|
887
|
+
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
888
|
+
* @returns <zh/> 渲染包围盒 | <en/> render bounding box
|
|
889
|
+
* @apiCategory element
|
|
890
|
+
*/
|
|
454
891
|
getElementRenderBounds(id: ID): AABB;
|
|
455
|
-
|
|
456
|
-
|
|
892
|
+
/**
|
|
893
|
+
* <zh/> 收起 Combo
|
|
894
|
+
*
|
|
895
|
+
* <en/> Collapse Combo
|
|
896
|
+
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
897
|
+
* @param animation - <zh/> 是否启用动画 | <en/> whether to enable animation
|
|
898
|
+
* @apiCategory element
|
|
899
|
+
*/
|
|
900
|
+
collapseElement(id: ID, animation?: boolean): Promise<void>;
|
|
901
|
+
/**
|
|
902
|
+
* <zh/> 展开 Combo
|
|
903
|
+
*
|
|
904
|
+
* <en/> Expand Combo
|
|
905
|
+
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
906
|
+
* @param animation - <zh/> 是否启用动画 | <en/> whether to enable animation
|
|
907
|
+
* @apiCategory element
|
|
908
|
+
*/
|
|
909
|
+
expandElement(id: ID, animation?: boolean): Promise<void>;
|
|
457
910
|
private setElementCollapsibility;
|
|
458
911
|
/**
|
|
459
912
|
* <zh/> 导出画布内容为 DataURL
|
|
460
913
|
*
|
|
461
914
|
* <en/> Export canvas content as DataURL
|
|
462
915
|
* @param options - <zh/> 导出配置 | <en/> export configuration
|
|
463
|
-
* @param mode
|
|
464
|
-
* <zh/> 导出模式
|
|
465
|
-
* - viewport: 导出视口内容
|
|
466
|
-
* - overall: 导出整个画布
|
|
467
|
-
*
|
|
468
|
-
* <en/> export mode
|
|
469
|
-
* - viewport: export the content of the viewport
|
|
470
|
-
* - overall: export the entire canvas
|
|
471
916
|
* @returns <zh/> DataURL | <en/> DataURL
|
|
917
|
+
* @apiCategory exportImage
|
|
472
918
|
*/
|
|
473
919
|
toDataURL(options?: Partial<DataURLOptions>): Promise<string>;
|
|
920
|
+
/**
|
|
921
|
+
* <zh/> 给定的视窗 DOM 坐标,转换为画布上的绘制坐标
|
|
922
|
+
*
|
|
923
|
+
* <en/> Convert the given viewport DOM coordinates to the drawing coordinates on the canvas
|
|
924
|
+
* @param point - <zh/> 视窗坐标 | <en/> viewport coordinates
|
|
925
|
+
* @returns <zh/> 画布上的绘制坐标 | <en/> drawing coordinates on the canvas
|
|
926
|
+
* @apiCategory viewport
|
|
927
|
+
*/
|
|
474
928
|
getCanvasByViewport(point: Point): Point;
|
|
929
|
+
/**
|
|
930
|
+
* <zh/> 给定画布上的绘制坐标,转换为视窗 DOM 的坐标
|
|
931
|
+
*
|
|
932
|
+
* <en/> Convert the given drawing coordinates on the canvas to the coordinates of the viewport DOM
|
|
933
|
+
* @param point - <zh/> 画布坐标 | <en/> canvas coordinates
|
|
934
|
+
* @returns <zh/> 视窗 DOM 的坐标 | <en/> coordinates of the viewport DOM
|
|
935
|
+
* @apiCategory viewport
|
|
936
|
+
*/
|
|
475
937
|
getViewportByCanvas(point: Point): Point;
|
|
938
|
+
/**
|
|
939
|
+
* <zh/> 给定画布上的绘制坐标,转换为浏览器坐标
|
|
940
|
+
*
|
|
941
|
+
* <en/> Convert the given drawing coordinates on the canvas to browser coordinates
|
|
942
|
+
* @param point - <zh/> 画布坐标 | <en/> canvas coordinates
|
|
943
|
+
* @returns <zh/> 浏览器坐标 | <en/> browser coordinates
|
|
944
|
+
* @apiCategory viewport
|
|
945
|
+
*/
|
|
476
946
|
getClientByCanvas(point: Point): Point;
|
|
947
|
+
/**
|
|
948
|
+
* <zh/> 给定的浏览器坐标,转换为画布上的绘制坐标
|
|
949
|
+
*
|
|
950
|
+
* <en/> Convert the given browser coordinates to drawing coordinates on the canvas
|
|
951
|
+
* @param point - <zh/> 浏览器坐标 | <en/> browser coordinates
|
|
952
|
+
* @returns <zh/> 画布上的绘制坐标 | <en/> drawing coordinates on the canvas
|
|
953
|
+
* @apiCategory viewport
|
|
954
|
+
*/
|
|
477
955
|
getCanvasByClient(point: Point): Point;
|
|
478
956
|
/**
|
|
479
957
|
* <zh/> 获取视口中心的画布坐标
|
|
480
958
|
*
|
|
481
959
|
* <en/> Get the canvas coordinates of the viewport center
|
|
482
960
|
* @returns <zh/> 视口中心的画布坐标 | <en/> Canvas coordinates of the viewport center
|
|
961
|
+
* @apiCategory viewport
|
|
483
962
|
*/
|
|
484
963
|
getViewportCenter(): Point;
|
|
964
|
+
/**
|
|
965
|
+
* <zh/> 获取画布中心的画布坐标
|
|
966
|
+
*
|
|
967
|
+
* <en/> Get the canvas coordinates of the canvas center
|
|
968
|
+
* @returns <zh/> 画布中心的画布坐标 | <en/> Canvas coordinates of the canvas center
|
|
969
|
+
* @apiCategory viewport
|
|
970
|
+
*/
|
|
485
971
|
getCanvasCenter(): Point;
|
|
486
972
|
private onResize;
|
|
487
973
|
/**
|
|
@@ -491,6 +977,7 @@ export declare class Graph extends EventEmitter {
|
|
|
491
977
|
* @param eventName - <zh/> 事件名称 | <en/> event name
|
|
492
978
|
* @param callback - <zh/> 回调函数 | <en/> callback function
|
|
493
979
|
* @returns <zh/> Graph 实例 | <en/> Graph instance
|
|
980
|
+
* @apiCategory event
|
|
494
981
|
*/
|
|
495
982
|
on<T extends IEvent = IEvent>(eventName: string, callback: (event: T) => void): this;
|
|
496
983
|
/**
|
|
@@ -500,6 +987,7 @@ export declare class Graph extends EventEmitter {
|
|
|
500
987
|
* @param eventName - <zh/> 事件名称 | <en/> event name
|
|
501
988
|
* @param callback - <zh/> 回调函数 | <en/> callback function
|
|
502
989
|
* @returns <zh/> Graph 实例 | <en/> Graph instance
|
|
990
|
+
* @apiCategory event
|
|
503
991
|
*/
|
|
504
992
|
once<T extends IEvent = IEvent>(eventName: string, callback: (event: T) => void): this;
|
|
505
993
|
}
|