@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,57 +1,159 @@
|
|
|
1
1
|
import EventEmitter from '@antv/event-emitter';
|
|
2
2
|
import type { AABB, BaseStyleProps } from '@antv/g';
|
|
3
|
-
import type { ID } from '@antv/graphlib';
|
|
4
3
|
import type { Plugin } from '../plugins/types';
|
|
5
|
-
import type { BehaviorOptions, ComboData, ComboOptions, EdgeData, EdgeOptions,
|
|
4
|
+
import type { BehaviorOptions, ComboData, ComboOptions, EdgeData, EdgeOptions, GraphData, GraphOptions, LayoutOptions, NodeData, NodeOptions, PluginOptions, ThemeOptions, TransformOptions } from '../spec';
|
|
6
5
|
import type { UpdateBehaviorOption } from '../spec/behavior';
|
|
7
6
|
import type { UpdatePluginOption } from '../spec/plugin';
|
|
8
7
|
import type { UpdateTransformOption } from '../spec/transform';
|
|
9
|
-
import type { CallableValue, DataID, EdgeDirection, ElementType, FitViewOptions, IEvent, NodeLikeData, PartialEdgeData, PartialGraphData, PartialNodeLikeData, Point, Position, State, ViewportAnimationEffectTiming } from '../types';
|
|
8
|
+
import type { CallableValue, DataID, EdgeDirection, ElementType, FitViewOptions, ID, IEvent, NodeLikeData, PartialEdgeData, PartialGraphData, PartialNodeLikeData, Point, Position, State, ViewportAnimationEffectTiming } from '../types';
|
|
10
9
|
import type { DataURLOptions } from './canvas';
|
|
11
10
|
import { Canvas } from './canvas';
|
|
12
11
|
import type { HierarchyKey } from './data';
|
|
13
12
|
export declare class Graph extends EventEmitter {
|
|
14
13
|
private options;
|
|
15
|
-
|
|
14
|
+
/**
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
static defaultOptions: GraphOptions;
|
|
18
|
+
/**
|
|
19
|
+
* <zh/> 当前图实例是否已经被销毁
|
|
20
|
+
*
|
|
21
|
+
* <en/> Whether the current graph instance has been destroyed
|
|
22
|
+
*/
|
|
16
23
|
destroyed: boolean;
|
|
17
24
|
private context;
|
|
18
|
-
constructor(options:
|
|
25
|
+
constructor(options: GraphOptions);
|
|
19
26
|
/**
|
|
20
27
|
* <zh/> 获取配置项
|
|
21
28
|
*
|
|
22
29
|
* <en/> Get options
|
|
23
30
|
* @returns <zh/> 配置项 | <en/> options
|
|
31
|
+
* @apiCategory option
|
|
24
32
|
*/
|
|
25
|
-
getOptions():
|
|
33
|
+
getOptions(): GraphOptions;
|
|
26
34
|
/**
|
|
27
35
|
* <zh/> 设置配置项
|
|
28
36
|
*
|
|
29
37
|
* <en/> Set options
|
|
30
38
|
* @param options - <zh/> 配置项 | <en/> options
|
|
31
|
-
* @
|
|
39
|
+
* @remarks
|
|
32
40
|
* <zh/> 要更新 devicePixelRatio、container 属性请销毁后重新创建实例
|
|
33
41
|
*
|
|
34
42
|
* <en/> To update devicePixelRatio and container properties, please destroy and recreate the instance
|
|
43
|
+
* @apiCategory option
|
|
44
|
+
*/
|
|
45
|
+
setOptions(options: GraphOptions): void;
|
|
46
|
+
/**
|
|
47
|
+
* <zh/> 设置画布背景色
|
|
48
|
+
*
|
|
49
|
+
* <en/> Set canvas background color
|
|
50
|
+
* @param background - <zh/> 背景色 | <en/> background color
|
|
51
|
+
* @apiCategory canvas
|
|
52
|
+
*/
|
|
53
|
+
setBackground(background: GraphOptions['background']): void;
|
|
54
|
+
/**
|
|
55
|
+
* <zh/> 获取画布背景色
|
|
56
|
+
*
|
|
57
|
+
* <en/> Get canvas background color
|
|
58
|
+
* @returns <zh/> 背景色 | <en/> background color
|
|
59
|
+
* @apiCategory canvas
|
|
60
|
+
*/
|
|
61
|
+
getBackground(): GraphOptions['background'];
|
|
62
|
+
/**
|
|
63
|
+
* <zh/> 获取当前图容器的大小
|
|
64
|
+
*
|
|
65
|
+
* <en/> Get the size of the current canvas container
|
|
66
|
+
* @returns <zh/> 画布尺寸 | <en/> canvas size
|
|
67
|
+
* @apiCategory canvas
|
|
35
68
|
*/
|
|
36
|
-
setOptions(options: G6Spec): void;
|
|
37
|
-
setBackground(background: G6Spec['background']): void;
|
|
38
|
-
getBackground(): G6Spec['background'];
|
|
39
69
|
getSize(): [number, number];
|
|
70
|
+
/**
|
|
71
|
+
* <zh/> 获取当前图容器的大小
|
|
72
|
+
*
|
|
73
|
+
* <en/> Get the size of the current canvas container
|
|
74
|
+
* @param width - <zh/> 画布宽度 | <en/> canvas width
|
|
75
|
+
* @param height - <zh/> 画布高度 | <en/> canvas height
|
|
76
|
+
* @apiCategory canvas
|
|
77
|
+
*/
|
|
40
78
|
setSize(width: number, height: number): void;
|
|
41
|
-
|
|
42
|
-
|
|
79
|
+
/**
|
|
80
|
+
* <zh/> 获取当前图的缩放区间
|
|
81
|
+
*
|
|
82
|
+
* <en/> Get the zoom range of the current graph
|
|
83
|
+
* @param zoomRange - <zh/> 缩放区间 | <en/> zoom range
|
|
84
|
+
* @apiCategory viewport
|
|
85
|
+
*/
|
|
86
|
+
setZoomRange(zoomRange: GraphOptions['zoomRange']): void;
|
|
87
|
+
/**
|
|
88
|
+
* <zh/> 获取当前图的缩放区间
|
|
89
|
+
*
|
|
90
|
+
* <en/> Get the zoom range of the current graph
|
|
91
|
+
* @returns <zh/> 缩放区间 | <en/> zoom range
|
|
92
|
+
* @apiCategory viewport
|
|
93
|
+
*/
|
|
94
|
+
getZoomRange(): GraphOptions['zoomRange'];
|
|
95
|
+
/**
|
|
96
|
+
* <zh/> 设置节点样式映射
|
|
97
|
+
*
|
|
98
|
+
* <en/> Set node mapper
|
|
99
|
+
* @param node - <zh/> 节点配置 | <en/> node configuration
|
|
100
|
+
* @apiCategory element
|
|
101
|
+
*/
|
|
43
102
|
setNode(node: NodeOptions): void;
|
|
103
|
+
/**
|
|
104
|
+
* <zh/> 设置边样式映射
|
|
105
|
+
*
|
|
106
|
+
* <en/> Set edge mapper
|
|
107
|
+
* @param edge - <zh/> 边配置 | <en/> edge configuration
|
|
108
|
+
* @apiCategory element
|
|
109
|
+
*/
|
|
44
110
|
setEdge(edge: EdgeOptions): void;
|
|
111
|
+
/**
|
|
112
|
+
* <zh/> 设置组合样式映射
|
|
113
|
+
*
|
|
114
|
+
* <en/> Set combo mapper
|
|
115
|
+
* @param combo - <zh/> 组合配置 | <en/> combo configuration
|
|
116
|
+
* @apiCategory element
|
|
117
|
+
*/
|
|
45
118
|
setCombo(combo: ComboOptions): void;
|
|
119
|
+
/**
|
|
120
|
+
* <zh/> 获取主题
|
|
121
|
+
*
|
|
122
|
+
* <en/> Get theme
|
|
123
|
+
* @returns <zh/> 主题配置 | <en/> theme configuration
|
|
124
|
+
* @apiCategory theme
|
|
125
|
+
*/
|
|
46
126
|
getTheme(): ThemeOptions;
|
|
127
|
+
/**
|
|
128
|
+
* <zh/> 设置主题
|
|
129
|
+
*
|
|
130
|
+
* <en/> Set theme
|
|
131
|
+
* @param theme - <zh/> 主题配置 | <en/> theme configuration
|
|
132
|
+
* @apiCategory theme
|
|
133
|
+
*/
|
|
47
134
|
setTheme(theme: CallableValue<ThemeOptions>): void;
|
|
135
|
+
/**
|
|
136
|
+
* <zh/> 设置布局
|
|
137
|
+
*
|
|
138
|
+
* <en/> Set layout
|
|
139
|
+
* @param layout - <zh/> 布局配置 | <en/> layout configuration
|
|
140
|
+
* @apiCategory layout
|
|
141
|
+
*/
|
|
48
142
|
setLayout(layout: CallableValue<LayoutOptions>): void;
|
|
143
|
+
/**
|
|
144
|
+
* <zh/> 获取布局
|
|
145
|
+
*
|
|
146
|
+
* <en/> Get layout
|
|
147
|
+
* @returns <zh/> 布局配置 | <en/> layout configuration
|
|
148
|
+
* @apiCategory layout
|
|
149
|
+
*/
|
|
49
150
|
getLayout(): LayoutOptions;
|
|
50
151
|
/**
|
|
51
152
|
* <zh/> 设置交互
|
|
52
153
|
*
|
|
53
154
|
* <en/> Set behaviors
|
|
54
155
|
* @param behaviors - <zh/> 交互配置 | <en/> behavior configuration
|
|
156
|
+
* @apiCategory behavior
|
|
55
157
|
*/
|
|
56
158
|
setBehaviors(behaviors: CallableValue<BehaviorOptions>): void;
|
|
57
159
|
/**
|
|
@@ -59,6 +161,7 @@ export declare class Graph extends EventEmitter {
|
|
|
59
161
|
*
|
|
60
162
|
* <en/> Update behavior
|
|
61
163
|
* @param behavior - <zh/> 交互配置 | <en/> behavior configuration
|
|
164
|
+
* @apiCategory behavior
|
|
62
165
|
*/
|
|
63
166
|
updateBehavior(behavior: UpdateBehaviorOption): void;
|
|
64
167
|
/**
|
|
@@ -66,6 +169,7 @@ export declare class Graph extends EventEmitter {
|
|
|
66
169
|
*
|
|
67
170
|
* <en/> Get behaviors
|
|
68
171
|
* @returns <zh/> 交互配置 | <en/> behavior configuration
|
|
172
|
+
* @apiCategory behavior
|
|
69
173
|
*/
|
|
70
174
|
getBehaviors(): BehaviorOptions;
|
|
71
175
|
/**
|
|
@@ -73,6 +177,7 @@ export declare class Graph extends EventEmitter {
|
|
|
73
177
|
*
|
|
74
178
|
* <en/> Set plugins
|
|
75
179
|
* @param plugins - <zh/> 插件配置 | <en/> plugin configuration
|
|
180
|
+
* @apiCategory plugin
|
|
76
181
|
*/
|
|
77
182
|
setPlugins(plugins: CallableValue<PluginOptions>): void;
|
|
78
183
|
/**
|
|
@@ -80,6 +185,7 @@ export declare class Graph extends EventEmitter {
|
|
|
80
185
|
*
|
|
81
186
|
* <en/> Update plugin
|
|
82
187
|
* @param plugin - <zh/> 插件配置 | <en/> plugin configuration
|
|
188
|
+
* @apiCategory plugin
|
|
83
189
|
*/
|
|
84
190
|
updatePlugin(plugin: UpdatePluginOption): void;
|
|
85
191
|
/**
|
|
@@ -87,6 +193,7 @@ export declare class Graph extends EventEmitter {
|
|
|
87
193
|
*
|
|
88
194
|
* <en/> Get plugins
|
|
89
195
|
* @returns <zh/> 插件配置 | <en/> plugin configuration
|
|
196
|
+
* @apiCategory plugin
|
|
90
197
|
*/
|
|
91
198
|
getPlugins(): PluginOptions;
|
|
92
199
|
/**
|
|
@@ -95,6 +202,7 @@ export declare class Graph extends EventEmitter {
|
|
|
95
202
|
* <en/> Get plugin instance
|
|
96
203
|
* @param key - <zh/> 插件 key | <en/> plugin key
|
|
97
204
|
* @returns <zh/> 插件实例 | <en/> plugin instance
|
|
205
|
+
* @apiCategory plugin
|
|
98
206
|
*/
|
|
99
207
|
getPluginInstance<T extends Plugin>(key: string): T;
|
|
100
208
|
/**
|
|
@@ -102,6 +210,7 @@ export declare class Graph extends EventEmitter {
|
|
|
102
210
|
*
|
|
103
211
|
* <en/> Set data transforms
|
|
104
212
|
* @param transforms - <zh/> 数据转换配置 | <en/> data transform configuration
|
|
213
|
+
* @apiCategory transform
|
|
105
214
|
*/
|
|
106
215
|
setTransforms(transforms: CallableValue<TransformOptions>): void;
|
|
107
216
|
/**
|
|
@@ -109,6 +218,7 @@ export declare class Graph extends EventEmitter {
|
|
|
109
218
|
*
|
|
110
219
|
* <en/> Update data transform
|
|
111
220
|
* @param transform - <zh/> 数据转换配置 | <en/> data transform configuration
|
|
221
|
+
* @apiCategory transform
|
|
112
222
|
*/
|
|
113
223
|
updateTransform(transform: UpdateTransformOption): void;
|
|
114
224
|
/**
|
|
@@ -116,78 +226,299 @@ export declare class Graph extends EventEmitter {
|
|
|
116
226
|
*
|
|
117
227
|
* <en/> Get data transforms
|
|
118
228
|
* @returns <zh/> 数据转换器实例 | <en/> data transform instance
|
|
229
|
+
* @apiCategory transform
|
|
119
230
|
*/
|
|
120
231
|
getTransforms(): TransformOptions;
|
|
232
|
+
/**
|
|
233
|
+
* <zh/> 获取数据
|
|
234
|
+
*
|
|
235
|
+
* <en/> Get data
|
|
236
|
+
* @returns <zh/> 数据 | <en/> data
|
|
237
|
+
* @apiCategory data
|
|
238
|
+
*/
|
|
121
239
|
getData(): GraphData;
|
|
240
|
+
/**
|
|
241
|
+
* <zh/> 获取所有节点数据
|
|
242
|
+
*
|
|
243
|
+
* <en/> Get all node data
|
|
244
|
+
* @returns <zh/> 节点数据 | <en/> node data
|
|
245
|
+
* @apiCategory data
|
|
246
|
+
*/
|
|
122
247
|
getNodeData(): NodeData[];
|
|
248
|
+
/**
|
|
249
|
+
* <zh/> 获取单个节点数据
|
|
250
|
+
*
|
|
251
|
+
* <en/> Get single node data
|
|
252
|
+
* @param id - <zh/> 节点 ID | <en/> node ID
|
|
253
|
+
* @returns <zh/> 节点数据 | <en/> node data
|
|
254
|
+
* @apiCategory data
|
|
255
|
+
*/
|
|
123
256
|
getNodeData(id: ID): NodeData;
|
|
257
|
+
/**
|
|
258
|
+
* <zh/> 批量获取多个节点数据
|
|
259
|
+
*
|
|
260
|
+
* <en/> Get multiple node data in batch
|
|
261
|
+
* @param ids - <zh/> 节点 ID 数组 | <en/> node ID array
|
|
262
|
+
* @returns <zh/> 节点数据 | <en/> node data
|
|
263
|
+
* @apiCategory data
|
|
264
|
+
*/
|
|
124
265
|
getNodeData(ids: ID[]): NodeData[];
|
|
266
|
+
/**
|
|
267
|
+
* <zh/> 获取所有边数据
|
|
268
|
+
*
|
|
269
|
+
* <en/> Get all edge data
|
|
270
|
+
* @returns <zh/> 边数据 | <en/> edge data
|
|
271
|
+
* @apiCategory data
|
|
272
|
+
*/
|
|
125
273
|
getEdgeData(): EdgeData[];
|
|
274
|
+
/**
|
|
275
|
+
* <zh/> 获取单条边数据
|
|
276
|
+
*
|
|
277
|
+
* <en/> Get single edge data
|
|
278
|
+
* @param id - <zh/> 边 ID | <en/> edge ID
|
|
279
|
+
* @returns <zh/> 边数据 | <en/> edge data
|
|
280
|
+
* @apiCategory data
|
|
281
|
+
*/
|
|
126
282
|
getEdgeData(id: ID): EdgeData;
|
|
283
|
+
/**
|
|
284
|
+
* <zh/> 批量获取多条边数据
|
|
285
|
+
*
|
|
286
|
+
* <en/> Get multiple edge data in batch
|
|
287
|
+
* @param ids - <zh/> 边 ID 数组 | <en/> edge ID array
|
|
288
|
+
* @returns <zh/> 边数据 | <en/> edge data
|
|
289
|
+
* @apiCategory data
|
|
290
|
+
*/
|
|
127
291
|
getEdgeData(ids: ID[]): EdgeData[];
|
|
292
|
+
/**
|
|
293
|
+
* <zh/> 获取所有组合数据
|
|
294
|
+
*
|
|
295
|
+
* <en/> Get all combo data
|
|
296
|
+
* @returns <zh/> 组合数据 | <en/> combo data
|
|
297
|
+
* @apiCategory data
|
|
298
|
+
*/
|
|
128
299
|
getComboData(): ComboData[];
|
|
300
|
+
/**
|
|
301
|
+
* <zh/> 获取单个组合数据
|
|
302
|
+
*
|
|
303
|
+
* <en/> Get single combo data
|
|
304
|
+
* @param id - <zh/> 组合ID | <en/> combo ID
|
|
305
|
+
* @returns <zh/> 组合数据 | <en/> combo data
|
|
306
|
+
* @apiCategory data
|
|
307
|
+
*/
|
|
129
308
|
getComboData(id: ID): ComboData;
|
|
309
|
+
/**
|
|
310
|
+
* <zh/> 批量获取多个组合数据
|
|
311
|
+
*
|
|
312
|
+
* <en/> Get multiple combo data in batch
|
|
313
|
+
* @param ids - <zh/> 组合ID 数组 | <en/> combo ID array
|
|
314
|
+
* @returns <zh/> 组合数据 | <en/> combo data
|
|
315
|
+
* @apiCategory data
|
|
316
|
+
*/
|
|
130
317
|
getComboData(ids: ID[]): ComboData[];
|
|
318
|
+
/**
|
|
319
|
+
* <zh/> 设置全量数据
|
|
320
|
+
*
|
|
321
|
+
* <en/> Set full data
|
|
322
|
+
* @param data - <zh/> 数据 | <en/> data
|
|
323
|
+
* @apiCategory data
|
|
324
|
+
*/
|
|
131
325
|
setData(data: CallableValue<GraphData>): void;
|
|
326
|
+
/**
|
|
327
|
+
* <zh/> 新增元素数据
|
|
328
|
+
*
|
|
329
|
+
* <en/> Add element data
|
|
330
|
+
* @param data - <zh/> 元素数据 | <en/> element data
|
|
331
|
+
* @apiCategory data
|
|
332
|
+
*/
|
|
132
333
|
addData(data: CallableValue<GraphData>): void;
|
|
334
|
+
/**
|
|
335
|
+
* <zh/> 新增节点数据
|
|
336
|
+
*
|
|
337
|
+
* <en/> Add node data
|
|
338
|
+
* @param data - <zh/> 节点数据 | <en/> node data
|
|
339
|
+
* @apiCategory data
|
|
340
|
+
*/
|
|
133
341
|
addNodeData(data: CallableValue<NodeData[]>): void;
|
|
342
|
+
/**
|
|
343
|
+
* <zh/> 新增边数据
|
|
344
|
+
*
|
|
345
|
+
* <en/> Add edge data
|
|
346
|
+
* @param data - <zh/> 边数据 | <en/> edge data
|
|
347
|
+
* @apiCategory data
|
|
348
|
+
*/
|
|
134
349
|
addEdgeData(data: CallableValue<EdgeData[]>): void;
|
|
350
|
+
/**
|
|
351
|
+
* <zh/> 新增组合数据
|
|
352
|
+
*
|
|
353
|
+
* <en/> Add combo data
|
|
354
|
+
* @param data - <zh/> 组合数据 | <en/> combo data
|
|
355
|
+
* @apiCategory data
|
|
356
|
+
*/
|
|
135
357
|
addComboData(data: CallableValue<ComboData[]>): void;
|
|
358
|
+
/**
|
|
359
|
+
* <zh/> 更新元素数据
|
|
360
|
+
*
|
|
361
|
+
* <en/> Update element data
|
|
362
|
+
* @param data - <zh/> 元素数据 | <en/> element data
|
|
363
|
+
* @apiCategory data
|
|
364
|
+
*/
|
|
136
365
|
updateData(data: CallableValue<PartialGraphData>): void;
|
|
366
|
+
/**
|
|
367
|
+
* <zh/> 更新节点数据
|
|
368
|
+
*
|
|
369
|
+
* <en/> Update node data
|
|
370
|
+
* @param data - <zh/> 节点数据 | <en/> node data
|
|
371
|
+
* @apiCategory data
|
|
372
|
+
*/
|
|
137
373
|
updateNodeData(data: CallableValue<PartialNodeLikeData<NodeData>[]>): void;
|
|
374
|
+
/**
|
|
375
|
+
* <zh/> 更新边数据
|
|
376
|
+
*
|
|
377
|
+
* <en/> Update edge data
|
|
378
|
+
* @param data - <zh/> 边数据 | <en/> edge data
|
|
379
|
+
* @apiCategory data
|
|
380
|
+
*/
|
|
138
381
|
updateEdgeData(data: CallableValue<PartialEdgeData<EdgeData>[]>): void;
|
|
382
|
+
/**
|
|
383
|
+
* <zh/> 更新 组合数据
|
|
384
|
+
*
|
|
385
|
+
* <en/> Update combo data
|
|
386
|
+
* @param data - <zh/> 组合数据 | <en/> combo data
|
|
387
|
+
* @apiCategory data
|
|
388
|
+
*/
|
|
139
389
|
updateComboData(data: CallableValue<PartialNodeLikeData<ComboData>[]>): void;
|
|
140
|
-
|
|
390
|
+
/**
|
|
391
|
+
* <zh/> 删除多条元素数据
|
|
392
|
+
*
|
|
393
|
+
* <en/> Remove multiple element data
|
|
394
|
+
* @param ids - <zh/> 元素 ID 数组 | <en/> element ID array
|
|
395
|
+
* @apiCategory data
|
|
396
|
+
*/
|
|
397
|
+
removeData(ids: DataID | ((data: GraphData) => DataID)): void;
|
|
398
|
+
/**
|
|
399
|
+
* <zh/> 删除多条节点数据
|
|
400
|
+
*
|
|
401
|
+
* <en/> Remove multiple node data
|
|
402
|
+
* @param ids - <zh/> 节点 ID 数组 | <en/> node ID array
|
|
403
|
+
* @apiCategory data
|
|
404
|
+
*/
|
|
141
405
|
removeNodeData(ids: ID[] | ((data: NodeData[]) => ID[])): void;
|
|
406
|
+
/**
|
|
407
|
+
* <zh/> 删除多条边数据
|
|
408
|
+
*
|
|
409
|
+
* <en/> Remove multiple edge data
|
|
410
|
+
* @param ids - <zh/> 边 ID 数组 | <en/> edge ID array
|
|
411
|
+
* @apiCategory data
|
|
412
|
+
*/
|
|
142
413
|
removeEdgeData(ids: ID[] | ((data: EdgeData[]) => ID[])): void;
|
|
414
|
+
/**
|
|
415
|
+
* <zh/> 删除多条组合数据
|
|
416
|
+
*
|
|
417
|
+
* <en/> Remove multiple combo data
|
|
418
|
+
* @param ids - <zh/> 组合 ID 数组 | <en/> 组合 ID array
|
|
419
|
+
* @apiCategory data
|
|
420
|
+
*/
|
|
143
421
|
removeComboData(ids: ID[] | ((data: ComboData[]) => ID[])): void;
|
|
422
|
+
/**
|
|
423
|
+
* <zh/> 获取元素类型
|
|
424
|
+
*
|
|
425
|
+
* <en/> Get element type
|
|
426
|
+
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
427
|
+
* @returns <zh/> 元素类型 | <en/> element type
|
|
428
|
+
* @apiCategory element
|
|
429
|
+
*/
|
|
144
430
|
getElementType(id: ID): ElementType;
|
|
431
|
+
/**
|
|
432
|
+
* <zh/> 获取节点或组合相关的边数据
|
|
433
|
+
*
|
|
434
|
+
* <en/> Get the edge data related to the node or combo
|
|
435
|
+
* @param id - <zh/> 节点或组合ID | <en/> node or combo ID
|
|
436
|
+
* @param direction - <zh/> 边的方向 | <en/> edge direction
|
|
437
|
+
* @returns <zh/> 边数据 | <en/> edge data
|
|
438
|
+
* @apiCategory data
|
|
439
|
+
*/
|
|
145
440
|
getRelatedEdgesData(id: ID, direction?: EdgeDirection): EdgeData[];
|
|
441
|
+
/**
|
|
442
|
+
* <zh/> 获取节点或组合的一跳邻居节点数据
|
|
443
|
+
*
|
|
444
|
+
* <en/> Get the one-hop neighbor node data of the node or combo
|
|
445
|
+
* @param id - <zh/> 节点或组合ID | <en/> node or combo ID
|
|
446
|
+
* @returns <zh/> 邻居节点数据 | <en/> neighbor node data
|
|
447
|
+
* @apiCategory data
|
|
448
|
+
*/
|
|
146
449
|
getNeighborNodesData(id: ID): NodeData[];
|
|
147
450
|
/**
|
|
148
|
-
* <zh/>
|
|
451
|
+
* <zh/> 获取节点或组合的祖先元素数据
|
|
149
452
|
*
|
|
150
453
|
* <en/> Get the ancestor element data of the node or combo
|
|
151
|
-
* @param id - <zh/>
|
|
152
|
-
* @param hierarchy - <zh/>
|
|
454
|
+
* @param id - <zh/> 节点或组合ID | <en/> node or combo ID
|
|
455
|
+
* @param hierarchy - <zh/> 指定树图层级关系还是组合层级关系 | <en/> specify tree or combo hierarchy relationship
|
|
153
456
|
* @returns <zh/> 祖先元素数据 | <en/> ancestor element data
|
|
154
|
-
* @
|
|
457
|
+
* @remarks
|
|
155
458
|
* <zh/> 数组中的顺序是从父节点到祖先节点
|
|
156
459
|
*
|
|
157
460
|
* <en/> The order in the array is from the parent node to the ancestor node
|
|
461
|
+
* @apiCategory data
|
|
158
462
|
*/
|
|
159
463
|
getAncestorsData(id: ID, hierarchy: HierarchyKey): NodeLikeData[];
|
|
160
464
|
/**
|
|
161
|
-
* <zh/>
|
|
465
|
+
* <zh/> 获取节点或组合的父元素数据
|
|
162
466
|
*
|
|
163
467
|
* <en/> Get the parent element data of the node or combo
|
|
164
|
-
* @param id - <zh/>
|
|
165
|
-
* @param hierarchy - <zh/>
|
|
468
|
+
* @param id - <zh/> 节点或组合ID | <en/> node or combo ID
|
|
469
|
+
* @param hierarchy - <zh/> 指定树图层级关系还是组合层级关系 | <en/> specify tree or combo hierarchy relationship
|
|
166
470
|
* @returns <zh/> 父元素数据 | <en/> parent element data
|
|
471
|
+
* @apiCategory data
|
|
167
472
|
*/
|
|
168
473
|
getParentData(id: ID, hierarchy: HierarchyKey): NodeLikeData | undefined;
|
|
169
474
|
/**
|
|
170
|
-
* <zh/>
|
|
475
|
+
* <zh/> 获取节点或组合的子元素数据
|
|
171
476
|
*
|
|
172
477
|
* <en/> Get the child element data of the node or combo
|
|
173
|
-
* @param id - <zh/>
|
|
478
|
+
* @param id - <zh/> 节点或组合ID | <en/> node or combo ID
|
|
174
479
|
* @returns <zh/> 子元素数据 | <en/> child element data
|
|
480
|
+
* @apiCategory data
|
|
175
481
|
*/
|
|
176
482
|
getChildrenData(id: ID): NodeLikeData[];
|
|
483
|
+
/**
|
|
484
|
+
* <zh/> 获取具体某一状态下的节点数据
|
|
485
|
+
*
|
|
486
|
+
* <en/> Get node data in a specific state
|
|
487
|
+
* @param state - <zh/> 状态 | <en/> state
|
|
488
|
+
* @returns <zh/> 节点数据 | <en/> node data
|
|
489
|
+
* @apiCategory data
|
|
490
|
+
*/
|
|
177
491
|
getElementDataByState(elementType: 'node', state: State): NodeData[];
|
|
492
|
+
/**
|
|
493
|
+
* <zh/> 获取具体某一状态下的边数据
|
|
494
|
+
*
|
|
495
|
+
* <en/> Get edge data in a specific state
|
|
496
|
+
* @param state - <zh/> 状态 | <en/> state
|
|
497
|
+
* @returns <zh/> 边数据 | <en/> edge data
|
|
498
|
+
* @apiCategory data
|
|
499
|
+
*/
|
|
178
500
|
getElementDataByState(elementType: 'edge', state: State): EdgeData[];
|
|
501
|
+
/**
|
|
502
|
+
* <zh/> 获取具体某一状态下的组合数据
|
|
503
|
+
*
|
|
504
|
+
* <en/> Get combo data in a specific state
|
|
505
|
+
* @param state - <zh/> 状态 | <en/> state
|
|
506
|
+
* @returns <zh/> 组合数据 | <en/> combo data
|
|
507
|
+
* @apiCategory data
|
|
508
|
+
*/
|
|
179
509
|
getElementDataByState(elementType: 'combo', state: State): ComboData[];
|
|
180
510
|
private initCanvas;
|
|
181
|
-
private
|
|
511
|
+
private initRuntime;
|
|
182
512
|
private prepare;
|
|
183
513
|
/**
|
|
184
514
|
* <zh/> 执行渲染
|
|
185
515
|
*
|
|
186
516
|
* <en/> Render
|
|
187
|
-
* @
|
|
517
|
+
* @remarks
|
|
188
518
|
* <zh/> 此过程会执行数据更新、绘制元素、执行布局
|
|
189
519
|
*
|
|
190
520
|
* <en/> This process will execute data update, element rendering, and layout execution
|
|
521
|
+
* @apiCategory render
|
|
191
522
|
*/
|
|
192
523
|
render(): Promise<void>;
|
|
193
524
|
/**
|
|
@@ -195,19 +526,64 @@ export declare class Graph extends EventEmitter {
|
|
|
195
526
|
*
|
|
196
527
|
* <en/> Draw elements
|
|
197
528
|
* @returns <zh/> 渲染结果 | <en/> draw result
|
|
529
|
+
* @apiCategory element
|
|
198
530
|
*/
|
|
199
531
|
draw(): Promise<void>;
|
|
200
|
-
|
|
532
|
+
/**
|
|
533
|
+
* <zh/> 执行布局
|
|
534
|
+
*
|
|
535
|
+
* <en/> Execute layout
|
|
536
|
+
* @apiCategory layout
|
|
537
|
+
*/
|
|
538
|
+
layout(): void;
|
|
539
|
+
/**
|
|
540
|
+
* <zh/> 停止布局
|
|
541
|
+
*
|
|
542
|
+
* <en/> Stop layout
|
|
543
|
+
* @remarks
|
|
544
|
+
* <zh/> 适用于带有迭代动画的布局,目前有 `force` 属于此类布局,即停止力导布局的迭代,一般用于布局迭代时间过长情况下的手动停止迭代动画,例如在点击画布/节点的监听中调用
|
|
545
|
+
*
|
|
546
|
+
* <en/> Suitable for layouts with iterative animations. Currently, `force` belongs to this type of layout, that is, stop the iteration of the force-directed layout. It is generally used to manually stop the iteration animation when the layout iteration time is too long, such as calling in the click canvas/node listener
|
|
547
|
+
* @apiCategory layout
|
|
548
|
+
*/
|
|
201
549
|
stopLayout(): void;
|
|
202
550
|
/**
|
|
203
551
|
* <zh/> 清空画布元素
|
|
204
552
|
*
|
|
205
553
|
* <en/> Clear canvas elements
|
|
554
|
+
* @apiCategory canvas
|
|
206
555
|
*/
|
|
207
556
|
clear(): Promise<void>;
|
|
557
|
+
/**
|
|
558
|
+
* <zh/> 销毁当前图实例
|
|
559
|
+
*
|
|
560
|
+
* <en/> Destroy the current graph instance
|
|
561
|
+
* @apiCategory instance
|
|
562
|
+
*/
|
|
208
563
|
destroy(): void;
|
|
564
|
+
/**
|
|
565
|
+
* <zh/> 获取画布实例
|
|
566
|
+
*
|
|
567
|
+
* <en/> Get canvas instance
|
|
568
|
+
* @returns - <zh/> 画布实例 | <en/> canvas instance
|
|
569
|
+
* @apiCategory canvas
|
|
570
|
+
*/
|
|
209
571
|
getCanvas(): Canvas;
|
|
572
|
+
/**
|
|
573
|
+
* <zh/> 调整画布大小为图容器大小
|
|
574
|
+
*
|
|
575
|
+
* <en/> Resize the canvas to the size of the graph container
|
|
576
|
+
* @apiCategory viewport
|
|
577
|
+
*/
|
|
210
578
|
resize(): void;
|
|
579
|
+
/**
|
|
580
|
+
* <zh/> 调整画布大小为指定宽高
|
|
581
|
+
*
|
|
582
|
+
* <en/> Resize the canvas to the specified width and height
|
|
583
|
+
* @param width - <zh/> 宽度 | <en/> width
|
|
584
|
+
* @param height - <zh/> 高度 | <en/> height
|
|
585
|
+
* @apiCategory viewport
|
|
586
|
+
*/
|
|
211
587
|
resize(width: number, height: number): void;
|
|
212
588
|
/**
|
|
213
589
|
* <zh/> 将图缩放至合适大小并平移至视口中心
|
|
@@ -215,6 +591,7 @@ export declare class Graph extends EventEmitter {
|
|
|
215
591
|
* <en/> Zoom the graph to fit the viewport and move it to the center of the viewport
|
|
216
592
|
* @param options - <zh/> 适配配置 | <en/> fit options
|
|
217
593
|
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
594
|
+
* @apiCategory viewport
|
|
218
595
|
*/
|
|
219
596
|
fitView(options?: FitViewOptions, animation?: ViewportAnimationEffectTiming): Promise<void>;
|
|
220
597
|
/**
|
|
@@ -222,9 +599,18 @@ export declare class Graph extends EventEmitter {
|
|
|
222
599
|
*
|
|
223
600
|
* <en/> Move the graph to the center of the viewport
|
|
224
601
|
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
602
|
+
* @apiCategory viewport
|
|
225
603
|
*/
|
|
226
604
|
fitCenter(animation?: ViewportAnimationEffectTiming): Promise<void>;
|
|
227
605
|
private autoFit;
|
|
606
|
+
/**
|
|
607
|
+
* <zh/> 移动图,使得元素对齐到视口中心
|
|
608
|
+
*
|
|
609
|
+
* <en/> Move the graph so that the element is aligned to the center of the viewport
|
|
610
|
+
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
611
|
+
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
612
|
+
* @apiCategory viewport
|
|
613
|
+
*/
|
|
228
614
|
focusElement(id: ID | ID[], animation?: ViewportAnimationEffectTiming): Promise<void>;
|
|
229
615
|
/**
|
|
230
616
|
* <zh/> 基于当前缩放比例进行缩放
|
|
@@ -233,13 +619,15 @@ export declare class Graph extends EventEmitter {
|
|
|
233
619
|
* @param ratio - <zh/> 缩放比例 | <en/> zoom ratio
|
|
234
620
|
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
235
621
|
* @param origin - <zh/> 缩放中心(视口坐标) | <en/> zoom center(viewport coordinates)
|
|
236
|
-
* @
|
|
622
|
+
* @remarks
|
|
237
623
|
* <zh/>
|
|
238
624
|
* - ratio > 1 放大
|
|
239
625
|
* - ratio < 1 缩小
|
|
626
|
+
*
|
|
240
627
|
* <en/>
|
|
241
628
|
* - ratio > 1 zoom in
|
|
242
629
|
* - ratio < 1 zoom out
|
|
630
|
+
* @apiCategory viewport
|
|
243
631
|
*/
|
|
244
632
|
zoomBy(ratio: number, animation?: ViewportAnimationEffectTiming, origin?: Point): Promise<void>;
|
|
245
633
|
/**
|
|
@@ -249,15 +637,17 @@ export declare class Graph extends EventEmitter {
|
|
|
249
637
|
* @param zoom - <zh/> 指定缩放比例 | <en/> specified zoom ratio
|
|
250
638
|
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
251
639
|
* @param origin - <zh/> 缩放中心(视口坐标) | <en/> zoom center(viewport coordinates)
|
|
252
|
-
* @
|
|
640
|
+
* @remarks
|
|
253
641
|
* <zh/>
|
|
254
642
|
* - zoom = 1 默认大小
|
|
255
643
|
* - zoom > 1 放大
|
|
256
644
|
* - zoom < 1 缩小
|
|
645
|
+
*
|
|
257
646
|
* <en/>
|
|
258
647
|
* - zoom = 1 default size
|
|
259
648
|
* - zoom > 1 zoom in
|
|
260
649
|
* - zoom < 1 zoom out
|
|
650
|
+
* @apiCategory viewport
|
|
261
651
|
*/
|
|
262
652
|
zoomTo(zoom: number, animation?: ViewportAnimationEffectTiming, origin?: Point): Promise<void>;
|
|
263
653
|
/**
|
|
@@ -265,6 +655,7 @@ export declare class Graph extends EventEmitter {
|
|
|
265
655
|
*
|
|
266
656
|
* <en/> Get the current zoom ratio
|
|
267
657
|
* @returns <zh/> 缩放比例 | <en/> zoom ratio
|
|
658
|
+
* @apiCategory viewport
|
|
268
659
|
*/
|
|
269
660
|
getZoom(): number;
|
|
270
661
|
/**
|
|
@@ -274,6 +665,7 @@ export declare class Graph extends EventEmitter {
|
|
|
274
665
|
* @param angle - <zh/> 旋转角度 | <en/> rotation angle
|
|
275
666
|
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
276
667
|
* @param origin - <zh/> 旋转中心(视口坐标) | <en/> rotation center(viewport coordinates)
|
|
668
|
+
* @apiCategory viewport
|
|
277
669
|
*/
|
|
278
670
|
rotateBy(angle: number, animation?: ViewportAnimationEffectTiming, origin?: Point): Promise<void>;
|
|
279
671
|
/**
|
|
@@ -283,6 +675,7 @@ export declare class Graph extends EventEmitter {
|
|
|
283
675
|
* @param angle - <zh/> 目标角度 | <en/> target angle
|
|
284
676
|
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
285
677
|
* @param origin - <zh/> 旋转中心(视口坐标) | <en/> rotation center(viewport coordinates)
|
|
678
|
+
* @apiCategory viewport
|
|
286
679
|
*/
|
|
287
680
|
rotateTo(angle: number, animation?: ViewportAnimationEffectTiming, origin?: Point): Promise<void>;
|
|
288
681
|
/**
|
|
@@ -290,6 +683,7 @@ export declare class Graph extends EventEmitter {
|
|
|
290
683
|
*
|
|
291
684
|
* <en/> Get the current rotation angle
|
|
292
685
|
* @returns <zh/> 旋转角度 | <en/> rotation angle
|
|
686
|
+
* @apiCategory viewport
|
|
293
687
|
*/
|
|
294
688
|
getRotation(): number;
|
|
295
689
|
/**
|
|
@@ -298,6 +692,7 @@ export declare class Graph extends EventEmitter {
|
|
|
298
692
|
* <en/> Translate the graph by the specified distance
|
|
299
693
|
* @param offset - <zh/> 偏移量 | <en/> offset
|
|
300
694
|
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
695
|
+
* @apiCategory viewport
|
|
301
696
|
*/
|
|
302
697
|
translateBy(offset: Point, animation?: ViewportAnimationEffectTiming): Promise<void>;
|
|
303
698
|
/**
|
|
@@ -306,7 +701,7 @@ export declare class Graph extends EventEmitter {
|
|
|
306
701
|
* <en/> Translate the graph to the specified position
|
|
307
702
|
* @param position - <zh/> 指定位置 | <en/> specified position
|
|
308
703
|
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
309
|
-
* @
|
|
704
|
+
* @apiCategory viewport
|
|
310
705
|
*/
|
|
311
706
|
translateTo(position: Point, animation?: ViewportAnimationEffectTiming): Promise<void>;
|
|
312
707
|
/**
|
|
@@ -314,10 +709,11 @@ export declare class Graph extends EventEmitter {
|
|
|
314
709
|
*
|
|
315
710
|
* <en/> Get the position of the graph
|
|
316
711
|
* @returns <zh/> 图的位置 | <en/> position of the graph
|
|
317
|
-
* @
|
|
712
|
+
* @remarks
|
|
318
713
|
* <zh/> 默认状态下,图的位置为 [0, 0]
|
|
319
714
|
*
|
|
320
715
|
* <en/> By default, the position of the graph is [0, 0]
|
|
716
|
+
* @apiCategory viewport
|
|
321
717
|
*/
|
|
322
718
|
getPosition(): Point;
|
|
323
719
|
/**
|
|
@@ -326,7 +722,8 @@ export declare class Graph extends EventEmitter {
|
|
|
326
722
|
* <en/> Translate the element by the specified distance
|
|
327
723
|
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
328
724
|
* @param offset - <zh/> 偏移量 | <en/> offset
|
|
329
|
-
* @param animation - <zh/>
|
|
725
|
+
* @param animation - <zh/> 是否启用动画 | <en/> whether to enable animation
|
|
726
|
+
* @apiCategory element
|
|
330
727
|
*/
|
|
331
728
|
translateElementBy(id: ID, offset: Position, animation?: boolean): Promise<void>;
|
|
332
729
|
/**
|
|
@@ -334,7 +731,8 @@ export declare class Graph extends EventEmitter {
|
|
|
334
731
|
*
|
|
335
732
|
* <en/> Batch translate elements by the specified distance
|
|
336
733
|
* @param offsets - <zh/> 偏移量配置 | <en/> offset configuration
|
|
337
|
-
* @param animation - <zh/>
|
|
734
|
+
* @param animation - <zh/> 是否启用动画 | <en/> whether to enable animation
|
|
735
|
+
* @apiCategory element
|
|
338
736
|
*/
|
|
339
737
|
translateElementBy(offsets: Record<ID, Position>, animation?: boolean): Promise<void>;
|
|
340
738
|
/**
|
|
@@ -343,7 +741,8 @@ export declare class Graph extends EventEmitter {
|
|
|
343
741
|
* <en/> Translate the element to the specified position
|
|
344
742
|
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
345
743
|
* @param position - <zh/> 指定位置 | <en/> specified position
|
|
346
|
-
* @param animation - <zh/>
|
|
744
|
+
* @param animation - <zh/> 是否启用动画 | <en/> whether to enable animation
|
|
745
|
+
* @apiCategory element
|
|
347
746
|
*/
|
|
348
747
|
translateElementTo(id: ID, position: Position, animation?: boolean): Promise<void>;
|
|
349
748
|
/**
|
|
@@ -351,10 +750,27 @@ export declare class Graph extends EventEmitter {
|
|
|
351
750
|
*
|
|
352
751
|
* <en/> Batch translate elements to the specified position
|
|
353
752
|
* @param positions - <zh/> 位置配置 | <en/> position configuration
|
|
354
|
-
* @param animation - <zh/>
|
|
753
|
+
* @param animation - <zh/> 是否启用动画 | <en/> whether to enable animation
|
|
754
|
+
* @apiCategory element
|
|
355
755
|
*/
|
|
356
756
|
translateElementTo(positions: Record<ID, Position>, animation?: boolean): Promise<void>;
|
|
757
|
+
/**
|
|
758
|
+
* <zh/> 获取元素位置
|
|
759
|
+
*
|
|
760
|
+
* <en/> Get element position
|
|
761
|
+
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
762
|
+
* @returns <zh/> 元素位置 | <en/> element position
|
|
763
|
+
* @apiCategory element
|
|
764
|
+
*/
|
|
357
765
|
getElementPosition(id: ID): Position;
|
|
766
|
+
/**
|
|
767
|
+
* <zh/> 获取元素渲染样式
|
|
768
|
+
*
|
|
769
|
+
* <en/> Get element rendering style
|
|
770
|
+
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
771
|
+
* @returns <zh/> 元素渲染样式 | <en/> element rendering style
|
|
772
|
+
* @apiCategory element
|
|
773
|
+
*/
|
|
358
774
|
getElementRenderStyle(id: ID): import("@antv/util/lib/lodash/types").ObjectType<unknown>;
|
|
359
775
|
/**
|
|
360
776
|
* <zh/> 设置元素可见性
|
|
@@ -363,6 +779,7 @@ export declare class Graph extends EventEmitter {
|
|
|
363
779
|
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
364
780
|
* @param visibility - <zh/> 可见性 | <en/> visibility
|
|
365
781
|
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
782
|
+
* @apiCategory element
|
|
366
783
|
*/
|
|
367
784
|
setElementVisibility(id: ID, visibility: BaseStyleProps['visibility'], animation?: boolean): Promise<void>;
|
|
368
785
|
/**
|
|
@@ -371,6 +788,7 @@ export declare class Graph extends EventEmitter {
|
|
|
371
788
|
* <en/> Batch set element visibility
|
|
372
789
|
* @param visibility - <zh/> 可见性配置 | <en/> visibility configuration
|
|
373
790
|
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
791
|
+
* @apiCategory element
|
|
374
792
|
*/
|
|
375
793
|
setElementVisibility(visibility: Record<ID, BaseStyleProps['visibility']>, animation?: boolean): Promise<void>;
|
|
376
794
|
/**
|
|
@@ -378,7 +796,8 @@ export declare class Graph extends EventEmitter {
|
|
|
378
796
|
*
|
|
379
797
|
* <en/> Show element
|
|
380
798
|
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
381
|
-
* @param animation - <zh/>
|
|
799
|
+
* @param animation - <zh/> 是否启用动画 | <en/> whether to enable animation
|
|
800
|
+
* @apiCategory element
|
|
382
801
|
*/
|
|
383
802
|
showElement(id: ID | ID[], animation?: boolean): Promise<void>;
|
|
384
803
|
/**
|
|
@@ -386,7 +805,8 @@ export declare class Graph extends EventEmitter {
|
|
|
386
805
|
*
|
|
387
806
|
* <en/> Hide element
|
|
388
807
|
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
389
|
-
* @param animation - <zh/>
|
|
808
|
+
* @param animation - <zh/> 是否启用动画 | <en/> whether to enable animation
|
|
809
|
+
* @apiCategory element
|
|
390
810
|
*/
|
|
391
811
|
hideElement(id: ID | ID[], animation?: boolean): Promise<void>;
|
|
392
812
|
/**
|
|
@@ -395,6 +815,7 @@ export declare class Graph extends EventEmitter {
|
|
|
395
815
|
* <en/> Get element visibility
|
|
396
816
|
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
397
817
|
* @returns <zh/> 元素可见性 | <en/> element visibility
|
|
818
|
+
* @apiCategory element
|
|
398
819
|
*/
|
|
399
820
|
getElementVisibility(id: ID): BaseStyleProps['visibility'];
|
|
400
821
|
/**
|
|
@@ -403,6 +824,7 @@ export declare class Graph extends EventEmitter {
|
|
|
403
824
|
* <en/> Set element z-index
|
|
404
825
|
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
405
826
|
* @param zIndex - <zh/> 层级 | <en/> z-index
|
|
827
|
+
* @apiCategory element
|
|
406
828
|
*/
|
|
407
829
|
setElementZIndex(id: ID, zIndex: number): Promise<void>;
|
|
408
830
|
/**
|
|
@@ -410,6 +832,7 @@ export declare class Graph extends EventEmitter {
|
|
|
410
832
|
*
|
|
411
833
|
* <en/> Batch set element z-index
|
|
412
834
|
* @param zIndex - <zh/> 层级配置 | <en/> z-index configuration
|
|
835
|
+
* @apiCategory element
|
|
413
836
|
*/
|
|
414
837
|
setElementZIndex(zIndex: Record<ID, number>): Promise<void>;
|
|
415
838
|
/**
|
|
@@ -417,6 +840,7 @@ export declare class Graph extends EventEmitter {
|
|
|
417
840
|
*
|
|
418
841
|
* <en/> Bring the element to the front
|
|
419
842
|
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
843
|
+
* @apiCategory element
|
|
420
844
|
*/
|
|
421
845
|
frontElement(id: ID | ID[]): Promise<void>;
|
|
422
846
|
/**
|
|
@@ -425,6 +849,7 @@ export declare class Graph extends EventEmitter {
|
|
|
425
849
|
* <en/> Get element z-index
|
|
426
850
|
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
427
851
|
* @returns <zh/> 元素层级 | <en/> element z-index
|
|
852
|
+
* @apiCategory element
|
|
428
853
|
*/
|
|
429
854
|
getElementZIndex(id: ID): number;
|
|
430
855
|
/**
|
|
@@ -434,6 +859,7 @@ export declare class Graph extends EventEmitter {
|
|
|
434
859
|
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
435
860
|
* @param state - <zh/> 状态 | <en/> state
|
|
436
861
|
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
862
|
+
* @apiCategory element
|
|
437
863
|
*/
|
|
438
864
|
setElementState(id: ID, state: State | State[], animation?: boolean): Promise<void>;
|
|
439
865
|
/**
|
|
@@ -442,6 +868,7 @@ export declare class Graph extends EventEmitter {
|
|
|
442
868
|
* <en/> Batch set element state
|
|
443
869
|
* @param state - <zh/> 状态配置 | <en/> state configuration
|
|
444
870
|
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
871
|
+
* @apiCategory element
|
|
445
872
|
*/
|
|
446
873
|
setElementState(state: Record<ID, State | State[]>, animation?: boolean): Promise<void>;
|
|
447
874
|
/**
|
|
@@ -450,39 +877,97 @@ export declare class Graph extends EventEmitter {
|
|
|
450
877
|
* <en/> Get element state
|
|
451
878
|
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
452
879
|
* @returns <zh/> 元素状态 | <en/> element state
|
|
880
|
+
* @apiCategory element
|
|
453
881
|
*/
|
|
454
882
|
getElementState(id: ID): State[];
|
|
883
|
+
/**
|
|
884
|
+
* <zh/> 获取元素自身以及子节点在世界坐标系下的渲染包围盒
|
|
885
|
+
*
|
|
886
|
+
* <en/> Get the rendering bounding box of the element itself and its child nodes in the world coordinate system
|
|
887
|
+
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
888
|
+
* @returns <zh/> 渲染包围盒 | <en/> render bounding box
|
|
889
|
+
* @apiCategory element
|
|
890
|
+
*/
|
|
455
891
|
getElementRenderBounds(id: ID): AABB;
|
|
456
|
-
|
|
457
|
-
|
|
892
|
+
/**
|
|
893
|
+
* <zh/> 收起 Combo
|
|
894
|
+
*
|
|
895
|
+
* <en/> Collapse Combo
|
|
896
|
+
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
897
|
+
* @param animation - <zh/> 是否启用动画 | <en/> whether to enable animation
|
|
898
|
+
* @apiCategory element
|
|
899
|
+
*/
|
|
900
|
+
collapseElement(id: ID, animation?: boolean): Promise<void>;
|
|
901
|
+
/**
|
|
902
|
+
* <zh/> 展开 Combo
|
|
903
|
+
*
|
|
904
|
+
* <en/> Expand Combo
|
|
905
|
+
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
906
|
+
* @param animation - <zh/> 是否启用动画 | <en/> whether to enable animation
|
|
907
|
+
* @apiCategory element
|
|
908
|
+
*/
|
|
909
|
+
expandElement(id: ID, animation?: boolean): Promise<void>;
|
|
458
910
|
private setElementCollapsibility;
|
|
459
911
|
/**
|
|
460
912
|
* <zh/> 导出画布内容为 DataURL
|
|
461
913
|
*
|
|
462
914
|
* <en/> Export canvas content as DataURL
|
|
463
915
|
* @param options - <zh/> 导出配置 | <en/> export configuration
|
|
464
|
-
* @param mode
|
|
465
|
-
* <zh/> 导出模式
|
|
466
|
-
* - viewport: 导出视口内容
|
|
467
|
-
* - overall: 导出整个画布
|
|
468
|
-
*
|
|
469
|
-
* <en/> export mode
|
|
470
|
-
* - viewport: export the content of the viewport
|
|
471
|
-
* - overall: export the entire canvas
|
|
472
916
|
* @returns <zh/> DataURL | <en/> DataURL
|
|
917
|
+
* @apiCategory exportImage
|
|
473
918
|
*/
|
|
474
919
|
toDataURL(options?: Partial<DataURLOptions>): Promise<string>;
|
|
920
|
+
/**
|
|
921
|
+
* <zh/> 给定的视窗 DOM 坐标,转换为画布上的绘制坐标
|
|
922
|
+
*
|
|
923
|
+
* <en/> Convert the given viewport DOM coordinates to the drawing coordinates on the canvas
|
|
924
|
+
* @param point - <zh/> 视窗坐标 | <en/> viewport coordinates
|
|
925
|
+
* @returns <zh/> 画布上的绘制坐标 | <en/> drawing coordinates on the canvas
|
|
926
|
+
* @apiCategory viewport
|
|
927
|
+
*/
|
|
475
928
|
getCanvasByViewport(point: Point): Point;
|
|
929
|
+
/**
|
|
930
|
+
* <zh/> 给定画布上的绘制坐标,转换为视窗 DOM 的坐标
|
|
931
|
+
*
|
|
932
|
+
* <en/> Convert the given drawing coordinates on the canvas to the coordinates of the viewport DOM
|
|
933
|
+
* @param point - <zh/> 画布坐标 | <en/> canvas coordinates
|
|
934
|
+
* @returns <zh/> 视窗 DOM 的坐标 | <en/> coordinates of the viewport DOM
|
|
935
|
+
* @apiCategory viewport
|
|
936
|
+
*/
|
|
476
937
|
getViewportByCanvas(point: Point): Point;
|
|
938
|
+
/**
|
|
939
|
+
* <zh/> 给定画布上的绘制坐标,转换为浏览器坐标
|
|
940
|
+
*
|
|
941
|
+
* <en/> Convert the given drawing coordinates on the canvas to browser coordinates
|
|
942
|
+
* @param point - <zh/> 画布坐标 | <en/> canvas coordinates
|
|
943
|
+
* @returns <zh/> 浏览器坐标 | <en/> browser coordinates
|
|
944
|
+
* @apiCategory viewport
|
|
945
|
+
*/
|
|
477
946
|
getClientByCanvas(point: Point): Point;
|
|
947
|
+
/**
|
|
948
|
+
* <zh/> 给定的浏览器坐标,转换为画布上的绘制坐标
|
|
949
|
+
*
|
|
950
|
+
* <en/> Convert the given browser coordinates to drawing coordinates on the canvas
|
|
951
|
+
* @param point - <zh/> 浏览器坐标 | <en/> browser coordinates
|
|
952
|
+
* @returns <zh/> 画布上的绘制坐标 | <en/> drawing coordinates on the canvas
|
|
953
|
+
* @apiCategory viewport
|
|
954
|
+
*/
|
|
478
955
|
getCanvasByClient(point: Point): Point;
|
|
479
956
|
/**
|
|
480
957
|
* <zh/> 获取视口中心的画布坐标
|
|
481
958
|
*
|
|
482
959
|
* <en/> Get the canvas coordinates of the viewport center
|
|
483
960
|
* @returns <zh/> 视口中心的画布坐标 | <en/> Canvas coordinates of the viewport center
|
|
961
|
+
* @apiCategory viewport
|
|
484
962
|
*/
|
|
485
963
|
getViewportCenter(): Point;
|
|
964
|
+
/**
|
|
965
|
+
* <zh/> 获取画布中心的画布坐标
|
|
966
|
+
*
|
|
967
|
+
* <en/> Get the canvas coordinates of the canvas center
|
|
968
|
+
* @returns <zh/> 画布中心的画布坐标 | <en/> Canvas coordinates of the canvas center
|
|
969
|
+
* @apiCategory viewport
|
|
970
|
+
*/
|
|
486
971
|
getCanvasCenter(): Point;
|
|
487
972
|
private onResize;
|
|
488
973
|
/**
|
|
@@ -492,6 +977,7 @@ export declare class Graph extends EventEmitter {
|
|
|
492
977
|
* @param eventName - <zh/> 事件名称 | <en/> event name
|
|
493
978
|
* @param callback - <zh/> 回调函数 | <en/> callback function
|
|
494
979
|
* @returns <zh/> Graph 实例 | <en/> Graph instance
|
|
980
|
+
* @apiCategory event
|
|
495
981
|
*/
|
|
496
982
|
on<T extends IEvent = IEvent>(eventName: string, callback: (event: T) => void): this;
|
|
497
983
|
/**
|
|
@@ -501,6 +987,7 @@ export declare class Graph extends EventEmitter {
|
|
|
501
987
|
* @param eventName - <zh/> 事件名称 | <en/> event name
|
|
502
988
|
* @param callback - <zh/> 回调函数 | <en/> callback function
|
|
503
989
|
* @returns <zh/> Graph 实例 | <en/> Graph instance
|
|
990
|
+
* @apiCategory event
|
|
504
991
|
*/
|
|
505
992
|
once<T extends IEvent = IEvent>(eventName: string, callback: (event: T) => void): this;
|
|
506
993
|
}
|