@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,103 @@
|
|
|
1
|
+
import { Shortcut } from '../utils/shortcut';
|
|
2
|
+
import { BaseBehavior } from './base-behavior';
|
|
3
|
+
import type { Graph } from '../runtime/graph';
|
|
4
|
+
import type { RuntimeContext } from '../runtime/types';
|
|
5
|
+
import type { NodeStyle } from '../spec/element/node';
|
|
6
|
+
import type { ElementType, ID, IPointerEvent, Points, State } from '../types';
|
|
7
|
+
import type { ShortcutKey } from '../utils/shortcut';
|
|
8
|
+
import type { BaseBehaviorOptions } from './base-behavior';
|
|
9
|
+
type SELECT_MODE = 'union' | 'intersect' | 'diff' | 'default';
|
|
10
|
+
export type States = Record<ID, State | State[]>;
|
|
11
|
+
export interface BrushSelectOptions extends BaseBehaviorOptions {
|
|
12
|
+
/**
|
|
13
|
+
* <zh/> 是否启用框选功能
|
|
14
|
+
*
|
|
15
|
+
* <en/> Whether to enable Brush select element function.
|
|
16
|
+
*/
|
|
17
|
+
enable?: boolean | ((event: IPointerEvent) => boolean);
|
|
18
|
+
/**
|
|
19
|
+
* <zh/> 可框选的元素类型
|
|
20
|
+
*
|
|
21
|
+
* <en/> Enable Elements type.
|
|
22
|
+
*/
|
|
23
|
+
enableElements?: ElementType[];
|
|
24
|
+
/**
|
|
25
|
+
* <zh/> 是否启用动画
|
|
26
|
+
*
|
|
27
|
+
* <en/> Whether to enable animation.
|
|
28
|
+
*/
|
|
29
|
+
animation?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* <zh/> 交互配置 按键拖拽 或 直接拖拽
|
|
32
|
+
*
|
|
33
|
+
* <en/> Trigger click or drag.
|
|
34
|
+
*/
|
|
35
|
+
trigger?: ShortcutKey;
|
|
36
|
+
/**
|
|
37
|
+
* <zh/> 框选选中模式
|
|
38
|
+
* union : 选中元素添加 state 状态
|
|
39
|
+
* intersect : 进一步筛选已经 state 开启的元素
|
|
40
|
+
* diff : 反转选中元素的 state 状态
|
|
41
|
+
* default : 选中元素添加 state 状态, 其他元素 state 关闭
|
|
42
|
+
*
|
|
43
|
+
* <en/> Box Select Select the mode.
|
|
44
|
+
* union : Select element add state.
|
|
45
|
+
* intersect : Further filter the elements that are already state enabled.
|
|
46
|
+
* diff : Inverts the state of the selected element.
|
|
47
|
+
* default : Check element state to turn on and other elements state to turn off.
|
|
48
|
+
*/
|
|
49
|
+
mode?: SELECT_MODE;
|
|
50
|
+
/**
|
|
51
|
+
* <zh/> 选中 state 状态
|
|
52
|
+
*
|
|
53
|
+
* <en/> Check state status.
|
|
54
|
+
*/
|
|
55
|
+
state?: 'selected' | 'active';
|
|
56
|
+
/**
|
|
57
|
+
* <zh/> 及时框选, 在框选模式为 default 时,才能使用
|
|
58
|
+
*
|
|
59
|
+
* <en/> Timely screening.
|
|
60
|
+
*/
|
|
61
|
+
immediately?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* <zh/> 框选 框样式
|
|
64
|
+
*
|
|
65
|
+
* <en/> Timely screening.
|
|
66
|
+
*/
|
|
67
|
+
style?: NodeStyle;
|
|
68
|
+
/**
|
|
69
|
+
* <zh/> 框选元素状态回调。
|
|
70
|
+
*
|
|
71
|
+
* <en/> Callback when brush select elements.
|
|
72
|
+
*/
|
|
73
|
+
onSelect?: (states: States) => States;
|
|
74
|
+
}
|
|
75
|
+
export declare const DEFAULT_STYLE: {
|
|
76
|
+
lineWidth: number;
|
|
77
|
+
color: string;
|
|
78
|
+
stroke: string;
|
|
79
|
+
fillOpacity: number;
|
|
80
|
+
zIndex: number;
|
|
81
|
+
};
|
|
82
|
+
export declare class BrushSelect<T extends BaseBehaviorOptions = BrushSelectOptions> extends BaseBehavior<T> {
|
|
83
|
+
static defaultOptions: Partial<BrushSelectOptions>;
|
|
84
|
+
private startPoint?;
|
|
85
|
+
private endPoint?;
|
|
86
|
+
private rectShape?;
|
|
87
|
+
shortcut?: Shortcut;
|
|
88
|
+
selectElementFn: (graph: Graph, id: ID, points: Points) => boolean;
|
|
89
|
+
constructor(context: RuntimeContext, options: T);
|
|
90
|
+
pointerDown: (event: IPointerEvent) => Promise<void>;
|
|
91
|
+
pointerMove: (event: IPointerEvent) => Promise<void>;
|
|
92
|
+
pointerUp: (event: IPointerEvent) => Promise<void>;
|
|
93
|
+
clearSelected: () => void;
|
|
94
|
+
updateElementState: (points: Points) => void;
|
|
95
|
+
private clearBrush;
|
|
96
|
+
getPointsSelectIds: (graph: Graph, points: Points, itemTypes: ElementType[]) => string[];
|
|
97
|
+
isKeydown(): boolean | undefined;
|
|
98
|
+
validate(event: IPointerEvent): any;
|
|
99
|
+
bindEvents(): void;
|
|
100
|
+
unbindEvents(): void;
|
|
101
|
+
destroy(): void;
|
|
102
|
+
}
|
|
103
|
+
export {};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { RuntimeContext } from '../runtime/types';
|
|
2
|
+
import type { IPointerEvent, State } from '../types';
|
|
3
|
+
import type { ShortcutKey } from '../utils/shortcut';
|
|
4
|
+
import type { BaseBehaviorOptions } from './base-behavior';
|
|
5
|
+
import { BaseBehavior } from './base-behavior';
|
|
6
|
+
export interface ClickElementOptions extends BaseBehaviorOptions {
|
|
7
|
+
/**
|
|
8
|
+
* <zh/> 是否启用动画
|
|
9
|
+
*
|
|
10
|
+
* <en/> Whether to enable animation
|
|
11
|
+
*/
|
|
12
|
+
animation?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* <zh/> 是否启用点击元素的功能
|
|
15
|
+
*
|
|
16
|
+
* <en/> Whether to enable the function of clicking the element
|
|
17
|
+
*/
|
|
18
|
+
enable?: boolean | ((event: IPointerEvent) => boolean);
|
|
19
|
+
/**
|
|
20
|
+
* <zh/> 是否允许多选
|
|
21
|
+
*
|
|
22
|
+
* <en/> Whether to allow multiple selection
|
|
23
|
+
*/
|
|
24
|
+
multiple?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* <zh/> 按下该快捷键配合鼠标点击进行多选
|
|
27
|
+
*
|
|
28
|
+
* <en/> Press this shortcut key to apply multiple selection with mouse click
|
|
29
|
+
*/
|
|
30
|
+
trigger?: ShortcutKey;
|
|
31
|
+
/**
|
|
32
|
+
* <zh/> 选中时应用的状态,默认为 selected
|
|
33
|
+
*
|
|
34
|
+
* <en/> The state to be applied when select.
|
|
35
|
+
*/
|
|
36
|
+
selectedState: State;
|
|
37
|
+
/**
|
|
38
|
+
* <zh/> 当有元素被选中时,其他未选中的元素应用的状态,默认为 undefined
|
|
39
|
+
*
|
|
40
|
+
* <en/> The state to be applied on other unselected elements when some elements are selected
|
|
41
|
+
*/
|
|
42
|
+
unselectedState: State;
|
|
43
|
+
/**
|
|
44
|
+
* <zh/> 选中元素的度,即决定了影响范围
|
|
45
|
+
*
|
|
46
|
+
* <en/> The degree to determine the scope of influence
|
|
47
|
+
* @description
|
|
48
|
+
* <zh/> 对于节点来说,
|
|
49
|
+
* - 0 表示只选中当前节点
|
|
50
|
+
* - 1 表示选中当前节点及其直接相邻的节点和边,以此类推
|
|
51
|
+
* 对于边来说,
|
|
52
|
+
* - 0 表示只选中当前边
|
|
53
|
+
* - 1 表示选中当前边及其直接相邻的节点,以此类推
|
|
54
|
+
*
|
|
55
|
+
* <en/> For nodes,
|
|
56
|
+
* - 0 means only the current node is selected
|
|
57
|
+
* - 1 means the current node and its directly adjacent nodes and edges are selected, etc
|
|
58
|
+
* For edges,
|
|
59
|
+
* - 0 means only the current edge is selected
|
|
60
|
+
* - 1 means the current edge and its directly adjacent nodes are selected, etc
|
|
61
|
+
*/
|
|
62
|
+
degree?: number;
|
|
63
|
+
}
|
|
64
|
+
export declare class ClickElement extends BaseBehavior<ClickElementOptions> {
|
|
65
|
+
private selectedElementIds;
|
|
66
|
+
private shortcut;
|
|
67
|
+
static defaultOptions: Partial<ClickElementOptions>;
|
|
68
|
+
constructor(context: RuntimeContext, options: ClickElementOptions);
|
|
69
|
+
private bindEvents;
|
|
70
|
+
private onClickElement;
|
|
71
|
+
private onClickCanvas;
|
|
72
|
+
private updateElementsState;
|
|
73
|
+
private getElementsState;
|
|
74
|
+
private validate;
|
|
75
|
+
private unbindEvents;
|
|
76
|
+
destroy(): void;
|
|
77
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { ID } from '@antv/graphlib';
|
|
2
1
|
import type { RuntimeContext } from '../runtime/types';
|
|
3
|
-
import type { IPointerEvent } from '../types';
|
|
2
|
+
import type { ID, IPointerEvent } from '../types';
|
|
4
3
|
import type { BaseBehaviorOptions } from './base-behavior';
|
|
5
4
|
import { BaseBehavior } from './base-behavior';
|
|
6
5
|
export interface CollapseExpandOptions extends BaseBehaviorOptions {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type { ID } from '@antv/graphlib';
|
|
2
1
|
import type { RuntimeContext } from '../runtime/types';
|
|
3
2
|
import type { EdgeData } from '../spec';
|
|
4
3
|
import type { EdgeStyle } from '../spec/element/edge';
|
|
5
|
-
import type { IPointerEvent } from '../types';
|
|
4
|
+
import type { ID, IPointerEvent } from '../types';
|
|
6
5
|
import type { BaseBehaviorOptions } from './base-behavior';
|
|
7
6
|
import { BaseBehavior } from './base-behavior';
|
|
8
7
|
export interface CreateEdgeOptions extends BaseBehaviorOptions {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Element, ID, IDragEvent, Point } from '../types';
|
|
2
|
+
import type { DragElementOptions } from './drag-element';
|
|
3
|
+
import { DragElement } from './drag-element';
|
|
4
|
+
export interface DragElementForceOptions extends Omit<DragElementOptions, 'animation' | 'dropEffect' | 'shadow'> {
|
|
5
|
+
}
|
|
6
|
+
export declare class DragElementForce extends DragElement {
|
|
7
|
+
private get forceLayoutInstance();
|
|
8
|
+
protected validate(event: IDragEvent<Element>): boolean;
|
|
9
|
+
protected moveElement(ids: ID[], offset: Point): Promise<void>;
|
|
10
|
+
protected onDragStart(event: IDragEvent<Element>): void;
|
|
11
|
+
protected onDrag(event: IDragEvent<Element>): void;
|
|
12
|
+
protected onDragEnd(): void;
|
|
13
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { BaseStyleProps } from '@antv/g';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import type { EdgeDirection, Element, IDragEvent, PrefixObject } from '../types';
|
|
2
|
+
import type { RuntimeContext } from '../runtime/types';
|
|
3
|
+
import type { EdgeDirection, Element, ID, IDragEvent, Point, PrefixObject } from '../types';
|
|
5
4
|
import type { BaseBehaviorOptions } from './base-behavior';
|
|
6
5
|
import { BaseBehavior } from './base-behavior';
|
|
7
6
|
export interface DragElementOptions extends BaseBehaviorOptions, PrefixObject<BaseStyleProps, 'shadow'> {
|
|
@@ -74,9 +73,9 @@ export interface DragElementOptions extends BaseBehaviorOptions, PrefixObject<Ba
|
|
|
74
73
|
}
|
|
75
74
|
export declare class DragElement extends BaseBehavior<DragElementOptions> {
|
|
76
75
|
static defaultOptions: Partial<DragElementOptions>;
|
|
77
|
-
|
|
76
|
+
protected enable: boolean;
|
|
78
77
|
private enableElements;
|
|
79
|
-
|
|
78
|
+
protected target: ID[];
|
|
80
79
|
private shadow?;
|
|
81
80
|
private shadowOrigin;
|
|
82
81
|
private hiddenEdges;
|
|
@@ -84,17 +83,18 @@ export declare class DragElement extends BaseBehavior<DragElementOptions> {
|
|
|
84
83
|
constructor(context: RuntimeContext, options: DragElementOptions);
|
|
85
84
|
update(options: Partial<DragElementOptions>): void;
|
|
86
85
|
private bindEvents;
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
86
|
+
protected getSelectedNodeIDs(currTarget: ID[]): string[];
|
|
87
|
+
protected getDelta(event: IElementDragEvent): [number, number] | Float32Array | [number, number, number];
|
|
88
|
+
protected onDragStart(event: IElementDragEvent): void;
|
|
89
|
+
protected onDrag(event: IElementDragEvent): void;
|
|
90
|
+
protected onDragEnd(): void;
|
|
91
91
|
private onDrop;
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
protected validate(event: IElementDragEvent): boolean;
|
|
93
|
+
protected moveElement(ids: ID[], offset: Point): Promise<void>;
|
|
94
94
|
private moveShadow;
|
|
95
95
|
private createShadow;
|
|
96
96
|
private showEdges;
|
|
97
|
-
|
|
97
|
+
protected hideEdge(): void;
|
|
98
98
|
private unbindEvents;
|
|
99
99
|
destroy(): void;
|
|
100
100
|
}
|
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
export { BaseBehavior } from './base-behavior';
|
|
2
|
+
export { BrushSelect } from './brush-select';
|
|
3
|
+
export { ClickElement } from './click-element';
|
|
2
4
|
export { CollapseExpand } from './collapse-expand';
|
|
3
5
|
export { CreateEdge } from './create-edge';
|
|
4
6
|
export { DragCanvas } from './drag-canvas';
|
|
5
7
|
export { DragElement } from './drag-element';
|
|
8
|
+
export { DragElementForce } from './drag-element-force';
|
|
6
9
|
export { FocusElement } from './focus-element';
|
|
7
10
|
export { HoverElement } from './hover-element';
|
|
11
|
+
export { LassoSelect } from './lasso-select';
|
|
8
12
|
export { ZoomCanvas } from './zoom-canvas';
|
|
9
13
|
export type { BaseBehaviorOptions } from './base-behavior';
|
|
14
|
+
export type { BrushSelectOptions } from './brush-select';
|
|
15
|
+
export type { ClickElementOptions } from './click-element';
|
|
10
16
|
export type { CollapseExpandOptions } from './collapse-expand';
|
|
11
17
|
export type { CreateEdgeOptions } from './create-edge';
|
|
12
18
|
export type { DragCanvasOptions } from './drag-canvas';
|
|
13
19
|
export type { DragElementOptions } from './drag-element';
|
|
20
|
+
export type { DragElementForceOptions } from './drag-element-force';
|
|
14
21
|
export type { FocusElementOptions } from './focus-element';
|
|
15
22
|
export type { HoverElementOptions } from './hover-element';
|
|
23
|
+
export type { LassoSelectOptions } from './lasso-select';
|
|
16
24
|
export type { ZoomCanvasOptions } from './zoom-canvas';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BrushSelect } from './brush-select';
|
|
2
|
+
import type { RuntimeContext } from '../runtime/types';
|
|
3
|
+
import type { ID, IPointerEvent, Points, State } from '../types';
|
|
4
|
+
import type { BrushSelectOptions } from './brush-select';
|
|
5
|
+
export type States = Record<ID, State | State[]>;
|
|
6
|
+
export type LassoSelectOptions = BrushSelectOptions;
|
|
7
|
+
export declare class LassoSelect extends BrushSelect<LassoSelectOptions> {
|
|
8
|
+
static defaultOptions: Partial<LassoSelectOptions>;
|
|
9
|
+
private points?;
|
|
10
|
+
private pathShape?;
|
|
11
|
+
selectElementFn: (graph: import("..").Graph, id: string, points: Points) => boolean;
|
|
12
|
+
constructor(context: RuntimeContext, options: LassoSelectOptions);
|
|
13
|
+
pointerDown: (event: IPointerEvent) => Promise<void>;
|
|
14
|
+
pointerMove: (event: IPointerEvent) => Promise<void>;
|
|
15
|
+
pointerUp: () => Promise<void>;
|
|
16
|
+
clearSelected: () => void;
|
|
17
|
+
private lassoUpdateElementState;
|
|
18
|
+
private clearLasso;
|
|
19
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { BaseBehavior } from './base-behavior';
|
|
2
2
|
import type { DragCanvasOptions } from './drag-canvas';
|
|
3
3
|
import type { ZoomCanvasOptions } from './zoom-canvas';
|
|
4
|
+
export type { States } from './brush-select';
|
|
4
5
|
export type BuiltInBehaviorOptions = DragCanvasOptions | ZoomCanvasOptions;
|
|
5
6
|
export type Behavior = BaseBehavior<any>;
|
|
@@ -2,7 +2,7 @@ export declare const ChangeEvent: {
|
|
|
2
2
|
/** <zh/> 数据变更 | <en/> 数据变更 */
|
|
3
3
|
CHANGE: string;
|
|
4
4
|
};
|
|
5
|
-
export declare const enum
|
|
5
|
+
export declare const enum ChangeType {
|
|
6
6
|
'NodeAdded' = "NodeAdded",
|
|
7
7
|
'NodeUpdated' = "NodeUpdated",
|
|
8
8
|
'NodeRemoved' = "NodeRemoved",
|
|
@@ -42,11 +42,13 @@ export declare enum GraphEvent {
|
|
|
42
42
|
/** <zh/> 可视区域变化之前 | <en/> Before the visible area changes */
|
|
43
43
|
BEFORE_TRANSFORM = "beforetransform",
|
|
44
44
|
/** <zh/> 可视区域变化之后 | <en/> After the visible area changes */
|
|
45
|
-
AFTER_TRANSFORM = "aftertransform"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
45
|
+
AFTER_TRANSFORM = "aftertransform",
|
|
46
|
+
/** <zh/> 状态变化之前 | <en/> Before the state changes */
|
|
47
|
+
BEFORE_ELEMENT_STATE_CHANGE = "beforeelementstatechange",
|
|
48
|
+
/** <zh/> 状态变化之后 | <en/> After the state changes */
|
|
49
|
+
AFTER_ELEMENT_STATE_CHANGE = "afterelementstatechange",
|
|
50
|
+
/** <zh/> 批处理开始 | <en/> Batch processing starts */
|
|
51
|
+
BATCH_START = "batchstart",
|
|
52
|
+
/** <zh/> 批处理结束 | <en/> Batch processing ends */
|
|
53
|
+
BATCH_END = "batchend"
|
|
52
54
|
}
|
|
@@ -16,5 +16,7 @@ export declare enum ExtensionCategory {
|
|
|
16
16
|
/** <zh/> 插件 | <en/> Plugin */
|
|
17
17
|
PLUGIN = "plugin",
|
|
18
18
|
/** <zh/> 动画 | <en/> Animation */
|
|
19
|
-
ANIMATION = "animation"
|
|
19
|
+
ANIMATION = "animation",
|
|
20
|
+
/** <zh/> 数据转换 |<en/> Data transform */
|
|
21
|
+
TRANSFORM = "transform"
|
|
20
22
|
}
|
|
@@ -1,8 +1,49 @@
|
|
|
1
|
-
import type { AABB,
|
|
2
|
-
import type {
|
|
1
|
+
import type { AABB, DisplayObject, DisplayObjectConfig, Group } from '@antv/g';
|
|
2
|
+
import type { BaseElementStyleProps, Combo, Node, NodeLikeData, Padding, Placement, Position, PrefixObject, STDSize, Size } from '../../types';
|
|
3
3
|
import type { BaseNodeStyleProps } from '../nodes';
|
|
4
4
|
import { BaseNode } from '../nodes';
|
|
5
5
|
import { IconStyleProps } from '../shapes';
|
|
6
|
+
export type BaseComboStyleProps<T extends Record<string, unknown> = Record<string, any>> = T & BaseElementStyleProps & BaseNodeStyleProps<T> & PrefixObject<T, 'collapsed'> & PrefixObject<CollapsedMarkerStyleProps, 'collapsedMarker'> & {
|
|
7
|
+
/**
|
|
8
|
+
* <zh/> Combo 展开后的默认大小
|
|
9
|
+
*
|
|
10
|
+
* <en/> The default size of combo when expanded
|
|
11
|
+
*/
|
|
12
|
+
size?: Size;
|
|
13
|
+
/**
|
|
14
|
+
* <zh/> Combo 收起后的默认大小
|
|
15
|
+
*
|
|
16
|
+
* <en/> The default size of combo when collapsed
|
|
17
|
+
*/
|
|
18
|
+
collapsedSize?: Size;
|
|
19
|
+
/**
|
|
20
|
+
* <zh/> Combo 收起时的原点
|
|
21
|
+
* <en/> The origin of combo when collapsed
|
|
22
|
+
*/
|
|
23
|
+
collapsedOrigin?: Placement | [number, number];
|
|
24
|
+
/**
|
|
25
|
+
* <zh/> Combo 的子元素,可以是节点或者 Combo
|
|
26
|
+
*
|
|
27
|
+
* <en/> The children of combo, which can be nodes or combos
|
|
28
|
+
*/
|
|
29
|
+
childrenNode?: (Node | Combo)[];
|
|
30
|
+
/**
|
|
31
|
+
* <zh/> Combo 的子元素数据
|
|
32
|
+
*
|
|
33
|
+
* <en/> The data of the children of combo
|
|
34
|
+
* @description
|
|
35
|
+
* <zh/> 如果 combo 是收起状态,children 可能为空,通过 childrenData 能够获取完整的子元素数据
|
|
36
|
+
*
|
|
37
|
+
* <en/> If the combo is collapsed, children may be empty, and the complete child element data can be obtained through childrenData
|
|
38
|
+
*/
|
|
39
|
+
childrenData?: NodeLikeData[];
|
|
40
|
+
/**
|
|
41
|
+
* <zh/> Combo 的内边距,只在展开状态下生效
|
|
42
|
+
* <en/> The padding of combo, only effective when expanded
|
|
43
|
+
*/
|
|
44
|
+
padding?: Padding;
|
|
45
|
+
collapsedMarker?: boolean;
|
|
46
|
+
};
|
|
6
47
|
export type CollapsedMarkerStyleProps = IconStyleProps & {
|
|
7
48
|
/**
|
|
8
49
|
* <zh/> 标记类型
|
|
@@ -15,10 +56,6 @@ export type CollapsedMarkerStyleProps = IconStyleProps & {
|
|
|
15
56
|
*/
|
|
16
57
|
type?: 'child-count' | 'descendant-count' | 'node-count' | ((children: NodeLikeData[]) => string);
|
|
17
58
|
};
|
|
18
|
-
export type BaseComboStyleProps<KeyStyleProps extends BaseStyleProps = BaseStyleProps> = BaseComboProps & PrefixObject<KeyStyleProps, 'collapsed'> & {
|
|
19
|
-
collapsedMarker?: boolean;
|
|
20
|
-
} & PrefixObject<CollapsedMarkerStyleProps, 'collapsedMarker'> & BaseNodeStyleProps<KeyStyleProps>;
|
|
21
|
-
export type ParsedBaseComboStyleProps<KeyStyleProps extends BaseStyleProps> = Required<BaseComboStyleProps<KeyStyleProps>>;
|
|
22
59
|
export declare abstract class BaseCombo<S extends BaseComboStyleProps = BaseComboStyleProps> extends BaseNode<S> {
|
|
23
60
|
type: string;
|
|
24
61
|
static defaultStyleProps: Partial<BaseComboStyleProps>;
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import type { DisplayObjectConfig, CircleStyleProps as GCircleStyleProps } from '@antv/g';
|
|
2
2
|
import { Circle as GCircle, Group } from '@antv/g';
|
|
3
3
|
import type { Position, STDSize } from '../../types';
|
|
4
|
-
import type { BaseComboStyleProps
|
|
4
|
+
import type { BaseComboStyleProps } from './base-combo';
|
|
5
5
|
import { BaseCombo } from './base-combo';
|
|
6
|
-
export type CircleComboStyleProps = BaseComboStyleProps
|
|
7
|
-
type ParsedCircleComboStyleProps = ParsedBaseComboStyleProps<KeyStyleProps>;
|
|
8
|
-
type CircleComboOptions = DisplayObjectConfig<CircleComboStyleProps>;
|
|
9
|
-
type KeyStyleProps = GCircleStyleProps;
|
|
6
|
+
export type CircleComboStyleProps = BaseComboStyleProps;
|
|
10
7
|
export declare class CircleCombo extends BaseCombo<CircleComboStyleProps> {
|
|
11
|
-
constructor(options:
|
|
12
|
-
protected drawKeyShape(attributes:
|
|
13
|
-
protected getKeyStyle(attributes:
|
|
14
|
-
protected getCollapsedKeySize(attributes:
|
|
15
|
-
protected getExpandedKeySize(attributes:
|
|
16
|
-
protected getCollapsedOriginPosition(attributes:
|
|
8
|
+
constructor(options: DisplayObjectConfig<CircleComboStyleProps>);
|
|
9
|
+
protected drawKeyShape(attributes: Required<CircleComboStyleProps>, container: Group): GCircle | undefined;
|
|
10
|
+
protected getKeyStyle(attributes: Required<CircleComboStyleProps>): GCircleStyleProps;
|
|
11
|
+
protected getCollapsedKeySize(attributes: Required<CircleComboStyleProps>): STDSize;
|
|
12
|
+
protected getExpandedKeySize(attributes: Required<CircleComboStyleProps>): STDSize;
|
|
13
|
+
protected getCollapsedOriginPosition(attributes: Required<CircleComboStyleProps>): Position;
|
|
17
14
|
}
|
|
18
|
-
export {};
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import type { DisplayObjectConfig, RectStyleProps as GRectStyleProps } from '@antv/g';
|
|
2
2
|
import { Rect as GRect, Group } from '@antv/g';
|
|
3
|
-
import type { BaseComboStyleProps
|
|
3
|
+
import type { BaseComboStyleProps } from './base-combo';
|
|
4
4
|
import { BaseCombo } from './base-combo';
|
|
5
|
-
type
|
|
6
|
-
export type RectComboStyleProps = BaseComboStyleProps<KeyStyleProps>;
|
|
7
|
-
type ParsedRectComboStyleProps = ParsedBaseComboStyleProps<KeyStyleProps>;
|
|
8
|
-
type RectComboOptions = DisplayObjectConfig<RectComboStyleProps>;
|
|
5
|
+
export type RectComboStyleProps = BaseComboStyleProps;
|
|
9
6
|
export declare class RectCombo extends BaseCombo<RectComboStyleProps> {
|
|
10
7
|
static defaultStyleProps: Partial<RectComboStyleProps>;
|
|
11
|
-
constructor(options:
|
|
12
|
-
protected drawKeyShape(attributes:
|
|
13
|
-
protected getKeyStyle(attributes:
|
|
8
|
+
constructor(options: DisplayObjectConfig<RectComboStyleProps>);
|
|
9
|
+
protected drawKeyShape(attributes: Required<RectComboStyleProps>, container: Group): GRect | undefined;
|
|
10
|
+
protected getKeyStyle(attributes: Required<RectComboStyleProps>): GRectStyleProps;
|
|
14
11
|
}
|
|
15
|
-
export {};
|
|
@@ -1,11 +1,73 @@
|
|
|
1
1
|
import type { DisplayObjectConfig, Group, ImageStyleProps, PathStyleProps } from '@antv/g';
|
|
2
2
|
import { Path } from '@antv/g';
|
|
3
3
|
import type { PathArray } from '@antv/util';
|
|
4
|
-
import type {
|
|
4
|
+
import type { BaseElementStyleProps, EdgeLabelStyleProps, Keyframe, LoopPlacement, Node, Point, PrefixObject, Size } from '../../types';
|
|
5
5
|
import type { SymbolFactor } from '../../utils/symbol';
|
|
6
6
|
import type { LabelStyleProps } from '../shapes';
|
|
7
7
|
import { BaseShape } from '../shapes/base-shape';
|
|
8
|
-
export type BaseEdgeStyleProps =
|
|
8
|
+
export type BaseEdgeStyleProps = BaseElementStyleProps & Pick<PathStyleProps, 'isBillboard' | 'markerStart' | 'markerStartOffset' | 'markerEnd' | 'markerEndOffset' | 'markerMid'> & PrefixObject<EdgeLabelStyleProps, 'label'> & PrefixObject<PathStyleProps, 'halo'> & PrefixObject<EdgeArrowStyleProps, 'startArrow'> & PrefixObject<EdgeArrowStyleProps, 'endArrow'> & PrefixObject<LoopStyleProps, 'loop'> & {
|
|
9
|
+
/**
|
|
10
|
+
* <zh/> 是否显示边的标签
|
|
11
|
+
*
|
|
12
|
+
* <en/> Whether to display the label of the edge
|
|
13
|
+
*/
|
|
14
|
+
label?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* <zh/> 是否显示边的光晕
|
|
17
|
+
*
|
|
18
|
+
* <en/> Whether to display the halo of the edge
|
|
19
|
+
*/
|
|
20
|
+
halo?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* <zh/> 是否显示边的起始箭头
|
|
23
|
+
*
|
|
24
|
+
* <en/> Whether to display the start arrow of the edge
|
|
25
|
+
*/
|
|
26
|
+
startArrow?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* <zh/> 是否显示边的结束箭头
|
|
29
|
+
*
|
|
30
|
+
* <en/> Whether to display the end arrow of the edge
|
|
31
|
+
*/
|
|
32
|
+
endArrow?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* <zh/> 起始箭头的偏移量
|
|
35
|
+
*
|
|
36
|
+
* <en/> Offset of the start arrow
|
|
37
|
+
*/
|
|
38
|
+
startArrowOffset?: number;
|
|
39
|
+
/**
|
|
40
|
+
* <zh/> 结束箭头的偏移量
|
|
41
|
+
*
|
|
42
|
+
* <en/> Offset of the end arrow
|
|
43
|
+
*/
|
|
44
|
+
endArrowOffset?: number;
|
|
45
|
+
/**
|
|
46
|
+
* <zh/> 主色
|
|
47
|
+
* <en/> Subject color
|
|
48
|
+
*/
|
|
49
|
+
color?: string;
|
|
50
|
+
/**
|
|
51
|
+
* <zh/> 边的起点 shape
|
|
52
|
+
* <en/> The source shape. Represents the start of the edge
|
|
53
|
+
*/
|
|
54
|
+
sourceNode: Node;
|
|
55
|
+
/**
|
|
56
|
+
* <zh/> 边的终点 shape
|
|
57
|
+
* <en/> The source shape. Represents the start of the edge
|
|
58
|
+
*/
|
|
59
|
+
targetNode: Node;
|
|
60
|
+
/**
|
|
61
|
+
* <zh/> 边起始连接的 port
|
|
62
|
+
* <en/> The Port of the source node
|
|
63
|
+
*/
|
|
64
|
+
sourcePort?: string;
|
|
65
|
+
/**
|
|
66
|
+
* <zh/> 边终点连接的 port
|
|
67
|
+
* <en/> The Port of the target node
|
|
68
|
+
*/
|
|
69
|
+
targetPort?: string;
|
|
70
|
+
};
|
|
9
71
|
type ParsedBaseEdgeStyleProps = Required<BaseEdgeStyleProps>;
|
|
10
72
|
export declare abstract class BaseEdge extends BaseShape<BaseEdgeStyleProps> {
|
|
11
73
|
type: string;
|
|
@@ -68,12 +130,4 @@ export type LoopStyleProps = {
|
|
|
68
130
|
*/
|
|
69
131
|
dist?: number;
|
|
70
132
|
};
|
|
71
|
-
type ShapeSwitch = {
|
|
72
|
-
label?: boolean;
|
|
73
|
-
halo?: boolean;
|
|
74
|
-
startArrow?: boolean;
|
|
75
|
-
endArrow?: boolean;
|
|
76
|
-
startArrowOffset?: number;
|
|
77
|
-
endArrowOffset?: number;
|
|
78
|
-
};
|
|
79
133
|
export {};
|
|
@@ -2,7 +2,7 @@ import type { DisplayObjectConfig } from '@antv/g';
|
|
|
2
2
|
import type { Point } from '../../types';
|
|
3
3
|
import type { BaseEdgeStyleProps } from './base-edge';
|
|
4
4
|
import { Cubic } from './cubic';
|
|
5
|
-
export
|
|
5
|
+
export interface CubicHorizontalStyleProps extends BaseEdgeStyleProps {
|
|
6
6
|
/**
|
|
7
7
|
* <zh/> 控制点在两端点连线上的相对位置,范围为`0-1`
|
|
8
8
|
* <en/> The relative position of the control point on the line, ranging from `0-1`
|
|
@@ -13,7 +13,7 @@ export type CubicHorizontalStyleProps = BaseEdgeStyleProps & {
|
|
|
13
13
|
* <en/> The distance of the control point from the line
|
|
14
14
|
*/
|
|
15
15
|
curveOffset?: number | [number, number];
|
|
16
|
-
}
|
|
16
|
+
}
|
|
17
17
|
export declare class CubicHorizontal extends Cubic {
|
|
18
18
|
static defaultStyleProps: Partial<CubicHorizontalStyleProps>;
|
|
19
19
|
constructor(options: DisplayObjectConfig<CubicHorizontalStyleProps>);
|
|
@@ -2,7 +2,7 @@ import type { DisplayObjectConfig } from '@antv/g';
|
|
|
2
2
|
import type { Point } from '../../types';
|
|
3
3
|
import type { BaseEdgeStyleProps } from './base-edge';
|
|
4
4
|
import { Cubic } from './cubic';
|
|
5
|
-
export
|
|
5
|
+
export interface CubicVerticalStyleProps extends BaseEdgeStyleProps {
|
|
6
6
|
/**
|
|
7
7
|
* <zh/> 控制点在两端点连线上的相对位置,范围为`0-1`
|
|
8
8
|
* <en/> The relative position of the control point on the line, ranging from `0-1`
|
|
@@ -13,7 +13,7 @@ export type CubicVerticalStyleProps = BaseEdgeStyleProps & {
|
|
|
13
13
|
* <en/> The distance of the control point from the line
|
|
14
14
|
*/
|
|
15
15
|
curveOffset?: number | [number, number];
|
|
16
|
-
}
|
|
16
|
+
}
|
|
17
17
|
export declare class CubicVertical extends Cubic {
|
|
18
18
|
static defaultStyleProps: Partial<CubicVerticalStyleProps>;
|
|
19
19
|
constructor(options: DisplayObjectConfig<CubicVerticalStyleProps>);
|
|
@@ -3,7 +3,7 @@ import type { PathArray } from '@antv/util';
|
|
|
3
3
|
import type { Point } from '../../types';
|
|
4
4
|
import type { BaseEdgeStyleProps } from './base-edge';
|
|
5
5
|
import { BaseEdge } from './base-edge';
|
|
6
|
-
export
|
|
6
|
+
export interface CubicStyleProps extends BaseEdgeStyleProps {
|
|
7
7
|
/**
|
|
8
8
|
* <zh/> 控制点数组,用于定义曲线的形状。如果不指定,将会通过`curveOffset`和`curvePosition`来计算控制点
|
|
9
9
|
* <en/> Control points. Used to define the shape of the curve. If not specified, it will be calculated using `curveOffset` and `curvePosition`.
|
|
@@ -19,7 +19,7 @@ export type CubicStyleProps = BaseEdgeStyleProps & {
|
|
|
19
19
|
* <en/> The distance of the control point from the line
|
|
20
20
|
*/
|
|
21
21
|
curveOffset?: number | [number, number];
|
|
22
|
-
}
|
|
22
|
+
}
|
|
23
23
|
type ParsedCubicStyleProps = Required<CubicStyleProps>;
|
|
24
24
|
export declare class Cubic extends BaseEdge {
|
|
25
25
|
static defaultStyleProps: Partial<CubicStyleProps>;
|
|
@@ -3,7 +3,7 @@ import type { PathArray } from '@antv/util';
|
|
|
3
3
|
import type { Padding, Point } from '../../types';
|
|
4
4
|
import type { BaseEdgeStyleProps } from './base-edge';
|
|
5
5
|
import { BaseEdge } from './base-edge';
|
|
6
|
-
export
|
|
6
|
+
export interface PolylineStyleProps extends BaseEdgeStyleProps {
|
|
7
7
|
/**
|
|
8
8
|
* <zh/> 圆角半径
|
|
9
9
|
* <en/> The radius of the rounded corner
|
|
@@ -29,7 +29,7 @@ export type PolylineStyleProps = BaseEdgeStyleProps & {
|
|
|
29
29
|
* <en/> Padding for routing calculation
|
|
30
30
|
*/
|
|
31
31
|
routerPadding?: Padding;
|
|
32
|
-
}
|
|
32
|
+
}
|
|
33
33
|
type ParsedPolylineStyleProps = Required<PolylineStyleProps>;
|
|
34
34
|
export declare class Polyline extends BaseEdge {
|
|
35
35
|
static defaultStyleProps: Partial<PolylineStyleProps>;
|