@antv/g6 5.0.0-beta.32 → 5.0.0-beta.33
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/brush-select.d.ts +104 -0
- package/dist/lib/behaviors/click-element.d.ts +77 -0
- package/dist/lib/behaviors/drag-element-force.d.ts +14 -0
- package/dist/lib/behaviors/drag-element.d.ts +13 -12
- package/dist/lib/behaviors/index.d.ts +8 -0
- package/dist/lib/behaviors/lasso-select.d.ts +20 -0
- package/dist/lib/behaviors/types.d.ts +1 -0
- package/dist/lib/constants/change.d.ts +1 -1
- package/dist/lib/constants/events/graph.d.ts +9 -7
- package/dist/lib/constants/registry.d.ts +3 -1
- package/dist/lib/elements/combos/base-combo.d.ts +43 -6
- package/dist/lib/elements/combos/circle.d.ts +8 -12
- package/dist/lib/elements/combos/rect.d.ts +5 -9
- package/dist/lib/elements/edges/base-edge.d.ts +64 -10
- package/dist/lib/elements/edges/cubic-horizontal.d.ts +2 -2
- package/dist/lib/elements/edges/cubic-vertical.d.ts +2 -2
- package/dist/lib/elements/edges/cubic.d.ts +2 -2
- package/dist/lib/elements/edges/polyline.d.ts +2 -2
- package/dist/lib/elements/edges/quadratic.d.ts +2 -2
- package/dist/lib/elements/nodes/base-node.d.ts +104 -13
- package/dist/lib/elements/nodes/circle.d.ts +5 -8
- package/dist/lib/elements/nodes/diamond.d.ts +2 -4
- package/dist/lib/elements/nodes/ellipse.d.ts +5 -8
- package/dist/lib/elements/nodes/hexagon.d.ts +6 -9
- package/dist/lib/elements/nodes/image.d.ts +9 -11
- package/dist/lib/elements/nodes/polygon.d.ts +9 -8
- package/dist/lib/elements/nodes/rect.d.ts +2 -3
- package/dist/lib/elements/nodes/star.d.ts +7 -10
- package/dist/lib/elements/nodes/triangle.d.ts +7 -10
- package/dist/lib/exports.d.ts +4 -2
- package/dist/lib/layouts/index.d.ts +1 -1
- package/dist/lib/layouts/types.d.ts +6 -6
- package/dist/lib/palettes/index.d.ts +1 -0
- package/dist/lib/plugins/history/events.d.ts +21 -0
- package/dist/lib/plugins/history/index.d.ts +82 -0
- package/dist/lib/plugins/history/utils.d.ts +31 -0
- package/dist/lib/plugins/hull/index.d.ts +59 -0
- package/dist/lib/plugins/hull/shape.d.ts +49 -0
- package/dist/lib/plugins/hull/util.d.ts +12 -0
- package/dist/lib/plugins/index.d.ts +4 -0
- package/dist/lib/registry/extension/index.d.ts +1 -1
- package/dist/lib/registry/types.d.ts +4 -0
- package/dist/lib/runtime/batch.d.ts +11 -0
- package/dist/lib/runtime/behavior.d.ts +1 -1
- package/dist/lib/runtime/canvas.d.ts +13 -3
- package/dist/lib/runtime/data.d.ts +4 -4
- package/dist/lib/runtime/element.d.ts +3 -19
- package/dist/lib/runtime/graph.d.ts +40 -2
- package/dist/lib/runtime/layout.d.ts +5 -11
- package/dist/lib/runtime/plugin.d.ts +1 -1
- package/dist/lib/runtime/transform.d.ts +11 -0
- package/dist/lib/runtime/types.d.ts +14 -0
- package/dist/lib/spec/index.d.ts +1 -0
- package/dist/lib/spec/spec.d.ts +7 -0
- package/dist/lib/spec/transform.d.ts +12 -0
- package/dist/lib/transforms/arrange-draw-order.d.ts +10 -0
- package/dist/lib/transforms/base-transform.d.ts +7 -0
- package/dist/lib/transforms/collapse-expand-combo.d.ts +10 -0
- package/dist/lib/transforms/index.d.ts +6 -0
- package/dist/lib/transforms/process-parallel-edges.d.ts +84 -0
- package/dist/lib/transforms/types.d.ts +20 -0
- package/dist/lib/transforms/update-related-edge.d.ts +9 -0
- package/dist/lib/types/canvas.d.ts +1 -1
- package/dist/lib/types/change.d.ts +27 -10
- package/dist/lib/types/element.d.ts +6 -140
- package/dist/lib/types/node.d.ts +3 -3
- package/dist/lib/types/point.d.ts +1 -0
- package/dist/lib/utils/animation.d.ts +1 -1
- package/dist/lib/utils/behaviors/brush.d.ts +19 -0
- package/dist/lib/utils/behaviors/lasso.d.ts +13 -0
- package/dist/lib/utils/behaviors/utils.d.ts +21 -0
- package/dist/lib/utils/change.d.ts +9 -1
- package/dist/lib/utils/combo.d.ts +5 -4
- package/dist/lib/utils/edge.d.ts +11 -0
- package/dist/lib/utils/event/events.d.ts +1 -1
- package/dist/lib/utils/extension.d.ts +1 -1
- package/dist/lib/utils/id.d.ts +3 -8
- package/dist/lib/utils/line.d.ts +21 -0
- package/dist/lib/utils/path.d.ts +35 -0
- package/dist/lib/utils/point.d.ts +74 -20
- package/dist/lib/utils/polygon.d.ts +17 -0
- package/dist/lib/utils/position.d.ts +14 -1
- package/dist/lib/utils/prefix.d.ts +1 -1
- package/dist/lib/utils/shortcut.d.ts +1 -0
- package/dist/lib/utils/vector.d.ts +3 -2
- package/esm/behaviors/brush-select.d.ts +104 -0
- package/esm/behaviors/brush-select.js +199 -0
- package/esm/behaviors/brush-select.js.map +1 -0
- package/esm/behaviors/click-element.d.ts +77 -0
- package/esm/behaviors/click-element.js +108 -0
- package/esm/behaviors/click-element.js.map +1 -0
- package/esm/behaviors/drag-element-force.d.ts +14 -0
- package/esm/behaviors/drag-element-force.js +55 -0
- package/esm/behaviors/drag-element-force.js.map +1 -0
- package/esm/behaviors/drag-element.d.ts +13 -12
- package/esm/behaviors/drag-element.js +17 -9
- package/esm/behaviors/drag-element.js.map +1 -1
- package/esm/behaviors/hover-element.js +2 -2
- package/esm/behaviors/hover-element.js.map +1 -1
- package/esm/behaviors/index.d.ts +8 -0
- package/esm/behaviors/index.js +4 -0
- package/esm/behaviors/index.js.map +1 -1
- package/esm/behaviors/lasso-select.d.ts +20 -0
- package/esm/behaviors/lasso-select.js +79 -0
- package/esm/behaviors/lasso-select.js.map +1 -0
- package/esm/behaviors/types.d.ts +1 -0
- package/esm/constants/change.d.ts +1 -1
- package/esm/constants/change.js +12 -12
- package/esm/constants/change.js.map +1 -1
- package/esm/constants/events/graph.d.ts +9 -7
- package/esm/constants/events/graph.js +8 -8
- package/esm/constants/events/graph.js.map +1 -1
- package/esm/constants/registry.d.ts +3 -1
- package/esm/constants/registry.js +2 -0
- package/esm/constants/registry.js.map +1 -1
- package/esm/elements/combos/base-combo.d.ts +43 -6
- package/esm/elements/combos/base-combo.js.map +1 -1
- package/esm/elements/combos/circle.d.ts +8 -12
- package/esm/elements/combos/circle.js.map +1 -1
- package/esm/elements/combos/rect.d.ts +5 -9
- package/esm/elements/combos/rect.js.map +1 -1
- package/esm/elements/edges/base-edge.d.ts +64 -10
- package/esm/elements/edges/base-edge.js.map +1 -1
- package/esm/elements/edges/cubic-horizontal.d.ts +2 -2
- package/esm/elements/edges/cubic-vertical.d.ts +2 -2
- package/esm/elements/edges/cubic.d.ts +2 -2
- package/esm/elements/edges/polyline.d.ts +2 -2
- package/esm/elements/edges/quadratic.d.ts +2 -2
- package/esm/elements/nodes/base-node.d.ts +104 -13
- package/esm/elements/nodes/base-node.js +4 -1
- package/esm/elements/nodes/base-node.js.map +1 -1
- package/esm/elements/nodes/circle.d.ts +5 -8
- package/esm/elements/nodes/circle.js.map +1 -1
- package/esm/elements/nodes/diamond.d.ts +2 -4
- package/esm/elements/nodes/diamond.js +2 -2
- package/esm/elements/nodes/diamond.js.map +1 -1
- package/esm/elements/nodes/ellipse.d.ts +5 -8
- package/esm/elements/nodes/ellipse.js +1 -1
- package/esm/elements/nodes/ellipse.js.map +1 -1
- package/esm/elements/nodes/hexagon.d.ts +6 -9
- package/esm/elements/nodes/hexagon.js.map +1 -1
- package/esm/elements/nodes/image.d.ts +9 -11
- package/esm/elements/nodes/image.js.map +1 -1
- package/esm/elements/nodes/polygon.d.ts +9 -8
- package/esm/elements/nodes/polygon.js +4 -1
- package/esm/elements/nodes/polygon.js.map +1 -1
- package/esm/elements/nodes/rect.d.ts +2 -3
- package/esm/elements/nodes/rect.js.map +1 -1
- package/esm/elements/nodes/star.d.ts +7 -10
- package/esm/elements/nodes/star.js.map +1 -1
- package/esm/elements/nodes/triangle.d.ts +7 -10
- package/esm/elements/nodes/triangle.js.map +1 -1
- package/esm/exports.d.ts +4 -2
- package/esm/exports.js +2 -1
- package/esm/exports.js.map +1 -1
- package/esm/layouts/index.d.ts +1 -1
- package/esm/layouts/index.js +1 -1
- package/esm/layouts/index.js.map +1 -1
- package/esm/layouts/types.d.ts +6 -6
- package/esm/palettes/index.d.ts +1 -0
- package/esm/palettes/index.js +12 -0
- package/esm/palettes/index.js.map +1 -1
- package/esm/plugins/history/events.d.ts +21 -0
- package/esm/plugins/history/events.js +16 -0
- package/esm/plugins/history/events.js.map +1 -0
- package/esm/plugins/history/index.d.ts +82 -0
- package/esm/plugins/history/index.js +168 -0
- package/esm/plugins/history/index.js.map +1 -0
- package/esm/plugins/history/utils.d.ts +31 -0
- package/esm/plugins/history/utils.js +79 -0
- package/esm/plugins/history/utils.js.map +1 -0
- package/esm/plugins/hull/index.d.ts +59 -0
- package/esm/plugins/hull/index.js +107 -0
- package/esm/plugins/hull/index.js.map +1 -0
- package/esm/plugins/hull/shape.d.ts +49 -0
- package/esm/plugins/hull/shape.js +35 -0
- package/esm/plugins/hull/shape.js.map +1 -0
- package/esm/plugins/hull/util.d.ts +12 -0
- package/esm/plugins/hull/util.js +203 -0
- package/esm/plugins/hull/util.js.map +1 -0
- 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.map +1 -1
- package/esm/registry/build-in.js +19 -4
- package/esm/registry/build-in.js.map +1 -1
- package/esm/registry/extension/index.d.ts +1 -1
- package/esm/registry/index.js +1 -0
- package/esm/registry/index.js.map +1 -1
- package/esm/registry/types.d.ts +4 -0
- package/esm/runtime/batch.d.ts +11 -0
- package/esm/runtime/batch.js +31 -0
- package/esm/runtime/batch.js.map +1 -0
- package/esm/runtime/behavior.d.ts +1 -1
- package/esm/runtime/behavior.js.map +1 -1
- package/esm/runtime/canvas.d.ts +13 -3
- package/esm/runtime/canvas.js +36 -12
- package/esm/runtime/canvas.js.map +1 -1
- package/esm/runtime/data.d.ts +4 -4
- package/esm/runtime/data.js +23 -25
- package/esm/runtime/data.js.map +1 -1
- package/esm/runtime/element.d.ts +3 -19
- package/esm/runtime/element.js +16 -137
- package/esm/runtime/element.js.map +1 -1
- package/esm/runtime/graph.d.ts +40 -2
- package/esm/runtime/graph.js +57 -1
- package/esm/runtime/graph.js.map +1 -1
- package/esm/runtime/layout.d.ts +5 -11
- package/esm/runtime/layout.js +29 -75
- package/esm/runtime/layout.js.map +1 -1
- package/esm/runtime/plugin.d.ts +1 -1
- package/esm/runtime/plugin.js.map +1 -1
- package/esm/runtime/transform.d.ts +11 -0
- package/esm/runtime/transform.js +20 -0
- package/esm/runtime/transform.js.map +1 -0
- package/esm/runtime/types.d.ts +14 -0
- package/esm/spec/index.d.ts +1 -0
- package/esm/spec/spec.d.ts +7 -0
- package/esm/spec/transform.d.ts +12 -0
- package/esm/spec/transform.js +2 -0
- package/esm/spec/transform.js.map +1 -0
- package/esm/themes/base.js +9 -1
- package/esm/themes/base.js.map +1 -1
- package/esm/transforms/arrange-draw-order.d.ts +10 -0
- package/esm/transforms/arrange-draw-order.js +27 -0
- package/esm/transforms/arrange-draw-order.js.map +1 -0
- package/esm/transforms/base-transform.d.ts +7 -0
- package/esm/transforms/base-transform.js +7 -0
- package/esm/transforms/base-transform.js.map +1 -0
- package/esm/transforms/collapse-expand-combo.d.ts +10 -0
- package/esm/transforms/collapse-expand-combo.js +82 -0
- package/esm/transforms/collapse-expand-combo.js.map +1 -0
- package/esm/transforms/index.d.ts +6 -0
- package/esm/transforms/index.js +6 -0
- package/esm/transforms/index.js.map +1 -0
- package/esm/transforms/process-parallel-edges.d.ts +84 -0
- package/esm/transforms/process-parallel-edges.js +215 -0
- package/esm/transforms/process-parallel-edges.js.map +1 -0
- package/esm/transforms/types.d.ts +20 -0
- package/esm/transforms/types.js +11 -0
- package/esm/transforms/types.js.map +1 -0
- package/esm/transforms/update-related-edge.d.ts +9 -0
- package/esm/transforms/update-related-edge.js +20 -0
- package/esm/transforms/update-related-edge.js.map +1 -0
- package/esm/types/canvas.d.ts +1 -1
- package/esm/types/change.d.ts +27 -10
- package/esm/types/element.d.ts +6 -140
- package/esm/types/node.d.ts +3 -3
- package/esm/types/point.d.ts +1 -0
- package/esm/utils/animation.d.ts +1 -1
- package/esm/utils/animation.js +6 -0
- package/esm/utils/animation.js.map +1 -1
- package/esm/utils/behaviors/brush.d.ts +19 -0
- package/esm/utils/behaviors/brush.js +25 -0
- package/esm/utils/behaviors/brush.js.map +1 -0
- package/esm/utils/behaviors/lasso.d.ts +13 -0
- package/esm/utils/behaviors/lasso.js +112 -0
- package/esm/utils/behaviors/lasso.js.map +1 -0
- package/esm/utils/behaviors/utils.d.ts +21 -0
- package/esm/utils/behaviors/utils.js +42 -0
- package/esm/utils/behaviors/utils.js.map +1 -0
- package/esm/utils/change.d.ts +9 -1
- package/esm/utils/change.js +28 -0
- package/esm/utils/change.js.map +1 -1
- package/esm/utils/combo.d.ts +5 -4
- package/esm/utils/combo.js.map +1 -1
- package/esm/utils/edge.d.ts +11 -0
- package/esm/utils/edge.js +1 -1
- package/esm/utils/edge.js.map +1 -1
- package/esm/utils/event/events.d.ts +1 -1
- package/esm/utils/event/events.js.map +1 -1
- package/esm/utils/extension.d.ts +1 -1
- package/esm/utils/extension.js.map +1 -1
- package/esm/utils/id.d.ts +3 -8
- package/esm/utils/id.js +8 -2
- package/esm/utils/id.js.map +1 -1
- package/esm/utils/line.d.ts +21 -0
- package/esm/utils/line.js +41 -0
- package/esm/utils/line.js.map +1 -0
- package/esm/utils/path.d.ts +35 -0
- package/esm/utils/path.js +143 -0
- package/esm/utils/path.js.map +1 -0
- package/esm/utils/point.d.ts +74 -20
- package/esm/utils/point.js +168 -44
- package/esm/utils/point.js.map +1 -1
- package/esm/utils/polygon.d.ts +17 -0
- package/esm/utils/polygon.js +62 -0
- package/esm/utils/polygon.js.map +1 -0
- package/esm/utils/position.d.ts +14 -1
- package/esm/utils/position.js +16 -0
- package/esm/utils/position.js.map +1 -1
- package/esm/utils/prefix.d.ts +1 -1
- package/esm/utils/prefix.js.map +1 -1
- package/esm/utils/shortcut.d.ts +1 -0
- package/esm/utils/shortcut.js +13 -2
- package/esm/utils/shortcut.js.map +1 -1
- package/esm/utils/style.js.map +1 -1
- package/esm/utils/vector.d.ts +3 -2
- package/esm/utils/vector.js +10 -3
- package/esm/utils/vector.js.map +1 -1
- package/lib/behaviors/brush-select.d.ts +104 -0
- package/lib/behaviors/brush-select.js +203 -0
- package/lib/behaviors/brush-select.js.map +1 -0
- package/lib/behaviors/click-element.d.ts +77 -0
- package/lib/behaviors/click-element.js +112 -0
- package/lib/behaviors/click-element.js.map +1 -0
- package/lib/behaviors/drag-element-force.d.ts +14 -0
- package/lib/behaviors/drag-element-force.js +59 -0
- package/lib/behaviors/drag-element-force.js.map +1 -0
- package/lib/behaviors/drag-element.d.ts +13 -12
- package/lib/behaviors/drag-element.js +17 -9
- package/lib/behaviors/drag-element.js.map +1 -1
- package/lib/behaviors/hover-element.js +1 -1
- package/lib/behaviors/hover-element.js.map +1 -1
- package/lib/behaviors/index.d.ts +8 -0
- package/lib/behaviors/index.js +9 -1
- package/lib/behaviors/index.js.map +1 -1
- package/lib/behaviors/lasso-select.d.ts +20 -0
- package/lib/behaviors/lasso-select.js +83 -0
- package/lib/behaviors/lasso-select.js.map +1 -0
- package/lib/behaviors/types.d.ts +1 -0
- package/lib/constants/change.d.ts +1 -1
- package/lib/constants/change.js +13 -13
- package/lib/constants/change.js.map +1 -1
- package/lib/constants/events/graph.d.ts +9 -7
- package/lib/constants/events/graph.js +9 -9
- package/lib/constants/events/graph.js.map +1 -1
- package/lib/constants/registry.d.ts +3 -1
- package/lib/constants/registry.js +2 -0
- package/lib/constants/registry.js.map +1 -1
- package/lib/elements/combos/base-combo.d.ts +43 -6
- package/lib/elements/combos/base-combo.js.map +1 -1
- package/lib/elements/combos/circle.d.ts +8 -12
- package/lib/elements/combos/circle.js.map +1 -1
- package/lib/elements/combos/rect.d.ts +5 -9
- package/lib/elements/combos/rect.js.map +1 -1
- package/lib/elements/edges/base-edge.d.ts +64 -10
- package/lib/elements/edges/base-edge.js.map +1 -1
- package/lib/elements/edges/cubic-horizontal.d.ts +2 -2
- package/lib/elements/edges/cubic-vertical.d.ts +2 -2
- package/lib/elements/edges/cubic.d.ts +2 -2
- package/lib/elements/edges/polyline.d.ts +2 -2
- package/lib/elements/edges/quadratic.d.ts +2 -2
- package/lib/elements/nodes/base-node.d.ts +104 -13
- package/lib/elements/nodes/base-node.js +4 -1
- package/lib/elements/nodes/base-node.js.map +1 -1
- package/lib/elements/nodes/circle.d.ts +5 -8
- package/lib/elements/nodes/circle.js.map +1 -1
- package/lib/elements/nodes/diamond.d.ts +2 -4
- package/lib/elements/nodes/diamond.js +2 -2
- package/lib/elements/nodes/diamond.js.map +1 -1
- package/lib/elements/nodes/ellipse.d.ts +5 -8
- package/lib/elements/nodes/ellipse.js +1 -1
- package/lib/elements/nodes/ellipse.js.map +1 -1
- package/lib/elements/nodes/hexagon.d.ts +6 -9
- package/lib/elements/nodes/hexagon.js.map +1 -1
- package/lib/elements/nodes/image.d.ts +9 -11
- package/lib/elements/nodes/image.js.map +1 -1
- package/lib/elements/nodes/polygon.d.ts +9 -8
- package/lib/elements/nodes/polygon.js +4 -1
- package/lib/elements/nodes/polygon.js.map +1 -1
- package/lib/elements/nodes/rect.d.ts +2 -3
- package/lib/elements/nodes/rect.js.map +1 -1
- package/lib/elements/nodes/star.d.ts +7 -10
- package/lib/elements/nodes/star.js.map +1 -1
- package/lib/elements/nodes/triangle.d.ts +7 -10
- package/lib/elements/nodes/triangle.js.map +1 -1
- package/lib/exports.d.ts +4 -2
- package/lib/exports.js +4 -1
- package/lib/exports.js.map +1 -1
- package/lib/layouts/index.d.ts +1 -1
- package/lib/layouts/index.js +2 -1
- package/lib/layouts/index.js.map +1 -1
- package/lib/layouts/types.d.ts +6 -6
- package/lib/palettes/index.d.ts +1 -0
- package/lib/palettes/index.js +13 -1
- package/lib/palettes/index.js.map +1 -1
- package/lib/plugins/history/events.d.ts +21 -0
- package/lib/plugins/history/events.js +19 -0
- package/lib/plugins/history/events.js.map +1 -0
- package/lib/plugins/history/index.d.ts +82 -0
- package/lib/plugins/history/index.js +175 -0
- package/lib/plugins/history/index.js.map +1 -0
- package/lib/plugins/history/utils.d.ts +31 -0
- package/lib/plugins/history/utils.js +84 -0
- package/lib/plugins/history/utils.js.map +1 -0
- package/lib/plugins/hull/index.d.ts +59 -0
- package/lib/plugins/hull/index.js +114 -0
- package/lib/plugins/hull/index.js.map +1 -0
- package/lib/plugins/hull/shape.d.ts +49 -0
- package/lib/plugins/hull/shape.js +39 -0
- package/lib/plugins/hull/shape.js.map +1 -0
- package/lib/plugins/hull/util.d.ts +12 -0
- package/lib/plugins/hull/util.js +207 -0
- package/lib/plugins/hull/util.js.map +1 -0
- 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.map +1 -1
- package/lib/registry/build-in.js +15 -0
- package/lib/registry/build-in.js.map +1 -1
- package/lib/registry/extension/index.d.ts +1 -1
- package/lib/registry/index.js +1 -0
- package/lib/registry/index.js.map +1 -1
- package/lib/registry/types.d.ts +4 -0
- package/lib/runtime/batch.d.ts +11 -0
- package/lib/runtime/batch.js +35 -0
- package/lib/runtime/batch.js.map +1 -0
- package/lib/runtime/behavior.d.ts +1 -1
- package/lib/runtime/behavior.js.map +1 -1
- package/lib/runtime/canvas.d.ts +13 -3
- package/lib/runtime/canvas.js +34 -10
- package/lib/runtime/canvas.js.map +1 -1
- package/lib/runtime/data.d.ts +4 -4
- package/lib/runtime/data.js +22 -24
- package/lib/runtime/data.js.map +1 -1
- package/lib/runtime/element.d.ts +3 -19
- package/lib/runtime/element.js +16 -137
- package/lib/runtime/element.js.map +1 -1
- package/lib/runtime/graph.d.ts +40 -2
- package/lib/runtime/graph.js +57 -1
- package/lib/runtime/graph.js.map +1 -1
- package/lib/runtime/layout.d.ts +5 -11
- package/lib/runtime/layout.js +27 -73
- package/lib/runtime/layout.js.map +1 -1
- package/lib/runtime/plugin.d.ts +1 -1
- package/lib/runtime/plugin.js.map +1 -1
- package/lib/runtime/transform.d.ts +11 -0
- package/lib/runtime/transform.js +24 -0
- package/lib/runtime/transform.js.map +1 -0
- package/lib/runtime/types.d.ts +14 -0
- package/lib/spec/index.d.ts +1 -0
- package/lib/spec/spec.d.ts +7 -0
- package/lib/spec/transform.d.ts +12 -0
- package/lib/spec/transform.js +3 -0
- package/lib/spec/transform.js.map +1 -0
- package/lib/themes/base.js +9 -1
- package/lib/themes/base.js.map +1 -1
- package/lib/transforms/arrange-draw-order.d.ts +10 -0
- package/lib/transforms/arrange-draw-order.js +31 -0
- package/lib/transforms/arrange-draw-order.js.map +1 -0
- package/lib/transforms/base-transform.d.ts +7 -0
- package/lib/transforms/base-transform.js +11 -0
- package/lib/transforms/base-transform.js.map +1 -0
- package/lib/transforms/collapse-expand-combo.d.ts +10 -0
- package/lib/transforms/collapse-expand-combo.js +86 -0
- package/lib/transforms/collapse-expand-combo.js.map +1 -0
- package/lib/transforms/index.d.ts +6 -0
- package/lib/transforms/index.js +14 -0
- package/lib/transforms/index.js.map +1 -0
- package/lib/transforms/process-parallel-edges.d.ts +84 -0
- package/lib/transforms/process-parallel-edges.js +222 -0
- package/lib/transforms/process-parallel-edges.js.map +1 -0
- package/lib/transforms/types.d.ts +20 -0
- package/lib/transforms/types.js +15 -0
- package/lib/transforms/types.js.map +1 -0
- package/lib/transforms/update-related-edge.d.ts +9 -0
- package/lib/transforms/update-related-edge.js +24 -0
- package/lib/transforms/update-related-edge.js.map +1 -0
- package/lib/types/canvas.d.ts +1 -1
- package/lib/types/change.d.ts +27 -10
- package/lib/types/element.d.ts +6 -140
- package/lib/types/node.d.ts +3 -3
- package/lib/types/point.d.ts +1 -0
- package/lib/utils/animation.d.ts +1 -1
- package/lib/utils/animation.js +6 -0
- package/lib/utils/animation.js.map +1 -1
- package/lib/utils/behaviors/brush.d.ts +19 -0
- package/lib/utils/behaviors/brush.js +30 -0
- package/lib/utils/behaviors/brush.js.map +1 -0
- package/lib/utils/behaviors/lasso.d.ts +13 -0
- package/lib/utils/behaviors/lasso.js +116 -0
- package/lib/utils/behaviors/lasso.js.map +1 -0
- package/lib/utils/behaviors/utils.d.ts +21 -0
- package/lib/utils/behaviors/utils.js +47 -0
- package/lib/utils/behaviors/utils.js.map +1 -0
- package/lib/utils/change.d.ts +9 -1
- package/lib/utils/change.js +30 -1
- package/lib/utils/change.js.map +1 -1
- package/lib/utils/combo.d.ts +5 -4
- package/lib/utils/combo.js.map +1 -1
- package/lib/utils/edge.d.ts +11 -0
- package/lib/utils/edge.js +2 -1
- package/lib/utils/edge.js.map +1 -1
- package/lib/utils/event/events.d.ts +1 -1
- package/lib/utils/event/events.js.map +1 -1
- package/lib/utils/extension.d.ts +1 -1
- package/lib/utils/extension.js.map +1 -1
- package/lib/utils/id.d.ts +3 -8
- package/lib/utils/id.js +10 -4
- package/lib/utils/id.js.map +1 -1
- package/lib/utils/line.d.ts +21 -0
- package/lib/utils/line.js +46 -0
- package/lib/utils/line.js.map +1 -0
- package/lib/utils/path.d.ts +35 -0
- package/lib/utils/path.js +150 -0
- package/lib/utils/path.js.map +1 -0
- package/lib/utils/point.d.ts +74 -20
- package/lib/utils/point.js +178 -48
- package/lib/utils/point.js.map +1 -1
- package/lib/utils/polygon.d.ts +17 -0
- package/lib/utils/polygon.js +66 -0
- package/lib/utils/polygon.js.map +1 -0
- package/lib/utils/position.d.ts +14 -1
- package/lib/utils/position.js +18 -1
- package/lib/utils/position.js.map +1 -1
- package/lib/utils/prefix.d.ts +1 -1
- package/lib/utils/prefix.js.map +1 -1
- package/lib/utils/shortcut.d.ts +1 -0
- package/lib/utils/shortcut.js +12 -1
- package/lib/utils/shortcut.js.map +1 -1
- package/lib/utils/style.js.map +1 -1
- package/lib/utils/vector.d.ts +3 -2
- package/lib/utils/vector.js +10 -3
- package/lib/utils/vector.js.map +1 -1
- package/package.json +5 -6
- package/src/behaviors/brush-select.ts +306 -0
- package/src/behaviors/click-element.ts +182 -0
- package/src/behaviors/drag-element-force.ts +70 -0
- package/src/behaviors/drag-element.ts +27 -17
- package/src/behaviors/hover-element.ts +2 -3
- package/src/behaviors/index.ts +8 -0
- package/src/behaviors/lasso-select.ts +103 -0
- package/src/behaviors/types.ts +2 -0
- package/src/constants/change.ts +1 -1
- package/src/constants/events/graph.ts +8 -8
- package/src/constants/registry.ts +2 -0
- package/src/elements/combos/base-combo.ts +59 -10
- package/src/elements/combos/circle.ts +8 -11
- package/src/elements/combos/rect.ts +5 -8
- package/src/elements/edges/base-edge.ts +70 -13
- package/src/elements/edges/cubic-horizontal.ts +2 -2
- package/src/elements/edges/cubic-vertical.ts +2 -2
- package/src/elements/edges/cubic.ts +2 -2
- package/src/elements/edges/polyline.ts +2 -2
- package/src/elements/edges/quadratic.ts +2 -2
- package/src/elements/nodes/base-node.ts +115 -19
- package/src/elements/nodes/circle.ts +5 -7
- package/src/elements/nodes/diamond.ts +4 -6
- package/src/elements/nodes/ellipse.ts +6 -8
- package/src/elements/nodes/hexagon.ts +7 -9
- package/src/elements/nodes/image.ts +12 -13
- package/src/elements/nodes/polygon.ts +17 -11
- package/src/elements/nodes/rect.ts +3 -4
- package/src/elements/nodes/star.ts +9 -11
- package/src/elements/nodes/triangle.ts +7 -9
- package/src/exports.ts +4 -2
- package/src/layouts/index.ts +1 -0
- package/src/layouts/types.ts +7 -5
- package/src/palettes/index.ts +13 -0
- package/src/plugins/history/events.ts +25 -0
- package/src/plugins/history/index.ts +222 -0
- package/src/plugins/history/utils.ts +98 -0
- package/src/plugins/hull/index.ts +149 -0
- package/src/plugins/hull/shape.ts +96 -0
- package/src/plugins/hull/util.ts +222 -0
- package/src/plugins/index.ts +4 -0
- package/src/plugins/legend.ts +1 -1
- package/src/registry/build-in.ts +22 -2
- package/src/registry/extension/index.ts +1 -1
- package/src/registry/index.ts +1 -0
- package/src/registry/types.ts +2 -0
- package/src/runtime/batch.ts +38 -0
- package/src/runtime/behavior.ts +1 -1
- package/src/runtime/canvas.ts +51 -13
- package/src/runtime/data.ts +31 -36
- package/src/runtime/element.ts +28 -167
- package/src/runtime/graph.ts +65 -3
- package/src/runtime/layout.ts +48 -79
- package/src/runtime/plugin.ts +1 -1
- package/src/runtime/transform.ts +27 -0
- package/src/runtime/types.ts +14 -0
- package/src/spec/index.ts +1 -0
- package/src/spec/spec.ts +7 -0
- package/src/spec/transform.ts +15 -0
- package/src/themes/base.ts +9 -1
- package/src/transforms/arrange-draw-order.ts +36 -0
- package/src/transforms/base-transform.ts +11 -0
- package/src/transforms/collapse-expand-combo.ts +87 -0
- package/src/transforms/index.ts +7 -0
- package/src/transforms/process-parallel-edges.ts +286 -0
- package/src/transforms/types.ts +23 -0
- package/src/transforms/update-related-edge.ts +28 -0
- package/src/types/canvas.ts +1 -1
- package/src/types/change.ts +28 -10
- package/src/types/element.ts +6 -147
- package/src/types/node.ts +3 -3
- package/src/types/point.ts +1 -0
- package/src/utils/animation.ts +6 -0
- package/src/utils/behaviors/brush.ts +29 -0
- package/src/utils/behaviors/lasso.ts +127 -0
- package/src/utils/behaviors/utils.ts +47 -0
- package/src/utils/change.ts +42 -1
- package/src/utils/combo.ts +6 -5
- package/src/utils/edge.ts +6 -1
- package/src/utils/event/events.ts +3 -1
- package/src/utils/extension.ts +1 -1
- package/src/utils/id.ts +11 -2
- package/src/utils/line.ts +50 -0
- package/src/utils/path.ts +153 -0
- package/src/utils/point.ts +190 -51
- package/src/utils/polygon.ts +72 -0
- package/src/utils/position.ts +18 -1
- package/src/utils/prefix.ts +1 -1
- package/src/utils/shortcut.ts +13 -2
- package/src/utils/style.ts +1 -1
- package/src/utils/vector.ts +10 -3
- package/esm/elements/types.d.ts +0 -0
- package/esm/elements/types.js +0 -15
- package/esm/elements/types.js.map +0 -1
- package/lib/elements/types.d.ts +0 -0
- package/lib/elements/types.js +0 -15
- package/lib/elements/types.js.map +0 -1
- package/src/elements/types.ts +0 -21
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { DisplayObjectConfig, Group, PathStyleProps } from '@antv/g';
|
|
2
|
+
import type { LabelStyleProps } from '../../elements/shapes';
|
|
3
|
+
import { BaseShape } from '../../elements/shapes';
|
|
4
|
+
import type { CardinalPlacement, PrefixObject } from '../../types';
|
|
5
|
+
type HullLabelStyleProps = LabelStyleProps & {
|
|
6
|
+
/**
|
|
7
|
+
* <zh/> 标签位置,可选值为 'top'、'right'、'bottom'、'left'、'center';默认为 'bottom'
|
|
8
|
+
* <en/> Label position, optional values are 'top', 'right', 'bottom', 'left', 'center'; default is 'bottom'
|
|
9
|
+
*/
|
|
10
|
+
placement?: CardinalPlacement | 'center';
|
|
11
|
+
/**
|
|
12
|
+
* <zh/> 标签是否贴合轮廓,默认为 true
|
|
13
|
+
* <en/> Whether the label is close to the contour, default is true
|
|
14
|
+
*/
|
|
15
|
+
closeToHull?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* <zh/> 标签是否跟随轮廓旋转,默认为 true,仅在 closeToHull 为 true 时生效
|
|
18
|
+
* <en/> Whether the label rotates with the contour, default is true. Only effective when closeToHull is true
|
|
19
|
+
*/
|
|
20
|
+
autoRotate?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* <zh/> x 轴偏移量
|
|
23
|
+
* <en/> Label x-axis offset
|
|
24
|
+
*/
|
|
25
|
+
offsetX?: number;
|
|
26
|
+
/**
|
|
27
|
+
* <zh/> y 轴偏移量
|
|
28
|
+
* <en/> Label y-axis offset
|
|
29
|
+
*/
|
|
30
|
+
offsetY?: number;
|
|
31
|
+
/**
|
|
32
|
+
* <zh/> 文本的最大宽度,超出会自动省略
|
|
33
|
+
* <en/> The maximum width of the text, which will be automatically ellipsis if exceeded
|
|
34
|
+
*/
|
|
35
|
+
maxWidth?: number;
|
|
36
|
+
};
|
|
37
|
+
export type HullStyleProps = PathStyleProps & {
|
|
38
|
+
label?: boolean;
|
|
39
|
+
} & PrefixObject<HullLabelStyleProps, 'label'>;
|
|
40
|
+
type ParsedHullStyleProps = Required<HullStyleProps>;
|
|
41
|
+
type HullOptions = DisplayObjectConfig<HullStyleProps>;
|
|
42
|
+
export declare class Hull extends BaseShape<HullStyleProps> {
|
|
43
|
+
static defaultStyleProps: Partial<HullStyleProps>;
|
|
44
|
+
constructor(options: HullOptions);
|
|
45
|
+
protected getLabelStyle(attributes: ParsedHullStyleProps): LabelStyleProps | false;
|
|
46
|
+
protected getContourStyle(attributes: ParsedHullStyleProps): Omit<Required<HullStyleProps>, "transform" | "x" | "y" | "z" | "zIndex" | "className" | "transformOrigin" | "context">;
|
|
47
|
+
render(attributes: ParsedHullStyleProps, container: Group): void;
|
|
48
|
+
}
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type PathArray } from '@antv/util';
|
|
2
|
+
import type { Point } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* <zh/> 计算 Hull 路径
|
|
5
|
+
*
|
|
6
|
+
* <en/> Compute Hull Path
|
|
7
|
+
* @param points - <zh/> 顶点列表 | <en/> Vertices of Hull
|
|
8
|
+
* @param padding - <zh/> 内边距 | <en/> padding
|
|
9
|
+
* @param corner - <zh/> 拐角类型,目前支持 'sharp'、'rounded' 和 'smooth' | <en/> Corner type, currently supports 'sharp', 'rounded' and 'smooth'
|
|
10
|
+
* @returns <zh/> Hull 路径 | <en/> Hull Path
|
|
11
|
+
*/
|
|
12
|
+
export declare function computeHullPath(points: Point[], padding: number, corner: 'rounded' | 'smooth' | 'sharp'): PathArray;
|
|
@@ -2,6 +2,8 @@ export { BasePlugin } from './base-plugin';
|
|
|
2
2
|
export { CameraSetting } from './camera-setting';
|
|
3
3
|
export { Contextmenu } from './contextmenu';
|
|
4
4
|
export { GridLine } from './grid-line';
|
|
5
|
+
export { History } from './history';
|
|
6
|
+
export { Hull } from './hull';
|
|
5
7
|
export { Legend } from './legend';
|
|
6
8
|
export { Toolbar } from './toolbar';
|
|
7
9
|
export { Tooltip } from './tooltip';
|
|
@@ -10,6 +12,8 @@ export type { BasePluginOptions } from './base-plugin';
|
|
|
10
12
|
export type { CameraSettingOptions } from './camera-setting';
|
|
11
13
|
export type { ContextmenuOptions } from './contextmenu';
|
|
12
14
|
export type { GridLineOptions } from './grid-line';
|
|
15
|
+
export type { HistoryOptions } from './history';
|
|
16
|
+
export type { HullOptions } from './hull';
|
|
13
17
|
export type { LegendOptions } from './legend';
|
|
14
18
|
export type { ToolbarOptions } from './toolbar';
|
|
15
19
|
export type { TooltipOptions } from './tooltip';
|
|
@@ -6,7 +6,7 @@ export declare abstract class ExtensionController<Extension extends BaseExtensio
|
|
|
6
6
|
protected context: RuntimeContext;
|
|
7
7
|
protected extensions: STDExtensionOption[];
|
|
8
8
|
protected extensionMap: Record<string, Extension>;
|
|
9
|
-
abstract category: 'plugin' | 'behavior';
|
|
9
|
+
abstract category: 'plugin' | 'behavior' | 'transform';
|
|
10
10
|
constructor(context: RuntimeContext);
|
|
11
11
|
setExtensions(extensions: ExtensionOptions): void;
|
|
12
12
|
protected createExtension(extension: STDExtensionOption): void;
|
|
@@ -4,6 +4,7 @@ import type { Behavior } from '../behaviors/types';
|
|
|
4
4
|
import type { STDPalette } from '../palettes/types';
|
|
5
5
|
import type { Plugin } from '../plugins/types';
|
|
6
6
|
import type { Theme } from '../themes/types';
|
|
7
|
+
import type { Transform } from '../transforms/types';
|
|
7
8
|
import type { Combo, Edge, Node } from '../types';
|
|
8
9
|
/**
|
|
9
10
|
* <zh/> 扩展注册表
|
|
@@ -32,4 +33,7 @@ export interface ExtensionRegistry {
|
|
|
32
33
|
new (...args: any[]): Plugin;
|
|
33
34
|
}>;
|
|
34
35
|
animation: Record<string, STDAnimation>;
|
|
36
|
+
transform: Record<string, {
|
|
37
|
+
new (...args: any[]): Transform;
|
|
38
|
+
}>;
|
|
35
39
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RuntimeContext } from './types';
|
|
2
|
+
export declare class BatchController {
|
|
3
|
+
private context;
|
|
4
|
+
private batchCount;
|
|
5
|
+
constructor(context: RuntimeContext);
|
|
6
|
+
private emit;
|
|
7
|
+
startBatch(initiate?: boolean): void;
|
|
8
|
+
endBatch(): void;
|
|
9
|
+
get isBatching(): boolean;
|
|
10
|
+
destroy(): void;
|
|
11
|
+
}
|
|
@@ -5,7 +5,7 @@ import type { RuntimeContext } from './types';
|
|
|
5
5
|
export declare class BehaviorController extends ExtensionController<BaseBehavior<CustomBehaviorOption>> {
|
|
6
6
|
/** <zh/> 当前事件的目标 | <en/> The current event target */
|
|
7
7
|
private currentTarget;
|
|
8
|
-
category:
|
|
8
|
+
category: "behavior";
|
|
9
9
|
constructor(context: RuntimeContext);
|
|
10
10
|
setBehaviors(behaviors: BehaviorOptions): void;
|
|
11
11
|
private forwardEvents;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Cursor,
|
|
1
|
+
import type { Cursor, DisplayObject, CanvasConfig as GCanvasConfig, DataURLOptions as GDataURLOptions, IRenderer, PointLike } from '@antv/g';
|
|
2
2
|
import { Canvas as GCanvas } from '@antv/g';
|
|
3
3
|
import type { CanvasOptions } from '../spec/canvas';
|
|
4
4
|
import type { CanvasLayer } from '../types/canvas';
|
|
@@ -6,6 +6,18 @@ export interface CanvasConfig extends Pick<GCanvasConfig, 'container' | 'deviceP
|
|
|
6
6
|
renderer?: CanvasOptions['renderer'];
|
|
7
7
|
background?: string;
|
|
8
8
|
}
|
|
9
|
+
export interface DataURLOptions extends GDataURLOptions {
|
|
10
|
+
/**
|
|
11
|
+
* <zh/> 导出模式
|
|
12
|
+
* - viewport: 导出视口内容
|
|
13
|
+
* - overall: 导出整个画布
|
|
14
|
+
*
|
|
15
|
+
* <en/> export mode
|
|
16
|
+
* - viewport: export the content of the viewport
|
|
17
|
+
* - overall: export the entire canvas
|
|
18
|
+
*/
|
|
19
|
+
mode?: 'viewport' | 'overall';
|
|
20
|
+
}
|
|
9
21
|
/**
|
|
10
22
|
* @deprecated this canvas will be replace by layered canvas
|
|
11
23
|
*/
|
|
@@ -15,12 +27,10 @@ export declare class Canvas {
|
|
|
15
27
|
main: GCanvas;
|
|
16
28
|
label: GCanvas;
|
|
17
29
|
transient: GCanvas;
|
|
18
|
-
transientLabel: GCanvas;
|
|
19
30
|
get canvas(): {
|
|
20
31
|
main: GCanvas;
|
|
21
32
|
label: GCanvas;
|
|
22
33
|
transient: GCanvas;
|
|
23
|
-
transientLabel: GCanvas;
|
|
24
34
|
background: GCanvas;
|
|
25
35
|
};
|
|
26
36
|
get document(): import("@antv/g").Document;
|
|
@@ -46,6 +46,7 @@ export declare class DataController {
|
|
|
46
46
|
* @returns <zh/> 数据变更 | <en/> data changes
|
|
47
47
|
*/
|
|
48
48
|
getChanges(): DataChange[];
|
|
49
|
+
clearChanges(): void;
|
|
49
50
|
batch(callback: () => void): void;
|
|
50
51
|
/**
|
|
51
52
|
* <zh/> 执行操作而不会留下记录
|
|
@@ -69,9 +70,8 @@ export declare class DataController {
|
|
|
69
70
|
getComboData(ids?: ID[]): ComboData[];
|
|
70
71
|
getAncestorsData(id: ID, hierarchy: HierarchyKey): NodeLikeData[];
|
|
71
72
|
getDescendantsData(id: ID): NodeLikeData[];
|
|
72
|
-
getParentData(id: ID, hierarchy
|
|
73
|
+
getParentData(id: ID, hierarchy: HierarchyKey): NodeLikeData | undefined;
|
|
73
74
|
getChildrenData(id: ID): NodeLikeData[];
|
|
74
|
-
private inferStructureKey;
|
|
75
75
|
/**
|
|
76
76
|
* <zh/> 获取指定类型元素的数据
|
|
77
77
|
*
|
|
@@ -79,7 +79,7 @@ export declare class DataController {
|
|
|
79
79
|
* @param elementType - <zh/> 元素类型 | <en/> element type
|
|
80
80
|
* @returns <zh/> 元素数据 | <en/> element data
|
|
81
81
|
*/
|
|
82
|
-
getElementData(elementType: ElementType): NodeData[] | EdgeData[]
|
|
82
|
+
getElementData(elementType: ElementType): NodeData[] | EdgeData[];
|
|
83
83
|
/**
|
|
84
84
|
* <zh/> 根据 ID 获取元素的数据,不用关心元素的类型
|
|
85
85
|
*
|
|
@@ -96,7 +96,7 @@ export declare class DataController {
|
|
|
96
96
|
* @returns <zh/> 节点和 combo 的数据 | <en/> node and combo data
|
|
97
97
|
*/
|
|
98
98
|
getNodeLikeData(ids?: ID[]): NodeLikeData[];
|
|
99
|
-
getElementDataByState(elementType: ElementType, state: string): (NodeData | EdgeData
|
|
99
|
+
getElementDataByState(elementType: ElementType, state: string): (NodeData | EdgeData)[];
|
|
100
100
|
getElementState(id: ID): State[];
|
|
101
101
|
hasNode(id: ID): boolean;
|
|
102
102
|
hasEdge(id: ID): boolean;
|
|
@@ -13,7 +13,7 @@ export declare class ElementController {
|
|
|
13
13
|
private emit;
|
|
14
14
|
private forEachElementData;
|
|
15
15
|
private getTheme;
|
|
16
|
-
getThemeStyle(elementType: ElementType): import("../spec/element/node").NodeStyle | import("../spec/element/edge").EdgeStyle
|
|
16
|
+
getThemeStyle(elementType: ElementType): import("../spec/element/node").NodeStyle | import("../spec/element/edge").EdgeStyle;
|
|
17
17
|
getThemeStateStyle(elementType: ElementType, states: State[]): any;
|
|
18
18
|
private paletteStyle;
|
|
19
19
|
private computePaletteStyle;
|
|
@@ -79,24 +79,8 @@ export declare class ElementController {
|
|
|
79
79
|
* <en/> start render process
|
|
80
80
|
*/
|
|
81
81
|
draw(drawContext?: DrawContext): Promise<void>;
|
|
82
|
-
private
|
|
83
|
-
|
|
84
|
-
* 如果更新了节点 / combo,需要更新连接的边
|
|
85
|
-
* If the node / combo is updated, the connected edge and the combo it is in need to be updated
|
|
86
|
-
*/
|
|
87
|
-
private updateRelatedEdgeFlow;
|
|
88
|
-
/**
|
|
89
|
-
* <zh/> 调整元素绘制顺序
|
|
90
|
-
*
|
|
91
|
-
* <en/> Adjust the drawing order of elements
|
|
92
|
-
*/
|
|
93
|
-
private arrangeDrawOrderFlow;
|
|
94
|
-
/**
|
|
95
|
-
* <zh/> 处理元素的收起和展开
|
|
96
|
-
*
|
|
97
|
-
* <en/> Process the collapse and expand of elements
|
|
98
|
-
*/
|
|
99
|
-
private collapseExpandFlow;
|
|
82
|
+
private computeChangesAndDrawData;
|
|
83
|
+
private transformData;
|
|
100
84
|
private createElement;
|
|
101
85
|
private getCreateTasks;
|
|
102
86
|
/**
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import EventEmitter from '@antv/event-emitter';
|
|
2
|
-
import type { AABB, BaseStyleProps
|
|
2
|
+
import type { AABB, BaseStyleProps } from '@antv/g';
|
|
3
3
|
import type { ID } from '@antv/graphlib';
|
|
4
4
|
import type { Plugin } from '../plugins/types';
|
|
5
|
-
import type { BehaviorOptions, ComboData, ComboOptions, EdgeData, EdgeOptions, G6Spec, GraphData, LayoutOptions, NodeData, NodeOptions, PluginOptions, ThemeOptions } from '../spec';
|
|
5
|
+
import type { BehaviorOptions, ComboData, ComboOptions, EdgeData, EdgeOptions, G6Spec, GraphData, LayoutOptions, NodeData, NodeOptions, PluginOptions, ThemeOptions, TransformOptions } from '../spec';
|
|
6
6
|
import type { UpdateBehaviorOption } from '../spec/behavior';
|
|
7
7
|
import type { UpdatePluginOption } from '../spec/plugin';
|
|
8
|
+
import type { UpdateTransformOption } from '../spec/transform';
|
|
8
9
|
import type { CallableValue, DataID, EdgeDirection, ElementType, FitViewOptions, IEvent, NodeLikeData, PartialEdgeData, PartialGraphData, PartialNodeLikeData, Point, Position, State, ViewportAnimationEffectTiming } from '../types';
|
|
10
|
+
import type { DataURLOptions } from './canvas';
|
|
9
11
|
import { Canvas } from './canvas';
|
|
10
12
|
import type { HierarchyKey } from './data';
|
|
11
13
|
export declare class Graph extends EventEmitter {
|
|
@@ -95,6 +97,27 @@ export declare class Graph extends EventEmitter {
|
|
|
95
97
|
* @returns <zh/> 插件实例 | <en/> plugin instance
|
|
96
98
|
*/
|
|
97
99
|
getPluginInstance<T extends Plugin>(key: string): T;
|
|
100
|
+
/**
|
|
101
|
+
* <zh/> 设置数据转换器
|
|
102
|
+
*
|
|
103
|
+
* <en/> Set data transforms
|
|
104
|
+
* @param transforms - <zh/> 数据转换配置 | <en/> data transform configuration
|
|
105
|
+
*/
|
|
106
|
+
setTransforms(transforms: CallableValue<TransformOptions>): void;
|
|
107
|
+
/**
|
|
108
|
+
* <zh/> 更新数据转换器
|
|
109
|
+
*
|
|
110
|
+
* <en/> Update data transform
|
|
111
|
+
* @param transform - <zh/> 数据转换配置 | <en/> data transform configuration
|
|
112
|
+
*/
|
|
113
|
+
updateTransform(transform: UpdateTransformOption): void;
|
|
114
|
+
/**
|
|
115
|
+
* <zh/> 获取数据转换器
|
|
116
|
+
*
|
|
117
|
+
* <en/> Get data transforms
|
|
118
|
+
* @returns <zh/> 数据转换器实例 | <en/> data transform instance
|
|
119
|
+
*/
|
|
120
|
+
getTransforms(): TransformOptions;
|
|
98
121
|
getData(): GraphData;
|
|
99
122
|
getNodeData(): NodeData[];
|
|
100
123
|
getNodeData(id: ID): NodeData;
|
|
@@ -433,6 +456,21 @@ export declare class Graph extends EventEmitter {
|
|
|
433
456
|
collapse(id: ID, animation?: boolean): Promise<void>;
|
|
434
457
|
expand(id: ID, animation?: boolean): Promise<void>;
|
|
435
458
|
private setElementCollapsibility;
|
|
459
|
+
/**
|
|
460
|
+
* <zh/> 导出画布内容为 DataURL
|
|
461
|
+
*
|
|
462
|
+
* <en/> Export canvas content as DataURL
|
|
463
|
+
* @param options - <zh/> 导出配置 | <en/> export configuration
|
|
464
|
+
* @param mode
|
|
465
|
+
* <zh/> 导出模式
|
|
466
|
+
* - viewport: 导出视口内容
|
|
467
|
+
* - overall: 导出整个画布
|
|
468
|
+
*
|
|
469
|
+
* <en/> export mode
|
|
470
|
+
* - viewport: export the content of the viewport
|
|
471
|
+
* - overall: export the entire canvas
|
|
472
|
+
* @returns <zh/> DataURL | <en/> DataURL
|
|
473
|
+
*/
|
|
436
474
|
toDataURL(options?: Partial<DataURLOptions>): Promise<string>;
|
|
437
475
|
getCanvasByViewport(point: Point): Point;
|
|
438
476
|
getViewportByCanvas(point: Point): Point;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Graph as Graphlib } from '@antv/graphlib';
|
|
2
|
-
import type { LayoutMapping } from '@antv/layout';
|
|
2
|
+
import type { Layout, LayoutMapping } from '@antv/layout';
|
|
3
3
|
import type { EdgeData, NodeData } from '../spec';
|
|
4
4
|
import type { STDLayoutOptions } from '../spec/layout';
|
|
5
5
|
import type { RuntimeContext } from './types';
|
|
@@ -8,21 +8,15 @@ export declare class LayoutController {
|
|
|
8
8
|
private context;
|
|
9
9
|
private supervisor?;
|
|
10
10
|
private instance?;
|
|
11
|
+
private instances;
|
|
11
12
|
private animationResult?;
|
|
12
13
|
private get presetOptions();
|
|
13
14
|
private get options();
|
|
14
15
|
constructor(context: RuntimeContext);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
*
|
|
18
|
-
* <en/> Initialize layout position
|
|
19
|
-
* @param model - <zh/> 布局数据 | <en/> Layout data
|
|
20
|
-
* @param options - <zh/> 预设布局配置项 | <en/> Preset layout options
|
|
21
|
-
* @returns <zh/> 布局结果 | <en/> Layout result
|
|
22
|
-
*/
|
|
23
|
-
private presetLayout;
|
|
16
|
+
getLayoutInstance(): Layout<unknown>[];
|
|
17
|
+
getLayoutInstance(index: number): Layout<unknown>;
|
|
24
18
|
layout(): Promise<void>;
|
|
25
|
-
stepLayout(model: LayoutGraphlibModel, options: STDLayoutOptions): Promise<LayoutMapping>;
|
|
19
|
+
stepLayout(model: LayoutGraphlibModel, options: STDLayoutOptions, index: number): Promise<LayoutMapping>;
|
|
26
20
|
private graphLayout;
|
|
27
21
|
private treeLayout;
|
|
28
22
|
stopLayout(): void;
|
|
@@ -3,7 +3,7 @@ import { ExtensionController } from '../registry/extension';
|
|
|
3
3
|
import type { CustomPluginOption, PluginOptions } from '../spec/plugin';
|
|
4
4
|
import type { RuntimeContext } from './types';
|
|
5
5
|
export declare class PluginController extends ExtensionController<BasePlugin<CustomPluginOption>> {
|
|
6
|
-
category:
|
|
6
|
+
category: "plugin";
|
|
7
7
|
constructor(context: RuntimeContext);
|
|
8
8
|
setPlugins(plugins: PluginOptions): void;
|
|
9
9
|
getPluginInstance(key: string): BasePlugin<CustomPluginOption>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ExtensionController } from '../registry/extension';
|
|
2
|
+
import type { CustomTransformOption, TransformOptions } from '../spec/transform';
|
|
3
|
+
import { BaseTransform } from '../transforms';
|
|
4
|
+
import type { RuntimeContext } from './types';
|
|
5
|
+
export declare const REQUIRED_TRANSFORMS: TransformOptions;
|
|
6
|
+
export declare class TransformController extends ExtensionController<BaseTransform<CustomTransformOption>> {
|
|
7
|
+
category: "transform";
|
|
8
|
+
constructor(context: RuntimeContext);
|
|
9
|
+
setTransforms(transforms: TransformOptions): void;
|
|
10
|
+
getTransformInstance(key?: string): BaseTransform<CustomTransformOption> | Record<string, BaseTransform<CustomTransformOption>>;
|
|
11
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { G6Spec } from '../spec';
|
|
2
|
+
import type { BatchController } from './batch';
|
|
2
3
|
import type { BehaviorController } from './behavior';
|
|
3
4
|
import type { Canvas } from './canvas';
|
|
4
5
|
import type { DataController } from './data';
|
|
@@ -6,6 +7,7 @@ import type { ElementController } from './element';
|
|
|
6
7
|
import type { Graph } from './graph';
|
|
7
8
|
import type { LayoutController } from './layout';
|
|
8
9
|
import type { PluginController } from './plugin';
|
|
10
|
+
import type { TransformController } from './transform';
|
|
9
11
|
import type { ViewportController } from './viewport';
|
|
10
12
|
export interface RuntimeContext {
|
|
11
13
|
/**
|
|
@@ -32,6 +34,12 @@ export interface RuntimeContext {
|
|
|
32
34
|
* <en/> Data model
|
|
33
35
|
*/
|
|
34
36
|
model: DataController;
|
|
37
|
+
/**
|
|
38
|
+
* <zh/> 数据转换控制器
|
|
39
|
+
*
|
|
40
|
+
* <en/> Data transform controller
|
|
41
|
+
*/
|
|
42
|
+
transform: TransformController;
|
|
35
43
|
/**
|
|
36
44
|
* <zh/> 元素控制器
|
|
37
45
|
*
|
|
@@ -66,4 +74,10 @@ export interface RuntimeContext {
|
|
|
66
74
|
* <en/> Plugin controller
|
|
67
75
|
*/
|
|
68
76
|
plugin?: PluginController;
|
|
77
|
+
/**
|
|
78
|
+
* <zh/> 批量操作控制器
|
|
79
|
+
*
|
|
80
|
+
* <en/> Batch operation controller
|
|
81
|
+
*/
|
|
82
|
+
batch?: BatchController;
|
|
69
83
|
}
|
package/dist/lib/spec/index.d.ts
CHANGED
|
@@ -8,4 +8,5 @@ export type { LayoutOptions } from './layout';
|
|
|
8
8
|
export type { PluginOptions } from './plugin';
|
|
9
9
|
export type { G6Spec } from './spec';
|
|
10
10
|
export type { ThemeOptions } from './theme';
|
|
11
|
+
export type { TransformOptions } from './transform';
|
|
11
12
|
export type { ViewportOptions } from './viewport';
|
package/dist/lib/spec/spec.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import type { NodeOptions } from './element/node';
|
|
|
8
8
|
import type { LayoutOptions } from './layout';
|
|
9
9
|
import type { PluginOptions } from './plugin';
|
|
10
10
|
import type { ThemeOptions } from './theme';
|
|
11
|
+
import type { TransformOptions } from './transform';
|
|
11
12
|
import type { ViewportOptions } from './viewport';
|
|
12
13
|
/**
|
|
13
14
|
* <zh/> Spec 定义
|
|
@@ -73,4 +74,10 @@ export interface G6Spec extends CanvasOptions, ViewportOptions {
|
|
|
73
74
|
* <en/> Canvas plugins
|
|
74
75
|
*/
|
|
75
76
|
plugins?: PluginOptions;
|
|
77
|
+
/**
|
|
78
|
+
* <zh/> 数据转换器
|
|
79
|
+
*
|
|
80
|
+
* <en/> Data transforms
|
|
81
|
+
*/
|
|
82
|
+
transforms?: TransformOptions;
|
|
76
83
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ExtensionOptions } from '../registry/extension/types';
|
|
2
|
+
import type { BuiltInTransformOptions } from '../transforms/types';
|
|
3
|
+
export type TransformOptions = ExtensionOptions<BuiltInTransformOptions>;
|
|
4
|
+
export interface UpdateTransformOption {
|
|
5
|
+
key: string;
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
}
|
|
8
|
+
export interface CustomTransformOption {
|
|
9
|
+
type?: string;
|
|
10
|
+
key?: string;
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BaseTransform } from './base-transform';
|
|
2
|
+
import type { DrawData } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* <zh/> 调整元素绘制顺序
|
|
5
|
+
*
|
|
6
|
+
* <en/> Adjust the drawing order of elements
|
|
7
|
+
*/
|
|
8
|
+
export declare class ArrangeDrawOrder extends BaseTransform {
|
|
9
|
+
beforeDraw(input: DrawData): DrawData;
|
|
10
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BaseExtension } from '../registry/extension';
|
|
2
|
+
import type { CustomBehaviorOption } from '../spec/behavior';
|
|
3
|
+
import type { DrawData } from './types';
|
|
4
|
+
export type BaseTransformOptions = CustomBehaviorOption;
|
|
5
|
+
export declare abstract class BaseTransform<T extends BaseTransformOptions = BaseTransformOptions> extends BaseExtension<T> {
|
|
6
|
+
beforeDraw(data: DrawData): DrawData;
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BaseTransform } from './base-transform';
|
|
2
|
+
import type { DrawData } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* <zh/> 处理元素的收起和展开
|
|
5
|
+
*
|
|
6
|
+
* <en/> Process the collapse and expand of elements
|
|
7
|
+
*/
|
|
8
|
+
export declare class CollapseExpandCombo extends BaseTransform {
|
|
9
|
+
beforeDraw(input: DrawData): DrawData;
|
|
10
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { ArrangeDrawOrder } from './arrange-draw-order';
|
|
2
|
+
export { BaseTransform } from './base-transform';
|
|
3
|
+
export { CollapseExpandCombo } from './collapse-expand-combo';
|
|
4
|
+
export { ProcessParallelEdges } from './process-parallel-edges';
|
|
5
|
+
export { UpdateRelatedEdge } from './update-related-edge';
|
|
6
|
+
export type { BaseTransformOptions } from './base-transform';
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { PathStyleProps } from '@antv/g';
|
|
2
|
+
import type { ID } from '@antv/graphlib';
|
|
3
|
+
import type { RuntimeContext } from '../runtime/types';
|
|
4
|
+
import type { EdgeData } from '../spec';
|
|
5
|
+
import type { ElementDatum, ElementType } from '../types';
|
|
6
|
+
import type { BaseTransformOptions } from './base-transform';
|
|
7
|
+
import { BaseTransform } from './base-transform';
|
|
8
|
+
import type { DrawData } from './types';
|
|
9
|
+
export interface ProcessParallelEdgesOptions extends BaseTransformOptions {
|
|
10
|
+
/**
|
|
11
|
+
* <zh/> 处理模式,默认为捆绑
|
|
12
|
+
*
|
|
13
|
+
* <en/> Processing mode, default is bundle
|
|
14
|
+
* @description
|
|
15
|
+
* <zh/>
|
|
16
|
+
* - merge: 将平行边合并为一条边,适用于不需要区分平行边的情况
|
|
17
|
+
* - bundle: 每条边都会与其他所有平行边捆绑在一起,并通过改变曲率与其他边分开。如果一组平行边的数量是奇数,那么中心的边将被绘制为直线,其他的边将被绘制为曲线
|
|
18
|
+
* <en/>
|
|
19
|
+
* - merge: Merge parallel edges into one edge which is suitable for cases where parallel edges do not need to be distinguished
|
|
20
|
+
* - bundle: Each edge will be bundled with all other parallel edges and separated from them by varying the curvature. If the number of parallel edges in a group is odd, the central edge will be drawn as a straight line, and the others will be drawn as curves
|
|
21
|
+
*/
|
|
22
|
+
mode: 'bundle' | 'merge';
|
|
23
|
+
/**
|
|
24
|
+
* <zh/> 考虑要处理的边,默认为全部边
|
|
25
|
+
*
|
|
26
|
+
* <en/> The edges to be handled, all edges by default
|
|
27
|
+
*/
|
|
28
|
+
edges?: ID[];
|
|
29
|
+
/**
|
|
30
|
+
* <zh/> 边之间的距离,仅在捆绑模式下有效
|
|
31
|
+
*
|
|
32
|
+
* <en/> The distance between edges, only valid for bundling mode
|
|
33
|
+
*/
|
|
34
|
+
distance?: number;
|
|
35
|
+
/**
|
|
36
|
+
* <zh/> 合并边的样式,仅在合并模式下有效
|
|
37
|
+
*
|
|
38
|
+
* <en/> The style of the merged edge, only valid for merging mode
|
|
39
|
+
*/
|
|
40
|
+
style?: PathStyleProps;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* <zh/> 处理平行边,即多条边共享同一源节点和目标节点
|
|
44
|
+
*
|
|
45
|
+
* <en/> Process parallel edges which share the same source and target nodes
|
|
46
|
+
*/
|
|
47
|
+
export declare class ProcessParallelEdges extends BaseTransform<ProcessParallelEdgesOptions> {
|
|
48
|
+
static defaultOptions: Partial<ProcessParallelEdgesOptions>;
|
|
49
|
+
constructor(context: RuntimeContext, options: ProcessParallelEdgesOptions);
|
|
50
|
+
beforeDraw(input: DrawData): DrawData;
|
|
51
|
+
private getAffectedParallelEdges;
|
|
52
|
+
protected applyBundlingStyle: (reassignTo: (type: 'add' | 'update' | 'remove', elementType: ElementType, datum: ElementDatum) => void, edges: Map<ID, EdgeData>, distance: number) => void;
|
|
53
|
+
protected applyMergingStyle: (reassignTo: (type: 'add' | 'update' | 'remove', elementType: ElementType, datum: ElementDatum) => void, edges: Map<ID, EdgeData>) => void;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* <zh/> 按照端点分组
|
|
57
|
+
*
|
|
58
|
+
* <en/> Group by endpoints
|
|
59
|
+
* @param edges - <zh/> 边集合 | <en/> Edges
|
|
60
|
+
* @returns <zh/> 端点分组后的边集合 | <en/> Edges grouped by endpoints
|
|
61
|
+
*/
|
|
62
|
+
export declare const groupByEndpoints: (edges: Map<ID, EdgeData>) => {
|
|
63
|
+
edgeMap: Map<string, EdgeData[]>;
|
|
64
|
+
reverses: Record<string, boolean>;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* <zh/> 获取平行边
|
|
68
|
+
*
|
|
69
|
+
* <en/> Get parallel edges
|
|
70
|
+
* @param edge - <zh/> 目标边 | <en/> Target edge
|
|
71
|
+
* @param edges - <zh/> 边集合 | <en/> Edges
|
|
72
|
+
* @param containsSelf - <zh/> 输出结果是否包含目标边 | <en/> Whether the output result contains the target edge
|
|
73
|
+
* @returns <zh/> 平行边集合 | <en/> Parallel edges
|
|
74
|
+
*/
|
|
75
|
+
export declare const getParallelEdges: (edge: EdgeData, edges: EdgeData[], containsSelf?: boolean) => EdgeData[];
|
|
76
|
+
/**
|
|
77
|
+
* <zh/> 判断两条边是否平行
|
|
78
|
+
*
|
|
79
|
+
* <en/> Determine whether two edges are parallel
|
|
80
|
+
* @param edge1 - <zh/> 边1 | <en/> Edge 1
|
|
81
|
+
* @param edge2 - <zh/> 边2 | <en/> Edge 2
|
|
82
|
+
* @returns <zh/> 是否平行 | <en/> Whether is parallel
|
|
83
|
+
*/
|
|
84
|
+
export declare const isParallelEdges: (edge1: EdgeData, edge2: EdgeData) => boolean;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ID } from '@antv/graphlib';
|
|
2
|
+
import type { ComboData, EdgeData, NodeData } from '../spec';
|
|
3
|
+
import type { BaseTransform, BaseTransformOptions } from './base-transform';
|
|
4
|
+
export type BuiltInTransformOptions = BaseTransformOptions;
|
|
5
|
+
export type Transform = BaseTransform<any>;
|
|
6
|
+
/**
|
|
7
|
+
* <zh/> 在 Element Controller 中,为了提高查询性能,统一使用 Map 存储数据
|
|
8
|
+
*
|
|
9
|
+
* <en/> In Element Controller, in order to improve query performance, use Map to store data uniformly
|
|
10
|
+
*/
|
|
11
|
+
export declare class ProcedureData {
|
|
12
|
+
nodes: Map<ID, NodeData>;
|
|
13
|
+
edges: Map<ID, EdgeData>;
|
|
14
|
+
combos: Map<ID, ComboData>;
|
|
15
|
+
}
|
|
16
|
+
export type DrawData = {
|
|
17
|
+
add: ProcedureData;
|
|
18
|
+
update: ProcedureData;
|
|
19
|
+
remove: ProcedureData;
|
|
20
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseTransform } from './base-transform';
|
|
2
|
+
import type { DrawData } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* 如果更新了节点 / combo,需要更新连接的边
|
|
5
|
+
* If the node / combo is updated, the connected edge and the combo it is in need to be updated
|
|
6
|
+
*/
|
|
7
|
+
export declare class UpdateRelatedEdge extends BaseTransform {
|
|
8
|
+
beforeDraw(input: DrawData): DrawData;
|
|
9
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type CanvasLayer = 'background' | 'main' | 'label' | 'transient'
|
|
1
|
+
export type CanvasLayer = 'background' | 'main' | 'label' | 'transient';
|