@antv/g6 5.0.2 → 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.
- package/README.en-US.md +118 -0
- package/README.md +118 -0
- package/dist/g6.min.js +2 -2
- package/dist/lib/behaviors/base-behavior.d.ts +1 -1
- package/dist/lib/behaviors/hover-activate.d.ts +0 -1
- package/dist/lib/behaviors/scroll-canvas.d.ts +1 -1
- package/dist/lib/behaviors/types.d.ts +0 -4
- package/dist/lib/behaviors/zoom-canvas.d.ts +1 -1
- package/dist/lib/elements/shapes/badge.d.ts +1 -1
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/layouts/index.d.ts +0 -1
- package/dist/lib/plugins/contextmenu/index.d.ts +4 -3
- package/dist/lib/plugins/types.d.ts +0 -2
- package/dist/lib/registry/extension/index.d.ts +17 -6
- package/dist/lib/registry/extension/types.d.ts +15 -33
- package/dist/lib/runtime/data.d.ts +3 -1
- package/dist/lib/runtime/element.d.ts +1 -1
- package/dist/lib/runtime/graph.d.ts +2 -1
- package/dist/lib/spec/behavior.d.ts +4 -5
- package/dist/lib/spec/element/combo.d.ts +8 -4
- package/dist/lib/spec/element/edge.d.ts +8 -4
- package/dist/lib/spec/element/node.d.ts +8 -4
- package/dist/lib/spec/plugin.d.ts +4 -5
- package/dist/lib/spec/transform.d.ts +5 -6
- package/dist/lib/transforms/types.d.ts +1 -2
- package/dist/lib/types/index.d.ts +0 -1
- package/dist/lib/types/style.d.ts +2 -0
- package/dist/lib/utils/event/events.d.ts +4 -4
- package/dist/lib/utils/extension.d.ts +5 -2
- package/dist/lib/utils/style.d.ts +5 -2
- package/dist/lib/utils/transform.d.ts +1 -1
- package/dist/lib/version.d.ts +1 -0
- package/esm/behaviors/base-behavior.d.ts +1 -1
- package/esm/behaviors/base-behavior.js.map +1 -1
- package/esm/behaviors/click-select.js +7 -4
- package/esm/behaviors/click-select.js.map +1 -1
- package/esm/behaviors/drag-element.js +2 -9
- package/esm/behaviors/drag-element.js.map +1 -1
- package/esm/behaviors/hover-activate.d.ts +0 -1
- package/esm/behaviors/hover-activate.js +18 -16
- package/esm/behaviors/hover-activate.js.map +1 -1
- package/esm/behaviors/scroll-canvas.d.ts +1 -1
- package/esm/behaviors/scroll-canvas.js.map +1 -1
- package/esm/behaviors/types.d.ts +0 -4
- package/esm/behaviors/zoom-canvas.d.ts +1 -1
- package/esm/elements/shapes/badge.d.ts +1 -1
- package/esm/index.d.ts +1 -1
- package/esm/index.js +1 -1
- package/esm/index.js.map +1 -1
- package/esm/layouts/index.d.ts +0 -1
- package/esm/plugins/camera-setting.js.map +1 -1
- package/esm/plugins/contextmenu/index.d.ts +4 -3
- package/esm/plugins/contextmenu/index.js +12 -10
- package/esm/plugins/contextmenu/index.js.map +1 -1
- package/esm/plugins/types.d.ts +0 -2
- package/esm/registry/extension/index.d.ts +17 -6
- package/esm/registry/extension/index.js +1 -1
- package/esm/registry/extension/index.js.map +1 -1
- package/esm/registry/extension/types.d.ts +15 -33
- package/esm/runtime/data.d.ts +3 -1
- package/esm/runtime/data.js +12 -0
- package/esm/runtime/data.js.map +1 -1
- package/esm/runtime/element.d.ts +1 -1
- package/esm/runtime/element.js +14 -8
- package/esm/runtime/element.js.map +1 -1
- package/esm/runtime/graph.d.ts +2 -1
- package/esm/runtime/graph.js +10 -9
- package/esm/runtime/graph.js.map +1 -1
- package/esm/spec/behavior.d.ts +4 -5
- package/esm/spec/element/combo.d.ts +8 -4
- package/esm/spec/element/edge.d.ts +8 -4
- package/esm/spec/element/node.d.ts +8 -4
- package/esm/spec/plugin.d.ts +4 -5
- package/esm/spec/transform.d.ts +5 -6
- package/esm/themes/base.js +3 -0
- package/esm/themes/base.js.map +1 -1
- package/esm/transforms/types.d.ts +1 -2
- package/esm/types/index.d.ts +0 -1
- package/esm/types/style.d.ts +2 -0
- package/esm/utils/event/events.d.ts +4 -4
- package/esm/utils/extension.d.ts +5 -2
- package/esm/utils/extension.js +5 -1
- package/esm/utils/extension.js.map +1 -1
- package/esm/utils/style.d.ts +5 -2
- package/esm/utils/style.js +5 -6
- package/esm/utils/style.js.map +1 -1
- package/esm/utils/transform.d.ts +1 -1
- package/esm/version.d.ts +1 -0
- package/esm/version.js +2 -0
- package/esm/version.js.map +1 -0
- package/lib/behaviors/base-behavior.d.ts +1 -1
- package/lib/behaviors/base-behavior.js.map +1 -1
- package/lib/behaviors/click-select.js +7 -4
- package/lib/behaviors/click-select.js.map +1 -1
- package/lib/behaviors/drag-element.js +2 -9
- package/lib/behaviors/drag-element.js.map +1 -1
- package/lib/behaviors/hover-activate.d.ts +0 -1
- package/lib/behaviors/hover-activate.js +18 -16
- package/lib/behaviors/hover-activate.js.map +1 -1
- package/lib/behaviors/scroll-canvas.d.ts +1 -1
- package/lib/behaviors/scroll-canvas.js.map +1 -1
- package/lib/behaviors/types.d.ts +0 -4
- package/lib/behaviors/zoom-canvas.d.ts +1 -1
- package/lib/elements/effect.js +1 -2
- package/lib/elements/effect.js.map +1 -1
- package/lib/elements/shapes/badge.d.ts +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/layouts/index.d.ts +0 -1
- package/lib/plugins/camera-setting.js.map +1 -1
- package/lib/plugins/contextmenu/index.d.ts +4 -3
- package/lib/plugins/contextmenu/index.js +12 -10
- package/lib/plugins/contextmenu/index.js.map +1 -1
- package/lib/plugins/contextmenu/util.js +2 -2
- package/lib/plugins/contextmenu/util.js.map +1 -1
- package/lib/plugins/history/util.js +2 -3
- package/lib/plugins/history/util.js.map +1 -1
- package/lib/plugins/hull/util.js +1 -2
- package/lib/plugins/hull/util.js.map +1 -1
- package/lib/plugins/toolbar/util.js +2 -2
- package/lib/plugins/toolbar/util.js.map +1 -1
- package/lib/plugins/types.d.ts +0 -2
- package/lib/plugins/watermark/util.js +2 -3
- package/lib/plugins/watermark/util.js.map +1 -1
- package/lib/registry/extension/index.d.ts +17 -6
- package/lib/registry/extension/index.js +1 -1
- package/lib/registry/extension/index.js.map +1 -1
- package/lib/registry/extension/types.d.ts +15 -33
- package/lib/registry/index.js +4 -5
- package/lib/registry/index.js.map +1 -1
- package/lib/runtime/data.d.ts +3 -1
- package/lib/runtime/data.js +12 -0
- package/lib/runtime/data.js.map +1 -1
- package/lib/runtime/element.d.ts +1 -1
- package/lib/runtime/element.js +14 -8
- package/lib/runtime/element.js.map +1 -1
- package/lib/runtime/graph.d.ts +2 -1
- package/lib/runtime/graph.js +10 -9
- package/lib/runtime/graph.js.map +1 -1
- package/lib/spec/behavior.d.ts +4 -5
- package/lib/spec/element/combo.d.ts +8 -4
- package/lib/spec/element/edge.d.ts +8 -4
- package/lib/spec/element/node.d.ts +8 -4
- package/lib/spec/plugin.d.ts +4 -5
- package/lib/spec/transform.d.ts +5 -6
- package/lib/themes/base.js +4 -2
- package/lib/themes/base.js.map +1 -1
- package/lib/transforms/types.d.ts +1 -2
- package/lib/transforms/utils.js +1 -2
- package/lib/transforms/utils.js.map +1 -1
- package/lib/types/index.d.ts +0 -1
- package/lib/types/style.d.ts +2 -0
- package/lib/utils/anchor.js +1 -2
- package/lib/utils/anchor.js.map +1 -1
- package/lib/utils/animation.js +5 -6
- package/lib/utils/animation.js.map +1 -1
- package/lib/utils/array.js +1 -2
- package/lib/utils/array.js.map +1 -1
- package/lib/utils/bbox.js +13 -14
- package/lib/utils/bbox.js.map +1 -1
- package/lib/utils/cache.js +4 -5
- package/lib/utils/cache.js.map +1 -1
- package/lib/utils/change.js +2 -3
- package/lib/utils/change.js.map +1 -1
- package/lib/utils/collapsibility.js +1 -2
- package/lib/utils/collapsibility.js.map +1 -1
- package/lib/utils/data.js +3 -4
- package/lib/utils/data.js.map +1 -1
- package/lib/utils/diff.js +1 -2
- package/lib/utils/diff.js.map +1 -1
- package/lib/utils/dom.js +4 -5
- package/lib/utils/dom.js.map +1 -1
- package/lib/utils/edge.js +18 -18
- package/lib/utils/edge.js.map +1 -1
- package/lib/utils/element.js +26 -27
- package/lib/utils/element.js.map +1 -1
- package/lib/utils/event/events.d.ts +4 -4
- package/lib/utils/event/index.js +2 -3
- package/lib/utils/event/index.js.map +1 -1
- package/lib/utils/extension.d.ts +5 -2
- package/lib/utils/extension.js +6 -3
- package/lib/utils/extension.js.map +1 -1
- package/lib/utils/graphlib.js +3 -4
- package/lib/utils/graphlib.js.map +1 -1
- package/lib/utils/id.js +3 -4
- package/lib/utils/id.js.map +1 -1
- package/lib/utils/is.js +4 -5
- package/lib/utils/is.js.map +1 -1
- package/lib/utils/layout.js +7 -8
- package/lib/utils/layout.js.map +1 -1
- package/lib/utils/line.js +2 -3
- package/lib/utils/line.js.map +1 -1
- package/lib/utils/math.js +1 -2
- package/lib/utils/math.js.map +1 -1
- package/lib/utils/node.js +1 -2
- package/lib/utils/node.js.map +1 -1
- package/lib/utils/padding.js +1 -2
- package/lib/utils/padding.js.map +1 -1
- package/lib/utils/palette.js +3 -4
- package/lib/utils/palette.js.map +1 -1
- package/lib/utils/path.js +4 -4
- package/lib/utils/path.js.map +1 -1
- package/lib/utils/placement.js +1 -2
- package/lib/utils/placement.js.map +1 -1
- package/lib/utils/point.js +21 -22
- package/lib/utils/point.js.map +1 -1
- package/lib/utils/polygon.js +1 -2
- package/lib/utils/polygon.js.map +1 -1
- package/lib/utils/position.js +5 -5
- package/lib/utils/position.js.map +1 -1
- package/lib/utils/prefix.js +7 -8
- package/lib/utils/prefix.js.map +1 -1
- package/lib/utils/relation.js +2 -3
- package/lib/utils/relation.js.map +1 -1
- package/lib/utils/router/orth.js +9 -10
- package/lib/utils/router/orth.js.map +1 -1
- package/lib/utils/shape.js +1 -2
- package/lib/utils/shape.js.map +1 -1
- package/lib/utils/size.js +1 -2
- package/lib/utils/size.js.map +1 -1
- package/lib/utils/style.d.ts +5 -2
- package/lib/utils/style.js +8 -10
- package/lib/utils/style.js.map +1 -1
- package/lib/utils/text.js +3 -4
- package/lib/utils/text.js.map +1 -1
- package/lib/utils/theme.js +1 -2
- package/lib/utils/theme.js.map +1 -1
- package/lib/utils/transform.d.ts +1 -1
- package/lib/utils/transform.js +2 -2
- package/lib/utils/transform.js.map +1 -1
- package/lib/utils/traverse.js +2 -3
- package/lib/utils/traverse.js.map +1 -1
- package/lib/utils/tree.js +1 -2
- package/lib/utils/tree.js.map +1 -1
- package/lib/utils/vector.js +16 -17
- package/lib/utils/vector.js.map +1 -1
- package/lib/utils/visibility.js +1 -2
- package/lib/utils/visibility.js.map +1 -1
- package/lib/version.d.ts +1 -0
- package/lib/version.js +5 -0
- package/lib/version.js.map +1 -0
- package/package.json +7 -4
- package/src/behaviors/base-behavior.ts +1 -1
- package/src/behaviors/click-select.ts +6 -4
- package/src/behaviors/drag-element.ts +2 -7
- package/src/behaviors/hover-activate.ts +18 -22
- package/src/behaviors/scroll-canvas.ts +1 -1
- package/src/behaviors/types.ts +0 -4
- package/src/index.ts +1 -1
- package/src/plugins/camera-setting.ts +2 -2
- package/src/plugins/contextmenu/index.ts +16 -16
- package/src/plugins/types.ts +0 -2
- package/src/registry/extension/index.ts +15 -8
- package/src/registry/extension/types.ts +15 -40
- package/src/runtime/data.ts +10 -0
- package/src/runtime/element.ts +14 -8
- package/src/runtime/graph.ts +10 -9
- package/src/spec/behavior.ts +4 -5
- package/src/spec/element/combo.ts +16 -4
- package/src/spec/element/edge.ts +16 -4
- package/src/spec/element/node.ts +16 -4
- package/src/spec/plugin.ts +4 -5
- package/src/spec/transform.ts +5 -6
- package/src/themes/base.ts +3 -0
- package/src/transforms/types.ts +1 -2
- package/src/types/index.ts +0 -1
- package/src/types/style.ts +2 -0
- package/src/utils/extension.ts +10 -3
- package/src/utils/style.ts +11 -6
- package/src/version.ts +1 -0
- package/dist/lib/types/callable.d.ts +0 -19
- package/esm/types/callable.d.ts +0 -19
- package/esm/types/callable.js +0 -2
- package/esm/types/callable.js.map +0 -1
- package/lib/types/callable.d.ts +0 -19
- package/lib/types/callable.js +0 -3
- package/lib/types/callable.js.map +0 -1
- 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
|
}
|
|
@@ -75,7 +75,6 @@ export declare class HoverActivate extends BaseBehavior<HoverActivateOptions> {
|
|
|
75
75
|
private toggleFrozen;
|
|
76
76
|
private bindEvents;
|
|
77
77
|
private hoverElement;
|
|
78
|
-
private hoverEndElement;
|
|
79
78
|
private updateElementsState;
|
|
80
79
|
private getElementsState;
|
|
81
80
|
private validate;
|
|
@@ -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[
|
|
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" | "
|
|
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/dist/lib/index.d.ts
CHANGED
|
@@ -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';
|
|
@@ -10,9 +10,9 @@ import type { Item } from './util';
|
|
|
10
10
|
*/
|
|
11
11
|
export interface ContextmenuOptions extends BasePluginOptions {
|
|
12
12
|
/**
|
|
13
|
-
* <zh/> 给菜单的 DOM
|
|
13
|
+
* <zh/> 给菜单的 DOM 追加的类名
|
|
14
14
|
*
|
|
15
|
-
* <en/> The
|
|
15
|
+
* <en/> The class name appended to the menu DOM for custom styles
|
|
16
16
|
* @defaultValue 'g6-contextmenu'
|
|
17
17
|
*/
|
|
18
18
|
className?: string;
|
|
@@ -39,7 +39,7 @@ export interface ContextmenuOptions extends BasePluginOptions {
|
|
|
39
39
|
*
|
|
40
40
|
* <en/> The callback method triggered when the menu is clicked
|
|
41
41
|
*/
|
|
42
|
-
onClick?: (
|
|
42
|
+
onClick?: (value: string, target: HTMLElement) => void;
|
|
43
43
|
/**
|
|
44
44
|
* <zh/> 返回菜单的项目列表,支持 `Promise` 类型的返回值。是 `getContent` 的快捷配置
|
|
45
45
|
*
|
|
@@ -79,6 +79,7 @@ export declare class Contextmenu extends BasePlugin<ContextmenuOptions> {
|
|
|
79
79
|
static defaultOptions: Partial<ContextmenuOptions>;
|
|
80
80
|
private $element;
|
|
81
81
|
constructor(context: RuntimeContext, options: ContextmenuOptions);
|
|
82
|
+
private initElement;
|
|
82
83
|
/**
|
|
83
84
|
* <zh/> 显示上下文菜单
|
|
84
85
|
*
|
|
@@ -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 {
|
|
5
|
-
export declare abstract class ExtensionController<
|
|
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,
|
|
9
|
+
protected extensionMap: Record<string, E>;
|
|
9
10
|
abstract category: 'plugin' | 'behavior' | 'transform';
|
|
10
11
|
constructor(context: RuntimeContext);
|
|
11
|
-
setExtensions(extensions:
|
|
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
|
|
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
|
|
26
|
-
/**
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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 |
|
|
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;
|
|
@@ -166,6 +166,8 @@ export declare class DataController {
|
|
|
166
166
|
*/
|
|
167
167
|
syncComboDatum(datum: PartialNodeLikeData<ComboData>): void;
|
|
168
168
|
getElementPosition(id: ID): Point;
|
|
169
|
+
translateNodeLikeBy(id: ID, offset: Point): void;
|
|
170
|
+
translateNodeLikeTo(id: ID, position: Point): void;
|
|
169
171
|
translateNodeBy(id: ID, offset: Point): void;
|
|
170
172
|
translateNodeTo(id: ID, position: Point): void;
|
|
171
173
|
translateComboBy(id: ID, offset: Point): void;
|
|
@@ -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/
|
|
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;
|
|
@@ -76,7 +76,7 @@ export declare class Graph extends EventEmitter {
|
|
|
76
76
|
*/
|
|
77
77
|
setSize(width: number, height: number): void;
|
|
78
78
|
/**
|
|
79
|
-
* <zh/>
|
|
79
|
+
* <zh/> 设置当前图的缩放区间
|
|
80
80
|
*
|
|
81
81
|
* <en/> Get the zoom range of the current graph
|
|
82
82
|
* @param zoomRange - <zh/> 缩放区间 | <en/> zoom range
|
|
@@ -513,6 +513,7 @@ export declare class Graph extends EventEmitter {
|
|
|
513
513
|
* <zh/> 为组合添加子节点使用 addNodeData / addComboData 方法
|
|
514
514
|
*
|
|
515
515
|
* <en/> Use addNodeData / addComboData method to add child nodes to the combo
|
|
516
|
+
* @apiCategory data
|
|
516
517
|
*/
|
|
517
518
|
addChildrenData(parentId: ID, childrenData: NodeData[]): void;
|
|
518
519
|
/**
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
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]:
|
|
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
|
|
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 {
|
|
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?:
|
|
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,
|
|
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 {
|
|
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?:
|
|
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,
|
|
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 {
|
|
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?:
|
|
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,
|
|
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 {
|
|
2
|
-
|
|
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]:
|
|
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
|
|
13
|
+
type: string;
|
|
15
14
|
/**
|
|
16
15
|
* <zh/> 插件 key,即唯一标识
|
|
17
16
|
*
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
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]:
|
|
5
|
+
[key: string]: unknown;
|
|
7
6
|
}
|
|
8
7
|
export interface CustomTransformOption {
|
|
9
|
-
type
|
|
8
|
+
type: string;
|
|
10
9
|
key?: string;
|
|
11
|
-
[key: string]:
|
|
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
|
|
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,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 {
|
|
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:
|
|
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 {
|
|
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:
|
|
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:
|
|
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,
|
|
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"}
|
|
@@ -88,24 +88,27 @@ export class ClickSelect extends BaseBehavior {
|
|
|
88
88
|
states[id] = uniq([...state.filter((s) => !exclude.includes(s)), select]);
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
|
-
|
|
91
|
+
const neighborIds = new Set();
|
|
92
92
|
if (neighbor) {
|
|
93
93
|
const d = typeof degree === 'function' ? degree(event) : degree;
|
|
94
94
|
if (d) {
|
|
95
95
|
const targetType = event.targetType;
|
|
96
96
|
this.select.forEach((id) => {
|
|
97
|
-
|
|
97
|
+
getElementNthDegreeIds(graph, targetType, id, d).forEach((id) => {
|
|
98
|
+
if (!this.select.has(id))
|
|
99
|
+
neighborIds.add(id);
|
|
100
|
+
});
|
|
98
101
|
});
|
|
99
102
|
}
|
|
100
103
|
const exclude = [select, unselect];
|
|
101
|
-
neighborIds
|
|
104
|
+
neighborIds.forEach((id) => {
|
|
102
105
|
const state = graph.getElementState(id);
|
|
103
106
|
states[id] = uniq([...state.filter((s) => !exclude.includes(s)), neighbor]);
|
|
104
107
|
});
|
|
105
108
|
}
|
|
106
109
|
const exclude = [select, neighbor, unselect];
|
|
107
110
|
idsOf(graph.getData(), true).forEach((id) => {
|
|
108
|
-
if (!this.select.has(id) && !neighborIds
|
|
111
|
+
if (!this.select.has(id) && !neighborIds.has(id)) {
|
|
109
112
|
const state = graph.getElementState(id);
|
|
110
113
|
const filtered = state.filter((s) => !exclude.includes(s));
|
|
111
114
|
// 仅在有选中元素时应用 unselect 状态
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"click-select.js","sourceRoot":"src/","sources":["behaviors/click-select.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAA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@internal
|
|
221
221
|
*/
|
|
222
222
|
async moveElement(ids, offset) {
|
|
223
|
-
const {
|
|
223
|
+
const { graph, model } = this.context;
|
|
224
224
|
const { dropEffect } = this.options;
|
|
225
|
-
ids.forEach((id) => {
|
|
226
|
-
const elementType = model.getElementType(id);
|
|
227
|
-
if (elementType === 'node')
|
|
228
|
-
model.translateNodeBy(id, offset);
|
|
229
|
-
else if (elementType === 'combo')
|
|
230
|
-
model.translateComboBy(id, offset);
|
|
231
|
-
});
|
|
232
225
|
if (dropEffect === 'move')
|
|
233
226
|
ids.forEach((id) => model.refreshComboData(id));
|
|
234
|
-
|
|
227
|
+
graph.translateElementBy(Object.fromEntries(ids.map((id) => [id, offset])), false);
|
|
235
228
|
}
|
|
236
229
|
moveShadow(offset) {
|
|
237
230
|
if (!this.shadow)
|