@antv/g6 5.0.0-beta.32 → 5.0.0-beta.34
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 +103 -0
- package/dist/lib/behaviors/click-element.d.ts +77 -0
- package/dist/lib/behaviors/collapse-expand.d.ts +1 -2
- package/dist/lib/behaviors/create-edge.d.ts +1 -2
- package/dist/lib/behaviors/drag-element-force.d.ts +13 -0
- package/dist/lib/behaviors/drag-element.d.ts +12 -12
- package/dist/lib/behaviors/index.d.ts +8 -0
- package/dist/lib/behaviors/lasso-select.d.ts +19 -0
- package/dist/lib/behaviors/types.d.ts +1 -0
- package/dist/lib/constants/change.d.ts +1 -1
- package/dist/lib/constants/events/animation.d.ts +1 -4
- 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 -14
- 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/donut.d.ts +45 -0
- 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/html.d.ts +27 -0
- package/dist/lib/elements/nodes/image.d.ts +9 -11
- package/dist/lib/elements/nodes/index.d.ts +4 -0
- 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 +8 -5
- 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 +58 -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 +8 -8
- package/dist/lib/runtime/element.d.ts +6 -22
- package/dist/lib/runtime/graph.d.ts +42 -5
- 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/runtime/viewport.d.ts +1 -2
- package/dist/lib/spec/data.d.ts +74 -1
- package/dist/lib/spec/element/combo.d.ts +17 -6
- package/dist/lib/spec/element/edge.d.ts +14 -2
- package/dist/lib/spec/element/node.d.ts +19 -3
- package/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/themes/base.d.ts +1 -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 +83 -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/callable.d.ts +2 -2
- package/dist/lib/types/canvas.d.ts +1 -1
- package/dist/lib/types/change.d.ts +27 -10
- package/dist/lib/types/data.d.ts +1 -1
- package/dist/lib/types/element.d.ts +6 -140
- package/dist/lib/types/id.d.ts +1 -0
- package/dist/lib/types/index.d.ts +1 -0
- package/dist/lib/types/node.d.ts +3 -3
- package/dist/lib/types/point.d.ts +1 -0
- package/dist/lib/types/style.d.ts +1 -3
- package/dist/lib/utils/animation.d.ts +2 -2
- package/dist/lib/utils/behaviors/brush.d.ts +18 -0
- package/dist/lib/utils/behaviors/lasso.d.ts +12 -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 +12 -2
- 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 +4 -10
- package/dist/lib/utils/line.d.ts +21 -0
- package/dist/lib/utils/palette.d.ts +1 -2
- 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/relation.d.ts +1 -2
- 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 +103 -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/collapse-expand.d.ts +1 -2
- package/esm/behaviors/collapse-expand.js.map +1 -1
- package/esm/behaviors/create-edge.d.ts +1 -2
- package/esm/behaviors/create-edge.js.map +1 -1
- package/esm/behaviors/drag-element-force.d.ts +13 -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 +12 -12
- package/esm/behaviors/drag-element.js +17 -9
- package/esm/behaviors/drag-element.js.map +1 -1
- package/esm/behaviors/focus-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 +19 -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/animation.d.ts +1 -4
- package/esm/constants/events/animation.js +0 -4
- package/esm/constants/events/animation.js.map +1 -1
- package/esm/constants/events/graph.d.ts +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 -14
- 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/donut.d.ts +45 -0
- package/esm/elements/nodes/donut.js +81 -0
- package/esm/elements/nodes/donut.js.map +1 -0
- package/esm/elements/nodes/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/html.d.ts +27 -0
- package/esm/elements/nodes/html.js +209 -0
- package/esm/elements/nodes/html.js.map +1 -0
- package/esm/elements/nodes/image.d.ts +9 -11
- package/esm/elements/nodes/image.js.map +1 -1
- package/esm/elements/nodes/index.d.ts +4 -0
- package/esm/elements/nodes/index.js +2 -0
- package/esm/elements/nodes/index.js.map +1 -1
- package/esm/elements/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 +8 -5
- package/esm/exports.js +4 -2
- 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 +58 -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 +3 -2
- package/esm/plugins/legend.js.map +1 -1
- package/esm/registry/build-in.js +24 -7
- 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 +40 -13
- package/esm/runtime/canvas.js.map +1 -1
- package/esm/runtime/data.d.ts +8 -8
- package/esm/runtime/data.js +23 -25
- package/esm/runtime/data.js.map +1 -1
- package/esm/runtime/element.d.ts +6 -22
- package/esm/runtime/element.js +73 -177
- package/esm/runtime/element.js.map +1 -1
- package/esm/runtime/graph.d.ts +42 -5
- package/esm/runtime/graph.js +68 -10
- package/esm/runtime/graph.js.map +1 -1
- package/esm/runtime/layout.d.ts +5 -11
- package/esm/runtime/layout.js +31 -77
- 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/runtime/viewport.d.ts +1 -2
- package/esm/runtime/viewport.js.map +1 -1
- package/esm/spec/data.d.ts +74 -1
- package/esm/spec/element/combo.d.ts +17 -6
- package/esm/spec/element/edge.d.ts +14 -2
- package/esm/spec/element/node.d.ts +19 -3
- package/esm/spec/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.d.ts +1 -0
- package/esm/themes/base.js +11 -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 +83 -0
- package/esm/transforms/process-parallel-edges.js +213 -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/callable.d.ts +2 -2
- package/esm/types/canvas.d.ts +1 -1
- package/esm/types/change.d.ts +27 -10
- package/esm/types/data.d.ts +1 -1
- package/esm/types/element.d.ts +6 -140
- package/esm/types/id.d.ts +1 -0
- package/esm/types/id.js +2 -0
- package/esm/types/id.js.map +1 -0
- package/esm/types/index.d.ts +1 -0
- package/esm/types/node.d.ts +3 -3
- package/esm/types/point.d.ts +1 -0
- package/esm/types/style.d.ts +1 -3
- package/esm/utils/animation.d.ts +2 -2
- package/esm/utils/animation.js +7 -1
- package/esm/utils/animation.js.map +1 -1
- package/esm/utils/behaviors/brush.d.ts +18 -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 +12 -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 +12 -2
- 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 +4 -10
- 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/palette.d.ts +1 -2
- package/esm/utils/palette.js.map +1 -1
- 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/relation.d.ts +1 -2
- package/esm/utils/relation.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 +3 -3
- 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 +103 -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/collapse-expand.d.ts +1 -2
- package/lib/behaviors/collapse-expand.js.map +1 -1
- package/lib/behaviors/create-edge.d.ts +1 -2
- package/lib/behaviors/create-edge.js.map +1 -1
- package/lib/behaviors/drag-element-force.d.ts +13 -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 +12 -12
- package/lib/behaviors/drag-element.js +17 -9
- package/lib/behaviors/drag-element.js.map +1 -1
- package/lib/behaviors/focus-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 +19 -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/animation.d.ts +1 -4
- package/lib/constants/events/animation.js +0 -4
- package/lib/constants/events/animation.js.map +1 -1
- package/lib/constants/events/graph.d.ts +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 -14
- 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/donut.d.ts +45 -0
- package/lib/elements/nodes/donut.js +85 -0
- package/lib/elements/nodes/donut.js.map +1 -0
- package/lib/elements/nodes/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/html.d.ts +27 -0
- package/lib/elements/nodes/html.js +213 -0
- package/lib/elements/nodes/html.js.map +1 -0
- package/lib/elements/nodes/image.d.ts +9 -11
- package/lib/elements/nodes/image.js.map +1 -1
- package/lib/elements/nodes/index.d.ts +4 -0
- package/lib/elements/nodes/index.js +5 -1
- package/lib/elements/nodes/index.js.map +1 -1
- package/lib/elements/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 +8 -5
- package/lib/exports.js +8 -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 +58 -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 +3 -2
- package/lib/plugins/legend.js.map +1 -1
- package/lib/registry/build-in.js +19 -2
- 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 +38 -11
- package/lib/runtime/canvas.js.map +1 -1
- package/lib/runtime/data.d.ts +8 -8
- package/lib/runtime/data.js +22 -24
- package/lib/runtime/data.js.map +1 -1
- package/lib/runtime/element.d.ts +6 -22
- package/lib/runtime/element.js +72 -176
- package/lib/runtime/element.js.map +1 -1
- package/lib/runtime/graph.d.ts +42 -5
- package/lib/runtime/graph.js +67 -9
- package/lib/runtime/graph.js.map +1 -1
- package/lib/runtime/layout.d.ts +5 -11
- package/lib/runtime/layout.js +29 -75
- 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/runtime/viewport.d.ts +1 -2
- package/lib/runtime/viewport.js.map +1 -1
- package/lib/spec/data.d.ts +74 -1
- package/lib/spec/element/combo.d.ts +17 -6
- package/lib/spec/element/edge.d.ts +14 -2
- package/lib/spec/element/node.d.ts +19 -3
- package/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.d.ts +1 -0
- package/lib/themes/base.js +11 -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 +83 -0
- package/lib/transforms/process-parallel-edges.js +220 -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/callable.d.ts +2 -2
- package/lib/types/canvas.d.ts +1 -1
- package/lib/types/change.d.ts +27 -10
- package/lib/types/data.d.ts +1 -1
- package/lib/types/element.d.ts +6 -140
- package/lib/types/id.d.ts +1 -0
- package/lib/{spec/element/base.js → types/id.js} +1 -1
- package/lib/types/id.js.map +1 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/node.d.ts +3 -3
- package/lib/types/point.d.ts +1 -0
- package/lib/types/style.d.ts +1 -3
- package/lib/utils/animation.d.ts +2 -2
- package/lib/utils/animation.js +7 -1
- package/lib/utils/animation.js.map +1 -1
- package/lib/utils/behaviors/brush.d.ts +18 -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 +12 -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 +12 -2
- 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 +4 -10
- 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/palette.d.ts +1 -2
- package/lib/utils/palette.js.map +1 -1
- 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/relation.d.ts +1 -2
- package/lib/utils/relation.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 +3 -3
- 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 +305 -0
- package/src/behaviors/click-element.ts +181 -0
- package/src/behaviors/collapse-expand.ts +1 -2
- package/src/behaviors/create-edge.ts +1 -2
- package/src/behaviors/drag-element-force.ts +69 -0
- package/src/behaviors/drag-element.ts +27 -18
- package/src/behaviors/focus-element.ts +1 -2
- package/src/behaviors/hover-element.ts +3 -5
- package/src/behaviors/index.ts +8 -0
- package/src/behaviors/lasso-select.ts +102 -0
- package/src/behaviors/types.ts +2 -0
- package/src/constants/change.ts +1 -1
- package/src/constants/events/animation.ts +0 -4
- 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 +117 -21
- package/src/elements/nodes/circle.ts +5 -7
- package/src/elements/nodes/diamond.ts +4 -6
- package/src/elements/nodes/donut.ts +137 -0
- package/src/elements/nodes/ellipse.ts +6 -8
- package/src/elements/nodes/hexagon.ts +7 -9
- package/src/elements/nodes/html.ts +230 -0
- package/src/elements/nodes/image.ts +12 -13
- package/src/elements/nodes/index.ts +4 -0
- 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 +24 -3
- 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 +148 -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 +5 -5
- package/src/registry/build-in.ts +28 -4
- 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 +55 -14
- package/src/runtime/data.ts +33 -37
- package/src/runtime/element.ts +90 -203
- package/src/runtime/graph.ts +78 -13
- package/src/runtime/layout.ts +50 -81
- package/src/runtime/plugin.ts +1 -1
- package/src/runtime/transform.ts +27 -0
- package/src/runtime/types.ts +14 -0
- package/src/runtime/viewport.ts +1 -2
- package/src/spec/data.ts +74 -1
- package/src/spec/element/combo.ts +17 -6
- package/src/spec/element/edge.ts +14 -2
- package/src/spec/element/node.ts +19 -3
- package/src/spec/index.ts +1 -0
- package/src/spec/spec.ts +7 -0
- package/src/spec/transform.ts +15 -0
- package/src/themes/base.ts +12 -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 +284 -0
- package/src/transforms/types.ts +23 -0
- package/src/transforms/update-related-edge.ts +27 -0
- package/src/types/callable.ts +2 -2
- package/src/types/canvas.ts +1 -1
- package/src/types/change.ts +28 -10
- package/src/types/data.ts +1 -1
- package/src/types/element.ts +6 -147
- package/src/types/id.ts +1 -0
- package/src/types/index.ts +1 -0
- package/src/types/node.ts +3 -3
- package/src/types/point.ts +1 -0
- package/src/types/style.ts +1 -3
- package/src/utils/animation.ts +8 -2
- package/src/utils/behaviors/brush.ts +28 -0
- package/src/utils/behaviors/lasso.ts +126 -0
- package/src/utils/behaviors/utils.ts +47 -0
- package/src/utils/change.ts +42 -2
- package/src/utils/combo.ts +6 -5
- package/src/utils/edge.ts +7 -2
- package/src/utils/event/events.ts +3 -1
- package/src/utils/extension.ts +1 -1
- package/src/utils/id.ts +11 -3
- package/src/utils/line.ts +50 -0
- package/src/utils/palette.ts +1 -1
- 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/relation.ts +1 -2
- package/src/utils/shortcut.ts +13 -2
- package/src/utils/style.ts +4 -4
- package/src/utils/vector.ts +10 -3
- package/dist/lib/runtime/index.d.ts +0 -6
- package/dist/lib/spec/element/base.d.ts +0 -6
- package/esm/elements/types.d.ts +0 -0
- package/esm/elements/types.js +0 -15
- package/esm/elements/types.js.map +0 -1
- package/esm/runtime/index.d.ts +0 -6
- package/esm/runtime/index.js +0 -7
- package/esm/runtime/index.js.map +0 -1
- package/esm/spec/element/base.d.ts +0 -6
- package/esm/spec/element/base.js +0 -2
- package/esm/spec/element/base.js.map +0 -1
- package/lib/elements/types.d.ts +0 -0
- package/lib/elements/types.js +0 -15
- package/lib/elements/types.js.map +0 -1
- package/lib/runtime/index.d.ts +0 -6
- package/lib/runtime/index.js +0 -8
- package/lib/runtime/index.js.map +0 -1
- package/lib/spec/element/base.d.ts +0 -6
- package/lib/spec/element/base.js.map +0 -1
- package/src/elements/types.ts +0 -21
- package/src/runtime/index.ts +0 -7
- package/src/spec/element/base.ts +0 -6
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { RuntimeContext } from '../../runtime/types';
|
|
2
|
+
import type { BasePluginOptions } from '../base-plugin';
|
|
3
|
+
import { BasePlugin } from '../base-plugin';
|
|
4
|
+
import type { HistoryEventHandler, HistoryEventName } from './events';
|
|
5
|
+
import type { Command } from './utils';
|
|
6
|
+
export interface HistoryOptions extends BasePluginOptions {
|
|
7
|
+
/**
|
|
8
|
+
* <zh/> 最多记录该数据长度的历史记录,默认为 0 表示不做限制
|
|
9
|
+
*/
|
|
10
|
+
stackSize?: number;
|
|
11
|
+
/**
|
|
12
|
+
* <zh/> 当一个命令被添加到 Undo/Redo 队列前被调用,如果该方法返回 false,那么这个命令将不会被添加到队列中。revert 为 true 时表示撤销操作,为 false 时表示重做操作
|
|
13
|
+
*
|
|
14
|
+
* <en/> Called before a command is added to the Undo/Redo queue. If this method returns false, the command will not be added to the queue. revert is true for undo operations and false for redo operations
|
|
15
|
+
*/
|
|
16
|
+
beforeAddCommand?: (cmd: Command, revert?: boolean) => boolean | void;
|
|
17
|
+
/**
|
|
18
|
+
* <zh/> 当一个命令被添加到 Undo/Redo 队列后被调用。revert 为 true 时表示撤销操作,为 false 时表示重做操作
|
|
19
|
+
*
|
|
20
|
+
* <en/> Called after a command is added to the Undo/Redo queue. revert is true for undo operations and false for redo operations
|
|
21
|
+
*/
|
|
22
|
+
afterAddCommand?: (cmd: Command, revert?: boolean) => void;
|
|
23
|
+
/**
|
|
24
|
+
* <zh/> 执行命令时的回调函数
|
|
25
|
+
*
|
|
26
|
+
* <en/> Callback function when executing a command
|
|
27
|
+
*/
|
|
28
|
+
executeCommand?: (cmd: Command) => void;
|
|
29
|
+
}
|
|
30
|
+
export declare class History extends BasePlugin<HistoryOptions> {
|
|
31
|
+
static defaultOptions: Partial<HistoryOptions>;
|
|
32
|
+
private emitter;
|
|
33
|
+
private batchChanges;
|
|
34
|
+
private batchAnimation;
|
|
35
|
+
undoStack: Command[];
|
|
36
|
+
redoStack: Command[];
|
|
37
|
+
private isFirstDraw;
|
|
38
|
+
private freezed;
|
|
39
|
+
constructor(context: RuntimeContext, options: HistoryOptions);
|
|
40
|
+
/**
|
|
41
|
+
* <zh/> 是否可以执行撤销操作
|
|
42
|
+
* <en/> Whether undo can be done
|
|
43
|
+
* @returns <zh/> 是否可以执行撤销操作 | <en/> Whether undo can be done
|
|
44
|
+
*/
|
|
45
|
+
canUndo: () => boolean;
|
|
46
|
+
/**
|
|
47
|
+
* <zh/> 是否可以执行重做操作
|
|
48
|
+
* <en/> Whether redo can be done
|
|
49
|
+
* @returns <zh/> 是否可以执行重做操作 | <en/> Whether redo can be done
|
|
50
|
+
*/
|
|
51
|
+
canRedo: () => boolean;
|
|
52
|
+
/**
|
|
53
|
+
* <zh/> 执行撤销
|
|
54
|
+
* <en/> Execute undo
|
|
55
|
+
* @returns <zh/> 返回当前实例 | <en/> Return the current instance
|
|
56
|
+
*/
|
|
57
|
+
undo: () => this;
|
|
58
|
+
/**
|
|
59
|
+
* <zh/> 执行重做
|
|
60
|
+
* <en/> Execute redo
|
|
61
|
+
* @returns <zh/> 返回当前实例 | <en/> Return the current instance
|
|
62
|
+
*/
|
|
63
|
+
redo: () => this;
|
|
64
|
+
/**
|
|
65
|
+
* <zh/> 执行撤销且不计入历史记录
|
|
66
|
+
* <en/> Execute undo and do not record in history
|
|
67
|
+
* @returns <zh/> 返回当前实例 | <en/> Return the current instance
|
|
68
|
+
*/
|
|
69
|
+
undoAndCancel: () => this;
|
|
70
|
+
private executeCommand;
|
|
71
|
+
private addCommand;
|
|
72
|
+
private initBatchCommand;
|
|
73
|
+
private undoStackPush;
|
|
74
|
+
/**
|
|
75
|
+
* <zh/> 清空历史记录
|
|
76
|
+
* <en/> Clear history
|
|
77
|
+
*/
|
|
78
|
+
clear(): void;
|
|
79
|
+
protected notify(event: HistoryEventName, cmd: Command | null): void;
|
|
80
|
+
on(event: HistoryEventName, handler: HistoryEventHandler): void;
|
|
81
|
+
destroy(): void;
|
|
82
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { RuntimeContext } from '../../runtime/types';
|
|
2
|
+
import type { GraphData } from '../../spec';
|
|
3
|
+
import type { DataChange } from '../../types';
|
|
4
|
+
export type Command = {
|
|
5
|
+
current: CommandData;
|
|
6
|
+
original: CommandData;
|
|
7
|
+
animation: boolean;
|
|
8
|
+
};
|
|
9
|
+
export type CommandData = {
|
|
10
|
+
add: GraphData;
|
|
11
|
+
update: GraphData;
|
|
12
|
+
remove: GraphData;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* <zh/> 对齐两个对象的字段。若目标对象缺少字段,则会添加默认值。
|
|
16
|
+
*
|
|
17
|
+
* <en/> Align the fields of two objects. If the target object lacks fields, default values will be added.
|
|
18
|
+
* @param refObject - <zh/> 参考对象 | <en/> Reference object
|
|
19
|
+
* @param targetObject - <zh/> 目标对象 | <en/> Target object
|
|
20
|
+
*/
|
|
21
|
+
export declare function alignFields(refObject: Record<string, any>, targetObject: Record<string, any>): void;
|
|
22
|
+
/**
|
|
23
|
+
* <zh/> 解析数据变更为历史记录命令
|
|
24
|
+
*
|
|
25
|
+
* <en/> Parse data changes into history commands
|
|
26
|
+
* @param changes - <zh/> 数据变更 | <en/> Data changes
|
|
27
|
+
* @param animation - <zh/> 是否开启动画 | <en/> Whether to enable animation
|
|
28
|
+
* @param context - <zh/> 运行时上下文 | <en/> Runtime context
|
|
29
|
+
* @returns <zh/> 历史记录命令 | <en/> History command
|
|
30
|
+
*/
|
|
31
|
+
export declare function parseCommand(changes: DataChange[], animation?: boolean, context?: RuntimeContext): Command;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { RuntimeContext } from '../../runtime/types';
|
|
2
|
+
import type { CallableValue, ID } from '../../types';
|
|
3
|
+
import type { BasePluginOptions } from '../base-plugin';
|
|
4
|
+
import { BasePlugin } from '../base-plugin';
|
|
5
|
+
import type { HullStyleProps } from './shape';
|
|
6
|
+
export interface HullOptions extends BasePluginOptions, HullStyleProps {
|
|
7
|
+
/**
|
|
8
|
+
* <zh/> Hull 内的元素
|
|
9
|
+
* <en/> Elements in Hull
|
|
10
|
+
*/
|
|
11
|
+
members?: ID[];
|
|
12
|
+
/**
|
|
13
|
+
* <zh/> 凹度,数值越大凹度越小;默认为 Infinity 代表为 Convex Hull
|
|
14
|
+
* <en/> Concavity. Default is Infinity, which means Convex Hull
|
|
15
|
+
*/
|
|
16
|
+
concavity?: number;
|
|
17
|
+
/**
|
|
18
|
+
* <zh/> 内边距,默认为 10
|
|
19
|
+
* <en/> Padding, default is 10
|
|
20
|
+
*/
|
|
21
|
+
padding?: number;
|
|
22
|
+
/**
|
|
23
|
+
* <zh/> 拐角类型,目前支持 'rounded'、'smooth' 和 'sharp'
|
|
24
|
+
* <en/> Corner type, currently supports 'rounded', 'smooth' and 'sharp'
|
|
25
|
+
*/
|
|
26
|
+
corner?: 'rounded' | 'smooth' | 'sharp';
|
|
27
|
+
}
|
|
28
|
+
export declare class Hull extends BasePlugin<HullOptions> {
|
|
29
|
+
private shape;
|
|
30
|
+
/**
|
|
31
|
+
* <zh/> 在 Hull 上的元素
|
|
32
|
+
* <en/> Element Ids on Hull
|
|
33
|
+
*/
|
|
34
|
+
private hullMemberIds;
|
|
35
|
+
/**
|
|
36
|
+
* <zh/> Hull 绘制路径
|
|
37
|
+
* <en/> Hull path
|
|
38
|
+
*/
|
|
39
|
+
private path;
|
|
40
|
+
/**
|
|
41
|
+
* <zh> 是否初次渲染完成
|
|
42
|
+
* <en> Whether the first rendering is completed
|
|
43
|
+
*/
|
|
44
|
+
private firstRender;
|
|
45
|
+
static defaultOptions: Partial<HullOptions>;
|
|
46
|
+
constructor(context: RuntimeContext, options: HullOptions);
|
|
47
|
+
private bindEvents;
|
|
48
|
+
private getHullStyle;
|
|
49
|
+
private drawHull;
|
|
50
|
+
private updateHullPath;
|
|
51
|
+
private getHullPath;
|
|
52
|
+
private getPadding;
|
|
53
|
+
addMembers(members: ID | ID[]): void;
|
|
54
|
+
removeMembers(members: ID | ID[]): void;
|
|
55
|
+
updateMembers(members: CallableValue<ID[]>): void;
|
|
56
|
+
updateOptions(options: CallableValue<HullOptions>): void;
|
|
57
|
+
destroy(): void;
|
|
58
|
+
}
|
|
@@ -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;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Graph as GraphLib
|
|
1
|
+
import { Graph as GraphLib } from '@antv/graphlib';
|
|
2
2
|
import { COMBO_KEY, TREE_KEY } from '../constants';
|
|
3
3
|
import type { ComboData, EdgeData, GraphData, NodeData } from '../spec';
|
|
4
|
-
import type { DataChange, DataID, ElementDatum, NodeLikeData, PartialEdgeData, PartialGraphData, PartialNodeLikeData, Position, State } from '../types';
|
|
4
|
+
import type { DataChange, DataID, ElementDatum, ID, NodeLikeData, PartialEdgeData, PartialGraphData, PartialNodeLikeData, Position, State } from '../types';
|
|
5
5
|
import type { EdgeDirection } from '../types/edge';
|
|
6
6
|
import type { ElementType } from '../types/element';
|
|
7
7
|
export declare class DataController {
|
|
@@ -17,8 +17,8 @@ export declare class DataController {
|
|
|
17
17
|
* <en/> When the combo is deleted, its id will be removed from comboIds. At this time, the NodeRemoved obtained according to the changes event of Graphlib cannot distinguish whether it is a combo or a node.
|
|
18
18
|
* Therefore, it is necessary to record the id of the last deleted combo and use it to judge isCombo
|
|
19
19
|
*/
|
|
20
|
-
protected latestRemovedComboIds: Set<
|
|
21
|
-
protected comboIds: Set<
|
|
20
|
+
protected latestRemovedComboIds: Set<string>;
|
|
21
|
+
protected comboIds: Set<string>;
|
|
22
22
|
/**
|
|
23
23
|
* <zh/> 获取详细数据变更
|
|
24
24
|
*
|
|
@@ -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;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { DisplayObject, IAnimation } from '@antv/g';
|
|
2
|
-
import type { ID } from '@antv/graphlib';
|
|
3
2
|
import type { AnimationStage } from '../spec/element/animation';
|
|
4
|
-
import type { Combo, Element, ElementDatum, ElementType, Node, State } from '../types';
|
|
3
|
+
import type { Combo, Element, ElementDatum, ElementType, ID, Node, State } from '../types';
|
|
5
4
|
import type { RuntimeContext } from './types';
|
|
6
5
|
export declare class ElementController {
|
|
7
6
|
private context;
|
|
@@ -12,8 +11,9 @@ export declare class ElementController {
|
|
|
12
11
|
init(): void;
|
|
13
12
|
private emit;
|
|
14
13
|
private forEachElementData;
|
|
14
|
+
getElementType(elementType: ElementType, datum: ElementDatum): string;
|
|
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;
|
|
@@ -28,7 +28,7 @@ export declare class ElementController {
|
|
|
28
28
|
*
|
|
29
29
|
* <en/> compute default style of single element
|
|
30
30
|
*/
|
|
31
|
-
private
|
|
31
|
+
private computeElementDefaultStyle;
|
|
32
32
|
private computeElementsDefaultStyle;
|
|
33
33
|
getDefaultStyle(id: ID): Record<string, unknown>;
|
|
34
34
|
private getElementState;
|
|
@@ -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,12 @@
|
|
|
1
1
|
import EventEmitter from '@antv/event-emitter';
|
|
2
|
-
import type { AABB, BaseStyleProps
|
|
3
|
-
import type { ID } from '@antv/graphlib';
|
|
2
|
+
import type { AABB, BaseStyleProps } from '@antv/g';
|
|
4
3
|
import type { Plugin } from '../plugins/types';
|
|
5
|
-
import type { BehaviorOptions, ComboData, ComboOptions, EdgeData, EdgeOptions, G6Spec, GraphData, LayoutOptions, NodeData, NodeOptions, PluginOptions, ThemeOptions } from '../spec';
|
|
4
|
+
import type { BehaviorOptions, ComboData, ComboOptions, EdgeData, EdgeOptions, G6Spec, GraphData, LayoutOptions, NodeData, NodeOptions, PluginOptions, ThemeOptions, TransformOptions } from '../spec';
|
|
6
5
|
import type { UpdateBehaviorOption } from '../spec/behavior';
|
|
7
6
|
import type { UpdatePluginOption } from '../spec/plugin';
|
|
8
|
-
import type {
|
|
7
|
+
import type { UpdateTransformOption } from '../spec/transform';
|
|
8
|
+
import type { CallableValue, DataID, EdgeDirection, ElementType, FitViewOptions, ID, IEvent, NodeLikeData, PartialEdgeData, PartialGraphData, PartialNodeLikeData, Point, Position, State, ViewportAnimationEffectTiming } from '../types';
|
|
9
|
+
import type { DataURLOptions } from './canvas';
|
|
9
10
|
import { Canvas } from './canvas';
|
|
10
11
|
import type { HierarchyKey } from './data';
|
|
11
12
|
export declare class Graph extends EventEmitter {
|
|
@@ -95,6 +96,27 @@ export declare class Graph extends EventEmitter {
|
|
|
95
96
|
* @returns <zh/> 插件实例 | <en/> plugin instance
|
|
96
97
|
*/
|
|
97
98
|
getPluginInstance<T extends Plugin>(key: string): T;
|
|
99
|
+
/**
|
|
100
|
+
* <zh/> 设置数据转换器
|
|
101
|
+
*
|
|
102
|
+
* <en/> Set data transforms
|
|
103
|
+
* @param transforms - <zh/> 数据转换配置 | <en/> data transform configuration
|
|
104
|
+
*/
|
|
105
|
+
setTransforms(transforms: CallableValue<TransformOptions>): void;
|
|
106
|
+
/**
|
|
107
|
+
* <zh/> 更新数据转换器
|
|
108
|
+
*
|
|
109
|
+
* <en/> Update data transform
|
|
110
|
+
* @param transform - <zh/> 数据转换配置 | <en/> data transform configuration
|
|
111
|
+
*/
|
|
112
|
+
updateTransform(transform: UpdateTransformOption): void;
|
|
113
|
+
/**
|
|
114
|
+
* <zh/> 获取数据转换器
|
|
115
|
+
*
|
|
116
|
+
* <en/> Get data transforms
|
|
117
|
+
* @returns <zh/> 数据转换器实例 | <en/> data transform instance
|
|
118
|
+
*/
|
|
119
|
+
getTransforms(): TransformOptions;
|
|
98
120
|
getData(): GraphData;
|
|
99
121
|
getNodeData(): NodeData[];
|
|
100
122
|
getNodeData(id: ID): NodeData;
|
|
@@ -155,7 +177,7 @@ export declare class Graph extends EventEmitter {
|
|
|
155
177
|
getElementDataByState(elementType: 'edge', state: State): EdgeData[];
|
|
156
178
|
getElementDataByState(elementType: 'combo', state: State): ComboData[];
|
|
157
179
|
private initCanvas;
|
|
158
|
-
private
|
|
180
|
+
private initRuntime;
|
|
159
181
|
private prepare;
|
|
160
182
|
/**
|
|
161
183
|
* <zh/> 执行渲染
|
|
@@ -433,6 +455,21 @@ export declare class Graph extends EventEmitter {
|
|
|
433
455
|
collapse(id: ID, animation?: boolean): Promise<void>;
|
|
434
456
|
expand(id: ID, animation?: boolean): Promise<void>;
|
|
435
457
|
private setElementCollapsibility;
|
|
458
|
+
/**
|
|
459
|
+
* <zh/> 导出画布内容为 DataURL
|
|
460
|
+
*
|
|
461
|
+
* <en/> Export canvas content as DataURL
|
|
462
|
+
* @param options - <zh/> 导出配置 | <en/> export configuration
|
|
463
|
+
* @param mode
|
|
464
|
+
* <zh/> 导出模式
|
|
465
|
+
* - viewport: 导出视口内容
|
|
466
|
+
* - overall: 导出整个画布
|
|
467
|
+
*
|
|
468
|
+
* <en/> export mode
|
|
469
|
+
* - viewport: export the content of the viewport
|
|
470
|
+
* - overall: export the entire canvas
|
|
471
|
+
* @returns <zh/> DataURL | <en/> DataURL
|
|
472
|
+
*/
|
|
436
473
|
toDataURL(options?: Partial<DataURLOptions>): Promise<string>;
|
|
437
474
|
getCanvasByViewport(point: Point): Point;
|
|
438
475
|
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
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { AABB } from '@antv/g';
|
|
2
|
-
import type { ID } from '
|
|
3
|
-
import type { FitViewOptions, Point, TransformOptions, ViewportAnimationEffectTiming } from '../types';
|
|
2
|
+
import type { FitViewOptions, ID, Point, TransformOptions, ViewportAnimationEffectTiming } from '../types';
|
|
4
3
|
import type { RuntimeContext } from './types';
|
|
5
4
|
export declare class ViewportController {
|
|
6
5
|
private context;
|