@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
|
@@ -1,149 +1,15 @@
|
|
|
1
|
-
import type { BaseStyleProps
|
|
2
|
-
import type { ID } from '@antv/graphlib';
|
|
1
|
+
import type { BaseStyleProps } from '@antv/g';
|
|
3
2
|
import type { BaseCombo } from '../elements/combos';
|
|
4
3
|
import type { BaseEdge } from '../elements/edges';
|
|
5
4
|
import type { BaseNode } from '../elements/nodes';
|
|
6
5
|
import type { RuntimeContext } from '../runtime/types';
|
|
7
|
-
import type { ComboOptions, EdgeOptions,
|
|
8
|
-
import type { NodeLikeData } from './data';
|
|
9
|
-
import type { Padding } from './padding';
|
|
10
|
-
import type { Placement } from './placement';
|
|
11
|
-
import type { Size } from './size';
|
|
6
|
+
import type { ComboOptions, EdgeOptions, NodeOptions } from '../spec';
|
|
12
7
|
export type ElementType = 'node' | 'edge' | 'combo';
|
|
13
8
|
export type ElementOptions = NodeOptions | EdgeOptions | ComboOptions;
|
|
14
|
-
export type Node = BaseNode
|
|
9
|
+
export type Node = BaseNode<any>;
|
|
15
10
|
export type Edge = BaseEdge;
|
|
16
|
-
export type Combo = BaseCombo
|
|
17
|
-
export type NodeLike = Node | Combo;
|
|
11
|
+
export type Combo = BaseCombo<any>;
|
|
18
12
|
export type Element = Node | Edge | Combo;
|
|
19
|
-
|
|
13
|
+
export interface BaseElementStyleProps extends BaseStyleProps {
|
|
20
14
|
context?: RuntimeContext;
|
|
21
|
-
}
|
|
22
|
-
export type BaseNodeProps = BaseElementStyleProps & {
|
|
23
|
-
/**
|
|
24
|
-
* <zh/> x 坐标
|
|
25
|
-
*
|
|
26
|
-
* <en/> The x-coordinate of node
|
|
27
|
-
*/
|
|
28
|
-
x?: number | string;
|
|
29
|
-
/**
|
|
30
|
-
* <zh/> y 坐标
|
|
31
|
-
*
|
|
32
|
-
* <en/> The y-coordinate of node
|
|
33
|
-
*/
|
|
34
|
-
y?: number | string;
|
|
35
|
-
/**
|
|
36
|
-
* <zh/> 节点大小,快捷设置节点宽高
|
|
37
|
-
*
|
|
38
|
-
* <en/> The size of node, which is a shortcut to set the width and height of node
|
|
39
|
-
*/
|
|
40
|
-
size?: Size;
|
|
41
|
-
/**
|
|
42
|
-
* <zh/> 主色
|
|
43
|
-
*
|
|
44
|
-
* <en/> Subject color
|
|
45
|
-
*/
|
|
46
|
-
color?: string;
|
|
47
|
-
/**
|
|
48
|
-
* <zh/> 解决类型 style.getPropertyValue 问题,不要使用该属性
|
|
49
|
-
*
|
|
50
|
-
* <en/> Solve the problem of style.getPropertyValue, do not use this property
|
|
51
|
-
* @description
|
|
52
|
-
* <zh/> 移除该属性会导致 Polygon 及其子类与 Node 不兼容
|
|
53
|
-
*
|
|
54
|
-
* <en/> Removing this property will cause Polygon and its subclasses to be incompatible with Node
|
|
55
|
-
* @ignore
|
|
56
|
-
*/
|
|
57
|
-
points?: ([number, number] | [number, number, number])[];
|
|
58
|
-
/**
|
|
59
|
-
* <zh/> 父节点 id
|
|
60
|
-
* <en/> The id of the parent node/combo
|
|
61
|
-
*/
|
|
62
|
-
parentId?: ID;
|
|
63
|
-
/**
|
|
64
|
-
* <zh/> 是否收起
|
|
65
|
-
*
|
|
66
|
-
* <en/> Indicates whether the node is collapsed
|
|
67
|
-
*/
|
|
68
|
-
collapsed?: boolean;
|
|
69
|
-
/**
|
|
70
|
-
* <zh/> 子节点实例
|
|
71
|
-
*
|
|
72
|
-
* <en/> The instance of the child node
|
|
73
|
-
*/
|
|
74
|
-
childrenNode?: Node[];
|
|
75
|
-
/**
|
|
76
|
-
* <zh/> 子节点数据
|
|
77
|
-
*
|
|
78
|
-
* <en/> The data of the child node
|
|
79
|
-
*/
|
|
80
|
-
childrenData?: NodeData[];
|
|
81
|
-
};
|
|
82
|
-
export type BaseEdgeProps = BaseElementStyleProps & Pick<PathStyleProps, 'isBillboard' | 'markerStart' | 'markerStartOffset' | 'markerEnd' | 'markerEndOffset' | 'markerMid'> & {
|
|
83
|
-
/**
|
|
84
|
-
* <zh/> 主色
|
|
85
|
-
* <en/> Subject color
|
|
86
|
-
*/
|
|
87
|
-
color?: string;
|
|
88
|
-
/**
|
|
89
|
-
* <zh/> 边的起点 shape
|
|
90
|
-
* <en/> The source shape. Represents the start of the edge
|
|
91
|
-
*/
|
|
92
|
-
sourceNode: Node;
|
|
93
|
-
/**
|
|
94
|
-
* <zh/> 边的终点 shape
|
|
95
|
-
* <en/> The source shape. Represents the start of the edge
|
|
96
|
-
*/
|
|
97
|
-
targetNode: Node;
|
|
98
|
-
/**
|
|
99
|
-
* <zh/> 边起始连接的 port
|
|
100
|
-
* <en/> The Port of the source node
|
|
101
|
-
*/
|
|
102
|
-
sourcePort?: string;
|
|
103
|
-
/**
|
|
104
|
-
* <zh/> 边终点连接的 port
|
|
105
|
-
* <en/> The Port of the target node
|
|
106
|
-
*/
|
|
107
|
-
targetPort?: string;
|
|
108
|
-
};
|
|
109
|
-
export type BaseComboProps = BaseElementStyleProps & {
|
|
110
|
-
/**
|
|
111
|
-
* <zh/> Combo 展开后的默认大小
|
|
112
|
-
*
|
|
113
|
-
* <en/> The default size of combo when expanded
|
|
114
|
-
*/
|
|
115
|
-
size?: Size;
|
|
116
|
-
/**
|
|
117
|
-
* <zh/> Combo 收起后的默认大小
|
|
118
|
-
*
|
|
119
|
-
* <en/> The default size of combo when collapsed
|
|
120
|
-
*/
|
|
121
|
-
collapsedSize?: Size;
|
|
122
|
-
/**
|
|
123
|
-
* <zh/> Combo 收起时的原点
|
|
124
|
-
* <en/> The origin of combo when collapsed
|
|
125
|
-
*/
|
|
126
|
-
collapsedOrigin?: Placement | [number, number];
|
|
127
|
-
/**
|
|
128
|
-
* <zh/> Combo 的子元素,可以是节点或者 Combo
|
|
129
|
-
*
|
|
130
|
-
* <en/> The children of combo, which can be nodes or combos
|
|
131
|
-
*/
|
|
132
|
-
childrenNode?: NodeLike[];
|
|
133
|
-
/**
|
|
134
|
-
* <zh/> Combo 的子元素数据
|
|
135
|
-
*
|
|
136
|
-
* <en/> The data of the children of combo
|
|
137
|
-
* @description
|
|
138
|
-
* <zh/> 如果 combo 是收起状态,children 可能为空,通过 childrenData 能够获取完整的子元素数据
|
|
139
|
-
*
|
|
140
|
-
* <en/> If the combo is collapsed, children may be empty, and the complete child element data can be obtained through childrenData
|
|
141
|
-
*/
|
|
142
|
-
childrenData?: NodeLikeData[];
|
|
143
|
-
/**
|
|
144
|
-
* <zh/> Combo 的内边距,只在展开状态下生效
|
|
145
|
-
* <en/> The padding of combo, only effective when expanded
|
|
146
|
-
*/
|
|
147
|
-
padding?: Padding;
|
|
148
|
-
};
|
|
149
|
-
export {};
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ID = string;
|
|
@@ -9,6 +9,7 @@ export type * from './element';
|
|
|
9
9
|
export type * from './enum';
|
|
10
10
|
export type * from './event';
|
|
11
11
|
export type * from './graphlib';
|
|
12
|
+
export type * from './id';
|
|
12
13
|
export type * from './node';
|
|
13
14
|
export type * from './padding';
|
|
14
15
|
export type * from './placement';
|
package/dist/lib/types/node.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type { DisplayObject, CircleStyleProps as GCircleStyleProps } from '@antv/g';
|
|
2
2
|
import type { CardinalPlacement, CornerPlacement, DirectionalPlacement, RelativePlacement } from './placement';
|
|
3
|
-
import { Point } from './point';
|
|
3
|
+
import type { Point } from './point';
|
|
4
4
|
export type PortPlacement = RelativePlacement | CardinalPlacement;
|
|
5
5
|
export type StarPortPlacement = RelativePlacement | 'top' | 'left' | 'right' | 'left-bottom' | 'right-bottom';
|
|
6
6
|
export type TrianglePortPlacement = RelativePlacement | CardinalPlacement;
|
|
7
7
|
export type BadgePlacement = CardinalPlacement | CornerPlacement;
|
|
8
8
|
export type LabelPlacement = DirectionalPlacement;
|
|
9
|
-
export
|
|
9
|
+
export interface PortStyleProps extends GCircleStyleProps {
|
|
10
10
|
/**
|
|
11
11
|
* <zh/> 是否连接到中心
|
|
12
12
|
* <en/> Whether to connect to the center
|
|
13
13
|
*/
|
|
14
14
|
linkToCenter?: boolean;
|
|
15
|
-
}
|
|
15
|
+
}
|
|
16
16
|
export type Port = DisplayObject<PortStyleProps> | Point;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ElementDatum } from './data';
|
|
2
2
|
/**
|
|
3
3
|
* <zh/> 样式计算迭代上下文
|
|
4
4
|
*
|
|
@@ -6,6 +6,4 @@ import type { ElementData, ElementDatum } from './data';
|
|
|
6
6
|
*/
|
|
7
7
|
export type StyleIterationContext = {
|
|
8
8
|
datum: ElementDatum;
|
|
9
|
-
index: number;
|
|
10
|
-
elementData: ElementData;
|
|
11
9
|
};
|
|
@@ -36,7 +36,7 @@ export declare function executeAnimation<T extends DisplayObject>(shape: T, keyf
|
|
|
36
36
|
*
|
|
37
37
|
* <en/> During the animation, some attributes do not explicitly specify the attribute value, but in fact there is an attribute value in G, so use this method to get the actual default value
|
|
38
38
|
*/
|
|
39
|
-
export declare function inferDefaultValue(name: string): 1 | 0 | undefined;
|
|
39
|
+
export declare function inferDefaultValue(name: string): false | 1 | never[] | 0 | "visible" | undefined;
|
|
40
40
|
type Callbacks = {
|
|
41
41
|
before?: () => void;
|
|
42
42
|
beforeAnimate?: (result: IAnimation) => void;
|
|
@@ -51,7 +51,7 @@ type Callbacks = {
|
|
|
51
51
|
* @param callbacks - <zh/> 回调函数 | <en/> callback function
|
|
52
52
|
* @returns <zh/> 动画对象 | <en/> animation object
|
|
53
53
|
*/
|
|
54
|
-
export declare function withAnimationCallbacks(animation: IAnimation | null, callbacks: Callbacks): IAnimation | null;
|
|
54
|
+
export declare function withAnimationCallbacks(animation: IAnimation | null | undefined, callbacks: Callbacks): IAnimation | null;
|
|
55
55
|
/**
|
|
56
56
|
* <zh/> 执行动画任务
|
|
57
57
|
*
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Graph } from '../../runtime/graph';
|
|
2
|
+
import type { ID, Point, Points } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* <zh/> 元素中心是否在 rect 中
|
|
5
|
+
*
|
|
6
|
+
* <en/> Element center in rect.
|
|
7
|
+
* @param graph Graph
|
|
8
|
+
* @param id ID
|
|
9
|
+
* @param points Points
|
|
10
|
+
* @returns boolean
|
|
11
|
+
*/
|
|
12
|
+
export declare function isBBoxCenterInRect(graph: Graph, id: ID, points: Points): boolean;
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @param start
|
|
16
|
+
* @param end
|
|
17
|
+
*/
|
|
18
|
+
export declare function getRectPoints(start: Point, end: Point): Points;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Graph } from '../../runtime/graph';
|
|
2
|
+
import type { ID, Points } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* <zh/> 元素中心是否在 path 中
|
|
5
|
+
*
|
|
6
|
+
* <en/> Element center in path.
|
|
7
|
+
* @param graph Graph
|
|
8
|
+
* @param id ID
|
|
9
|
+
* @param points Points
|
|
10
|
+
* @returns boolean
|
|
11
|
+
*/
|
|
12
|
+
export declare const isBBoxIntersectPolygon: (graph: Graph, id: ID, points: Points) => boolean;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { States } from '../../behaviors/types';
|
|
2
|
+
import type { Graph } from '../../runtime/graph';
|
|
3
|
+
import type { ID } from '../../types';
|
|
4
|
+
/**
|
|
5
|
+
* <zh/> 获取所有元素状态.
|
|
6
|
+
*
|
|
7
|
+
* <en/> Gets all element states.
|
|
8
|
+
* @param graph Graph
|
|
9
|
+
* @param callback (id: ID, state: string[]) => string[]
|
|
10
|
+
* @returns States
|
|
11
|
+
*/
|
|
12
|
+
export declare const getAllElementState: (graph: Graph, callback?: (id: ID, state: string[]) => string[]) => States;
|
|
13
|
+
/**
|
|
14
|
+
* <zh/> 转化 edge 状态.
|
|
15
|
+
*
|
|
16
|
+
* <en/> Example Transform the edge state.
|
|
17
|
+
* @param graph Graph
|
|
18
|
+
* @param states States
|
|
19
|
+
* @param state 'active' | 'selected'
|
|
20
|
+
*/
|
|
21
|
+
export declare const transformEdgeState: (graph: Graph, states: States, state: 'active' | 'selected') => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DataChange } from '../types';
|
|
1
|
+
import type { DataChange, DataChanges } from '../types';
|
|
2
2
|
/**
|
|
3
3
|
* <zh/> 对数据操作进行约简
|
|
4
4
|
*
|
|
@@ -7,3 +7,11 @@ import type { DataChange } from '../types';
|
|
|
7
7
|
* @returns <zh/> 约简后的数据操作 | <en/> reduced data changes
|
|
8
8
|
*/
|
|
9
9
|
export declare function reduceDataChanges(changes: DataChange[]): DataChange[];
|
|
10
|
+
/**
|
|
11
|
+
* <zh/> 对数据操作进行分类
|
|
12
|
+
*
|
|
13
|
+
* <en/> Classify data changes
|
|
14
|
+
* @param changes - <zh/> 数据操作 | <en/> data changes
|
|
15
|
+
* @returns <zh/> 分类后的数据操作 | <en/> classified data changes
|
|
16
|
+
*/
|
|
17
|
+
export declare function groupByChangeType(changes: DataChange[]): DataChanges;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BaseComboStyleProps } from '../elements/combos/base-combo';
|
|
2
|
+
import type { Point, Position, Size } from '../types';
|
|
2
3
|
/**
|
|
3
4
|
* <zh/> 获取矩形 Combo 收起时原点的相对位置
|
|
4
5
|
*
|
|
@@ -8,7 +9,7 @@ import type { BaseComboProps, Point, Position, Size } from '../types';
|
|
|
8
9
|
* @param expandedSize - <zh/> 展开尺寸 | <en/> expanded size
|
|
9
10
|
* @returns <zh/> 收起时的原点 | <en/> origin when collapsed
|
|
10
11
|
*/
|
|
11
|
-
export declare function getRectCollapsedOrigin(collapsedOrigin:
|
|
12
|
+
export declare function getRectCollapsedOrigin(collapsedOrigin: BaseComboStyleProps['collapsedOrigin'], collapsedSize: Size, expandedSize: Size): Position;
|
|
12
13
|
/**
|
|
13
14
|
* <zh/> 获取圆形 Combo 收起时原点的相对位置
|
|
14
15
|
*
|
|
@@ -18,7 +19,7 @@ export declare function getRectCollapsedOrigin(collapsedOrigin: BaseComboProps['
|
|
|
18
19
|
* @param expandedSize - <zh/> 展开尺寸 | <en/> expanded size
|
|
19
20
|
* @returns <zh/> 收起时的原点 | <en/> origin when collapsed
|
|
20
21
|
*/
|
|
21
|
-
export declare function getCircleCollapsedOrigin(collapsedOrigin:
|
|
22
|
+
export declare function getCircleCollapsedOrigin(collapsedOrigin: BaseComboStyleProps['collapsedOrigin'], collapsedSize: Size, expandedSize: Size): Position;
|
|
22
23
|
/**
|
|
23
24
|
* <zh/> 计算 Combo 收起时原点的实际位置
|
|
24
25
|
*
|
|
@@ -30,4 +31,4 @@ export declare function getCircleCollapsedOrigin(collapsedOrigin: BaseComboProps
|
|
|
30
31
|
* @param getCollapsedOrigin - <zh/> 获取原点相对位置的函数 | <en/> function to get the relative position of the origin
|
|
31
32
|
* @returns <zh/> 原点实际位置 | <en/> actual position of the origin
|
|
32
33
|
*/
|
|
33
|
-
export declare function getXYByCollapsedOrigin(collapsedOrigin:
|
|
34
|
+
export declare function getXYByCollapsedOrigin(collapsedOrigin: BaseComboStyleProps['collapsedOrigin'], center: Point, collapsedSize: Size, expandedSize: Size, getCollapsedOrigin?: (collapsedOrigin: BaseComboStyleProps['collapsedOrigin'], collapsedSize: Size, expandedSize: Size) => Position): Position;
|
package/dist/lib/utils/edge.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { AABB } from '@antv/g';
|
|
2
|
-
import type { ID } from '@antv/graphlib';
|
|
3
2
|
import type { PathArray } from '@antv/util';
|
|
4
3
|
import type { EdgeData } from '../spec';
|
|
5
|
-
import type { EdgeKey, EdgeLabelPlacement, EdgeLabelStyleProps, LoopPlacement, Node, Point, Port } from '../types';
|
|
4
|
+
import type { EdgeKey, EdgeLabelPlacement, EdgeLabelStyleProps, ID, LoopPlacement, Node, Point, Port } from '../types';
|
|
6
5
|
/**
|
|
7
6
|
* <zh/> 获取标签的位置样式
|
|
8
7
|
*
|
|
@@ -74,6 +73,17 @@ export declare function getCubicPath(sourcePoint: Point, targetPoint: Point, con
|
|
|
74
73
|
* @returns <zh/> 返回绘制折线的路径 | <en/> Returns the path for drawing a polyline
|
|
75
74
|
*/
|
|
76
75
|
export declare function getPolylinePath(points: Point[], radius?: number, z?: boolean): PathArray;
|
|
76
|
+
/**
|
|
77
|
+
* <zh/> 根据给定的半径计算出不共线的三点生成贝塞尔曲线的控制点,以模拟接近圆弧
|
|
78
|
+
*
|
|
79
|
+
* <en/> Calculates the control points of the Bezier curve generated by three non-collinear points according to the given radius to simulate an arc
|
|
80
|
+
* @param prevPoint - <zh/> 前一个点 | <en/> Previous point
|
|
81
|
+
* @param midPoint - <zh/> 中间点 | <en/> Middle point
|
|
82
|
+
* @param nextPoint - <zh/> 后一个点 | <en/> Next point
|
|
83
|
+
* @param radius - <zh/> 圆角半径 | <en/> Radius of the rounded corner
|
|
84
|
+
* @returns <zh/> 返回控制点 | <en/> Returns control points
|
|
85
|
+
*/
|
|
86
|
+
export declare function getBorderRadiusPoints(prevPoint: Point, midPoint: Point, nextPoint: Point, radius: number): [Point, Point];
|
|
77
87
|
/** ==================== Loop Edge =========================== */
|
|
78
88
|
export declare const getRadians: (bbox: AABB) => Record<LoopPlacement, [number, number]>;
|
|
79
89
|
/**
|
|
@@ -7,7 +7,7 @@ export declare class BaseEvent {
|
|
|
7
7
|
}
|
|
8
8
|
export declare class GraphLifeCycleEvent extends BaseEvent implements IGraphLifeCycleEvent {
|
|
9
9
|
data?: any;
|
|
10
|
-
constructor(type: GraphEvent.BEFORE_RENDER | GraphEvent.AFTER_RENDER | GraphEvent.BEFORE_DRAW | GraphEvent.AFTER_DRAW | GraphEvent.BEFORE_LAYOUT | GraphEvent.AFTER_LAYOUT | GraphEvent.BEFORE_SIZE_CHANGE | GraphEvent.AFTER_SIZE_CHANGE, data?: any);
|
|
10
|
+
constructor(type: GraphEvent.BEFORE_RENDER | GraphEvent.AFTER_RENDER | GraphEvent.BEFORE_DRAW | GraphEvent.AFTER_DRAW | GraphEvent.BEFORE_LAYOUT | GraphEvent.AFTER_LAYOUT | GraphEvent.BEFORE_SIZE_CHANGE | GraphEvent.AFTER_SIZE_CHANGE | GraphEvent.BATCH_START | GraphEvent.BATCH_END, data?: any);
|
|
11
11
|
}
|
|
12
12
|
export declare class AnimateEvent extends BaseEvent implements IAnimateEvent {
|
|
13
13
|
animationType: AnimationType;
|
|
@@ -7,4 +7,4 @@ import type { ExtensionOptions, STDExtensionOption } from '../registry/extension
|
|
|
7
7
|
* @param extensions - <zh/> 模块配置项 <en/> extension options
|
|
8
8
|
* @returns <zh/> 标准模块配置项 <en/> Standard extension options
|
|
9
9
|
*/
|
|
10
|
-
export declare function parseExtensions(category:
|
|
10
|
+
export declare function parseExtensions(category: string, extensions: ExtensionOptions): STDExtensionOption[];
|
package/dist/lib/utils/id.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ID } from '@antv/graphlib';
|
|
2
1
|
import type { ComboData, EdgeData, GraphData, NodeData } from '../spec';
|
|
2
|
+
import type { DataID, ID } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* <zh/> 获取节点/边/Combo 的 ID
|
|
5
5
|
*
|
|
@@ -15,12 +15,6 @@ export declare function idOf(data: Partial<NodeData | EdgeData | ComboData>): ID
|
|
|
15
15
|
* @param data - <zh/> 节点/Combo 的数据 | <en/> data of node/combo
|
|
16
16
|
* @returns <zh/> 节点/Combo 的父节点 ID | <en/> parent id of node/combo
|
|
17
17
|
*/
|
|
18
|
-
export declare function parentIdOf(data: Partial<NodeData | ComboData>):
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
*
|
|
22
|
-
* <en/> Get the IDs of all nodes/edges/combos in the graph data
|
|
23
|
-
* @param data - <zh/> 图数据 | <en/> graph data
|
|
24
|
-
* @returns - <zh/> 返回元素 ID 数组 | <en/> Returns an array of element IDs
|
|
25
|
-
*/
|
|
26
|
-
export declare function getIds(data: GraphData): ID[];
|
|
18
|
+
export declare function parentIdOf(data: Partial<NodeData | ComboData>): string | undefined;
|
|
19
|
+
export declare function idsOf(data: GraphData, flat: true): ID[];
|
|
20
|
+
export declare function idsOf(data: GraphData, flat: false): DataID;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Point } from '../types';
|
|
2
|
+
export type LineSegment = [Point, Point];
|
|
3
|
+
/**
|
|
4
|
+
* <zh/> 判断两条线段是否平行
|
|
5
|
+
*
|
|
6
|
+
* <en/> Judge whether two line segments are parallel
|
|
7
|
+
* @param l1 - <zh/> 第一条线段 | <en/> the first line segment
|
|
8
|
+
* @param l2 - <zh/> 第二条线段 | <en/> the second line segment
|
|
9
|
+
* @returns <zh/> 是否平行 | <en/> whether parallel or not
|
|
10
|
+
*/
|
|
11
|
+
export declare function isLinesParallel(l1: LineSegment, l2: LineSegment): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* <zh/> 获取两条线段的交点
|
|
14
|
+
*
|
|
15
|
+
* <en/> Get the intersection of two line segments
|
|
16
|
+
* @param l1 - <zh/> 第一条线段 | <en/> the first line segment
|
|
17
|
+
* @param l2 - <zh/> 第二条线段 | <en/> the second line segment
|
|
18
|
+
* @param extended - <zh/> 是否包含延长线上的交点 | <en/> whether to include the intersection on the extension line
|
|
19
|
+
* @returns <zh/> 交点 | <en/> intersection
|
|
20
|
+
*/
|
|
21
|
+
export declare function getLinesIntersection(l1: LineSegment, l2: LineSegment, extended?: boolean): Point | undefined;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { ID } from '@antv/graphlib';
|
|
2
1
|
import type { CategoricalPalette } from '../palettes/types';
|
|
3
2
|
import type { PaletteOptions, STDPaletteOptions } from '../spec/element/palette';
|
|
4
3
|
import type { ElementData } from '../types/data';
|
|
@@ -22,7 +21,7 @@ export declare function parsePalette(palette?: PaletteOptions): STDPaletteOption
|
|
|
22
21
|
*
|
|
23
22
|
* <en/> The return value is an object with element id as key and color value as value
|
|
24
23
|
*/
|
|
25
|
-
export declare function assignColorByPalette(data: ElementData, palette?: STDPaletteOptions): Record<
|
|
24
|
+
export declare function assignColorByPalette(data: ElementData, palette?: STDPaletteOptions): Record<string, string> | undefined;
|
|
26
25
|
/**
|
|
27
26
|
* <zh/> 获取离散色板配色
|
|
28
27
|
*
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { PathArray } from '@antv/util';
|
|
2
|
+
import type { Point, Points } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* <zh/> points 转化为 path 路径
|
|
5
|
+
*
|
|
6
|
+
* <en/> points transfrom path.
|
|
7
|
+
* @param points Point[]
|
|
8
|
+
* @param isClose boolean
|
|
9
|
+
* @returns path string[][]
|
|
10
|
+
*/
|
|
11
|
+
export declare function pointsToPath(points: Points, isClose?: boolean): PathArray;
|
|
12
|
+
/**
|
|
13
|
+
* <zh/> 将路径字符串转换为路径段数组
|
|
14
|
+
*
|
|
15
|
+
* <en/> Convert a path string to an array of path segments.
|
|
16
|
+
* @param path - <zh/> 路径字符串 | <en/> path string
|
|
17
|
+
* @returns <zh/> 路径段数组 | <en/> path segment array
|
|
18
|
+
*/
|
|
19
|
+
export declare function parsePath(path: string): PathArray;
|
|
20
|
+
/**
|
|
21
|
+
* <zh/> 将路径转换为点数组
|
|
22
|
+
*
|
|
23
|
+
* <en/> Convert path to points array
|
|
24
|
+
* @param path - <zh/> 路径数组 <en/> path array
|
|
25
|
+
* @returns
|
|
26
|
+
*/
|
|
27
|
+
export declare function pathToPoints(path: string | PathArray): Point[];
|
|
28
|
+
/**
|
|
29
|
+
* <zh/> 生成平滑闭合曲线
|
|
30
|
+
*
|
|
31
|
+
* <en/> Generate smooth closed curves
|
|
32
|
+
* @param points - <zh/> 点集 | <en/> points
|
|
33
|
+
* @returns <zh/> 平滑闭合曲线 | <en/> smooth closed curves
|
|
34
|
+
*/
|
|
35
|
+
export declare const getClosedSpline: (points: Point[]) => PathArray;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AABB, PointLike } from '@antv/g';
|
|
2
2
|
import type { Point } from '../types';
|
|
3
|
+
import type { LineSegment } from './line';
|
|
3
4
|
/**
|
|
4
5
|
* <zh/> 将对象坐标转换为数组坐标
|
|
5
6
|
* <en/> Convert object coordinates to array coordinates
|
|
@@ -15,6 +16,21 @@ export declare function parsePoint(point: PointLike): Point;
|
|
|
15
16
|
* @returns <zh/> 对象坐标 | <en/> object coordinates
|
|
16
17
|
*/
|
|
17
18
|
export declare function toPointObject(point: Point): PointLike;
|
|
19
|
+
/**
|
|
20
|
+
* <zh/> 根据 X 轴坐标排序
|
|
21
|
+
* <en/> Sort by X-axis coordinates
|
|
22
|
+
* @param points - <zh/> 点集 | <en/> point set
|
|
23
|
+
* @returns <zh/> 排序后的点集 | <en/> sorted point set
|
|
24
|
+
*/
|
|
25
|
+
export declare function sortByX(points: Point[]): Point[];
|
|
26
|
+
/**
|
|
27
|
+
* <zh/> 点集去重
|
|
28
|
+
*
|
|
29
|
+
* <en/> Deduplicate point set
|
|
30
|
+
* @param points - <zh/> 点集 | <en/> pointset
|
|
31
|
+
* @returns <zh/> 去重后的点集 | <en/> deduplicated pointset
|
|
32
|
+
*/
|
|
33
|
+
export declare function deduplicate(points: Point[]): Point[];
|
|
18
34
|
/**
|
|
19
35
|
* <zh/> 对点格式化,精确到 `digits` 位的数字
|
|
20
36
|
*
|
|
@@ -72,24 +88,6 @@ export declare function isOrthogonal(p1: Point, p2: Point): boolean;
|
|
|
72
88
|
* @returns <zh/> 是否三点共线 | <en/> whether three points are collinear
|
|
73
89
|
*/
|
|
74
90
|
export declare function isCollinear(p1: Point, p2: Point, p3: Point): boolean;
|
|
75
|
-
/**
|
|
76
|
-
* <zh/> 判断两条线段是否平行
|
|
77
|
-
*
|
|
78
|
-
* <en/> Judge whether two line segments are parallel
|
|
79
|
-
* @param l1 - <zh/> 第一条线段 | <en/> the first line segment
|
|
80
|
-
* @param l2 - <zh/> 第二条线段 | <en/> the second line segment
|
|
81
|
-
* @returns <zh/> 是否平行 | <en/> whether parallel or not
|
|
82
|
-
*/
|
|
83
|
-
export declare function isLinesParallel(l1: [Point, Point], l2: [Point, Point]): boolean;
|
|
84
|
-
/**
|
|
85
|
-
* <zh/> 获取两条线段的交点
|
|
86
|
-
*
|
|
87
|
-
* <en/> Get the intersection of two line segments
|
|
88
|
-
* @param l1 - <zh/> 第一条线段 | <en/> the first line segment
|
|
89
|
-
* @param l2 - <zh/> 第二条线段 | <en/> the second line segment
|
|
90
|
-
* @returns <zh/> 交点 | <en/> intersection
|
|
91
|
-
*/
|
|
92
|
-
export declare function getLinesIntersection(l1: [Point, Point], l2: [Point, Point]): Point | undefined;
|
|
93
91
|
/**
|
|
94
92
|
* <zh/> 获取从多边形中心到给定点的连线与多边形边缘的交点
|
|
95
93
|
*
|
|
@@ -98,9 +96,21 @@ export declare function getLinesIntersection(l1: [Point, Point], l2: [Point, Poi
|
|
|
98
96
|
* @param center - <zh/> 多边形中心 | <en/> the center of the polygon
|
|
99
97
|
* @param points - <zh/> 多边形顶点 | <en/> the vertices of the polygon
|
|
100
98
|
* @param isRelativePos - <zh/> 顶点坐标是否相对中心点 | <en/> whether the vertex coordinates are relative to the center point
|
|
101
|
-
* @returns <zh/>
|
|
99
|
+
* @returns <zh/> 交点与相交线段 | <en/> intersection and intersecting line segment
|
|
100
|
+
*/
|
|
101
|
+
export declare function getPolygonIntersectPoint(p: Point, center: Point, points: Point[], isRelativePos?: boolean): {
|
|
102
|
+
point: Point;
|
|
103
|
+
line?: LineSegment;
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* <zh/> 判断点是否在多边形内部(射线法)
|
|
107
|
+
*
|
|
108
|
+
* <en/> Whether point is inside the polygon (ray algo)
|
|
109
|
+
* @param point - <zh/> 点 | <en/> point
|
|
110
|
+
* @param points - <zh/> 多边形顶点 | <en/> polygon vertices
|
|
111
|
+
* @returns <zh/> 是否在多边形内部 | <en/> whether inside the polygon
|
|
102
112
|
*/
|
|
103
|
-
export declare function
|
|
113
|
+
export declare function isPointInPolygon(point: Point, points: Point[]): boolean;
|
|
104
114
|
/**
|
|
105
115
|
* <zh/> 获取从矩形中心到给定点的连线与矩形边缘的交点
|
|
106
116
|
*
|
|
@@ -127,3 +137,47 @@ export declare function getEllipseIntersectPoint(p: Point, bbox: AABB): Point;
|
|
|
127
137
|
* @returns <zh/> 距离最近的两个点 | <en/> the nearest two points
|
|
128
138
|
*/
|
|
129
139
|
export declare function findNearestPoints(group1: Point[], group2: Point[]): [Point, Point];
|
|
140
|
+
/**
|
|
141
|
+
* <zh/> 从一组线段中找到距离给定点最近的线段
|
|
142
|
+
*
|
|
143
|
+
* <en/> Find the line segment closest to the given point from a group of line segments
|
|
144
|
+
* @param point - <zh/> 给定点 | <en/> the given point
|
|
145
|
+
* @param lines - <zh/> 一组线段 | <en/> a group of line segments
|
|
146
|
+
* @returns <zh/> 距离最近的线段 | <en/> the nearest line segment
|
|
147
|
+
*/
|
|
148
|
+
export declare function findNearestLine(point: Point, lines: LineSegment[]): [Point, Point];
|
|
149
|
+
/**
|
|
150
|
+
* <zh/> 获取点到线段的距离
|
|
151
|
+
*
|
|
152
|
+
* <en/> Get the distance from a point to a line segment
|
|
153
|
+
* @param point - <zh/> 点 | <en/> the point
|
|
154
|
+
* @param line - <zh/> 线段 | <en/> the line segment
|
|
155
|
+
* @returns <zh/> 点到线段的距离 | <en/> the distance from the point to the line segment
|
|
156
|
+
*/
|
|
157
|
+
export declare function getDistanceToLine(point: Point, line: LineSegment): number;
|
|
158
|
+
/**
|
|
159
|
+
* <zh/> 获取线段上距离给定点最近的点
|
|
160
|
+
*
|
|
161
|
+
* <en/> Get the point on the line segment closest to the given point
|
|
162
|
+
* @param point - <zh/> 给定点 | <en/> the given point
|
|
163
|
+
* @param line - <zh/> 线段 | <en/> the line segment
|
|
164
|
+
* @returns <zh/> 线段上距离给定点最近的点 | <en/> the point on the line segment closest to the given point
|
|
165
|
+
*/
|
|
166
|
+
export declare function findNearestPointOnLine(point: Point, line: LineSegment): Point;
|
|
167
|
+
/**
|
|
168
|
+
* <zh/> 获取点集的中心点
|
|
169
|
+
*
|
|
170
|
+
* <en/> Get the center point of a set of points
|
|
171
|
+
* @param points - <zh/> 点集 | <en/> point set
|
|
172
|
+
* @returns <zh/> 中心点 | <en/> center point
|
|
173
|
+
*/
|
|
174
|
+
export declare function centerOf(points: Point[]): Point;
|
|
175
|
+
/**
|
|
176
|
+
* <zh/> 按顺时针或逆时针方向对点集排序
|
|
177
|
+
*
|
|
178
|
+
* <en/> Sort the point set in a clockwise or counterclockwise direction
|
|
179
|
+
* @param points - <zh/> 点集 | <en/> point set
|
|
180
|
+
* @param clockwise - <zh/> 是否顺时针 | <en/> whether clockwise
|
|
181
|
+
* @returns <zh/> 排序后的点集 | <en/> sorted point set
|
|
182
|
+
*/
|
|
183
|
+
export declare function sortByClockwise(points: Point[], clockwise?: boolean): Point[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { AABB, TextStyleProps } from '@antv/g';
|
|
2
|
+
import type { PathArray } from '@antv/util';
|
|
3
|
+
import type { CardinalPlacement } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* <zh/> 计算文本位置样式
|
|
6
|
+
*
|
|
7
|
+
* <en/> Calculate text position style
|
|
8
|
+
* @param bounds - <zh/> 外包围盒 | <en/> contour bounds
|
|
9
|
+
* @param placement - <zh/> 位置 | <en/> placement
|
|
10
|
+
* @param offsetX - <zh/> x轴偏移 | <en/> x-axis offset
|
|
11
|
+
* @param offsetY - <zh/> y轴偏移 | <en/> y-axis offset
|
|
12
|
+
* @param closeToContour - <zh/> 标签位置是否贴合轮廓 | <en/> whether the label position is close to the contour
|
|
13
|
+
* @param path - <zh/> 路径 | <en/> path
|
|
14
|
+
* @param autoRotate - <zh/> 是否跟随轮廓旋转 | <en/> whether to rotate with the contour
|
|
15
|
+
* @returns <zh/> 文本样式 | <en/> text style
|
|
16
|
+
*/
|
|
17
|
+
export declare function getPolygonTextStyleByPlacement(bounds: AABB, placement: CardinalPlacement | 'center', offsetX: number, offsetY: number, closeToContour: boolean, path: PathArray | string, autoRotate: boolean): Partial<TextStyleProps>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AABB } from '@antv/g';
|
|
2
|
-
import type { Anchor, NodeLikeData, Placement, Position, RelativePlacement } from '../types';
|
|
2
|
+
import type { Anchor, NodeLikeData, Placement, Points, Position, RelativePlacement } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* <zh/> 获取节点/ combo 的位置坐标
|
|
5
5
|
*
|
|
@@ -35,3 +35,16 @@ export declare function getXYByPlacement(bbox: AABB, placement?: Placement): Pos
|
|
|
35
35
|
* @returns - <zh/> 坐标 | <en/> position
|
|
36
36
|
*/
|
|
37
37
|
export declare function getXYByAnchor(bbox: AABB, anchor: Anchor): Position;
|
|
38
|
+
/**
|
|
39
|
+
* <zh/> 通过 rect points 路径点获取 position 方位配置.
|
|
40
|
+
*
|
|
41
|
+
* <en/> The rect points command is used to obtain the position and orientation configuration.
|
|
42
|
+
* @param points Points
|
|
43
|
+
* @returns `{ left: number; right: number; top: number; bottom: number }`
|
|
44
|
+
*/
|
|
45
|
+
export declare const getPositionByRectPoints: (points: Points) => {
|
|
46
|
+
left: number;
|
|
47
|
+
right: number;
|
|
48
|
+
top: number;
|
|
49
|
+
bottom: number;
|
|
50
|
+
};
|
|
@@ -35,7 +35,7 @@ export declare function removePrefix(string: string, prefix?: string, lowercaseF
|
|
|
35
35
|
* @param prefix - <zh/> 子样式前缀 | <en/> sub style prefix
|
|
36
36
|
* @returns <zh/> 子样式 | <en/> sub style
|
|
37
37
|
*/
|
|
38
|
-
export declare function subStyleProps<T extends
|
|
38
|
+
export declare function subStyleProps<T extends Record<string, any>>(style: object, prefix: string): T;
|
|
39
39
|
/**
|
|
40
40
|
* <zh/> 从对象中提取指定前缀的属性,并移除前缀
|
|
41
41
|
*
|