@antv/g6 5.0.19 → 5.0.21
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/behaviors/base-behavior.d.ts +10 -0
- package/dist/lib/behaviors/drag-canvas.d.ts +9 -0
- package/dist/lib/behaviors/hover-activate.d.ts +16 -2
- package/dist/lib/behaviors/scroll-canvas.d.ts +9 -0
- package/dist/lib/elements/combos/circle.d.ts +1 -1
- package/dist/lib/elements/edges/cubic-radial.d.ts +24 -0
- package/dist/lib/elements/edges/index.d.ts +2 -0
- package/dist/lib/elements/edges/line.d.ts +0 -2
- package/dist/lib/elements/nodes/base-node.d.ts +2 -1
- package/dist/lib/elements/nodes/circle.d.ts +1 -1
- package/dist/lib/elements/nodes/ellipse.d.ts +1 -1
- package/dist/lib/elements/shapes/base-shape.d.ts +29 -14
- package/dist/lib/elements/shapes/polygon.d.ts +1 -1
- package/dist/lib/exports.d.ts +9 -7
- package/dist/lib/layouts/base-layout.d.ts +5 -0
- package/dist/lib/plugins/background/index.d.ts +1 -0
- package/dist/lib/plugins/base-plugin.d.ts +5 -0
- package/dist/lib/plugins/bubble-sets.d.ts +1 -0
- package/dist/lib/plugins/contextmenu/index.d.ts +1 -0
- package/dist/lib/plugins/grid-line.d.ts +1 -0
- package/dist/lib/plugins/history/index.d.ts +1 -0
- package/dist/lib/plugins/hull/index.d.ts +1 -0
- package/dist/lib/plugins/legend.d.ts +1 -0
- package/dist/lib/plugins/minimap/index.d.ts +8 -2
- package/dist/lib/plugins/snapline/index.d.ts +10 -0
- package/dist/lib/plugins/timebar.d.ts +1 -0
- package/dist/lib/plugins/toolbar/index.d.ts +1 -0
- package/dist/lib/plugins/tooltip.d.ts +11 -0
- package/dist/lib/plugins/watermark/index.d.ts +1 -0
- package/dist/lib/runtime/data.d.ts +1 -0
- package/dist/lib/runtime/element.d.ts +1 -0
- package/dist/lib/runtime/graph.d.ts +2 -0
- package/dist/lib/runtime/layout.d.ts +1 -0
- package/dist/lib/transforms/base-transform.d.ts +6 -0
- package/dist/lib/transforms/index.d.ts +3 -0
- package/dist/lib/transforms/position-radial-labels.d.ts +27 -0
- package/dist/lib/transforms/process-parallel-edges.d.ts +7 -9
- package/dist/lib/transforms/utils.d.ts +5 -5
- package/dist/lib/types/element.d.ts +2 -1
- package/dist/lib/utils/bbox.d.ts +12 -3
- package/dist/lib/utils/data.d.ts +14 -0
- package/dist/lib/utils/diff.d.ts +2 -1
- package/dist/lib/utils/padding.d.ts +4 -4
- package/dist/lib/utils/point.d.ts +17 -5
- package/dist/lib/utils/position.d.ts +8 -0
- package/dist/lib/utils/prefix.d.ts +1 -1
- package/dist/lib/utils/relation.d.ts +6 -4
- package/dist/lib/utils/router/orth.d.ts +1 -1
- package/dist/lib/utils/size.d.ts +3 -1
- package/dist/lib/utils/transform.d.ts +5 -5
- package/dist/lib/utils/vector.d.ts +8 -0
- package/dist/lib/version.d.ts +1 -1
- package/esm/behaviors/base-behavior.d.ts +10 -0
- package/esm/behaviors/base-behavior.js +5 -0
- package/esm/behaviors/base-behavior.js.map +1 -1
- package/esm/behaviors/drag-canvas.d.ts +9 -0
- package/esm/behaviors/drag-canvas.js +28 -3
- package/esm/behaviors/drag-canvas.js.map +1 -1
- package/esm/behaviors/hover-activate.d.ts +16 -2
- package/esm/behaviors/hover-activate.js +17 -7
- package/esm/behaviors/hover-activate.js.map +1 -1
- package/esm/behaviors/scroll-canvas.d.ts +9 -0
- package/esm/behaviors/scroll-canvas.js +31 -4
- package/esm/behaviors/scroll-canvas.js.map +1 -1
- package/esm/elements/combos/base-combo.js +2 -2
- package/esm/elements/combos/base-combo.js.map +1 -1
- package/esm/elements/combos/circle.d.ts +1 -1
- package/esm/elements/combos/circle.js +2 -2
- package/esm/elements/combos/circle.js.map +1 -1
- package/esm/elements/edges/cubic-radial.d.ts +24 -0
- package/esm/elements/edges/cubic-radial.js +52 -0
- package/esm/elements/edges/cubic-radial.js.map +1 -0
- package/esm/elements/edges/index.d.ts +2 -0
- package/esm/elements/edges/index.js +1 -0
- package/esm/elements/edges/index.js.map +1 -1
- package/esm/elements/edges/line.d.ts +0 -2
- package/esm/elements/edges/line.js +0 -2
- package/esm/elements/edges/line.js.map +1 -1
- package/esm/elements/edges/polyline.js.map +1 -1
- package/esm/elements/nodes/base-node.d.ts +2 -1
- package/esm/elements/nodes/base-node.js +3 -2
- package/esm/elements/nodes/base-node.js.map +1 -1
- package/esm/elements/nodes/circle.d.ts +1 -1
- package/esm/elements/nodes/circle.js +2 -2
- package/esm/elements/nodes/circle.js.map +1 -1
- package/esm/elements/nodes/ellipse.d.ts +1 -1
- package/esm/elements/nodes/ellipse.js +2 -2
- package/esm/elements/nodes/ellipse.js.map +1 -1
- package/esm/elements/nodes/html.js +4 -1
- package/esm/elements/nodes/html.js.map +1 -1
- package/esm/elements/shapes/base-shape.d.ts +29 -14
- package/esm/elements/shapes/base-shape.js +27 -12
- package/esm/elements/shapes/base-shape.js.map +1 -1
- package/esm/elements/shapes/polygon.d.ts +1 -1
- package/esm/elements/shapes/polygon.js +2 -2
- package/esm/elements/shapes/polygon.js.map +1 -1
- package/esm/exports.d.ts +9 -7
- package/esm/exports.js +6 -4
- package/esm/exports.js.map +1 -1
- package/esm/layouts/base-layout.d.ts +5 -0
- package/esm/layouts/base-layout.js +5 -0
- package/esm/layouts/base-layout.js.map +1 -1
- package/esm/plugins/background/index.d.ts +1 -0
- package/esm/plugins/background/index.js +1 -0
- package/esm/plugins/background/index.js.map +1 -1
- package/esm/plugins/base-plugin.d.ts +5 -0
- package/esm/plugins/base-plugin.js +5 -0
- package/esm/plugins/base-plugin.js.map +1 -1
- package/esm/plugins/bubble-sets.d.ts +1 -0
- package/esm/plugins/bubble-sets.js +1 -0
- package/esm/plugins/bubble-sets.js.map +1 -1
- package/esm/plugins/contextmenu/index.d.ts +1 -0
- package/esm/plugins/contextmenu/index.js +1 -0
- package/esm/plugins/contextmenu/index.js.map +1 -1
- package/esm/plugins/grid-line.d.ts +1 -0
- package/esm/plugins/grid-line.js +1 -0
- package/esm/plugins/grid-line.js.map +1 -1
- package/esm/plugins/history/index.d.ts +1 -0
- package/esm/plugins/history/index.js +1 -0
- package/esm/plugins/history/index.js.map +1 -1
- package/esm/plugins/hull/index.d.ts +1 -0
- package/esm/plugins/hull/index.js +1 -0
- package/esm/plugins/hull/index.js.map +1 -1
- package/esm/plugins/legend.d.ts +1 -0
- package/esm/plugins/legend.js +1 -0
- package/esm/plugins/legend.js.map +1 -1
- package/esm/plugins/minimap/index.d.ts +8 -2
- package/esm/plugins/minimap/index.js +5 -0
- package/esm/plugins/minimap/index.js.map +1 -1
- package/esm/plugins/snapline/index.d.ts +10 -0
- package/esm/plugins/snapline/index.js +5 -0
- package/esm/plugins/snapline/index.js.map +1 -1
- package/esm/plugins/timebar.d.ts +1 -0
- package/esm/plugins/timebar.js +1 -0
- package/esm/plugins/timebar.js.map +1 -1
- package/esm/plugins/toolbar/index.d.ts +1 -0
- package/esm/plugins/toolbar/index.js +1 -0
- package/esm/plugins/toolbar/index.js.map +1 -1
- package/esm/plugins/tooltip.d.ts +11 -0
- package/esm/plugins/tooltip.js +11 -2
- package/esm/plugins/tooltip.js.map +1 -1
- package/esm/plugins/watermark/index.d.ts +1 -0
- package/esm/plugins/watermark/index.js +1 -0
- package/esm/plugins/watermark/index.js.map +1 -1
- package/esm/registry/build-in.js +4 -2
- package/esm/registry/build-in.js.map +1 -1
- package/esm/runtime/animation.js +12 -10
- package/esm/runtime/animation.js.map +1 -1
- package/esm/runtime/data.d.ts +1 -0
- package/esm/runtime/data.js +21 -13
- package/esm/runtime/data.js.map +1 -1
- package/esm/runtime/element.d.ts +1 -0
- package/esm/runtime/element.js +21 -11
- package/esm/runtime/element.js.map +1 -1
- package/esm/runtime/graph.d.ts +2 -0
- package/esm/runtime/graph.js +42 -22
- package/esm/runtime/graph.js.map +1 -1
- package/esm/runtime/layout.d.ts +1 -0
- package/esm/runtime/layout.js +5 -0
- package/esm/runtime/layout.js.map +1 -1
- package/esm/transforms/base-transform.d.ts +6 -0
- package/esm/transforms/base-transform.js +6 -0
- package/esm/transforms/base-transform.js.map +1 -1
- package/esm/transforms/collapse-expand-combo.js +3 -0
- package/esm/transforms/collapse-expand-combo.js.map +1 -1
- package/esm/transforms/collapse-expand-node.js +2 -0
- package/esm/transforms/collapse-expand-node.js.map +1 -1
- package/esm/transforms/index.d.ts +3 -0
- package/esm/transforms/index.js +1 -0
- package/esm/transforms/index.js.map +1 -1
- package/esm/transforms/position-radial-labels.d.ts +27 -0
- package/esm/transforms/position-radial-labels.js +50 -0
- package/esm/transforms/position-radial-labels.js.map +1 -0
- package/esm/transforms/process-parallel-edges.d.ts +7 -9
- package/esm/transforms/process-parallel-edges.js.map +1 -1
- package/esm/transforms/utils.d.ts +5 -5
- package/esm/transforms/utils.js +5 -5
- package/esm/types/element.d.ts +2 -1
- package/esm/utils/bbox.d.ts +12 -3
- package/esm/utils/bbox.js +16 -4
- package/esm/utils/bbox.js.map +1 -1
- package/esm/utils/data.d.ts +14 -0
- package/esm/utils/data.js +39 -0
- package/esm/utils/data.js.map +1 -1
- package/esm/utils/diff.d.ts +2 -1
- package/esm/utils/diff.js +3 -2
- package/esm/utils/diff.js.map +1 -1
- package/esm/utils/edge.js +4 -4
- package/esm/utils/edge.js.map +1 -1
- package/esm/utils/padding.d.ts +4 -4
- package/esm/utils/padding.js +4 -4
- package/esm/utils/point.d.ts +17 -5
- package/esm/utils/point.js +27 -8
- package/esm/utils/point.js.map +1 -1
- package/esm/utils/position.d.ts +8 -0
- package/esm/utils/position.js +11 -0
- package/esm/utils/position.js.map +1 -1
- package/esm/utils/prefix.d.ts +1 -1
- package/esm/utils/prefix.js +1 -1
- package/esm/utils/relation.d.ts +6 -4
- package/esm/utils/relation.js +10 -8
- package/esm/utils/relation.js.map +1 -1
- package/esm/utils/router/orth.d.ts +1 -1
- package/esm/utils/router/orth.js +27 -11
- package/esm/utils/router/orth.js.map +1 -1
- package/esm/utils/size.d.ts +3 -1
- package/esm/utils/size.js +3 -1
- package/esm/utils/size.js.map +1 -1
- package/esm/utils/transform.d.ts +5 -5
- package/esm/utils/transform.js +5 -5
- package/esm/utils/vector.d.ts +8 -0
- package/esm/utils/vector.js +13 -0
- package/esm/utils/vector.js.map +1 -1
- package/esm/version.d.ts +1 -1
- package/esm/version.js +1 -1
- package/lib/behaviors/base-behavior.d.ts +10 -0
- package/lib/behaviors/base-behavior.js +5 -0
- package/lib/behaviors/base-behavior.js.map +1 -1
- package/lib/behaviors/drag-canvas.d.ts +9 -0
- package/lib/behaviors/drag-canvas.js +27 -2
- package/lib/behaviors/drag-canvas.js.map +1 -1
- package/lib/behaviors/hover-activate.d.ts +16 -2
- package/lib/behaviors/hover-activate.js +17 -7
- package/lib/behaviors/hover-activate.js.map +1 -1
- package/lib/behaviors/scroll-canvas.d.ts +9 -0
- package/lib/behaviors/scroll-canvas.js +31 -4
- package/lib/behaviors/scroll-canvas.js.map +1 -1
- package/lib/elements/combos/base-combo.js +1 -1
- package/lib/elements/combos/base-combo.js.map +1 -1
- package/lib/elements/combos/circle.d.ts +1 -1
- package/lib/elements/combos/circle.js +2 -2
- package/lib/elements/combos/circle.js.map +1 -1
- package/lib/elements/edges/cubic-radial.d.ts +24 -0
- package/lib/elements/edges/cubic-radial.js +56 -0
- package/lib/elements/edges/cubic-radial.js.map +1 -0
- package/lib/elements/edges/index.d.ts +2 -0
- package/lib/elements/edges/index.js +3 -1
- package/lib/elements/edges/index.js.map +1 -1
- package/lib/elements/edges/line.d.ts +0 -2
- package/lib/elements/edges/line.js +0 -2
- package/lib/elements/edges/line.js.map +1 -1
- package/lib/elements/edges/polyline.js.map +1 -1
- package/lib/elements/nodes/base-node.d.ts +2 -1
- package/lib/elements/nodes/base-node.js +3 -2
- package/lib/elements/nodes/base-node.js.map +1 -1
- package/lib/elements/nodes/circle.d.ts +1 -1
- package/lib/elements/nodes/circle.js +2 -2
- package/lib/elements/nodes/circle.js.map +1 -1
- package/lib/elements/nodes/ellipse.d.ts +1 -1
- package/lib/elements/nodes/ellipse.js +2 -2
- package/lib/elements/nodes/ellipse.js.map +1 -1
- package/lib/elements/nodes/html.js +3 -0
- package/lib/elements/nodes/html.js.map +1 -1
- package/lib/elements/shapes/base-shape.d.ts +29 -14
- package/lib/elements/shapes/base-shape.js +27 -12
- package/lib/elements/shapes/base-shape.js.map +1 -1
- package/lib/elements/shapes/polygon.d.ts +1 -1
- package/lib/elements/shapes/polygon.js +2 -2
- package/lib/elements/shapes/polygon.js.map +1 -1
- package/lib/exports.d.ts +9 -7
- package/lib/exports.js +15 -6
- package/lib/exports.js.map +1 -1
- package/lib/layouts/base-layout.d.ts +5 -0
- package/lib/layouts/base-layout.js +5 -0
- package/lib/layouts/base-layout.js.map +1 -1
- package/lib/plugins/background/index.d.ts +1 -0
- package/lib/plugins/background/index.js +1 -0
- package/lib/plugins/background/index.js.map +1 -1
- package/lib/plugins/base-plugin.d.ts +5 -0
- package/lib/plugins/base-plugin.js +5 -0
- package/lib/plugins/base-plugin.js.map +1 -1
- package/lib/plugins/bubble-sets.d.ts +1 -0
- package/lib/plugins/bubble-sets.js +1 -0
- package/lib/plugins/bubble-sets.js.map +1 -1
- package/lib/plugins/contextmenu/index.d.ts +1 -0
- package/lib/plugins/contextmenu/index.js +1 -0
- package/lib/plugins/contextmenu/index.js.map +1 -1
- package/lib/plugins/grid-line.d.ts +1 -0
- package/lib/plugins/grid-line.js +1 -0
- package/lib/plugins/grid-line.js.map +1 -1
- package/lib/plugins/history/index.d.ts +1 -0
- package/lib/plugins/history/index.js +1 -0
- package/lib/plugins/history/index.js.map +1 -1
- package/lib/plugins/hull/index.d.ts +1 -0
- package/lib/plugins/hull/index.js +1 -0
- package/lib/plugins/hull/index.js.map +1 -1
- package/lib/plugins/legend.d.ts +1 -0
- package/lib/plugins/legend.js +1 -0
- package/lib/plugins/legend.js.map +1 -1
- package/lib/plugins/minimap/index.d.ts +8 -2
- package/lib/plugins/minimap/index.js +5 -0
- package/lib/plugins/minimap/index.js.map +1 -1
- package/lib/plugins/snapline/index.d.ts +10 -0
- package/lib/plugins/snapline/index.js +5 -0
- package/lib/plugins/snapline/index.js.map +1 -1
- package/lib/plugins/timebar.d.ts +1 -0
- package/lib/plugins/timebar.js +1 -0
- package/lib/plugins/timebar.js.map +1 -1
- package/lib/plugins/toolbar/index.d.ts +1 -0
- package/lib/plugins/toolbar/index.js +1 -0
- package/lib/plugins/toolbar/index.js.map +1 -1
- package/lib/plugins/tooltip.d.ts +11 -0
- package/lib/plugins/tooltip.js +11 -2
- package/lib/plugins/tooltip.js.map +1 -1
- package/lib/plugins/watermark/index.d.ts +1 -0
- package/lib/plugins/watermark/index.js +1 -0
- package/lib/plugins/watermark/index.js.map +1 -1
- package/lib/registry/build-in.js +2 -0
- package/lib/registry/build-in.js.map +1 -1
- package/lib/runtime/animation.js +12 -10
- package/lib/runtime/animation.js.map +1 -1
- package/lib/runtime/data.d.ts +1 -0
- package/lib/runtime/data.js +19 -11
- package/lib/runtime/data.js.map +1 -1
- package/lib/runtime/element.d.ts +1 -0
- package/lib/runtime/element.js +21 -11
- package/lib/runtime/element.js.map +1 -1
- package/lib/runtime/graph.d.ts +2 -0
- package/lib/runtime/graph.js +42 -22
- package/lib/runtime/graph.js.map +1 -1
- package/lib/runtime/layout.d.ts +1 -0
- package/lib/runtime/layout.js +5 -0
- package/lib/runtime/layout.js.map +1 -1
- package/lib/transforms/base-transform.d.ts +6 -0
- package/lib/transforms/base-transform.js +6 -0
- package/lib/transforms/base-transform.js.map +1 -1
- package/lib/transforms/collapse-expand-combo.js +3 -0
- package/lib/transforms/collapse-expand-combo.js.map +1 -1
- package/lib/transforms/collapse-expand-node.js +2 -0
- package/lib/transforms/collapse-expand-node.js.map +1 -1
- package/lib/transforms/index.d.ts +3 -0
- package/lib/transforms/index.js +3 -1
- package/lib/transforms/index.js.map +1 -1
- package/lib/transforms/position-radial-labels.d.ts +27 -0
- package/lib/transforms/position-radial-labels.js +54 -0
- package/lib/transforms/position-radial-labels.js.map +1 -0
- package/lib/transforms/process-parallel-edges.d.ts +7 -9
- package/lib/transforms/process-parallel-edges.js.map +1 -1
- package/lib/transforms/utils.d.ts +5 -5
- package/lib/transforms/utils.js +5 -5
- package/lib/types/element.d.ts +2 -1
- package/lib/utils/bbox.d.ts +12 -3
- package/lib/utils/bbox.js +19 -6
- package/lib/utils/bbox.js.map +1 -1
- package/lib/utils/data.d.ts +14 -0
- package/lib/utils/data.js +40 -0
- package/lib/utils/data.js.map +1 -1
- package/lib/utils/diff.d.ts +2 -1
- package/lib/utils/diff.js +3 -2
- package/lib/utils/diff.js.map +1 -1
- package/lib/utils/edge.js +3 -3
- package/lib/utils/edge.js.map +1 -1
- package/lib/utils/padding.d.ts +4 -4
- package/lib/utils/padding.js +4 -4
- package/lib/utils/point.d.ts +17 -5
- package/lib/utils/point.js +28 -8
- package/lib/utils/point.js.map +1 -1
- package/lib/utils/position.d.ts +8 -0
- package/lib/utils/position.js +12 -0
- package/lib/utils/position.js.map +1 -1
- package/lib/utils/prefix.d.ts +1 -1
- package/lib/utils/prefix.js +1 -1
- package/lib/utils/relation.d.ts +6 -4
- package/lib/utils/relation.js +10 -8
- package/lib/utils/relation.js.map +1 -1
- package/lib/utils/router/orth.d.ts +1 -1
- package/lib/utils/router/orth.js +25 -9
- package/lib/utils/router/orth.js.map +1 -1
- package/lib/utils/size.d.ts +3 -1
- package/lib/utils/size.js +3 -1
- package/lib/utils/size.js.map +1 -1
- package/lib/utils/transform.d.ts +5 -5
- package/lib/utils/transform.js +5 -5
- package/lib/utils/vector.d.ts +8 -0
- package/lib/utils/vector.js +14 -0
- package/lib/utils/vector.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +10 -10
- package/src/behaviors/base-behavior.ts +10 -0
- package/src/behaviors/drag-canvas.ts +42 -3
- package/src/behaviors/hover-activate.ts +39 -9
- package/src/behaviors/scroll-canvas.ts +45 -4
- package/src/elements/combos/base-combo.ts +2 -2
- package/src/elements/combos/circle.ts +2 -2
- package/src/elements/edges/cubic-radial.ts +77 -0
- package/src/elements/edges/index.ts +2 -0
- package/src/elements/edges/line.ts +0 -2
- package/src/elements/edges/polyline.ts +2 -0
- package/src/elements/nodes/base-node.ts +3 -2
- package/src/elements/nodes/circle.ts +2 -2
- package/src/elements/nodes/ellipse.ts +2 -2
- package/src/elements/nodes/html.ts +4 -1
- package/src/elements/shapes/base-shape.ts +29 -14
- package/src/elements/shapes/polygon.ts +2 -2
- package/src/exports.ts +21 -7
- package/src/layouts/base-layout.ts +5 -0
- package/src/plugins/background/index.ts +1 -0
- package/src/plugins/base-plugin.ts +5 -0
- package/src/plugins/bubble-sets.ts +1 -0
- package/src/plugins/contextmenu/index.ts +1 -0
- package/src/plugins/grid-line.ts +1 -0
- package/src/plugins/history/index.ts +1 -0
- package/src/plugins/hull/index.ts +1 -0
- package/src/plugins/legend.ts +1 -0
- package/src/plugins/minimap/index.ts +8 -2
- package/src/plugins/snapline/index.ts +10 -0
- package/src/plugins/timebar.ts +1 -0
- package/src/plugins/toolbar/index.ts +1 -0
- package/src/plugins/tooltip.ts +15 -2
- package/src/plugins/watermark/index.ts +1 -0
- package/src/registry/build-in.ts +4 -0
- package/src/runtime/animation.ts +16 -11
- package/src/runtime/data.ts +20 -13
- package/src/runtime/element.ts +23 -11
- package/src/runtime/graph.ts +51 -22
- package/src/runtime/layout.ts +7 -0
- package/src/transforms/base-transform.ts +7 -0
- package/src/transforms/collapse-expand-combo.ts +2 -0
- package/src/transforms/collapse-expand-node.ts +3 -0
- package/src/transforms/index.ts +3 -0
- package/src/transforms/position-radial-labels.ts +76 -0
- package/src/transforms/process-parallel-edges.ts +7 -9
- package/src/transforms/utils.ts +5 -5
- package/src/types/element.ts +2 -1
- package/src/utils/bbox.ts +17 -4
- package/src/utils/data.ts +49 -0
- package/src/utils/diff.ts +8 -2
- package/src/utils/edge.ts +4 -4
- package/src/utils/padding.ts +4 -4
- package/src/utils/point.ts +27 -7
- package/src/utils/position.ts +12 -0
- package/src/utils/prefix.ts +1 -1
- package/src/utils/relation.ts +22 -9
- package/src/utils/router/orth.ts +29 -11
- package/src/utils/size.ts +3 -1
- package/src/utils/transform.ts +5 -5
- package/src/utils/vector.ts +13 -0
- package/src/version.ts +1 -1
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import { BaseExtension } from '../registry/extension';
|
|
2
2
|
import type { CustomBehaviorOption } from '../spec/behavior';
|
|
3
|
+
/**
|
|
4
|
+
* <zh/> 交互通用配置项
|
|
5
|
+
*
|
|
6
|
+
* <en/> Base options for behaviors
|
|
7
|
+
*/
|
|
3
8
|
export interface BaseBehaviorOptions extends CustomBehaviorOption {
|
|
4
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* <zh/> 交互的基类
|
|
12
|
+
*
|
|
13
|
+
* <en/> Base class for behaviors
|
|
14
|
+
*/
|
|
5
15
|
export declare abstract class BaseBehavior<T extends BaseBehaviorOptions = BaseBehaviorOptions> extends BaseExtension<T> {
|
|
6
16
|
}
|
|
@@ -35,6 +35,13 @@ export interface DragCanvasOptions extends BaseBehaviorOptions {
|
|
|
35
35
|
* @defaultValue `'both'`
|
|
36
36
|
*/
|
|
37
37
|
direction?: 'x' | 'y' | 'both';
|
|
38
|
+
/**
|
|
39
|
+
* <zh/> 可拖拽的视口范围,默认最多可拖拽一屏。可以分别设置上、右、下、左四个方向的范围,每个方向的范围在 [0, Infinity] 之间
|
|
40
|
+
*
|
|
41
|
+
* <en/> The draggable viewport range allows you to drag up to one screen by default. You can set the range for each direction (top, right, bottom, left) individually, with each direction's range between [0, Infinity]
|
|
42
|
+
* @defaultValue 1
|
|
43
|
+
*/
|
|
44
|
+
range?: number | number[];
|
|
38
45
|
/**
|
|
39
46
|
* <zh/> 触发拖拽的方式,默认使用指针按下拖拽
|
|
40
47
|
*
|
|
@@ -94,6 +101,8 @@ export declare class DragCanvas extends BaseBehavior<DragCanvasOptions> {
|
|
|
94
101
|
* @internal
|
|
95
102
|
*/
|
|
96
103
|
protected translate(offset: Vector2, animation?: ViewportAnimationEffectTiming): Promise<void>;
|
|
104
|
+
private clampByDirection;
|
|
105
|
+
private clampByRange;
|
|
97
106
|
private validate;
|
|
98
107
|
private unbindEvents;
|
|
99
108
|
destroy(): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RuntimeContext } from '../runtime/types';
|
|
2
|
-
import type { IPointerEvent, State } from '../types';
|
|
2
|
+
import type { EdgeDirection, Element, IPointerEvent, State } from '../types';
|
|
3
3
|
import type { BaseBehaviorOptions } from './base-behavior';
|
|
4
4
|
import { BaseBehavior } from './base-behavior';
|
|
5
5
|
/**
|
|
@@ -32,7 +32,20 @@ export interface HoverActivateOptions extends BaseBehaviorOptions {
|
|
|
32
32
|
* - `1` means the current node and its directly adjacent nodes and edges are activated, etc
|
|
33
33
|
* @defaultValue 0
|
|
34
34
|
*/
|
|
35
|
-
degree?: number;
|
|
35
|
+
degree?: number | ((event: IPointerEvent) => number);
|
|
36
|
+
/**
|
|
37
|
+
* <zh/> 指定边的方向
|
|
38
|
+
* - `'both'`: 表示激活当前节点的所有关系
|
|
39
|
+
* - `'in'`: 表示激活当前节点的入边和入节点
|
|
40
|
+
* - `'out'`: 表示激活当前节点的出边和出节点
|
|
41
|
+
*
|
|
42
|
+
* <en/> Specify the direction of the edge
|
|
43
|
+
* - `'both'`: Activate all relationships of the current node
|
|
44
|
+
* - `'in'`: Activate the incoming edges and nodes of the current node
|
|
45
|
+
* - `'out'`: Activate the outgoing edges and nodes of the current node
|
|
46
|
+
* @defaultValue 'both'
|
|
47
|
+
*/
|
|
48
|
+
direction?: EdgeDirection;
|
|
36
49
|
/**
|
|
37
50
|
* <zh/> 激活元素的状态,默认为 `active`
|
|
38
51
|
*
|
|
@@ -75,6 +88,7 @@ export declare class HoverActivate extends BaseBehavior<HoverActivateOptions> {
|
|
|
75
88
|
private toggleFrozen;
|
|
76
89
|
private bindEvents;
|
|
77
90
|
private hoverElement;
|
|
91
|
+
protected getActiveIds(event: IPointerEvent<Element>): string[];
|
|
78
92
|
private updateElementsState;
|
|
79
93
|
private getElementsState;
|
|
80
94
|
private validate;
|
|
@@ -39,6 +39,13 @@ export interface ScrollCanvasOptions extends BaseBehaviorOptions {
|
|
|
39
39
|
* - `'y'`: only allow vertical scrolling
|
|
40
40
|
*/
|
|
41
41
|
direction?: 'x' | 'y';
|
|
42
|
+
/**
|
|
43
|
+
* <zh/> 可滚动的视口范围,默认最多可滚动一屏。可以分别设置上、右、下、左四个方向的范围,每个方向的范围在 [0, Infinity] 之间
|
|
44
|
+
*
|
|
45
|
+
* <en/> The scrollable viewport range allows you to scroll up to one screen by default. You can set the range for each direction (top, right, bottom, left) individually, with each direction's range between [0, Infinity]
|
|
46
|
+
* @defaultValue 1
|
|
47
|
+
*/
|
|
48
|
+
range?: number | number[];
|
|
42
49
|
/**
|
|
43
50
|
* <zh/> 滚动灵敏度
|
|
44
51
|
*
|
|
@@ -81,6 +88,8 @@ export declare class ScrollCanvas extends BaseBehavior<ScrollCanvasOptions> {
|
|
|
81
88
|
get graphDom(): import("@antv/g").CanvasLike | null;
|
|
82
89
|
private onWheel;
|
|
83
90
|
private formatDisplacement;
|
|
91
|
+
private clampByDirection;
|
|
92
|
+
private clampByRange;
|
|
84
93
|
private scroll;
|
|
85
94
|
private validate;
|
|
86
95
|
/**
|
|
@@ -21,5 +21,5 @@ export declare class CircleCombo extends BaseCombo<CircleComboStyleProps> {
|
|
|
21
21
|
protected getKeyStyle(attributes: Required<CircleComboStyleProps>): GCircleStyleProps;
|
|
22
22
|
protected getCollapsedKeySize(attributes: Required<CircleComboStyleProps>): STDSize;
|
|
23
23
|
protected getExpandedKeySize(attributes: Required<CircleComboStyleProps>): STDSize;
|
|
24
|
-
getIntersectPoint(point: Point): Point;
|
|
24
|
+
getIntersectPoint(point: Point, useExtendedLine?: boolean): Point;
|
|
25
25
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { DisplayObjectConfig } from '@antv/g';
|
|
2
|
+
import type { Point } from '../../types';
|
|
3
|
+
import type { CubicStyleProps } from './cubic';
|
|
4
|
+
import { Cubic } from './cubic';
|
|
5
|
+
/**
|
|
6
|
+
* <zh/> 径向贝塞尔曲线样式配置项
|
|
7
|
+
*
|
|
8
|
+
* <en/> Radial cubic style props
|
|
9
|
+
*/
|
|
10
|
+
export interface CubicRadialStyleProps extends CubicStyleProps {
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* <zh/> 径向贝塞尔曲线
|
|
14
|
+
*
|
|
15
|
+
* <en/> Radial cubic edge
|
|
16
|
+
*/
|
|
17
|
+
export declare class CubicRadial extends Cubic {
|
|
18
|
+
static defaultStyleProps: Partial<CubicStyleProps>;
|
|
19
|
+
constructor(options: DisplayObjectConfig<CubicStyleProps>);
|
|
20
|
+
private get ref();
|
|
21
|
+
protected getEndpoints(attributes: Required<CubicStyleProps>): [Point, Point];
|
|
22
|
+
private toRadialCoordinate;
|
|
23
|
+
protected getControlPoints(sourcePoint: Point, targetPoint: Point, curvePosition: [number, number], curveOffset: [number, number]): [Point, Point];
|
|
24
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { BaseEdge } from './base-edge';
|
|
2
2
|
export { Cubic } from './cubic';
|
|
3
3
|
export { CubicHorizontal } from './cubic-horizontal';
|
|
4
|
+
export { CubicRadial } from './cubic-radial';
|
|
4
5
|
export { CubicVertical } from './cubic-vertical';
|
|
5
6
|
export { Line } from './line';
|
|
6
7
|
export { Polyline } from './polyline';
|
|
@@ -8,6 +9,7 @@ export { Quadratic } from './quadratic';
|
|
|
8
9
|
export type { BaseEdgeStyleProps } from './base-edge';
|
|
9
10
|
export type { CubicStyleProps } from './cubic';
|
|
10
11
|
export type { CubicHorizontalStyleProps } from './cubic-horizontal';
|
|
12
|
+
export type { CubicRadialStyleProps } from './cubic-radial';
|
|
11
13
|
export type { CubicVerticalStyleProps } from './cubic-vertical';
|
|
12
14
|
export type { LineStyleProps } from './line';
|
|
13
15
|
export type { PolylineStyleProps } from './polyline';
|
|
@@ -14,8 +14,6 @@ type ParsedLineStyleProps = Required<LineStyleProps>;
|
|
|
14
14
|
* <zh/> 直线
|
|
15
15
|
*
|
|
16
16
|
* <en/> Line
|
|
17
|
-
* @remarks
|
|
18
|
-
* <img width="300" src="https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*YbpvTa4liAEAAAAAAAAAAAAADmJ7AQ/original" />
|
|
19
17
|
*/
|
|
20
18
|
export declare class Line extends BaseEdge {
|
|
21
19
|
static defaultStyleProps: Partial<LineStyleProps>;
|
|
@@ -179,9 +179,10 @@ export declare abstract class BaseNode<S extends BaseNodeStyleProps = BaseNodeSt
|
|
|
179
179
|
/**
|
|
180
180
|
* Get the point on the outer contour of the node that is the intersection with a line starting in the center the ending in the point `p`.
|
|
181
181
|
* @param point - The point to intersect with the node.
|
|
182
|
+
* @param useExtendedLine - Whether to use the extended line.
|
|
182
183
|
* @returns The intersection point.
|
|
183
184
|
*/
|
|
184
|
-
getIntersectPoint(point: Point): Point;
|
|
185
|
+
getIntersectPoint(point: Point, useExtendedLine?: boolean): Point;
|
|
185
186
|
protected drawHaloShape(attributes: Required<S>, container: Group): void;
|
|
186
187
|
protected drawIconShape(attributes: Required<S>, container: Group): void;
|
|
187
188
|
protected drawBadgeShapes(attributes: Required<S>, container: Group): void;
|
|
@@ -22,5 +22,5 @@ export declare class Circle extends BaseNode {
|
|
|
22
22
|
protected drawKeyShape(attributes: Required<CircleStyleProps>, container: Group): GCircle | undefined;
|
|
23
23
|
protected getKeyStyle(attributes: Required<CircleStyleProps>): GCircleStyleProps;
|
|
24
24
|
protected getIconStyle(attributes: Required<CircleStyleProps>): false | IconStyleProps;
|
|
25
|
-
getIntersectPoint(point: Point): Point;
|
|
25
|
+
getIntersectPoint(point: Point, useExtendedLine?: boolean): Point;
|
|
26
26
|
}
|
|
@@ -22,5 +22,5 @@ export declare class Ellipse extends BaseNode {
|
|
|
22
22
|
protected drawKeyShape(attributes: Required<EllipseStyleProps>, container: Group): GEllipse | undefined;
|
|
23
23
|
protected getKeyStyle(attributes: Required<EllipseStyleProps>): GEllipseStyleProps;
|
|
24
24
|
protected getIconStyle(attributes: Required<EllipseStyleProps>): false | IconStyleProps;
|
|
25
|
-
getIntersectPoint(point: Point): Point;
|
|
25
|
+
getIntersectPoint(point: Point, useExtendedLine?: boolean): Point;
|
|
26
26
|
}
|
|
@@ -3,31 +3,45 @@ import { CustomElement } from '@antv/g';
|
|
|
3
3
|
import type { Keyframe } from '../../types';
|
|
4
4
|
export interface BaseShapeStyleProps extends BaseStyleProps {
|
|
5
5
|
}
|
|
6
|
+
/**
|
|
7
|
+
* <zh/> 图形基类
|
|
8
|
+
*
|
|
9
|
+
* <en/> Base class for shapes
|
|
10
|
+
*/
|
|
6
11
|
export declare abstract class BaseShape<StyleProps extends BaseShapeStyleProps> extends CustomElement<StyleProps> {
|
|
7
12
|
constructor(options: DisplayObjectConfig<StyleProps>);
|
|
13
|
+
/**
|
|
14
|
+
* <zh/> 解析后的属性
|
|
15
|
+
*
|
|
16
|
+
* <en/> parsed attributes
|
|
17
|
+
* @returns <zh/> 解析后的属性 | <en/> parsed attributes
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
8
20
|
protected get parsedAttributes(): Required<StyleProps>;
|
|
9
21
|
/**
|
|
10
|
-
* <zh
|
|
22
|
+
* <zh/> 图形实例映射表
|
|
11
23
|
*
|
|
12
|
-
* <en
|
|
24
|
+
* <en/> shape instance map
|
|
25
|
+
* @internal
|
|
13
26
|
*/
|
|
14
27
|
protected shapeMap: Record<string, DisplayObject>;
|
|
15
28
|
/**
|
|
16
|
-
* <zh
|
|
29
|
+
* <zh/> 动画实例映射表
|
|
17
30
|
*
|
|
18
|
-
* <en
|
|
31
|
+
* <en/> animation instance map
|
|
32
|
+
* @internal
|
|
19
33
|
*/
|
|
20
34
|
protected animateMap: Record<string, IAnimation>;
|
|
21
35
|
/**
|
|
22
|
-
* <zh
|
|
36
|
+
* <zh/> 创建、更新或删除图形
|
|
23
37
|
*
|
|
24
|
-
* <en
|
|
25
|
-
* @param className - <zh
|
|
26
|
-
* @param Ctor - <zh
|
|
27
|
-
* @param style - <zh
|
|
28
|
-
* @param container - <zh
|
|
29
|
-
* @param hooks - <zh
|
|
30
|
-
* @returns <zh
|
|
38
|
+
* <en/> create, update or remove shape
|
|
39
|
+
* @param className - <zh/> 图形名称 | <en/> shape name
|
|
40
|
+
* @param Ctor - <zh/> 图形类型 | <en/> shape type
|
|
41
|
+
* @param style - <zh/> 图形样式。若要删除图形,传入 false | <en/> shape style. Pass false to remove the shape
|
|
42
|
+
* @param container - <zh/> 容器 | <en/> container
|
|
43
|
+
* @param hooks - <zh/> 钩子函数 | <en/> hooks
|
|
44
|
+
* @returns <zh/> 图形实例 | <en/> shape instance
|
|
31
45
|
*/
|
|
32
46
|
protected upsert<T extends DisplayObject>(className: string, Ctor: string | {
|
|
33
47
|
new (...args: any[]): T;
|
|
@@ -41,9 +55,9 @@ export declare abstract class BaseShape<StyleProps extends BaseShapeStyleProps>
|
|
|
41
55
|
protected transformPosition(attributes: Partial<StyleProps>): void;
|
|
42
56
|
update(attr?: Partial<StyleProps>): void;
|
|
43
57
|
/**
|
|
44
|
-
* <zh
|
|
58
|
+
* <zh/> 在初始化时会被自动调用
|
|
45
59
|
*
|
|
46
|
-
* <en
|
|
60
|
+
* <en/> will be called automatically when initializing
|
|
47
61
|
* @param attributes
|
|
48
62
|
* @param container
|
|
49
63
|
*/
|
|
@@ -61,6 +75,7 @@ export declare abstract class BaseShape<StyleProps extends BaseShapeStyleProps>
|
|
|
61
75
|
/**
|
|
62
76
|
* Get the prefix pairs for composite shapes used to handle animation
|
|
63
77
|
* @returns tuples array where each tuple contains a key corresponding to a method `get${key}Style` and its shape prefix
|
|
78
|
+
* @internal
|
|
64
79
|
*/
|
|
65
80
|
protected get compositeShapes(): [string, string][];
|
|
66
81
|
animate(keyframes: Keyframe[], options?: number | KeyframeAnimationOptions): IAnimation | null;
|
|
@@ -26,5 +26,5 @@ export declare abstract class Polygon<T extends PolygonStyleProps = PolygonStyle
|
|
|
26
26
|
protected drawKeyShape(attributes: Required<T>, container: Group): GPolygon | undefined;
|
|
27
27
|
protected getKeyStyle(attributes: Required<T>): GPolygonStyleProps;
|
|
28
28
|
protected abstract getPoints(attributes: Required<T>): Point[];
|
|
29
|
-
getIntersectPoint(point: Point): Point;
|
|
29
|
+
getIntersectPoint(point: Point, useExtendedLine?: boolean): Point;
|
|
30
30
|
}
|
package/dist/lib/exports.d.ts
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
export { BaseBehavior, BrushSelect, ClickSelect, CollapseExpand, CreateEdge, DragCanvas, DragElement, DragElementForce, FixElementSize, FocusElement, HoverActivate, LassoSelect, OptimizeViewportTransform, ScrollCanvas, ZoomCanvas, } from './behaviors';
|
|
2
2
|
export { CanvasEvent, ComboEvent, CommonEvent, ContainerEvent, EdgeEvent, ExtensionCategory, GraphEvent, HistoryEvent, NodeEvent, } from './constants';
|
|
3
3
|
export { BaseCombo, CircleCombo, RectCombo } from './elements/combos';
|
|
4
|
-
export { BaseEdge, Cubic, CubicHorizontal, CubicVertical, Line, Polyline, Quadratic } from './elements/edges';
|
|
4
|
+
export { BaseEdge, Cubic, CubicHorizontal, CubicRadial, CubicVertical, Line, Polyline, Quadratic, } from './elements/edges';
|
|
5
|
+
export { effect } from './elements/effect';
|
|
5
6
|
export { BaseNode, Circle, Diamond, Donut, Ellipse, HTML, Hexagon, Image, Rect, Star, Triangle, } from './elements/nodes';
|
|
6
7
|
export { Badge, BaseShape, Icon, Label } from './elements/shapes';
|
|
7
|
-
export { AntVDagreLayout, BaseLayout, CircularLayout, ComboCombinedLayout, ConcentricLayout, D3ForceLayout, DagreLayout, ForceAtlas2Layout, ForceLayout, FruchtermanLayout, GridLayout,
|
|
8
|
-
export { BasePlugin, BubbleSets, CameraSetting, Contextmenu, EdgeFilterLens, Fisheye, Fullscreen, GridLine, History, Hull, Legend, Minimap, Snapline, Timebar, Toolbar, Tooltip, Watermark, } from './plugins';
|
|
8
|
+
export { AntVDagreLayout, BaseLayout, CircularLayout, ComboCombinedLayout, compactBox as CompactBoxLayout, ConcentricLayout, D3ForceLayout, DagreLayout, dendrogram as DendrogramLayout, ForceAtlas2Layout, ForceLayout, FruchtermanLayout, GridLayout, indented as IndentedLayout, MDSLayout, mindmap as MindmapLayout, RadialLayout, RandomLayout, } from './layouts';
|
|
9
|
+
export { Background, BasePlugin, BubbleSets, CameraSetting, Contextmenu, EdgeFilterLens, Fisheye, Fullscreen, GridLine, History, Hull, Legend, Minimap, Snapline, Timebar, Toolbar, Tooltip, Watermark, } from './plugins';
|
|
9
10
|
export { getExtension, getExtensions } from './registry/get';
|
|
10
11
|
export { register } from './registry/register';
|
|
11
12
|
export { Graph } from './runtime/graph';
|
|
12
|
-
export { BaseTransform } from './transforms';
|
|
13
|
+
export { BaseTransform, PositionRadialLabels, ProcessParallelEdges } from './transforms';
|
|
13
14
|
export { isCollapsed } from './utils/collapsibility';
|
|
14
15
|
export { idOf } from './utils/id';
|
|
15
16
|
export { invokeLayoutMethod } from './utils/layout';
|
|
17
|
+
export { positionOf } from './utils/position';
|
|
16
18
|
export { omitStyleProps, subStyleProps } from './utils/prefix';
|
|
17
19
|
export { Shortcut } from './utils/shortcut';
|
|
18
20
|
export { parseSize } from './utils/size';
|
|
@@ -25,14 +27,14 @@ export type { AnimationContext, AnimationEffectTiming, AnimationExecutor, Animat
|
|
|
25
27
|
export type { BaseBehaviorOptions, BrushSelectOptions, ClickSelectOptions, CollapseExpandOptions, CreateEdgeOptions, DragCanvasOptions, DragElementForceOptions, DragElementOptions, FixElementSizeOptions, FocusElementOptions, HoverActivateOptions, LassoSelectOptions, OptimizeViewportTransformOptions, ScrollCanvasOptions, ZoomCanvasOptions, } from './behaviors';
|
|
26
28
|
export type { FixShapeConfig } from './behaviors/fix-element-size';
|
|
27
29
|
export type { BaseComboStyleProps, CircleComboStyleProps, RectComboStyleProps } from './elements/combos';
|
|
28
|
-
export type { BaseEdgeStyleProps, CubicHorizontalStyleProps, CubicStyleProps, CubicVerticalStyleProps, LineStyleProps, PolylineStyleProps, QuadraticStyleProps, } from './elements/edges';
|
|
30
|
+
export type { BaseEdgeStyleProps, CubicHorizontalStyleProps, CubicRadialStyleProps, CubicStyleProps, CubicVerticalStyleProps, LineStyleProps, PolylineStyleProps, QuadraticStyleProps, } from './elements/edges';
|
|
29
31
|
export type { BaseNodeStyleProps, CircleStyleProps, DiamondStyleProps, DonutStyleProps, EllipseStyleProps, HTMLStyleProps, HexagonStyleProps, ImageStyleProps, RectStyleProps, StarStyleProps, TriangleStyleProps, } from './elements/nodes';
|
|
30
32
|
export type { BadgeStyleProps, BaseShapeStyleProps, IconStyleProps, LabelStyleProps, PolygonStyleProps, } from './elements/shapes';
|
|
31
33
|
export type { UpsertHooks } from './elements/shapes/base-shape';
|
|
32
34
|
export type { ContourLabelStyleProps, ContourStyleProps } from './elements/shapes/contour';
|
|
33
35
|
export type { BaseLayoutOptions, WebWorkerLayoutOptions } from './layouts/types';
|
|
34
36
|
export type { CategoricalPalette } from './palettes/types';
|
|
35
|
-
export type { BasePluginOptions, BubbleSetsOptions, CameraSettingOptions, ContextmenuOptions, EdgeFilterLensOptions, FisheyeOptions, FullscreenOptions, GridLineOptions, HistoryOptions, HullOptions, LegendOptions, MinimapOptions, SnaplineOptions, TimebarOptions, ToolbarOptions, TooltipOptions, WatermarkOptions, } from './plugins';
|
|
37
|
+
export type { BackgroundOptions, BasePluginOptions, BubbleSetsOptions, CameraSettingOptions, ContextmenuOptions, EdgeFilterLensOptions, FisheyeOptions, FullscreenOptions, GridLineOptions, HistoryOptions, HullOptions, LegendOptions, MinimapOptions, SnaplineOptions, TimebarOptions, ToolbarOptions, TooltipOptions, WatermarkOptions, } from './plugins';
|
|
36
38
|
export type { DataURLOptions } from './runtime/canvas';
|
|
37
39
|
export type { RuntimeContext } from './runtime/types';
|
|
38
40
|
export type { BehaviorOptions, CanvasOptions, ComboData, ComboOptions, EdgeData, EdgeOptions, GraphData, GraphOptions, NodeData, NodeOptions, PluginOptions, ThemeOptions, ViewportOptions, } from './spec';
|
|
@@ -40,7 +42,7 @@ export type { CustomBehaviorOption } from './spec/behavior';
|
|
|
40
42
|
export type { AnimationStage } from './spec/element/animation';
|
|
41
43
|
export type { LayoutOptions, STDLayoutOptions, SingleLayoutOptions } from './spec/layout';
|
|
42
44
|
export type { CustomPluginOption } from './spec/plugin';
|
|
43
|
-
export type { BaseTransformOptions } from './transforms';
|
|
45
|
+
export type { BaseTransformOptions, PositionRadialLabelsOptions, ProcessParallelEdgesOptions } from './transforms';
|
|
44
46
|
export type { DrawData } from './transforms/types';
|
|
45
47
|
export type { BaseElementStyleProps, CardinalPlacement, CollapsedMarkerStyleProps, Combo, CornerPlacement, DirectionalPlacement, Edge, EdgeArrowStyleProps, EdgeDirection, EdgeLabelStyleProps, Element, ElementDatum, ElementHooks, ElementMethods, ElementType, FitViewOptions, HierarchyKey, IAnimateEvent, ID, IDragEvent, IElementDragEvent, IElementEvent, IElementLifeCycleEvent, IEvent, IGraphLifeCycleEvent, IKeyboardEvent, IPointerEvent, IViewportEvent, IWheelEvent, LoopPlacement, LoopStyleProps, Node, NodeBadgeStyleProps, NodeLabelStyleProps, NodeLikeData, NodePortStyleProps, Padding, Placement, Point, PortStyleProps, Prefix, PrefixKey, RelativePlacement, Size, State, TransformOptions, TreeData, TriangleDirection, Vector2, Vector3, ViewportAnimationEffectTiming, } from './types';
|
|
46
48
|
export type { Command, CommandData } from './types/history';
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import type { RuntimeContext } from '../runtime/types';
|
|
2
2
|
import type { GraphData } from '../spec';
|
|
3
3
|
import type { BaseLayoutOptions } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* <zh/> 布局的基类
|
|
6
|
+
*
|
|
7
|
+
* <en/> Base class for layout
|
|
8
|
+
*/
|
|
4
9
|
export declare abstract class BaseLayout<O extends BaseLayoutOptions = any> {
|
|
5
10
|
abstract id: string;
|
|
6
11
|
options: O;
|
|
@@ -2,5 +2,10 @@ import { BaseExtension } from '../registry/extension';
|
|
|
2
2
|
import type { CustomPluginOption } from '../spec/plugin';
|
|
3
3
|
export interface BasePluginOptions extends CustomPluginOption {
|
|
4
4
|
}
|
|
5
|
+
/**
|
|
6
|
+
* <zh/> 插件的基类
|
|
7
|
+
*
|
|
8
|
+
* <en/> Base class for plugins
|
|
9
|
+
*/
|
|
5
10
|
export declare abstract class BasePlugin<T extends BasePluginOptions> extends BaseExtension<T> {
|
|
6
11
|
}
|
|
@@ -4,15 +4,16 @@ import type { ElementType, Padding, Placement } from '../../types';
|
|
|
4
4
|
import type { BasePluginOptions } from '../base-plugin';
|
|
5
5
|
import { BasePlugin } from '../base-plugin';
|
|
6
6
|
/**
|
|
7
|
-
* <zh/>
|
|
7
|
+
* <zh/> 缩略图插件配置项
|
|
8
8
|
*
|
|
9
|
-
* <en/>
|
|
9
|
+
* <en/> Minimap plugin options
|
|
10
10
|
*/
|
|
11
11
|
export interface MinimapOptions extends BasePluginOptions {
|
|
12
12
|
/**
|
|
13
13
|
* <zh/> 宽度和高度
|
|
14
14
|
*
|
|
15
15
|
* <en/> Width and height
|
|
16
|
+
* @defaultValue [240, 160]
|
|
16
17
|
*/
|
|
17
18
|
size?: [number, number];
|
|
18
19
|
/**
|
|
@@ -84,6 +85,11 @@ export interface MinimapOptions extends BasePluginOptions {
|
|
|
84
85
|
*/
|
|
85
86
|
renderer?: IRenderer;
|
|
86
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* <zh/> 缩略图插件
|
|
90
|
+
*
|
|
91
|
+
* <en/> Minimap plugin
|
|
92
|
+
*/
|
|
87
93
|
export declare class Minimap extends BasePlugin<MinimapOptions> {
|
|
88
94
|
static defaultOptions: Partial<MinimapOptions>;
|
|
89
95
|
private canvas;
|
|
@@ -3,6 +3,11 @@ import type { RuntimeContext } from '../../runtime/types';
|
|
|
3
3
|
import type { IDragEvent, Node } from '../../types';
|
|
4
4
|
import type { BasePluginOptions } from '../base-plugin';
|
|
5
5
|
import { BasePlugin } from '../base-plugin';
|
|
6
|
+
/**
|
|
7
|
+
* <zh/> 对齐线插件配置项
|
|
8
|
+
*
|
|
9
|
+
* <en/> Snapline plugin options
|
|
10
|
+
*/
|
|
6
11
|
export interface SnaplineOptions extends BasePluginOptions {
|
|
7
12
|
/**
|
|
8
13
|
* <zh/> 对齐精度,即移动节点时与目标位置的距离小于 tolerance 时触发显示对齐线
|
|
@@ -62,6 +67,11 @@ export interface SnaplineOptions extends BasePluginOptions {
|
|
|
62
67
|
*/
|
|
63
68
|
filter?: (node: Node) => boolean;
|
|
64
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* <zh/> 对齐线插件
|
|
72
|
+
*
|
|
73
|
+
* <en/> Snapline plugin
|
|
74
|
+
*/
|
|
65
75
|
export declare class Snapline extends BasePlugin<SnaplineOptions> {
|
|
66
76
|
static defaultOptions: Partial<SnaplineOptions>;
|
|
67
77
|
private horizontalLine;
|
|
@@ -3,6 +3,11 @@ import type { RuntimeContext } from '../runtime/types';
|
|
|
3
3
|
import type { ElementDatum, ID, IElementEvent } from '../types';
|
|
4
4
|
import type { BasePluginOptions } from './base-plugin';
|
|
5
5
|
import { BasePlugin } from './base-plugin';
|
|
6
|
+
/**
|
|
7
|
+
* <zh/> 提示框插件配置项
|
|
8
|
+
*
|
|
9
|
+
* <en/> Tooltip plugin options
|
|
10
|
+
*/
|
|
6
11
|
export interface TooltipOptions extends BasePluginOptions, Pick<TooltipStyleProps, 'position' | 'offset' | 'enterable' | 'style' | 'container' | 'title'> {
|
|
7
12
|
/**
|
|
8
13
|
* <zh/> 触发行为,可选 hover | click
|
|
@@ -29,6 +34,11 @@ export interface TooltipOptions extends BasePluginOptions, Pick<TooltipStyleProp
|
|
|
29
34
|
*/
|
|
30
35
|
enable?: boolean | ((event: IElementEvent) => boolean);
|
|
31
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* <zh/> 提示框插件
|
|
39
|
+
*
|
|
40
|
+
* <en/> Tooltip plugin
|
|
41
|
+
*/
|
|
32
42
|
export declare class Tooltip extends BasePlugin<TooltipOptions> {
|
|
33
43
|
static defaultOptions: Partial<TooltipOptions>;
|
|
34
44
|
private currentTarget;
|
|
@@ -112,6 +122,7 @@ export declare class Tooltip extends BasePlugin<TooltipOptions> {
|
|
|
112
122
|
* <zh/> 销毁tooltip
|
|
113
123
|
*
|
|
114
124
|
* <en/> Destroy tooltip
|
|
125
|
+
* @internal
|
|
115
126
|
*/
|
|
116
127
|
destroy(): void;
|
|
117
128
|
}
|
|
@@ -68,6 +68,7 @@ export declare class DataController {
|
|
|
68
68
|
getEdgeDatum(id: ID): EdgeData;
|
|
69
69
|
getEdgeData(ids?: ID[]): EdgeData[];
|
|
70
70
|
getComboData(ids?: ID[]): ComboData[];
|
|
71
|
+
getRootsData(hierarchyKey?: HierarchyKey): NodeLikeData[];
|
|
71
72
|
getAncestorsData(id: ID, hierarchyKey: HierarchyKey): NodeLikeData[];
|
|
72
73
|
getDescendantsData(id: ID): NodeLikeData[];
|
|
73
74
|
getParentData(id: ID, hierarchyKey: HierarchyKey): NodeLikeData | undefined;
|
|
@@ -42,6 +42,7 @@ export declare class Graph extends EventEmitter {
|
|
|
42
42
|
* @apiCategory option
|
|
43
43
|
*/
|
|
44
44
|
setOptions(options: GraphOptions): void;
|
|
45
|
+
private _setOptions;
|
|
45
46
|
/**
|
|
46
47
|
* <zh/> 获取当前画布容器的尺寸
|
|
47
48
|
*
|
|
@@ -723,6 +724,7 @@ export declare class Graph extends EventEmitter {
|
|
|
723
724
|
*/
|
|
724
725
|
getElementDataByState(elementType: 'combo', state: State): ComboData[];
|
|
725
726
|
private initCanvas;
|
|
727
|
+
private updateCanvas;
|
|
726
728
|
private initRuntime;
|
|
727
729
|
private prepare;
|
|
728
730
|
/**
|
|
@@ -3,6 +3,12 @@ import type { DrawContext } from '../runtime/element';
|
|
|
3
3
|
import type { CustomBehaviorOption } from '../spec/behavior';
|
|
4
4
|
import type { DrawData } from './types';
|
|
5
5
|
export type BaseTransformOptions = CustomBehaviorOption;
|
|
6
|
+
/**
|
|
7
|
+
* <zh/> 数据转换的基类
|
|
8
|
+
*
|
|
9
|
+
* <en/> Base class for data transforms
|
|
10
|
+
*/
|
|
6
11
|
export declare abstract class BaseTransform<T extends BaseTransformOptions = BaseTransformOptions> extends BaseExtension<T> {
|
|
7
12
|
beforeDraw(data: DrawData, context: DrawContext): DrawData;
|
|
13
|
+
afterLayout(): void;
|
|
8
14
|
}
|
|
@@ -3,6 +3,9 @@ export { BaseTransform } from './base-transform';
|
|
|
3
3
|
export { CollapseExpandCombo } from './collapse-expand-combo';
|
|
4
4
|
export { CollapseExpandNode } from './collapse-expand-node';
|
|
5
5
|
export { GetEdgeActualEnds } from './get-edge-actual-ends';
|
|
6
|
+
export { PositionRadialLabels } from './position-radial-labels';
|
|
6
7
|
export { ProcessParallelEdges } from './process-parallel-edges';
|
|
7
8
|
export { UpdateRelatedEdge } from './update-related-edge';
|
|
8
9
|
export type { BaseTransformOptions } from './base-transform';
|
|
10
|
+
export type { PositionRadialLabelsOptions } from './position-radial-labels';
|
|
11
|
+
export type { ProcessParallelEdgesOptions } from './process-parallel-edges';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { RuntimeContext } from '../runtime/types';
|
|
2
|
+
import type { BaseTransformOptions } from './base-transform';
|
|
3
|
+
import { BaseTransform } from './base-transform';
|
|
4
|
+
/**
|
|
5
|
+
* <zh/> 根据径向布局自动调整节点标签样式的配置项
|
|
6
|
+
*
|
|
7
|
+
* <en/> Options for automatically adjusting the style of node labels according to the radial layout
|
|
8
|
+
*/
|
|
9
|
+
export interface PositionRadialLabelsOptions extends BaseTransformOptions {
|
|
10
|
+
/**
|
|
11
|
+
* <zh/> 偏移量
|
|
12
|
+
*
|
|
13
|
+
* <en/> Offset
|
|
14
|
+
*/
|
|
15
|
+
offset?: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* <zh/> 根据径向布局自动调整节点标签样式,包括位置和旋转角度
|
|
19
|
+
*
|
|
20
|
+
* <en/> Automatically adjust the style of node labels according to the radial layout, including position and rotation angle
|
|
21
|
+
*/
|
|
22
|
+
export declare class PositionRadialLabels extends BaseTransform<PositionRadialLabelsOptions> {
|
|
23
|
+
static defaultOptions: Partial<PositionRadialLabelsOptions>;
|
|
24
|
+
constructor(context: RuntimeContext, options: PositionRadialLabelsOptions);
|
|
25
|
+
private get ref();
|
|
26
|
+
afterLayout(): void;
|
|
27
|
+
}
|