@antv/g6 5.0.0-beta.26 → 5.0.0-beta.27
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/esm/constant/shape.d.ts +1 -1
- package/esm/index.d.ts +3 -1
- package/esm/index.js +1 -1
- package/esm/item/combo.d.ts +6 -4
- package/esm/item/combo.js +10 -3
- package/esm/item/combo.js.map +1 -1
- package/esm/item/edge.d.ts +12 -4
- package/esm/item/edge.js +100 -17
- package/esm/item/edge.js.map +1 -1
- package/esm/item/item.d.ts +18 -8
- package/esm/item/item.js +103 -59
- package/esm/item/item.js.map +1 -1
- package/esm/item/node.d.ts +10 -4
- package/esm/item/node.js +92 -8
- package/esm/item/node.js.map +1 -1
- package/esm/runtime/controller/data.d.ts +5 -1
- package/esm/runtime/controller/data.js +38 -1
- package/esm/runtime/controller/data.js.map +1 -1
- package/esm/runtime/controller/index.d.ts +1 -1
- package/esm/runtime/controller/index.js +1 -1
- package/esm/runtime/controller/index.js.map +1 -1
- package/esm/runtime/controller/item.d.ts +22 -11
- package/esm/runtime/controller/item.js +241 -96
- package/esm/runtime/controller/item.js.map +1 -1
- package/esm/runtime/controller/layout.d.ts +3 -0
- package/esm/runtime/controller/layout.js +178 -98
- package/esm/runtime/controller/layout.js.map +1 -1
- package/esm/runtime/controller/plugin.d.ts +3 -0
- package/esm/runtime/controller/plugin.js +66 -24
- package/esm/runtime/controller/plugin.js.map +1 -1
- package/esm/runtime/controller/viewport.js +9 -2
- package/esm/runtime/controller/viewport.js.map +1 -1
- package/esm/runtime/graph.d.ts +57 -26
- package/esm/runtime/graph.js +263 -139
- package/esm/runtime/graph.js.map +1 -1
- package/esm/stdlib/behavior/click-select.js +9 -3
- package/esm/stdlib/behavior/click-select.js.map +1 -1
- package/esm/stdlib/behavior/drag-canvas.js +6 -3
- package/esm/stdlib/behavior/drag-canvas.js.map +1 -1
- package/esm/stdlib/behavior/drag-combo.js +8 -8
- package/esm/stdlib/behavior/drag-combo.js.map +1 -1
- package/esm/stdlib/behavior/drag-node.d.ts +4 -0
- package/esm/stdlib/behavior/drag-node.js +121 -27
- package/esm/stdlib/behavior/drag-node.js.map +1 -1
- package/esm/stdlib/behavior/scroll-canvas.js +3 -3
- package/esm/stdlib/behavior/scroll-canvas.js.map +1 -1
- package/esm/stdlib/behavior/zoom-canvas.js +3 -3
- package/esm/stdlib/behavior/zoom-canvas.js.map +1 -1
- package/esm/stdlib/data/mapNodeSize.js +2 -2
- package/esm/stdlib/data/mapNodeSize.js.map +1 -1
- package/esm/stdlib/data/validateData.js +2 -2
- package/esm/stdlib/data/validateData.js.map +1 -1
- package/esm/stdlib/index.d.ts +2 -0
- package/esm/stdlib/index.js +3 -1
- package/esm/stdlib/index.js.map +1 -1
- package/esm/stdlib/item/edge/base.d.ts +2 -11
- package/esm/stdlib/item/edge/base.js +12 -105
- package/esm/stdlib/item/edge/base.js.map +1 -1
- package/esm/stdlib/item/node/base.d.ts +2 -20
- package/esm/stdlib/item/node/base.js +10 -150
- package/esm/stdlib/item/node/base.js.map +1 -1
- package/esm/stdlib/plugin/edgeFilterLens/index.js +2 -2
- package/esm/stdlib/plugin/edgeFilterLens/index.js.map +1 -1
- package/esm/stdlib/plugin/fisheye/index.js +3 -2
- package/esm/stdlib/plugin/fisheye/index.js.map +1 -1
- package/esm/stdlib/plugin/history/visibility-updated-command.js +2 -2
- package/esm/stdlib/plugin/history/visibility-updated-command.js.map +1 -1
- package/esm/stdlib/plugin/hull/index.d.ts +1 -1
- package/esm/stdlib/plugin/index.d.ts +1 -0
- package/esm/stdlib/plugin/index.js +1 -0
- package/esm/stdlib/plugin/index.js.map +1 -1
- package/esm/stdlib/plugin/lodController/index.d.ts +73 -0
- package/esm/stdlib/plugin/lodController/index.js +556 -0
- package/esm/stdlib/plugin/lodController/index.js.map +1 -0
- package/esm/stdlib/plugin/minimap/index.js +12 -14
- package/esm/stdlib/plugin/minimap/index.js.map +1 -1
- package/esm/stdlib/plugin/toolbar/index.d.ts +2 -2
- package/esm/stdlib/plugin/toolbar/index.js +27 -29
- package/esm/stdlib/plugin/toolbar/index.js.map +1 -1
- package/esm/stdlib/theme/dark.js +32 -35
- package/esm/stdlib/theme/dark.js.map +1 -1
- package/esm/stdlib/theme/light.js +27 -30
- package/esm/stdlib/theme/light.js.map +1 -1
- package/esm/stdlib/themeSolver/spec.js +2 -2
- package/esm/stdlib/themeSolver/spec.js.map +1 -1
- package/esm/types/animate.d.ts +1 -1
- package/esm/types/combo.d.ts +2 -2
- package/esm/types/edge.d.ts +2 -2
- package/esm/types/graph.d.ts +62 -43
- package/esm/types/hook.d.ts +5 -0
- package/esm/types/item.d.ts +9 -15
- package/esm/types/layout.d.ts +7 -2
- package/esm/types/layout.js.map +1 -1
- package/esm/types/node.d.ts +3 -2
- package/esm/types/plugin.d.ts +1 -0
- package/esm/types/plugin.js +1 -0
- package/esm/types/plugin.js.map +1 -1
- package/esm/types/spec.d.ts +1 -0
- package/esm/types/theme.d.ts +7 -7
- package/esm/util/animate.d.ts +7 -2
- package/esm/util/animate.js +37 -23
- package/esm/util/animate.js.map +1 -1
- package/esm/util/bbox.d.ts +7 -1
- package/esm/util/bbox.js +16 -0
- package/esm/util/bbox.js.map +1 -1
- package/esm/util/data.d.ts +7 -1
- package/esm/util/data.js +17 -5
- package/esm/util/data.js.map +1 -1
- package/esm/util/dom.js +5 -5
- package/esm/util/dom.js.map +1 -1
- package/esm/util/item.d.ts +1 -1
- package/esm/util/item.js +8 -8
- package/esm/util/item.js.map +1 -1
- package/esm/util/mapper.js +1 -1
- package/esm/util/mapper.js.map +1 -1
- package/esm/util/path.d.ts +6 -1
- package/esm/util/path.js +72 -1
- package/esm/util/path.js.map +1 -1
- package/esm/util/polyline.d.ts +10 -0
- package/esm/util/polyline.js +22 -17
- package/esm/util/polyline.js.map +1 -1
- package/esm/util/router.d.ts +1 -1
- package/esm/util/router.js +19 -18
- package/esm/util/router.js.map +1 -1
- package/esm/util/shape.d.ts +1 -1
- package/esm/util/shape.js +28 -13
- package/esm/util/shape.js.map +1 -1
- package/esm/util/zoom.d.ts +5 -8
- package/esm/util/zoom.js +15 -20
- package/esm/util/zoom.js.map +1 -1
- package/lib/constant/shape.d.ts +1 -1
- package/lib/index.d.ts +3 -1
- package/lib/index.js +1 -1
- package/lib/item/combo.d.ts +6 -4
- package/lib/item/combo.js +10 -3
- package/lib/item/combo.js.map +1 -1
- package/lib/item/edge.d.ts +12 -4
- package/lib/item/edge.js +99 -16
- package/lib/item/edge.js.map +1 -1
- package/lib/item/item.d.ts +18 -8
- package/lib/item/item.js +101 -57
- package/lib/item/item.js.map +1 -1
- package/lib/item/node.d.ts +10 -4
- package/lib/item/node.js +92 -8
- package/lib/item/node.js.map +1 -1
- package/lib/runtime/controller/data.d.ts +5 -1
- package/lib/runtime/controller/data.js +38 -1
- package/lib/runtime/controller/data.js.map +1 -1
- package/lib/runtime/controller/index.d.ts +1 -1
- package/lib/runtime/controller/index.js +1 -1
- package/lib/runtime/controller/index.js.map +1 -1
- package/lib/runtime/controller/item.d.ts +22 -11
- package/lib/runtime/controller/item.js +238 -93
- package/lib/runtime/controller/item.js.map +1 -1
- package/lib/runtime/controller/layout.d.ts +3 -0
- package/lib/runtime/controller/layout.js +178 -98
- package/lib/runtime/controller/layout.js.map +1 -1
- package/lib/runtime/controller/plugin.d.ts +3 -0
- package/lib/runtime/controller/plugin.js +66 -24
- package/lib/runtime/controller/plugin.js.map +1 -1
- package/lib/runtime/controller/viewport.js +9 -2
- package/lib/runtime/controller/viewport.js.map +1 -1
- package/lib/runtime/graph.d.ts +57 -26
- package/lib/runtime/graph.js +263 -139
- package/lib/runtime/graph.js.map +1 -1
- package/lib/stdlib/behavior/click-select.js +9 -3
- package/lib/stdlib/behavior/click-select.js.map +1 -1
- package/lib/stdlib/behavior/drag-canvas.js +6 -3
- package/lib/stdlib/behavior/drag-canvas.js.map +1 -1
- package/lib/stdlib/behavior/drag-combo.js +8 -8
- package/lib/stdlib/behavior/drag-combo.js.map +1 -1
- package/lib/stdlib/behavior/drag-node.d.ts +4 -0
- package/lib/stdlib/behavior/drag-node.js +121 -27
- package/lib/stdlib/behavior/drag-node.js.map +1 -1
- package/lib/stdlib/behavior/scroll-canvas.js +3 -3
- package/lib/stdlib/behavior/scroll-canvas.js.map +1 -1
- package/lib/stdlib/behavior/zoom-canvas.js +3 -3
- package/lib/stdlib/behavior/zoom-canvas.js.map +1 -1
- package/lib/stdlib/data/mapNodeSize.js +2 -2
- package/lib/stdlib/data/mapNodeSize.js.map +1 -1
- package/lib/stdlib/data/validateData.js +2 -2
- package/lib/stdlib/data/validateData.js.map +1 -1
- package/lib/stdlib/index.d.ts +2 -0
- package/lib/stdlib/index.js +3 -1
- package/lib/stdlib/index.js.map +1 -1
- package/lib/stdlib/item/edge/base.d.ts +2 -11
- package/lib/stdlib/item/edge/base.js +12 -105
- package/lib/stdlib/item/edge/base.js.map +1 -1
- package/lib/stdlib/item/node/base.d.ts +2 -20
- package/lib/stdlib/item/node/base.js +10 -150
- package/lib/stdlib/item/node/base.js.map +1 -1
- package/lib/stdlib/plugin/edgeFilterLens/index.js +2 -2
- package/lib/stdlib/plugin/edgeFilterLens/index.js.map +1 -1
- package/lib/stdlib/plugin/fisheye/index.js +2 -1
- package/lib/stdlib/plugin/fisheye/index.js.map +1 -1
- package/lib/stdlib/plugin/history/visibility-updated-command.js +2 -2
- package/lib/stdlib/plugin/history/visibility-updated-command.js.map +1 -1
- package/lib/stdlib/plugin/hull/index.d.ts +1 -1
- package/lib/stdlib/plugin/index.d.ts +1 -0
- package/lib/stdlib/plugin/index.js +1 -0
- package/lib/stdlib/plugin/index.js.map +1 -1
- package/lib/stdlib/plugin/lodController/index.d.ts +73 -0
- package/lib/stdlib/plugin/lodController/index.js +560 -0
- package/lib/stdlib/plugin/lodController/index.js.map +1 -0
- package/lib/stdlib/plugin/minimap/index.js +12 -14
- package/lib/stdlib/plugin/minimap/index.js.map +1 -1
- package/lib/stdlib/plugin/toolbar/index.d.ts +2 -2
- package/lib/stdlib/plugin/toolbar/index.js +27 -29
- package/lib/stdlib/plugin/toolbar/index.js.map +1 -1
- package/lib/stdlib/theme/dark.js +32 -35
- package/lib/stdlib/theme/dark.js.map +1 -1
- package/lib/stdlib/theme/light.js +27 -30
- package/lib/stdlib/theme/light.js.map +1 -1
- package/lib/stdlib/themeSolver/spec.js +2 -2
- package/lib/stdlib/themeSolver/spec.js.map +1 -1
- package/lib/types/animate.d.ts +1 -1
- package/lib/types/combo.d.ts +2 -2
- package/lib/types/edge.d.ts +2 -2
- package/lib/types/graph.d.ts +62 -43
- package/lib/types/hook.d.ts +5 -0
- package/lib/types/item.d.ts +9 -15
- package/lib/types/layout.d.ts +7 -2
- package/lib/types/layout.js.map +1 -1
- package/lib/types/node.d.ts +3 -2
- package/lib/types/plugin.d.ts +1 -0
- package/lib/types/plugin.js +1 -0
- package/lib/types/plugin.js.map +1 -1
- package/lib/types/spec.d.ts +1 -0
- package/lib/types/theme.d.ts +7 -7
- package/lib/util/animate.d.ts +7 -2
- package/lib/util/animate.js +37 -23
- package/lib/util/animate.js.map +1 -1
- package/lib/util/bbox.d.ts +7 -1
- package/lib/util/bbox.js +18 -1
- package/lib/util/bbox.js.map +1 -1
- package/lib/util/data.d.ts +7 -1
- package/lib/util/data.js +19 -6
- package/lib/util/data.js.map +1 -1
- package/lib/util/dom.js +5 -5
- package/lib/util/dom.js.map +1 -1
- package/lib/util/item.d.ts +1 -1
- package/lib/util/item.js +8 -8
- package/lib/util/item.js.map +1 -1
- package/lib/util/mapper.js +1 -1
- package/lib/util/mapper.js.map +1 -1
- package/lib/util/path.d.ts +6 -1
- package/lib/util/path.js +72 -1
- package/lib/util/path.js.map +1 -1
- package/lib/util/polyline.d.ts +10 -0
- package/lib/util/polyline.js +25 -18
- package/lib/util/polyline.js.map +1 -1
- package/lib/util/router.d.ts +1 -1
- package/lib/util/router.js +19 -18
- package/lib/util/router.js.map +1 -1
- package/lib/util/shape.d.ts +1 -1
- package/lib/util/shape.js +27 -12
- package/lib/util/shape.js.map +1 -1
- package/lib/util/zoom.d.ts +5 -8
- package/lib/util/zoom.js +17 -22
- package/lib/util/zoom.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -1
- package/src/item/combo.ts +13 -5
- package/src/item/edge.ts +126 -17
- package/src/item/item.ts +119 -57
- package/src/item/node.ts +108 -11
- package/src/runtime/controller/data.ts +64 -3
- package/src/runtime/controller/index.ts +1 -1
- package/src/runtime/controller/item.ts +321 -135
- package/src/runtime/controller/layout.ts +254 -113
- package/src/runtime/controller/plugin.ts +86 -33
- package/src/runtime/controller/viewport.ts +8 -2
- package/src/runtime/graph.ts +383 -158
- package/src/stdlib/behavior/click-select.ts +8 -3
- package/src/stdlib/behavior/drag-canvas.ts +6 -3
- package/src/stdlib/behavior/drag-combo.ts +8 -8
- package/src/stdlib/behavior/drag-node.ts +165 -50
- package/src/stdlib/behavior/scroll-canvas.ts +3 -3
- package/src/stdlib/behavior/zoom-canvas.ts +3 -3
- package/src/stdlib/data/mapNodeSize.ts +2 -2
- package/src/stdlib/data/validateData.ts +2 -2
- package/src/stdlib/index.ts +3 -0
- package/src/stdlib/item/edge/base.ts +15 -139
- package/src/stdlib/item/node/base.ts +20 -215
- package/src/stdlib/plugin/edgeFilterLens/index.ts +2 -2
- package/src/stdlib/plugin/fisheye/index.ts +3 -2
- package/src/stdlib/plugin/history/visibility-updated-command.ts +2 -2
- package/src/stdlib/plugin/index.ts +1 -0
- package/src/stdlib/plugin/lodController/index.ts +602 -0
- package/src/stdlib/plugin/minimap/index.ts +12 -14
- package/src/stdlib/plugin/toolbar/index.ts +29 -31
- package/src/stdlib/theme/dark.ts +32 -34
- package/src/stdlib/theme/light.ts +27 -29
- package/src/stdlib/themeSolver/spec.ts +2 -2
- package/src/types/animate.ts +1 -1
- package/src/types/combo.ts +2 -2
- package/src/types/edge.ts +2 -2
- package/src/types/graph.ts +65 -53
- package/src/types/hook.ts +5 -0
- package/src/types/item.ts +8 -14
- package/src/types/layout.ts +20 -15
- package/src/types/node.ts +3 -2
- package/src/types/plugin.ts +2 -0
- package/src/types/spec.ts +1 -0
- package/src/types/theme.ts +7 -7
- package/src/util/animate.ts +104 -78
- package/src/util/bbox.ts +26 -1
- package/src/util/data.ts +15 -6
- package/src/util/dom.ts +6 -6
- package/src/util/item.ts +15 -1
- package/src/util/mapper.ts +1 -1
- package/src/util/path.ts +72 -2
- package/src/util/polyline.ts +30 -23
- package/src/util/router.ts +21 -19
- package/src/util/shape.ts +27 -12
- package/src/util/zoom.ts +19 -25
- package/esm/runtime/controller/extension.d.ts +0 -9
- package/esm/runtime/controller/extension.js +0 -11
- package/esm/runtime/controller/extension.js.map +0 -1
- package/lib/runtime/controller/extension.d.ts +0 -9
- package/lib/runtime/controller/extension.js +0 -15
- package/lib/runtime/controller/extension.js.map +0 -1
- package/src/runtime/controller/extension.ts +0 -14
package/esm/types/combo.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Node as GNode, PlainObject } from '@antv/graphlib';
|
|
|
2
2
|
import { ImageStyleProps, TextStyleProps } from '@antv/gui/lib/shapes';
|
|
3
3
|
import { IAnimates } from './animate';
|
|
4
4
|
import { Padding } from './common';
|
|
5
|
-
import { BadgePosition, Encode, IItem, ItemShapeStyles, LabelBackground, ShapeAttrEncode, ShapesEncode, ShapeStyle,
|
|
5
|
+
import { BadgePosition, Encode, IItem, ItemShapeStyles, LabelBackground, ShapeAttrEncode, ShapesEncode, ShapeStyle, LodLevel } from './item';
|
|
6
6
|
import { NodeShapeMap } from './node';
|
|
7
7
|
export type ComboLabelPosition = 'bottom' | 'center' | 'top' | 'left' | 'left-top' | 'right' | 'outside-top' | 'outside-left' | 'outside-right' | 'outside-bottom';
|
|
8
8
|
/** User input data. Combo data has no position info, which is always depends on children's combined bounds. */
|
|
@@ -102,7 +102,7 @@ export interface ComboShapeStyles extends ItemShapeStyles {
|
|
|
102
102
|
}
|
|
103
103
|
/** Displayed data, only for drawing and not received by users. */
|
|
104
104
|
export type ComboDisplayModelData = ComboModelData & ComboShapeStyles & {
|
|
105
|
-
|
|
105
|
+
lodLevels?: LodLevel[];
|
|
106
106
|
x?: number;
|
|
107
107
|
y?: number;
|
|
108
108
|
z?: number;
|
package/esm/types/edge.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { DisplayObject, PathStyleProps } from '@antv/g';
|
|
|
2
2
|
import { Edge as GEdge, PlainObject } from '@antv/graphlib';
|
|
3
3
|
import { BaseEdge } from '../stdlib/item/edge/base';
|
|
4
4
|
import { IAnimates } from './animate';
|
|
5
|
-
import { Encode, IItem, ItemShapeStyles, LabelBackground,
|
|
5
|
+
import { Encode, IItem, ItemShapeStyles, LabelBackground, LodLevel, ShapeAttrEncode, ShapeStyle, ShapesEncode } from './item';
|
|
6
6
|
export interface EdgeUserModelData extends PlainObject {
|
|
7
7
|
/**
|
|
8
8
|
* Anchor index to link to the source / target node.
|
|
@@ -68,7 +68,7 @@ export interface EdgeShapeStyles extends ItemShapeStyles {
|
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
70
|
export type EdgeDisplayModelData = EdgeModelData & EdgeShapeStyles & {
|
|
71
|
-
|
|
71
|
+
lodLevels?: LodLevel[];
|
|
72
72
|
};
|
|
73
73
|
/** User input data. */
|
|
74
74
|
export type EdgeUserModel = GEdge<EdgeUserModelData>;
|
package/esm/types/graph.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { BehaviorOptionsOf, BehaviorRegistry } from './behavior';
|
|
|
8
8
|
import { ComboModel, ComboUserModel } from './combo';
|
|
9
9
|
import { Padding, Point } from './common';
|
|
10
10
|
import { GraphData } from './data';
|
|
11
|
-
import { EdgeModel, EdgeUserModel } from './edge';
|
|
11
|
+
import { EdgeDisplayModel, EdgeModel, EdgeUserModel } from './edge';
|
|
12
12
|
import type { StackType } from './history';
|
|
13
13
|
import { ITEM_TYPE, SHAPE_TYPE, ShapeStyle } from './item';
|
|
14
14
|
import { LayoutOptions } from './layout';
|
|
@@ -21,6 +21,7 @@ export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends
|
|
|
21
21
|
[x: string]: any;
|
|
22
22
|
hooks: Hooks;
|
|
23
23
|
canvas: Canvas;
|
|
24
|
+
labelCanvas: Canvas;
|
|
24
25
|
transientCanvas: Canvas;
|
|
25
26
|
destroyed: boolean;
|
|
26
27
|
container: HTMLElement;
|
|
@@ -102,6 +103,12 @@ export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends
|
|
|
102
103
|
* @group Data
|
|
103
104
|
*/
|
|
104
105
|
getRelatedEdgesData: (nodeId: ID, direction?: 'in' | 'out' | 'both') => EdgeModel[];
|
|
106
|
+
/**
|
|
107
|
+
* Get nearby edges from a start node using quadtree collision detection.
|
|
108
|
+
* @param nodeId id of the start node
|
|
109
|
+
* @returns nearby edges' data array
|
|
110
|
+
*/
|
|
111
|
+
getNearEdgesData: (nodeId: ID, shouldBegin?: (edge: EdgeDisplayModel) => boolean) => EdgeModel[];
|
|
105
112
|
/**
|
|
106
113
|
* Get one-hop node ids from a start node.
|
|
107
114
|
* @param nodeId id of the start node
|
|
@@ -109,12 +116,6 @@ export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends
|
|
|
109
116
|
* @group Data
|
|
110
117
|
*/
|
|
111
118
|
getNeighborNodesData: (nodeId: ID, direction?: 'in' | 'out' | 'both') => NodeModel[];
|
|
112
|
-
/**
|
|
113
|
-
* Retrieve the nearby edges for a given node using quadtree collision detection.
|
|
114
|
-
* @param nodeId target node's id
|
|
115
|
-
* @returns edges
|
|
116
|
-
*/
|
|
117
|
-
getNearEdgesForNode: (nodeId: ID) => EdgeModel[];
|
|
118
119
|
getComboChildrenData: (comboId: ID) => (ComboModel | NodeModel)[];
|
|
119
120
|
/**
|
|
120
121
|
* Get item type by id.
|
|
@@ -134,10 +135,11 @@ export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends
|
|
|
134
135
|
* Change graph data.
|
|
135
136
|
* @param data new data
|
|
136
137
|
* @param type the way to change data, 'replace' means discard the old data and use the new one; 'mergeReplace' means merge the common part, remove (old - new), add (new - old)
|
|
138
|
+
* @param relayout whether relayout the nodes after data changing
|
|
137
139
|
* @returns
|
|
138
140
|
* @group Data
|
|
139
141
|
*/
|
|
140
|
-
changeData: (data: GraphData, type
|
|
142
|
+
changeData: (data: GraphData, type?: 'replace' | 'mergeReplace', relayout?: boolean) => void;
|
|
141
143
|
/**
|
|
142
144
|
* Clear the graph, means remove all the items on the graph.
|
|
143
145
|
* @returns
|
|
@@ -157,52 +159,57 @@ export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends
|
|
|
157
159
|
* Add one or more node/edge/combo data to the graph.
|
|
158
160
|
* @param itemType item type
|
|
159
161
|
* @param model user data
|
|
160
|
-
* @param stack whether push this operation to stack
|
|
161
162
|
* @returns whehter success
|
|
162
163
|
* @group Data
|
|
163
164
|
*/
|
|
164
|
-
addData: (itemType: ITEM_TYPE, model: NodeUserModel | EdgeUserModel | ComboUserModel | NodeUserModel[] | EdgeUserModel[] | ComboUserModel[]
|
|
165
|
+
addData: (itemType: ITEM_TYPE, model: NodeUserModel | EdgeUserModel | ComboUserModel | NodeUserModel[] | EdgeUserModel[] | ComboUserModel[]) => NodeModel | EdgeModel | ComboModel | NodeModel[] | EdgeModel[] | ComboModel[];
|
|
165
166
|
/**
|
|
166
167
|
* Remove one or more node/edge/combo data from the graph.
|
|
167
|
-
* @param
|
|
168
|
-
* @param
|
|
168
|
+
* @param itemType the type the item(s) to be removed.
|
|
169
|
+
* @param id the id or the ids' array of the items to be removed.
|
|
169
170
|
* @returns whehter success
|
|
170
171
|
* @group Data
|
|
171
172
|
*/
|
|
172
|
-
removeData: (itemType: ITEM_TYPE, id: ID | ID[]
|
|
173
|
+
removeData: (itemType: ITEM_TYPE, id: ID | ID[]) => void;
|
|
173
174
|
/**
|
|
174
175
|
* Update one or more node/edge/combo data on the graph.
|
|
175
|
-
* @param
|
|
176
|
-
* @param
|
|
177
|
-
* @param {boolean} stack whether push this operation to stack
|
|
176
|
+
* @param itemType the type the item(s) to be udated.
|
|
177
|
+
* @param models update configs.
|
|
178
178
|
* @group Data
|
|
179
179
|
*/
|
|
180
|
-
updateData: (itemType: ITEM_TYPE, model: Partial<NodeUserModel> | Partial<EdgeUserModel> | Partial<ComboUserModel | Partial<NodeUserModel>[] | Partial<EdgeUserModel>[] | Partial<ComboUserModel>[]
|
|
180
|
+
updateData: (itemType: ITEM_TYPE, model: Partial<NodeUserModel> | Partial<EdgeUserModel> | Partial<ComboUserModel | Partial<NodeUserModel>[] | Partial<EdgeUserModel>[] | Partial<ComboUserModel>[]>) => NodeModel | EdgeModel | ComboModel | NodeModel[] | EdgeModel[] | ComboModel[];
|
|
181
181
|
/**
|
|
182
182
|
* Update one or more nodes' positions,
|
|
183
183
|
* do not update other styles which leads to better performance than updating positions by updateData.
|
|
184
|
-
* @param models new configurations with x and y for every node, which has id field to indicate the specific item
|
|
185
|
-
* @param
|
|
184
|
+
* @param models new configurations with x and y for every node, which has id field to indicate the specific item.
|
|
185
|
+
* @param upsertAncestors whether update the ancestors in combo tree.
|
|
186
|
+
* @param disableAnimate whether disable the animation for this call.
|
|
187
|
+
* @param callback callback function after update nodes done.
|
|
186
188
|
* @group Data
|
|
187
189
|
*/
|
|
188
|
-
updateNodePosition: (models: Partial<NodeUserModel> | Partial<ComboUserModel | Partial<NodeUserModel>[] | Partial<ComboUserModel>[]>, upsertAncestors?: boolean, disableAnimate?: boolean, callback?: (model: NodeModel | EdgeModel | ComboModel, canceled?: boolean) => void
|
|
190
|
+
updateNodePosition: (models: Partial<NodeUserModel> | Partial<ComboUserModel | Partial<NodeUserModel>[] | Partial<ComboUserModel>[]>, upsertAncestors?: boolean, disableAnimate?: boolean, callback?: (model: NodeModel | EdgeModel | ComboModel, canceled?: boolean) => void) => NodeModel | ComboModel | NodeModel[] | ComboModel[];
|
|
189
191
|
/**
|
|
190
192
|
* Update one or more combos' positions, it is achieved by move the succeed nodes.
|
|
191
193
|
* Do not update other styles which leads to better performance than updating positions by updateData.
|
|
192
|
-
* @param models new configurations with x and y for every combo, which has id field to indicate the specific item
|
|
193
|
-
* @param
|
|
194
|
+
* @param models new configurations with x and y for every combo, which has id field to indicate the specific item.
|
|
195
|
+
* @param upsertAncestors whether update the ancestors in combo tree.
|
|
196
|
+
* @param disableAnimate whether disable the animation for this call.
|
|
197
|
+
* @param callback callback function after update combos done.
|
|
194
198
|
* @group Data
|
|
195
199
|
*/
|
|
196
|
-
updateComboPosition: (models: Partial<ComboUserModel> | Partial<ComboUserModel | Partial<NodeUserModel>[] | Partial<ComboUserModel>[]>, upsertAncestors?: boolean, disableAnimate?: boolean, callback?: (model: NodeModel | EdgeModel | ComboModel) => void
|
|
200
|
+
updateComboPosition: (models: Partial<ComboUserModel> | Partial<ComboUserModel | Partial<NodeUserModel>[] | Partial<ComboUserModel>[]>, upsertAncestors?: boolean, disableAnimate?: boolean, callback?: (model: NodeModel | EdgeModel | ComboModel) => void) => NodeModel | ComboModel | NodeModel[] | ComboModel[];
|
|
197
201
|
/**
|
|
198
202
|
* Move one or more combos a distance (dx, dy) relatively,
|
|
199
203
|
* do not update other styles which leads to better performance than updating positions by updateData.
|
|
200
204
|
* In fact, it changes the succeed nodes positions to affect the combo's position, but not modify the combo's position directly.
|
|
201
|
-
* @param models new configurations with x and y for every combo, which has id field to indicate the specific item
|
|
202
|
-
* @param
|
|
205
|
+
* @param models new configurations with x and y for every combo, which has id field to indicate the specific item.
|
|
206
|
+
* @param dx the distance alone x-axis to move the combo.
|
|
207
|
+
* @param dy the distance alone y-axis to move the combo.
|
|
208
|
+
* @param upsertAncestors whether update the ancestors in the combo tree.
|
|
209
|
+
* @param callback callback function after move combo done.
|
|
203
210
|
* @group Data
|
|
204
211
|
*/
|
|
205
|
-
moveCombo: (ids: ID[], dx: number, dy: number, upsertAncestors?: boolean, callback?: (model: NodeModel | EdgeModel | ComboModel, canceled?: boolean) => void
|
|
212
|
+
moveCombo: (ids: ID[], dx: number, dy: number, upsertAncestors?: boolean, callback?: (model: NodeModel | EdgeModel | ComboModel, canceled?: boolean) => void) => ComboModel[];
|
|
206
213
|
/**
|
|
207
214
|
* Move the graph with a relative vector.
|
|
208
215
|
* @param dx x of the relative vector
|
|
@@ -339,28 +346,36 @@ export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends
|
|
|
339
346
|
* @returns
|
|
340
347
|
* @group Data
|
|
341
348
|
*/
|
|
342
|
-
showItem: (ids: ID | ID[],
|
|
349
|
+
showItem: (ids: ID | ID[], options?: {
|
|
350
|
+
disableAnimate?: boolean;
|
|
351
|
+
shapeIds?: string[];
|
|
352
|
+
}) => void;
|
|
343
353
|
/**
|
|
344
354
|
* Hide the item(s).
|
|
345
355
|
* @param ids the item id(s) to be hidden
|
|
346
356
|
* @returns
|
|
347
357
|
* @group Item
|
|
348
358
|
*/
|
|
349
|
-
hideItem: (ids: ID | ID[],
|
|
359
|
+
hideItem: (ids: ID | ID[], options?: {
|
|
360
|
+
disableAnimate?: boolean;
|
|
361
|
+
keepKeyShape?: boolean;
|
|
362
|
+
keepRelated?: boolean;
|
|
363
|
+
shapeIds?: string[];
|
|
364
|
+
}) => void;
|
|
350
365
|
/**
|
|
351
366
|
* Make the item(s) to the front.
|
|
352
367
|
* @param ids the item id(s) to front
|
|
353
368
|
* @returns
|
|
354
369
|
* @group Item
|
|
355
370
|
*/
|
|
356
|
-
frontItem: (ids: ID | ID[]
|
|
371
|
+
frontItem: (ids: ID | ID[]) => void;
|
|
357
372
|
/**
|
|
358
373
|
* Make the item(s) to the back.
|
|
359
374
|
* @param ids the item id(s) to back
|
|
360
375
|
* @returns
|
|
361
376
|
* @group Item
|
|
362
377
|
*/
|
|
363
|
-
backItem: (ids: ID | ID[]
|
|
378
|
+
backItem: (ids: ID | ID[]) => void;
|
|
364
379
|
/**
|
|
365
380
|
* Set state for the item(s).
|
|
366
381
|
* @param ids the id(s) for the item(s) to be set
|
|
@@ -369,7 +384,7 @@ export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends
|
|
|
369
384
|
* @returns
|
|
370
385
|
* @group Item
|
|
371
386
|
*/
|
|
372
|
-
setItemState: (ids: ID | ID[], state: string, value: boolean
|
|
387
|
+
setItemState: (ids: ID | ID[], state: string, value: boolean) => void;
|
|
373
388
|
/**
|
|
374
389
|
* Get the state value for an item.
|
|
375
390
|
* @param id the id for the item
|
|
@@ -392,7 +407,7 @@ export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends
|
|
|
392
407
|
* @returns
|
|
393
408
|
* @group Item
|
|
394
409
|
*/
|
|
395
|
-
clearItemState: (ids: ID | ID[], states?: string[]
|
|
410
|
+
clearItemState: (ids: ID | ID[], states?: string[]) => void;
|
|
396
411
|
/**
|
|
397
412
|
* Get the rendering bbox for a node / edge / combo, or the graph (when the id is not assigned).
|
|
398
413
|
* @param id the id for the node / edge / combo, undefined for the whole graph
|
|
@@ -405,28 +420,34 @@ export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends
|
|
|
405
420
|
* @returns visibility for the item, false for invisible or unexistence for the item
|
|
406
421
|
*/
|
|
407
422
|
getItemVisible: (id: ID) => boolean;
|
|
423
|
+
/**
|
|
424
|
+
* Get the visible shape ids in a node / edge / combo.
|
|
425
|
+
* @param id the id for the node / edge / combo
|
|
426
|
+
* @returns ids of the visible shapes
|
|
427
|
+
*/
|
|
428
|
+
getItemVisibleShapeIds: (id: ID) => string[];
|
|
408
429
|
/**
|
|
409
430
|
* Add a new combo to the graph, and update the structure of the existed child in childrenIds to be the children of the new combo.
|
|
410
431
|
* Different from addData with combo type, this API update the succeeds' combo tree strucutres in the same time.
|
|
411
|
-
* @param model combo user data
|
|
412
|
-
* @param
|
|
432
|
+
* @param model combo user data.
|
|
433
|
+
* @param childrenIds the ids of the children nodes / combos to move into the new combo.
|
|
413
434
|
* @returns whether success
|
|
414
435
|
* @group Combo
|
|
415
436
|
*/
|
|
416
|
-
addCombo: (model: ComboUserModel, childrenIds: ID[]
|
|
437
|
+
addCombo: (model: ComboUserModel, childrenIds: ID[]) => ComboModel;
|
|
417
438
|
/**
|
|
418
439
|
* Collapse a combo.
|
|
419
|
-
* @param comboId combo id or
|
|
440
|
+
* @param comboId combo id or ids' array.
|
|
420
441
|
* @group Combo
|
|
421
442
|
*/
|
|
422
|
-
collapseCombo: (comboIds: ID | ID[]
|
|
443
|
+
collapseCombo: (comboIds: ID | ID[]) => void;
|
|
423
444
|
/**
|
|
424
445
|
* Expand a combo.
|
|
425
446
|
* @group Combo
|
|
426
|
-
* @param
|
|
447
|
+
* @param comboId combo id or ids' array.
|
|
427
448
|
* @group Combo
|
|
428
449
|
*/
|
|
429
|
-
expandCombo: (comboIds: ID | ID[]
|
|
450
|
+
expandCombo: (comboIds: ID | ID[]) => void;
|
|
430
451
|
/**
|
|
431
452
|
* Layout the graph (with current configurations if cfg is not assigned).
|
|
432
453
|
*/
|
|
@@ -609,18 +630,16 @@ export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends
|
|
|
609
630
|
* Collapse sub tree(s).
|
|
610
631
|
* @param ids Root id(s) of the sub trees.
|
|
611
632
|
* @param disableAnimate Whether disable the animations for this operation.
|
|
612
|
-
* @param stack Whether push this operation to stack.
|
|
613
633
|
* @returns
|
|
614
634
|
* @group Tree
|
|
615
635
|
*/
|
|
616
|
-
collapse: (ids: ID | ID[], disableAnimate?: boolean
|
|
636
|
+
collapse: (ids: ID | ID[], disableAnimate?: boolean) => void;
|
|
617
637
|
/**
|
|
618
638
|
* Expand sub tree(s).
|
|
619
639
|
* @param ids Root id(s) of the sub trees.
|
|
620
640
|
* @param disableAnimate Whether disable the animations for this operation.
|
|
621
|
-
* @param stack Whether push this operation to stack.
|
|
622
641
|
* @returns
|
|
623
642
|
* @group Tree
|
|
624
643
|
*/
|
|
625
|
-
expand: (ids: ID | ID[], disableAnimate?: boolean
|
|
644
|
+
expand: (ids: ID | ID[], disableAnimate?: boolean) => void;
|
|
626
645
|
}
|
package/esm/types/hook.d.ts
CHANGED
|
@@ -30,7 +30,9 @@ export interface Hooks {
|
|
|
30
30
|
canvases: {
|
|
31
31
|
background: Canvas;
|
|
32
32
|
main: Canvas;
|
|
33
|
+
label: Canvas;
|
|
33
34
|
transient: Canvas;
|
|
35
|
+
transientLabel: Canvas;
|
|
34
36
|
};
|
|
35
37
|
}>;
|
|
36
38
|
datachange: IHook<{
|
|
@@ -51,6 +53,7 @@ export interface Hooks {
|
|
|
51
53
|
graphCore: GraphCore;
|
|
52
54
|
theme: ThemeSpecification;
|
|
53
55
|
transientCanvas: Canvas;
|
|
56
|
+
transientLabelCanvas: Canvas;
|
|
54
57
|
tileOptimize?: {
|
|
55
58
|
tileFirstRender?: boolean | number;
|
|
56
59
|
tileFirstRenderSize?: number;
|
|
@@ -86,6 +89,8 @@ export interface Hooks {
|
|
|
86
89
|
enableStack?: boolean;
|
|
87
90
|
changes?: any;
|
|
88
91
|
keepKeyShape?: boolean;
|
|
92
|
+
keepRelated?: boolean;
|
|
93
|
+
shapeIds?: string[];
|
|
89
94
|
}>;
|
|
90
95
|
itemzindexchange: IHook<{
|
|
91
96
|
ids: ID[];
|
package/esm/types/item.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ID } from '@antv/graphlib';
|
|
2
2
|
import { AABB, CircleStyleProps, RectStyleProps, EllipseStyleProps, PolygonStyleProps, LineStyleProps, PathStyleProps, PolylineStyleProps, TextStyleProps, ImageStyleProps, Group, DisplayObject, IAnimation } from '@antv/g';
|
|
3
3
|
import { CubeGeometryProps, PlaneGeometryProps, SphereGeometryProps } from '@antv/g-plugin-3d';
|
|
4
|
-
import {
|
|
4
|
+
import { IAnimates } from './animate';
|
|
5
5
|
import { ComboDisplayModel, ComboEncode, ComboModel, ComboModelData, ComboUserModel } from './combo';
|
|
6
6
|
import { EdgeDisplayModel, EdgeEncode, EdgeModel, EdgeModelData, EdgeShapeMap, EdgeUserModel } from './edge';
|
|
7
7
|
import { NodeDisplayModel, NodeEncode, NodeModel, NodeModelData, NodeShapeMap, NodeUserModel } from './node';
|
|
@@ -15,7 +15,7 @@ export type ClipCfg = {
|
|
|
15
15
|
} & CircleStyleProps & RectStyleProps & EllipseStyleProps;
|
|
16
16
|
export type ShapeStyle = Partial<GShapeStyle & {
|
|
17
17
|
animates?: IAnimates;
|
|
18
|
-
lod?: number;
|
|
18
|
+
lod?: number | 'auto';
|
|
19
19
|
visible?: boolean;
|
|
20
20
|
} & {
|
|
21
21
|
clipCfg?: ClipCfg;
|
|
@@ -86,18 +86,12 @@ export type ItemShapeStyles = {
|
|
|
86
86
|
};
|
|
87
87
|
animates?: IAnimates;
|
|
88
88
|
};
|
|
89
|
-
export interface
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
primary?: boolean;
|
|
93
|
-
}[];
|
|
94
|
-
animateCfg: AnimateCfg;
|
|
89
|
+
export interface LodLevel {
|
|
90
|
+
zoomRange: [number, number];
|
|
91
|
+
primary?: boolean;
|
|
95
92
|
}
|
|
96
|
-
export interface
|
|
97
|
-
|
|
98
|
-
[levelIdx: number]: [number, number];
|
|
99
|
-
};
|
|
100
|
-
animateCfg: AnimateCfg;
|
|
93
|
+
export interface LodLevelRanges {
|
|
94
|
+
[levelIdx: number]: [number, number];
|
|
101
95
|
}
|
|
102
96
|
/**
|
|
103
97
|
* Base item of node / edge / combo.
|
|
@@ -142,7 +136,7 @@ export interface IItem {
|
|
|
142
136
|
[stateName: string]: ItemShapeStyles;
|
|
143
137
|
};
|
|
144
138
|
/** The zoom strategy to show and hide shapes according to their lod. */
|
|
145
|
-
|
|
139
|
+
lodLevels: LodLevelRanges;
|
|
146
140
|
/** Last zoom ratio. */
|
|
147
141
|
zoom: number;
|
|
148
142
|
/** Cache the chaging states which are not consomed by draw */
|
|
@@ -176,7 +170,7 @@ export interface IItem {
|
|
|
176
170
|
current: ItemModelData;
|
|
177
171
|
}, isReplace?: boolean, itemTheme?: {
|
|
178
172
|
styles: NodeStyleSet | EdgeStyleSet | ComboStyleSet;
|
|
179
|
-
|
|
173
|
+
lodLevels: LodLevelRanges;
|
|
180
174
|
}, onlyMove?: boolean, animate?: boolean, onfinish?: Function) => void;
|
|
181
175
|
/**
|
|
182
176
|
* Update the group's position, e.g. node, combo.
|
package/esm/types/layout.d.ts
CHANGED
|
@@ -22,17 +22,22 @@ type Workerized = {
|
|
|
22
22
|
*/
|
|
23
23
|
iterations?: number;
|
|
24
24
|
};
|
|
25
|
+
type PureLayoutOptions = CircularLayout | RandomLayout | ConcentricLayout | GridLayout | MDSLayout | RadialLayout | FruchtermanLayout | D3ForceLayout | ForceLayout | ForceAtlas2 | CustomLayout;
|
|
25
26
|
export type ImmediatelyInvokedLayoutOptions = {
|
|
26
27
|
/**
|
|
27
28
|
* like an IIFE.
|
|
28
29
|
*/
|
|
29
30
|
execute: (graph: GraphCore, options?: any) => Promise<LayoutMapping>;
|
|
30
|
-
} & Animatable
|
|
31
|
+
} & Animatable & {
|
|
32
|
+
presetLayout?: Partial<PureLayoutOptions>;
|
|
33
|
+
};
|
|
31
34
|
type CustomLayout = {
|
|
32
35
|
type: string;
|
|
33
36
|
[option: string]: any;
|
|
34
37
|
};
|
|
35
|
-
export type StandardLayoutOptions =
|
|
38
|
+
export type StandardLayoutOptions = PureLayoutOptions & Animatable & Workerized & {
|
|
39
|
+
presetLayout?: Partial<PureLayoutOptions>;
|
|
40
|
+
};
|
|
36
41
|
export type LayoutOptions = StandardLayoutOptions | ImmediatelyInvokedLayoutOptions;
|
|
37
42
|
export declare function isImmediatelyInvokedLayoutOptions(options: any): options is ImmediatelyInvokedLayoutOptions;
|
|
38
43
|
export declare function isLayoutWorkerized(options: StandardLayoutOptions): boolean;
|
package/esm/types/layout.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.js","sourceRoot":"src/","sources":["types/layout.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"layout.js","sourceRoot":"src/","sources":["types/layout.ts"],"names":[],"mappings":"AA+EA,MAAM,UAAU,iCAAiC,CAC/C,OAAY;IAEZ,OAAO,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;AAC3B,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,OAA8B;IAC/D,OAAO,CACL;QACE,UAAU;QACV,QAAQ;QACR,MAAM;QACN,KAAK;QACL,YAAY;QACZ,QAAQ;QACR,aAAa;QACb,gBAAgB;QAChB,SAAS;QACT,OAAO;QACP,QAAQ;QACR,aAAa;KACd,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAC7B,CAAC;AACJ,CAAC"}
|
package/esm/types/node.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { Node as GNode, ID, PlainObject } from '@antv/graphlib';
|
|
|
3
3
|
import { BaseNode } from '../stdlib/item/node/base';
|
|
4
4
|
import { BaseNode3D } from '../stdlib/item/node/base3d';
|
|
5
5
|
import { IAnimates } from './animate';
|
|
6
|
-
import { BadgePosition, Encode, IBadgePosition, IItem, ItemShapeStyles,
|
|
6
|
+
import { BadgePosition, Encode, IBadgePosition, IItem, ItemShapeStyles, LodLevel, ShapeAttrEncode, ShapeStyle, ShapesEncode } from './item';
|
|
7
7
|
export type NodeLabelPosition = 'bottom' | 'center' | 'top' | 'left' | 'right';
|
|
8
8
|
/** Data in user input model. */
|
|
9
9
|
export interface NodeUserModelData extends PlainObject {
|
|
@@ -175,7 +175,7 @@ export interface NodeShapeStyles extends ItemShapeStyles {
|
|
|
175
175
|
}
|
|
176
176
|
/** Data in display model. */
|
|
177
177
|
export type NodeDisplayModelData = NodeModelData & NodeShapeStyles & {
|
|
178
|
-
|
|
178
|
+
lodLevels?: LodLevel[];
|
|
179
179
|
};
|
|
180
180
|
/** User input model. */
|
|
181
181
|
export type NodeUserModel = GNode<NodeUserModelData>;
|
|
@@ -197,6 +197,7 @@ export interface NodeShapesEncode extends ShapesEncode {
|
|
|
197
197
|
}
|
|
198
198
|
export interface NodeEncode extends NodeShapesEncode {
|
|
199
199
|
type?: string | Encode<string>;
|
|
200
|
+
lodLevels?: LodLevel[];
|
|
200
201
|
animates?: IAnimates;
|
|
201
202
|
}
|
|
202
203
|
export interface NodeShapeMap {
|
package/esm/types/plugin.d.ts
CHANGED
package/esm/types/plugin.js
CHANGED
package/esm/types/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"src/","sources":["types/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAc3C,MAAM,OAAgB,MAAM;
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"src/","sources":["types/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAc3C,MAAM,OAAgB,MAAM;IAa1B;;;OAGG;IACH,YAAY,OAA2B;QACrC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,OAAO,CAAC,CAAC;QACvD,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;IACzB,CAAC;IAED;;;OAGG;IACI,UAAU,CAAC,OAA2B;QAC3C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC9C,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;IAED;;OAEG;IACI,cAAc;QACnB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED;;OAEG;IACI,IAAI,CAAC,KAAa;QACvB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED;;;OAGG;IACI,SAAS;QACd,OAAO,EAAE,CAAC;IACZ,CAAC;IACD;;OAEG;IACI,OAAO;QACZ,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;QACvB,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YACpB,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;QACF,IAAI,CAAC,MAA8B,GAAG,IAAI,CAAC;QAC3C,IAAI,CAAC,OAAoC,GAAG,IAAI,CAAC;QAClD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IACxB,CAAC;;AA9DM,eAAQ,GAAY,KAAK,CAAC"}
|
package/esm/types/spec.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export interface Specification<B extends BehaviorRegistry, T extends ThemeRegist
|
|
|
20
20
|
backgroundCanvas?: Canvas;
|
|
21
21
|
canvas?: Canvas;
|
|
22
22
|
transientCanvas?: Canvas;
|
|
23
|
+
transientLabelCanvas?: Canvas;
|
|
23
24
|
width?: number;
|
|
24
25
|
height?: number;
|
|
25
26
|
renderer?: RendererName | {
|
package/esm/types/theme.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseThemeSolver } from '../stdlib/themeSolver/base';
|
|
2
2
|
import { ComboShapeStyles } from './combo';
|
|
3
3
|
import { EdgeShapeStyles } from './edge';
|
|
4
|
-
import {
|
|
4
|
+
import { LodLevel } from './item';
|
|
5
5
|
import { NodeShapeStyles } from './node';
|
|
6
6
|
export interface ThemeOption {
|
|
7
7
|
}
|
|
@@ -115,7 +115,7 @@ export type ComboStyleSets = ComboStyleSet[] | {
|
|
|
115
115
|
* dataTypeField - the field name in model.data that indicates the data type to map style set.
|
|
116
116
|
* palette - color palette.
|
|
117
117
|
* styles - style sets to map.
|
|
118
|
-
*
|
|
118
|
+
* lodLevels - level of detail strategy for global setting.
|
|
119
119
|
*/
|
|
120
120
|
export interface NodeThemeSpecifications {
|
|
121
121
|
dataTypeField?: string;
|
|
@@ -123,14 +123,14 @@ export interface NodeThemeSpecifications {
|
|
|
123
123
|
[dataTypeValue: string]: string;
|
|
124
124
|
};
|
|
125
125
|
styles?: NodeStyleSets;
|
|
126
|
-
|
|
126
|
+
lodLevels?: LodLevel[];
|
|
127
127
|
}
|
|
128
128
|
/**
|
|
129
129
|
* Theme specification for edge.
|
|
130
130
|
* dataTypeField - the field name in model.data that indicates the data type to map style set.
|
|
131
131
|
* palette - color palette.
|
|
132
132
|
* styles - style sets to map.
|
|
133
|
-
*
|
|
133
|
+
* lodLevels - level of detail strategy for global setting.
|
|
134
134
|
*/
|
|
135
135
|
export interface EdgeThemeSpecifications {
|
|
136
136
|
dataTypeField?: string;
|
|
@@ -138,14 +138,14 @@ export interface EdgeThemeSpecifications {
|
|
|
138
138
|
[dataTypeValue: string]: string;
|
|
139
139
|
};
|
|
140
140
|
styles?: EdgeStyleSets;
|
|
141
|
-
|
|
141
|
+
lodLevels?: LodLevel[];
|
|
142
142
|
}
|
|
143
143
|
/**
|
|
144
144
|
* Theme specification for combo.
|
|
145
145
|
* dataTypeField - the field name in model.data that indicates the data type to map style set.
|
|
146
146
|
* palette - color palette.
|
|
147
147
|
* styles - style sets to map.
|
|
148
|
-
*
|
|
148
|
+
* lodLevels - level of detail strategy for global setting.
|
|
149
149
|
*/
|
|
150
150
|
export interface ComboThemeSpecifications {
|
|
151
151
|
dataTypeField?: string;
|
|
@@ -153,7 +153,7 @@ export interface ComboThemeSpecifications {
|
|
|
153
153
|
[dataTypeValue: string]: string;
|
|
154
154
|
};
|
|
155
155
|
styles?: ComboStyleSets;
|
|
156
|
-
|
|
156
|
+
lodLevels?: LodLevel[];
|
|
157
157
|
}
|
|
158
158
|
/**
|
|
159
159
|
* Theme specification with node / edge / combo palette and style mappers. And also canvas DOM CSS settings.
|
package/esm/util/animate.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export declare const getShapeAnimateBeginStyles: (shape: any) => {
|
|
|
9
9
|
opacity?: undefined;
|
|
10
10
|
strokeOpacity?: undefined;
|
|
11
11
|
offsetDistance?: undefined;
|
|
12
|
+
fill?: undefined;
|
|
12
13
|
} | {
|
|
13
14
|
opacity: number;
|
|
14
15
|
strokeOpacity: number;
|
|
@@ -16,6 +17,7 @@ export declare const getShapeAnimateBeginStyles: (shape: any) => {
|
|
|
16
17
|
offsetDistance: number;
|
|
17
18
|
lineDash: (string | number)[];
|
|
18
19
|
fontSize?: undefined;
|
|
20
|
+
fill?: undefined;
|
|
19
21
|
} | {
|
|
20
22
|
opacity: number;
|
|
21
23
|
strokeOpacity: number;
|
|
@@ -23,6 +25,7 @@ export declare const getShapeAnimateBeginStyles: (shape: any) => {
|
|
|
23
25
|
offsetDistance: number;
|
|
24
26
|
r: number;
|
|
25
27
|
fontSize?: undefined;
|
|
28
|
+
fill?: undefined;
|
|
26
29
|
} | {
|
|
27
30
|
opacity: number;
|
|
28
31
|
strokeOpacity: number;
|
|
@@ -31,11 +34,13 @@ export declare const getShapeAnimateBeginStyles: (shape: any) => {
|
|
|
31
34
|
rx: number;
|
|
32
35
|
ry: number;
|
|
33
36
|
fontSize?: undefined;
|
|
37
|
+
fill?: undefined;
|
|
34
38
|
} | {
|
|
35
39
|
fontSize: number;
|
|
36
40
|
opacity: number;
|
|
37
41
|
strokeOpacity: number;
|
|
38
42
|
offsetDistance: number;
|
|
43
|
+
fill: string;
|
|
39
44
|
} | {
|
|
40
45
|
opacity: number;
|
|
41
46
|
strokeOpacity: number;
|
|
@@ -44,6 +49,7 @@ export declare const getShapeAnimateBeginStyles: (shape: any) => {
|
|
|
44
49
|
width: number;
|
|
45
50
|
height: number;
|
|
46
51
|
fontSize?: undefined;
|
|
52
|
+
fill?: undefined;
|
|
47
53
|
};
|
|
48
54
|
/**
|
|
49
55
|
* Initial(timing = show) group animation start from GROUP_ANIMATE_STYLES[0], and end to GROUP_ANIMATE_STYLES[1].
|
|
@@ -60,7 +66,6 @@ export declare const DEFAULT_ANIMATE_CFG: {
|
|
|
60
66
|
duration: number;
|
|
61
67
|
easing: string;
|
|
62
68
|
iterations: number;
|
|
63
|
-
delay: number;
|
|
64
69
|
fill: string;
|
|
65
70
|
};
|
|
66
71
|
show: {
|
|
@@ -95,7 +100,7 @@ export declare const DEFAULT_ANIMATE_CFG: {
|
|
|
95
100
|
*/
|
|
96
101
|
export declare const animateShapes: (animates: IAnimates, mergedStyles: ItemShapeStyles, shapeMap: {
|
|
97
102
|
[shapeId: string]: DisplayObject<any, any>;
|
|
98
|
-
},
|
|
103
|
+
}, shapeIds: string[], groups: Group[], timing?: AnimateTiming, changedStates?: string[], onAnimatesFrame?: Function, onAnimatesEnd?: Function) => IAnimation[];
|
|
99
104
|
export declare const getAnimatesExcludePosition: (animates: any) => any;
|
|
100
105
|
export declare const fadeIn: (id: any, shape: any, style: any, hiddenShape: any, animateConfig: any) => void;
|
|
101
106
|
export declare const fadeOut: (id: any, shape: any, hiddenShapeMap: any, animateConfig: any) => void;
|