@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,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GraphOptions } from '../spec';
|
|
2
2
|
import type { BatchController } from './batch';
|
|
3
3
|
import type { BehaviorController } from './behavior';
|
|
4
4
|
import type { Canvas } from './canvas';
|
|
@@ -27,7 +27,7 @@ export interface RuntimeContext {
|
|
|
27
27
|
*
|
|
28
28
|
* <en/> G6 options
|
|
29
29
|
*/
|
|
30
|
-
options:
|
|
30
|
+
options: GraphOptions;
|
|
31
31
|
/**
|
|
32
32
|
* <zh/> 数据模型
|
|
33
33
|
*
|
|
@@ -44,7 +44,7 @@ export interface RuntimeContext {
|
|
|
44
44
|
* <zh/> 元素控制器
|
|
45
45
|
*
|
|
46
46
|
* <en/> Element controller
|
|
47
|
-
* @
|
|
47
|
+
* @remarks
|
|
48
48
|
* <zh/> 仅在绘制开始后才可用
|
|
49
49
|
*
|
|
50
50
|
* <en/> Only available after drawing starts
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { AABB } from '@antv/g';
|
|
2
|
-
import type { ID } from '
|
|
3
|
-
import type { FitViewOptions, Point, TransformOptions, ViewportAnimationEffectTiming } from '../types';
|
|
2
|
+
import type { FitViewOptions, ID, Point, TransformOptions, ViewportAnimationEffectTiming } from '../types';
|
|
4
3
|
import type { RuntimeContext } from './types';
|
|
5
4
|
export declare class ViewportController {
|
|
6
5
|
private context;
|
|
@@ -17,7 +16,7 @@ export declare class ViewportController {
|
|
|
17
16
|
*
|
|
18
17
|
* <en/> Get the center coordinates of the canvas
|
|
19
18
|
* @returns - <zh/> 画布中心坐标 | <en/> Center coordinates of the canvas
|
|
20
|
-
* @
|
|
19
|
+
* @remarks
|
|
21
20
|
* <zh/> 基于画布的宽高计算中心坐标,不受视口变换影响
|
|
22
21
|
*
|
|
23
22
|
* <en/> Calculate the center coordinates based on the width and height of the canvas, not affected by the viewport transformation
|
|
@@ -28,7 +27,7 @@ export declare class ViewportController {
|
|
|
28
27
|
*
|
|
29
28
|
* <en/> Current viewport center coordinates
|
|
30
29
|
* @returns - <zh/> 视口中心坐标 | <en/> Viewport center coordinates
|
|
31
|
-
* @
|
|
30
|
+
* @remarks
|
|
32
31
|
* <zh/> 以画布原点为原点,受到视口变换影响
|
|
33
32
|
*
|
|
34
33
|
* <en/> With the origin of the canvas as the origin, affected by the viewport transformation
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { CanvasConfig, IRenderer } from '@antv/g';
|
|
2
2
|
import type { Canvas } from '../runtime/canvas';
|
|
3
|
-
import type { CanvasLayer } from '../types/canvas';
|
|
4
3
|
/**
|
|
5
4
|
* <zh/> 画布配置项
|
|
6
5
|
*
|
|
@@ -8,6 +7,11 @@ import type { CanvasLayer } from '../types/canvas';
|
|
|
8
7
|
* @public
|
|
9
8
|
*/
|
|
10
9
|
export interface CanvasOptions extends Pick<CanvasConfig, 'devicePixelRatio'> {
|
|
10
|
+
/**
|
|
11
|
+
* <zh/> 画布容器
|
|
12
|
+
*
|
|
13
|
+
* <en/> canvas container
|
|
14
|
+
*/
|
|
11
15
|
container?: string | HTMLElement | Canvas;
|
|
12
16
|
/**
|
|
13
17
|
* <zh/> 画布宽度
|
|
@@ -26,7 +30,7 @@ export interface CanvasOptions extends Pick<CanvasConfig, 'devicePixelRatio'> {
|
|
|
26
30
|
*
|
|
27
31
|
* <en/> get renderer
|
|
28
32
|
*/
|
|
29
|
-
renderer?: (layer:
|
|
33
|
+
renderer?: (layer: 'background' | 'main' | 'label' | 'transient') => IRenderer;
|
|
30
34
|
/**
|
|
31
35
|
* <zh/> 是否自动调整画布大小
|
|
32
36
|
*
|
package/dist/lib/spec/data.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ID } from '
|
|
1
|
+
import type { ID } from '../types';
|
|
2
2
|
import type { ComboStyle } from './element/combo';
|
|
3
3
|
import type { EdgeStyle } from './element/edge';
|
|
4
4
|
import type { NodeStyle } from './element/node';
|
|
@@ -23,22 +23,95 @@ export interface GraphData {
|
|
|
23
23
|
combos?: ComboData[];
|
|
24
24
|
}
|
|
25
25
|
export interface NodeData {
|
|
26
|
+
/**
|
|
27
|
+
* <zh/> 节点 ID
|
|
28
|
+
*
|
|
29
|
+
* <en/> Node ID
|
|
30
|
+
*/
|
|
26
31
|
id: ID;
|
|
32
|
+
/**
|
|
33
|
+
* <zh/> 节点类型
|
|
34
|
+
*
|
|
35
|
+
* <en/> Node type
|
|
36
|
+
*/
|
|
37
|
+
type?: string;
|
|
38
|
+
/**
|
|
39
|
+
* <zh/> 节点数据
|
|
40
|
+
*
|
|
41
|
+
* <en/> Node data
|
|
42
|
+
*/
|
|
27
43
|
data?: Record<string, unknown>;
|
|
44
|
+
/**
|
|
45
|
+
* <zh/> 节点样式
|
|
46
|
+
*
|
|
47
|
+
* <en/> Node style
|
|
48
|
+
*/
|
|
28
49
|
style?: NodeStyle;
|
|
29
50
|
[key: string]: unknown;
|
|
30
51
|
}
|
|
31
52
|
export interface ComboData {
|
|
53
|
+
/**
|
|
54
|
+
* <zh/> Combo ID
|
|
55
|
+
*
|
|
56
|
+
* <en/> Combo ID
|
|
57
|
+
*/
|
|
32
58
|
id: ID;
|
|
59
|
+
/**
|
|
60
|
+
* <zh/> Combo 类型
|
|
61
|
+
*
|
|
62
|
+
* <en/> Combo type
|
|
63
|
+
*/
|
|
64
|
+
type?: string;
|
|
65
|
+
/**
|
|
66
|
+
* <zh/> Combo 数据
|
|
67
|
+
*
|
|
68
|
+
* <en/> Combo data
|
|
69
|
+
*/
|
|
33
70
|
data?: Record<string, unknown>;
|
|
71
|
+
/**
|
|
72
|
+
* <zh/> Combo 样式
|
|
73
|
+
*
|
|
74
|
+
* <en/> Combo style
|
|
75
|
+
*/
|
|
34
76
|
style?: ComboStyle;
|
|
35
77
|
[key: string]: unknown;
|
|
36
78
|
}
|
|
37
79
|
export interface EdgeData {
|
|
80
|
+
/**
|
|
81
|
+
* <zh/> 边 ID
|
|
82
|
+
*
|
|
83
|
+
* <en/> Edge ID
|
|
84
|
+
*/
|
|
38
85
|
id?: ID;
|
|
86
|
+
/**
|
|
87
|
+
* <zh/> 边源节点 ID
|
|
88
|
+
*
|
|
89
|
+
* <en/> Source node ID
|
|
90
|
+
*/
|
|
39
91
|
source: ID;
|
|
92
|
+
/**
|
|
93
|
+
* <zh/> 边目标节点 ID
|
|
94
|
+
*
|
|
95
|
+
* <en/> Target node ID
|
|
96
|
+
*/
|
|
40
97
|
target: ID;
|
|
98
|
+
/**
|
|
99
|
+
* <zh/> 边类型
|
|
100
|
+
*
|
|
101
|
+
* <en/> Edge type
|
|
102
|
+
*/
|
|
103
|
+
type?: string;
|
|
104
|
+
/**
|
|
105
|
+
* <zh/> 边数据
|
|
106
|
+
*
|
|
107
|
+
* <en/> Edge data
|
|
108
|
+
*/
|
|
41
109
|
data?: Record<string, unknown>;
|
|
110
|
+
/**
|
|
111
|
+
* <zh/> 边样式
|
|
112
|
+
*
|
|
113
|
+
* <en/> Edge style
|
|
114
|
+
*/
|
|
42
115
|
style?: EdgeStyle;
|
|
43
116
|
[key: string]: unknown;
|
|
44
117
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type { ID } from '@antv/graphlib';
|
|
2
1
|
import type { BaseComboStyleProps } from '../../elements/combos';
|
|
2
|
+
import type { ID, State } from '../../types';
|
|
3
3
|
import type { CallableObject } from '../../types/callable';
|
|
4
|
-
import type {
|
|
4
|
+
import type { ComboData } from '../data';
|
|
5
5
|
import type { AnimationOptions } from './animation';
|
|
6
|
-
import type { BaseElementStyle } from './base';
|
|
7
6
|
import type { PaletteOptions } from './palette';
|
|
8
7
|
/**
|
|
9
8
|
* <zh/> Combo 配置项
|
|
@@ -11,18 +10,24 @@ import type { PaletteOptions } from './palette';
|
|
|
11
10
|
* <en/> Combo spec
|
|
12
11
|
*/
|
|
13
12
|
export interface ComboOptions {
|
|
13
|
+
/**
|
|
14
|
+
* <zh/> Combo 类型
|
|
15
|
+
*
|
|
16
|
+
* <en/> Combo type
|
|
17
|
+
*/
|
|
18
|
+
type?: string | ((datum: ComboData) => string);
|
|
14
19
|
/**
|
|
15
20
|
* <zh/> Combo 样式
|
|
16
21
|
*
|
|
17
22
|
* <en/> Combo style
|
|
18
23
|
*/
|
|
19
|
-
style?: CallableObject<ComboStyle,
|
|
24
|
+
style?: CallableObject<ComboStyle, ComboData>;
|
|
20
25
|
/**
|
|
21
26
|
* <zh/> Combo 状态样式
|
|
22
27
|
*
|
|
23
28
|
* <en/> Combo state style
|
|
24
29
|
*/
|
|
25
|
-
state?: Record<string, CallableObject<ComboStyle,
|
|
30
|
+
state?: Record<string, CallableObject<ComboStyle, ComboData>>;
|
|
26
31
|
/**
|
|
27
32
|
* <zh/> Combo 动画
|
|
28
33
|
*
|
|
@@ -42,7 +47,13 @@ export interface StaticComboOptions {
|
|
|
42
47
|
animation?: AnimationOptions;
|
|
43
48
|
palette?: PaletteOptions;
|
|
44
49
|
}
|
|
45
|
-
export interface ComboStyle extends
|
|
50
|
+
export interface ComboStyle extends Partial<BaseComboStyleProps> {
|
|
51
|
+
/**
|
|
52
|
+
* <zh/> 初始状态
|
|
53
|
+
*
|
|
54
|
+
* <en/> Initial state
|
|
55
|
+
*/
|
|
56
|
+
states?: State[];
|
|
46
57
|
children?: ID[];
|
|
47
58
|
[key: string]: any;
|
|
48
59
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { BaseEdgeStyleProps } from '../../elements/edges';
|
|
2
|
+
import { State } from '../../types';
|
|
2
3
|
import type { CallableObject } from '../../types/callable';
|
|
3
4
|
import type { EdgeData } from '../data';
|
|
4
5
|
import type { AnimationOptions } from './animation';
|
|
5
|
-
import type { BaseElementStyle } from './base';
|
|
6
6
|
import type { PaletteOptions } from './palette';
|
|
7
7
|
/**
|
|
8
8
|
* <zh/> 边配置项
|
|
@@ -10,6 +10,12 @@ import type { PaletteOptions } from './palette';
|
|
|
10
10
|
* <en/> Edge spec
|
|
11
11
|
*/
|
|
12
12
|
export interface EdgeOptions {
|
|
13
|
+
/**
|
|
14
|
+
* <zh/> 边类型
|
|
15
|
+
*
|
|
16
|
+
* <en/> Edge type
|
|
17
|
+
*/
|
|
18
|
+
type?: string | ((datum: EdgeData) => string);
|
|
13
19
|
/**
|
|
14
20
|
* <zh/> 边样式
|
|
15
21
|
*
|
|
@@ -41,6 +47,12 @@ export interface StaticEdgeOptions {
|
|
|
41
47
|
animation?: AnimationOptions;
|
|
42
48
|
palette?: PaletteOptions;
|
|
43
49
|
}
|
|
44
|
-
export interface EdgeStyle extends
|
|
50
|
+
export interface EdgeStyle extends Partial<BaseEdgeStyleProps> {
|
|
51
|
+
/**
|
|
52
|
+
* <zh/> 初始状态
|
|
53
|
+
*
|
|
54
|
+
* <en/> Initial state
|
|
55
|
+
*/
|
|
56
|
+
states?: State[];
|
|
45
57
|
[key: string]: any;
|
|
46
58
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type { ID } from '@antv/graphlib';
|
|
2
1
|
import type { BaseNodeStyleProps } from '../../elements/nodes';
|
|
2
|
+
import type { ID, State } from '../../types';
|
|
3
3
|
import type { CallableObject } from '../../types/callable';
|
|
4
4
|
import type { NodeData } from '../data';
|
|
5
5
|
import type { AnimationOptions } from './animation';
|
|
6
|
-
import type { BaseElementStyle } from './base';
|
|
7
6
|
import type { PaletteOptions } from './palette';
|
|
8
7
|
/**
|
|
9
8
|
* <zh/> 节点配置项
|
|
@@ -11,6 +10,12 @@ import type { PaletteOptions } from './palette';
|
|
|
11
10
|
* <en/> Node spec
|
|
12
11
|
*/
|
|
13
12
|
export interface NodeOptions {
|
|
13
|
+
/**
|
|
14
|
+
* <zh/> 节点类型
|
|
15
|
+
*
|
|
16
|
+
* <en/> Node type
|
|
17
|
+
*/
|
|
18
|
+
type?: string | ((datum: NodeData) => string);
|
|
14
19
|
/**
|
|
15
20
|
* <zh/> 节点样式
|
|
16
21
|
*
|
|
@@ -42,7 +47,18 @@ export interface StaticNodeOptions {
|
|
|
42
47
|
animation?: AnimationOptions;
|
|
43
48
|
palette?: PaletteOptions;
|
|
44
49
|
}
|
|
45
|
-
export interface NodeStyle extends
|
|
50
|
+
export interface NodeStyle extends Partial<BaseNodeStyleProps> {
|
|
51
|
+
/**
|
|
52
|
+
* <zh/> 初始状态
|
|
53
|
+
*
|
|
54
|
+
* <en/> Initial state
|
|
55
|
+
*/
|
|
56
|
+
states?: State[];
|
|
57
|
+
/**
|
|
58
|
+
* <zh/> 子节点 ID (树图专用)
|
|
59
|
+
*
|
|
60
|
+
* <en/> Child node ID (for tree graph)
|
|
61
|
+
*/
|
|
46
62
|
children?: ID[];
|
|
47
63
|
[key: string]: any;
|
|
48
64
|
}
|
|
@@ -11,16 +11,24 @@ import type { ThemeOptions } from './theme';
|
|
|
11
11
|
import type { TransformOptions } from './transform';
|
|
12
12
|
import type { ViewportOptions } from './viewport';
|
|
13
13
|
/**
|
|
14
|
-
* <zh/>
|
|
14
|
+
* <zh/> Graph 配置项
|
|
15
15
|
*
|
|
16
|
-
* <en/>
|
|
16
|
+
* <en/> Graph options
|
|
17
|
+
* @remarks
|
|
18
|
+
* <zh/> Graph 的初始化通过 `new` 进行实例化,实例化时需要传入需要的参数。目前所支持的参数如下:
|
|
19
|
+
*
|
|
20
|
+
* <en/> The initialization of Graph is instantiated through `new`, and the required parameters need to be passed in when instantiated.
|
|
21
|
+
*
|
|
22
|
+
* ```
|
|
23
|
+
* new G6.Graph(options: GraphOptions) => Graph
|
|
24
|
+
* ```
|
|
17
25
|
*/
|
|
18
|
-
export interface
|
|
26
|
+
export interface GraphOptions extends CanvasOptions, ViewportOptions {
|
|
19
27
|
/**
|
|
20
28
|
* <zh/> 启用关闭、全局动画
|
|
21
29
|
*
|
|
22
30
|
* <en/> Enable or disable global animation
|
|
23
|
-
* @
|
|
31
|
+
* @remarks
|
|
24
32
|
* <zh/> 为动画配置项时,会启用动画,并将该动画配置作为全局动画的基础配置
|
|
25
33
|
*
|
|
26
34
|
* <en/> When it is an animation configuration item, the animation will be enabled, and the animation configuration will be used as the basic configuration of the global animation
|
package/dist/lib/spec/index.d.ts
CHANGED
|
@@ -4,9 +4,9 @@ export type { ComboData, EdgeData, GraphData, NodeData } from './data';
|
|
|
4
4
|
export type { ComboOptions } from './element/combo';
|
|
5
5
|
export type { EdgeOptions } from './element/edge';
|
|
6
6
|
export type { NodeOptions } from './element/node';
|
|
7
|
+
export type { GraphOptions } from './graph';
|
|
7
8
|
export type { LayoutOptions } from './layout';
|
|
8
9
|
export type { PluginOptions } from './plugin';
|
|
9
|
-
export type { G6Spec } from './spec';
|
|
10
10
|
export type { ThemeOptions } from './theme';
|
|
11
11
|
export type { TransformOptions } from './transform';
|
|
12
12
|
export type { ViewportOptions } from './viewport';
|
package/dist/lib/spec/theme.d.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import type { BuiltInTheme } from '../themes/types';
|
|
2
1
|
/**
|
|
3
2
|
* <zh/> 主题配置项
|
|
4
3
|
*
|
|
5
4
|
* <en/> Theme Options
|
|
6
5
|
* @public
|
|
7
6
|
*/
|
|
8
|
-
export type ThemeOptions =
|
|
9
|
-
type CustomTheme = string;
|
|
10
|
-
export {};
|
|
7
|
+
export type ThemeOptions = 'light' | 'dark' | string;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { StaticComboOptions } from '../spec/element/combo';
|
|
2
2
|
import type { StaticEdgeOptions } from '../spec/element/edge';
|
|
3
3
|
import type { StaticNodeOptions } from '../spec/element/node';
|
|
4
|
-
export type BuiltInTheme = 'light' | 'dark';
|
|
5
4
|
export type Theme = {
|
|
6
5
|
node?: StaticNodeOptions;
|
|
7
6
|
edge?: StaticEdgeOptions;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { PathStyleProps } from '@antv/g';
|
|
2
|
-
import type { ID } from '@antv/graphlib';
|
|
3
2
|
import type { RuntimeContext } from '../runtime/types';
|
|
4
3
|
import type { EdgeData } from '../spec';
|
|
5
|
-
import type { ElementDatum, ElementType } from '../types';
|
|
4
|
+
import type { ElementDatum, ElementType, ID } from '../types';
|
|
6
5
|
import type { BaseTransformOptions } from './base-transform';
|
|
7
6
|
import { BaseTransform } from './base-transform';
|
|
8
7
|
import type { DrawData } from './types';
|
|
@@ -11,7 +10,7 @@ export interface ProcessParallelEdgesOptions extends BaseTransformOptions {
|
|
|
11
10
|
* <zh/> 处理模式,默认为捆绑
|
|
12
11
|
*
|
|
13
12
|
* <en/> Processing mode, default is bundle
|
|
14
|
-
* @
|
|
13
|
+
* @remarks
|
|
15
14
|
* <zh/>
|
|
16
15
|
* - merge: 将平行边合并为一条边,适用于不需要区分平行边的情况
|
|
17
16
|
* - bundle: 每条边都会与其他所有平行边捆绑在一起,并通过改变曲率与其他边分开。如果一组平行边的数量是奇数,那么中心的边将被绘制为直线,其他的边将被绘制为曲线
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ID } from '@antv/graphlib';
|
|
2
1
|
import type { ComboData, EdgeData, NodeData } from '../spec';
|
|
2
|
+
import type { ID } from '../types';
|
|
3
3
|
import type { BaseTransform, BaseTransformOptions } from './base-transform';
|
|
4
4
|
export type BuiltInTransformOptions = BaseTransformOptions;
|
|
5
5
|
export type Transform = BaseTransform<any>;
|
|
@@ -25,6 +25,6 @@ export type CallableValue<Returns, Param = Returns> = Returns | ((args: Param) =
|
|
|
25
25
|
* fill: ({ model }) => model.value,
|
|
26
26
|
* }
|
|
27
27
|
*/
|
|
28
|
-
export type CallableObject<Obj extends Record<string, unknown>, T> = ((datum: T
|
|
29
|
-
[K in keyof Obj]: Obj[K] | ((datum: T
|
|
28
|
+
export type CallableObject<Obj extends Record<string, unknown>, T> = ((datum: T) => Obj) | {
|
|
29
|
+
[K in keyof Obj]: Obj[K] | ((datum: T) => NonNullable<Obj[K]>);
|
|
30
30
|
};
|
package/dist/lib/types/data.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ID } from '@antv/graphlib';
|
|
2
1
|
import type { ComboData, EdgeData, NodeData } from '../spec/data';
|
|
2
|
+
import type { ID } from '../types';
|
|
3
3
|
export type DataID = {
|
|
4
4
|
nodes?: ID[];
|
|
5
5
|
edges?: ID[];
|
|
@@ -12,7 +12,7 @@ export type ElementData = NodeData[] | EdgeData[] | ComboData[];
|
|
|
12
12
|
* <zh/> 节点、边更新可选数据
|
|
13
13
|
*
|
|
14
14
|
* <en/> Node, edge update optional data
|
|
15
|
-
* @
|
|
15
|
+
* @remarks
|
|
16
16
|
* <zh/> 必须包含 id 字段,其他字段可选
|
|
17
17
|
*
|
|
18
18
|
* <en/> Must contain the id field, other fields are optional
|
|
@@ -22,7 +22,7 @@ export type PartialNodeLikeData<T extends NodeLikeData> = Partial<T> & Pick<T, '
|
|
|
22
22
|
* <zh/> 边更新可选数据
|
|
23
23
|
*
|
|
24
24
|
* <en/> Edge update optional data
|
|
25
|
-
* @
|
|
25
|
+
* @remarks
|
|
26
26
|
* <zh/> 包含两种情况:
|
|
27
27
|
* 1. 必须包含 source、target 字段,其他字段可选
|
|
28
28
|
* 2. 必须包含 id 字段,其他字段可选
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ID = string;
|
|
@@ -9,6 +9,7 @@ export type * from './element';
|
|
|
9
9
|
export type * from './enum';
|
|
10
10
|
export type * from './event';
|
|
11
11
|
export type * from './graphlib';
|
|
12
|
+
export type * from './id';
|
|
12
13
|
export type * from './node';
|
|
13
14
|
export type * from './padding';
|
|
14
15
|
export type * from './placement';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ElementDatum } from './data';
|
|
2
2
|
/**
|
|
3
3
|
* <zh/> 样式计算迭代上下文
|
|
4
4
|
*
|
|
@@ -6,6 +6,4 @@ import type { ElementData, ElementDatum } from './data';
|
|
|
6
6
|
*/
|
|
7
7
|
export type StyleIterationContext = {
|
|
8
8
|
datum: ElementDatum;
|
|
9
|
-
index: number;
|
|
10
|
-
elementData: ElementData;
|
|
11
9
|
};
|
|
@@ -3,14 +3,14 @@ export type ViewportAnimationEffectTiming = boolean | {
|
|
|
3
3
|
easing?: string;
|
|
4
4
|
duration?: number;
|
|
5
5
|
};
|
|
6
|
-
export
|
|
6
|
+
export interface TransformOptions {
|
|
7
7
|
mode: ViewportChangeMode;
|
|
8
8
|
origin?: Point;
|
|
9
9
|
translate?: Point;
|
|
10
10
|
rotate?: number;
|
|
11
11
|
scale?: number;
|
|
12
|
-
}
|
|
13
|
-
export
|
|
12
|
+
}
|
|
13
|
+
export interface FitViewOptions {
|
|
14
14
|
/**
|
|
15
15
|
* <zh/> 在以下情况下进行适配
|
|
16
16
|
* - 'overflow' 仅当图内容超出视口时进行适配
|
|
@@ -33,6 +33,6 @@ export type FitViewOptions = {
|
|
|
33
33
|
* - 'both' Adapt to the x and y directions
|
|
34
34
|
*/
|
|
35
35
|
direction?: 'x' | 'y' | 'both';
|
|
36
|
-
}
|
|
36
|
+
}
|
|
37
37
|
type ViewportChangeMode = 'relative' | 'absolute';
|
|
38
38
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DisplayObject, IAnimation } from '@antv/g';
|
|
2
|
-
import type {
|
|
2
|
+
import type { GraphOptions } from '../spec';
|
|
3
3
|
import type { AnimatableTask, Keyframe } from '../types';
|
|
4
4
|
export declare function createAnimationsProxy(animations: IAnimation[]): IAnimation | null;
|
|
5
5
|
export declare function createAnimationsProxy(sourceAnimation: IAnimation, targetAnimations: IAnimation[]): IAnimation;
|
|
@@ -19,7 +19,7 @@ export declare function preprocessKeyframes(keyframes: Keyframe[]): Keyframe[];
|
|
|
19
19
|
* @param keyframes - <zh/> 动画关键帧 | <en/> keyframes of the animation
|
|
20
20
|
* @param options - <zh/> 动画配置项 | <en/> animation options
|
|
21
21
|
* @returns <zh/> 动画对象 | <en/> animation object
|
|
22
|
-
* @
|
|
22
|
+
* @remarks
|
|
23
23
|
* <zh/> 在设置 enableCSSParsing 为 false 后,复合图形无法继承父属性,因此对于一些需要继承父属性的动画,需要对所有子图形执行相同的动画
|
|
24
24
|
*
|
|
25
25
|
* <en/> After setting enableCSSParsing to false, the compound shape cannot inherit the parent attribute, so for some animations that need to inherit the parent attribute, the same animation needs to be performed on all child shapes
|
|
@@ -31,12 +31,12 @@ export declare function executeAnimation<T extends DisplayObject>(shape: T, keyf
|
|
|
31
31
|
* <en/> Get default value of attribute
|
|
32
32
|
* @param name - <zh/> 属性名 | <en/> Attribute name
|
|
33
33
|
* @returns <zh/> 属性默认值 | <en/> Attribute default value
|
|
34
|
-
* @
|
|
34
|
+
* @remarks
|
|
35
35
|
* <zh/> 执行动画过程中,一些属性没有显式指定属性值,但实际上在 G 中存在属性值,因此通过该方法获取其实际默认值
|
|
36
36
|
*
|
|
37
37
|
* <en/> During the animation, some attributes do not explicitly specify the attribute value, but in fact there is an attribute value in G, so use this method to get the actual default value
|
|
38
38
|
*/
|
|
39
|
-
export declare function inferDefaultValue(name: string): false | 1 |
|
|
39
|
+
export declare function inferDefaultValue(name: string): false | 1 | "visible" | 0 | never[] | undefined;
|
|
40
40
|
type Callbacks = {
|
|
41
41
|
before?: () => void;
|
|
42
42
|
beforeAnimate?: (result: IAnimation) => void;
|
|
@@ -51,7 +51,7 @@ type Callbacks = {
|
|
|
51
51
|
* @param callbacks - <zh/> 回调函数 | <en/> callback function
|
|
52
52
|
* @returns <zh/> 动画对象 | <en/> animation object
|
|
53
53
|
*/
|
|
54
|
-
export declare function withAnimationCallbacks(animation: IAnimation | null, callbacks: Callbacks): IAnimation | null;
|
|
54
|
+
export declare function withAnimationCallbacks(animation: IAnimation | null | undefined, callbacks: Callbacks): IAnimation | null;
|
|
55
55
|
/**
|
|
56
56
|
* <zh/> 执行动画任务
|
|
57
57
|
*
|
|
@@ -69,5 +69,5 @@ export declare function executeAnimatableTasks(tasks: AnimatableTask[], callback
|
|
|
69
69
|
* @param localAnimation - <zh/> 局部动画配置 | <en/> local animation configuration
|
|
70
70
|
* @returns <zh/> 动画配置 | <en/> animation configuration
|
|
71
71
|
*/
|
|
72
|
-
export declare function getAnimation(options:
|
|
72
|
+
export declare function getAnimation(options: GraphOptions, localAnimation: boolean | EffectTiming | undefined): false | EffectTiming;
|
|
73
73
|
export {};
|
package/dist/lib/utils/data.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type { ComboData, EdgeData, GraphData, NodeData } from '../spec';
|
|
|
6
6
|
* @param original - <zh/> 原始数据 | <en/> original data
|
|
7
7
|
* @param modified - <zh/> 待合并的数据 | <en/> data to be merged
|
|
8
8
|
* @returns <zh/> 合并后的数据 | <en/> merged data
|
|
9
|
-
* @
|
|
9
|
+
* @remarks
|
|
10
10
|
* <zh/> 只会合并第一层的数据,data、style 下的二级数据会被覆盖
|
|
11
11
|
*
|
|
12
12
|
* <en/> Only the first level of data will be merged, the second level of data under data and style will be overwritten
|
|
@@ -18,7 +18,7 @@ export declare function mergeElementsData<T extends NodeData | EdgeData | ComboD
|
|
|
18
18
|
* <en/> Clone clement data
|
|
19
19
|
* @param data - <zh/> 待克隆的数据 | <en/> data to be cloned
|
|
20
20
|
* @returns <zh/> 克隆后的数据 | <en/> cloned data
|
|
21
|
-
* @
|
|
21
|
+
* @remarks
|
|
22
22
|
* <zh/> 只会克隆到第二层(data、style)
|
|
23
23
|
*
|
|
24
24
|
* <en/> Only clone to the second level (data, style)
|
package/dist/lib/utils/edge.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { AABB } from '@antv/g';
|
|
2
|
-
import type { ID } from '@antv/graphlib';
|
|
3
2
|
import type { PathArray } from '@antv/util';
|
|
4
3
|
import type { EdgeData } from '../spec';
|
|
5
|
-
import type { EdgeKey, EdgeLabelPlacement, EdgeLabelStyleProps, LoopPlacement, Node, Point, Port } from '../types';
|
|
4
|
+
import type { EdgeKey, EdgeLabelPlacement, EdgeLabelStyleProps, ID, LoopPlacement, Node, Point, Port } from '../types';
|
|
6
5
|
/**
|
|
7
6
|
* <zh/> 获取标签的位置样式
|
|
8
7
|
*
|
|
@@ -92,7 +92,7 @@ export declare function findPorts(sourceNode: Node, targetNode: Node, sourcePort
|
|
|
92
92
|
* <zh/> 查找节点上的最有可能连接的连接桩
|
|
93
93
|
*
|
|
94
94
|
* <en/> Find the most likely connected port on the node
|
|
95
|
-
* @
|
|
95
|
+
* @remarks
|
|
96
96
|
* 1. If `portKey` is specified, return the port.
|
|
97
97
|
* 2. If `portKey` is not specified, return the port closest to the opposite connection points.
|
|
98
98
|
* 3. If the node has no ports, return undefined.
|
|
@@ -7,7 +7,7 @@ export declare class BaseEvent {
|
|
|
7
7
|
}
|
|
8
8
|
export declare class GraphLifeCycleEvent extends BaseEvent implements IGraphLifeCycleEvent {
|
|
9
9
|
data?: any;
|
|
10
|
-
constructor(type: GraphEvent.BEFORE_RENDER | GraphEvent.AFTER_RENDER | GraphEvent.BEFORE_DRAW | GraphEvent.AFTER_DRAW | GraphEvent.BEFORE_LAYOUT | GraphEvent.AFTER_LAYOUT | GraphEvent.BEFORE_SIZE_CHANGE | GraphEvent.AFTER_SIZE_CHANGE | GraphEvent.BATCH_START | GraphEvent.BATCH_END, data?: any);
|
|
10
|
+
constructor(type: GraphEvent.BEFORE_RENDER | GraphEvent.AFTER_RENDER | GraphEvent.BEFORE_DRAW | GraphEvent.AFTER_DRAW | GraphEvent.BEFORE_LAYOUT | GraphEvent.AFTER_LAYOUT | GraphEvent.BEFORE_SIZE_CHANGE | GraphEvent.AFTER_SIZE_CHANGE | GraphEvent.BATCH_START | GraphEvent.BATCH_END | GraphEvent.BEFORE_DESTROY | GraphEvent.AFTER_DESTROY, data?: any);
|
|
11
11
|
}
|
|
12
12
|
export declare class AnimateEvent extends BaseEvent implements IAnimateEvent {
|
|
13
13
|
animationType: AnimationType;
|
|
@@ -18,7 +18,7 @@ export declare function emit(emitter: EventEmitter, event: BaseEvent): void;
|
|
|
18
18
|
* <en/> Get the event target element
|
|
19
19
|
* @param shape - <zh/> 事件图形 | <en/> event shape
|
|
20
20
|
* @returns <zh/> 目标元素 | <en/> target element
|
|
21
|
-
* @
|
|
21
|
+
* @remarks
|
|
22
22
|
* <zh/> 事件响应大多数情况会命中元素的内部图形,通过该方法可以获取到其所属元素
|
|
23
23
|
*
|
|
24
24
|
* <en/> Most of the event responses will hit the internal graphics of the element, and this method can be used to get the element to which it belongs
|