@antv/g6 5.0.33 → 5.0.35-beta.1
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 +11 -11
- package/dist/lib/behaviors/optimize-viewport-transform.d.ts +1 -1
- package/dist/lib/elements/edges/base-edge.d.ts +5 -5
- package/dist/lib/elements/nodes/base-node.d.ts +2 -0
- package/dist/lib/elements/shapes/base-shape.d.ts +2 -9
- package/dist/lib/exports.d.ts +2 -2
- package/dist/lib/layouts/fishbone.d.ts +2 -1
- package/dist/lib/layouts/index.d.ts +2 -0
- package/dist/lib/layouts/snake.d.ts +80 -0
- package/dist/lib/layouts/types.d.ts +23 -1
- package/dist/lib/plugins/minimap/index.d.ts +1 -1
- package/dist/lib/plugins/tooltip.d.ts +6 -0
- package/dist/lib/runtime/data.d.ts +2 -8
- package/dist/lib/runtime/element.d.ts +5 -2
- package/dist/lib/runtime/layout.d.ts +18 -1
- package/dist/lib/runtime/options.d.ts +9 -0
- package/dist/lib/runtime/transform.d.ts +2 -1
- package/dist/lib/spec/canvas.d.ts +26 -2
- package/dist/lib/spec/data.d.ts +0 -14
- package/dist/lib/spec/graph.d.ts +60 -12
- package/dist/lib/spec/viewport.d.ts +4 -0
- package/dist/lib/transforms/base-transform.d.ts +2 -1
- package/dist/lib/utils/cache.d.ts +5 -5
- package/dist/lib/utils/element.d.ts +9 -1
- package/dist/lib/utils/layout.d.ts +13 -1
- package/dist/lib/utils/style.d.ts +5 -5
- package/dist/lib/utils/transform.d.ts +2 -2
- package/dist/lib/version.d.ts +1 -1
- package/esm/animations/executor.js +3 -2
- package/esm/animations/executor.js.map +1 -1
- package/esm/behaviors/drag-element.js +9 -2
- package/esm/behaviors/drag-element.js.map +1 -1
- package/esm/behaviors/optimize-viewport-transform.d.ts +1 -1
- package/esm/elements/combos/base-combo.js +1 -1
- package/esm/elements/combos/base-combo.js.map +1 -1
- package/esm/elements/edges/base-edge.d.ts +5 -5
- package/esm/elements/edges/base-edge.js +8 -2
- package/esm/elements/edges/base-edge.js.map +1 -1
- package/esm/elements/nodes/base-node.d.ts +2 -0
- package/esm/elements/nodes/base-node.js +2 -2
- package/esm/elements/nodes/base-node.js.map +1 -1
- package/esm/elements/shapes/base-shape.d.ts +2 -9
- package/esm/elements/shapes/base-shape.js +24 -21
- package/esm/elements/shapes/base-shape.js.map +1 -1
- package/esm/exports.d.ts +2 -2
- package/esm/exports.js +1 -1
- package/esm/exports.js.map +1 -1
- package/esm/layouts/fishbone.d.ts +2 -1
- package/esm/layouts/fishbone.js +1 -1
- package/esm/layouts/fishbone.js.map +1 -1
- package/esm/layouts/index.d.ts +2 -0
- package/esm/layouts/index.js +1 -0
- package/esm/layouts/index.js.map +1 -1
- package/esm/layouts/snake.d.ts +80 -0
- package/esm/layouts/snake.js +162 -0
- package/esm/layouts/snake.js.map +1 -0
- package/esm/layouts/types.d.ts +23 -1
- package/esm/plugins/background/index.js +1 -0
- package/esm/plugins/background/index.js.map +1 -1
- package/esm/plugins/grid-line.js +1 -0
- package/esm/plugins/grid-line.js.map +1 -1
- package/esm/plugins/minimap/index.d.ts +1 -1
- package/esm/plugins/tooltip.d.ts +6 -0
- package/esm/plugins/tooltip.js +8 -6
- package/esm/plugins/tooltip.js.map +1 -1
- package/esm/registry/build-in.js +2 -1
- package/esm/registry/build-in.js.map +1 -1
- package/esm/runtime/data.d.ts +2 -8
- package/esm/runtime/data.js +14 -18
- package/esm/runtime/data.js.map +1 -1
- package/esm/runtime/element.d.ts +5 -2
- package/esm/runtime/element.js +39 -15
- package/esm/runtime/element.js.map +1 -1
- package/esm/runtime/graph.js +19 -7
- package/esm/runtime/graph.js.map +1 -1
- package/esm/runtime/layout.d.ts +18 -1
- package/esm/runtime/layout.js +85 -20
- package/esm/runtime/layout.js.map +1 -1
- package/esm/runtime/options.d.ts +9 -0
- package/esm/runtime/options.js +49 -0
- package/esm/runtime/options.js.map +1 -0
- package/esm/runtime/transform.d.ts +2 -1
- package/esm/runtime/transform.js.map +1 -1
- package/esm/spec/canvas.d.ts +26 -2
- package/esm/spec/data.d.ts +0 -14
- package/esm/spec/graph.d.ts +60 -12
- package/esm/spec/viewport.d.ts +4 -0
- package/esm/transforms/base-transform.d.ts +2 -1
- package/esm/transforms/base-transform.js +1 -1
- package/esm/transforms/base-transform.js.map +1 -1
- package/esm/utils/cache.d.ts +5 -5
- package/esm/utils/cache.js +5 -5
- package/esm/utils/element.d.ts +9 -1
- package/esm/utils/element.js +35 -1
- package/esm/utils/element.js.map +1 -1
- package/esm/utils/layout.d.ts +13 -1
- package/esm/utils/layout.js +14 -0
- package/esm/utils/layout.js.map +1 -1
- package/esm/utils/style.d.ts +5 -5
- package/esm/utils/style.js +5 -5
- package/esm/utils/transform.d.ts +2 -2
- package/esm/utils/transform.js +13 -8
- package/esm/utils/transform.js.map +1 -1
- package/esm/version.d.ts +1 -1
- package/esm/version.js +1 -1
- package/esm/version.js.map +1 -1
- package/lib/animations/executor.js +3 -2
- package/lib/animations/executor.js.map +1 -1
- package/lib/behaviors/drag-element.js +9 -2
- package/lib/behaviors/drag-element.js.map +1 -1
- package/lib/behaviors/optimize-viewport-transform.d.ts +1 -1
- package/lib/elements/combos/base-combo.js +1 -1
- package/lib/elements/combos/base-combo.js.map +1 -1
- package/lib/elements/edges/base-edge.d.ts +5 -5
- package/lib/elements/edges/base-edge.js +7 -1
- package/lib/elements/edges/base-edge.js.map +1 -1
- package/lib/elements/nodes/base-node.d.ts +2 -0
- package/lib/elements/nodes/base-node.js +2 -2
- package/lib/elements/nodes/base-node.js.map +1 -1
- package/lib/elements/shapes/base-shape.d.ts +2 -9
- package/lib/elements/shapes/base-shape.js +23 -20
- package/lib/elements/shapes/base-shape.js.map +1 -1
- package/lib/exports.d.ts +2 -2
- package/lib/exports.js +3 -2
- package/lib/exports.js.map +1 -1
- package/lib/layouts/fishbone.d.ts +2 -1
- package/lib/layouts/fishbone.js +2 -2
- package/lib/layouts/fishbone.js.map +1 -1
- package/lib/layouts/index.d.ts +2 -0
- package/lib/layouts/index.js +3 -1
- package/lib/layouts/index.js.map +1 -1
- package/lib/layouts/snake.d.ts +80 -0
- package/lib/layouts/snake.js +166 -0
- package/lib/layouts/snake.js.map +1 -0
- package/lib/layouts/types.d.ts +23 -1
- package/lib/plugins/background/index.js +1 -0
- package/lib/plugins/background/index.js.map +1 -1
- package/lib/plugins/grid-line.js +1 -0
- package/lib/plugins/grid-line.js.map +1 -1
- package/lib/plugins/minimap/index.d.ts +1 -1
- package/lib/plugins/tooltip.d.ts +6 -0
- package/lib/plugins/tooltip.js +8 -6
- package/lib/plugins/tooltip.js.map +1 -1
- package/lib/registry/build-in.js +1 -0
- package/lib/registry/build-in.js.map +1 -1
- package/lib/runtime/data.d.ts +2 -8
- package/lib/runtime/data.js +14 -18
- package/lib/runtime/data.js.map +1 -1
- package/lib/runtime/element.d.ts +5 -2
- package/lib/runtime/element.js +39 -15
- package/lib/runtime/element.js.map +1 -1
- package/lib/runtime/graph.js +21 -9
- package/lib/runtime/graph.js.map +1 -1
- package/lib/runtime/layout.d.ts +18 -1
- package/lib/runtime/layout.js +84 -19
- package/lib/runtime/layout.js.map +1 -1
- package/lib/runtime/options.d.ts +9 -0
- package/lib/runtime/options.js +52 -0
- package/lib/runtime/options.js.map +1 -0
- package/lib/runtime/transform.d.ts +2 -1
- package/lib/runtime/transform.js.map +1 -1
- package/lib/spec/canvas.d.ts +26 -2
- package/lib/spec/data.d.ts +0 -14
- package/lib/spec/graph.d.ts +60 -12
- package/lib/spec/viewport.d.ts +4 -0
- package/lib/transforms/base-transform.d.ts +2 -1
- package/lib/transforms/base-transform.js +1 -1
- package/lib/transforms/base-transform.js.map +1 -1
- package/lib/utils/cache.d.ts +5 -5
- package/lib/utils/cache.js +5 -5
- package/lib/utils/element.d.ts +9 -1
- package/lib/utils/element.js +35 -0
- package/lib/utils/element.js.map +1 -1
- package/lib/utils/layout.d.ts +13 -1
- package/lib/utils/layout.js +15 -0
- package/lib/utils/layout.js.map +1 -1
- package/lib/utils/style.d.ts +5 -5
- package/lib/utils/style.js +5 -5
- package/lib/utils/transform.d.ts +2 -2
- package/lib/utils/transform.js +13 -8
- package/lib/utils/transform.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/src/animations/executor.ts +4 -4
- package/src/behaviors/drag-element.ts +9 -2
- package/src/behaviors/optimize-viewport-transform.ts +1 -1
- package/src/elements/combos/base-combo.ts +1 -1
- package/src/elements/edges/base-edge.ts +14 -10
- package/src/elements/nodes/base-node.ts +4 -2
- package/src/elements/shapes/base-shape.ts +23 -21
- package/src/exports.ts +2 -1
- package/src/layouts/fishbone.ts +3 -2
- package/src/layouts/index.ts +3 -0
- package/src/layouts/snake.ts +235 -0
- package/src/layouts/types.ts +25 -1
- package/src/plugins/background/index.ts +1 -0
- package/src/plugins/grid-line.ts +1 -0
- package/src/plugins/minimap/index.ts +1 -1
- package/src/plugins/tooltip.ts +11 -4
- package/src/registry/build-in.ts +2 -0
- package/src/runtime/data.ts +14 -19
- package/src/runtime/element.ts +62 -13
- package/src/runtime/graph.ts +19 -8
- package/src/runtime/layout.ts +79 -23
- package/src/runtime/options.ts +52 -0
- package/src/runtime/transform.ts +2 -0
- package/src/spec/canvas.ts +26 -2
- package/src/spec/data.ts +0 -14
- package/src/spec/graph.ts +60 -12
- package/src/spec/viewport.ts +4 -0
- package/src/transforms/base-transform.ts +3 -1
- package/src/utils/cache.ts +5 -5
- package/src/utils/element.ts +21 -2
- package/src/utils/layout.ts +16 -1
- package/src/utils/style.ts +5 -5
- package/src/utils/transform.ts +13 -9
- package/src/version.ts +1 -1
|
@@ -20,7 +20,7 @@ export interface OptimizeViewportTransformOptions extends BaseBehaviorOptions {
|
|
|
20
20
|
/**
|
|
21
21
|
* <zh/> 指定始终显示的图形元素。应用此交互后,在画布操作过程中,只有通过该属性指定的图形元素会保持可见,其余图形元素将被隐藏,从而提升渲染性能。默认情况下,节点始终可见,而其他图形元素在操作画布过程中会自动隐藏
|
|
22
22
|
*
|
|
23
|
-
* <en/> Specify the
|
|
23
|
+
* <en/> Specify the shapes that are always visible. After applying this interaction, only the shapes specified by this property will remain visible during the canvas operation, and the rest of the shapes will be hidden to improve rendering performance. By default, nodes are always visible, while other shapes are automatically hidden during canvas operations
|
|
24
24
|
*/
|
|
25
25
|
shapes?: {
|
|
26
26
|
node?: string[];
|
|
@@ -95,33 +95,33 @@ export interface BaseEdgeStyleProps extends BaseShapeStyleProps, Prefix<'label',
|
|
|
95
95
|
/**
|
|
96
96
|
* <zh/> 在 “起点” 处添加一个标记图形,其中 “起始点” 为边与起始节点的交点
|
|
97
97
|
*
|
|
98
|
-
* <en/> Add a marker
|
|
98
|
+
* <en/> Add a marker at the "start point", where the "start point" is the intersection of the edge and the source node
|
|
99
99
|
*/
|
|
100
100
|
markerStart?: DisplayObject | null;
|
|
101
101
|
/**
|
|
102
102
|
* <zh/> 调整 “起点” 处标记图形的位置,正偏移量向内,负偏移量向外
|
|
103
103
|
*
|
|
104
|
-
* <en/> Adjust the position of the marker
|
|
104
|
+
* <en/> Adjust the position of the marker at the "start point", positive offset inward, negative offset outward
|
|
105
105
|
* @defaultValue 0
|
|
106
106
|
*/
|
|
107
107
|
markerStartOffset?: number;
|
|
108
108
|
/**
|
|
109
109
|
* <zh/> 在 “终点” 处添加一个标记图形,其中 “终点” 为边与终止节点的交点
|
|
110
110
|
*
|
|
111
|
-
* <en/> Add a marker
|
|
111
|
+
* <en/> Add a marker at the "end point", where the "end point" is the intersection of the edge and the target node
|
|
112
112
|
*/
|
|
113
113
|
markerEnd?: DisplayObject | null;
|
|
114
114
|
/**
|
|
115
115
|
* <zh/> 调整 “终点” 处标记图形的位置,正偏移量向内,负偏移量向外
|
|
116
116
|
*
|
|
117
|
-
* <en/> Adjust the position of the marker
|
|
117
|
+
* <en/> Adjust the position of the marker at the "end point", positive offset inward, negative offset outward
|
|
118
118
|
* @defaultValue 0
|
|
119
119
|
*/
|
|
120
120
|
markerEndOffset?: number;
|
|
121
121
|
/**
|
|
122
122
|
* <zh/> 在路径除了 “起点” 和 “终点” 之外的每一个顶点上放置标记图形。在内部实现中,由于我们会把路径中部分命令转换成 C 命令,因此这些顶点实际是三阶贝塞尔曲线的控制点
|
|
123
123
|
*
|
|
124
|
-
* <en/> Place a marker
|
|
124
|
+
* <en/> Place a marker on each vertex of the path except for the "start point" and "end point". In the internal implementation, because we will convert some commands in the path to C commands, these controlPoints are actually the control points of the cubic Bezier curve
|
|
125
125
|
*/
|
|
126
126
|
markerMid?: DisplayObject | null;
|
|
127
127
|
/**
|
|
@@ -52,6 +52,7 @@ export interface BaseNodeStyleProps extends BaseShapeStyleProps, Prefix<'label',
|
|
|
52
52
|
* <zh/> 仅在树图中生效
|
|
53
53
|
*
|
|
54
54
|
* <en/> Only valid in the tree graph
|
|
55
|
+
* @ignore
|
|
55
56
|
*/
|
|
56
57
|
childrenNode?: ID[];
|
|
57
58
|
/**
|
|
@@ -62,6 +63,7 @@ export interface BaseNodeStyleProps extends BaseShapeStyleProps, Prefix<'label',
|
|
|
62
63
|
* <zh/> 仅在树图中生效。如果当前节点为收起状态,children 可能为空,通过 childrenData 能够获取完整的子元素数据
|
|
63
64
|
*
|
|
64
65
|
* <en/> Only valid in the tree graph. If the current node is collapsed, children may be empty, and the complete child element data can be obtained through childrenData
|
|
66
|
+
* @ignore
|
|
65
67
|
*/
|
|
66
68
|
childrenData?: NodeData[];
|
|
67
69
|
/**
|
|
@@ -46,13 +46,6 @@ export declare abstract class BaseShape<StyleProps extends BaseShapeStyleProps>
|
|
|
46
46
|
protected upsert<T extends DisplayObject>(className: string, Ctor: string | {
|
|
47
47
|
new (...args: any[]): T;
|
|
48
48
|
}, style: T['attributes'] | false, container: DisplayObject, hooks?: UpsertHooks): T | undefined;
|
|
49
|
-
/**
|
|
50
|
-
* <zh/> 使用 transform 更新图形位置
|
|
51
|
-
*
|
|
52
|
-
* <en/> Update the position of the shape using transform
|
|
53
|
-
* @param attributes - <zh/> 样式属性 | <en/> style attributes
|
|
54
|
-
*/
|
|
55
|
-
protected transformPosition(attributes: Partial<StyleProps>): void;
|
|
56
49
|
update(attr?: Partial<StyleProps>): void;
|
|
57
50
|
/**
|
|
58
51
|
* <zh/> 在初始化时会被自动调用
|
|
@@ -66,8 +59,8 @@ export declare abstract class BaseShape<StyleProps extends BaseShapeStyleProps>
|
|
|
66
59
|
/**
|
|
67
60
|
* <zh/> 从给定的属性对象中提取图形样式属性。删除特定的属性,如位置、变换和类名
|
|
68
61
|
*
|
|
69
|
-
* <en/> Extracts the
|
|
70
|
-
* Removes specific
|
|
62
|
+
* <en/> Extracts the shape styles from a given attribute object.
|
|
63
|
+
* Removes specific styles like position, transformation, and class name.
|
|
71
64
|
* @param style - <zh/> 属性对象 | <en/> attribute object
|
|
72
65
|
* @returns <zh/> 仅包含样式属性的对象 | <en/> An object containing only the style properties.
|
|
73
66
|
*/
|
package/dist/lib/exports.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export { BaseEdge, Cubic, CubicHorizontal, CubicRadial, CubicVertical, Line, Pol
|
|
|
5
5
|
export { effect } from './elements/effect';
|
|
6
6
|
export { BaseNode, Circle, Diamond, Donut, Ellipse, HTML, Hexagon, Image, Rect, Star, Triangle, } from './elements/nodes';
|
|
7
7
|
export { Badge, BaseShape, Icon, Label } from './elements/shapes';
|
|
8
|
-
export { AntVDagreLayout, BaseLayout, CircularLayout, ComboCombinedLayout, compactBox as CompactBoxLayout, ConcentricLayout, D3ForceLayout, DagreLayout, dendrogram as DendrogramLayout, FishboneLayout, ForceAtlas2Layout, ForceLayout, FruchtermanLayout, GridLayout, indented as IndentedLayout, MDSLayout, mindmap as MindmapLayout, RadialLayout, RandomLayout, } from './layouts';
|
|
8
|
+
export { AntVDagreLayout, BaseLayout, CircularLayout, ComboCombinedLayout, compactBox as CompactBoxLayout, ConcentricLayout, D3ForceLayout, DagreLayout, dendrogram as DendrogramLayout, FishboneLayout, ForceAtlas2Layout, ForceLayout, FruchtermanLayout, GridLayout, indented as IndentedLayout, MDSLayout, mindmap as MindmapLayout, RadialLayout, RandomLayout, SnakeLayout, } from './layouts';
|
|
9
9
|
export { Background, BasePlugin, BubbleSets, CameraSetting, Contextmenu, EdgeBundling, EdgeFilterLens, Fisheye, Fullscreen, GridLine, History, Hull, Legend, Minimap, Snapline, Timebar, Toolbar, Tooltip, Watermark, } from './plugins';
|
|
10
10
|
export { getExtension, getExtensions } from './registry/get';
|
|
11
11
|
export { register } from './registry/register';
|
|
@@ -33,7 +33,7 @@ export type { BaseNodeStyleProps, CircleStyleProps, DiamondStyleProps, DonutStyl
|
|
|
33
33
|
export type { BadgeStyleProps, BaseShapeStyleProps, IconStyleProps, LabelStyleProps, PolygonStyleProps, } from './elements/shapes';
|
|
34
34
|
export type { UpsertHooks } from './elements/shapes/base-shape';
|
|
35
35
|
export type { ContourLabelStyleProps, ContourStyleProps } from './elements/shapes/contour';
|
|
36
|
-
export type { FishboneLayoutOptions } from './layouts';
|
|
36
|
+
export type { FishboneLayoutOptions, SnakeLayoutOptions } from './layouts';
|
|
37
37
|
export type { BaseLayoutOptions, WebWorkerLayoutOptions } from './layouts/types';
|
|
38
38
|
export type { CategoricalPalette } from './palettes/types';
|
|
39
39
|
export type { BackgroundOptions, BasePluginOptions, BubbleSetsOptions, CameraSettingOptions, ContextmenuOptions, EdgeBundlingOptions, EdgeFilterLensOptions, FisheyeOptions, FullscreenOptions, GridLineOptions, HistoryOptions, HullOptions, LegendOptions, MinimapOptions, SnaplineOptions, TimebarOptions, ToolbarOptions, TooltipOptions, WatermarkOptions, } from './plugins';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { BaseLayoutOptions } from '../layouts/types';
|
|
1
2
|
import type { GraphData, NodeData } from '../spec';
|
|
2
3
|
import type { Size } from '../types';
|
|
3
4
|
import { BaseLayout } from './base-layout';
|
|
4
|
-
export interface FishboneLayoutOptions {
|
|
5
|
+
export interface FishboneLayoutOptions extends BaseLayoutOptions {
|
|
5
6
|
/**
|
|
6
7
|
* <zh/> 节点大小
|
|
7
8
|
*
|
|
@@ -2,4 +2,6 @@ export { compactBox, dendrogram, indented, mindmap } from '@antv/hierarchy';
|
|
|
2
2
|
export { AntVDagreLayout, CircularLayout, ComboCombinedLayout, ConcentricLayout, D3ForceLayout, DagreLayout, ForceAtlas2Layout, ForceLayout, FruchtermanLayout, GridLayout, MDSLayout, RadialLayout, RandomLayout, } from '@antv/layout';
|
|
3
3
|
export { BaseLayout } from './base-layout';
|
|
4
4
|
export { FishboneLayout } from './fishbone';
|
|
5
|
+
export { SnakeLayout } from './snake';
|
|
5
6
|
export type { FishboneLayoutOptions } from './fishbone';
|
|
7
|
+
export type { SnakeLayoutOptions } from './snake';
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { GraphData, NodeData } from '../spec';
|
|
2
|
+
import type { Padding, Size } from '../types';
|
|
3
|
+
import { BaseLayout } from './base-layout';
|
|
4
|
+
import type { BaseLayoutOptions } from './types';
|
|
5
|
+
export interface SnakeLayoutOptions extends BaseLayoutOptions {
|
|
6
|
+
/**
|
|
7
|
+
* <zh/> 节点尺寸
|
|
8
|
+
*
|
|
9
|
+
* <en/> Node size
|
|
10
|
+
*/
|
|
11
|
+
nodeSize?: Size | ((node: NodeData) => Size);
|
|
12
|
+
/**
|
|
13
|
+
* <zh/> 内边距,即布局区域与画布边界的距离
|
|
14
|
+
*
|
|
15
|
+
* <en/> Padding, the distance between the layout area and the canvas boundary
|
|
16
|
+
* @defaultValue 0
|
|
17
|
+
*/
|
|
18
|
+
padding?: Padding;
|
|
19
|
+
/**
|
|
20
|
+
* <zh/> 节点排序方法。默认按照在图中的路径顺序进行展示
|
|
21
|
+
*
|
|
22
|
+
* <en/> Node sorting method
|
|
23
|
+
*/
|
|
24
|
+
sortBy?: (nodeA: NodeData, nodeB: NodeData) => -1 | 0 | 1;
|
|
25
|
+
/**
|
|
26
|
+
* <zh/> 节点列数
|
|
27
|
+
*
|
|
28
|
+
* <en/> Number of node columns
|
|
29
|
+
* @defaultValue 5
|
|
30
|
+
*/
|
|
31
|
+
cols?: number;
|
|
32
|
+
/**
|
|
33
|
+
* <zh/> 节点行之间的间隙大小。默认将根据画布高度和节点总行数自动计算
|
|
34
|
+
*
|
|
35
|
+
* <en/> The size of the gap between a node's rows
|
|
36
|
+
*/
|
|
37
|
+
rowGap?: number;
|
|
38
|
+
/**
|
|
39
|
+
* <zh/> 节点列之间的间隙大小。默认将根据画布宽度和节点总列数自动计算
|
|
40
|
+
*
|
|
41
|
+
* <en/> The size of the gap between a node's columns
|
|
42
|
+
*/
|
|
43
|
+
colGap?: number;
|
|
44
|
+
/**
|
|
45
|
+
* <zh/> 节点排布方向是否顺时针
|
|
46
|
+
*
|
|
47
|
+
* <en/> Whether the node arrangement direction is clockwise
|
|
48
|
+
* @defaultValue true
|
|
49
|
+
* @remarks
|
|
50
|
+
* <zh/> 在顺时针排布时,节点从左上角开始,第一行从左到右排列,第二行从右到左排列,依次类推,形成 S 型路径。在逆时针排布时,节点从右上角开始,第一行从右到左排列,第二行从左到右排列,依次类推,形成反向 S 型路径。
|
|
51
|
+
*
|
|
52
|
+
* <en/> When arranged clockwise, the nodes start from the upper left corner, the first row is arranged from left to right, the second row is arranged from right to left, and so on, forming an S-shaped path. When arranged counterclockwise, the nodes start from the upper right corner, the first row is arranged from right to left, the second row is arranged from left to right, and so on, forming a reverse S-shaped path.
|
|
53
|
+
*/
|
|
54
|
+
clockwise?: boolean;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* <zh/> 蛇形布局
|
|
58
|
+
*
|
|
59
|
+
* <en/> Snake layout
|
|
60
|
+
* @remarks
|
|
61
|
+
* <zh/> 蛇形布局(Snake Layout)是一种特殊的图形布局方式,能够在较小的空间内更有效地展示长链结构。需要注意的是,其图数据需要确保节点按照从源节点到汇节点的顺序进行线性排列,形成一条明确的路径。
|
|
62
|
+
*
|
|
63
|
+
* <zh/> 节点按 S 字型排列,第一个节点位于第一行的起始位置,接下来的节点在第一行向右排列,直到行末尾。到达行末尾后,下一行的节点从右向左反向排列。这个过程重复进行,直到所有节点排列完毕。
|
|
64
|
+
*
|
|
65
|
+
* <en/> The Snake layout is a special way of graph layout that can more effectively display long chain structures in a smaller space. Note that the graph data needs to ensure that the nodes are linearly arranged in the order from the source node to the sink node to form a clear path.
|
|
66
|
+
*
|
|
67
|
+
* <en/> The nodes are arranged in an S-shaped pattern, with the first node at the beginning of the first row, and the following nodes arranged to the right until the end of the row. After reaching the end of the row, the nodes in the next row are arranged in reverse from right to left. This process is repeated until all nodes are arranged.
|
|
68
|
+
*/
|
|
69
|
+
export declare class SnakeLayout extends BaseLayout {
|
|
70
|
+
id: string;
|
|
71
|
+
static defaultOptions: Partial<SnakeLayoutOptions>;
|
|
72
|
+
private formatSize;
|
|
73
|
+
/**
|
|
74
|
+
* Validates the graph data to ensure it meets the requirements for linear arrangement.
|
|
75
|
+
* @param data - Graph data
|
|
76
|
+
* @returns false if the graph is not connected, has more than one source or sink node, or contains cycles.
|
|
77
|
+
*/
|
|
78
|
+
private validate;
|
|
79
|
+
execute(model: GraphData, options?: SnakeLayoutOptions): Promise<GraphData>;
|
|
80
|
+
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { AntVDagreLayoutOptions, LayoutWithIterations as AntVIterativeLayout, Layout as AntVNonIterativeLayout, CircularLayoutOptions, ConcentricLayoutOptions, D3Force3DLayoutOptions, D3ForceLayoutOptions, DagreLayoutOptions, ForceAtlas2LayoutOptions, ForceLayoutOptions, FruchtermanLayoutOptions, GridLayoutOptions, MDSLayoutOptions, RadialLayoutOptions, RandomLayoutOptions } from '@antv/layout';
|
|
2
2
|
import type { NodeData } from '../spec/data';
|
|
3
3
|
import type { BaseLayout } from './base-layout';
|
|
4
|
-
|
|
4
|
+
import type { FishboneLayoutOptions } from './fishbone';
|
|
5
|
+
import type { SnakeLayoutOptions } from './snake';
|
|
6
|
+
export type BuiltInLayoutOptions = AntVDagreLayout | CircularLayout | ConcentricLayout | D3ForceLayout | D3Force3DLayout | DagreLayout | ForceAtlas2 | ForceLayout | FruchtermanLayout | GridLayout | MDSLayout | RadialLayout | RandomLayout | SnakeLayoutOptions | FishboneLayoutOptions;
|
|
5
7
|
export interface BaseLayoutOptions extends AnimationOptions, WebWorkerLayoutOptions, Record<string, any> {
|
|
6
8
|
/**
|
|
7
9
|
* <zh/> 布局类型
|
|
@@ -17,6 +19,26 @@ export interface BaseLayoutOptions extends AnimationOptions, WebWorkerLayoutOpti
|
|
|
17
19
|
* @returns <zh/> 是否参与布局 | <en/> Whether to participate in the layout
|
|
18
20
|
*/
|
|
19
21
|
nodeFilter?: (node: NodeData) => boolean;
|
|
22
|
+
/**
|
|
23
|
+
* <zh/> 使用前布局,在初始化元素前计算布局
|
|
24
|
+
*
|
|
25
|
+
* <en/> Use pre-layout to calculate the layout before initializing the elements
|
|
26
|
+
* @remarks
|
|
27
|
+
* <zh/> 不适用于流水线布局
|
|
28
|
+
*
|
|
29
|
+
* <en/> Not applicable to pipeline layout
|
|
30
|
+
*/
|
|
31
|
+
preLayout?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* <zh/> 不可见节点是否参与布局
|
|
34
|
+
*
|
|
35
|
+
* <en/> Whether invisible nodes participate in the layout
|
|
36
|
+
* @remarks
|
|
37
|
+
* <zh/> 当 preLayout 为 true 时生效
|
|
38
|
+
*
|
|
39
|
+
* <en/> Takes effect when preLayout is true
|
|
40
|
+
*/
|
|
41
|
+
isLayoutInvisibleNodes?: boolean;
|
|
20
42
|
}
|
|
21
43
|
interface CircularLayout extends BaseLayoutOptions, CircularLayoutOptions {
|
|
22
44
|
type: 'circular';
|
|
@@ -50,7 +50,7 @@ export interface MinimapOptions extends BasePluginOptions {
|
|
|
50
50
|
* - 也可以传入一个函数,接收元素的 id 和类型,返回一个图形
|
|
51
51
|
*
|
|
52
52
|
* <en/>
|
|
53
|
-
* - 'key' uses the key shape of the element as the thumbnail
|
|
53
|
+
* - 'key' uses the key shape of the element as the thumbnail shape
|
|
54
54
|
* - You can also pass in a function that receives the id and type of the element and returns a shape
|
|
55
55
|
*/
|
|
56
56
|
shape?: 'key' | ((id: string, elementType: ElementType) => DisplayObject);
|
|
@@ -33,6 +33,12 @@ export interface TooltipOptions extends BasePluginOptions, Pick<TooltipStyleProp
|
|
|
33
33
|
* @defaultValue true
|
|
34
34
|
*/
|
|
35
35
|
enable?: boolean | ((event: IElementEvent) => boolean);
|
|
36
|
+
/**
|
|
37
|
+
* <zh/> 显示隐藏的回调
|
|
38
|
+
*
|
|
39
|
+
* <en/> Callback executed when visibility of the tooltip card is changed
|
|
40
|
+
*/
|
|
41
|
+
onOpenChange: (open: boolean) => void;
|
|
36
42
|
}
|
|
37
43
|
/**
|
|
38
44
|
* <zh/> 提示框插件
|
|
@@ -163,7 +163,8 @@ export declare class DataController {
|
|
|
163
163
|
* <en/> Submit all data to the change record for redrawing
|
|
164
164
|
*/
|
|
165
165
|
refreshData(): void;
|
|
166
|
-
|
|
166
|
+
syncNodeLikeDatum(datum: PartialNodeLikeData<NodeData>): void;
|
|
167
|
+
syncEdgeDatum(datum: PartialEdgeData<EdgeData>): void;
|
|
167
168
|
updateEdgeData(edges?: PartialEdgeData<EdgeData>[]): void;
|
|
168
169
|
updateComboData(combos?: PartialNodeLikeData<ComboData>[]): void;
|
|
169
170
|
/**
|
|
@@ -187,13 +188,6 @@ export declare class DataController {
|
|
|
187
188
|
* <en/> Will not change the data, but will trigger data change events
|
|
188
189
|
*/
|
|
189
190
|
refreshComboData(id: ID): void;
|
|
190
|
-
/**
|
|
191
|
-
* <zh/> 将 combo 数据同步到 model 中
|
|
192
|
-
*
|
|
193
|
-
* <en/> Synchronize combo data to the model
|
|
194
|
-
* @param datum - <zh/> combo 数据 | <en/> combo data
|
|
195
|
-
*/
|
|
196
|
-
syncComboDatum(datum: PartialNodeLikeData<ComboData>): void;
|
|
197
191
|
getElementPosition(id: ID): Point;
|
|
198
192
|
translateNodeLikeBy(id: ID, offset: Point): void;
|
|
199
193
|
translateNodeLikeTo(id: ID, position: Point): void;
|
|
@@ -55,12 +55,15 @@ export declare class ElementController {
|
|
|
55
55
|
getEdges(): Edge[];
|
|
56
56
|
getCombos(): Combo[];
|
|
57
57
|
getElementComputedStyle(elementType: ElementType, datum: ElementDatum): any;
|
|
58
|
+
private getDrawData;
|
|
58
59
|
/**
|
|
59
60
|
* <zh/> 开始绘制流程
|
|
60
61
|
*
|
|
61
62
|
* <en/> start render process
|
|
62
63
|
*/
|
|
63
|
-
draw(context?: DrawContext): import("@antv/g").IAnimation | null;
|
|
64
|
+
draw(context?: DrawContext): import("@antv/g").IAnimation | null | undefined;
|
|
65
|
+
preLayoutDraw(context?: DrawContext): Promise<import("@antv/g").IAnimation | null | undefined>;
|
|
66
|
+
private setAnimationTask;
|
|
64
67
|
private computeChangesAndDrawData;
|
|
65
68
|
private transformData;
|
|
66
69
|
private createElement;
|
|
@@ -92,7 +95,7 @@ export declare class ElementController {
|
|
|
92
95
|
*
|
|
93
96
|
* <en/> collapse node
|
|
94
97
|
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
95
|
-
* @param
|
|
98
|
+
* @param options - <zh/> 选项 | <en/> options
|
|
96
99
|
*/
|
|
97
100
|
collapseNode(id: ID, options: CollapseExpandNodeOptions): Promise<void>;
|
|
98
101
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BaseLayout } from '../layouts';
|
|
2
2
|
import type { GraphData } from '../spec';
|
|
3
3
|
import type { STDLayoutOptions } from '../spec/layout';
|
|
4
|
+
import type { DrawData } from '../transforms/types';
|
|
4
5
|
import type { RuntimeContext } from './types';
|
|
5
6
|
export declare class LayoutController {
|
|
6
7
|
private context;
|
|
@@ -12,7 +13,23 @@ export declare class LayoutController {
|
|
|
12
13
|
private get options();
|
|
13
14
|
constructor(context: RuntimeContext);
|
|
14
15
|
getLayoutInstance(): BaseLayout[];
|
|
15
|
-
|
|
16
|
+
/**
|
|
17
|
+
* <zh/> 前布局,即在绘制前执行布局
|
|
18
|
+
*
|
|
19
|
+
* <en/> Pre-layout, that is, perform layout before drawing
|
|
20
|
+
* @param data - <zh/> 绘制数据 | <en/> Draw data
|
|
21
|
+
* @remarks
|
|
22
|
+
* <zh/> 前布局应该只在首次绘制前执行,后续更新不会触发
|
|
23
|
+
*
|
|
24
|
+
* <en/> Pre-layout should only be executed before the first drawing, and subsequent updates will not trigger
|
|
25
|
+
*/
|
|
26
|
+
preLayout(data: DrawData): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* <zh/> 后布局,即在完成绘制后执行布局
|
|
29
|
+
*
|
|
30
|
+
* <en/> Post layout, that is, perform layout after drawing
|
|
31
|
+
*/
|
|
32
|
+
postLayout(): Promise<void>;
|
|
16
33
|
private transformDataAfterLayout;
|
|
17
34
|
/**
|
|
18
35
|
* <zh/> 模拟布局
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { GraphOptions } from '../spec';
|
|
2
|
+
/**
|
|
3
|
+
* <zh/> 基于用户传入的配置,推断出最终的配置
|
|
4
|
+
*
|
|
5
|
+
* <en/> Infer the final configuration based on the configuration passed by the user
|
|
6
|
+
* @param options - <zh/> 用户传入的配置 | <en/> Configuration passed by the user
|
|
7
|
+
* @returns <zh/> 最终的配置 | <en/> Final configuration
|
|
8
|
+
*/
|
|
9
|
+
export declare function inferOptions(options: GraphOptions): GraphOptions;
|
|
@@ -8,5 +8,6 @@ export declare class TransformController extends ExtensionController<BaseTransfo
|
|
|
8
8
|
constructor(context: RuntimeContext);
|
|
9
9
|
protected getTransforms(): void;
|
|
10
10
|
setTransforms(transforms: TransformOptions): void;
|
|
11
|
-
getTransformInstance(
|
|
11
|
+
getTransformInstance(): Record<string, BaseTransform>;
|
|
12
|
+
getTransformInstance(key: string): BaseTransform;
|
|
12
13
|
}
|
|
@@ -17,18 +17,30 @@ export interface CanvasOptions {
|
|
|
17
17
|
* <zh/> 画布宽度
|
|
18
18
|
*
|
|
19
19
|
* <en/> canvas width
|
|
20
|
+
* @remarks
|
|
21
|
+
* <zh/> 如果未设置,则会自动获取容器宽度
|
|
22
|
+
*
|
|
23
|
+
* <en/> If not set, the container width will be automatically obtained
|
|
20
24
|
*/
|
|
21
25
|
width?: number;
|
|
22
26
|
/**
|
|
23
27
|
* <zh/> 画布高度
|
|
24
28
|
*
|
|
25
29
|
* <en/> canvas height
|
|
30
|
+
* @remarks
|
|
31
|
+
* <zh/> 如果未设置,则会自动获取容器高度
|
|
32
|
+
*
|
|
33
|
+
* <en/> If not set, the container height will be automatically obtained
|
|
26
34
|
*/
|
|
27
35
|
height?: number;
|
|
28
36
|
/**
|
|
29
|
-
* <zh/>
|
|
37
|
+
* <zh/> 手动置顶渲染器
|
|
38
|
+
*
|
|
39
|
+
* <en/> manually set renderer
|
|
40
|
+
* @remarks
|
|
41
|
+
* <zh/> G6 采用了分层渲染的方式,分为 background、main、label、transient 四层,用户可以通过该配置项分别设置每层画布的渲染器
|
|
30
42
|
*
|
|
31
|
-
* <en/>
|
|
43
|
+
* <en/> G6 adopts a layered rendering method, divided into four layers: background, main, label, transient. Users can set the renderer of each layer canvas separately through this configuration item
|
|
32
44
|
*/
|
|
33
45
|
renderer?: (layer: 'background' | 'main' | 'label' | 'transient') => IRenderer;
|
|
34
46
|
/**
|
|
@@ -36,18 +48,30 @@ export interface CanvasOptions {
|
|
|
36
48
|
*
|
|
37
49
|
* <en/> whether to auto resize canvas
|
|
38
50
|
* @defaultValue false
|
|
51
|
+
* @remarks
|
|
52
|
+
* <zh/> 基于 window.onresize 事件自动调整画布大小
|
|
53
|
+
*
|
|
54
|
+
* <en/> Automatically adjust the canvas size based on the window.onresize event
|
|
39
55
|
*/
|
|
40
56
|
autoResize?: boolean;
|
|
41
57
|
/**
|
|
42
58
|
* <zh/> 画布背景色
|
|
43
59
|
*
|
|
44
60
|
* <en/> canvas background color
|
|
61
|
+
* @remarks
|
|
62
|
+
* <zh/> 该颜色作为导出图片时的背景色
|
|
63
|
+
*
|
|
64
|
+
* <en/> This color is used as the background color when exporting images
|
|
45
65
|
*/
|
|
46
66
|
background?: string;
|
|
47
67
|
/**
|
|
48
68
|
* <zh/> 设备像素比
|
|
49
69
|
*
|
|
50
70
|
* <en/> device pixel ratio
|
|
71
|
+
* @remarks
|
|
72
|
+
* <zh/> 用于高清屏的设备像素比,默认为 [window.devicePixelRatio](https://developer.mozilla.org/zh-CN/docs/Web/API/Window/devicePixelRatio)
|
|
73
|
+
*
|
|
74
|
+
* <en/> Device pixel ratio for high-definition screens, default is [window.devicePixelRatio](https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio)
|
|
51
75
|
*/
|
|
52
76
|
devicePixelRatio?: number;
|
|
53
77
|
/**
|
package/dist/lib/spec/data.d.ts
CHANGED
|
@@ -186,20 +186,6 @@ export interface EdgeData {
|
|
|
186
186
|
* <en/> Target node ID
|
|
187
187
|
*/
|
|
188
188
|
target: ID;
|
|
189
|
-
/**
|
|
190
|
-
* <zh/> 边的起点 shape
|
|
191
|
-
*
|
|
192
|
-
* <en/> The source shape. Represents the start of the edge
|
|
193
|
-
* @internal
|
|
194
|
-
*/
|
|
195
|
-
sourceNode?: ID;
|
|
196
|
-
/**
|
|
197
|
-
* <zh/> 边的终点 shape
|
|
198
|
-
*
|
|
199
|
-
* <en/> The source shape. Represents the start of the edge
|
|
200
|
-
* @internal
|
|
201
|
-
*/
|
|
202
|
-
targetNode?: ID;
|
|
203
189
|
/**
|
|
204
190
|
* <zh/> 边类型
|
|
205
191
|
*
|
package/dist/lib/spec/graph.d.ts
CHANGED
|
@@ -38,30 +38,50 @@ export interface GraphOptions extends CanvasOptions, ViewportOptions {
|
|
|
38
38
|
* <zh/> 数据
|
|
39
39
|
*
|
|
40
40
|
* <en/> Data
|
|
41
|
+
* @remarks
|
|
42
|
+
* <zh/> 详见 [Data](/api/data/graph-data)
|
|
43
|
+
*
|
|
44
|
+
* <en/> See [Data](/en/api/data/graph-data)
|
|
41
45
|
*/
|
|
42
46
|
data?: GraphData;
|
|
43
47
|
/**
|
|
44
|
-
* <zh/>
|
|
48
|
+
* <zh/> 布局配置项
|
|
49
|
+
*
|
|
50
|
+
* <en/> Layout options
|
|
51
|
+
* @remarks
|
|
52
|
+
* <zh/> 详见 [Layout](/api/layouts/antv-dagre-layout)
|
|
45
53
|
*
|
|
46
|
-
* <en/> Layout
|
|
54
|
+
* <en/> See [Layout](/en/api/layouts/antv-dagre-layout)
|
|
47
55
|
*/
|
|
48
56
|
layout?: LayoutOptions;
|
|
49
57
|
/**
|
|
50
|
-
* <zh/>
|
|
58
|
+
* <zh/> 节点配置项
|
|
59
|
+
*
|
|
60
|
+
* <en/> Node options
|
|
61
|
+
* @remarks
|
|
62
|
+
* <zh/> 详见 [Node](/api/elements/nodes/base-node)
|
|
51
63
|
*
|
|
52
|
-
* <en/> Node
|
|
64
|
+
* <en/> See [Node](/en/api/elements/nodes/base-node)
|
|
53
65
|
*/
|
|
54
66
|
node?: NodeOptions;
|
|
55
67
|
/**
|
|
56
|
-
* <zh/>
|
|
68
|
+
* <zh/> 边配置项
|
|
57
69
|
*
|
|
58
|
-
* <en/> Edge
|
|
70
|
+
* <en/> Edge options
|
|
71
|
+
* @remarks
|
|
72
|
+
* <zh/> 详见 [Edge](/api/elements/edges/base-edge)
|
|
73
|
+
*
|
|
74
|
+
* <en/> See [Edge](/en/api/elements/edges/base-edge)
|
|
59
75
|
*/
|
|
60
76
|
edge?: EdgeOptions;
|
|
61
77
|
/**
|
|
62
|
-
* <zh/>
|
|
78
|
+
* <zh/> 组合配置项
|
|
63
79
|
*
|
|
64
|
-
* <en/> Combo
|
|
80
|
+
* <en/> Combo options
|
|
81
|
+
* @remarks
|
|
82
|
+
* <zh/> 详见 [Combo](/api/elements/combos/base-combo)
|
|
83
|
+
*
|
|
84
|
+
* <en/> See [Combo](/en/api/elements/combos/base-combo)
|
|
65
85
|
*/
|
|
66
86
|
combo?: ComboOptions;
|
|
67
87
|
/**
|
|
@@ -71,15 +91,43 @@ export interface GraphOptions extends CanvasOptions, ViewportOptions {
|
|
|
71
91
|
*/
|
|
72
92
|
theme?: ThemeOptions;
|
|
73
93
|
/**
|
|
74
|
-
* <zh/>
|
|
94
|
+
* <zh/> 启用交互
|
|
95
|
+
*
|
|
96
|
+
* <en/> Enable interactions
|
|
97
|
+
* @remarks
|
|
98
|
+
* <zh/>
|
|
99
|
+
* - 概念:[核心概念 - 交互](/manual/core-concept/behavior)
|
|
100
|
+
*
|
|
101
|
+
* - 内置交互: [交互](/api/behaviors/auto-adapt-label)
|
|
102
|
+
*
|
|
103
|
+
* - 自定义交互: [自定义扩展 - 自定义交互](/manual/advanced/custom-behavior)
|
|
75
104
|
*
|
|
76
|
-
* <en/>
|
|
105
|
+
* <en/>
|
|
106
|
+
* - Concept: [Concepts - Behavior](/en/manual/core-concept/behavior)
|
|
107
|
+
*
|
|
108
|
+
* - Built-in behaviors: [Behavior](/en/api/behaviors/auto-adapt-label)
|
|
109
|
+
*
|
|
110
|
+
* - Custom behaviors: [Custom Extension - Custom Behavior](/en/manual/advanced/custom-behavior)
|
|
77
111
|
*/
|
|
78
112
|
behaviors?: BehaviorOptions;
|
|
79
113
|
/**
|
|
80
|
-
* <zh/>
|
|
114
|
+
* <zh/> 启用插件
|
|
115
|
+
*
|
|
116
|
+
* <en/> Enable plugins
|
|
117
|
+
* @remarks
|
|
118
|
+
* <zh/>
|
|
119
|
+
* - 概念:[核心概念 - 插件](/manual/core-concept/plugin)
|
|
120
|
+
*
|
|
121
|
+
* - 内置插件: [插件](/en/api/plugins/background)
|
|
122
|
+
*
|
|
123
|
+
* - 自定义插件: [自定义扩展 - 自定义插件](/manual/advanced/custom-plugin)
|
|
124
|
+
*
|
|
125
|
+
* <en/>
|
|
126
|
+
* - Concept: [Concepts - Plugin](/en/manual/core-concept/plugin)
|
|
127
|
+
*
|
|
128
|
+
* - Built-in plugins: [Plugin](/en/api/plugins/background)
|
|
81
129
|
*
|
|
82
|
-
*
|
|
130
|
+
* - Custom plugins: [Custom Extension - Custom Plugin](/en/manual/advanced/custom-plugin)
|
|
83
131
|
*/
|
|
84
132
|
plugins?: PluginOptions;
|
|
85
133
|
/**
|
|
@@ -23,6 +23,10 @@ export interface ViewportOptions {
|
|
|
23
23
|
* <zh/> 是否自动适应
|
|
24
24
|
*
|
|
25
25
|
* <en/> whether to auto fit
|
|
26
|
+
* @remarks
|
|
27
|
+
* <zh/> 每次执行 `render` 时,都会根据 `autoFit` 进行自适应
|
|
28
|
+
*
|
|
29
|
+
* <en/> Every time `render` is executed, it will be adapted according to `autoFit`
|
|
26
30
|
*/
|
|
27
31
|
autoFit?: {
|
|
28
32
|
type: 'view';
|
|
@@ -10,5 +10,6 @@ export type BaseTransformOptions = CustomBehaviorOption;
|
|
|
10
10
|
*/
|
|
11
11
|
export declare abstract class BaseTransform<T extends BaseTransformOptions = BaseTransformOptions> extends BaseExtension<T> {
|
|
12
12
|
beforeDraw(data: DrawData, context: DrawContext): DrawData;
|
|
13
|
-
afterLayout(): void;
|
|
13
|
+
afterLayout(type: 'pre', data: DrawData): void;
|
|
14
|
+
afterLayout(type: 'post', data?: undefined): void;
|
|
14
15
|
}
|
|
@@ -2,8 +2,8 @@ import type { DisplayObject } from '@antv/g';
|
|
|
2
2
|
/**
|
|
3
3
|
* <zh/> 缓存图形样式
|
|
4
4
|
*
|
|
5
|
-
* <en/> Cache
|
|
6
|
-
* @param element - <zh/> 图形元素 | <en/>
|
|
5
|
+
* <en/> Cache shape style
|
|
6
|
+
* @param element - <zh/> 图形元素 | <en/> shape element
|
|
7
7
|
* @param name - <zh/> 样式名 | <en/> style name
|
|
8
8
|
*/
|
|
9
9
|
export declare function cacheStyle(element: DisplayObject, name: string | string[]): void;
|
|
@@ -11,7 +11,7 @@ export declare function cacheStyle(element: DisplayObject, name: string | string
|
|
|
11
11
|
* <zh/> 获取缓存的样式
|
|
12
12
|
*
|
|
13
13
|
* <en/> Get cached style
|
|
14
|
-
* @param element - <zh/> 图形元素 | <en/>
|
|
14
|
+
* @param element - <zh/> 图形元素 | <en/> shape element
|
|
15
15
|
* @param name - <zh/> 样式名 | <en/> style name
|
|
16
16
|
* @returns <zh/> 样式值 | <en/> style value
|
|
17
17
|
*/
|
|
@@ -20,7 +20,7 @@ export declare function getCachedStyle(element: DisplayObject, name: string): an
|
|
|
20
20
|
* <zh/> 是否有缓存的样式
|
|
21
21
|
*
|
|
22
22
|
* <en/> Whether there is a cached style
|
|
23
|
-
* @param element - <zh/> 图形元素 | <en/>
|
|
23
|
+
* @param element - <zh/> 图形元素 | <en/> shape element
|
|
24
24
|
* @param name - <zh/> 样式名 | <en/> style name
|
|
25
25
|
* @returns <zh/> 是否有缓存的样式 | <en/> Whether there is a cached style
|
|
26
26
|
*/
|
|
@@ -29,7 +29,7 @@ export declare function hasCachedStyle(element: DisplayObject, name: string): bo
|
|
|
29
29
|
* <zh/> 设置缓存的样式
|
|
30
30
|
*
|
|
31
31
|
* <en/> Set cached style
|
|
32
|
-
* @param element - <zh/> 图形元素 | <en/>
|
|
32
|
+
* @param element - <zh/> 图形元素 | <en/> shape element
|
|
33
33
|
* @param name - <zh/> 样式名 | <en/> style name
|
|
34
34
|
* @param value - <zh/> 样式值 | <en/> style value
|
|
35
35
|
*/
|