@antv/g6 5.0.0-beta.2 → 5.0.0-beta.20
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/api-doc/graph.d.ts +3 -3
- package/esm/api-doc/graph.js +3 -3
- package/esm/api-doc/graph.js.map +1 -1
- package/esm/api-doc/types.d.ts +1 -0
- package/esm/api-doc/types.js +1 -2
- package/esm/api-doc/types.js.map +1 -1
- package/esm/constant/shape.d.ts +3 -1
- package/esm/index.d.ts +24 -63
- package/esm/index.js +4 -5
- package/esm/index.js.map +1 -1
- package/esm/item/combo.d.ts +1 -1
- package/esm/item/combo.js +18 -14
- package/esm/item/combo.js.map +1 -1
- package/esm/item/edge.d.ts +19 -2
- package/esm/item/edge.js +100 -44
- package/esm/item/edge.js.map +1 -1
- package/esm/item/item.d.ts +3 -2
- package/esm/item/item.js +27 -13
- package/esm/item/item.js.map +1 -1
- package/esm/item/node.d.ts +2 -8
- package/esm/item/node.js +31 -19
- package/esm/item/node.js.map +1 -1
- package/esm/runtime/controller/data.d.ts +7 -10
- package/esm/runtime/controller/data.js +125 -281
- package/esm/runtime/controller/data.js.map +1 -1
- package/esm/runtime/controller/interaction.js +9 -4
- package/esm/runtime/controller/interaction.js.map +1 -1
- package/esm/runtime/controller/item.d.ts +1 -0
- package/esm/runtime/controller/item.js +285 -150
- package/esm/runtime/controller/item.js.map +1 -1
- package/esm/runtime/controller/layout.js +1 -3
- package/esm/runtime/controller/layout.js.map +1 -1
- package/esm/runtime/controller/plugin.js +9 -5
- package/esm/runtime/controller/plugin.js.map +1 -1
- package/esm/runtime/graph.d.ts +104 -24
- package/esm/runtime/graph.js +472 -94
- package/esm/runtime/graph.js.map +1 -1
- package/esm/stdlib/behavior/activate-relations.d.ts +1 -1
- package/esm/stdlib/behavior/activate-relations.js +2 -2
- package/esm/stdlib/behavior/activate-relations.js.map +1 -1
- package/esm/stdlib/behavior/brush-select.d.ts +9 -3
- package/esm/stdlib/behavior/brush-select.js +10 -12
- package/esm/stdlib/behavior/brush-select.js.map +1 -1
- package/esm/stdlib/behavior/click-select.d.ts +1 -1
- package/esm/stdlib/behavior/click-select.js +1 -1
- package/esm/stdlib/behavior/click-select.js.map +1 -1
- package/esm/stdlib/behavior/collapse-expand-combo.d.ts +1 -1
- package/esm/stdlib/behavior/collapse-expand-tree.d.ts +1 -1
- package/esm/stdlib/behavior/create-edge.d.ts +57 -0
- package/esm/stdlib/behavior/create-edge.js +215 -0
- package/esm/stdlib/behavior/create-edge.js.map +1 -0
- package/esm/stdlib/behavior/drag-canvas.d.ts +3 -1
- package/esm/stdlib/behavior/drag-canvas.js +78 -33
- package/esm/stdlib/behavior/drag-canvas.js.map +1 -1
- package/esm/stdlib/behavior/drag-combo.d.ts +3 -3
- package/esm/stdlib/behavior/drag-combo.js +43 -32
- package/esm/stdlib/behavior/drag-combo.js.map +1 -1
- package/esm/stdlib/behavior/drag-node.d.ts +4 -4
- package/esm/stdlib/behavior/drag-node.js +80 -63
- package/esm/stdlib/behavior/drag-node.js.map +1 -1
- package/esm/stdlib/behavior/index.d.ts +3 -0
- package/esm/stdlib/behavior/index.js +3 -0
- package/esm/stdlib/behavior/index.js.map +1 -1
- package/esm/stdlib/behavior/lasso-select.d.ts +1 -1
- package/esm/stdlib/behavior/lasso-select.js +3 -4
- package/esm/stdlib/behavior/lasso-select.js.map +1 -1
- package/esm/stdlib/behavior/scroll-canvas.d.ts +67 -0
- package/esm/stdlib/behavior/scroll-canvas.js +266 -0
- package/esm/stdlib/behavior/scroll-canvas.js.map +1 -0
- package/esm/stdlib/behavior/shortcuts-call.d.ts +38 -0
- package/esm/stdlib/behavior/shortcuts-call.js +87 -0
- package/esm/stdlib/behavior/shortcuts-call.js.map +1 -0
- package/esm/stdlib/behavior/zoom-canvas-3d.js +4 -1
- package/esm/stdlib/behavior/zoom-canvas-3d.js.map +1 -1
- package/esm/stdlib/behavior/zoom-canvas.d.ts +3 -1
- package/esm/stdlib/behavior/zoom-canvas.js +70 -26
- package/esm/stdlib/behavior/zoom-canvas.js.map +1 -1
- package/esm/stdlib/data/mapNodeSize.d.ts +2 -2
- package/esm/stdlib/data/mapNodeSize.js +2 -2
- package/esm/stdlib/data/mapNodeSize.js.map +1 -1
- package/esm/stdlib/data/transformV4Data.d.ts +2 -2
- package/esm/stdlib/data/transformV4Data.js +2 -2
- package/esm/stdlib/data/transformV4Data.js.map +1 -1
- package/esm/stdlib/data/validateData.d.ts +2 -2
- package/esm/stdlib/data/validateData.js +13 -12
- package/esm/stdlib/data/validateData.js.map +1 -1
- package/esm/stdlib/index.d.ts +18 -6
- package/esm/stdlib/index.js +22 -10
- package/esm/stdlib/index.js.map +1 -1
- package/esm/stdlib/item/edge/base.d.ts +3 -5
- package/esm/stdlib/item/edge/base.js +32 -31
- package/esm/stdlib/item/edge/base.js.map +1 -1
- package/esm/stdlib/item/edge/cubic-horizontal.js.map +1 -1
- package/esm/stdlib/item/edge/cubic-vertical.js.map +1 -1
- package/esm/stdlib/item/edge/cubic.js +1 -1
- package/esm/stdlib/item/edge/cubic.js.map +1 -1
- package/esm/stdlib/item/edge/loop.js +1 -1
- package/esm/stdlib/item/edge/loop.js.map +1 -1
- package/esm/stdlib/item/node/base.d.ts +3 -6
- package/esm/stdlib/item/node/base.js +30 -60
- package/esm/stdlib/item/node/base.js.map +1 -1
- package/esm/stdlib/item/node/base3d.d.ts +1 -0
- package/esm/stdlib/item/node/base3d.js +1 -0
- package/esm/stdlib/item/node/base3d.js.map +1 -1
- package/esm/stdlib/item/node/cube.d.ts +35 -0
- package/esm/stdlib/item/node/cube.js +54 -0
- package/esm/stdlib/item/node/cube.js.map +1 -0
- package/esm/stdlib/item/node/diamond.js +1 -1
- package/esm/stdlib/item/node/donut.d.ts +3 -3
- package/esm/stdlib/item/node/ellipse.js +2 -2
- package/esm/stdlib/item/node/hexagon.js +6 -2
- package/esm/stdlib/item/node/hexagon.js.map +1 -1
- package/esm/stdlib/item/node/image.d.ts +40 -0
- package/esm/stdlib/item/node/image.js +110 -0
- package/esm/stdlib/item/node/image.js.map +1 -0
- package/esm/stdlib/item/node/index.d.ts +4 -0
- package/esm/stdlib/item/node/index.js +4 -0
- package/esm/stdlib/item/node/index.js.map +1 -1
- package/esm/stdlib/plugin/edgeFilterLens/index.d.ts +66 -0
- package/esm/stdlib/plugin/edgeFilterLens/index.js +309 -0
- package/esm/stdlib/plugin/edgeFilterLens/index.js.map +1 -0
- package/esm/stdlib/plugin/grid/index.d.ts +1 -1
- package/esm/stdlib/plugin/grid/index.js +3 -4
- package/esm/stdlib/plugin/grid/index.js.map +1 -1
- package/esm/stdlib/plugin/history/combo-command.js +2 -2
- package/esm/stdlib/plugin/history/combo-command.js.map +1 -1
- package/esm/stdlib/plugin/history/index.d.ts +10 -10
- package/esm/stdlib/plugin/history/index.js +14 -14
- package/esm/stdlib/plugin/history/index.js.map +1 -1
- package/esm/stdlib/plugin/history/item-data-command.js +25 -16
- package/esm/stdlib/plugin/history/item-data-command.js.map +1 -1
- package/esm/stdlib/plugin/history/layer-updated-command.js +2 -2
- package/esm/stdlib/plugin/history/layer-updated-command.js.map +1 -1
- package/esm/stdlib/plugin/history/state-updated-command.js +1 -1
- package/esm/stdlib/plugin/history/state-updated-command.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/convexHull.d.ts +1 -1
- package/esm/stdlib/plugin/hull/hullComponent.d.ts +2 -2
- package/esm/stdlib/plugin/hull/hullComponent.js +5 -9
- package/esm/stdlib/plugin/hull/hullComponent.js.map +1 -1
- package/esm/stdlib/plugin/hull/util.d.ts +2 -2
- package/esm/stdlib/plugin/hull/util.js +6 -2
- package/esm/stdlib/plugin/hull/util.js.map +1 -1
- package/esm/stdlib/plugin/index.d.ts +2 -0
- package/esm/stdlib/plugin/index.js +2 -0
- package/esm/stdlib/plugin/index.js.map +1 -1
- package/esm/stdlib/plugin/legend/index.d.ts +3 -3
- package/esm/stdlib/plugin/legend/index.js +3 -3
- package/esm/stdlib/plugin/legend/index.js.map +1 -1
- package/esm/stdlib/plugin/menu/index.d.ts +4 -4
- package/esm/stdlib/plugin/menu/index.js +3 -3
- package/esm/stdlib/plugin/menu/index.js.map +1 -1
- package/esm/stdlib/plugin/minimap/index.d.ts +6 -2
- package/esm/stdlib/plugin/minimap/index.js +119 -12
- package/esm/stdlib/plugin/minimap/index.js.map +1 -1
- package/esm/stdlib/plugin/snapline/index.d.ts +167 -0
- package/esm/stdlib/plugin/snapline/index.js +1063 -0
- package/esm/stdlib/plugin/snapline/index.js.map +1 -0
- package/esm/stdlib/plugin/timebar/index.d.ts +4 -4
- package/esm/stdlib/plugin/timebar/index.js +6 -6
- package/esm/stdlib/plugin/timebar/index.js.map +1 -1
- package/esm/stdlib/plugin/toolbar/index.d.ts +3 -3
- package/esm/stdlib/plugin/toolbar/index.js +4 -4
- package/esm/stdlib/plugin/toolbar/index.js.map +1 -1
- package/esm/stdlib/plugin/tooltip/index.d.ts +5 -5
- package/esm/stdlib/plugin/tooltip/index.js +3 -4
- package/esm/stdlib/plugin/tooltip/index.js.map +1 -1
- package/esm/stdlib/plugin/types.d.ts +2 -0
- package/esm/stdlib/plugin/watermaker/index.d.ts +78 -0
- package/esm/stdlib/plugin/watermaker/index.js +243 -0
- package/esm/stdlib/plugin/watermaker/index.js.map +1 -0
- package/esm/stdlib/theme/dark.js +42 -2
- package/esm/stdlib/theme/dark.js.map +1 -1
- package/esm/stdlib/theme/light.js +4 -4
- package/esm/types/animate.d.ts +2 -2
- package/esm/types/behavior.d.ts +1 -1
- package/esm/types/combo.d.ts +7 -7
- package/esm/types/common.d.ts +5 -5
- package/esm/types/data.d.ts +6 -6
- package/esm/types/edge.d.ts +9 -9
- package/esm/types/event.d.ts +2 -1
- package/esm/types/graph.d.ts +48 -22
- package/esm/types/history.d.ts +2 -2
- package/esm/types/hook.d.ts +23 -3
- package/esm/types/index.d.ts +2 -1
- package/esm/types/index.js +1 -0
- package/esm/types/index.js.map +1 -1
- package/esm/types/item.d.ts +18 -12
- package/esm/types/item.js.map +1 -1
- package/esm/types/layout.d.ts +6 -6
- package/esm/types/loop.d.ts +2 -2
- package/esm/types/node.d.ts +7 -7
- package/esm/types/plugin.d.ts +1 -1
- package/esm/types/render.d.ts +1 -1
- package/esm/types/spec.d.ts +19 -3
- package/esm/types/stdlib.d.ts +1 -1
- package/esm/types/theme.d.ts +8 -8
- package/esm/types/view.d.ts +7 -2
- package/esm/util/bbox.d.ts +16 -1
- package/esm/util/bbox.js +33 -5
- package/esm/util/bbox.js.map +1 -1
- package/esm/util/behavior.d.ts +2 -2
- package/esm/util/behavior.js +2 -2
- package/esm/util/behavior.js.map +1 -1
- package/esm/util/data.d.ts +2 -2
- package/esm/util/data.js.map +1 -1
- package/esm/util/dom.d.ts +15 -0
- package/esm/util/dom.js +29 -0
- package/esm/util/dom.js.map +1 -0
- package/esm/util/event.d.ts +5 -3
- package/esm/util/event.js +8 -1
- package/esm/util/event.js.map +1 -1
- package/esm/util/extend.d.ts +1 -1
- package/esm/util/extend.js +0 -1
- package/esm/util/extend.js.map +1 -1
- package/esm/util/index.d.ts +7 -52
- package/esm/util/index.js +7 -23
- package/esm/util/index.js.map +1 -1
- package/esm/util/item.d.ts +16 -1
- package/esm/util/item.js +31 -8
- package/esm/util/item.js.map +1 -1
- package/esm/util/layout.d.ts +13 -2
- package/esm/util/layout.js +45 -0
- package/esm/util/layout.js.map +1 -1
- package/esm/util/loop.d.ts +1 -1
- package/esm/util/loop.js +4 -0
- package/esm/util/loop.js.map +1 -1
- package/esm/util/math.d.ts +1 -1
- package/esm/util/matrix.d.ts +6 -0
- package/esm/util/matrix.js +48 -0
- package/esm/util/matrix.js.map +1 -0
- package/esm/util/path.js +1 -1
- package/esm/util/path.js.map +1 -1
- package/esm/util/point.d.ts +1 -1
- package/esm/util/point.js +9 -2
- package/esm/util/point.js.map +1 -1
- package/esm/util/polyline.d.ts +2 -1
- package/esm/util/polyline.js +2 -1
- package/esm/util/polyline.js.map +1 -1
- package/esm/util/router.d.ts +1 -1
- package/esm/util/shape.d.ts +1 -2
- package/esm/util/shape.js +15 -25
- package/esm/util/shape.js.map +1 -1
- package/esm/util/shape3d.js +16 -17
- package/esm/util/shape3d.js.map +1 -1
- package/esm/util/text.d.ts +1 -1
- package/esm/util/text.js +3 -2
- package/esm/util/text.js.map +1 -1
- package/esm/util/warn.d.ts +14 -0
- package/esm/util/warn.js +4 -0
- package/esm/util/warn.js.map +1 -0
- package/lib/api-doc/graph.d.ts +3 -3
- package/lib/api-doc/graph.js +27 -7
- package/lib/api-doc/graph.js.map +1 -1
- package/lib/api-doc/types.d.ts +1 -0
- package/lib/api-doc/types.js +2 -2
- package/lib/api-doc/types.js.map +1 -1
- package/lib/constant/shape.d.ts +3 -1
- package/lib/index.d.ts +24 -63
- package/lib/index.js +18 -10
- package/lib/index.js.map +1 -1
- package/lib/item/combo.d.ts +1 -1
- package/lib/item/combo.js +18 -14
- package/lib/item/combo.js.map +1 -1
- package/lib/item/edge.d.ts +19 -2
- package/lib/item/edge.js +99 -43
- package/lib/item/edge.js.map +1 -1
- package/lib/item/item.d.ts +3 -2
- package/lib/item/item.js +27 -13
- package/lib/item/item.js.map +1 -1
- package/lib/item/node.d.ts +2 -8
- package/lib/item/node.js +31 -19
- package/lib/item/node.js.map +1 -1
- package/lib/runtime/controller/data.d.ts +7 -10
- package/lib/runtime/controller/data.js +125 -281
- package/lib/runtime/controller/data.js.map +1 -1
- package/lib/runtime/controller/interaction.js +9 -4
- package/lib/runtime/controller/interaction.js.map +1 -1
- package/lib/runtime/controller/item.d.ts +1 -0
- package/lib/runtime/controller/item.js +284 -149
- package/lib/runtime/controller/item.js.map +1 -1
- package/lib/runtime/controller/layout.js +1 -3
- package/lib/runtime/controller/layout.js.map +1 -1
- package/lib/runtime/controller/plugin.js +9 -5
- package/lib/runtime/controller/plugin.js.map +1 -1
- package/lib/runtime/graph.d.ts +104 -24
- package/lib/runtime/graph.js +473 -94
- package/lib/runtime/graph.js.map +1 -1
- package/lib/stdlib/behavior/activate-relations.d.ts +1 -1
- package/lib/stdlib/behavior/activate-relations.js +2 -2
- package/lib/stdlib/behavior/activate-relations.js.map +1 -1
- package/lib/stdlib/behavior/brush-select.d.ts +9 -3
- package/lib/stdlib/behavior/brush-select.js +13 -12
- package/lib/stdlib/behavior/brush-select.js.map +1 -1
- package/lib/stdlib/behavior/click-select.d.ts +1 -1
- package/lib/stdlib/behavior/click-select.js +1 -1
- package/lib/stdlib/behavior/click-select.js.map +1 -1
- package/lib/stdlib/behavior/collapse-expand-combo.d.ts +1 -1
- package/lib/stdlib/behavior/collapse-expand-tree.d.ts +1 -1
- package/lib/stdlib/behavior/create-edge.d.ts +57 -0
- package/lib/stdlib/behavior/create-edge.js +219 -0
- package/lib/stdlib/behavior/create-edge.js.map +1 -0
- package/lib/stdlib/behavior/drag-canvas.d.ts +3 -1
- package/lib/stdlib/behavior/drag-canvas.js +78 -33
- package/lib/stdlib/behavior/drag-canvas.js.map +1 -1
- package/lib/stdlib/behavior/drag-combo.d.ts +3 -3
- package/lib/stdlib/behavior/drag-combo.js +43 -32
- package/lib/stdlib/behavior/drag-combo.js.map +1 -1
- package/lib/stdlib/behavior/drag-node.d.ts +4 -4
- package/lib/stdlib/behavior/drag-node.js +80 -63
- package/lib/stdlib/behavior/drag-node.js.map +1 -1
- package/lib/stdlib/behavior/index.d.ts +3 -0
- package/lib/stdlib/behavior/index.js +3 -0
- package/lib/stdlib/behavior/index.js.map +1 -1
- package/lib/stdlib/behavior/lasso-select.d.ts +1 -1
- package/lib/stdlib/behavior/lasso-select.js +6 -4
- package/lib/stdlib/behavior/lasso-select.js.map +1 -1
- package/lib/stdlib/behavior/scroll-canvas.d.ts +67 -0
- package/lib/stdlib/behavior/scroll-canvas.js +270 -0
- package/lib/stdlib/behavior/scroll-canvas.js.map +1 -0
- package/lib/stdlib/behavior/shortcuts-call.d.ts +38 -0
- package/lib/stdlib/behavior/shortcuts-call.js +91 -0
- package/lib/stdlib/behavior/shortcuts-call.js.map +1 -0
- package/lib/stdlib/behavior/zoom-canvas-3d.js +4 -1
- package/lib/stdlib/behavior/zoom-canvas-3d.js.map +1 -1
- package/lib/stdlib/behavior/zoom-canvas.d.ts +3 -1
- package/lib/stdlib/behavior/zoom-canvas.js +70 -26
- package/lib/stdlib/behavior/zoom-canvas.js.map +1 -1
- package/lib/stdlib/data/mapNodeSize.d.ts +2 -2
- package/lib/stdlib/data/mapNodeSize.js +2 -2
- package/lib/stdlib/data/mapNodeSize.js.map +1 -1
- package/lib/stdlib/data/transformV4Data.d.ts +2 -2
- package/lib/stdlib/data/transformV4Data.js +2 -2
- package/lib/stdlib/data/transformV4Data.js.map +1 -1
- package/lib/stdlib/data/validateData.d.ts +2 -2
- package/lib/stdlib/data/validateData.js +13 -12
- package/lib/stdlib/data/validateData.js.map +1 -1
- package/lib/stdlib/index.d.ts +18 -6
- package/lib/stdlib/index.js +22 -10
- package/lib/stdlib/index.js.map +1 -1
- package/lib/stdlib/item/edge/base.d.ts +3 -5
- package/lib/stdlib/item/edge/base.js +30 -29
- package/lib/stdlib/item/edge/base.js.map +1 -1
- package/lib/stdlib/item/edge/cubic-horizontal.js.map +1 -1
- package/lib/stdlib/item/edge/cubic-vertical.js.map +1 -1
- package/lib/stdlib/item/edge/cubic.js +2 -2
- package/lib/stdlib/item/edge/cubic.js.map +1 -1
- package/lib/stdlib/item/edge/loop.js +3 -3
- package/lib/stdlib/item/edge/loop.js.map +1 -1
- package/lib/stdlib/item/node/base.d.ts +3 -6
- package/lib/stdlib/item/node/base.js +29 -59
- package/lib/stdlib/item/node/base.js.map +1 -1
- package/lib/stdlib/item/node/base3d.d.ts +1 -0
- package/lib/stdlib/item/node/base3d.js +1 -0
- package/lib/stdlib/item/node/base3d.js.map +1 -1
- package/lib/stdlib/item/node/cube.d.ts +35 -0
- package/lib/stdlib/item/node/cube.js +58 -0
- package/lib/stdlib/item/node/cube.js.map +1 -0
- package/lib/stdlib/item/node/diamond.js +1 -1
- package/lib/stdlib/item/node/donut.d.ts +3 -3
- package/lib/stdlib/item/node/ellipse.js +2 -2
- package/lib/stdlib/item/node/hexagon.js +6 -2
- package/lib/stdlib/item/node/hexagon.js.map +1 -1
- package/lib/stdlib/item/node/image.d.ts +40 -0
- package/lib/stdlib/item/node/image.js +114 -0
- package/lib/stdlib/item/node/image.js.map +1 -0
- package/lib/stdlib/item/node/index.d.ts +4 -0
- package/lib/stdlib/item/node/index.js +4 -0
- package/lib/stdlib/item/node/index.js.map +1 -1
- package/lib/stdlib/plugin/edgeFilterLens/index.d.ts +66 -0
- package/lib/stdlib/plugin/edgeFilterLens/index.js +313 -0
- package/lib/stdlib/plugin/edgeFilterLens/index.js.map +1 -0
- package/lib/stdlib/plugin/grid/index.d.ts +1 -1
- package/lib/stdlib/plugin/grid/index.js +6 -7
- package/lib/stdlib/plugin/grid/index.js.map +1 -1
- package/lib/stdlib/plugin/history/combo-command.js +2 -2
- package/lib/stdlib/plugin/history/combo-command.js.map +1 -1
- package/lib/stdlib/plugin/history/index.d.ts +10 -10
- package/lib/stdlib/plugin/history/index.js +14 -14
- package/lib/stdlib/plugin/history/index.js.map +1 -1
- package/lib/stdlib/plugin/history/item-data-command.js +25 -16
- package/lib/stdlib/plugin/history/item-data-command.js.map +1 -1
- package/lib/stdlib/plugin/history/layer-updated-command.js +2 -2
- package/lib/stdlib/plugin/history/layer-updated-command.js.map +1 -1
- package/lib/stdlib/plugin/history/state-updated-command.js +1 -1
- package/lib/stdlib/plugin/history/state-updated-command.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/convexHull.d.ts +1 -1
- package/lib/stdlib/plugin/hull/hullComponent.d.ts +2 -2
- package/lib/stdlib/plugin/hull/hullComponent.js +5 -9
- package/lib/stdlib/plugin/hull/hullComponent.js.map +1 -1
- package/lib/stdlib/plugin/hull/util.d.ts +2 -2
- package/lib/stdlib/plugin/hull/util.js +26 -22
- package/lib/stdlib/plugin/hull/util.js.map +1 -1
- package/lib/stdlib/plugin/index.d.ts +2 -0
- package/lib/stdlib/plugin/index.js +2 -0
- package/lib/stdlib/plugin/index.js.map +1 -1
- package/lib/stdlib/plugin/legend/index.d.ts +3 -3
- package/lib/stdlib/plugin/legend/index.js +3 -3
- package/lib/stdlib/plugin/legend/index.js.map +1 -1
- package/lib/stdlib/plugin/menu/index.d.ts +4 -4
- package/lib/stdlib/plugin/menu/index.js +6 -6
- package/lib/stdlib/plugin/menu/index.js.map +1 -1
- package/lib/stdlib/plugin/minimap/index.d.ts +6 -2
- package/lib/stdlib/plugin/minimap/index.js +121 -14
- package/lib/stdlib/plugin/minimap/index.js.map +1 -1
- package/lib/stdlib/plugin/snapline/index.d.ts +167 -0
- package/lib/stdlib/plugin/snapline/index.js +1067 -0
- package/lib/stdlib/plugin/snapline/index.js.map +1 -0
- package/lib/stdlib/plugin/timebar/index.d.ts +4 -4
- package/lib/stdlib/plugin/timebar/index.js +6 -6
- package/lib/stdlib/plugin/timebar/index.js.map +1 -1
- package/lib/stdlib/plugin/toolbar/index.d.ts +3 -3
- package/lib/stdlib/plugin/toolbar/index.js +5 -5
- package/lib/stdlib/plugin/toolbar/index.js.map +1 -1
- package/lib/stdlib/plugin/tooltip/index.d.ts +5 -5
- package/lib/stdlib/plugin/tooltip/index.js +10 -11
- package/lib/stdlib/plugin/tooltip/index.js.map +1 -1
- package/lib/stdlib/plugin/types.d.ts +2 -0
- package/lib/stdlib/plugin/watermaker/index.d.ts +78 -0
- package/lib/stdlib/plugin/watermaker/index.js +247 -0
- package/lib/stdlib/plugin/watermaker/index.js.map +1 -0
- package/lib/stdlib/theme/dark.js +42 -2
- package/lib/stdlib/theme/dark.js.map +1 -1
- package/lib/stdlib/theme/light.js +4 -4
- package/lib/types/animate.d.ts +2 -2
- package/lib/types/behavior.d.ts +1 -1
- package/lib/types/combo.d.ts +7 -7
- package/lib/types/common.d.ts +5 -5
- package/lib/types/data.d.ts +6 -6
- package/lib/types/edge.d.ts +9 -9
- package/lib/types/event.d.ts +2 -1
- package/lib/types/event.js +2 -2
- package/lib/types/event.js.map +1 -1
- package/lib/types/graph.d.ts +48 -22
- package/lib/types/history.d.ts +2 -2
- package/lib/types/history.js +1 -1
- package/lib/types/history.js.map +1 -1
- package/lib/types/hook.d.ts +23 -3
- package/lib/types/index.d.ts +2 -1
- package/lib/types/index.js +3 -1
- package/lib/types/index.js.map +1 -1
- package/lib/types/item.d.ts +18 -12
- package/lib/types/item.js +1 -1
- package/lib/types/item.js.map +1 -1
- package/lib/types/layout.d.ts +6 -6
- package/lib/types/loop.d.ts +2 -2
- package/lib/types/loop.js +1 -1
- package/lib/types/loop.js.map +1 -1
- package/lib/types/node.d.ts +7 -7
- package/lib/types/plugin.d.ts +1 -1
- package/lib/types/render.d.ts +1 -1
- package/lib/types/spec.d.ts +19 -3
- package/lib/types/stdlib.d.ts +1 -1
- package/lib/types/theme.d.ts +8 -8
- package/lib/types/view.d.ts +7 -2
- package/lib/util/bbox.d.ts +16 -1
- package/lib/util/bbox.js +36 -6
- package/lib/util/bbox.js.map +1 -1
- package/lib/util/behavior.d.ts +2 -2
- package/lib/util/behavior.js +2 -2
- package/lib/util/behavior.js.map +1 -1
- package/lib/util/data.d.ts +2 -2
- package/lib/util/data.js.map +1 -1
- package/lib/util/dom.d.ts +15 -0
- package/lib/util/dom.js +34 -0
- package/lib/util/dom.js.map +1 -0
- package/lib/util/event.d.ts +5 -3
- package/lib/util/event.js +8 -1
- package/lib/util/event.js.map +1 -1
- package/lib/util/extend.d.ts +1 -1
- package/lib/util/extend.js +0 -1
- package/lib/util/extend.js.map +1 -1
- package/lib/util/index.d.ts +7 -52
- package/lib/util/index.js +23 -23
- package/lib/util/index.js.map +1 -1
- package/lib/util/item.d.ts +16 -1
- package/lib/util/item.js +33 -9
- package/lib/util/item.js.map +1 -1
- package/lib/util/layout.d.ts +13 -2
- package/lib/util/layout.js +47 -1
- package/lib/util/layout.js.map +1 -1
- package/lib/util/loop.d.ts +1 -1
- package/lib/util/loop.js +4 -0
- package/lib/util/loop.js.map +1 -1
- package/lib/util/math.d.ts +1 -1
- package/lib/util/matrix.d.ts +6 -0
- package/lib/util/matrix.js +52 -0
- package/lib/util/matrix.js.map +1 -0
- package/lib/util/path.js +2 -2
- package/lib/util/path.js.map +1 -1
- package/lib/util/point.d.ts +1 -1
- package/lib/util/point.js +9 -2
- package/lib/util/point.js.map +1 -1
- package/lib/util/polyline.d.ts +2 -1
- package/lib/util/polyline.js +2 -1
- package/lib/util/polyline.js.map +1 -1
- package/lib/util/router.d.ts +1 -1
- package/lib/util/shape.d.ts +1 -2
- package/lib/util/shape.js +16 -26
- package/lib/util/shape.js.map +1 -1
- package/lib/util/shape3d.js +15 -16
- package/lib/util/shape3d.js.map +1 -1
- package/lib/util/text.d.ts +1 -1
- package/lib/util/text.js +3 -2
- package/lib/util/text.js.map +1 -1
- package/lib/util/warn.d.ts +14 -0
- package/lib/util/warn.js +8 -0
- package/lib/util/warn.js.map +1 -0
- package/package.json +41 -50
- package/src/api-doc/graph.ts +4 -3
- package/src/api-doc/types.ts +1 -0
- package/src/constant/shape.ts +1 -1
- package/src/index.ts +5 -6
- package/src/item/combo.ts +16 -15
- package/src/item/edge.ts +135 -57
- package/src/item/item.ts +32 -19
- package/src/item/node.ts +36 -50
- package/src/runtime/controller/data.ts +140 -339
- package/src/runtime/controller/interaction.ts +10 -4
- package/src/runtime/controller/item.ts +261 -78
- package/src/runtime/controller/layout.ts +1 -5
- package/src/runtime/controller/plugin.ts +15 -4
- package/src/runtime/graph.ts +605 -103
- package/src/stdlib/behavior/activate-relations.ts +2 -2
- package/src/stdlib/behavior/brush-select.ts +14 -13
- package/src/stdlib/behavior/click-select.ts +1 -1
- package/src/stdlib/behavior/create-edge.ts +305 -0
- package/src/stdlib/behavior/drag-canvas.ts +107 -35
- package/src/stdlib/behavior/drag-combo.ts +10 -10
- package/src/stdlib/behavior/drag-node.ts +27 -18
- package/src/stdlib/behavior/index.ts +3 -0
- package/src/stdlib/behavior/lasso-select.ts +7 -5
- package/src/stdlib/behavior/scroll-canvas.ts +348 -0
- package/src/stdlib/behavior/shortcuts-call.ts +129 -0
- package/src/stdlib/behavior/zoom-canvas-3d.ts +4 -1
- package/src/stdlib/behavior/zoom-canvas.ts +98 -27
- package/src/stdlib/data/mapNodeSize.ts +2 -2
- package/src/stdlib/data/transformV4Data.ts +2 -2
- package/src/stdlib/data/validateData.ts +16 -16
- package/src/stdlib/index.ts +28 -7
- package/src/stdlib/item/edge/base.ts +32 -41
- package/src/stdlib/item/edge/cubic-horizontal.ts +0 -1
- package/src/stdlib/item/edge/cubic-vertical.ts +0 -1
- package/src/stdlib/item/edge/cubic.ts +1 -1
- package/src/stdlib/item/edge/loop.ts +1 -1
- package/src/stdlib/item/node/base.ts +38 -65
- package/src/stdlib/item/node/base3d.ts +1 -0
- package/src/stdlib/item/node/cube.ts +102 -0
- package/src/stdlib/item/node/diamond.ts +1 -1
- package/src/stdlib/item/node/ellipse.ts +2 -2
- package/src/stdlib/item/node/hexagon.ts +6 -2
- package/src/stdlib/item/node/image.ts +190 -0
- package/src/stdlib/item/node/index.ts +4 -0
- package/src/stdlib/plugin/edgeFilterLens/index.ts +387 -0
- package/src/stdlib/plugin/grid/index.ts +6 -6
- package/src/stdlib/plugin/history/combo-command.ts +2 -2
- package/src/stdlib/plugin/history/index.ts +14 -14
- package/src/stdlib/plugin/history/item-data-command.ts +35 -17
- package/src/stdlib/plugin/history/layer-updated-command.ts +2 -2
- package/src/stdlib/plugin/history/state-updated-command.ts +1 -1
- package/src/stdlib/plugin/history/visibility-updated-command.ts +2 -2
- package/src/stdlib/plugin/hull/convexHull.ts +1 -1
- package/src/stdlib/plugin/hull/hullComponent.ts +10 -8
- package/src/stdlib/plugin/hull/util.ts +6 -2
- package/src/stdlib/plugin/index.ts +2 -0
- package/src/stdlib/plugin/legend/index.ts +6 -6
- package/src/stdlib/plugin/menu/index.ts +13 -13
- package/src/stdlib/plugin/minimap/index.ts +126 -16
- package/src/stdlib/plugin/snapline/index.ts +1297 -0
- package/src/stdlib/plugin/timebar/index.ts +4 -4
- package/src/stdlib/plugin/toolbar/index.ts +8 -8
- package/src/stdlib/plugin/tooltip/index.ts +10 -10
- package/src/stdlib/plugin/types.ts +2 -0
- package/src/stdlib/plugin/watermaker/index.ts +302 -0
- package/src/stdlib/theme/dark.ts +66 -2
- package/src/stdlib/theme/light.ts +4 -4
- package/src/types/event.ts +1 -0
- package/src/types/graph.ts +62 -25
- package/src/types/hook.ts +22 -2
- package/src/types/index.ts +2 -1
- package/src/types/item.ts +10 -0
- package/src/types/plugin.ts +1 -1
- package/src/types/spec.ts +22 -3
- package/src/types/view.ts +8 -3
- package/src/util/bbox.ts +42 -6
- package/src/util/behavior.ts +4 -4
- package/src/util/data.ts +2 -3
- package/src/util/dom.ts +33 -0
- package/src/util/event.ts +14 -1
- package/src/util/extend.ts +2 -3
- package/src/util/index.ts +7 -24
- package/src/util/item.ts +65 -28
- package/src/util/layout.ts +48 -2
- package/src/util/loop.ts +5 -1
- package/src/util/math.ts +1 -1
- package/src/util/matrix.ts +66 -0
- package/src/util/path.ts +1 -1
- package/src/util/point.ts +9 -4
- package/src/util/polyline.ts +2 -1
- package/src/util/router.ts +1 -1
- package/src/util/shape.ts +22 -26
- package/src/util/shape3d.ts +20 -20
- package/src/util/text.ts +3 -1
- package/src/util/warn.ts +20 -0
package/src/types/graph.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import EventEmitter from '@antv/event-emitter';
|
|
2
|
-
import { AABB, Canvas, DisplayObject, PointLike } from '@antv/g';
|
|
2
|
+
import { AABB, Canvas, Cursor, DisplayObject, PointLike } from '@antv/g';
|
|
3
3
|
import { ID } from '@antv/graphlib';
|
|
4
4
|
import { Command } from '../stdlib/plugin/history/command';
|
|
5
5
|
import { Hooks } from '../types/hook';
|
|
6
6
|
import { CameraAnimationOptions } from './animate';
|
|
7
7
|
import { BehaviorOptionsOf, BehaviorRegistry } from './behavior';
|
|
8
|
-
import {
|
|
8
|
+
import { ComboModel, ComboUserModel } from './combo';
|
|
9
9
|
import { Padding, Point } from './common';
|
|
10
10
|
import { GraphData } from './data';
|
|
11
|
-
import {
|
|
11
|
+
import { EdgeModel, EdgeUserModel } from './edge';
|
|
12
12
|
import type { StackType } from './history';
|
|
13
|
-
import { ITEM_TYPE, SHAPE_TYPE } from './item';
|
|
13
|
+
import { ITEM_TYPE, SHAPE_TYPE, ShapeStyle } from './item';
|
|
14
14
|
import { LayoutOptions } from './layout';
|
|
15
|
-
import {
|
|
15
|
+
import { NodeModel, NodeUserModel } from './node';
|
|
16
16
|
import { RendererName } from './render';
|
|
17
|
-
import { Specification } from './spec';
|
|
17
|
+
import { ComboMapper, EdgeMapper, NodeMapper, Specification } from './spec';
|
|
18
18
|
import { ThemeOptionsOf, ThemeRegistry } from './theme';
|
|
19
19
|
import { FitViewRules, GraphTransformOptions } from './view';
|
|
20
20
|
|
|
@@ -36,7 +36,7 @@ export interface IGraph<
|
|
|
36
36
|
* @returns
|
|
37
37
|
* @group Graph Instance
|
|
38
38
|
*/
|
|
39
|
-
destroy: (callback?:
|
|
39
|
+
destroy: (callback?: () => void) => void;
|
|
40
40
|
/**
|
|
41
41
|
* Update the specs (configurations).
|
|
42
42
|
*/
|
|
@@ -45,6 +45,15 @@ export interface IGraph<
|
|
|
45
45
|
* Update the theme specs (configurations).
|
|
46
46
|
*/
|
|
47
47
|
updateTheme: (theme: ThemeOptionsOf<T>) => void;
|
|
48
|
+
/**
|
|
49
|
+
* Update the item display mapper for a specific item type.
|
|
50
|
+
* @param {ITEM_TYPE} type - The type of item (node, edge, or combo).
|
|
51
|
+
* @param {NodeMapper | EdgeMapper | ComboMapper} mapper - The mapper to be updated.
|
|
52
|
+
* */
|
|
53
|
+
updateMapper: (
|
|
54
|
+
type: ITEM_TYPE,
|
|
55
|
+
mapper: NodeMapper | EdgeMapper | ComboMapper,
|
|
56
|
+
) => void;
|
|
48
57
|
/**
|
|
49
58
|
* Get the copy of specs(configurations).
|
|
50
59
|
* @returns graph specs
|
|
@@ -389,8 +398,8 @@ export interface IGraph<
|
|
|
389
398
|
*/
|
|
390
399
|
fitView: (
|
|
391
400
|
options?: {
|
|
392
|
-
padding
|
|
393
|
-
rules
|
|
401
|
+
padding?: Padding;
|
|
402
|
+
rules?: FitViewRules;
|
|
394
403
|
},
|
|
395
404
|
effectTiming?: CameraAnimationOptions,
|
|
396
405
|
) => Promise<void>;
|
|
@@ -400,7 +409,10 @@ export interface IGraph<
|
|
|
400
409
|
* @returns
|
|
401
410
|
* @group View
|
|
402
411
|
*/
|
|
403
|
-
fitCenter: (
|
|
412
|
+
fitCenter: (
|
|
413
|
+
boundsType?: 'render' | 'layout',
|
|
414
|
+
effectTiming?: CameraAnimationOptions,
|
|
415
|
+
) => Promise<void>;
|
|
404
416
|
/**
|
|
405
417
|
* Move the graph to make the item align the view center.
|
|
406
418
|
* @param item node/edge/combo item or its id
|
|
@@ -470,7 +482,11 @@ export interface IGraph<
|
|
|
470
482
|
* @returns
|
|
471
483
|
* @group Item
|
|
472
484
|
*/
|
|
473
|
-
hideItem: (
|
|
485
|
+
hideItem: (
|
|
486
|
+
ids: ID | ID[],
|
|
487
|
+
disableAnimate?: boolean,
|
|
488
|
+
keepKeyShape?: boolean,
|
|
489
|
+
) => void;
|
|
474
490
|
/**
|
|
475
491
|
* Make the item(s) to the front.
|
|
476
492
|
* @param ids the item id(s) to front
|
|
@@ -591,6 +607,11 @@ export interface IGraph<
|
|
|
591
607
|
* @group Interaction
|
|
592
608
|
*/
|
|
593
609
|
getMode: () => string;
|
|
610
|
+
/**
|
|
611
|
+
* Set the cursor. But the cursor in item's style has higher priority.
|
|
612
|
+
* @param cursor
|
|
613
|
+
*/
|
|
614
|
+
setCursor: (cursor: Cursor) => void;
|
|
594
615
|
/**
|
|
595
616
|
* Add behavior(s) to mode(s).
|
|
596
617
|
* @param behaviors behavior names or configs
|
|
@@ -628,7 +649,22 @@ export interface IGraph<
|
|
|
628
649
|
drawTransient: (
|
|
629
650
|
type: ITEM_TYPE | SHAPE_TYPE,
|
|
630
651
|
id: ID,
|
|
631
|
-
config:
|
|
652
|
+
config: {
|
|
653
|
+
action?: 'remove' | 'add' | 'update' | undefined;
|
|
654
|
+
/** Data to be merged into the transient item. */
|
|
655
|
+
data?: Record<string, any>;
|
|
656
|
+
/** Style to be merged into the transient shape. */
|
|
657
|
+
style?: ShapeStyle;
|
|
658
|
+
/** For type: 'edge' */
|
|
659
|
+
drawSource?: boolean;
|
|
660
|
+
/** For type: 'edge' */
|
|
661
|
+
drawTarget?: boolean;
|
|
662
|
+
/** Only shape with id in shapeIds will be cloned while type is ITEM_TYPE. If shapeIds is not assigned, the whole item will be cloned. */
|
|
663
|
+
shapeIds?: string[];
|
|
664
|
+
/** Whether show the shapes in shapeIds. True by default. */
|
|
665
|
+
visible?: boolean;
|
|
666
|
+
upsertAncestors?: boolean;
|
|
667
|
+
},
|
|
632
668
|
canvas?: Canvas,
|
|
633
669
|
) => DisplayObject;
|
|
634
670
|
|
|
@@ -682,16 +718,16 @@ export interface IGraph<
|
|
|
682
718
|
/**
|
|
683
719
|
* Pause stacking operation.
|
|
684
720
|
*/
|
|
685
|
-
|
|
721
|
+
pauseStack: () => void;
|
|
686
722
|
/**
|
|
687
723
|
* Resume stacking operation.
|
|
688
724
|
*/
|
|
689
|
-
|
|
725
|
+
resumeStack: () => void;
|
|
690
726
|
/**
|
|
691
727
|
* Execute a callback without allowing any stacking operations.
|
|
692
728
|
* @param callback
|
|
693
729
|
*/
|
|
694
|
-
|
|
730
|
+
executeWithNoStack: (callback: () => void) => void;
|
|
695
731
|
/**
|
|
696
732
|
* Retrieve the current redo stack which consists of operations that could be undone
|
|
697
733
|
*/
|
|
@@ -731,33 +767,34 @@ export interface IGraph<
|
|
|
731
767
|
canRedo: () => void;
|
|
732
768
|
|
|
733
769
|
/**
|
|
734
|
-
* Begin a
|
|
735
|
-
* Any operations performed between `
|
|
770
|
+
* Begin a historyBatch operation.
|
|
771
|
+
* Any operations performed between `startHistoryBatch` and `stopHistoryBatch` are grouped together.
|
|
736
772
|
* treated as a single operation when undoing or redoing.
|
|
737
773
|
*/
|
|
738
|
-
|
|
774
|
+
startHistoryBatch: () => void;
|
|
739
775
|
|
|
740
776
|
/**
|
|
741
|
-
* End a
|
|
742
|
-
* Any operations performed between `
|
|
777
|
+
* End a historyBatch operation.
|
|
778
|
+
* Any operations performed between `startHistoryBatch` and `stopHistoryBatch` are grouped together.
|
|
743
779
|
* treated as a single operation when undoing or redoing.
|
|
744
780
|
*/
|
|
745
|
-
|
|
781
|
+
stopHistoryBatch: () => void;
|
|
746
782
|
|
|
747
783
|
/**
|
|
748
784
|
* Execute a provided function within a batched context
|
|
749
785
|
* All operations performed inside callback will be treated as a composite operation
|
|
750
|
-
* more convenient way without manually invoking `
|
|
786
|
+
* more convenient way without manually invoking `startHistoryBatch` and `stopHistoryBatch`.
|
|
751
787
|
* @param callback The func containing operations to be batched together.
|
|
752
788
|
*/
|
|
753
|
-
|
|
789
|
+
historyBatch: (callback: () => void) => void;
|
|
790
|
+
|
|
754
791
|
/**
|
|
755
792
|
* Execute a provided function within a batched context
|
|
756
793
|
* All operations performed inside callback will be treated as a composite operation
|
|
757
|
-
* more convenient way without manually invoking `
|
|
794
|
+
* more convenient way without manually invoking `startHistoryBatch` and `stopHistoryBatch`.
|
|
758
795
|
* @param callback The func containing operations to be batched together.
|
|
759
796
|
*/
|
|
760
|
-
|
|
797
|
+
cleanHistory: (stackType?: StackType) => void;
|
|
761
798
|
// ===== tree operations =====
|
|
762
799
|
/**
|
|
763
800
|
* Collapse sub tree(s).
|
package/src/types/hook.ts
CHANGED
|
@@ -11,6 +11,7 @@ import { ThemeSpecification } from './theme';
|
|
|
11
11
|
import { GraphTransformOptions } from './view';
|
|
12
12
|
import { ComboModel } from './combo';
|
|
13
13
|
import { Plugin as PluginBase } from './plugin';
|
|
14
|
+
import { ComboMapper, EdgeMapper, NodeMapper } from './spec';
|
|
14
15
|
|
|
15
16
|
export interface IHook<T> {
|
|
16
17
|
name: string;
|
|
@@ -24,6 +25,7 @@ export interface IHook<T> {
|
|
|
24
25
|
export type ViewportChangeHookParams = {
|
|
25
26
|
transform: GraphTransformOptions;
|
|
26
27
|
effectTiming?: Partial<CameraAnimationOptions>;
|
|
28
|
+
tileLodSize?: number;
|
|
27
29
|
};
|
|
28
30
|
|
|
29
31
|
export interface Hooks {
|
|
@@ -53,6 +55,10 @@ export interface Hooks {
|
|
|
53
55
|
graphCore: GraphCore;
|
|
54
56
|
theme: ThemeSpecification;
|
|
55
57
|
transientCanvas: Canvas;
|
|
58
|
+
tileOptimize?: {
|
|
59
|
+
tileFirstRender?: boolean | number;
|
|
60
|
+
tileFirstRenderSize?: number;
|
|
61
|
+
};
|
|
56
62
|
}>; // TODO: define param template
|
|
57
63
|
layout: IHook<{
|
|
58
64
|
graphCore: GraphCore;
|
|
@@ -82,6 +88,7 @@ export interface Hooks {
|
|
|
82
88
|
action?: string;
|
|
83
89
|
enableStack?: boolean;
|
|
84
90
|
changes?: any;
|
|
91
|
+
keepKeyShape?: boolean;
|
|
85
92
|
}>;
|
|
86
93
|
itemzindexchange: IHook<{
|
|
87
94
|
ids: ID[];
|
|
@@ -95,8 +102,17 @@ export interface Hooks {
|
|
|
95
102
|
id: ID;
|
|
96
103
|
canvas: Canvas;
|
|
97
104
|
config: {
|
|
98
|
-
style
|
|
99
|
-
action
|
|
105
|
+
style?: ShapeStyle;
|
|
106
|
+
action?: 'remove' | 'add' | 'update';
|
|
107
|
+
/** For type: 'edge' */
|
|
108
|
+
drawSource?: boolean;
|
|
109
|
+
/** For type: 'edge' */
|
|
110
|
+
drawTarget?: boolean;
|
|
111
|
+
/** Only shape with id in shapeIds will be cloned while type is ITEM_TYPE. If shapeIds is not assigned, the whole item will be cloned. */
|
|
112
|
+
shapeIds?: string[];
|
|
113
|
+
/** Whether show the shapes in shapeIds. True by default. */
|
|
114
|
+
visible?: boolean;
|
|
115
|
+
upsertAncestors?: boolean;
|
|
100
116
|
};
|
|
101
117
|
graphCore: GraphCore;
|
|
102
118
|
}>;
|
|
@@ -118,6 +134,10 @@ export interface Hooks {
|
|
|
118
134
|
transient: Canvas;
|
|
119
135
|
};
|
|
120
136
|
}>;
|
|
137
|
+
mapperchange: IHook<{
|
|
138
|
+
type: ITEM_TYPE;
|
|
139
|
+
mapper: NodeMapper | EdgeMapper | ComboMapper;
|
|
140
|
+
}>;
|
|
121
141
|
treecollapseexpand: IHook<{
|
|
122
142
|
ids: ID[];
|
|
123
143
|
action: 'collapse' | 'expand';
|
package/src/types/index.ts
CHANGED
|
@@ -49,6 +49,7 @@ export type {
|
|
|
49
49
|
LayoutOptions,
|
|
50
50
|
StandardLayoutOptions,
|
|
51
51
|
} from './layout';
|
|
52
|
-
export type {
|
|
52
|
+
export type { IPluginBaseConfig } from './plugin';
|
|
53
|
+
export { Plugin as PluginBase } from './plugin';
|
|
53
54
|
export type { Specification } from './spec';
|
|
54
55
|
export type { ThemeSpecification } from './theme';
|
package/src/types/item.ts
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
Group,
|
|
14
14
|
DisplayObject,
|
|
15
15
|
IAnimation,
|
|
16
|
+
Shape,
|
|
16
17
|
} from '@antv/g';
|
|
17
18
|
import {
|
|
18
19
|
CubeGeometryProps,
|
|
@@ -61,11 +62,20 @@ export type GShapeStyle = CircleStyleProps &
|
|
|
61
62
|
interactive?: boolean;
|
|
62
63
|
};
|
|
63
64
|
|
|
65
|
+
export type ClipCfg = {
|
|
66
|
+
type: SHAPE_TYPE;
|
|
67
|
+
show: boolean;
|
|
68
|
+
} & CircleStyleProps &
|
|
69
|
+
RectStyleProps &
|
|
70
|
+
EllipseStyleProps;
|
|
71
|
+
|
|
64
72
|
export type ShapeStyle = Partial<
|
|
65
73
|
GShapeStyle & {
|
|
66
74
|
animates?: IAnimates;
|
|
67
75
|
lod?: number;
|
|
68
76
|
visible?: boolean;
|
|
77
|
+
} & {
|
|
78
|
+
clipCfg?: ClipCfg;
|
|
69
79
|
}
|
|
70
80
|
>;
|
|
71
81
|
export interface Encode<T> {
|
package/src/types/plugin.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { deepMix, each } from '@antv/util';
|
|
|
2
2
|
import { IGraph } from './graph';
|
|
3
3
|
|
|
4
4
|
export interface IPluginBaseConfig {
|
|
5
|
-
container?:
|
|
5
|
+
container?: HTMLElement | string | null;
|
|
6
6
|
className?: string;
|
|
7
7
|
graph?: IGraph;
|
|
8
8
|
[key: string]: any;
|
package/src/types/spec.ts
CHANGED
|
@@ -29,6 +29,12 @@ import { RendererName } from './render';
|
|
|
29
29
|
import { StackCfg } from './history';
|
|
30
30
|
import { Plugin } from './plugin';
|
|
31
31
|
|
|
32
|
+
export type NodeMapper = ((data: NodeModel) => NodeDisplayModel) | NodeEncode;
|
|
33
|
+
export type EdgeMapper = ((data: EdgeModel) => EdgeDisplayModel) | EdgeEncode;
|
|
34
|
+
export type ComboMapper =
|
|
35
|
+
| ((data: ComboModel) => ComboDisplayModel)
|
|
36
|
+
| ComboEncode;
|
|
37
|
+
|
|
32
38
|
export interface Specification<
|
|
33
39
|
B extends BehaviorRegistry,
|
|
34
40
|
T extends ThemeRegistry,
|
|
@@ -47,6 +53,19 @@ export interface Specification<
|
|
|
47
53
|
headless: boolean;
|
|
48
54
|
};
|
|
49
55
|
zoom?: number;
|
|
56
|
+
/** Global optimize configuration. */
|
|
57
|
+
optimize?: {
|
|
58
|
+
/** Whether enable tile rendering for first time. */
|
|
59
|
+
tileFirstRender?: boolean | number;
|
|
60
|
+
/** Tile size for first rendering. */
|
|
61
|
+
tileFirstRenderSize?: number;
|
|
62
|
+
/** Whether enable tile hiding / showing for behaivors, e.g. hiding shapes while drag-canvas, zoom-canvas. The enableOptimize in behavior configuration has higher priority. */
|
|
63
|
+
tileBehavior?: boolean | number;
|
|
64
|
+
/** Tile size for shape optimizing by behaviors, e.g. hiding shapes while drag-canvas, zoom-canvas. The enableOptimize in behavior configuration has higher priority. */
|
|
65
|
+
tileBehaviorSize?: number;
|
|
66
|
+
/** Tile size for level of detial changing. */
|
|
67
|
+
tileLodSize?: number;
|
|
68
|
+
};
|
|
50
69
|
autoFit?:
|
|
51
70
|
| 'view'
|
|
52
71
|
| 'center'
|
|
@@ -79,9 +98,9 @@ export interface Specification<
|
|
|
79
98
|
| TransformerFn[];
|
|
80
99
|
|
|
81
100
|
/** item */
|
|
82
|
-
node?:
|
|
83
|
-
edge?:
|
|
84
|
-
combo?:
|
|
101
|
+
node?: NodeMapper;
|
|
102
|
+
edge?: EdgeMapper;
|
|
103
|
+
combo?: ComboMapper;
|
|
85
104
|
|
|
86
105
|
/** item state styles */
|
|
87
106
|
nodeState?: {
|
package/src/types/view.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
export interface FitViewRules {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
/** Whehter fit it only when the graph is out of the view. */
|
|
3
|
+
onlyOutOfViewPort?: boolean;
|
|
4
|
+
/** Axis to fit. */
|
|
5
|
+
direction?: 'x' | 'y' | 'both';
|
|
6
|
+
/** Ratio rule to fit. */
|
|
7
|
+
ratioRule?: 'max' | 'min';
|
|
8
|
+
/** Bounds type. 'render' means calculate the bounds by get rendering bounds. 'layout' for the situation that layout algorithm is done but the positions are not animated rendered. */
|
|
9
|
+
boundsType?: 'render' | 'layout';
|
|
5
10
|
}
|
|
6
11
|
|
|
7
12
|
export type GraphAlignment =
|
package/src/util/bbox.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/* eslint-disable prefer-spread */
|
|
2
1
|
import { AABB } from '@antv/g';
|
|
3
|
-
import { PolyPoint } from 'types/common';
|
|
2
|
+
import { Point, PolyPoint } from 'types/common';
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* Retrieve the width of a bounding box
|
|
@@ -40,10 +39,10 @@ export const getBBoxFromPoints = (points: PolyPoint[] = []): AABB => {
|
|
|
40
39
|
xs.push(p.x);
|
|
41
40
|
ys.push(p.y);
|
|
42
41
|
});
|
|
43
|
-
const minX = Math.min
|
|
44
|
-
const maxX = Math.max
|
|
45
|
-
const minY = Math.min
|
|
46
|
-
const maxY = Math.max
|
|
42
|
+
const minX = Math.min(...xs);
|
|
43
|
+
const maxX = Math.max(...xs);
|
|
44
|
+
const minY = Math.min(...ys);
|
|
45
|
+
const maxY = Math.max(...ys);
|
|
47
46
|
const bbox = new AABB();
|
|
48
47
|
bbox.setMinMax([minX, minY, 0], [maxX, maxY, 0]);
|
|
49
48
|
return bbox;
|
|
@@ -296,3 +295,40 @@ export const isSegmentCrossingBBox = (
|
|
|
296
295
|
}
|
|
297
296
|
return false;
|
|
298
297
|
};
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
Determines whether a given point is inside a given bounding box.
|
|
301
|
+
@param {Point} point - The point to be checked.
|
|
302
|
+
@param {AABB} bbox - The bounding box.
|
|
303
|
+
@returns {boolean} - Returns true if the point is inside the bounding box, false otherwise.
|
|
304
|
+
*/
|
|
305
|
+
export const isPointInBBox = (point: Point, bbox: AABB) => {
|
|
306
|
+
const { x, y } = point;
|
|
307
|
+
return (
|
|
308
|
+
x > bbox.min[0] && x < bbox.max[0] && y > bbox.min[1] && y < bbox.max[1]
|
|
309
|
+
);
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
Determines whether a given sub-bounding box is fully contained within a given bounding box.
|
|
314
|
+
@param {AABB} subBBox - The sub-bounding box to be checked.
|
|
315
|
+
@param {AABB} bbox - The bounding box.
|
|
316
|
+
@param {number} [scale] - Optional scaling factor to adjust the size of the bounding box.
|
|
317
|
+
@returns {boolean} - Returns true if the sub-bounding box is fully contained within the bounding box, false otherwise.
|
|
318
|
+
*/
|
|
319
|
+
export const isBBoxInBBox = (subBBox: AABB, bbox: AABB, scale?: number) => {
|
|
320
|
+
if (scale) {
|
|
321
|
+
return (
|
|
322
|
+
subBBox.min[0] > bbox.min[0] - bbox.halfExtents[0] * scale &&
|
|
323
|
+
subBBox.max[0] < bbox.max[0] + bbox.halfExtents[0] * scale &&
|
|
324
|
+
subBBox.min[1] > bbox.min[1] - bbox.halfExtents[1] * scale &&
|
|
325
|
+
subBBox.max[1] < bbox.max[1] + bbox.halfExtents[1] * scale
|
|
326
|
+
);
|
|
327
|
+
}
|
|
328
|
+
return (
|
|
329
|
+
subBBox.min[0] > bbox.min[0] &&
|
|
330
|
+
subBBox.max[0] < bbox.max[0] &&
|
|
331
|
+
subBBox.min[1] > bbox.min[1] &&
|
|
332
|
+
subBBox.max[1] < bbox.max[1]
|
|
333
|
+
);
|
|
334
|
+
};
|
package/src/util/behavior.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { BehaviorOptionsOf, BehaviorRegistry } from 'types/behavior';
|
|
2
1
|
import { isString } from '@antv/util';
|
|
2
|
+
import { BehaviorOptionsOf, BehaviorRegistry } from '../types/behavior';
|
|
3
3
|
import { isArrayOverlap } from './array';
|
|
4
4
|
|
|
5
5
|
const TREE_BEHAVIORS = ['collapse-expand-tree'];
|
|
6
|
-
export
|
|
6
|
+
export function hasTreeBehaviors(
|
|
7
7
|
behaviors: BehaviorOptionsOf<BehaviorRegistry>[],
|
|
8
|
-
)
|
|
8
|
+
) {
|
|
9
9
|
if (!behaviors?.length) return false;
|
|
10
10
|
const behaviorTypes = behaviors
|
|
11
11
|
.map((behavior) => (isString(behavior) ? behavior : behavior.type))
|
|
12
12
|
.filter(Boolean);
|
|
13
13
|
return isArrayOverlap(TREE_BEHAVIORS, behaviorTypes);
|
|
14
|
-
}
|
|
14
|
+
}
|
package/src/util/data.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { NodeUserModel } from 'types';
|
|
2
1
|
import { ID, TreeData } from '@antv/graphlib';
|
|
3
|
-
import { NodeUserModelData } from 'types/node';
|
|
4
2
|
import { isArray } from '@antv/util';
|
|
5
3
|
import { depthFirstSearch, connectedComponent } from '@antv/algorithm';
|
|
6
4
|
import { GraphCore, GraphData } from '../types/data';
|
|
7
5
|
import { IGraph } from '../types/graph';
|
|
8
|
-
import { NodeModel } from '../types';
|
|
6
|
+
import { NodeModel, NodeUserModel } from '../types';
|
|
7
|
+
import { NodeUserModelData } from '../types/node';
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* Deconstruct data and distinguish nodes and combos from graphcore data.
|
package/src/util/dom.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create DOM from a html string.
|
|
3
|
+
* @param str
|
|
4
|
+
* @returns
|
|
5
|
+
*/
|
|
6
|
+
export function createDOM(str: string): HTMLElement {
|
|
7
|
+
const container = document.createElement('div');
|
|
8
|
+
container.innerHTML = str;
|
|
9
|
+
|
|
10
|
+
const dom = container.childNodes[0];
|
|
11
|
+
if (dom && container.contains(dom)) {
|
|
12
|
+
container.removeChild(dom);
|
|
13
|
+
}
|
|
14
|
+
return dom as HTMLElement;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Modify the CSS of a DOM.
|
|
19
|
+
* @param dom
|
|
20
|
+
* @param css
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
export function modifyCSS(
|
|
24
|
+
dom: HTMLElement,
|
|
25
|
+
css: { [key: string]: any },
|
|
26
|
+
): HTMLElement {
|
|
27
|
+
if (!dom) return;
|
|
28
|
+
|
|
29
|
+
Object.keys(css).forEach((key) => {
|
|
30
|
+
dom.style[key] = css[key];
|
|
31
|
+
});
|
|
32
|
+
return dom;
|
|
33
|
+
}
|
package/src/util/event.ts
CHANGED
|
@@ -9,6 +9,8 @@ import {
|
|
|
9
9
|
NodeDataUpdated,
|
|
10
10
|
NodeRemoved,
|
|
11
11
|
TreeStructureChanged,
|
|
12
|
+
TreeStructureAttached,
|
|
13
|
+
TreeStructureDetached,
|
|
12
14
|
} from '@antv/graphlib';
|
|
13
15
|
import { IG6GraphEvent, IGraph, NodeModelData } from '../types';
|
|
14
16
|
import { GraphCore } from '../types/data';
|
|
@@ -84,6 +86,8 @@ export type GroupedChanges = {
|
|
|
84
86
|
EdgeDataUpdated: EdgeDataUpdated<EdgeModelData>[];
|
|
85
87
|
TreeStructureChanged: TreeStructureChanged[];
|
|
86
88
|
ComboStructureChanged: TreeStructureChanged[];
|
|
89
|
+
TreeStructureAttached: TreeStructureAttached[];
|
|
90
|
+
TreeStructureDetached: TreeStructureDetached[];
|
|
87
91
|
};
|
|
88
92
|
|
|
89
93
|
/**
|
|
@@ -106,6 +110,8 @@ export const getGroupedChanges = (
|
|
|
106
110
|
EdgeDataUpdated: [],
|
|
107
111
|
TreeStructureChanged: [],
|
|
108
112
|
ComboStructureChanged: [],
|
|
113
|
+
TreeStructureAttached: [],
|
|
114
|
+
TreeStructureDetached: [],
|
|
109
115
|
};
|
|
110
116
|
changes.forEach((change) => {
|
|
111
117
|
const { type: changeType } = change;
|
|
@@ -126,7 +132,14 @@ export const getGroupedChanges = (
|
|
|
126
132
|
else if (change.treeKey === 'tree')
|
|
127
133
|
groupedChanges.TreeStructureChanged.push(change);
|
|
128
134
|
return;
|
|
129
|
-
} else if (
|
|
135
|
+
} else if (
|
|
136
|
+
[
|
|
137
|
+
'NodeRemoved',
|
|
138
|
+
'EdgeRemoved',
|
|
139
|
+
'TreeStructureAttached',
|
|
140
|
+
'TreeStructureDetached',
|
|
141
|
+
].includes(changeType)
|
|
142
|
+
) {
|
|
130
143
|
groupedChanges[changeType].push(change);
|
|
131
144
|
} else {
|
|
132
145
|
const { id: oid } = change.value;
|
package/src/util/extend.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { NodeRegistry } from '../types/node';
|
|
|
4
4
|
import { EdgeRegistry } from '../types/edge';
|
|
5
5
|
import { LayoutRegistry } from '../types/layout';
|
|
6
6
|
import { PluginRegistry } from '../types/plugin';
|
|
7
|
-
import Graph from '../runtime/graph';
|
|
7
|
+
import { Graph } from '../runtime/graph';
|
|
8
8
|
import registry from '../stdlib';
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -43,6 +43,5 @@ export const extend = <
|
|
|
43
43
|
extension.type = type;
|
|
44
44
|
});
|
|
45
45
|
});
|
|
46
|
-
|
|
47
|
-
return GraphClass;
|
|
46
|
+
return GraphClass as any;
|
|
48
47
|
};
|
package/src/util/index.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
export { extend } from './extend';
|
|
2
|
+
export { mock } from './mock';
|
|
3
|
+
export { isEncode } from './type';
|
|
4
|
+
export { getArrowPath } from './arrow';
|
|
5
|
+
export {
|
|
6
6
|
graphCoreTreeDfs,
|
|
7
7
|
graphComboTreeDfs,
|
|
8
8
|
traverseAncestorsAndSucceeds,
|
|
@@ -13,22 +13,5 @@ import {
|
|
|
13
13
|
graphData2TreeData,
|
|
14
14
|
traverse,
|
|
15
15
|
} from './data';
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const Util = {
|
|
19
|
-
extend,
|
|
20
|
-
isEncode,
|
|
21
|
-
mock,
|
|
22
|
-
getArrowPath,
|
|
23
|
-
graphCoreTreeDfs,
|
|
24
|
-
graphComboTreeDfs,
|
|
25
|
-
traverseAncestorsAndSucceeds,
|
|
26
|
-
traverseGraphAncestors,
|
|
27
|
-
traverseAncestors,
|
|
28
|
-
isSucceed,
|
|
29
|
-
treeData2GraphData,
|
|
30
|
-
graphData2TreeData,
|
|
31
|
-
traverse,
|
|
32
|
-
getEdgesBetween,
|
|
33
|
-
};
|
|
34
|
-
export default Util;
|
|
16
|
+
export { getEdgesBetween } from './item';
|
|
17
|
+
export { transform } from './matrix';
|