@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/esm/types/graph.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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';
|
|
@@ -10,11 +10,11 @@ import { Padding, Point } from './common';
|
|
|
10
10
|
import { GraphData } from './data';
|
|
11
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
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
|
export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends ThemeRegistry = ThemeRegistry> extends EventEmitter {
|
|
@@ -30,7 +30,7 @@ export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends
|
|
|
30
30
|
* @returns
|
|
31
31
|
* @group Graph Instance
|
|
32
32
|
*/
|
|
33
|
-
destroy: (callback?:
|
|
33
|
+
destroy: (callback?: () => void) => void;
|
|
34
34
|
/**
|
|
35
35
|
* Update the specs (configurations).
|
|
36
36
|
*/
|
|
@@ -39,6 +39,12 @@ export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends
|
|
|
39
39
|
* Update the theme specs (configurations).
|
|
40
40
|
*/
|
|
41
41
|
updateTheme: (theme: ThemeOptionsOf<T>) => void;
|
|
42
|
+
/**
|
|
43
|
+
* Update the item display mapper for a specific item type.
|
|
44
|
+
* @param {ITEM_TYPE} type - The type of item (node, edge, or combo).
|
|
45
|
+
* @param {NodeMapper | EdgeMapper | ComboMapper} mapper - The mapper to be updated.
|
|
46
|
+
* */
|
|
47
|
+
updateMapper: (type: ITEM_TYPE, mapper: NodeMapper | EdgeMapper | ComboMapper) => void;
|
|
42
48
|
/**
|
|
43
49
|
* Get the copy of specs(configurations).
|
|
44
50
|
* @returns graph specs
|
|
@@ -264,8 +270,8 @@ export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends
|
|
|
264
270
|
* @group View
|
|
265
271
|
*/
|
|
266
272
|
fitView: (options?: {
|
|
267
|
-
padding
|
|
268
|
-
rules
|
|
273
|
+
padding?: Padding;
|
|
274
|
+
rules?: FitViewRules;
|
|
269
275
|
}, effectTiming?: CameraAnimationOptions) => Promise<void>;
|
|
270
276
|
/**
|
|
271
277
|
* Fit the graph center to the view center.
|
|
@@ -273,7 +279,7 @@ export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends
|
|
|
273
279
|
* @returns
|
|
274
280
|
* @group View
|
|
275
281
|
*/
|
|
276
|
-
fitCenter: (effectTiming?: CameraAnimationOptions) => Promise<void>;
|
|
282
|
+
fitCenter: (boundsType?: 'render' | 'layout', effectTiming?: CameraAnimationOptions) => Promise<void>;
|
|
277
283
|
/**
|
|
278
284
|
* Move the graph to make the item align the view center.
|
|
279
285
|
* @param item node/edge/combo item or its id
|
|
@@ -334,7 +340,7 @@ export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends
|
|
|
334
340
|
* @returns
|
|
335
341
|
* @group Item
|
|
336
342
|
*/
|
|
337
|
-
hideItem: (ids: ID | ID[], disableAnimate?: boolean) => void;
|
|
343
|
+
hideItem: (ids: ID | ID[], disableAnimate?: boolean, keepKeyShape?: boolean) => void;
|
|
338
344
|
/**
|
|
339
345
|
* Make the item(s) to the front.
|
|
340
346
|
* @param ids the item id(s) to front
|
|
@@ -433,6 +439,11 @@ export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends
|
|
|
433
439
|
* @group Interaction
|
|
434
440
|
*/
|
|
435
441
|
getMode: () => string;
|
|
442
|
+
/**
|
|
443
|
+
* Set the cursor. But the cursor in item's style has higher priority.
|
|
444
|
+
* @param cursor
|
|
445
|
+
*/
|
|
446
|
+
setCursor: (cursor: Cursor) => void;
|
|
436
447
|
/**
|
|
437
448
|
* Add behavior(s) to mode(s).
|
|
438
449
|
* @param behaviors behavior names or configs
|
|
@@ -463,7 +474,22 @@ export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends
|
|
|
463
474
|
* @returns upserted shape or group
|
|
464
475
|
* @group Interaction
|
|
465
476
|
*/
|
|
466
|
-
drawTransient: (type: ITEM_TYPE | SHAPE_TYPE, id: ID, config:
|
|
477
|
+
drawTransient: (type: ITEM_TYPE | SHAPE_TYPE, id: ID, config: {
|
|
478
|
+
action?: 'remove' | 'add' | 'update' | undefined;
|
|
479
|
+
/** Data to be merged into the transient item. */
|
|
480
|
+
data?: Record<string, any>;
|
|
481
|
+
/** Style to be merged into the transient shape. */
|
|
482
|
+
style?: ShapeStyle;
|
|
483
|
+
/** For type: 'edge' */
|
|
484
|
+
drawSource?: boolean;
|
|
485
|
+
/** For type: 'edge' */
|
|
486
|
+
drawTarget?: boolean;
|
|
487
|
+
/** 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. */
|
|
488
|
+
shapeIds?: string[];
|
|
489
|
+
/** Whether show the shapes in shapeIds. True by default. */
|
|
490
|
+
visible?: boolean;
|
|
491
|
+
upsertAncestors?: boolean;
|
|
492
|
+
}, canvas?: Canvas) => DisplayObject;
|
|
467
493
|
/**
|
|
468
494
|
* Add plugin(s) to graph.
|
|
469
495
|
* @param pluginCfgs
|
|
@@ -506,16 +532,16 @@ export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends
|
|
|
506
532
|
/**
|
|
507
533
|
* Pause stacking operation.
|
|
508
534
|
*/
|
|
509
|
-
|
|
535
|
+
pauseStack: () => void;
|
|
510
536
|
/**
|
|
511
537
|
* Resume stacking operation.
|
|
512
538
|
*/
|
|
513
|
-
|
|
539
|
+
resumeStack: () => void;
|
|
514
540
|
/**
|
|
515
541
|
* Execute a callback without allowing any stacking operations.
|
|
516
542
|
* @param callback
|
|
517
543
|
*/
|
|
518
|
-
|
|
544
|
+
executeWithNoStack: (callback: () => void) => void;
|
|
519
545
|
/**
|
|
520
546
|
* Retrieve the current redo stack which consists of operations that could be undone
|
|
521
547
|
*/
|
|
@@ -548,31 +574,31 @@ export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends
|
|
|
548
574
|
*/
|
|
549
575
|
canRedo: () => void;
|
|
550
576
|
/**
|
|
551
|
-
* Begin a
|
|
552
|
-
* Any operations performed between `
|
|
577
|
+
* Begin a historyBatch operation.
|
|
578
|
+
* Any operations performed between `startHistoryBatch` and `stopHistoryBatch` are grouped together.
|
|
553
579
|
* treated as a single operation when undoing or redoing.
|
|
554
580
|
*/
|
|
555
|
-
|
|
581
|
+
startHistoryBatch: () => void;
|
|
556
582
|
/**
|
|
557
|
-
* End a
|
|
558
|
-
* Any operations performed between `
|
|
583
|
+
* End a historyBatch operation.
|
|
584
|
+
* Any operations performed between `startHistoryBatch` and `stopHistoryBatch` are grouped together.
|
|
559
585
|
* treated as a single operation when undoing or redoing.
|
|
560
586
|
*/
|
|
561
|
-
|
|
587
|
+
stopHistoryBatch: () => void;
|
|
562
588
|
/**
|
|
563
589
|
* Execute a provided function within a batched context
|
|
564
590
|
* All operations performed inside callback will be treated as a composite operation
|
|
565
|
-
* more convenient way without manually invoking `
|
|
591
|
+
* more convenient way without manually invoking `startHistoryBatch` and `stopHistoryBatch`.
|
|
566
592
|
* @param callback The func containing operations to be batched together.
|
|
567
593
|
*/
|
|
568
|
-
|
|
594
|
+
historyBatch: (callback: () => void) => void;
|
|
569
595
|
/**
|
|
570
596
|
* Execute a provided function within a batched context
|
|
571
597
|
* All operations performed inside callback will be treated as a composite operation
|
|
572
|
-
* more convenient way without manually invoking `
|
|
598
|
+
* more convenient way without manually invoking `startHistoryBatch` and `stopHistoryBatch`.
|
|
573
599
|
* @param callback The func containing operations to be batched together.
|
|
574
600
|
*/
|
|
575
|
-
|
|
601
|
+
cleanHistory: (stackType?: StackType) => void;
|
|
576
602
|
/**
|
|
577
603
|
* Collapse sub tree(s).
|
|
578
604
|
* @param ids Root id(s) of the sub trees.
|
package/esm/types/history.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type StackCfg = {
|
|
1
|
+
export declare type StackCfg = {
|
|
2
2
|
/** A number representing the size of the stack. */
|
|
3
3
|
stackSize?: number;
|
|
4
4
|
/** Indicate whether the stack is active. If active, operations can be pushed onto the stack; otherwise, cannot. */
|
|
@@ -25,4 +25,4 @@ export declare enum STACK_TYPE {
|
|
|
25
25
|
'redo' = "redo",
|
|
26
26
|
'undo' = "undo"
|
|
27
27
|
}
|
|
28
|
-
export type StackType = `${STACK_TYPE}`;
|
|
28
|
+
export declare type StackType = `${STACK_TYPE}`;
|
package/esm/types/hook.d.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
|
export interface IHook<T> {
|
|
15
16
|
name: string;
|
|
16
17
|
listeners: Function[];
|
|
@@ -19,9 +20,10 @@ export interface IHook<T> {
|
|
|
19
20
|
emit: (param: T) => void;
|
|
20
21
|
emitLinearAsync: (param: T) => Promise<void>;
|
|
21
22
|
}
|
|
22
|
-
export type ViewportChangeHookParams = {
|
|
23
|
+
export declare type ViewportChangeHookParams = {
|
|
23
24
|
transform: GraphTransformOptions;
|
|
24
25
|
effectTiming?: Partial<CameraAnimationOptions>;
|
|
26
|
+
tileLodSize?: number;
|
|
25
27
|
};
|
|
26
28
|
export interface Hooks {
|
|
27
29
|
init: IHook<{
|
|
@@ -49,6 +51,10 @@ export interface Hooks {
|
|
|
49
51
|
graphCore: GraphCore;
|
|
50
52
|
theme: ThemeSpecification;
|
|
51
53
|
transientCanvas: Canvas;
|
|
54
|
+
tileOptimize?: {
|
|
55
|
+
tileFirstRender?: boolean | number;
|
|
56
|
+
tileFirstRenderSize?: number;
|
|
57
|
+
};
|
|
52
58
|
}>;
|
|
53
59
|
layout: IHook<{
|
|
54
60
|
graphCore: GraphCore;
|
|
@@ -79,6 +85,7 @@ export interface Hooks {
|
|
|
79
85
|
action?: string;
|
|
80
86
|
enableStack?: boolean;
|
|
81
87
|
changes?: any;
|
|
88
|
+
keepKeyShape?: boolean;
|
|
82
89
|
}>;
|
|
83
90
|
itemzindexchange: IHook<{
|
|
84
91
|
ids: ID[];
|
|
@@ -92,8 +99,17 @@ export interface Hooks {
|
|
|
92
99
|
id: ID;
|
|
93
100
|
canvas: Canvas;
|
|
94
101
|
config: {
|
|
95
|
-
style
|
|
96
|
-
action
|
|
102
|
+
style?: ShapeStyle;
|
|
103
|
+
action?: 'remove' | 'add' | 'update';
|
|
104
|
+
/** For type: 'edge' */
|
|
105
|
+
drawSource?: boolean;
|
|
106
|
+
/** For type: 'edge' */
|
|
107
|
+
drawTarget?: boolean;
|
|
108
|
+
/** 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. */
|
|
109
|
+
shapeIds?: string[];
|
|
110
|
+
/** Whether show the shapes in shapeIds. True by default. */
|
|
111
|
+
visible?: boolean;
|
|
112
|
+
upsertAncestors?: boolean;
|
|
97
113
|
};
|
|
98
114
|
graphCore: GraphCore;
|
|
99
115
|
}>;
|
|
@@ -114,6 +130,10 @@ export interface Hooks {
|
|
|
114
130
|
transient: Canvas;
|
|
115
131
|
};
|
|
116
132
|
}>;
|
|
133
|
+
mapperchange: IHook<{
|
|
134
|
+
type: ITEM_TYPE;
|
|
135
|
+
mapper: NodeMapper | EdgeMapper | ComboMapper;
|
|
136
|
+
}>;
|
|
117
137
|
treecollapseexpand: IHook<{
|
|
118
138
|
ids: ID[];
|
|
119
139
|
action: 'collapse' | 'expand';
|
package/esm/types/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export type { IGraph } from './graph';
|
|
|
11
11
|
export type { StackCfg } from './history';
|
|
12
12
|
export { isImmediatelyInvokedLayoutOptions, isLayoutWorkerized, } from './layout';
|
|
13
13
|
export type { ImmediatelyInvokedLayoutOptions, LayoutOptions, StandardLayoutOptions, } from './layout';
|
|
14
|
-
export type {
|
|
14
|
+
export type { IPluginBaseConfig } from './plugin';
|
|
15
|
+
export { Plugin as PluginBase } from './plugin';
|
|
15
16
|
export type { Specification } from './spec';
|
|
16
17
|
export type { ThemeSpecification } from './theme';
|
package/esm/types/index.js
CHANGED
package/esm/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["types/index.ts"],"names":[],"mappings":"AA0CA,OAAO,EACL,iCAAiC,EACjC,kBAAkB,GACnB,MAAM,UAAU,CAAC,CAAC,4BAA4B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["types/index.ts"],"names":[],"mappings":"AA0CA,OAAO,EACL,iCAAiC,EACjC,kBAAkB,GACnB,MAAM,UAAU,CAAC,CAAC,4BAA4B;AAO/C,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,UAAU,CAAC"}
|
package/esm/types/item.d.ts
CHANGED
|
@@ -6,13 +6,19 @@ import { ComboDisplayModel, ComboEncode, ComboModel, ComboModelData, ComboUserMo
|
|
|
6
6
|
import { EdgeDisplayModel, EdgeEncode, EdgeModel, EdgeModelData, EdgeShapeMap, EdgeUserModel } from './edge';
|
|
7
7
|
import { NodeDisplayModel, NodeEncode, NodeModel, NodeModelData, NodeShapeMap, NodeUserModel } from './node';
|
|
8
8
|
import { ComboStyleSet, EdgeStyleSet, NodeStyleSet } from './theme';
|
|
9
|
-
export type GShapeStyle = CircleStyleProps & RectStyleProps & EllipseStyleProps & PolygonStyleProps & LineStyleProps & PolylineStyleProps & TextStyleProps & ImageStyleProps & PathStyleProps & SphereGeometryProps & CubeGeometryProps & PlaneGeometryProps & {
|
|
9
|
+
export declare type GShapeStyle = CircleStyleProps & RectStyleProps & EllipseStyleProps & PolygonStyleProps & LineStyleProps & PolylineStyleProps & TextStyleProps & ImageStyleProps & PathStyleProps & SphereGeometryProps & CubeGeometryProps & PlaneGeometryProps & {
|
|
10
10
|
interactive?: boolean;
|
|
11
11
|
};
|
|
12
|
-
export type
|
|
12
|
+
export declare type ClipCfg = {
|
|
13
|
+
type: SHAPE_TYPE;
|
|
14
|
+
show: boolean;
|
|
15
|
+
} & CircleStyleProps & RectStyleProps & EllipseStyleProps;
|
|
16
|
+
export declare type ShapeStyle = Partial<GShapeStyle & {
|
|
13
17
|
animates?: IAnimates;
|
|
14
18
|
lod?: number;
|
|
15
19
|
visible?: boolean;
|
|
20
|
+
} & {
|
|
21
|
+
clipCfg?: ClipCfg;
|
|
16
22
|
}>;
|
|
17
23
|
export interface Encode<T> {
|
|
18
24
|
fields: string[];
|
|
@@ -39,14 +45,14 @@ export interface ShapesEncode {
|
|
|
39
45
|
};
|
|
40
46
|
};
|
|
41
47
|
}
|
|
42
|
-
export type SHAPE_TYPE = 'rect' | 'circle' | 'ellipse' | 'polygon' | 'image' | 'polyline' | 'line' | 'path' | 'text';
|
|
43
|
-
export type SHAPE_TYPE_3D = 'sphere' | 'cube' | 'plane';
|
|
44
|
-
export type ITEM_TYPE = 'node' | 'edge' | 'combo';
|
|
45
|
-
export type ItemModelData = NodeModelData | EdgeModelData | ComboModelData;
|
|
46
|
-
export type ItemModel = NodeModel | EdgeModel | ComboModel;
|
|
47
|
-
export type ItemDisplayModel = NodeDisplayModel | EdgeDisplayModel | ComboDisplayModel;
|
|
48
|
-
export type DisplayMapper = ((model: ItemModel) => ItemDisplayModel) | NodeEncode | EdgeEncode | ComboEncode;
|
|
49
|
-
export type State = {
|
|
48
|
+
export declare type SHAPE_TYPE = 'rect' | 'circle' | 'ellipse' | 'polygon' | 'image' | 'polyline' | 'line' | 'path' | 'text';
|
|
49
|
+
export declare type SHAPE_TYPE_3D = 'sphere' | 'cube' | 'plane';
|
|
50
|
+
export declare type ITEM_TYPE = 'node' | 'edge' | 'combo';
|
|
51
|
+
export declare type ItemModelData = NodeModelData | EdgeModelData | ComboModelData;
|
|
52
|
+
export declare type ItemModel = NodeModel | EdgeModel | ComboModel;
|
|
53
|
+
export declare type ItemDisplayModel = NodeDisplayModel | EdgeDisplayModel | ComboDisplayModel;
|
|
54
|
+
export declare type DisplayMapper = ((model: ItemModel) => ItemDisplayModel) | NodeEncode | EdgeEncode | ComboEncode;
|
|
55
|
+
export declare type State = {
|
|
50
56
|
name: string;
|
|
51
57
|
value: boolean | string | number;
|
|
52
58
|
};
|
|
@@ -64,9 +70,9 @@ export declare enum BadgePosition {
|
|
|
64
70
|
top = "top",
|
|
65
71
|
topRight = "topRight"
|
|
66
72
|
}
|
|
67
|
-
export type IBadgePosition = `${BadgePosition}`;
|
|
73
|
+
export declare type IBadgePosition = `${BadgePosition}`;
|
|
68
74
|
/** Shape styles for an item. */
|
|
69
|
-
export type ItemShapeStyles = {
|
|
75
|
+
export declare type ItemShapeStyles = {
|
|
70
76
|
keyShape?: ShapeStyle;
|
|
71
77
|
iconShape?: Partial<TextStyleProps & ImageStyleProps & ShapeStyle & {
|
|
72
78
|
offsetX?: number;
|
package/esm/types/item.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item.js","sourceRoot":"src/","sources":["types/item.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"item.js","sourceRoot":"src/","sources":["types/item.ts"],"names":[],"mappings":"AA+IA,MAAM,CAAN,IAAY,aAaX;AAbD,WAAY,aAAa;IACvB,sCAAqB,CAAA;IACrB,gCAAe,CAAA;IACf,4CAA2B,CAAA;IAC3B,4CAA2B,CAAA;IAC3B,kCAAiB,CAAA;IACjB,0CAAyB,CAAA;IACzB,0CAAyB,CAAA;IACzB,8BAAa,CAAA;IACb,oCAAmB,CAAA;IACnB,oCAAmB,CAAA;IACnB,4BAAW,CAAA;IACX,sCAAqB,CAAA;AACvB,CAAC,EAbW,aAAa,KAAb,aAAa,QAaxB"}
|
package/esm/types/layout.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IAnimationEffectTiming } from '@antv/g';
|
|
2
2
|
import { CircularLayoutOptions, ConcentricLayoutOptions, D3ForceLayoutOptions, ForceAtlas2LayoutOptions, ForceLayoutOptions, FruchtermanLayoutOptions, GridLayoutOptions, Layout, LayoutMapping, MDSLayoutOptions, RadialLayoutOptions, RandomLayoutOptions } from '@antv/layout';
|
|
3
3
|
import { GraphCore } from './data';
|
|
4
|
-
type Animatable = {
|
|
4
|
+
declare type Animatable = {
|
|
5
5
|
/**
|
|
6
6
|
* Make layout animated. For layouts with iterations, transitions will happen between ticks.
|
|
7
7
|
*/
|
|
@@ -12,7 +12,7 @@ type Animatable = {
|
|
|
12
12
|
*/
|
|
13
13
|
animationEffectTiming?: Partial<IAnimationEffectTiming>;
|
|
14
14
|
};
|
|
15
|
-
type Workerized = {
|
|
15
|
+
declare type Workerized = {
|
|
16
16
|
/**
|
|
17
17
|
* Make layout running in WebWorker.
|
|
18
18
|
*/
|
|
@@ -22,18 +22,18 @@ type Workerized = {
|
|
|
22
22
|
*/
|
|
23
23
|
iterations?: number;
|
|
24
24
|
};
|
|
25
|
-
export type ImmediatelyInvokedLayoutOptions = {
|
|
25
|
+
export declare type ImmediatelyInvokedLayoutOptions = {
|
|
26
26
|
/**
|
|
27
27
|
* like an IIFE.
|
|
28
28
|
*/
|
|
29
29
|
execute: (graph: GraphCore, options?: any) => Promise<LayoutMapping>;
|
|
30
30
|
} & Animatable;
|
|
31
|
-
type CustomLayout = {
|
|
31
|
+
declare type CustomLayout = {
|
|
32
32
|
type: string;
|
|
33
33
|
[option: string]: any;
|
|
34
34
|
};
|
|
35
|
-
export type StandardLayoutOptions = (CircularLayout | RandomLayout | ConcentricLayout | GridLayout | MDSLayout | RadialLayout | FruchtermanLayout | D3ForceLayout | ForceLayout | ForceAtlas2 | CustomLayout) & Animatable & Workerized;
|
|
36
|
-
export type LayoutOptions = StandardLayoutOptions | ImmediatelyInvokedLayoutOptions;
|
|
35
|
+
export declare type StandardLayoutOptions = (CircularLayout | RandomLayout | ConcentricLayout | GridLayout | MDSLayout | RadialLayout | FruchtermanLayout | D3ForceLayout | ForceLayout | ForceAtlas2 | CustomLayout) & Animatable & Workerized;
|
|
36
|
+
export declare type LayoutOptions = StandardLayoutOptions | ImmediatelyInvokedLayoutOptions;
|
|
37
37
|
export declare function isImmediatelyInvokedLayoutOptions(options: any): options is ImmediatelyInvokedLayoutOptions;
|
|
38
38
|
export declare function isLayoutWorkerized(options: StandardLayoutOptions): boolean;
|
|
39
39
|
interface CircularLayout extends CircularLayoutOptions {
|
package/esm/types/loop.d.ts
CHANGED
|
@@ -8,8 +8,8 @@ export declare enum LOOP_POSITION {
|
|
|
8
8
|
'left' = "left",
|
|
9
9
|
'top-left' = "top-left"
|
|
10
10
|
}
|
|
11
|
-
export type LoopPosition = `${LOOP_POSITION}`;
|
|
12
|
-
export type LoopCfg = {
|
|
11
|
+
export declare type LoopPosition = `${LOOP_POSITION}`;
|
|
12
|
+
export declare type LoopCfg = {
|
|
13
13
|
/** Specifies the relative position of the self-loop to the node. Default: top. */
|
|
14
14
|
position?: LoopPosition;
|
|
15
15
|
/** Determine the position from the edge of the node keyShape to the top of the self-loop, used to specify the curvature of the self-loop, the default is the height. */
|
package/esm/types/node.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { BaseNode } from '../stdlib/item/node/base';
|
|
|
4
4
|
import { BaseNode3D } from '../stdlib/item/node/base3d';
|
|
5
5
|
import { IAnimates } from './animate';
|
|
6
6
|
import { BadgePosition, Encode, IBadgePosition, IItem, ItemShapeStyles, LodStrategy, ShapeAttrEncode, ShapeStyle, ShapesEncode } from './item';
|
|
7
|
-
export type NodeLabelPosition = 'bottom' | 'center' | 'top' | 'left' | 'right';
|
|
7
|
+
export declare type NodeLabelPosition = 'bottom' | 'center' | 'top' | 'left' | 'right';
|
|
8
8
|
/** Data in user input model. */
|
|
9
9
|
export interface NodeUserModelData extends PlainObject {
|
|
10
10
|
/**
|
|
@@ -77,7 +77,7 @@ export interface NodeUserModelData extends PlainObject {
|
|
|
77
77
|
preventPolylineEdgeOverlap?: boolean;
|
|
78
78
|
}
|
|
79
79
|
/** Data in inner model. Same format to the user data. */
|
|
80
|
-
export type NodeModelData = NodeUserModelData;
|
|
80
|
+
export declare type NodeModelData = NodeUserModelData;
|
|
81
81
|
export interface NodeShapeStyles extends ItemShapeStyles {
|
|
82
82
|
/**
|
|
83
83
|
* Style of the text to show on the node.
|
|
@@ -174,15 +174,15 @@ export interface NodeShapeStyles extends ItemShapeStyles {
|
|
|
174
174
|
};
|
|
175
175
|
}
|
|
176
176
|
/** Data in display model. */
|
|
177
|
-
export type NodeDisplayModelData = NodeModelData & NodeShapeStyles & {
|
|
177
|
+
export declare type NodeDisplayModelData = NodeModelData & NodeShapeStyles & {
|
|
178
178
|
lodStrategy?: LodStrategy;
|
|
179
179
|
};
|
|
180
180
|
/** User input model. */
|
|
181
|
-
export type NodeUserModel = GNode<NodeUserModelData>;
|
|
181
|
+
export declare type NodeUserModel = GNode<NodeUserModelData>;
|
|
182
182
|
/** Inner node model, clone and transform from user data. */
|
|
183
|
-
export type NodeModel = GNode<NodeModelData>;
|
|
183
|
+
export declare type NodeModel = GNode<NodeModelData>;
|
|
184
184
|
/** Displayed model, only for drawing and not received by users. */
|
|
185
|
-
export type NodeDisplayModel = GNode<NodeDisplayModelData>;
|
|
185
|
+
export declare type NodeDisplayModel = GNode<NodeDisplayModelData>;
|
|
186
186
|
interface NodeLabelShapeAttrEncode extends ShapeAttrEncode {
|
|
187
187
|
position?: NodeLabelPosition | Encode<NodeLabelPosition>;
|
|
188
188
|
offsetX?: number | Encode<number>;
|
|
@@ -205,7 +205,7 @@ export interface NodeShapeMap {
|
|
|
205
205
|
iconShape?: DisplayObject;
|
|
206
206
|
[otherShapeId: string]: DisplayObject;
|
|
207
207
|
}
|
|
208
|
-
export type INode = IItem;
|
|
208
|
+
export declare type INode = IItem;
|
|
209
209
|
export interface IAnchorPositionMap {
|
|
210
210
|
[key: string]: [number, number];
|
|
211
211
|
}
|
package/esm/types/plugin.d.ts
CHANGED
package/esm/types/render.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export type RendererName = 'canvas' | 'svg' | 'webgl' | 'webgl-3d';
|
|
1
|
+
export declare type RendererName = 'canvas' | 'svg' | 'webgl' | 'webgl-3d';
|
package/esm/types/spec.d.ts
CHANGED
|
@@ -12,6 +12,9 @@ import { ThemeOptionsOf, ThemeRegistry } from './theme';
|
|
|
12
12
|
import { RendererName } from './render';
|
|
13
13
|
import { StackCfg } from './history';
|
|
14
14
|
import { Plugin } from './plugin';
|
|
15
|
+
export declare type NodeMapper = ((data: NodeModel) => NodeDisplayModel) | NodeEncode;
|
|
16
|
+
export declare type EdgeMapper = ((data: EdgeModel) => EdgeDisplayModel) | EdgeEncode;
|
|
17
|
+
export declare type ComboMapper = ((data: ComboModel) => ComboDisplayModel) | ComboEncode;
|
|
15
18
|
export interface Specification<B extends BehaviorRegistry, T extends ThemeRegistry> {
|
|
16
19
|
container?: string | HTMLElement;
|
|
17
20
|
backgroundCanvas?: Canvas;
|
|
@@ -25,6 +28,19 @@ export interface Specification<B extends BehaviorRegistry, T extends ThemeRegist
|
|
|
25
28
|
headless: boolean;
|
|
26
29
|
};
|
|
27
30
|
zoom?: number;
|
|
31
|
+
/** Global optimize configuration. */
|
|
32
|
+
optimize?: {
|
|
33
|
+
/** Whether enable tile rendering for first time. */
|
|
34
|
+
tileFirstRender?: boolean | number;
|
|
35
|
+
/** Tile size for first rendering. */
|
|
36
|
+
tileFirstRenderSize?: number;
|
|
37
|
+
/** Whether enable tile hiding / showing for behaivors, e.g. hiding shapes while drag-canvas, zoom-canvas. The enableOptimize in behavior configuration has higher priority. */
|
|
38
|
+
tileBehavior?: boolean | number;
|
|
39
|
+
/** Tile size for shape optimizing by behaviors, e.g. hiding shapes while drag-canvas, zoom-canvas. The enableOptimize in behavior configuration has higher priority. */
|
|
40
|
+
tileBehaviorSize?: number;
|
|
41
|
+
/** Tile size for level of detial changing. */
|
|
42
|
+
tileLodSize?: number;
|
|
43
|
+
};
|
|
28
44
|
autoFit?: 'view' | 'center' | {
|
|
29
45
|
type: 'view';
|
|
30
46
|
padding?: Padding;
|
|
@@ -47,9 +63,9 @@ export interface Specification<B extends BehaviorRegistry, T extends ThemeRegist
|
|
|
47
63
|
[param: string]: unknown;
|
|
48
64
|
}[] | TransformerFn[];
|
|
49
65
|
/** item */
|
|
50
|
-
node?:
|
|
51
|
-
edge?:
|
|
52
|
-
combo?:
|
|
66
|
+
node?: NodeMapper;
|
|
67
|
+
edge?: EdgeMapper;
|
|
68
|
+
combo?: ComboMapper;
|
|
53
69
|
/** item state styles */
|
|
54
70
|
nodeState?: {
|
|
55
71
|
[stateName: string]: ((data: NodeModel) => NodeDisplayModel) | NodeShapesEncode;
|
package/esm/types/stdlib.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BehaviorRegistry } from './behavior';
|
|
2
2
|
import { ThemeRegistry } from './theme';
|
|
3
|
-
export type StdLibCategory = 'transform' | 'behavior' | 'layout' | 'node' | 'edge' | 'combo' | 'theme' | 'themeSolver' | 'plugin';
|
|
3
|
+
export declare type StdLibCategory = 'transform' | 'behavior' | 'layout' | 'node' | 'edge' | 'combo' | 'theme' | 'themeSolver' | 'plugin';
|
|
4
4
|
export interface Lib {
|
|
5
5
|
behaviors?: BehaviorRegistry;
|
|
6
6
|
themes?: ThemeRegistry;
|
package/esm/types/theme.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export interface ThemeRegistry {
|
|
|
24
24
|
* Type templates, input registry table, output configure type.
|
|
25
25
|
* @example ThemeOptionsOf<{ 'drag-node': typeof DragNodeBehavior }> // 'drag-node' | { type: 'drag-node', key?: 'ctrl' | 'shift' }
|
|
26
26
|
*/
|
|
27
|
-
export type ThemeOptionsOf<T extends ThemeRegistry = {}> = Extract<keyof T, string> | {
|
|
27
|
+
export declare type ThemeOptionsOf<T extends ThemeRegistry = {}> = Extract<keyof T, string> | {
|
|
28
28
|
[K in keyof T]: T[K] extends {
|
|
29
29
|
new (options: infer O): any;
|
|
30
30
|
} ? O & {
|
|
@@ -33,7 +33,7 @@ export type ThemeOptionsOf<T extends ThemeRegistry = {}> = Extract<keyof T, stri
|
|
|
33
33
|
type: K;
|
|
34
34
|
};
|
|
35
35
|
}[Extract<keyof T, string>];
|
|
36
|
-
export type ThemeObjectOptionsOf<T extends ThemeRegistry = {}> = {
|
|
36
|
+
export declare type ThemeObjectOptionsOf<T extends ThemeRegistry = {}> = {
|
|
37
37
|
[K in keyof T]: T[K] extends {
|
|
38
38
|
new (options: infer O): any;
|
|
39
39
|
} ? O & {
|
|
@@ -42,21 +42,21 @@ export type ThemeObjectOptionsOf<T extends ThemeRegistry = {}> = {
|
|
|
42
42
|
} : never;
|
|
43
43
|
}[Extract<keyof T, string>];
|
|
44
44
|
/** Default and state styles for a node. */
|
|
45
|
-
export type NodeStyleSet = {
|
|
45
|
+
export declare type NodeStyleSet = {
|
|
46
46
|
/** Styles in default state. */
|
|
47
47
|
default: NodeShapeStyles;
|
|
48
48
|
/** Styles in different states. */
|
|
49
49
|
[stateName: string]: NodeShapeStyles;
|
|
50
50
|
};
|
|
51
51
|
/** Default and state styles for an edge. */
|
|
52
|
-
export type EdgeStyleSet = {
|
|
52
|
+
export declare type EdgeStyleSet = {
|
|
53
53
|
/** Styles in default state. */
|
|
54
54
|
default: EdgeShapeStyles;
|
|
55
55
|
/** Styles in different states. */
|
|
56
56
|
[stateName: string]: EdgeShapeStyles;
|
|
57
57
|
};
|
|
58
58
|
/** Default and state styles for a combo. */
|
|
59
|
-
export type ComboStyleSet = {
|
|
59
|
+
export declare type ComboStyleSet = {
|
|
60
60
|
/** Styles in default state. */
|
|
61
61
|
default: ComboShapeStyles;
|
|
62
62
|
/** Styles in different states. */
|
|
@@ -75,7 +75,7 @@ export type ComboStyleSet = {
|
|
|
75
75
|
* 'cluster2': { default: { keyShape: { fill: 'blue', stroke: 'black' } }, selected: { keyShape: { fill: 'green' }} },
|
|
76
76
|
* }
|
|
77
77
|
**/
|
|
78
|
-
export type NodeStyleSets = NodeStyleSet[] | {
|
|
78
|
+
export declare type NodeStyleSets = NodeStyleSet[] | {
|
|
79
79
|
[dataTypeValue: string]: NodeStyleSet;
|
|
80
80
|
};
|
|
81
81
|
/** Array of edge style sets to map the palette in order.
|
|
@@ -91,7 +91,7 @@ export type NodeStyleSets = NodeStyleSet[] | {
|
|
|
91
91
|
* 'cluster2': { default: { keyShape: { fill: 'blue', stroke: 'black' } }, selected: { keyShape: { fill: 'green' }} },
|
|
92
92
|
* }
|
|
93
93
|
**/
|
|
94
|
-
export type EdgeStyleSets = EdgeStyleSet[] | {
|
|
94
|
+
export declare type EdgeStyleSets = EdgeStyleSet[] | {
|
|
95
95
|
[dataTypeValue: string]: EdgeStyleSet;
|
|
96
96
|
};
|
|
97
97
|
/** Array of combo style sets to map the palette in order.
|
|
@@ -107,7 +107,7 @@ export type EdgeStyleSets = EdgeStyleSet[] | {
|
|
|
107
107
|
* 'cluster2': { default: { keyShape: { fill: 'blue', stroke: 'black' } }, selected: { keyShape: { fill: 'green' }} },
|
|
108
108
|
* }
|
|
109
109
|
**/
|
|
110
|
-
export type ComboStyleSets = ComboStyleSet[] | {
|
|
110
|
+
export declare type ComboStyleSets = ComboStyleSet[] | {
|
|
111
111
|
[dataTypeValue: string]: ComboStyleSet;
|
|
112
112
|
};
|
|
113
113
|
/**
|
package/esm/types/view.d.ts
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
export interface FitViewRules {
|
|
2
|
+
/** Whehter fit it only when the graph is out of the view. */
|
|
2
3
|
onlyOutOfViewPort?: boolean;
|
|
4
|
+
/** Axis to fit. */
|
|
3
5
|
direction?: 'x' | 'y' | 'both';
|
|
6
|
+
/** Ratio rule to fit. */
|
|
4
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
|
-
export type GraphAlignment = 'left-top' | 'right-top' | 'left-bottom' | 'right-bottom' | 'center' | [number, number];
|
|
7
|
-
export type GraphTransformOptions = {
|
|
11
|
+
export declare type GraphAlignment = 'left-top' | 'right-top' | 'left-bottom' | 'right-bottom' | 'center' | [number, number];
|
|
12
|
+
export declare type GraphTransformOptions = {
|
|
8
13
|
translate?: Partial<{
|
|
9
14
|
dx: number;
|
|
10
15
|
dy: number;
|
package/esm/util/bbox.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AABB } from '@antv/g';
|
|
2
|
-
import { PolyPoint } from 'types/common';
|
|
2
|
+
import { Point, PolyPoint } from 'types/common';
|
|
3
3
|
/**
|
|
4
4
|
* Retrieve the width of a bounding box
|
|
5
5
|
* @param bbox a bounding box
|
|
@@ -104,3 +104,18 @@ export declare const isSegmentsIntersected: (p0: PolyPoint, p1: PolyPoint, p2: P
|
|
|
104
104
|
* @returns True if the line segment intersects with bbox, False otherwise
|
|
105
105
|
*/
|
|
106
106
|
export declare const isSegmentCrossingBBox: (p1: PolyPoint, p2: PolyPoint, bbox: AABB) => boolean;
|
|
107
|
+
/**
|
|
108
|
+
Determines whether a given point is inside a given bounding box.
|
|
109
|
+
@param {Point} point - The point to be checked.
|
|
110
|
+
@param {AABB} bbox - The bounding box.
|
|
111
|
+
@returns {boolean} - Returns true if the point is inside the bounding box, false otherwise.
|
|
112
|
+
*/
|
|
113
|
+
export declare const isPointInBBox: (point: Point, bbox: AABB) => boolean;
|
|
114
|
+
/**
|
|
115
|
+
Determines whether a given sub-bounding box is fully contained within a given bounding box.
|
|
116
|
+
@param {AABB} subBBox - The sub-bounding box to be checked.
|
|
117
|
+
@param {AABB} bbox - The bounding box.
|
|
118
|
+
@param {number} [scale] - Optional scaling factor to adjust the size of the bounding box.
|
|
119
|
+
@returns {boolean} - Returns true if the sub-bounding box is fully contained within the bounding box, false otherwise.
|
|
120
|
+
*/
|
|
121
|
+
export declare const isBBoxInBBox: (subBBox: AABB, bbox: AABB, scale?: number) => boolean;
|