@antv/g6 5.0.0-beta.33 → 5.0.0-beta.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/g6.min.js +2 -2
- package/dist/lib/animations/types.d.ts +3 -4
- package/dist/lib/behaviors/base-behavior.d.ts +2 -1
- package/dist/lib/behaviors/brush-select.d.ts +33 -16
- package/dist/lib/behaviors/click-element.d.ts +28 -5
- package/dist/lib/behaviors/collapse-expand.d.ts +3 -2
- package/dist/lib/behaviors/create-edge.d.ts +1 -2
- package/dist/lib/behaviors/drag-canvas.d.ts +7 -0
- package/dist/lib/behaviors/drag-element-force.d.ts +1 -2
- package/dist/lib/behaviors/drag-element.d.ts +4 -5
- package/dist/lib/behaviors/index.d.ts +2 -0
- package/dist/lib/behaviors/lasso-select.d.ts +4 -4
- package/dist/lib/behaviors/scroll-canvas.d.ts +64 -0
- package/dist/lib/behaviors/types.d.ts +2 -1
- package/dist/lib/behaviors/zoom-canvas.d.ts +1 -1
- package/dist/lib/constants/events/animation.d.ts +1 -4
- package/dist/lib/constants/events/graph.d.ts +5 -1
- package/dist/lib/elements/combos/base-combo.d.ts +1 -1
- package/dist/lib/elements/edges/base-edge.d.ts +0 -5
- package/dist/lib/elements/nodes/base-node.d.ts +3 -10
- package/dist/lib/elements/nodes/donut.d.ts +45 -0
- package/dist/lib/elements/nodes/html.d.ts +27 -0
- package/dist/lib/elements/nodes/index.d.ts +4 -0
- package/dist/lib/elements/shapes/badge.d.ts +1 -1
- package/dist/lib/{plugins/hull/shape.d.ts → elements/shapes/contour.d.ts} +17 -17
- package/dist/lib/elements/shapes/index.d.ts +2 -0
- package/dist/lib/exports.d.ts +15 -22
- package/dist/lib/plugins/bubble-sets.d.ts +45 -0
- package/dist/lib/plugins/camera-setting.d.ts +4 -2
- package/dist/lib/plugins/contextmenu.d.ts +1 -0
- package/dist/lib/plugins/grid-line.d.ts +51 -8
- package/dist/lib/plugins/hull/index.d.ts +44 -13
- package/dist/lib/plugins/index.d.ts +4 -0
- package/dist/lib/plugins/timebar.d.ts +225 -0
- package/dist/lib/plugins/tooltip.d.ts +2 -2
- package/dist/lib/registry/index.d.ts +1 -1
- package/dist/lib/runtime/data.d.ts +13 -7
- package/dist/lib/runtime/element.d.ts +6 -10
- package/dist/lib/runtime/graph.d.ts +532 -45
- package/dist/lib/runtime/types.d.ts +3 -3
- package/dist/lib/runtime/viewport.d.ts +3 -4
- package/dist/lib/spec/canvas.d.ts +6 -2
- package/dist/lib/spec/data.d.ts +74 -1
- package/dist/lib/spec/element/combo.d.ts +17 -6
- package/dist/lib/spec/element/edge.d.ts +14 -2
- package/dist/lib/spec/element/node.d.ts +19 -3
- package/{lib/spec/spec.d.ts → dist/lib/spec/graph.d.ts} +12 -4
- package/dist/lib/spec/index.d.ts +1 -1
- package/dist/lib/spec/theme.d.ts +1 -4
- package/dist/lib/spec/viewport.d.ts +1 -1
- package/dist/lib/themes/base.d.ts +1 -0
- package/dist/lib/themes/types.d.ts +0 -1
- package/dist/lib/transforms/process-parallel-edges.d.ts +2 -3
- package/dist/lib/transforms/types.d.ts +1 -1
- package/dist/lib/types/callable.d.ts +2 -2
- package/dist/lib/types/data.d.ts +3 -3
- package/dist/lib/types/id.d.ts +1 -0
- package/dist/lib/types/index.d.ts +1 -0
- package/dist/lib/types/style.d.ts +1 -3
- package/dist/lib/types/viewport.d.ts +4 -4
- package/dist/lib/utils/animation.d.ts +6 -6
- package/dist/lib/utils/behaviors/brush.d.ts +1 -2
- package/dist/lib/utils/behaviors/lasso.d.ts +1 -2
- package/dist/lib/utils/behaviors/utils.d.ts +1 -1
- package/dist/lib/utils/data.d.ts +2 -2
- package/dist/lib/utils/edge.d.ts +1 -2
- package/dist/lib/utils/element.d.ts +1 -1
- package/dist/lib/utils/event/events.d.ts +1 -1
- package/dist/lib/utils/event/index.d.ts +1 -1
- package/dist/lib/utils/id.d.ts +2 -3
- package/dist/lib/utils/palette.d.ts +2 -3
- package/dist/lib/utils/relation.d.ts +3 -4
- package/dist/lib/utils/visibility.d.ts +1 -1
- package/esm/animations/types.d.ts +3 -4
- package/esm/behaviors/base-behavior.d.ts +2 -1
- package/esm/behaviors/brush-select.d.ts +33 -16
- package/esm/behaviors/brush-select.js +7 -2
- package/esm/behaviors/brush-select.js.map +1 -1
- package/esm/behaviors/click-element.d.ts +28 -5
- package/esm/behaviors/click-element.js +11 -0
- package/esm/behaviors/click-element.js.map +1 -1
- package/esm/behaviors/collapse-expand.d.ts +3 -2
- package/esm/behaviors/collapse-expand.js +2 -2
- package/esm/behaviors/collapse-expand.js.map +1 -1
- package/esm/behaviors/create-edge.d.ts +1 -2
- package/esm/behaviors/create-edge.js.map +1 -1
- package/esm/behaviors/drag-canvas.d.ts +7 -0
- package/esm/behaviors/drag-canvas.js.map +1 -1
- package/esm/behaviors/drag-element-force.d.ts +1 -2
- package/esm/behaviors/drag-element-force.js.map +1 -1
- package/esm/behaviors/drag-element.d.ts +4 -5
- package/esm/behaviors/drag-element.js.map +1 -1
- package/esm/behaviors/focus-element.js.map +1 -1
- package/esm/behaviors/hover-element.js.map +1 -1
- package/esm/behaviors/index.d.ts +2 -0
- package/esm/behaviors/index.js +1 -0
- package/esm/behaviors/index.js.map +1 -1
- package/esm/behaviors/lasso-select.d.ts +4 -4
- package/esm/behaviors/lasso-select.js +1 -1
- package/esm/behaviors/lasso-select.js.map +1 -1
- package/esm/behaviors/scroll-canvas.d.ts +64 -0
- package/esm/behaviors/scroll-canvas.js +80 -0
- package/esm/behaviors/scroll-canvas.js.map +1 -0
- package/esm/behaviors/types.d.ts +2 -1
- package/esm/behaviors/zoom-canvas.d.ts +1 -1
- package/esm/constants/events/animation.d.ts +1 -4
- package/esm/constants/events/animation.js +0 -4
- package/esm/constants/events/animation.js.map +1 -1
- package/esm/constants/events/graph.d.ts +5 -1
- package/esm/constants/events/graph.js +4 -0
- package/esm/constants/events/graph.js.map +1 -1
- package/esm/elements/combos/base-combo.d.ts +1 -1
- package/esm/elements/edges/base-edge.d.ts +0 -5
- package/esm/elements/edges/base-edge.js +1 -2
- package/esm/elements/edges/base-edge.js.map +1 -1
- package/esm/elements/nodes/base-node.d.ts +3 -10
- package/esm/elements/nodes/base-node.js +2 -2
- package/esm/elements/nodes/base-node.js.map +1 -1
- package/esm/elements/nodes/donut.d.ts +45 -0
- package/esm/elements/nodes/donut.js +81 -0
- package/esm/elements/nodes/donut.js.map +1 -0
- package/esm/elements/nodes/html.d.ts +27 -0
- package/esm/elements/nodes/html.js +209 -0
- package/esm/elements/nodes/html.js.map +1 -0
- package/esm/elements/nodes/index.d.ts +4 -0
- package/esm/elements/nodes/index.js +2 -0
- package/esm/elements/nodes/index.js.map +1 -1
- package/esm/elements/shapes/badge.d.ts +1 -1
- package/esm/{plugins/hull/shape.d.ts → elements/shapes/contour.d.ts} +17 -17
- package/esm/{plugins/hull/shape.js → elements/shapes/contour.js} +12 -11
- package/esm/elements/shapes/contour.js.map +1 -0
- package/esm/elements/shapes/index.d.ts +2 -0
- package/esm/elements/shapes/index.js +1 -0
- package/esm/elements/shapes/index.js.map +1 -1
- package/esm/exports.d.ts +15 -22
- package/esm/exports.js +8 -18
- package/esm/exports.js.map +1 -1
- package/esm/plugins/bubble-sets.d.ts +45 -0
- package/esm/plugins/bubble-sets.js +212 -0
- package/esm/plugins/bubble-sets.js.map +1 -0
- package/esm/plugins/camera-setting.d.ts +4 -2
- package/esm/plugins/camera-setting.js.map +1 -1
- package/esm/plugins/contextmenu.d.ts +1 -0
- package/esm/plugins/contextmenu.js +1 -0
- package/esm/plugins/contextmenu.js.map +1 -1
- package/esm/plugins/grid-line.d.ts +51 -8
- package/esm/plugins/grid-line.js.map +1 -1
- package/esm/plugins/history/utils.js +6 -2
- package/esm/plugins/history/utils.js.map +1 -1
- package/esm/plugins/hull/index.d.ts +44 -13
- package/esm/plugins/hull/index.js +46 -16
- package/esm/plugins/hull/index.js.map +1 -1
- package/esm/plugins/index.d.ts +4 -0
- package/esm/plugins/index.js +2 -0
- package/esm/plugins/index.js.map +1 -1
- package/esm/plugins/legend.js +4 -2
- package/esm/plugins/legend.js.map +1 -1
- package/esm/plugins/timebar.d.ts +225 -0
- package/esm/plugins/timebar.js +253 -0
- package/esm/plugins/timebar.js.map +1 -0
- package/esm/plugins/tooltip.d.ts +2 -2
- package/esm/registry/build-in.js +15 -10
- package/esm/registry/build-in.js.map +1 -1
- package/esm/registry/index.d.ts +1 -1
- package/esm/registry/index.js +1 -1
- package/esm/runtime/canvas.js +7 -4
- package/esm/runtime/canvas.js.map +1 -1
- package/esm/runtime/data.d.ts +13 -7
- package/esm/runtime/data.js +20 -3
- package/esm/runtime/data.js.map +1 -1
- package/esm/runtime/element.d.ts +6 -10
- package/esm/runtime/element.js +65 -46
- package/esm/runtime/element.js.map +1 -1
- package/esm/runtime/graph.d.ts +532 -45
- package/esm/runtime/graph.js +418 -40
- package/esm/runtime/graph.js.map +1 -1
- package/esm/runtime/layout.js +2 -2
- package/esm/runtime/layout.js.map +1 -1
- package/esm/runtime/types.d.ts +3 -3
- package/esm/runtime/viewport.d.ts +3 -4
- package/esm/runtime/viewport.js +2 -2
- package/esm/runtime/viewport.js.map +1 -1
- package/esm/spec/canvas.d.ts +6 -2
- package/esm/spec/data.d.ts +74 -1
- package/esm/spec/element/combo.d.ts +17 -6
- package/esm/spec/element/edge.d.ts +14 -2
- package/esm/spec/element/node.d.ts +19 -3
- package/esm/spec/{spec.d.ts → graph.d.ts} +12 -4
- package/esm/spec/graph.js +2 -0
- package/esm/spec/graph.js.map +1 -0
- package/esm/spec/index.d.ts +1 -1
- package/esm/spec/theme.d.ts +1 -4
- package/esm/spec/viewport.d.ts +1 -1
- package/esm/themes/base.d.ts +1 -0
- package/esm/themes/base.js +11 -9
- package/esm/themes/base.js.map +1 -1
- package/esm/themes/types.d.ts +0 -1
- package/esm/transforms/process-parallel-edges.d.ts +2 -3
- package/esm/transforms/process-parallel-edges.js +2 -4
- package/esm/transforms/process-parallel-edges.js.map +1 -1
- package/esm/transforms/types.d.ts +1 -1
- package/esm/transforms/update-related-edge.js.map +1 -1
- package/esm/types/callable.d.ts +2 -2
- package/esm/types/data.d.ts +3 -3
- package/esm/types/id.d.ts +1 -0
- package/esm/types/id.js +2 -0
- package/esm/types/id.js.map +1 -0
- package/esm/types/index.d.ts +1 -0
- package/esm/types/style.d.ts +1 -3
- package/esm/types/viewport.d.ts +4 -4
- package/esm/utils/animation.d.ts +6 -6
- package/esm/utils/animation.js +3 -3
- package/esm/utils/animation.js.map +1 -1
- package/esm/utils/behaviors/brush.d.ts +1 -2
- package/esm/utils/behaviors/brush.js.map +1 -1
- package/esm/utils/behaviors/lasso.d.ts +1 -2
- package/esm/utils/behaviors/lasso.js.map +1 -1
- package/esm/utils/behaviors/utils.d.ts +1 -1
- package/esm/utils/change.js +8 -1
- package/esm/utils/change.js.map +1 -1
- package/esm/utils/data.d.ts +2 -2
- package/esm/utils/data.js +2 -2
- package/esm/utils/edge.d.ts +1 -2
- package/esm/utils/edge.js.map +1 -1
- package/esm/utils/element.d.ts +1 -1
- package/esm/utils/element.js +2 -2
- package/esm/utils/event/events.d.ts +1 -1
- package/esm/utils/event/events.js.map +1 -1
- package/esm/utils/event/index.d.ts +1 -1
- package/esm/utils/event/index.js +1 -1
- package/esm/utils/id.d.ts +2 -3
- package/esm/utils/id.js.map +1 -1
- package/esm/utils/palette.d.ts +2 -3
- package/esm/utils/palette.js +1 -1
- package/esm/utils/palette.js.map +1 -1
- package/esm/utils/relation.d.ts +3 -4
- package/esm/utils/relation.js +2 -2
- package/esm/utils/relation.js.map +1 -1
- package/esm/utils/style.js +3 -3
- package/esm/utils/style.js.map +1 -1
- package/esm/utils/visibility.d.ts +1 -1
- package/esm/utils/visibility.js +1 -1
- package/lib/animations/types.d.ts +3 -4
- package/lib/behaviors/base-behavior.d.ts +2 -1
- package/lib/behaviors/brush-select.d.ts +33 -16
- package/lib/behaviors/brush-select.js +7 -2
- package/lib/behaviors/brush-select.js.map +1 -1
- package/lib/behaviors/click-element.d.ts +28 -5
- package/lib/behaviors/click-element.js +11 -0
- package/lib/behaviors/click-element.js.map +1 -1
- package/lib/behaviors/collapse-expand.d.ts +3 -2
- package/lib/behaviors/collapse-expand.js +2 -2
- package/lib/behaviors/collapse-expand.js.map +1 -1
- package/lib/behaviors/create-edge.d.ts +1 -2
- package/lib/behaviors/create-edge.js.map +1 -1
- package/lib/behaviors/drag-canvas.d.ts +7 -0
- package/lib/behaviors/drag-canvas.js.map +1 -1
- package/lib/behaviors/drag-element-force.d.ts +1 -2
- package/lib/behaviors/drag-element-force.js.map +1 -1
- package/lib/behaviors/drag-element.d.ts +4 -5
- package/lib/behaviors/drag-element.js.map +1 -1
- package/lib/behaviors/focus-element.js.map +1 -1
- package/lib/behaviors/hover-element.js.map +1 -1
- package/lib/behaviors/index.d.ts +2 -0
- package/lib/behaviors/index.js +3 -1
- package/lib/behaviors/index.js.map +1 -1
- package/lib/behaviors/lasso-select.d.ts +4 -4
- package/lib/behaviors/lasso-select.js +1 -1
- package/lib/behaviors/lasso-select.js.map +1 -1
- package/lib/behaviors/scroll-canvas.d.ts +64 -0
- package/lib/behaviors/scroll-canvas.js +84 -0
- package/lib/behaviors/scroll-canvas.js.map +1 -0
- package/lib/behaviors/types.d.ts +2 -1
- package/lib/behaviors/zoom-canvas.d.ts +1 -1
- package/lib/constants/events/animation.d.ts +1 -4
- package/lib/constants/events/animation.js +0 -4
- package/lib/constants/events/animation.js.map +1 -1
- package/lib/constants/events/graph.d.ts +5 -1
- package/lib/constants/events/graph.js +4 -0
- package/lib/constants/events/graph.js.map +1 -1
- package/lib/elements/combos/base-combo.d.ts +1 -1
- package/lib/elements/edges/base-edge.d.ts +0 -5
- package/lib/elements/edges/base-edge.js +1 -2
- package/lib/elements/edges/base-edge.js.map +1 -1
- package/lib/elements/nodes/base-node.d.ts +3 -10
- package/lib/elements/nodes/base-node.js +2 -2
- package/lib/elements/nodes/base-node.js.map +1 -1
- package/lib/elements/nodes/donut.d.ts +45 -0
- package/lib/elements/nodes/donut.js +85 -0
- package/lib/elements/nodes/donut.js.map +1 -0
- package/lib/elements/nodes/html.d.ts +27 -0
- package/lib/elements/nodes/html.js +213 -0
- package/lib/elements/nodes/html.js.map +1 -0
- package/lib/elements/nodes/index.d.ts +4 -0
- package/lib/elements/nodes/index.js +5 -1
- package/lib/elements/nodes/index.js.map +1 -1
- package/lib/elements/shapes/badge.d.ts +1 -1
- package/lib/{plugins/hull/shape.d.ts → elements/shapes/contour.d.ts} +17 -17
- package/lib/{plugins/hull/shape.js → elements/shapes/contour.js} +15 -14
- package/lib/elements/shapes/contour.js.map +1 -0
- package/lib/elements/shapes/index.d.ts +2 -0
- package/lib/elements/shapes/index.js +3 -1
- package/lib/elements/shapes/index.js.map +1 -1
- package/lib/exports.d.ts +15 -22
- package/lib/exports.js +50 -17
- package/lib/exports.js.map +1 -1
- package/lib/plugins/bubble-sets.d.ts +45 -0
- package/lib/plugins/bubble-sets.js +216 -0
- package/lib/plugins/bubble-sets.js.map +1 -0
- package/lib/plugins/camera-setting.d.ts +4 -2
- package/lib/plugins/camera-setting.js.map +1 -1
- package/lib/plugins/contextmenu.d.ts +1 -0
- package/lib/plugins/contextmenu.js +1 -0
- package/lib/plugins/contextmenu.js.map +1 -1
- package/lib/plugins/grid-line.d.ts +51 -8
- package/lib/plugins/grid-line.js.map +1 -1
- package/lib/plugins/history/utils.js +6 -2
- package/lib/plugins/history/utils.js.map +1 -1
- package/lib/plugins/hull/index.d.ts +44 -13
- package/lib/plugins/hull/index.js +46 -16
- package/lib/plugins/hull/index.js.map +1 -1
- package/lib/plugins/index.d.ts +4 -0
- package/lib/plugins/index.js +5 -1
- package/lib/plugins/index.js.map +1 -1
- package/lib/plugins/legend.js +4 -2
- package/lib/plugins/legend.js.map +1 -1
- package/lib/plugins/timebar.d.ts +225 -0
- package/lib/plugins/timebar.js +257 -0
- package/lib/plugins/timebar.js.map +1 -0
- package/lib/plugins/tooltip.d.ts +2 -2
- package/lib/registry/build-in.js +12 -7
- package/lib/registry/build-in.js.map +1 -1
- package/lib/registry/index.d.ts +1 -1
- package/lib/registry/index.js +1 -1
- package/lib/runtime/canvas.js +7 -4
- package/lib/runtime/canvas.js.map +1 -1
- package/lib/runtime/data.d.ts +13 -7
- package/lib/runtime/data.js +20 -3
- package/lib/runtime/data.js.map +1 -1
- package/lib/runtime/element.d.ts +6 -10
- package/lib/runtime/element.js +64 -45
- package/lib/runtime/element.js.map +1 -1
- package/lib/runtime/graph.d.ts +532 -45
- package/lib/runtime/graph.js +417 -39
- package/lib/runtime/graph.js.map +1 -1
- package/lib/runtime/layout.js +2 -2
- package/lib/runtime/layout.js.map +1 -1
- package/lib/runtime/types.d.ts +3 -3
- package/lib/runtime/viewport.d.ts +3 -4
- package/lib/runtime/viewport.js +2 -2
- package/lib/runtime/viewport.js.map +1 -1
- package/lib/spec/canvas.d.ts +6 -2
- package/lib/spec/data.d.ts +74 -1
- package/lib/spec/element/combo.d.ts +17 -6
- package/lib/spec/element/edge.d.ts +14 -2
- package/lib/spec/element/node.d.ts +19 -3
- package/{dist/lib/spec/spec.d.ts → lib/spec/graph.d.ts} +12 -4
- package/lib/spec/{spec.js → graph.js} +1 -1
- package/lib/spec/graph.js.map +1 -0
- package/lib/spec/index.d.ts +1 -1
- package/lib/spec/theme.d.ts +1 -4
- package/lib/spec/viewport.d.ts +1 -1
- package/lib/themes/base.d.ts +1 -0
- package/lib/themes/base.js +11 -9
- package/lib/themes/base.js.map +1 -1
- package/lib/themes/types.d.ts +0 -1
- package/lib/transforms/process-parallel-edges.d.ts +2 -3
- package/lib/transforms/process-parallel-edges.js +2 -4
- package/lib/transforms/process-parallel-edges.js.map +1 -1
- package/lib/transforms/types.d.ts +1 -1
- package/lib/transforms/update-related-edge.js.map +1 -1
- package/lib/types/callable.d.ts +2 -2
- package/lib/types/data.d.ts +3 -3
- package/lib/types/id.d.ts +1 -0
- package/lib/{spec/element/base.js → types/id.js} +1 -1
- package/lib/types/id.js.map +1 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/style.d.ts +1 -3
- package/lib/types/viewport.d.ts +4 -4
- package/lib/utils/animation.d.ts +6 -6
- package/lib/utils/animation.js +3 -3
- package/lib/utils/animation.js.map +1 -1
- package/lib/utils/behaviors/brush.d.ts +1 -2
- package/lib/utils/behaviors/brush.js.map +1 -1
- package/lib/utils/behaviors/lasso.d.ts +1 -2
- package/lib/utils/behaviors/lasso.js.map +1 -1
- package/lib/utils/behaviors/utils.d.ts +1 -1
- package/lib/utils/change.js +8 -1
- package/lib/utils/change.js.map +1 -1
- package/lib/utils/data.d.ts +2 -2
- package/lib/utils/data.js +2 -2
- package/lib/utils/edge.d.ts +1 -2
- package/lib/utils/edge.js.map +1 -1
- package/lib/utils/element.d.ts +1 -1
- package/lib/utils/element.js +2 -2
- package/lib/utils/event/events.d.ts +1 -1
- package/lib/utils/event/events.js.map +1 -1
- package/lib/utils/event/index.d.ts +1 -1
- package/lib/utils/event/index.js +1 -1
- package/lib/utils/id.d.ts +2 -3
- package/lib/utils/id.js.map +1 -1
- package/lib/utils/palette.d.ts +2 -3
- package/lib/utils/palette.js +1 -1
- package/lib/utils/palette.js.map +1 -1
- package/lib/utils/relation.d.ts +3 -4
- package/lib/utils/relation.js +2 -2
- package/lib/utils/relation.js.map +1 -1
- package/lib/utils/style.js +3 -3
- package/lib/utils/style.js.map +1 -1
- package/lib/utils/visibility.d.ts +1 -1
- package/lib/utils/visibility.js +1 -1
- package/package.json +2 -1
- package/src/animations/types.ts +3 -4
- package/src/behaviors/base-behavior.ts +1 -1
- package/src/behaviors/brush-select.ts +34 -16
- package/src/behaviors/click-element.ts +29 -7
- package/src/behaviors/collapse-expand.ts +5 -4
- package/src/behaviors/create-edge.ts +1 -2
- package/src/behaviors/drag-canvas.ts +7 -0
- package/src/behaviors/drag-element-force.ts +1 -2
- package/src/behaviors/drag-element.ts +3 -4
- package/src/behaviors/focus-element.ts +1 -2
- package/src/behaviors/hover-element.ts +1 -2
- package/src/behaviors/index.ts +2 -0
- package/src/behaviors/lasso-select.ts +3 -4
- package/src/behaviors/scroll-canvas.ts +143 -0
- package/src/behaviors/types.ts +2 -1
- package/src/behaviors/zoom-canvas.ts +1 -1
- package/src/constants/events/animation.ts +0 -4
- package/src/constants/events/graph.ts +4 -0
- package/src/elements/combos/base-combo.ts +1 -1
- package/src/elements/edges/base-edge.ts +1 -7
- package/src/elements/nodes/base-node.ts +6 -15
- package/src/elements/nodes/donut.ts +137 -0
- package/src/elements/nodes/html.ts +230 -0
- package/src/elements/nodes/index.ts +4 -0
- package/src/{plugins/hull/shape.ts → elements/shapes/contour.ts} +27 -34
- package/src/elements/shapes/index.ts +2 -0
- package/src/exports.ts +124 -25
- package/src/plugins/bubble-sets.ts +268 -0
- package/src/plugins/camera-setting.ts +4 -2
- package/src/plugins/contextmenu.ts +1 -0
- package/src/plugins/grid-line.ts +51 -8
- package/src/plugins/history/utils.ts +6 -2
- package/src/plugins/hull/index.ts +58 -22
- package/src/plugins/index.ts +4 -0
- package/src/plugins/legend.ts +6 -4
- package/src/plugins/timebar.ts +450 -0
- package/src/plugins/tooltip.ts +2 -2
- package/src/registry/build-in.ts +27 -8
- package/src/registry/index.ts +1 -1
- package/src/runtime/canvas.ts +7 -4
- package/src/runtime/data.ts +23 -4
- package/src/runtime/element.ts +67 -40
- package/src/runtime/graph.ts +554 -56
- package/src/runtime/layout.ts +4 -4
- package/src/runtime/types.ts +3 -3
- package/src/runtime/viewport.ts +3 -4
- package/src/spec/canvas.ts +6 -2
- package/src/spec/data.ts +74 -1
- package/src/spec/element/combo.ts +17 -6
- package/src/spec/element/edge.ts +14 -2
- package/src/spec/element/node.ts +19 -3
- package/src/spec/{spec.ts → graph.ts} +12 -4
- package/src/spec/index.ts +1 -1
- package/src/spec/theme.ts +1 -5
- package/src/spec/viewport.ts +1 -1
- package/src/themes/base.ts +12 -9
- package/src/themes/types.ts +0 -2
- package/src/transforms/arrange-draw-order.ts +1 -1
- package/src/transforms/process-parallel-edges.ts +5 -7
- package/src/transforms/types.ts +1 -1
- package/src/transforms/update-related-edge.ts +1 -2
- package/src/types/callable.ts +2 -2
- package/src/types/data.ts +3 -3
- package/src/types/id.ts +1 -0
- package/src/types/index.ts +1 -0
- package/src/types/style.ts +1 -3
- package/src/types/viewport.ts +4 -4
- package/src/utils/animation.ts +6 -6
- package/src/utils/behaviors/brush.ts +1 -2
- package/src/utils/behaviors/lasso.ts +1 -2
- package/src/utils/behaviors/utils.ts +1 -1
- package/src/utils/change.ts +7 -3
- package/src/utils/data.ts +2 -2
- package/src/utils/edge.ts +1 -1
- package/src/utils/element.ts +2 -2
- package/src/utils/event/events.ts +3 -1
- package/src/utils/event/index.ts +1 -1
- package/src/utils/id.ts +1 -2
- package/src/utils/palette.ts +2 -2
- package/src/utils/relation.ts +3 -4
- package/src/utils/style.ts +3 -3
- package/src/utils/visibility.ts +1 -1
- package/dist/lib/runtime/index.d.ts +0 -6
- package/dist/lib/spec/element/base.d.ts +0 -6
- package/esm/plugins/hull/shape.js.map +0 -1
- package/esm/runtime/index.d.ts +0 -6
- package/esm/runtime/index.js +0 -7
- package/esm/runtime/index.js.map +0 -1
- package/esm/spec/element/base.d.ts +0 -6
- package/esm/spec/element/base.js +0 -2
- package/esm/spec/element/base.js.map +0 -1
- package/esm/spec/spec.js +0 -2
- package/esm/spec/spec.js.map +0 -1
- package/lib/plugins/hull/shape.js.map +0 -1
- package/lib/runtime/index.d.ts +0 -6
- package/lib/runtime/index.js +0 -8
- package/lib/runtime/index.js.map +0 -1
- package/lib/spec/element/base.d.ts +0 -6
- package/lib/spec/element/base.js.map +0 -1
- package/lib/spec/spec.js.map +0 -1
- package/src/runtime/index.ts +0 -7
- package/src/spec/element/base.ts +0 -6
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { DisplayObject, IAnimation, IAnimationEffectTiming } from '@antv/g';
|
|
2
2
|
import type { State } from '../types';
|
|
3
3
|
/**
|
|
4
|
-
* @description
|
|
5
4
|
* <zh/> 为 string 时,会从注册的动画中获取
|
|
6
5
|
*
|
|
7
6
|
* <en/> When it is a string, it will be obtained from the registered animation
|
|
@@ -18,7 +17,7 @@ export interface AnimationContext {
|
|
|
18
17
|
* <zh/> 动画的源样式
|
|
19
18
|
*
|
|
20
19
|
* <en/> Source style of animation
|
|
21
|
-
* @
|
|
20
|
+
* @remarks
|
|
22
21
|
* <zh/> 用于在动画执行前将 shape 的样式设置为源样式,例如 move-to 动画,需要将 shape 的 x, y 设置为源样式
|
|
23
22
|
*
|
|
24
23
|
* <en/> Used to set the style of shape to the source style before the animation is executed. For example, the move-to animation needs to set the x and y of shape to the source style
|
|
@@ -28,7 +27,7 @@ export interface AnimationContext {
|
|
|
28
27
|
* <zh/> 额外的动画终态样式
|
|
29
28
|
*
|
|
30
29
|
* <en/> Additional animation final state style
|
|
31
|
-
* @
|
|
30
|
+
* @remarks
|
|
32
31
|
* <zh/> 例如元素销毁前,需要将元素的终态透明度设置为 0
|
|
33
32
|
*
|
|
34
33
|
* <en/> For example, before the element is destroyed, the final state opacity of the element needs to be set to 0
|
|
@@ -38,7 +37,7 @@ export interface AnimationContext {
|
|
|
38
37
|
* <zh/> 动画配置过滤
|
|
39
38
|
*
|
|
40
39
|
* <en/> Animation configuration filter
|
|
41
|
-
* @
|
|
40
|
+
* @remarks
|
|
42
41
|
* <zh/> 某些情况下,需要过滤掉一些动画配置,例如位移动画只会作用于元素根节点图形,不会作用于子图形。这项配置通常用于优化动画性能,避免不必要的动画执行
|
|
43
42
|
*
|
|
44
43
|
* <en/> In some cases, it is necessary to filter out some animation configurations. For example, the displacement animation will only affect the root node shape of the element, not the child shape. This configuration is usually used to optimize animation performance and avoid unnecessary animation execution
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseExtension } from '../registry/extension';
|
|
2
2
|
import type { CustomBehaviorOption } from '../spec/behavior';
|
|
3
|
-
export
|
|
3
|
+
export interface BaseBehaviorOptions extends CustomBehaviorOption {
|
|
4
|
+
}
|
|
4
5
|
export declare abstract class BaseBehavior<T extends BaseBehaviorOptions> extends BaseExtension<T> {
|
|
5
6
|
}
|
|
@@ -1,63 +1,74 @@
|
|
|
1
1
|
import { Shortcut } from '../utils/shortcut';
|
|
2
2
|
import { BaseBehavior } from './base-behavior';
|
|
3
|
-
import type { ID } from '@antv/graphlib';
|
|
4
3
|
import type { Graph } from '../runtime/graph';
|
|
5
4
|
import type { RuntimeContext } from '../runtime/types';
|
|
6
5
|
import type { NodeStyle } from '../spec/element/node';
|
|
7
|
-
import type { ElementType, IPointerEvent, Points, State } from '../types';
|
|
6
|
+
import type { ElementType, ID, IPointerEvent, Points, State } from '../types';
|
|
8
7
|
import type { ShortcutKey } from '../utils/shortcut';
|
|
9
8
|
import type { BaseBehaviorOptions } from './base-behavior';
|
|
10
|
-
type SELECT_MODE = 'union' | 'intersect' | 'diff' | 'default';
|
|
11
9
|
export type States = Record<ID, State | State[]>;
|
|
10
|
+
/**
|
|
11
|
+
* <zh/> 框选配置项
|
|
12
|
+
*
|
|
13
|
+
* <en/> Brush select options
|
|
14
|
+
*/
|
|
12
15
|
export interface BrushSelectOptions extends BaseBehaviorOptions {
|
|
13
16
|
/**
|
|
14
17
|
* <zh/> 是否启用框选功能
|
|
15
18
|
*
|
|
16
19
|
* <en/> Whether to enable Brush select element function.
|
|
20
|
+
* @defaultValue true
|
|
17
21
|
*/
|
|
18
22
|
enable?: boolean | ((event: IPointerEvent) => boolean);
|
|
19
23
|
/**
|
|
20
24
|
* <zh/> 可框选的元素类型
|
|
21
25
|
*
|
|
22
26
|
* <en/> Enable Elements type.
|
|
27
|
+
* @defaultValue ['node', 'combo', 'edge']
|
|
23
28
|
*/
|
|
24
29
|
enableElements?: ElementType[];
|
|
25
30
|
/**
|
|
26
31
|
* <zh/> 是否启用动画
|
|
27
32
|
*
|
|
28
33
|
* <en/> Whether to enable animation.
|
|
34
|
+
* @defaultValue false
|
|
29
35
|
*/
|
|
30
36
|
animation?: boolean;
|
|
31
37
|
/**
|
|
32
38
|
* <zh/> 交互配置 按键拖拽 或 直接拖拽
|
|
33
39
|
*
|
|
34
40
|
* <en/> Trigger click or drag.
|
|
41
|
+
* @defaultValue ['drag']
|
|
35
42
|
*/
|
|
36
43
|
trigger?: ShortcutKey;
|
|
37
44
|
/**
|
|
38
45
|
* <zh/> 框选选中模式
|
|
39
|
-
* union : 选中元素添加 state 状态
|
|
40
|
-
* intersect : 进一步筛选已经 state 开启的元素
|
|
41
|
-
* diff : 反转选中元素的 state 状态
|
|
42
|
-
* default : 选中元素添加 state 状态, 其他元素 state 关闭
|
|
46
|
+
* - union : 选中元素添加 state 状态
|
|
47
|
+
* - intersect : 进一步筛选已经 state 开启的元素
|
|
48
|
+
* - diff : 反转选中元素的 state 状态
|
|
49
|
+
* - default : 选中元素添加 state 状态, 其他元素 state 关闭
|
|
43
50
|
*
|
|
44
51
|
* <en/> Box Select Select the mode.
|
|
45
|
-
* union : Select element add state.
|
|
46
|
-
* intersect : Further filter the elements that are already state enabled.
|
|
47
|
-
* diff : Inverts the state of the selected element.
|
|
48
|
-
* default : Check element state to turn on and other elements state to turn off.
|
|
52
|
+
* - union : Select element add state.
|
|
53
|
+
* - intersect : Further filter the elements that are already state enabled.
|
|
54
|
+
* - diff : Inverts the state of the selected element.
|
|
55
|
+
* - default : Check element state to turn on and other elements state to turn off.
|
|
56
|
+
* @defaultValue 'default'
|
|
49
57
|
*/
|
|
50
|
-
mode?:
|
|
58
|
+
mode?: 'union' | 'intersect' | 'diff' | 'default';
|
|
51
59
|
/**
|
|
52
60
|
* <zh/> 选中 state 状态
|
|
53
61
|
*
|
|
54
62
|
* <en/> Check state status.
|
|
63
|
+
* @defaultValue 'selected'
|
|
55
64
|
*/
|
|
56
|
-
state?:
|
|
65
|
+
state?: State;
|
|
57
66
|
/**
|
|
58
67
|
* <zh/> 及时框选, 在框选模式为 default 时,才能使用
|
|
59
68
|
*
|
|
69
|
+
// * TODO fixme
|
|
60
70
|
* <en/> Timely screening.
|
|
71
|
+
* @defaultValue false
|
|
61
72
|
*/
|
|
62
73
|
immediately?: boolean;
|
|
63
74
|
/**
|
|
@@ -70,16 +81,23 @@ export interface BrushSelectOptions extends BaseBehaviorOptions {
|
|
|
70
81
|
* <zh/> 框选元素状态回调。
|
|
71
82
|
*
|
|
72
83
|
* <en/> Callback when brush select elements.
|
|
84
|
+
* @param states - 选中的元素状态
|
|
85
|
+
* @returns 选中的元素状态
|
|
73
86
|
*/
|
|
74
87
|
onSelect?: (states: States) => States;
|
|
75
88
|
}
|
|
76
89
|
export declare const DEFAULT_STYLE: {
|
|
77
90
|
lineWidth: number;
|
|
78
|
-
|
|
91
|
+
fill: string;
|
|
79
92
|
stroke: string;
|
|
80
93
|
fillOpacity: number;
|
|
81
94
|
zIndex: number;
|
|
82
95
|
};
|
|
96
|
+
/**
|
|
97
|
+
* <zh/> 框选一组元素
|
|
98
|
+
*
|
|
99
|
+
* <en/> Brush select elements
|
|
100
|
+
*/
|
|
83
101
|
export declare class BrushSelect<T extends BaseBehaviorOptions = BrushSelectOptions> extends BaseBehavior<T> {
|
|
84
102
|
static defaultOptions: Partial<BrushSelectOptions>;
|
|
85
103
|
private startPoint?;
|
|
@@ -94,11 +112,10 @@ export declare class BrushSelect<T extends BaseBehaviorOptions = BrushSelectOpti
|
|
|
94
112
|
clearSelected: () => void;
|
|
95
113
|
updateElementState: (points: Points) => void;
|
|
96
114
|
private clearBrush;
|
|
97
|
-
getPointsSelectIds: (graph: Graph, points: Points, itemTypes: ElementType[]) =>
|
|
115
|
+
getPointsSelectIds: (graph: Graph, points: Points, itemTypes: ElementType[]) => string[];
|
|
98
116
|
isKeydown(): boolean | undefined;
|
|
99
117
|
validate(event: IPointerEvent): any;
|
|
100
118
|
bindEvents(): void;
|
|
101
119
|
unbindEvents(): void;
|
|
102
120
|
destroy(): void;
|
|
103
121
|
}
|
|
104
|
-
export {};
|
|
@@ -3,48 +3,60 @@ import type { IPointerEvent, State } from '../types';
|
|
|
3
3
|
import type { ShortcutKey } from '../utils/shortcut';
|
|
4
4
|
import type { BaseBehaviorOptions } from './base-behavior';
|
|
5
5
|
import { BaseBehavior } from './base-behavior';
|
|
6
|
+
/**
|
|
7
|
+
* <zh/> 点击元素交互配置项
|
|
8
|
+
*
|
|
9
|
+
* <en/> Click element behavior options
|
|
10
|
+
*/
|
|
6
11
|
export interface ClickElementOptions extends BaseBehaviorOptions {
|
|
7
12
|
/**
|
|
8
13
|
* <zh/> 是否启用动画
|
|
9
14
|
*
|
|
10
15
|
* <en/> Whether to enable animation
|
|
16
|
+
* @defaultValue true
|
|
11
17
|
*/
|
|
12
18
|
animation?: boolean;
|
|
13
19
|
/**
|
|
14
20
|
* <zh/> 是否启用点击元素的功能
|
|
15
21
|
*
|
|
16
22
|
* <en/> Whether to enable the function of clicking the element
|
|
23
|
+
* @defaultValue true
|
|
17
24
|
*/
|
|
18
25
|
enable?: boolean | ((event: IPointerEvent) => boolean);
|
|
19
26
|
/**
|
|
20
27
|
* <zh/> 是否允许多选
|
|
21
28
|
*
|
|
22
29
|
* <en/> Whether to allow multiple selection
|
|
30
|
+
* @defaultValue false
|
|
23
31
|
*/
|
|
24
32
|
multiple?: boolean;
|
|
25
33
|
/**
|
|
26
34
|
* <zh/> 按下该快捷键配合鼠标点击进行多选
|
|
27
35
|
*
|
|
28
36
|
* <en/> Press this shortcut key to apply multiple selection with mouse click
|
|
37
|
+
* @defaultValue ['shift']
|
|
29
38
|
*/
|
|
30
39
|
trigger?: ShortcutKey;
|
|
31
40
|
/**
|
|
32
|
-
* <zh/>
|
|
41
|
+
* <zh/> 选中时应用的状态
|
|
33
42
|
*
|
|
34
43
|
* <en/> The state to be applied when select.
|
|
44
|
+
* @defaultValue 'selected'
|
|
35
45
|
*/
|
|
36
|
-
selectedState
|
|
46
|
+
selectedState?: State;
|
|
37
47
|
/**
|
|
38
|
-
* <zh/>
|
|
48
|
+
* <zh/> 当有元素被选中时,其他未选中的元素应用的状态
|
|
39
49
|
*
|
|
40
50
|
* <en/> The state to be applied on other unselected elements when some elements are selected
|
|
51
|
+
* @defaultValue undefined
|
|
41
52
|
*/
|
|
42
|
-
unselectedState
|
|
53
|
+
unselectedState?: State;
|
|
43
54
|
/**
|
|
44
55
|
* <zh/> 选中元素的度,即决定了影响范围
|
|
45
56
|
*
|
|
46
57
|
* <en/> The degree to determine the scope of influence
|
|
47
|
-
* @
|
|
58
|
+
* @defaultValue 0
|
|
59
|
+
* @remarks
|
|
48
60
|
* <zh/> 对于节点来说,
|
|
49
61
|
* - 0 表示只选中当前节点
|
|
50
62
|
* - 1 表示选中当前节点及其直接相邻的节点和边,以此类推
|
|
@@ -61,6 +73,17 @@ export interface ClickElementOptions extends BaseBehaviorOptions {
|
|
|
61
73
|
*/
|
|
62
74
|
degree?: number;
|
|
63
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* <zh/> 点击元素
|
|
78
|
+
*
|
|
79
|
+
* <en/> Click Element
|
|
80
|
+
* @remarks
|
|
81
|
+
* ```typescript
|
|
82
|
+
* const graph = new Graph({
|
|
83
|
+
* behaviors: ['click-element'],
|
|
84
|
+
* });
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
64
87
|
export declare class ClickElement extends BaseBehavior<ClickElementOptions> {
|
|
65
88
|
private selectedElementIds;
|
|
66
89
|
private shortcut;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { ID } from '@antv/graphlib';
|
|
2
1
|
import type { RuntimeContext } from '../runtime/types';
|
|
3
|
-
import type { IPointerEvent } from '../types';
|
|
2
|
+
import type { ID, IPointerEvent } from '../types';
|
|
4
3
|
import type { BaseBehaviorOptions } from './base-behavior';
|
|
5
4
|
import { BaseBehavior } from './base-behavior';
|
|
6
5
|
export interface CollapseExpandOptions extends BaseBehaviorOptions {
|
|
@@ -8,12 +7,14 @@ export interface CollapseExpandOptions extends BaseBehaviorOptions {
|
|
|
8
7
|
* <zh/> 是否启用动画
|
|
9
8
|
*
|
|
10
9
|
* <en/> Whether to enable animation
|
|
10
|
+
* @defaultValue true
|
|
11
11
|
*/
|
|
12
12
|
animation: boolean;
|
|
13
13
|
/**
|
|
14
14
|
* <zh/> 是否启用展开/收起功能
|
|
15
15
|
*
|
|
16
16
|
* <en/> Whether to enable the expand/collapse function
|
|
17
|
+
* @defaultValue true
|
|
17
18
|
*/
|
|
18
19
|
enable?: boolean | ((event: IPointerEvent) => boolean);
|
|
19
20
|
/**
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type { ID } from '@antv/graphlib';
|
|
2
1
|
import type { RuntimeContext } from '../runtime/types';
|
|
3
2
|
import type { EdgeData } from '../spec';
|
|
4
3
|
import type { EdgeStyle } from '../spec/element/edge';
|
|
5
|
-
import type { IPointerEvent } from '../types';
|
|
4
|
+
import type { ID, IPointerEvent } from '../types';
|
|
6
5
|
import type { BaseBehaviorOptions } from './base-behavior';
|
|
7
6
|
import { BaseBehavior } from './base-behavior';
|
|
8
7
|
export interface CreateEdgeOptions extends BaseBehaviorOptions {
|
|
@@ -3,6 +3,11 @@ import type { IKeyboardEvent, IPointerEvent, Vector2, ViewportAnimationEffectTim
|
|
|
3
3
|
import type { ShortcutKey } from '../utils/shortcut';
|
|
4
4
|
import type { BaseBehaviorOptions } from './base-behavior';
|
|
5
5
|
import { BaseBehavior } from './base-behavior';
|
|
6
|
+
/**
|
|
7
|
+
* <zh/> 拖拽画布交互配置项
|
|
8
|
+
*
|
|
9
|
+
* <en/> Drag canvas behavior options
|
|
10
|
+
*/
|
|
6
11
|
export interface DragCanvasOptions extends BaseBehaviorOptions {
|
|
7
12
|
/**
|
|
8
13
|
* <zh/> 是否启用拖拽动画,仅在使用按键移动时有效
|
|
@@ -14,6 +19,7 @@ export interface DragCanvasOptions extends BaseBehaviorOptions {
|
|
|
14
19
|
* <zh/> 是否启用拖拽画布的功能
|
|
15
20
|
*
|
|
16
21
|
* <en/> Whether to enable the function of dragging the canvas
|
|
22
|
+
* @defaultValue true
|
|
17
23
|
*/
|
|
18
24
|
enable?: boolean | ((event: IPointerEvent | IKeyboardEvent) => boolean);
|
|
19
25
|
/**
|
|
@@ -26,6 +32,7 @@ export interface DragCanvasOptions extends BaseBehaviorOptions {
|
|
|
26
32
|
* <zh/> 触发一次按键移动的距离
|
|
27
33
|
*
|
|
28
34
|
* <en/> The distance of a single key movement
|
|
35
|
+
* @defaultValue 10
|
|
29
36
|
*/
|
|
30
37
|
sensitivity?: number;
|
|
31
38
|
/**
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { ID } from '
|
|
2
|
-
import type { Element, IDragEvent, Point } from '../types';
|
|
1
|
+
import type { Element, ID, IDragEvent, Point } from '../types';
|
|
3
2
|
import type { DragElementOptions } from './drag-element';
|
|
4
3
|
import { DragElement } from './drag-element';
|
|
5
4
|
export interface DragElementForceOptions extends Omit<DragElementOptions, 'animation' | 'dropEffect' | 'shadow'> {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { BaseStyleProps } from '@antv/g';
|
|
2
|
-
import type { ID } from '@antv/graphlib';
|
|
3
2
|
import type { RuntimeContext } from '../runtime/types';
|
|
4
|
-
import type { EdgeDirection, Element, IDragEvent, Point, PrefixObject } from '../types';
|
|
3
|
+
import type { EdgeDirection, Element, ID, IDragEvent, Point, PrefixObject } from '../types';
|
|
5
4
|
import type { BaseBehaviorOptions } from './base-behavior';
|
|
6
5
|
import { BaseBehavior } from './base-behavior';
|
|
7
6
|
export interface DragElementOptions extends BaseBehaviorOptions, PrefixObject<BaseStyleProps, 'shadow'> {
|
|
@@ -27,7 +26,7 @@ export interface DragElementOptions extends BaseBehaviorOptions, PrefixObject<Ba
|
|
|
27
26
|
* - link: Place the drag element as a child element of the target element
|
|
28
27
|
* - move: Move the element and update the parent element size
|
|
29
28
|
* - none: Only update the drag target position, no additional operations
|
|
30
|
-
* @
|
|
29
|
+
* @remarks
|
|
31
30
|
* <zh/> combo 元素可作为元素容器置入 node 或 combo 元素
|
|
32
31
|
*
|
|
33
32
|
* <en/> The combo element can be placed as an element container into the node or combo element
|
|
@@ -53,7 +52,7 @@ export interface DragElementOptions extends BaseBehaviorOptions, PrefixObject<Ba
|
|
|
53
52
|
* - in: hide the edges with the node as the target node
|
|
54
53
|
* - both: hide all edges related to the node
|
|
55
54
|
* - all: hide all edges in the graph
|
|
56
|
-
* @
|
|
55
|
+
* @remarks
|
|
57
56
|
* <zh/> 使用幽灵节点时不会隐藏边
|
|
58
57
|
*
|
|
59
58
|
* <en/> Edges will not be hidden when using the drag shadow
|
|
@@ -84,7 +83,7 @@ export declare class DragElement extends BaseBehavior<DragElementOptions> {
|
|
|
84
83
|
constructor(context: RuntimeContext, options: DragElementOptions);
|
|
85
84
|
update(options: Partial<DragElementOptions>): void;
|
|
86
85
|
private bindEvents;
|
|
87
|
-
protected getSelectedNodeIDs(currTarget: ID[]):
|
|
86
|
+
protected getSelectedNodeIDs(currTarget: ID[]): string[];
|
|
88
87
|
protected getDelta(event: IElementDragEvent): [number, number] | Float32Array | [number, number, number];
|
|
89
88
|
protected onDragStart(event: IElementDragEvent): void;
|
|
90
89
|
protected onDrag(event: IElementDragEvent): void;
|
|
@@ -9,6 +9,7 @@ export { DragElementForce } from './drag-element-force';
|
|
|
9
9
|
export { FocusElement } from './focus-element';
|
|
10
10
|
export { HoverElement } from './hover-element';
|
|
11
11
|
export { LassoSelect } from './lasso-select';
|
|
12
|
+
export { ScrollCanvas } from './scroll-canvas';
|
|
12
13
|
export { ZoomCanvas } from './zoom-canvas';
|
|
13
14
|
export type { BaseBehaviorOptions } from './base-behavior';
|
|
14
15
|
export type { BrushSelectOptions } from './brush-select';
|
|
@@ -21,4 +22,5 @@ export type { DragElementForceOptions } from './drag-element-force';
|
|
|
21
22
|
export type { FocusElementOptions } from './focus-element';
|
|
22
23
|
export type { HoverElementOptions } from './hover-element';
|
|
23
24
|
export type { LassoSelectOptions } from './lasso-select';
|
|
25
|
+
export type { ScrollCanvasOptions } from './scroll-canvas';
|
|
24
26
|
export type { ZoomCanvasOptions } from './zoom-canvas';
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { BrushSelect } from './brush-select';
|
|
2
|
-
import type { ID } from '@antv/graphlib';
|
|
3
2
|
import type { RuntimeContext } from '../runtime/types';
|
|
4
|
-
import type { IPointerEvent, Points, State } from '../types';
|
|
3
|
+
import type { ID, IPointerEvent, Points, State } from '../types';
|
|
5
4
|
import type { BrushSelectOptions } from './brush-select';
|
|
6
5
|
export type States = Record<ID, State | State[]>;
|
|
7
|
-
export
|
|
6
|
+
export interface LassoSelectOptions extends BrushSelectOptions {
|
|
7
|
+
}
|
|
8
8
|
export declare class LassoSelect extends BrushSelect<LassoSelectOptions> {
|
|
9
9
|
static defaultOptions: Partial<LassoSelectOptions>;
|
|
10
10
|
private points?;
|
|
11
11
|
private pathShape?;
|
|
12
|
-
selectElementFn: (graph: import("..").Graph, id:
|
|
12
|
+
selectElementFn: (graph: import("..").Graph, id: string, points: Points) => boolean;
|
|
13
13
|
constructor(context: RuntimeContext, options: LassoSelectOptions);
|
|
14
14
|
pointerDown: (event: IPointerEvent) => Promise<void>;
|
|
15
15
|
pointerMove: (event: IPointerEvent) => Promise<void>;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { RuntimeContext } from '../runtime/types';
|
|
2
|
+
import type { IKeyboardEvent } from '../types';
|
|
3
|
+
import { ShortcutKey } from '../utils/shortcut';
|
|
4
|
+
import type { BaseBehaviorOptions } from './base-behavior';
|
|
5
|
+
import { BaseBehavior } from './base-behavior';
|
|
6
|
+
export interface ScrollCanvasOptions extends BaseBehaviorOptions {
|
|
7
|
+
/**
|
|
8
|
+
* <zh/> 是否启用滚动画布的功能
|
|
9
|
+
*
|
|
10
|
+
* <en/> Whether to enable the function of scrolling the canvas
|
|
11
|
+
* @defaultValue true
|
|
12
|
+
*/
|
|
13
|
+
enable?: boolean | ((event: WheelEvent | IKeyboardEvent) => boolean);
|
|
14
|
+
/**
|
|
15
|
+
* <zh/> 触发滚动的方式,默认使用指针滚动
|
|
16
|
+
*
|
|
17
|
+
* <en/> The way to trigger scrolling, default to scrolling with the pointer pressed
|
|
18
|
+
*/
|
|
19
|
+
trigger?: CombinationKey;
|
|
20
|
+
/**
|
|
21
|
+
* <zh/> 允许的滚动方向
|
|
22
|
+
* - 默认情况下没有限制
|
|
23
|
+
* - x : 只允许水平滚动
|
|
24
|
+
* - y : 只允许垂直滚动
|
|
25
|
+
*
|
|
26
|
+
* <en/> The allowed rolling direction
|
|
27
|
+
* - by default, there is no restriction
|
|
28
|
+
* - x: only allow horizontal scrolling
|
|
29
|
+
* - y: only allow vertical scrolling
|
|
30
|
+
*/
|
|
31
|
+
direction?: 'x' | 'y';
|
|
32
|
+
/**
|
|
33
|
+
* <zh/> 滚动灵敏度
|
|
34
|
+
*
|
|
35
|
+
* <en/> Scroll sensitivity
|
|
36
|
+
* @defaultValue 1
|
|
37
|
+
*/
|
|
38
|
+
sensitivity?: number;
|
|
39
|
+
/**
|
|
40
|
+
* <zh/> 完成滚动时的回调
|
|
41
|
+
*
|
|
42
|
+
* <en/> Callback when scrolling is completed
|
|
43
|
+
*/
|
|
44
|
+
onFinish?: () => void;
|
|
45
|
+
}
|
|
46
|
+
type CombinationKey = {
|
|
47
|
+
up: ShortcutKey;
|
|
48
|
+
down: ShortcutKey;
|
|
49
|
+
left: ShortcutKey;
|
|
50
|
+
right: ShortcutKey;
|
|
51
|
+
};
|
|
52
|
+
export declare class ScrollCanvas extends BaseBehavior<ScrollCanvasOptions> {
|
|
53
|
+
static defaultOptions: ScrollCanvasOptions;
|
|
54
|
+
private shortcut;
|
|
55
|
+
constructor(context: RuntimeContext, options: ScrollCanvasOptions);
|
|
56
|
+
private bindEvents;
|
|
57
|
+
get graphDom(): import("@antv/g").CanvasLike | null;
|
|
58
|
+
private onWheel;
|
|
59
|
+
private formatDisplacement;
|
|
60
|
+
private scroll;
|
|
61
|
+
private validate;
|
|
62
|
+
destroy(): void;
|
|
63
|
+
}
|
|
64
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { BaseBehavior } from './base-behavior';
|
|
2
2
|
import type { DragCanvasOptions } from './drag-canvas';
|
|
3
|
+
import type { ScrollCanvasOptions } from './scroll-canvas';
|
|
3
4
|
import type { ZoomCanvasOptions } from './zoom-canvas';
|
|
4
5
|
export type { States } from './brush-select';
|
|
5
|
-
export type BuiltInBehaviorOptions = DragCanvasOptions | ZoomCanvasOptions;
|
|
6
|
+
export type BuiltInBehaviorOptions = DragCanvasOptions | ZoomCanvasOptions | ScrollCanvasOptions;
|
|
6
7
|
export type Behavior = BaseBehavior<any>;
|
|
@@ -20,7 +20,7 @@ export interface ZoomCanvasOptions extends BaseBehaviorOptions {
|
|
|
20
20
|
* <zh/> 触发缩放的方式
|
|
21
21
|
*
|
|
22
22
|
* <en/> The way to trigger zoom
|
|
23
|
-
* @
|
|
23
|
+
* @remarks
|
|
24
24
|
* <zh/>
|
|
25
25
|
* - 数组:组合快捷键,默认使用滚轮缩放,['Control'] 表示按住 Control 键滚动鼠标滚轮时触发缩放
|
|
26
26
|
* - 对象:缩放快捷键,例如 { zoomIn: ['Control', '+'], zoomOut: ['Control', '-'], reset: ['Control', '0'] }
|
|
@@ -50,5 +50,9 @@ export declare enum GraphEvent {
|
|
|
50
50
|
/** <zh/> 批处理开始 | <en/> Batch processing starts */
|
|
51
51
|
BATCH_START = "batchstart",
|
|
52
52
|
/** <zh/> 批处理结束 | <en/> Batch processing ends */
|
|
53
|
-
BATCH_END = "batchend"
|
|
53
|
+
BATCH_END = "batchend",
|
|
54
|
+
/** <zh/> 销毁开始之前 | <en/> Before destruction */
|
|
55
|
+
BEFORE_DESTROY = "beforedestroy",
|
|
56
|
+
/** <zh/> 销毁结束之后 | <en/> After destruction */
|
|
57
|
+
AFTER_DESTROY = "afterdestroy"
|
|
54
58
|
}
|
|
@@ -31,7 +31,7 @@ export type BaseComboStyleProps<T extends Record<string, unknown> = Record<strin
|
|
|
31
31
|
* <zh/> Combo 的子元素数据
|
|
32
32
|
*
|
|
33
33
|
* <en/> The data of the children of combo
|
|
34
|
-
* @
|
|
34
|
+
* @remarks
|
|
35
35
|
* <zh/> 如果 combo 是收起状态,children 可能为空,通过 childrenData 能够获取完整的子元素数据
|
|
36
36
|
*
|
|
37
37
|
* <en/> If the combo is collapsed, children may be empty, and the complete child element data can be obtained through childrenData
|
|
@@ -42,11 +42,6 @@ export type BaseEdgeStyleProps = BaseElementStyleProps & Pick<PathStyleProps, 'i
|
|
|
42
42
|
* <en/> Offset of the end arrow
|
|
43
43
|
*/
|
|
44
44
|
endArrowOffset?: number;
|
|
45
|
-
/**
|
|
46
|
-
* <zh/> 主色
|
|
47
|
-
* <en/> Subject color
|
|
48
|
-
*/
|
|
49
|
-
color?: string;
|
|
50
45
|
/**
|
|
51
46
|
* <zh/> 边的起点 shape
|
|
52
47
|
* <en/> The source shape. Represents the start of the edge
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { DisplayObject, DisplayObjectConfig, Group } from '@antv/g';
|
|
2
|
-
import type { ID } from '@antv/graphlib';
|
|
3
2
|
import type { CategoricalPalette } from '../../palettes/types';
|
|
4
3
|
import type { NodeData } from '../../spec';
|
|
5
|
-
import type { BadgePlacement, BaseElementStyleProps, Keyframe, LabelPlacement, Node, Placement, Point, Port, PortStyleProps, PrefixObject, Size } from '../../types';
|
|
4
|
+
import type { BadgePlacement, BaseElementStyleProps, ID, Keyframe, LabelPlacement, Node, Placement, Point, Port, PortStyleProps, PrefixObject, Size } from '../../types';
|
|
6
5
|
import type { BadgeStyleProps, IconStyleProps, LabelStyleProps } from '../shapes';
|
|
7
6
|
import { BaseShape } from '../shapes';
|
|
8
7
|
export type BaseNodeStyleProps<T extends Record<string, unknown> = Record<string, any>> = T & BaseElementStyleProps & PrefixObject<NodeLabelStyleProps, 'label'> & PrefixObject<T, 'halo'> & PrefixObject<IconStyleProps, 'icon'> & PrefixObject<BadgeStyleProps, 'badge'> & PrefixObject<PortStyleProps, 'port'> & {
|
|
@@ -30,18 +29,12 @@ export type BaseNodeStyleProps<T extends Record<string, unknown> = Record<string
|
|
|
30
29
|
* <en/> The size of node, which is a shortcut to set the width and height of node
|
|
31
30
|
*/
|
|
32
31
|
size?: Size;
|
|
33
|
-
/**
|
|
34
|
-
* <zh/> 主色
|
|
35
|
-
*
|
|
36
|
-
* <en/> Subject color
|
|
37
|
-
*/
|
|
38
|
-
color?: string;
|
|
39
32
|
/**
|
|
40
33
|
* @deprecated
|
|
41
34
|
* <zh/> 解决类型 style.getPropertyValue 问题,不要使用该属性
|
|
42
35
|
*
|
|
43
36
|
* <en/> Solve the problem of style.getPropertyValue, do not use this property
|
|
44
|
-
* @
|
|
37
|
+
* @remarks
|
|
45
38
|
* <zh/> 移除该属性会导致 Polygon 及其子类与 Node 不兼容
|
|
46
39
|
*
|
|
47
40
|
* <en/> Removing this property will cause Polygon and its subclasses to be incompatible with Node
|
|
@@ -141,7 +134,7 @@ export declare abstract class BaseNode<S extends BaseNodeStyleProps = BaseNodeSt
|
|
|
141
134
|
* Get the key shape for the node.
|
|
142
135
|
* @returns Key shape.
|
|
143
136
|
*/
|
|
144
|
-
getKey():
|
|
137
|
+
getKey<T extends DisplayObject>(): T;
|
|
145
138
|
/**
|
|
146
139
|
* Get the ports for the node.
|
|
147
140
|
* @returns Ports shape map.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Circle } from './circle';
|
|
2
|
+
import type { BaseStyleProps, DisplayObjectConfig, Group } from '@antv/g';
|
|
3
|
+
import type { PrefixObject } from '../../types';
|
|
4
|
+
import type { CircleStyleProps } from './circle';
|
|
5
|
+
interface Round extends BaseStyleProps {
|
|
6
|
+
/**
|
|
7
|
+
* <zh/> 数值,用于计算比例
|
|
8
|
+
*
|
|
9
|
+
* <en/> Numerical value used to calculate the scale.
|
|
10
|
+
*/
|
|
11
|
+
value: number;
|
|
12
|
+
/**
|
|
13
|
+
* <zh/> 颜色
|
|
14
|
+
*
|
|
15
|
+
* <en/> Color.
|
|
16
|
+
*/
|
|
17
|
+
color?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface DonutStyleProps extends CircleStyleProps, PrefixObject<BaseStyleProps, 'donut'> {
|
|
20
|
+
/**
|
|
21
|
+
* <zh/> 内环半径,使用百分比或者像素值
|
|
22
|
+
*
|
|
23
|
+
* <en/> Inner ring radius, using percentage or pixel value.
|
|
24
|
+
*/
|
|
25
|
+
innerRadius?: string | number;
|
|
26
|
+
/**
|
|
27
|
+
* <zh/> 圆环数据
|
|
28
|
+
*
|
|
29
|
+
* <en/> Donut data.
|
|
30
|
+
*/
|
|
31
|
+
donuts?: number[] | Round[];
|
|
32
|
+
/**
|
|
33
|
+
* <zh/> 颜色或者色板名
|
|
34
|
+
*
|
|
35
|
+
* <en/> Color or palette.
|
|
36
|
+
*/
|
|
37
|
+
colors?: string | string[];
|
|
38
|
+
}
|
|
39
|
+
export declare class Donut extends Circle {
|
|
40
|
+
static defaultStyleProps: Partial<DonutStyleProps>;
|
|
41
|
+
constructor(options: DisplayObjectConfig<DonutStyleProps>);
|
|
42
|
+
protected drawDonutShape(attributes: Required<DonutStyleProps>, container: Group): void;
|
|
43
|
+
render(attributes: Required<DonutStyleProps>, container?: Group): void;
|
|
44
|
+
}
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { DisplayObjectConfig, HTMLStyleProps as GHTMLStyleProps, Group } from '@antv/g';
|
|
2
|
+
import type { BaseNodeStyleProps } from './base-node';
|
|
3
|
+
import { BaseNode } from './base-node';
|
|
4
|
+
export type HTMLStyleProps = BaseNodeStyleProps<{
|
|
5
|
+
innerHTML: string | HTMLElement;
|
|
6
|
+
}>;
|
|
7
|
+
/**
|
|
8
|
+
* @see https://github.com/antvis/G/blob/next/packages/g-lite/src/plugins/EventPlugin.ts
|
|
9
|
+
*/
|
|
10
|
+
export declare class HTML extends BaseNode<HTMLStyleProps> {
|
|
11
|
+
static defaultStyleProps: Partial<HTMLStyleProps>;
|
|
12
|
+
constructor(options: DisplayObjectConfig<HTMLStyleProps>);
|
|
13
|
+
private rootPointerEvent;
|
|
14
|
+
private get eventService();
|
|
15
|
+
private get events();
|
|
16
|
+
protected getDomElement(): HTMLElement;
|
|
17
|
+
protected getKeyStyle(attributes: Required<HTMLStyleProps>): GHTMLStyleProps;
|
|
18
|
+
protected drawKeyShape(attributes: Required<HTMLStyleProps>, container: Group): any;
|
|
19
|
+
connectedCallback(): void;
|
|
20
|
+
attributeChangedCallback(name: any, oldValue: any, newValue: any): void;
|
|
21
|
+
onDestroy(): void;
|
|
22
|
+
private forwardEvents;
|
|
23
|
+
private normalizeToPointerEvent;
|
|
24
|
+
private transferMouseData;
|
|
25
|
+
private bootstrapEvent;
|
|
26
|
+
private getViewportXY;
|
|
27
|
+
}
|