@antv/g6 5.0.16 → 5.0.17
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/behaviors/optimize-viewport-transform.d.ts +0 -1
- package/dist/lib/constants/registry.d.ts +7 -1
- package/dist/lib/elements/edges/polyline.d.ts +1 -0
- package/dist/lib/elements/shapes/base-shape.d.ts +51 -2
- package/dist/lib/exports.d.ts +3 -2
- package/dist/lib/plugins/edge-filter-lens/index.d.ts +125 -0
- package/dist/lib/plugins/index.d.ts +2 -0
- package/dist/lib/registry/types.d.ts +4 -0
- package/dist/lib/runtime/plugin.d.ts +1 -1
- package/dist/lib/version.d.ts +1 -1
- package/esm/behaviors/optimize-viewport-transform.d.ts +0 -1
- package/esm/behaviors/optimize-viewport-transform.js +5 -4
- package/esm/behaviors/optimize-viewport-transform.js.map +1 -1
- package/esm/constants/registry.d.ts +7 -1
- package/esm/constants/registry.js +6 -0
- package/esm/constants/registry.js.map +1 -1
- package/esm/elements/edges/polyline.d.ts +1 -0
- package/esm/elements/edges/polyline.js +5 -1
- package/esm/elements/edges/polyline.js.map +1 -1
- package/esm/elements/shapes/base-shape.d.ts +51 -2
- package/esm/elements/shapes/base-shape.js +22 -4
- package/esm/elements/shapes/base-shape.js.map +1 -1
- package/esm/exports.d.ts +3 -2
- package/esm/exports.js +1 -1
- package/esm/exports.js.map +1 -1
- package/esm/plugins/edge-filter-lens/index.d.ts +125 -0
- package/esm/plugins/edge-filter-lens/index.js +236 -0
- package/esm/plugins/edge-filter-lens/index.js.map +1 -0
- package/esm/plugins/index.d.ts +2 -0
- package/esm/plugins/index.js +1 -0
- package/esm/plugins/index.js.map +1 -1
- package/esm/plugins/snapline/index.js +2 -2
- package/esm/plugins/snapline/index.js.map +1 -1
- package/esm/registry/build-in.js +19 -1
- package/esm/registry/build-in.js.map +1 -1
- package/esm/registry/store.js +1 -0
- package/esm/registry/store.js.map +1 -1
- package/esm/registry/types.d.ts +4 -0
- package/esm/runtime/plugin.d.ts +1 -1
- package/esm/runtime/plugin.js +8 -1
- package/esm/runtime/plugin.js.map +1 -1
- package/esm/version.d.ts +1 -1
- package/esm/version.js +1 -1
- package/lib/behaviors/optimize-viewport-transform.d.ts +0 -1
- package/lib/behaviors/optimize-viewport-transform.js +5 -4
- package/lib/behaviors/optimize-viewport-transform.js.map +1 -1
- package/lib/constants/registry.d.ts +7 -1
- package/lib/constants/registry.js +6 -0
- package/lib/constants/registry.js.map +1 -1
- package/lib/elements/edges/polyline.d.ts +1 -0
- package/lib/elements/edges/polyline.js +5 -1
- package/lib/elements/edges/polyline.js.map +1 -1
- package/lib/elements/shapes/base-shape.d.ts +51 -2
- package/lib/elements/shapes/base-shape.js +22 -4
- package/lib/elements/shapes/base-shape.js.map +1 -1
- package/lib/exports.d.ts +3 -2
- package/lib/exports.js +3 -1
- package/lib/exports.js.map +1 -1
- package/lib/plugins/edge-filter-lens/index.d.ts +125 -0
- package/lib/plugins/edge-filter-lens/index.js +240 -0
- package/lib/plugins/edge-filter-lens/index.js.map +1 -0
- package/lib/plugins/index.d.ts +2 -0
- package/lib/plugins/index.js +3 -1
- package/lib/plugins/index.js.map +1 -1
- package/lib/plugins/snapline/index.js +2 -2
- package/lib/plugins/snapline/index.js.map +1 -1
- package/lib/registry/build-in.js +18 -0
- package/lib/registry/build-in.js.map +1 -1
- package/lib/registry/store.js +1 -0
- package/lib/registry/store.js.map +1 -1
- package/lib/registry/types.d.ts +4 -0
- package/lib/runtime/plugin.d.ts +1 -1
- package/lib/runtime/plugin.js +8 -1
- package/lib/runtime/plugin.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/src/behaviors/optimize-viewport-transform.ts +4 -10
- package/src/constants/registry.ts +6 -0
- package/src/elements/edges/polyline.ts +7 -1
- package/src/elements/shapes/base-shape.ts +75 -5
- package/src/exports.ts +5 -0
- package/src/plugins/edge-filter-lens/index.ts +391 -0
- package/src/plugins/index.ts +2 -0
- package/src/plugins/snapline/index.ts +2 -2
- package/src/registry/build-in.ts +30 -0
- package/src/registry/store.ts +1 -0
- package/src/registry/types.ts +2 -0
- package/src/runtime/plugin.ts +8 -1
- package/src/version.ts +1 -1
|
@@ -43,7 +43,6 @@ export declare class OptimizeViewportTransform extends BaseBehavior<OptimizeView
|
|
|
43
43
|
static defaultOptions: Partial<OptimizeViewportTransformOptions>;
|
|
44
44
|
private isVisible;
|
|
45
45
|
constructor(context: RuntimeContext, options: OptimizeViewportTransformOptions);
|
|
46
|
-
private filterShapes;
|
|
47
46
|
private setElementsVisibility;
|
|
48
47
|
private hideShapes;
|
|
49
48
|
private showShapes;
|
|
@@ -39,6 +39,7 @@ type ParsedPolylineStyleProps = Required<PolylineStyleProps>;
|
|
|
39
39
|
export declare class Polyline extends BaseEdge {
|
|
40
40
|
static defaultStyleProps: Partial<PolylineStyleProps>;
|
|
41
41
|
constructor(options: DisplayObjectConfig<PolylineStyleProps>);
|
|
42
|
+
protected getControlPoints(attributes: ParsedPolylineStyleProps): Point[];
|
|
42
43
|
protected getPoints(attributes: ParsedPolylineStyleProps): Point[];
|
|
43
44
|
protected getKeyPath(attributes: ParsedPolylineStyleProps): PathArray;
|
|
44
45
|
protected getLoopPath(attributes: ParsedPolylineStyleProps): PathArray;
|
|
@@ -26,11 +26,12 @@ export declare abstract class BaseShape<StyleProps extends BaseShapeStyleProps>
|
|
|
26
26
|
* @param Ctor - <zh> 图形类型 | <en> shape type
|
|
27
27
|
* @param style - <zh> 图形样式 | <en> shape style
|
|
28
28
|
* @param container - <zh> 容器 | <en> container
|
|
29
|
+
* @param hooks - <zh> 钩子函数 | <en> hooks
|
|
29
30
|
* @returns <zh> 图形实例 | <en> shape instance
|
|
30
31
|
*/
|
|
31
|
-
protected upsert<T extends DisplayObject>(className: string, Ctor: {
|
|
32
|
+
protected upsert<T extends DisplayObject>(className: string, Ctor: string | {
|
|
32
33
|
new (...args: any[]): T;
|
|
33
|
-
}, style: T['attributes'] | false, container: DisplayObject): T | undefined;
|
|
34
|
+
}, style: T['attributes'] | false, container: DisplayObject, hooks?: UpsertHooks): T | undefined;
|
|
34
35
|
/**
|
|
35
36
|
* <zh/> 使用 transform 更新图形位置
|
|
36
37
|
*
|
|
@@ -67,3 +68,51 @@ export declare abstract class BaseShape<StyleProps extends BaseShapeStyleProps>
|
|
|
67
68
|
private setVisibility;
|
|
68
69
|
destroy(): void;
|
|
69
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* <zh/> 图形 upsert 方法生命周期钩子
|
|
73
|
+
*
|
|
74
|
+
* <en/> Shape upsert method lifecycle hooks
|
|
75
|
+
*/
|
|
76
|
+
export interface UpsertHooks {
|
|
77
|
+
/**
|
|
78
|
+
* <zh/> 图形创建前
|
|
79
|
+
*
|
|
80
|
+
* <en/> Before creating the shape
|
|
81
|
+
*/
|
|
82
|
+
beforeCreate?: () => void;
|
|
83
|
+
/**
|
|
84
|
+
* <zh/> 图形创建后
|
|
85
|
+
*
|
|
86
|
+
* <en/> After creating the shape
|
|
87
|
+
* @param instance - <zh/> 图形实例 | <en/> shape instance
|
|
88
|
+
*/
|
|
89
|
+
afterCreate?: (instance: DisplayObject) => void;
|
|
90
|
+
/**
|
|
91
|
+
* <zh/> 图形更新前
|
|
92
|
+
*
|
|
93
|
+
* <en/> Before updating the shape
|
|
94
|
+
* @param instance - <zh/> 图形实例 | <en/> shape instance
|
|
95
|
+
*/
|
|
96
|
+
beforeUpdate?: (instance: DisplayObject) => void;
|
|
97
|
+
/**
|
|
98
|
+
* <zh/> 图形更新后
|
|
99
|
+
*
|
|
100
|
+
* <en/> After updating the shape
|
|
101
|
+
* @param instance - <zh/> 图形实例 | <en/> shape instance
|
|
102
|
+
*/
|
|
103
|
+
afterUpdate?: (instance: DisplayObject) => void;
|
|
104
|
+
/**
|
|
105
|
+
* <zh/> 图形销毁前
|
|
106
|
+
*
|
|
107
|
+
* <en/> Before destroying the shape
|
|
108
|
+
* @param instance - <zh/> 图形实例 | <en/> shape instance
|
|
109
|
+
*/
|
|
110
|
+
beforeDestroy?: (instance: DisplayObject) => void;
|
|
111
|
+
/**
|
|
112
|
+
* <zh/> 图形销毁后
|
|
113
|
+
*
|
|
114
|
+
* <en/> After destroying the shape
|
|
115
|
+
* @param instance - <zh/> 图形实例 | <en/> shape instance
|
|
116
|
+
*/
|
|
117
|
+
afterDestroy?: (instance: DisplayObject) => void;
|
|
118
|
+
}
|
package/dist/lib/exports.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export { BaseEdge, Cubic, CubicHorizontal, CubicVertical, Line, Polyline, Quadra
|
|
|
5
5
|
export { BaseNode, Circle, Diamond, Donut, Ellipse, HTML, Hexagon, Image, Rect, Star, Triangle, } from './elements/nodes';
|
|
6
6
|
export { Badge, BaseShape, Icon, Label } from './elements/shapes';
|
|
7
7
|
export { AntVDagreLayout, BaseLayout, CircularLayout, ComboCombinedLayout, ConcentricLayout, D3ForceLayout, DagreLayout, ForceAtlas2Layout, ForceLayout, FruchtermanLayout, GridLayout, MDSLayout, RadialLayout, RandomLayout, compactBox, dendrogram, indented, mindmap, } from './layouts';
|
|
8
|
-
export { BasePlugin, BubbleSets, CameraSetting, Contextmenu, Fullscreen, GridLine, History, Hull, Legend, Minimap, Timebar, Toolbar, Tooltip, Watermark, } from './plugins';
|
|
8
|
+
export { BasePlugin, BubbleSets, CameraSetting, Contextmenu, EdgeFilterLens, Fullscreen, GridLine, History, Hull, Legend, Minimap, Snapline, Timebar, Toolbar, Tooltip, Watermark, } from './plugins';
|
|
9
9
|
export { getExtension, getExtensions } from './registry/get';
|
|
10
10
|
export { register } from './registry/register';
|
|
11
11
|
export { Graph } from './runtime/graph';
|
|
@@ -28,10 +28,11 @@ export type { BaseComboStyleProps, CircleComboStyleProps, RectComboStyleProps }
|
|
|
28
28
|
export type { BaseEdgeStyleProps, CubicHorizontalStyleProps, CubicStyleProps, CubicVerticalStyleProps, LineStyleProps, PolylineStyleProps, QuadraticStyleProps, } from './elements/edges';
|
|
29
29
|
export type { BaseNodeStyleProps, CircleStyleProps, DiamondStyleProps, DonutStyleProps, EllipseStyleProps, HTMLStyleProps, HexagonStyleProps, ImageStyleProps, RectStyleProps, StarStyleProps, TriangleStyleProps, } from './elements/nodes';
|
|
30
30
|
export type { BadgeStyleProps, BaseShapeStyleProps, IconStyleProps, LabelStyleProps, PolygonStyleProps, } from './elements/shapes';
|
|
31
|
+
export type { UpsertHooks } from './elements/shapes/base-shape';
|
|
31
32
|
export type { ContourLabelStyleProps, ContourStyleProps } from './elements/shapes/contour';
|
|
32
33
|
export type { BaseLayoutOptions, WebWorkerLayoutOptions } from './layouts/types';
|
|
33
34
|
export type { CategoricalPalette } from './palettes/types';
|
|
34
|
-
export type { BasePluginOptions, BubbleSetsOptions, CameraSettingOptions, ContextmenuOptions, FullscreenOptions, GridLineOptions, HistoryOptions, HullOptions, LegendOptions, MinimapOptions, TimebarOptions, ToolbarOptions, TooltipOptions, WatermarkOptions, } from './plugins';
|
|
35
|
+
export type { BasePluginOptions, BubbleSetsOptions, CameraSettingOptions, ContextmenuOptions, EdgeFilterLensOptions, FullscreenOptions, GridLineOptions, HistoryOptions, HullOptions, LegendOptions, MinimapOptions, SnaplineOptions, TimebarOptions, ToolbarOptions, TooltipOptions, WatermarkOptions, } from './plugins';
|
|
35
36
|
export type { DataURLOptions } from './runtime/canvas';
|
|
36
37
|
export type { RuntimeContext } from './runtime/types';
|
|
37
38
|
export type { BehaviorOptions, CanvasOptions, ComboData, ComboOptions, EdgeData, EdgeOptions, GraphData, GraphOptions, NodeData, NodeOptions, PluginOptions, ThemeOptions, ViewportOptions, } from './spec';
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import type { BaseStyleProps } from '@antv/g';
|
|
2
|
+
import type { RuntimeContext } from '../../runtime/types';
|
|
3
|
+
import type { EdgeData, NodeData } from '../../spec';
|
|
4
|
+
import type { EdgeStyle } from '../../spec/element/edge';
|
|
5
|
+
import type { NodeStyle } from '../../spec/element/node';
|
|
6
|
+
import type { ElementType, ID, IPointerEvent } from '../../types';
|
|
7
|
+
import type { BasePluginOptions } from '../base-plugin';
|
|
8
|
+
import { BasePlugin } from '../base-plugin';
|
|
9
|
+
export interface EdgeFilterLensOptions extends BasePluginOptions {
|
|
10
|
+
/**
|
|
11
|
+
* <zh/> 移动透镜的方式
|
|
12
|
+
* - `'pointermove'`:始终跟随鼠标移动
|
|
13
|
+
* - `'click'`:鼠标点击时透镜移动
|
|
14
|
+
* - `'drag'`:拖拽透镜
|
|
15
|
+
*
|
|
16
|
+
* <en/> The way to move the lens
|
|
17
|
+
* - `'pointermove'`: always follow the mouse movement
|
|
18
|
+
* - `'click'`: move the lens when the mouse clicks
|
|
19
|
+
* - `'drag'`: drag the lens
|
|
20
|
+
* @defaultValue 'pointermove'
|
|
21
|
+
*/
|
|
22
|
+
trigger?: 'pointermove' | 'click' | 'drag';
|
|
23
|
+
/**
|
|
24
|
+
* <zh/> 透镜的半径
|
|
25
|
+
*
|
|
26
|
+
* <en/> The radius of the lens
|
|
27
|
+
* @defaultValue 60
|
|
28
|
+
*/
|
|
29
|
+
r?: number;
|
|
30
|
+
/**
|
|
31
|
+
* <zh/> 透镜的最大半径。只有在开启 `scaleRByWheel` 时生效
|
|
32
|
+
*
|
|
33
|
+
* <en/> The maximum radius of the lens. Only valid when `scaleRByWheel` is enabled
|
|
34
|
+
* @defaultValue canvas 宽高最小值的一半
|
|
35
|
+
*/
|
|
36
|
+
maxR?: number;
|
|
37
|
+
/**
|
|
38
|
+
* <zh/> 透镜的最小半径。只有在开启 `scaleRByWheel` 时生效
|
|
39
|
+
*
|
|
40
|
+
* <en/> The minimum radius of the lens. Only valid when `scaleRByWheel` is enabled
|
|
41
|
+
* @defaultValue 0
|
|
42
|
+
*/
|
|
43
|
+
minR?: number;
|
|
44
|
+
/**
|
|
45
|
+
* <zh/> 是否通过滚轮缩放透镜的半径
|
|
46
|
+
*
|
|
47
|
+
* <en/> Whether to scale the radius of the lens by wheel
|
|
48
|
+
* @defaultValue true
|
|
49
|
+
*/
|
|
50
|
+
scaleRByWheel?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* <zh/> 边显示的条件
|
|
53
|
+
* - `'both'`:只有起始节点和目标节点都在透镜中时,边才会显示
|
|
54
|
+
* - `'source'`:只有起始节点在透镜中时,边才会显示
|
|
55
|
+
* - `'target'`:只有目标节点在透镜中时,边才会显示
|
|
56
|
+
* - `'either'`:只要起始节点或目标节点有一个在透镜中时,边就会显示
|
|
57
|
+
*
|
|
58
|
+
* <zh/> The condition for displaying the edge
|
|
59
|
+
* - `'both'`: The edge is displayed only when both the source node and the target node are in the lens
|
|
60
|
+
* - `'source'`: The edge is displayed only when the source node is in the lens
|
|
61
|
+
* - `'target'`: The edge is displayed only when the target node is in the lens
|
|
62
|
+
* - `'either'`: The edge is displayed when either the source node or the target node is in the lens
|
|
63
|
+
* @defaultValue 'both'
|
|
64
|
+
*/
|
|
65
|
+
nodeType?: 'both' | 'source' | 'target' | 'either';
|
|
66
|
+
/**
|
|
67
|
+
* <zh/> 过滤出始终不在透镜中显示的元素
|
|
68
|
+
*
|
|
69
|
+
* <en/> Filter elements that are never displayed in the lens
|
|
70
|
+
* @param id - <zh/> 元素的 id | <en/> The id of the element
|
|
71
|
+
* @param elementType - <zh/> 元素的类型 | <en/> The type of the element
|
|
72
|
+
* @returns <zh/> 是否显示 | <en/> Whether to display
|
|
73
|
+
*/
|
|
74
|
+
filter?: (id: ID, elementType: ElementType) => boolean;
|
|
75
|
+
/**
|
|
76
|
+
* <zh/> 透镜的样式
|
|
77
|
+
*
|
|
78
|
+
* <en/> The style of the lens
|
|
79
|
+
*/
|
|
80
|
+
style?: BaseStyleProps;
|
|
81
|
+
/**
|
|
82
|
+
* <zh/> 在透镜中节点的样式
|
|
83
|
+
*
|
|
84
|
+
* <en/> The style of the nodes displayed in the lens
|
|
85
|
+
*/
|
|
86
|
+
nodeStyle?: NodeStyle | ((datum: NodeData) => NodeStyle);
|
|
87
|
+
/**
|
|
88
|
+
* <zh/> 在透镜中边的样式
|
|
89
|
+
*
|
|
90
|
+
* <en/> The style of the edges displayed in the lens
|
|
91
|
+
*/
|
|
92
|
+
edgeStyle?: EdgeStyle | ((datum: EdgeData) => EdgeStyle);
|
|
93
|
+
/**
|
|
94
|
+
* <zh/> 是否阻止默认事件
|
|
95
|
+
*
|
|
96
|
+
* <en/> Whether to prevent the default event
|
|
97
|
+
* @defaultValue true
|
|
98
|
+
*/
|
|
99
|
+
preventDefault?: boolean;
|
|
100
|
+
}
|
|
101
|
+
export declare class EdgeFilterLens extends BasePlugin<EdgeFilterLensOptions> {
|
|
102
|
+
static defaultOptions: Partial<EdgeFilterLensOptions>;
|
|
103
|
+
constructor(context: RuntimeContext, options: EdgeFilterLensOptions);
|
|
104
|
+
private lens;
|
|
105
|
+
private shapes;
|
|
106
|
+
private r;
|
|
107
|
+
private get canvas();
|
|
108
|
+
private get isLensOn();
|
|
109
|
+
protected onEdgeFilter: (event: IPointerEvent) => void;
|
|
110
|
+
private renderLens;
|
|
111
|
+
private getFilterData;
|
|
112
|
+
private getFocusElements;
|
|
113
|
+
private renderFocusElements;
|
|
114
|
+
private getElementStyle;
|
|
115
|
+
private scaleRByWheel;
|
|
116
|
+
get graphDom(): import("@antv/g").CanvasLike | null;
|
|
117
|
+
private isLensDragging;
|
|
118
|
+
private onDragStart;
|
|
119
|
+
private onDrag;
|
|
120
|
+
private onDragEnd;
|
|
121
|
+
private bindEvents;
|
|
122
|
+
private unbindEvents;
|
|
123
|
+
update(options: Partial<EdgeFilterLensOptions>): void;
|
|
124
|
+
destroy(): void;
|
|
125
|
+
}
|
|
@@ -3,6 +3,7 @@ export { BasePlugin } from './base-plugin';
|
|
|
3
3
|
export { BubbleSets } from './bubble-sets';
|
|
4
4
|
export { CameraSetting } from './camera-setting';
|
|
5
5
|
export { Contextmenu } from './contextmenu';
|
|
6
|
+
export { EdgeFilterLens } from './edge-filter-lens';
|
|
6
7
|
export { Fullscreen } from './fullscreen';
|
|
7
8
|
export { GridLine } from './grid-line';
|
|
8
9
|
export { History } from './history';
|
|
@@ -19,6 +20,7 @@ export type { BasePluginOptions } from './base-plugin';
|
|
|
19
20
|
export type { BubbleSetsOptions } from './bubble-sets';
|
|
20
21
|
export type { CameraSettingOptions } from './camera-setting';
|
|
21
22
|
export type { ContextmenuOptions } from './contextmenu';
|
|
23
|
+
export type { EdgeFilterLensOptions } from './edge-filter-lens';
|
|
22
24
|
export type { FullscreenOptions } from './fullscreen';
|
|
23
25
|
export type { GridLineOptions } from './grid-line';
|
|
24
26
|
export type { HistoryOptions } from './history';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DisplayObject } from '@antv/g';
|
|
1
2
|
import type { STDAnimation } from '../animations/types';
|
|
2
3
|
import type { Behavior } from '../behaviors/types';
|
|
3
4
|
import type { Layout } from '../layouts/types';
|
|
@@ -36,4 +37,7 @@ export interface ExtensionRegistry {
|
|
|
36
37
|
transform: Record<string, {
|
|
37
38
|
new (...args: any[]): Transform;
|
|
38
39
|
}>;
|
|
40
|
+
shape: Record<string, {
|
|
41
|
+
new (...args: any[]): DisplayObject;
|
|
42
|
+
}>;
|
|
39
43
|
}
|
|
@@ -6,5 +6,5 @@ export declare class PluginController extends ExtensionController<BasePlugin<Cus
|
|
|
6
6
|
category: "plugin";
|
|
7
7
|
constructor(context: RuntimeContext);
|
|
8
8
|
setPlugins(plugins: PluginOptions): void;
|
|
9
|
-
getPluginInstance(key: string): BasePlugin<CustomPluginOption
|
|
9
|
+
getPluginInstance(key: string): BasePlugin<CustomPluginOption> | undefined;
|
|
10
10
|
}
|
package/dist/lib/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "5.0.
|
|
1
|
+
export declare const version = "5.0.17";
|
|
@@ -43,7 +43,6 @@ export declare class OptimizeViewportTransform extends BaseBehavior<OptimizeView
|
|
|
43
43
|
static defaultOptions: Partial<OptimizeViewportTransformOptions>;
|
|
44
44
|
private isVisible;
|
|
45
45
|
constructor(context: RuntimeContext, options: OptimizeViewportTransformOptions);
|
|
46
|
-
private filterShapes;
|
|
47
46
|
private setElementsVisibility;
|
|
48
47
|
private hideShapes;
|
|
49
48
|
private showShapes;
|
|
@@ -18,12 +18,13 @@ export class OptimizeViewportTransform extends BaseBehavior {
|
|
|
18
18
|
super(context, Object.assign({}, OptimizeViewportTransform.defaultOptions, options));
|
|
19
19
|
this.bindEvents();
|
|
20
20
|
}
|
|
21
|
-
filterShapes = (shapes, classnames) => {
|
|
22
|
-
return shapes.filter((shape) => shape.className && !classnames?.includes(shape.className));
|
|
23
|
-
};
|
|
24
21
|
setElementsVisibility = (elements, visibility, excludedClassnames) => {
|
|
25
22
|
elements.forEach((element) => {
|
|
26
|
-
setVisibility(element, visibility, false, (shape) =>
|
|
23
|
+
setVisibility(element, visibility, false, (shape) => {
|
|
24
|
+
if (!shape.className)
|
|
25
|
+
return true;
|
|
26
|
+
return !excludedClassnames?.includes(shape.className);
|
|
27
|
+
});
|
|
27
28
|
});
|
|
28
29
|
};
|
|
29
30
|
hideShapes = (event) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"optimize-viewport-transform.js","sourceRoot":"src/","sources":["behaviors/optimize-viewport-transform.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAmC/C;;;;GAIG;AACH,MAAM,OAAO,yBAA0B,SAAQ,YAA8C;IAC3F,MAAM,CAAC,cAAc,GAA8C;QACjE,MAAM,EAAE,IAAI;QACZ,QAAQ,EAAE,GAAG;QACb,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE;KA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
* <en/> Shape
|
|
67
|
+
*/
|
|
68
|
+
ExtensionCategory["SHAPE"] = "shape";
|
|
63
69
|
})(ExtensionCategory || (ExtensionCategory = {}));
|
|
64
70
|
//# sourceMappingURL=registry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"src/","sources":["constants/registry.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"src/","sources":["constants/registry.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,iBAmEX;AAnED,WAAY,iBAAiB;IAC3B;;;;OAIG;IACH,kCAAa,CAAA;IACb;;;;OAIG;IACH,kCAAa,CAAA;IACb;;;;OAIG;IACH,oCAAe,CAAA;IACf;;;;OAIG;IACH,oCAAe,CAAA;IACf;;;;OAIG;IACH,wCAAmB,CAAA;IACnB;;;;OAIG;IACH,sCAAiB,CAAA;IACjB;;;;OAIG;IACH,0CAAqB,CAAA;IACrB;;;;OAIG;IACH,sCAAiB,CAAA;IACjB;;;;OAIG;IACH,4CAAuB,CAAA;IACvB;;;;OAIG;IACH,4CAAuB,CAAA;IACvB;;;;OAIG;IACH,oCAAe,CAAA;AACjB,CAAC,EAnEW,iBAAiB,KAAjB,iBAAiB,QAmE5B"}
|
|
@@ -39,6 +39,7 @@ type ParsedPolylineStyleProps = Required<PolylineStyleProps>;
|
|
|
39
39
|
export declare class Polyline extends BaseEdge {
|
|
40
40
|
static defaultStyleProps: Partial<PolylineStyleProps>;
|
|
41
41
|
constructor(options: DisplayObjectConfig<PolylineStyleProps>);
|
|
42
|
+
protected getControlPoints(attributes: ParsedPolylineStyleProps): Point[];
|
|
42
43
|
protected getPoints(attributes: ParsedPolylineStyleProps): Point[];
|
|
43
44
|
protected getKeyPath(attributes: ParsedPolylineStyleProps): PathArray;
|
|
44
45
|
protected getLoopPath(attributes: ParsedPolylineStyleProps): PathArray;
|
|
@@ -19,7 +19,7 @@ export class Polyline extends BaseEdge {
|
|
|
19
19
|
constructor(options) {
|
|
20
20
|
super(mergeOptions({ style: Polyline.defaultStyleProps }, options));
|
|
21
21
|
}
|
|
22
|
-
|
|
22
|
+
getControlPoints(attributes) {
|
|
23
23
|
const { router } = attributes;
|
|
24
24
|
const { sourceNode, targetNode } = this;
|
|
25
25
|
const [sourcePoint, targetPoint] = this.getEndpoints(attributes, false);
|
|
@@ -41,6 +41,10 @@ export class Polyline extends BaseEdge {
|
|
|
41
41
|
controlPoints = orth(sourcePoint, targetPoint, sourceNode, targetNode, attributes.controlPoints, router);
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
+
return controlPoints;
|
|
45
|
+
}
|
|
46
|
+
getPoints(attributes) {
|
|
47
|
+
const controlPoints = this.getControlPoints(attributes);
|
|
44
48
|
const [newSourcePoint, newTargetPoint] = this.getEndpoints(attributes, true, controlPoints);
|
|
45
49
|
return [newSourcePoint, ...controlPoints, newTargetPoint];
|
|
46
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polyline.js","sourceRoot":"src/","sources":["elements/edges/polyline.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAgCvC;;;;GAIG;AACH,MAAM,OAAO,QAAS,SAAQ,QAAQ;IACpC,MAAM,CAAC,iBAAiB,GAAgC;QACtD,MAAM,EAAE,CAAC;QACT,aAAa,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AAU,CAAC,MAAM,CAAC,CAAC;IACpD,CAAC;IAES,WAAW,CAAC,UAAoC;QACxD,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC;QACpF,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC;QAE7B,MAAM,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;QAC/B,2BAA2B;QAC3B,2FAA2F;QAC3F,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QAE1E,MAAM,EACJ,SAAS,EACT,SAAS,EACT,IAAI,GAAG,WAAW,GACnB,GAAG,aAAa,CAA2B,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,CAAC;QAEtF,OAAO,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,aAAa,EAAE,aAAa,CAAC,CAAC;IACrG,CAAC"}
|
|
@@ -26,11 +26,12 @@ export declare abstract class BaseShape<StyleProps extends BaseShapeStyleProps>
|
|
|
26
26
|
* @param Ctor - <zh> 图形类型 | <en> shape type
|
|
27
27
|
* @param style - <zh> 图形样式 | <en> shape style
|
|
28
28
|
* @param container - <zh> 容器 | <en> container
|
|
29
|
+
* @param hooks - <zh> 钩子函数 | <en> hooks
|
|
29
30
|
* @returns <zh> 图形实例 | <en> shape instance
|
|
30
31
|
*/
|
|
31
|
-
protected upsert<T extends DisplayObject>(className: string, Ctor: {
|
|
32
|
+
protected upsert<T extends DisplayObject>(className: string, Ctor: string | {
|
|
32
33
|
new (...args: any[]): T;
|
|
33
|
-
}, style: T['attributes'] | false, container: DisplayObject): T | undefined;
|
|
34
|
+
}, style: T['attributes'] | false, container: DisplayObject, hooks?: UpsertHooks): T | undefined;
|
|
34
35
|
/**
|
|
35
36
|
* <zh/> 使用 transform 更新图形位置
|
|
36
37
|
*
|
|
@@ -67,3 +68,51 @@ export declare abstract class BaseShape<StyleProps extends BaseShapeStyleProps>
|
|
|
67
68
|
private setVisibility;
|
|
68
69
|
destroy(): void;
|
|
69
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* <zh/> 图形 upsert 方法生命周期钩子
|
|
73
|
+
*
|
|
74
|
+
* <en/> Shape upsert method lifecycle hooks
|
|
75
|
+
*/
|
|
76
|
+
export interface UpsertHooks {
|
|
77
|
+
/**
|
|
78
|
+
* <zh/> 图形创建前
|
|
79
|
+
*
|
|
80
|
+
* <en/> Before creating the shape
|
|
81
|
+
*/
|
|
82
|
+
beforeCreate?: () => void;
|
|
83
|
+
/**
|
|
84
|
+
* <zh/> 图形创建后
|
|
85
|
+
*
|
|
86
|
+
* <en/> After creating the shape
|
|
87
|
+
* @param instance - <zh/> 图形实例 | <en/> shape instance
|
|
88
|
+
*/
|
|
89
|
+
afterCreate?: (instance: DisplayObject) => void;
|
|
90
|
+
/**
|
|
91
|
+
* <zh/> 图形更新前
|
|
92
|
+
*
|
|
93
|
+
* <en/> Before updating the shape
|
|
94
|
+
* @param instance - <zh/> 图形实例 | <en/> shape instance
|
|
95
|
+
*/
|
|
96
|
+
beforeUpdate?: (instance: DisplayObject) => void;
|
|
97
|
+
/**
|
|
98
|
+
* <zh/> 图形更新后
|
|
99
|
+
*
|
|
100
|
+
* <en/> After updating the shape
|
|
101
|
+
* @param instance - <zh/> 图形实例 | <en/> shape instance
|
|
102
|
+
*/
|
|
103
|
+
afterUpdate?: (instance: DisplayObject) => void;
|
|
104
|
+
/**
|
|
105
|
+
* <zh/> 图形销毁前
|
|
106
|
+
*
|
|
107
|
+
* <en/> Before destroying the shape
|
|
108
|
+
* @param instance - <zh/> 图形实例 | <en/> shape instance
|
|
109
|
+
*/
|
|
110
|
+
beforeDestroy?: (instance: DisplayObject) => void;
|
|
111
|
+
/**
|
|
112
|
+
* <zh/> 图形销毁后
|
|
113
|
+
*
|
|
114
|
+
* <en/> After destroying the shape
|
|
115
|
+
* @param instance - <zh/> 图形实例 | <en/> shape instance
|
|
116
|
+
*/
|
|
117
|
+
afterDestroy?: (instance: DisplayObject) => void;
|
|
118
|
+
}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { CustomElement } from '@antv/g';
|
|
2
2
|
import { isEmpty, isFunction, upperFirst } from '@antv/util';
|
|
3
|
+
import { ExtensionCategory } from '../../constants';
|
|
3
4
|
import { createAnimationsProxy, preprocessKeyframes } from '../../utils/animation';
|
|
4
5
|
import { updateStyle } from '../../utils/element';
|
|
5
6
|
import { subObject } from '../../utils/prefix';
|
|
7
|
+
import { format } from '../../utils/print';
|
|
6
8
|
import { getSubShapeStyle } from '../../utils/style';
|
|
7
9
|
import { replaceTranslateInTransform } from '../../utils/transform';
|
|
8
10
|
import { setVisibility } from '../../utils/visibility';
|
|
11
|
+
import { getExtension } from './../../registry/get';
|
|
9
12
|
export class BaseShape extends CustomElement {
|
|
10
13
|
constructor(options) {
|
|
11
14
|
super(options);
|
|
@@ -37,29 +40,44 @@ export class BaseShape extends CustomElement {
|
|
|
37
40
|
* @param Ctor - <zh> 图形类型 | <en> shape type
|
|
38
41
|
* @param style - <zh> 图形样式 | <en> shape style
|
|
39
42
|
* @param container - <zh> 容器 | <en> container
|
|
43
|
+
* @param hooks - <zh> 钩子函数 | <en> hooks
|
|
40
44
|
* @returns <zh> 图形实例 | <en> shape instance
|
|
41
45
|
*/
|
|
42
|
-
upsert(className, Ctor, style, container) {
|
|
46
|
+
upsert(className, Ctor, style, container, hooks) {
|
|
43
47
|
const target = this.shapeMap[className];
|
|
44
48
|
// remove
|
|
45
49
|
// 如果 style 为 false,则删除图形 / remove shape if style is false
|
|
46
50
|
if (style === false) {
|
|
47
51
|
if (target) {
|
|
52
|
+
hooks?.beforeDestroy?.(target);
|
|
48
53
|
container.removeChild(target);
|
|
49
54
|
delete this.shapeMap[className];
|
|
55
|
+
hooks?.afterDestroy?.(target);
|
|
50
56
|
}
|
|
51
57
|
return;
|
|
52
58
|
}
|
|
59
|
+
const _Ctor = typeof Ctor === 'string' ? getExtension(ExtensionCategory.SHAPE, Ctor) : Ctor;
|
|
60
|
+
if (!_Ctor) {
|
|
61
|
+
throw new Error(format(`Shape ${Ctor} not found`));
|
|
62
|
+
}
|
|
53
63
|
// create
|
|
54
|
-
if (!target || target.destroyed || !(target instanceof
|
|
55
|
-
target
|
|
56
|
-
|
|
64
|
+
if (!target || target.destroyed || !(target instanceof _Ctor)) {
|
|
65
|
+
if (target) {
|
|
66
|
+
hooks?.beforeDestroy?.(target);
|
|
67
|
+
target?.destroy();
|
|
68
|
+
hooks?.afterDestroy?.(target);
|
|
69
|
+
}
|
|
70
|
+
hooks?.beforeCreate?.();
|
|
71
|
+
const instance = new _Ctor({ className, style });
|
|
57
72
|
container.appendChild(instance);
|
|
58
73
|
this.shapeMap[className] = instance;
|
|
74
|
+
hooks?.afterCreate?.(instance);
|
|
59
75
|
return instance;
|
|
60
76
|
}
|
|
61
77
|
// update
|
|
78
|
+
hooks?.beforeUpdate?.(target);
|
|
62
79
|
updateStyle(target, style);
|
|
80
|
+
hooks?.afterUpdate?.(target);
|
|
63
81
|
return target;
|
|
64
82
|
}
|
|
65
83
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-shape.js","sourceRoot":"src/","sources":["elements/shapes/base-shape.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"base-shape.js","sourceRoot":"src/","sources":["elements/shapes/base-shape.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;A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QAAQ,CAA0B,IAAY;QACnD,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAM,CAAC;IAClC,CAAC;IAEO,aAAa;QACnB,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC;QACvC,aAAa,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;IACxC,CAAC;IAEM,OAAO;QACZ,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,KAAK,CAAC,OAAO,EAAE,CAAC;IAClB,CAAC;CACF;AAED;;;;;;;GAOG;AACH,SAAS,gBAAgB,CAAC,MAAqB,EAAE,SAAqB;IACpE,SAAS,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE;QAC5B,oCAAoC;QACpC,MAAM,KAAK,GAAG,MAAM,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC;QACxE,oCAAoC;QACpC,IAAI,KAAK,GAAG,CAAC,CAAC;YAAE,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/esm/exports.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export { BaseEdge, Cubic, CubicHorizontal, CubicVertical, Line, Polyline, Quadra
|
|
|
5
5
|
export { BaseNode, Circle, Diamond, Donut, Ellipse, HTML, Hexagon, Image, Rect, Star, Triangle, } from './elements/nodes';
|
|
6
6
|
export { Badge, BaseShape, Icon, Label } from './elements/shapes';
|
|
7
7
|
export { AntVDagreLayout, BaseLayout, CircularLayout, ComboCombinedLayout, ConcentricLayout, D3ForceLayout, DagreLayout, ForceAtlas2Layout, ForceLayout, FruchtermanLayout, GridLayout, MDSLayout, RadialLayout, RandomLayout, compactBox, dendrogram, indented, mindmap, } from './layouts';
|
|
8
|
-
export { BasePlugin, BubbleSets, CameraSetting, Contextmenu, Fullscreen, GridLine, History, Hull, Legend, Minimap, Timebar, Toolbar, Tooltip, Watermark, } from './plugins';
|
|
8
|
+
export { BasePlugin, BubbleSets, CameraSetting, Contextmenu, EdgeFilterLens, Fullscreen, GridLine, History, Hull, Legend, Minimap, Snapline, Timebar, Toolbar, Tooltip, Watermark, } from './plugins';
|
|
9
9
|
export { getExtension, getExtensions } from './registry/get';
|
|
10
10
|
export { register } from './registry/register';
|
|
11
11
|
export { Graph } from './runtime/graph';
|
|
@@ -28,10 +28,11 @@ export type { BaseComboStyleProps, CircleComboStyleProps, RectComboStyleProps }
|
|
|
28
28
|
export type { BaseEdgeStyleProps, CubicHorizontalStyleProps, CubicStyleProps, CubicVerticalStyleProps, LineStyleProps, PolylineStyleProps, QuadraticStyleProps, } from './elements/edges';
|
|
29
29
|
export type { BaseNodeStyleProps, CircleStyleProps, DiamondStyleProps, DonutStyleProps, EllipseStyleProps, HTMLStyleProps, HexagonStyleProps, ImageStyleProps, RectStyleProps, StarStyleProps, TriangleStyleProps, } from './elements/nodes';
|
|
30
30
|
export type { BadgeStyleProps, BaseShapeStyleProps, IconStyleProps, LabelStyleProps, PolygonStyleProps, } from './elements/shapes';
|
|
31
|
+
export type { UpsertHooks } from './elements/shapes/base-shape';
|
|
31
32
|
export type { ContourLabelStyleProps, ContourStyleProps } from './elements/shapes/contour';
|
|
32
33
|
export type { BaseLayoutOptions, WebWorkerLayoutOptions } from './layouts/types';
|
|
33
34
|
export type { CategoricalPalette } from './palettes/types';
|
|
34
|
-
export type { BasePluginOptions, BubbleSetsOptions, CameraSettingOptions, ContextmenuOptions, FullscreenOptions, GridLineOptions, HistoryOptions, HullOptions, LegendOptions, MinimapOptions, TimebarOptions, ToolbarOptions, TooltipOptions, WatermarkOptions, } from './plugins';
|
|
35
|
+
export type { BasePluginOptions, BubbleSetsOptions, CameraSettingOptions, ContextmenuOptions, EdgeFilterLensOptions, FullscreenOptions, GridLineOptions, HistoryOptions, HullOptions, LegendOptions, MinimapOptions, SnaplineOptions, TimebarOptions, ToolbarOptions, TooltipOptions, WatermarkOptions, } from './plugins';
|
|
35
36
|
export type { DataURLOptions } from './runtime/canvas';
|
|
36
37
|
export type { RuntimeContext } from './runtime/types';
|
|
37
38
|
export type { BehaviorOptions, CanvasOptions, ComboData, ComboOptions, EdgeData, EdgeOptions, GraphData, GraphOptions, NodeData, NodeOptions, PluginOptions, ThemeOptions, ViewportOptions, } from './spec';
|
package/esm/exports.js
CHANGED
|
@@ -5,7 +5,7 @@ export { BaseEdge, Cubic, CubicHorizontal, CubicVertical, Line, Polyline, Quadra
|
|
|
5
5
|
export { BaseNode, Circle, Diamond, Donut, Ellipse, HTML, Hexagon, Image, Rect, Star, Triangle, } from './elements/nodes';
|
|
6
6
|
export { Badge, BaseShape, Icon, Label } from './elements/shapes';
|
|
7
7
|
export { AntVDagreLayout, BaseLayout, CircularLayout, ComboCombinedLayout, ConcentricLayout, D3ForceLayout, DagreLayout, ForceAtlas2Layout, ForceLayout, FruchtermanLayout, GridLayout, MDSLayout, RadialLayout, RandomLayout, compactBox, dendrogram, indented, mindmap, } from './layouts';
|
|
8
|
-
export { BasePlugin, BubbleSets, CameraSetting, Contextmenu, Fullscreen, GridLine, History, Hull, Legend, Minimap, Timebar, Toolbar, Tooltip, Watermark, } from './plugins';
|
|
8
|
+
export { BasePlugin, BubbleSets, CameraSetting, Contextmenu, EdgeFilterLens, Fullscreen, GridLine, History, Hull, Legend, Minimap, Snapline, Timebar, Toolbar, Tooltip, Watermark, } from './plugins';
|
|
9
9
|
export { getExtension, getExtensions } from './registry/get';
|
|
10
10
|
export { register } from './registry/register';
|
|
11
11
|
export { Graph } from './runtime/graph';
|
package/esm/exports.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports.js","sourceRoot":"src/","sources":["exports.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,WAAW,EACX,WAAW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