@antv/g6 5.0.0-beta.35 → 5.0.0-beta.36
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/LICENSE +21 -0
- package/dist/g6.min.js +2 -2
- package/dist/lib/animations/types.d.ts +4 -4
- package/dist/lib/behaviors/brush-select.d.ts +125 -57
- package/dist/lib/behaviors/click-element.d.ts +17 -17
- package/dist/lib/behaviors/collapse-expand.d.ts +15 -1
- package/dist/lib/behaviors/create-edge.d.ts +25 -4
- package/dist/lib/behaviors/drag-canvas.d.ts +27 -8
- package/dist/lib/behaviors/drag-element-force.d.ts +44 -4
- package/dist/lib/behaviors/drag-element.d.ts +105 -25
- package/dist/lib/behaviors/focus-element.d.ts +18 -6
- package/dist/lib/behaviors/hover-element.d.ts +28 -6
- package/dist/lib/behaviors/lasso-select.d.ts +34 -13
- package/dist/lib/behaviors/scroll-canvas.d.ts +33 -12
- package/dist/lib/behaviors/types.d.ts +0 -1
- package/dist/lib/behaviors/zoom-canvas.d.ts +42 -15
- package/dist/lib/constants/change.d.ts +50 -1
- package/dist/lib/constants/element.d.ts +3 -2
- package/dist/lib/constants/events/canvas.d.ts +90 -18
- package/dist/lib/constants/events/common.d.ts +100 -20
- package/dist/lib/constants/events/container.d.ts +10 -2
- package/dist/lib/constants/events/edge.d.ts +70 -14
- package/dist/lib/constants/events/graph.d.ts +140 -28
- package/dist/lib/constants/events/history.d.ts +38 -0
- package/dist/lib/constants/events/index.d.ts +1 -0
- package/dist/lib/constants/events/node.d.ts +85 -17
- package/dist/lib/constants/registry.d.ts +50 -10
- package/dist/lib/elements/combos/base-combo.d.ts +32 -22
- package/dist/lib/elements/combos/circle.d.ts +14 -2
- package/dist/lib/elements/combos/rect.d.ts +12 -2
- package/dist/lib/elements/edges/base-edge.d.ts +63 -27
- package/dist/lib/elements/edges/cubic-horizontal.d.ts +18 -0
- package/dist/lib/elements/edges/cubic-vertical.d.ts +18 -0
- package/dist/lib/elements/edges/cubic.d.ts +19 -1
- package/dist/lib/elements/edges/line.d.ts +12 -2
- package/dist/lib/elements/edges/polyline.d.ts +21 -0
- package/dist/lib/elements/edges/quadratic.d.ts +15 -0
- package/dist/lib/elements/nodes/base-node.d.ts +67 -61
- package/dist/lib/elements/nodes/circle.d.ts +10 -2
- package/dist/lib/elements/nodes/diamond.d.ts +12 -4
- package/dist/lib/elements/nodes/donut.d.ts +20 -20
- package/dist/lib/elements/nodes/ellipse.d.ts +12 -1
- package/dist/lib/elements/nodes/hexagon.d.ts +17 -7
- package/dist/lib/elements/nodes/html.d.ts +16 -3
- package/dist/lib/elements/nodes/image.d.ts +22 -2
- package/dist/lib/elements/nodes/rect.d.ts +10 -2
- package/dist/lib/elements/nodes/star.d.ts +18 -9
- package/dist/lib/elements/nodes/triangle.d.ts +17 -7
- package/dist/lib/elements/shapes/badge.d.ts +3 -2
- package/dist/lib/elements/shapes/base-shape.d.ts +2 -3
- package/dist/lib/elements/shapes/contour.d.ts +27 -10
- package/dist/lib/elements/shapes/icon.d.ts +3 -2
- package/dist/lib/elements/shapes/index.d.ts +1 -0
- package/dist/lib/elements/shapes/label.d.ts +14 -5
- package/dist/lib/elements/shapes/polygon.d.ts +29 -0
- package/dist/lib/exports.d.ts +18 -8
- package/dist/lib/layouts/base-layout.d.ts +10 -0
- package/dist/lib/layouts/index.d.ts +1 -0
- package/dist/lib/layouts/types.d.ts +11 -4
- package/dist/lib/plugins/base-plugin.d.ts +2 -1
- package/dist/lib/plugins/bubble-sets.d.ts +71 -0
- package/dist/lib/plugins/camera-setting.d.ts +24 -10
- package/dist/lib/plugins/contextmenu.d.ts +63 -40
- package/dist/lib/plugins/grid-line.d.ts +35 -2
- package/dist/lib/plugins/history/index.d.ts +48 -10
- package/dist/lib/plugins/history/utils.d.ts +1 -11
- package/dist/lib/plugins/hull/index.d.ts +28 -4
- package/dist/lib/plugins/legend.d.ts +95 -15
- package/dist/lib/plugins/timebar.d.ts +23 -14
- package/dist/lib/plugins/toolbar/index.d.ts +35 -28
- package/dist/lib/plugins/toolbar/util.d.ts +9 -10
- package/dist/lib/plugins/tooltip.d.ts +93 -18
- package/dist/lib/plugins/watermark.d.ts +173 -33
- package/dist/lib/registry/types.d.ts +2 -2
- package/dist/lib/runtime/behavior.d.ts +5 -1
- package/dist/lib/runtime/data.d.ts +6 -6
- package/dist/lib/runtime/element.d.ts +3 -4
- package/dist/lib/runtime/graph.d.ts +7 -7
- package/dist/lib/runtime/layout.d.ts +5 -17
- package/dist/lib/spec/behavior.d.ts +20 -2
- package/dist/lib/spec/canvas.d.ts +9 -2
- package/dist/lib/spec/data.d.ts +93 -2
- package/dist/lib/spec/element/combo.d.ts +5 -13
- package/dist/lib/spec/element/edge.d.ts +1 -8
- package/dist/lib/spec/element/node.d.ts +1 -14
- package/dist/lib/spec/graph.d.ts +3 -3
- package/dist/lib/spec/plugin.d.ts +22 -2
- package/dist/lib/spec/viewport.d.ts +19 -23
- package/dist/lib/types/combo.d.ts +23 -0
- package/dist/lib/types/edge.d.ts +73 -9
- package/dist/lib/types/element.d.ts +3 -0
- package/dist/lib/types/event.d.ts +14 -2
- package/dist/lib/types/history.d.ts +51 -0
- package/dist/lib/types/index.d.ts +2 -0
- package/dist/lib/types/layout.d.ts +9 -0
- package/dist/lib/types/node.d.ts +111 -7
- package/dist/lib/types/point.d.ts +1 -2
- package/dist/lib/types/prefix.d.ts +11 -1
- package/dist/lib/types/viewport.d.ts +1 -3
- package/dist/lib/utils/animation.d.ts +2 -16
- package/dist/lib/utils/bbox.d.ts +1 -2
- package/dist/lib/utils/dom.d.ts +6 -0
- package/dist/lib/utils/edge.d.ts +11 -2
- package/dist/lib/utils/element.d.ts +7 -9
- package/dist/lib/utils/layout.d.ts +45 -0
- package/dist/lib/utils/point.d.ts +11 -2
- package/dist/lib/utils/transform.d.ts +10 -0
- package/dist/lib/utils/watermark.d.ts +1 -1
- package/esm/animations/executor.js +23 -11
- package/esm/animations/executor.js.map +1 -1
- package/esm/animations/types.d.ts +4 -4
- package/esm/behaviors/brush-select.d.ts +125 -57
- package/esm/behaviors/brush-select.js +182 -113
- package/esm/behaviors/brush-select.js.map +1 -1
- package/esm/behaviors/click-element.d.ts +17 -17
- package/esm/behaviors/click-element.js +3 -5
- package/esm/behaviors/click-element.js.map +1 -1
- package/esm/behaviors/collapse-expand.d.ts +15 -1
- package/esm/behaviors/collapse-expand.js +9 -0
- package/esm/behaviors/collapse-expand.js.map +1 -1
- package/esm/behaviors/create-edge.d.ts +25 -4
- package/esm/behaviors/create-edge.js +14 -0
- package/esm/behaviors/create-edge.js.map +1 -1
- package/esm/behaviors/drag-canvas.d.ts +27 -8
- package/esm/behaviors/drag-canvas.js +24 -0
- package/esm/behaviors/drag-canvas.js.map +1 -1
- package/esm/behaviors/drag-element-force.d.ts +44 -4
- package/esm/behaviors/drag-element-force.js +47 -8
- package/esm/behaviors/drag-element-force.js.map +1 -1
- package/esm/behaviors/drag-element.d.ts +105 -25
- package/esm/behaviors/drag-element.js +73 -0
- package/esm/behaviors/drag-element.js.map +1 -1
- package/esm/behaviors/focus-element.d.ts +18 -6
- package/esm/behaviors/focus-element.js +16 -15
- package/esm/behaviors/focus-element.js.map +1 -1
- package/esm/behaviors/hover-element.d.ts +28 -6
- package/esm/behaviors/hover-element.js +9 -0
- package/esm/behaviors/hover-element.js.map +1 -1
- package/esm/behaviors/lasso-select.d.ts +34 -13
- package/esm/behaviors/lasso-select.js +43 -56
- package/esm/behaviors/lasso-select.js.map +1 -1
- package/esm/behaviors/scroll-canvas.d.ts +33 -12
- package/esm/behaviors/scroll-canvas.js +21 -0
- package/esm/behaviors/scroll-canvas.js.map +1 -1
- package/esm/behaviors/types.d.ts +0 -1
- package/esm/behaviors/zoom-canvas.d.ts +42 -15
- package/esm/behaviors/zoom-canvas.js +26 -1
- package/esm/behaviors/zoom-canvas.js.map +1 -1
- package/esm/constants/change.d.ts +50 -1
- package/esm/constants/change.js +50 -1
- package/esm/constants/change.js.map +1 -1
- package/esm/constants/element.d.ts +3 -2
- package/esm/constants/element.js +3 -2
- package/esm/constants/element.js.map +1 -1
- package/esm/constants/events/canvas.d.ts +90 -18
- package/esm/constants/events/canvas.js +90 -18
- package/esm/constants/events/canvas.js.map +1 -1
- package/esm/constants/events/common.d.ts +100 -20
- package/esm/constants/events/common.js +100 -20
- package/esm/constants/events/common.js.map +1 -1
- package/esm/constants/events/container.d.ts +10 -2
- package/esm/constants/events/container.js +10 -2
- package/esm/constants/events/container.js.map +1 -1
- package/esm/constants/events/edge.d.ts +70 -14
- package/esm/constants/events/edge.js +70 -14
- package/esm/constants/events/edge.js.map +1 -1
- package/esm/constants/events/graph.d.ts +140 -28
- package/esm/constants/events/graph.js +140 -28
- package/esm/constants/events/graph.js.map +1 -1
- package/esm/constants/events/history.d.ts +38 -0
- package/esm/constants/events/history.js +40 -0
- package/esm/constants/events/history.js.map +1 -0
- package/esm/constants/events/index.d.ts +1 -0
- package/esm/constants/events/index.js +1 -0
- package/esm/constants/events/index.js.map +1 -1
- package/esm/constants/events/node.d.ts +85 -17
- package/esm/constants/events/node.js +85 -17
- package/esm/constants/events/node.js.map +1 -1
- package/esm/constants/registry.d.ts +50 -10
- package/esm/constants/registry.js +50 -10
- package/esm/constants/registry.js.map +1 -1
- package/esm/elements/combos/base-combo.d.ts +32 -22
- package/esm/elements/combos/base-combo.js +11 -1
- package/esm/elements/combos/base-combo.js.map +1 -1
- package/esm/elements/combos/circle.d.ts +14 -2
- package/esm/elements/combos/circle.js +10 -0
- package/esm/elements/combos/circle.js.map +1 -1
- package/esm/elements/combos/rect.d.ts +12 -2
- package/esm/elements/combos/rect.js +8 -5
- package/esm/elements/combos/rect.js.map +1 -1
- package/esm/elements/edges/base-edge.d.ts +63 -27
- package/esm/elements/edges/base-edge.js +9 -6
- package/esm/elements/edges/base-edge.js.map +1 -1
- package/esm/elements/edges/cubic-horizontal.d.ts +18 -0
- package/esm/elements/edges/cubic-horizontal.js +9 -0
- package/esm/elements/edges/cubic-horizontal.js.map +1 -1
- package/esm/elements/edges/cubic-vertical.d.ts +18 -0
- package/esm/elements/edges/cubic-vertical.js +9 -0
- package/esm/elements/edges/cubic-vertical.js.map +1 -1
- package/esm/elements/edges/cubic.d.ts +19 -1
- package/esm/elements/edges/cubic.js +8 -0
- package/esm/elements/edges/cubic.js.map +1 -1
- package/esm/elements/edges/line.d.ts +12 -2
- package/esm/elements/edges/line.js +5 -1
- package/esm/elements/edges/line.js.map +1 -1
- package/esm/elements/edges/polyline.d.ts +21 -0
- package/esm/elements/edges/polyline.js +5 -0
- package/esm/elements/edges/polyline.js.map +1 -1
- package/esm/elements/edges/quadratic.d.ts +15 -0
- package/esm/elements/edges/quadratic.js +5 -0
- package/esm/elements/edges/quadratic.js.map +1 -1
- package/esm/elements/nodes/base-node.d.ts +67 -61
- package/esm/elements/nodes/base-node.js +19 -5
- package/esm/elements/nodes/base-node.js.map +1 -1
- package/esm/elements/nodes/circle.d.ts +10 -2
- package/esm/elements/nodes/circle.js +3 -1
- package/esm/elements/nodes/circle.js.map +1 -1
- package/esm/elements/nodes/diamond.d.ts +12 -4
- package/esm/elements/nodes/diamond.js +4 -2
- package/esm/elements/nodes/diamond.js.map +1 -1
- package/esm/elements/nodes/donut.d.ts +20 -20
- package/esm/elements/nodes/donut.js +20 -7
- package/esm/elements/nodes/donut.js.map +1 -1
- package/esm/elements/nodes/ellipse.d.ts +12 -1
- package/esm/elements/nodes/ellipse.js +5 -0
- package/esm/elements/nodes/ellipse.js.map +1 -1
- package/esm/elements/nodes/hexagon.d.ts +17 -7
- package/esm/elements/nodes/hexagon.js +6 -1
- package/esm/elements/nodes/hexagon.js.map +1 -1
- package/esm/elements/nodes/html.d.ts +16 -3
- package/esm/elements/nodes/html.js +4 -1
- package/esm/elements/nodes/html.js.map +1 -1
- package/esm/elements/nodes/image.d.ts +22 -2
- package/esm/elements/nodes/image.js +10 -3
- package/esm/elements/nodes/image.js.map +1 -1
- package/esm/elements/nodes/rect.d.ts +10 -2
- package/esm/elements/nodes/rect.js +5 -2
- package/esm/elements/nodes/rect.js.map +1 -1
- package/esm/elements/nodes/star.d.ts +18 -9
- package/esm/elements/nodes/star.js +6 -1
- package/esm/elements/nodes/star.js.map +1 -1
- package/esm/elements/nodes/triangle.d.ts +17 -7
- package/esm/elements/nodes/triangle.js +6 -1
- package/esm/elements/nodes/triangle.js.map +1 -1
- package/esm/elements/shapes/badge.d.ts +3 -2
- package/esm/elements/shapes/base-shape.d.ts +2 -3
- package/esm/elements/shapes/base-shape.js +34 -5
- package/esm/elements/shapes/base-shape.js.map +1 -1
- package/esm/elements/shapes/contour.d.ts +27 -10
- package/esm/elements/shapes/contour.js +2 -2
- package/esm/elements/shapes/contour.js.map +1 -1
- package/esm/elements/shapes/icon.d.ts +3 -2
- package/esm/elements/shapes/icon.js +4 -1
- package/esm/elements/shapes/icon.js.map +1 -1
- package/esm/elements/shapes/index.d.ts +1 -0
- package/esm/elements/shapes/label.d.ts +14 -5
- package/esm/elements/shapes/label.js +2 -1
- package/esm/elements/shapes/label.js.map +1 -1
- package/esm/elements/shapes/polygon.d.ts +29 -0
- package/esm/elements/{nodes → shapes}/polygon.js +1 -1
- package/esm/elements/shapes/polygon.js.map +1 -0
- package/esm/exports.d.ts +18 -8
- package/esm/exports.js +4 -3
- package/esm/exports.js.map +1 -1
- package/esm/layouts/base-layout.d.ts +10 -0
- package/esm/layouts/base-layout.js +9 -0
- package/esm/layouts/base-layout.js.map +1 -0
- package/esm/layouts/index.d.ts +1 -0
- package/esm/layouts/index.js +1 -0
- package/esm/layouts/index.js.map +1 -1
- package/esm/layouts/types.d.ts +11 -4
- package/esm/plugins/base-plugin.d.ts +2 -1
- package/esm/plugins/bubble-sets.d.ts +71 -0
- package/esm/plugins/bubble-sets.js +70 -3
- package/esm/plugins/bubble-sets.js.map +1 -1
- package/esm/plugins/camera-setting.d.ts +24 -10
- package/esm/plugins/camera-setting.js +7 -0
- package/esm/plugins/camera-setting.js.map +1 -1
- package/esm/plugins/contextmenu.d.ts +63 -40
- package/esm/plugins/contextmenu.js +43 -34
- package/esm/plugins/contextmenu.js.map +1 -1
- package/esm/plugins/grid-line.d.ts +35 -2
- package/esm/plugins/grid-line.js +26 -7
- package/esm/plugins/grid-line.js.map +1 -1
- package/esm/plugins/history/index.d.ts +48 -10
- package/esm/plugins/history/index.js +38 -11
- package/esm/plugins/history/index.js.map +1 -1
- package/esm/plugins/history/utils.d.ts +1 -11
- package/esm/plugins/history/utils.js.map +1 -1
- package/esm/plugins/hull/index.d.ts +28 -4
- package/esm/plugins/hull/index.js +26 -5
- package/esm/plugins/hull/index.js.map +1 -1
- package/esm/plugins/legend.d.ts +95 -15
- package/esm/plugins/legend.js +64 -15
- package/esm/plugins/legend.js.map +1 -1
- package/esm/plugins/timebar.d.ts +23 -14
- package/esm/plugins/timebar.js +8 -0
- package/esm/plugins/timebar.js.map +1 -1
- package/esm/plugins/toolbar/index.d.ts +35 -28
- package/esm/plugins/toolbar/index.js +11 -8
- package/esm/plugins/toolbar/index.js.map +1 -1
- package/esm/plugins/toolbar/util.d.ts +9 -10
- package/esm/plugins/toolbar/util.js +2 -1
- package/esm/plugins/toolbar/util.js.map +1 -1
- package/esm/plugins/tooltip.d.ts +93 -18
- package/esm/plugins/tooltip.js +99 -36
- package/esm/plugins/tooltip.js.map +1 -1
- package/esm/plugins/watermark.d.ts +173 -33
- package/esm/plugins/watermark.js +23 -9
- package/esm/plugins/watermark.js.map +1 -1
- package/esm/registry/types.d.ts +2 -2
- package/esm/runtime/behavior.d.ts +5 -1
- package/esm/runtime/behavior.js +5 -1
- package/esm/runtime/behavior.js.map +1 -1
- package/esm/runtime/data.d.ts +6 -6
- package/esm/runtime/data.js +27 -30
- package/esm/runtime/data.js.map +1 -1
- package/esm/runtime/element.d.ts +3 -4
- package/esm/runtime/element.js +31 -27
- package/esm/runtime/element.js.map +1 -1
- package/esm/runtime/graph.d.ts +7 -7
- package/esm/runtime/graph.js +7 -7
- package/esm/runtime/graph.js.map +1 -1
- package/esm/runtime/layout.d.ts +5 -17
- package/esm/runtime/layout.js +38 -130
- package/esm/runtime/layout.js.map +1 -1
- package/esm/spec/behavior.d.ts +20 -2
- package/esm/spec/canvas.d.ts +9 -2
- package/esm/spec/data.d.ts +93 -2
- package/esm/spec/element/combo.d.ts +5 -13
- package/esm/spec/element/edge.d.ts +1 -8
- package/esm/spec/element/node.d.ts +1 -14
- package/esm/spec/graph.d.ts +3 -3
- package/esm/spec/plugin.d.ts +22 -2
- package/esm/spec/viewport.d.ts +19 -23
- package/esm/themes/base.js +17 -8
- package/esm/themes/base.js.map +1 -1
- package/esm/transforms/arrange-draw-order.js +17 -12
- package/esm/transforms/arrange-draw-order.js.map +1 -1
- package/esm/transforms/collapse-expand-combo.js +29 -20
- package/esm/transforms/collapse-expand-combo.js.map +1 -1
- package/esm/types/combo.d.ts +23 -0
- package/esm/types/combo.js +2 -0
- package/esm/types/combo.js.map +1 -0
- package/esm/types/edge.d.ts +73 -9
- package/esm/types/element.d.ts +3 -0
- package/esm/types/event.d.ts +14 -2
- package/esm/types/history.d.ts +51 -0
- package/esm/types/history.js +2 -0
- package/esm/types/history.js.map +1 -0
- package/esm/types/index.d.ts +2 -0
- package/esm/types/layout.d.ts +9 -0
- package/esm/types/layout.js +2 -0
- package/esm/types/layout.js.map +1 -0
- package/esm/types/node.d.ts +111 -7
- package/esm/types/point.d.ts +1 -2
- package/esm/types/prefix.d.ts +11 -1
- package/esm/types/viewport.d.ts +1 -3
- package/esm/utils/animation.d.ts +2 -16
- package/esm/utils/animation.js +0 -35
- package/esm/utils/animation.js.map +1 -1
- package/esm/utils/bbox.d.ts +1 -2
- package/esm/utils/bbox.js.map +1 -1
- package/esm/utils/dom.d.ts +6 -0
- package/esm/utils/dom.js +14 -0
- package/esm/utils/dom.js.map +1 -1
- package/esm/utils/edge.d.ts +11 -2
- package/esm/utils/edge.js +28 -4
- package/esm/utils/edge.js.map +1 -1
- package/esm/utils/element.d.ts +7 -9
- package/esm/utils/element.js +5 -4
- package/esm/utils/element.js.map +1 -1
- package/esm/utils/id.js +1 -1
- package/esm/utils/id.js.map +1 -1
- package/esm/utils/layout.d.ts +45 -0
- package/esm/utils/layout.js +167 -1
- package/esm/utils/layout.js.map +1 -1
- package/esm/utils/point.d.ts +11 -2
- package/esm/utils/point.js +30 -28
- package/esm/utils/point.js.map +1 -1
- package/esm/utils/polygon.js +3 -6
- package/esm/utils/polygon.js.map +1 -1
- package/esm/utils/prefix.js +15 -2
- package/esm/utils/prefix.js.map +1 -1
- package/esm/utils/symbol.js +27 -15
- package/esm/utils/symbol.js.map +1 -1
- package/esm/utils/transform.d.ts +10 -0
- package/esm/utils/transform.js +19 -0
- package/esm/utils/transform.js.map +1 -0
- package/esm/utils/tree.js +2 -2
- package/esm/utils/tree.js.map +1 -1
- package/esm/utils/watermark.d.ts +1 -1
- package/esm/utils/watermark.js +1 -1
- package/lib/animations/executor.js +22 -10
- package/lib/animations/executor.js.map +1 -1
- package/lib/animations/types.d.ts +4 -4
- package/lib/behaviors/brush-select.d.ts +125 -57
- package/lib/behaviors/brush-select.js +183 -113
- package/lib/behaviors/brush-select.js.map +1 -1
- package/lib/behaviors/click-element.d.ts +17 -17
- package/lib/behaviors/click-element.js +3 -5
- package/lib/behaviors/click-element.js.map +1 -1
- package/lib/behaviors/collapse-expand.d.ts +15 -1
- package/lib/behaviors/collapse-expand.js +9 -0
- package/lib/behaviors/collapse-expand.js.map +1 -1
- package/lib/behaviors/create-edge.d.ts +25 -4
- package/lib/behaviors/create-edge.js +14 -0
- package/lib/behaviors/create-edge.js.map +1 -1
- package/lib/behaviors/drag-canvas.d.ts +27 -8
- package/lib/behaviors/drag-canvas.js +24 -0
- package/lib/behaviors/drag-canvas.js.map +1 -1
- package/lib/behaviors/drag-element-force.d.ts +44 -4
- package/lib/behaviors/drag-element-force.js +47 -8
- package/lib/behaviors/drag-element-force.js.map +1 -1
- package/lib/behaviors/drag-element.d.ts +105 -25
- package/lib/behaviors/drag-element.js +73 -0
- package/lib/behaviors/drag-element.js.map +1 -1
- package/lib/behaviors/focus-element.d.ts +18 -6
- package/lib/behaviors/focus-element.js +16 -15
- package/lib/behaviors/focus-element.js.map +1 -1
- package/lib/behaviors/hover-element.d.ts +28 -6
- package/lib/behaviors/hover-element.js +9 -0
- package/lib/behaviors/hover-element.js.map +1 -1
- package/lib/behaviors/lasso-select.d.ts +34 -13
- package/lib/behaviors/lasso-select.js +42 -55
- package/lib/behaviors/lasso-select.js.map +1 -1
- package/lib/behaviors/scroll-canvas.d.ts +33 -12
- package/lib/behaviors/scroll-canvas.js +21 -0
- package/lib/behaviors/scroll-canvas.js.map +1 -1
- package/lib/behaviors/types.d.ts +0 -1
- package/lib/behaviors/zoom-canvas.d.ts +42 -15
- package/lib/behaviors/zoom-canvas.js +26 -1
- package/lib/behaviors/zoom-canvas.js.map +1 -1
- package/lib/constants/change.d.ts +50 -1
- package/lib/constants/change.js +50 -1
- package/lib/constants/change.js.map +1 -1
- package/lib/constants/element.d.ts +3 -2
- package/lib/constants/element.js +3 -2
- package/lib/constants/element.js.map +1 -1
- package/lib/constants/events/canvas.d.ts +90 -18
- package/lib/constants/events/canvas.js +90 -18
- package/lib/constants/events/canvas.js.map +1 -1
- package/lib/constants/events/common.d.ts +100 -20
- package/lib/constants/events/common.js +100 -20
- package/lib/constants/events/common.js.map +1 -1
- package/lib/constants/events/container.d.ts +10 -2
- package/lib/constants/events/container.js +10 -2
- package/lib/constants/events/container.js.map +1 -1
- package/lib/constants/events/edge.d.ts +70 -14
- package/lib/constants/events/edge.js +70 -14
- package/lib/constants/events/edge.js.map +1 -1
- package/lib/constants/events/graph.d.ts +140 -28
- package/lib/constants/events/graph.js +140 -28
- package/lib/constants/events/graph.js.map +1 -1
- package/lib/constants/events/history.d.ts +38 -0
- package/lib/constants/events/history.js +43 -0
- package/lib/constants/events/history.js.map +1 -0
- package/lib/constants/events/index.d.ts +1 -0
- package/lib/constants/events/index.js +3 -1
- package/lib/constants/events/index.js.map +1 -1
- package/lib/constants/events/node.d.ts +85 -17
- package/lib/constants/events/node.js +85 -17
- package/lib/constants/events/node.js.map +1 -1
- package/lib/constants/registry.d.ts +50 -10
- package/lib/constants/registry.js +50 -10
- package/lib/constants/registry.js.map +1 -1
- package/lib/elements/combos/base-combo.d.ts +32 -22
- package/lib/elements/combos/base-combo.js +11 -1
- package/lib/elements/combos/base-combo.js.map +1 -1
- package/lib/elements/combos/circle.d.ts +14 -2
- package/lib/elements/combos/circle.js +10 -0
- package/lib/elements/combos/circle.js.map +1 -1
- package/lib/elements/combos/rect.d.ts +12 -2
- package/lib/elements/combos/rect.js +8 -5
- package/lib/elements/combos/rect.js.map +1 -1
- package/lib/elements/edges/base-edge.d.ts +63 -27
- package/lib/elements/edges/base-edge.js +9 -6
- package/lib/elements/edges/base-edge.js.map +1 -1
- package/lib/elements/edges/cubic-horizontal.d.ts +18 -0
- package/lib/elements/edges/cubic-horizontal.js +9 -0
- package/lib/elements/edges/cubic-horizontal.js.map +1 -1
- package/lib/elements/edges/cubic-vertical.d.ts +18 -0
- package/lib/elements/edges/cubic-vertical.js +9 -0
- package/lib/elements/edges/cubic-vertical.js.map +1 -1
- package/lib/elements/edges/cubic.d.ts +19 -1
- package/lib/elements/edges/cubic.js +8 -0
- package/lib/elements/edges/cubic.js.map +1 -1
- package/lib/elements/edges/line.d.ts +12 -2
- package/lib/elements/edges/line.js +5 -1
- package/lib/elements/edges/line.js.map +1 -1
- package/lib/elements/edges/polyline.d.ts +21 -0
- package/lib/elements/edges/polyline.js +5 -0
- package/lib/elements/edges/polyline.js.map +1 -1
- package/lib/elements/edges/quadratic.d.ts +15 -0
- package/lib/elements/edges/quadratic.js +5 -0
- package/lib/elements/edges/quadratic.js.map +1 -1
- package/lib/elements/nodes/base-node.d.ts +67 -61
- package/lib/elements/nodes/base-node.js +19 -5
- package/lib/elements/nodes/base-node.js.map +1 -1
- package/lib/elements/nodes/circle.d.ts +10 -2
- package/lib/elements/nodes/circle.js +3 -1
- package/lib/elements/nodes/circle.js.map +1 -1
- package/lib/elements/nodes/diamond.d.ts +12 -4
- package/lib/elements/nodes/diamond.js +4 -2
- package/lib/elements/nodes/diamond.js.map +1 -1
- package/lib/elements/nodes/donut.d.ts +20 -20
- package/lib/elements/nodes/donut.js +20 -7
- package/lib/elements/nodes/donut.js.map +1 -1
- package/lib/elements/nodes/ellipse.d.ts +12 -1
- package/lib/elements/nodes/ellipse.js +5 -0
- package/lib/elements/nodes/ellipse.js.map +1 -1
- package/lib/elements/nodes/hexagon.d.ts +17 -7
- package/lib/elements/nodes/hexagon.js +6 -1
- package/lib/elements/nodes/hexagon.js.map +1 -1
- package/lib/elements/nodes/html.d.ts +16 -3
- package/lib/elements/nodes/html.js +4 -1
- package/lib/elements/nodes/html.js.map +1 -1
- package/lib/elements/nodes/image.d.ts +22 -2
- package/lib/elements/nodes/image.js +10 -3
- package/lib/elements/nodes/image.js.map +1 -1
- package/lib/elements/nodes/rect.d.ts +10 -2
- package/lib/elements/nodes/rect.js +5 -2
- package/lib/elements/nodes/rect.js.map +1 -1
- package/lib/elements/nodes/star.d.ts +18 -9
- package/lib/elements/nodes/star.js +6 -1
- package/lib/elements/nodes/star.js.map +1 -1
- package/lib/elements/nodes/triangle.d.ts +17 -7
- package/lib/elements/nodes/triangle.js +6 -1
- package/lib/elements/nodes/triangle.js.map +1 -1
- package/lib/elements/shapes/badge.d.ts +3 -2
- package/lib/elements/shapes/base-shape.d.ts +2 -3
- package/lib/elements/shapes/base-shape.js +33 -4
- package/lib/elements/shapes/base-shape.js.map +1 -1
- package/lib/elements/shapes/contour.d.ts +27 -10
- package/lib/elements/shapes/contour.js +2 -2
- package/lib/elements/shapes/contour.js.map +1 -1
- package/lib/elements/shapes/icon.d.ts +3 -2
- package/lib/elements/shapes/icon.js +4 -1
- package/lib/elements/shapes/icon.js.map +1 -1
- package/lib/elements/shapes/index.d.ts +1 -0
- package/lib/elements/shapes/label.d.ts +14 -5
- package/lib/elements/shapes/label.js +2 -1
- package/lib/elements/shapes/label.js.map +1 -1
- package/lib/elements/shapes/polygon.d.ts +29 -0
- package/lib/elements/{nodes → shapes}/polygon.js +1 -1
- package/lib/elements/shapes/polygon.js.map +1 -0
- package/lib/exports.d.ts +18 -8
- package/lib/exports.js +7 -2
- package/lib/exports.js.map +1 -1
- package/lib/layouts/base-layout.d.ts +10 -0
- package/lib/layouts/base-layout.js +13 -0
- package/lib/layouts/base-layout.js.map +1 -0
- package/lib/layouts/index.d.ts +1 -0
- package/lib/layouts/index.js +3 -1
- package/lib/layouts/index.js.map +1 -1
- package/lib/layouts/types.d.ts +11 -4
- package/lib/plugins/base-plugin.d.ts +2 -1
- package/lib/plugins/bubble-sets.d.ts +71 -0
- package/lib/plugins/bubble-sets.js +70 -3
- package/lib/plugins/bubble-sets.js.map +1 -1
- package/lib/plugins/camera-setting.d.ts +24 -10
- package/lib/plugins/camera-setting.js +7 -0
- package/lib/plugins/camera-setting.js.map +1 -1
- package/lib/plugins/contextmenu.d.ts +63 -40
- package/lib/plugins/contextmenu.js +43 -34
- package/lib/plugins/contextmenu.js.map +1 -1
- package/lib/plugins/grid-line.d.ts +35 -2
- package/lib/plugins/grid-line.js +25 -6
- package/lib/plugins/grid-line.js.map +1 -1
- package/lib/plugins/history/index.d.ts +48 -10
- package/lib/plugins/history/index.js +44 -17
- package/lib/plugins/history/index.js.map +1 -1
- package/lib/plugins/history/utils.d.ts +1 -11
- package/lib/plugins/history/utils.js.map +1 -1
- package/lib/plugins/hull/index.d.ts +28 -4
- package/lib/plugins/hull/index.js +26 -5
- package/lib/plugins/hull/index.js.map +1 -1
- package/lib/plugins/legend.d.ts +95 -15
- package/lib/plugins/legend.js +64 -15
- package/lib/plugins/legend.js.map +1 -1
- package/lib/plugins/timebar.d.ts +23 -14
- package/lib/plugins/timebar.js +8 -0
- package/lib/plugins/timebar.js.map +1 -1
- package/lib/plugins/toolbar/index.d.ts +35 -28
- package/lib/plugins/toolbar/index.js +11 -8
- package/lib/plugins/toolbar/index.js.map +1 -1
- package/lib/plugins/toolbar/util.d.ts +9 -10
- package/lib/plugins/toolbar/util.js +2 -1
- package/lib/plugins/toolbar/util.js.map +1 -1
- package/lib/plugins/tooltip.d.ts +93 -18
- package/lib/plugins/tooltip.js +99 -36
- package/lib/plugins/tooltip.js.map +1 -1
- package/lib/plugins/watermark.d.ts +173 -33
- package/lib/plugins/watermark.js +22 -8
- package/lib/plugins/watermark.js.map +1 -1
- package/lib/registry/types.d.ts +2 -2
- package/lib/runtime/behavior.d.ts +5 -1
- package/lib/runtime/behavior.js +5 -1
- package/lib/runtime/behavior.js.map +1 -1
- package/lib/runtime/data.d.ts +6 -6
- package/lib/runtime/data.js +27 -30
- package/lib/runtime/data.js.map +1 -1
- package/lib/runtime/element.d.ts +3 -4
- package/lib/runtime/element.js +29 -25
- package/lib/runtime/element.js.map +1 -1
- package/lib/runtime/graph.d.ts +7 -7
- package/lib/runtime/graph.js +7 -7
- package/lib/runtime/graph.js.map +1 -1
- package/lib/runtime/layout.d.ts +5 -17
- package/lib/runtime/layout.js +36 -128
- package/lib/runtime/layout.js.map +1 -1
- package/lib/spec/behavior.d.ts +20 -2
- package/lib/spec/canvas.d.ts +9 -2
- package/lib/spec/data.d.ts +93 -2
- package/lib/spec/element/combo.d.ts +5 -13
- package/lib/spec/element/edge.d.ts +1 -8
- package/lib/spec/element/node.d.ts +1 -14
- package/lib/spec/graph.d.ts +3 -3
- package/lib/spec/plugin.d.ts +22 -2
- package/lib/spec/viewport.d.ts +19 -23
- package/lib/themes/base.js +17 -8
- package/lib/themes/base.js.map +1 -1
- package/lib/transforms/arrange-draw-order.js +17 -12
- package/lib/transforms/arrange-draw-order.js.map +1 -1
- package/lib/transforms/collapse-expand-combo.js +29 -20
- package/lib/transforms/collapse-expand-combo.js.map +1 -1
- package/lib/types/combo.d.ts +23 -0
- package/lib/types/combo.js +3 -0
- package/lib/types/combo.js.map +1 -0
- package/lib/types/edge.d.ts +73 -9
- package/lib/types/element.d.ts +3 -0
- package/lib/types/event.d.ts +14 -2
- package/lib/types/history.d.ts +51 -0
- package/lib/types/history.js +3 -0
- package/lib/types/history.js.map +1 -0
- package/lib/types/index.d.ts +2 -0
- package/lib/types/layout.d.ts +9 -0
- package/lib/types/layout.js +3 -0
- package/lib/types/layout.js.map +1 -0
- package/lib/types/node.d.ts +111 -7
- package/lib/types/point.d.ts +1 -2
- package/lib/types/prefix.d.ts +11 -1
- package/lib/types/viewport.d.ts +1 -3
- package/lib/utils/animation.d.ts +2 -16
- package/lib/utils/animation.js +1 -37
- package/lib/utils/animation.js.map +1 -1
- package/lib/utils/bbox.d.ts +1 -2
- package/lib/utils/bbox.js.map +1 -1
- package/lib/utils/dom.d.ts +6 -0
- package/lib/utils/dom.js +16 -1
- package/lib/utils/dom.js.map +1 -1
- package/lib/utils/edge.d.ts +11 -2
- package/lib/utils/edge.js +30 -5
- package/lib/utils/edge.js.map +1 -1
- package/lib/utils/element.d.ts +7 -9
- package/lib/utils/element.js +7 -6
- package/lib/utils/element.js.map +1 -1
- package/lib/utils/id.js +1 -1
- package/lib/utils/id.js.map +1 -1
- package/lib/utils/layout.d.ts +45 -0
- package/lib/utils/layout.js +171 -1
- package/lib/utils/layout.js.map +1 -1
- package/lib/utils/point.d.ts +11 -2
- package/lib/utils/point.js +32 -29
- package/lib/utils/point.js.map +1 -1
- package/lib/utils/polygon.js +3 -6
- package/lib/utils/polygon.js.map +1 -1
- package/lib/utils/prefix.js +15 -2
- package/lib/utils/prefix.js.map +1 -1
- package/lib/utils/symbol.js +27 -15
- package/lib/utils/symbol.js.map +1 -1
- package/lib/utils/transform.d.ts +10 -0
- package/lib/utils/transform.js +23 -0
- package/lib/utils/transform.js.map +1 -0
- package/lib/utils/tree.js +2 -2
- package/lib/utils/tree.js.map +1 -1
- package/lib/utils/watermark.d.ts +1 -1
- package/lib/utils/watermark.js +3 -3
- package/package.json +33 -34
- package/src/animations/executor.ts +34 -13
- package/src/animations/types.ts +4 -4
- package/src/behaviors/brush-select.ts +237 -167
- package/src/behaviors/click-element.ts +17 -17
- package/src/behaviors/collapse-expand.ts +15 -1
- package/src/behaviors/create-edge.ts +26 -7
- package/src/behaviors/drag-canvas.ts +31 -8
- package/src/behaviors/drag-element-force.ts +51 -13
- package/src/behaviors/drag-element.ts +106 -26
- package/src/behaviors/focus-element.ts +24 -25
- package/src/behaviors/hover-element.ts +28 -6
- package/src/behaviors/lasso-select.ts +49 -69
- package/src/behaviors/scroll-canvas.ts +37 -13
- package/src/behaviors/types.ts +0 -2
- package/src/behaviors/zoom-canvas.ts +53 -16
- package/src/constants/change.ts +50 -1
- package/src/constants/element.ts +3 -2
- package/src/constants/events/canvas.ts +90 -18
- package/src/constants/events/common.ts +100 -20
- package/src/constants/events/container.ts +10 -2
- package/src/constants/events/edge.ts +70 -14
- package/src/constants/events/graph.ts +140 -28
- package/src/constants/events/history.ts +38 -0
- package/src/constants/events/index.ts +1 -0
- package/src/constants/events/node.ts +85 -17
- package/src/constants/registry.ts +50 -10
- package/src/elements/combos/base-combo.ts +67 -59
- package/src/elements/combos/circle.ts +18 -2
- package/src/elements/combos/rect.ts +14 -7
- package/src/elements/edges/base-edge.ts +131 -105
- package/src/elements/edges/cubic-horizontal.ts +18 -0
- package/src/elements/edges/cubic-vertical.ts +18 -0
- package/src/elements/edges/cubic.ts +19 -1
- package/src/elements/edges/line.ts +11 -2
- package/src/elements/edges/polyline.ts +23 -2
- package/src/elements/edges/quadratic.ts +15 -0
- package/src/elements/nodes/base-node.ts +167 -156
- package/src/elements/nodes/circle.ts +9 -2
- package/src/elements/nodes/diamond.ts +11 -4
- package/src/elements/nodes/donut.ts +36 -28
- package/src/elements/nodes/ellipse.ts +12 -2
- package/src/elements/nodes/hexagon.ts +17 -7
- package/src/elements/nodes/html.ts +16 -3
- package/src/elements/nodes/image.ts +28 -6
- package/src/elements/nodes/rect.ts +11 -3
- package/src/elements/nodes/star.ts +18 -9
- package/src/elements/nodes/triangle.ts +17 -7
- package/src/elements/shapes/badge.ts +1 -1
- package/src/elements/shapes/base-shape.ts +39 -11
- package/src/elements/shapes/contour.ts +29 -12
- package/src/elements/shapes/icon.ts +5 -3
- package/src/elements/shapes/index.ts +1 -0
- package/src/elements/shapes/label.ts +18 -9
- package/src/elements/{nodes → shapes}/polygon.ts +22 -13
- package/src/exports.ts +44 -2
- package/src/layouts/base-layout.ts +18 -0
- package/src/layouts/index.ts +1 -0
- package/src/layouts/types.ts +14 -4
- package/src/plugins/base-plugin.ts +1 -1
- package/src/plugins/bubble-sets.ts +75 -10
- package/src/plugins/camera-setting.ts +24 -11
- package/src/plugins/contextmenu.ts +82 -59
- package/src/plugins/grid-line.ts +40 -9
- package/src/plugins/history/index.ts +51 -17
- package/src/plugins/history/utils.ts +1 -13
- package/src/plugins/hull/index.ts +35 -9
- package/src/plugins/legend.ts +120 -38
- package/src/plugins/timebar.ts +24 -14
- package/src/plugins/toolbar/index.ts +35 -29
- package/src/plugins/toolbar/util.ts +9 -11
- package/src/plugins/tooltip.ts +124 -50
- package/src/plugins/watermark.ts +177 -36
- package/src/registry/types.ts +2 -2
- package/src/runtime/behavior.ts +5 -1
- package/src/runtime/data.ts +24 -27
- package/src/runtime/element.ts +37 -29
- package/src/runtime/graph.ts +10 -10
- package/src/runtime/layout.ts +53 -176
- package/src/spec/behavior.ts +20 -2
- package/src/spec/canvas.ts +9 -2
- package/src/spec/data.ts +93 -2
- package/src/spec/element/combo.ts +5 -13
- package/src/spec/element/edge.ts +1 -8
- package/src/spec/element/node.ts +1 -14
- package/src/spec/graph.ts +3 -3
- package/src/spec/plugin.ts +22 -2
- package/src/spec/viewport.ts +11 -20
- package/src/themes/base.ts +17 -8
- package/src/transforms/arrange-draw-order.ts +20 -14
- package/src/transforms/collapse-expand-combo.ts +32 -18
- package/src/types/combo.ts +24 -0
- package/src/types/edge.ts +86 -10
- package/src/types/element.ts +3 -0
- package/src/types/event.ts +14 -2
- package/src/types/history.ts +53 -0
- package/src/types/index.ts +2 -0
- package/src/types/layout.ts +12 -0
- package/src/types/node.ts +122 -7
- package/src/types/point.ts +1 -3
- package/src/types/prefix.ts +11 -1
- package/src/types/viewport.ts +1 -3
- package/src/utils/animation.ts +1 -45
- package/src/utils/bbox.ts +1 -2
- package/src/utils/dom.ts +14 -0
- package/src/utils/edge.ts +31 -6
- package/src/utils/element.ts +21 -12
- package/src/utils/id.ts +1 -1
- package/src/utils/layout.ts +203 -1
- package/src/utils/point.ts +28 -31
- package/src/utils/polygon.ts +3 -6
- package/src/utils/prefix.ts +16 -2
- package/src/utils/symbol.ts +27 -15
- package/src/utils/transform.ts +17 -0
- package/src/utils/tree.ts +3 -3
- package/src/utils/watermark.ts +1 -1
- package/dist/lib/elements/nodes/polygon.d.ts +0 -18
- package/dist/lib/plugins/history/events.d.ts +0 -21
- package/dist/lib/utils/behaviors/brush.d.ts +0 -18
- package/dist/lib/utils/behaviors/lasso.d.ts +0 -12
- package/dist/lib/utils/behaviors/utils.d.ts +0 -21
- package/esm/elements/nodes/polygon.d.ts +0 -18
- package/esm/elements/nodes/polygon.js.map +0 -1
- package/esm/plugins/history/events.d.ts +0 -21
- package/esm/plugins/history/events.js +0 -16
- package/esm/plugins/history/events.js.map +0 -1
- package/esm/utils/behaviors/brush.d.ts +0 -18
- package/esm/utils/behaviors/brush.js +0 -25
- package/esm/utils/behaviors/brush.js.map +0 -1
- package/esm/utils/behaviors/lasso.d.ts +0 -12
- package/esm/utils/behaviors/lasso.js +0 -112
- package/esm/utils/behaviors/lasso.js.map +0 -1
- package/esm/utils/behaviors/utils.d.ts +0 -21
- package/esm/utils/behaviors/utils.js +0 -42
- package/esm/utils/behaviors/utils.js.map +0 -1
- package/lib/elements/nodes/polygon.d.ts +0 -18
- package/lib/elements/nodes/polygon.js.map +0 -1
- package/lib/plugins/history/events.d.ts +0 -21
- package/lib/plugins/history/events.js +0 -19
- package/lib/plugins/history/events.js.map +0 -1
- package/lib/utils/behaviors/brush.d.ts +0 -18
- package/lib/utils/behaviors/brush.js +0 -30
- package/lib/utils/behaviors/brush.js.map +0 -1
- package/lib/utils/behaviors/lasso.d.ts +0 -12
- package/lib/utils/behaviors/lasso.js +0 -116
- package/lib/utils/behaviors/lasso.js.map +0 -1
- package/lib/utils/behaviors/utils.d.ts +0 -21
- package/lib/utils/behaviors/utils.js +0 -47
- package/lib/utils/behaviors/utils.js.map +0 -1
- package/src/plugins/history/events.ts +0 -25
- package/src/utils/behaviors/brush.ts +0 -28
- package/src/utils/behaviors/lasso.ts +0 -126
- package/src/utils/behaviors/utils.ts +0 -47
package/dist/lib/types/node.d.ts
CHANGED
|
@@ -1,16 +1,120 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { BaseStyleProps, CircleStyleProps, DisplayObject } from '@antv/g';
|
|
2
|
+
import type { BadgeStyleProps, LabelStyleProps } from '../elements/shapes';
|
|
3
|
+
import type { CardinalPlacement, CornerPlacement, DirectionalPlacement, Placement, RelativePlacement } from './placement';
|
|
3
4
|
import type { Point } from './point';
|
|
4
5
|
export type PortPlacement = RelativePlacement | CardinalPlacement;
|
|
5
6
|
export type StarPortPlacement = RelativePlacement | 'top' | 'left' | 'right' | 'left-bottom' | 'right-bottom';
|
|
6
7
|
export type TrianglePortPlacement = RelativePlacement | CardinalPlacement;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
/**
|
|
9
|
+
* <zh/> 三角形指向
|
|
10
|
+
*
|
|
11
|
+
* <en/> Triangle direction
|
|
12
|
+
*/
|
|
13
|
+
export type TriangleDirection = 'up' | 'left' | 'right' | 'down';
|
|
14
|
+
/**
|
|
15
|
+
* <zh/> 节点标签样式配置项
|
|
16
|
+
*
|
|
17
|
+
* <en/> Node label style props
|
|
18
|
+
*/
|
|
19
|
+
export interface NodeLabelStyleProps extends LabelStyleProps {
|
|
10
20
|
/**
|
|
11
|
-
* <zh/>
|
|
12
|
-
*
|
|
21
|
+
* <zh/> 标签相对于节点(keyShape)的位置
|
|
22
|
+
*
|
|
23
|
+
* <en/> Label position relative to the node (keyShape)
|
|
24
|
+
* @defaultValue 'bottom'
|
|
25
|
+
*/
|
|
26
|
+
placement?: DirectionalPlacement;
|
|
27
|
+
/**
|
|
28
|
+
* <zh/> 标签最大宽度
|
|
29
|
+
* - string: 表示以相对于节点宽度的百分比形式定义最大宽度。例如 `"50%"` 表示标签宽度不超过节点宽度的一半
|
|
30
|
+
* - number: 表示以像素值为单位定义最大宽度。例如 `100` 表示标签的最大宽度为 100 像素
|
|
31
|
+
*
|
|
32
|
+
* <en/> The maximum width of the label
|
|
33
|
+
* - string: When set to a string, it defines the maximum width as a percentage of the node width. For example, `"50%"` means the label width does not exceed half of the node width
|
|
34
|
+
* - number: When set to a number, it defines the maximum width in pixels. For example, `100` means the maximum width of the label is 100 pixels
|
|
35
|
+
* @defaultValue '200%'
|
|
36
|
+
*/
|
|
37
|
+
maxWidth?: string | number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* <zh/> 节点徽标样式配置项
|
|
41
|
+
*
|
|
42
|
+
* <en/> Node badge style props
|
|
43
|
+
*/
|
|
44
|
+
export interface NodeBadgeStyleProps extends BadgeStyleProps {
|
|
45
|
+
/**
|
|
46
|
+
* <zh/> 徽标相对于节点(keyShape)的位置
|
|
47
|
+
*
|
|
48
|
+
* <en/> Badge position relative to the node (keyShape)
|
|
49
|
+
*/
|
|
50
|
+
placement?: CardinalPlacement | CornerPlacement;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* <zh/> 连接桩样式配置项
|
|
54
|
+
*
|
|
55
|
+
* <en/> Port style props
|
|
56
|
+
*/
|
|
57
|
+
export interface PortStyleProps extends Omit<CircleStyleProps, 'r'> {
|
|
58
|
+
/**
|
|
59
|
+
* <zh/> 边是否连接到连接桩的中心
|
|
60
|
+
* - 若为 `true`,则边连接到连接桩的中心
|
|
61
|
+
* - 若为 `false`,则边连接到连接桩的边缘
|
|
62
|
+
*
|
|
63
|
+
* <en/> Whether the edge is connected to the center of the port
|
|
64
|
+
* - If `true`, the edge is connected to the center of the port
|
|
65
|
+
* - If `false`, the edge is connected to the edge of the port
|
|
66
|
+
* @defaultValue false
|
|
13
67
|
*/
|
|
14
68
|
linkToCenter?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* <zh/> 连接桩半径
|
|
71
|
+
* - 如果设置为 `undefined`,则连接桩被视为一个点,不在画布上显示但存在,边会优先连接到最近的连接桩
|
|
72
|
+
* - 如果设置为数字,则连接桩被视为一个圆,圆的半径由此处指定
|
|
73
|
+
*
|
|
74
|
+
* <en/> The radius of the port
|
|
75
|
+
* - If set to `undefined`, the port is treated as a point, not displayed on the canvas but exists, and the edge will be connected to the nearest port first
|
|
76
|
+
* - If set to a number, the port is treated as a circle, and the radius of the circle is specified here
|
|
77
|
+
*/
|
|
78
|
+
r?: number;
|
|
15
79
|
}
|
|
16
80
|
export type Port = DisplayObject<PortStyleProps> | Point;
|
|
81
|
+
/**
|
|
82
|
+
* <zh/> 节点连接桩样式配置项
|
|
83
|
+
*
|
|
84
|
+
* <en/> Node port style props
|
|
85
|
+
*/
|
|
86
|
+
export interface NodePortStyleProps extends PortStyleProps {
|
|
87
|
+
/**
|
|
88
|
+
* <zh/> 连接桩的键值,默认为连接桩的索引
|
|
89
|
+
*
|
|
90
|
+
* <en/> The key of the port. Default is the index of the port
|
|
91
|
+
*/
|
|
92
|
+
key?: string;
|
|
93
|
+
/**
|
|
94
|
+
* <zh/> 连接桩相对于节点(keyShape)的位置。值可以是字符串或两个数字的元组。
|
|
95
|
+
*
|
|
96
|
+
* <en/> The position of the port relative to the node (keyShape). The value can be a string or a tuple of two numbers.
|
|
97
|
+
* - If the value is a string, it will be treated as the position direction.
|
|
98
|
+
* - If the value is a tuple of two numbers, it will be treated as the position coordinates(0 ~ 1).
|
|
99
|
+
*/
|
|
100
|
+
placement: Placement;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* <zh/> 甜甜圈节点中的圆环样式配置项
|
|
104
|
+
*
|
|
105
|
+
* <en/> Ring style props in the donut node
|
|
106
|
+
*/
|
|
107
|
+
export interface DonutRound extends BaseStyleProps {
|
|
108
|
+
/**
|
|
109
|
+
* <zh/> 数值,用于计算比例
|
|
110
|
+
*
|
|
111
|
+
* <en/> Numerical value used to calculate the scale.
|
|
112
|
+
*/
|
|
113
|
+
value: number;
|
|
114
|
+
/**
|
|
115
|
+
* <zh/> 颜色
|
|
116
|
+
*
|
|
117
|
+
* <en/> Color.
|
|
118
|
+
*/
|
|
119
|
+
color?: string;
|
|
120
|
+
}
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
export type PrefixKey<P extends string = string, K extends string = string> = `${P}${Capitalize<K>}`;
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* @remarks
|
|
4
|
+
* <zh/> `Prefix<P, T>` 是一种类型模式,用于将特定的前缀 `P` 应用到类型 `T` 上。在我们的配置中,这意味着我们将为一组属性或行为添加一个前缀,以表示它们属于某个具体的上下文或分类。
|
|
5
|
+
*
|
|
6
|
+
* <zh/> 当你在文档中看到类似 `Prefix<'label', StyleProps>` 的表达式,它表示给 `StyleProps` 类型的属性加上 `label` 前缀,以形成新的属性名称。例如,`color` 属性将以 `labelColor` 形式使用。
|
|
7
|
+
*
|
|
8
|
+
* <en/> `Prefix<P, T>` is a type pattern used to apply a specific prefix `P` to the type `T`. In our configuration, this means adding a prefix to a set of properties or behaviors to indicate that they belong to a specific context or category.
|
|
9
|
+
*
|
|
10
|
+
* <en/> When you see expressions like `Prefix<'label', StyleProps>` in the document, it means adding the `label` prefix to the properties of the `StyleProps` type to form a new property name. For example, the `color` property will be used in the form of `labelColor`.
|
|
11
|
+
*/
|
|
12
|
+
export type Prefix<P extends string, T extends object> = {
|
|
3
13
|
[K in keyof T as K extends string ? PrefixKey<P, K> : never]?: T[K];
|
|
4
14
|
};
|
|
5
15
|
export type ReplacePrefix<T, OldPrefix extends string, NewPrefix extends string> = {
|
|
@@ -4,7 +4,7 @@ export type ViewportAnimationEffectTiming = boolean | {
|
|
|
4
4
|
duration?: number;
|
|
5
5
|
};
|
|
6
6
|
export interface TransformOptions {
|
|
7
|
-
mode:
|
|
7
|
+
mode: 'relative' | 'absolute';
|
|
8
8
|
origin?: Point;
|
|
9
9
|
translate?: Point;
|
|
10
10
|
rotate?: number;
|
|
@@ -34,5 +34,3 @@ export interface FitViewOptions {
|
|
|
34
34
|
*/
|
|
35
35
|
direction?: 'x' | 'y' | 'both';
|
|
36
36
|
}
|
|
37
|
-
type ViewportChangeMode = 'relative' | 'absolute';
|
|
38
|
-
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type IAnimation } from '@antv/g';
|
|
2
2
|
import type { GraphOptions } from '../spec';
|
|
3
3
|
import type { AnimatableTask, Keyframe } from '../types';
|
|
4
4
|
export declare function createAnimationsProxy(animations: IAnimation[]): IAnimation | null;
|
|
@@ -11,20 +11,6 @@ export declare function createAnimationsProxy(sourceAnimation: IAnimation, targe
|
|
|
11
11
|
* @returns <zh/> 关键帧 | <en/> keyframes
|
|
12
12
|
*/
|
|
13
13
|
export declare function preprocessKeyframes(keyframes: Keyframe[]): Keyframe[];
|
|
14
|
-
/**
|
|
15
|
-
* <zh/> 对图形执行动画
|
|
16
|
-
*
|
|
17
|
-
* <en/> Animate the shape
|
|
18
|
-
* @param shape - <zh/> 待执行动画的图形 | <en/> the shape to be animated
|
|
19
|
-
* @param keyframes - <zh/> 动画关键帧 | <en/> keyframes of the animation
|
|
20
|
-
* @param options - <zh/> 动画配置项 | <en/> animation options
|
|
21
|
-
* @returns <zh/> 动画对象 | <en/> animation object
|
|
22
|
-
* @remarks
|
|
23
|
-
* <zh/> 在设置 enableCSSParsing 为 false 后,复合图形无法继承父属性,因此对于一些需要继承父属性的动画,需要对所有子图形执行相同的动画
|
|
24
|
-
*
|
|
25
|
-
* <en/> After setting enableCSSParsing to false, the compound shape cannot inherit the parent attribute, so for some animations that need to inherit the parent attribute, the same animation needs to be performed on all child shapes
|
|
26
|
-
*/
|
|
27
|
-
export declare function executeAnimation<T extends DisplayObject>(shape: T, keyframes: Keyframe[], options: KeyframeAnimationOptions): IAnimation | null;
|
|
28
14
|
/**
|
|
29
15
|
* <zh/> 获取属性的默认值
|
|
30
16
|
*
|
|
@@ -36,7 +22,7 @@ export declare function executeAnimation<T extends DisplayObject>(shape: T, keyf
|
|
|
36
22
|
*
|
|
37
23
|
* <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
24
|
*/
|
|
39
|
-
export declare function inferDefaultValue(name: string): false | 1 | "visible" | 0 |
|
|
25
|
+
export declare function inferDefaultValue(name: string): false | 1 | never[] | "visible" | 0 | undefined;
|
|
40
26
|
type Callbacks = {
|
|
41
27
|
before?: () => void;
|
|
42
28
|
beforeAnimate?: (result: IAnimation) => void;
|
package/dist/lib/utils/bbox.d.ts
CHANGED
package/dist/lib/utils/dom.d.ts
CHANGED
|
@@ -21,3 +21,9 @@ export declare function createPluginContainer(type: string, cover?: boolean): HT
|
|
|
21
21
|
* @returns new DOM element
|
|
22
22
|
*/
|
|
23
23
|
export declare function insertDOM(id: string, tag?: string, style?: Partial<CSSStyleDeclaration>, innerHTML?: string, container?: HTMLElement): HTMLElement;
|
|
24
|
+
/**
|
|
25
|
+
* Insert a DOM element before the first child of the container.
|
|
26
|
+
* @param container - container
|
|
27
|
+
* @param element - element
|
|
28
|
+
*/
|
|
29
|
+
export declare function insertBefore(container: HTMLElement, element: HTMLElement): void;
|
package/dist/lib/utils/edge.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AABB } from '@antv/g';
|
|
2
2
|
import type { PathArray } from '@antv/util';
|
|
3
3
|
import type { EdgeData } from '../spec';
|
|
4
|
-
import type { EdgeKey,
|
|
4
|
+
import type { EdgeKey, EdgeLabelStyleProps, ID, LoopPlacement, Node, NodeLikeData, Point, Port } from '../types';
|
|
5
5
|
/**
|
|
6
6
|
* <zh/> 获取标签的位置样式
|
|
7
7
|
*
|
|
@@ -13,7 +13,7 @@ import type { EdgeKey, EdgeLabelPlacement, EdgeLabelStyleProps, ID, LoopPlacemen
|
|
|
13
13
|
* @param offsetY - <zh/> 标签相对于边的垂直偏移量 | <en/> Vertical offset of the label relative to the edge
|
|
14
14
|
* @returns <zh/> 标签的位置样式 | <en/> Returns the style of the label's position
|
|
15
15
|
*/
|
|
16
|
-
export declare function getLabelPositionStyle(key: EdgeKey, placement:
|
|
16
|
+
export declare function getLabelPositionStyle(key: EdgeKey, placement: EdgeLabelStyleProps['placement'], autoRotate: boolean, offsetX: number, offsetY: number): Partial<EdgeLabelStyleProps>;
|
|
17
17
|
/** ==================== Curve Edge =========================== */
|
|
18
18
|
/**
|
|
19
19
|
* <zh/> 计算曲线的控制点
|
|
@@ -166,3 +166,12 @@ export declare function getSubgraphRelatedEdges(ids: ID[], getRelatedEdges: (id:
|
|
|
166
166
|
internal: EdgeData[];
|
|
167
167
|
external: EdgeData[];
|
|
168
168
|
};
|
|
169
|
+
/**
|
|
170
|
+
* <zh/> 获取边的实际连接节点
|
|
171
|
+
*
|
|
172
|
+
* <en/> Get the actual connected object of the edge
|
|
173
|
+
* @param node - <zh/> 逻辑连接节点数据 | <en/> Logical connection node data
|
|
174
|
+
* @param getParentData - <zh/> 获取父节点数据 | <en/> Get parent node data
|
|
175
|
+
* @returns <zh/> 实际连接节点数据 | <en/> Actual connected node data
|
|
176
|
+
*/
|
|
177
|
+
export declare function findActualConnectNodeData(node: NodeLikeData, getParentData: (id: ID) => NodeLikeData | undefined): NodeLikeData;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type { NodePortStyleProps } from '../
|
|
3
|
-
import type {
|
|
4
|
-
import type { Combo, Edge, Element, Node, Placement, Point, Position } from '../types';
|
|
5
|
-
import type { LabelPlacement, Port } from '../types/node';
|
|
1
|
+
import { type AABB, type DisplayObject, type TextStyleProps } from '@antv/g';
|
|
2
|
+
import type { Combo, Edge, Element, Node, NodePortStyleProps, Placement, Point, Position, TriangleDirection } from '../types';
|
|
3
|
+
import type { NodeLabelStyleProps, Port } from '../types/node';
|
|
6
4
|
/**
|
|
7
5
|
* <zh/> 判断是否是 Node 的实例
|
|
8
6
|
*
|
|
@@ -26,7 +24,7 @@ export declare function isEdge(shape: DisplayObject): shape is Edge;
|
|
|
26
24
|
* @param shape - <zh/> 实例 | <en/> instance
|
|
27
25
|
* @returns <zh/> 是否是 Combo 的实例 | <en/> whether the instance is Combo
|
|
28
26
|
*/
|
|
29
|
-
export declare function isCombo(shape:
|
|
27
|
+
export declare function isCombo(shape: any): shape is Combo;
|
|
30
28
|
/**
|
|
31
29
|
* <zh/> 判断是否是 Element 的实例
|
|
32
30
|
*
|
|
@@ -111,7 +109,7 @@ export declare function findPort(node: Node, oppositeNode: Node, portKey?: strin
|
|
|
111
109
|
* @param opposite - <zh/> 对端的具体点或节点 | <en/> Opposite Point or Node
|
|
112
110
|
* @returns <zh/> 连接点 | <en/> Connection Point
|
|
113
111
|
*/
|
|
114
|
-
export declare function getConnectionPoint(node: Port | Node, opposite: Node | Port): Point;
|
|
112
|
+
export declare function getConnectionPoint(node: Port | Node | Combo, opposite: Node | Port): Point;
|
|
115
113
|
/**
|
|
116
114
|
* <zh/> 获取连接桩的连接点,即从连接桩中心到另一端的连线在连接桩边界上的交点
|
|
117
115
|
*
|
|
@@ -139,7 +137,7 @@ export declare function getNodeConnectionPoint(node: Node, opposite: Node | Port
|
|
|
139
137
|
* @param isReverseBaseline - Whether reverse the baseline.
|
|
140
138
|
* @returns Partial<TextStyleProps>
|
|
141
139
|
*/
|
|
142
|
-
export declare function getTextStyleByPlacement(bbox: AABB, placement?:
|
|
140
|
+
export declare function getTextStyleByPlacement(bbox: AABB, placement?: NodeLabelStyleProps['placement'], isReverseBaseline?: boolean): Partial<TextStyleProps>;
|
|
143
141
|
/**
|
|
144
142
|
* <zh/> 获取五角星的顶点
|
|
145
143
|
*
|
|
@@ -184,7 +182,7 @@ export declare function getTrianglePorts(width: number, height: number, directio
|
|
|
184
182
|
* @param height - <zh/> 高度 | <en/> height
|
|
185
183
|
* @returns <zh/> 矩形的顶点 | <en/> The points of a rectangle
|
|
186
184
|
*/
|
|
187
|
-
export declare function
|
|
185
|
+
export declare function getBoundingPoints(width: number, height: number): Point[];
|
|
188
186
|
/**
|
|
189
187
|
* Get Diamond PathArray.
|
|
190
188
|
* @param width - diamond width
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import { BaseLayout } from '../layouts/base-layout';
|
|
2
|
+
import type { LayoutMapping } from '@antv/layout';
|
|
3
|
+
import type { AntVLayout } from '../layouts/types';
|
|
4
|
+
import type { RuntimeContext } from '../runtime/types';
|
|
5
|
+
import type { GraphData } from '../spec/data';
|
|
1
6
|
import type { STDLayoutOptions } from '../spec/layout';
|
|
2
7
|
/**
|
|
3
8
|
* <zh/> 判断是否是 combo 布局
|
|
@@ -23,3 +28,43 @@ export declare function isTreeLayout(options: STDLayoutOptions): boolean;
|
|
|
23
28
|
* @returns <zh/> 是否指定了位置 | <en/> Is the position specified
|
|
24
29
|
*/
|
|
25
30
|
export declare function isPositionSpecified(data: Record<string, unknown>): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* <zh/> 将图布局结果转换为 G6 数据
|
|
33
|
+
*
|
|
34
|
+
* <en/> Convert the layout result to G6 data
|
|
35
|
+
* @param layoutMapping - <zh/> 布局映射 | <en/> Layout mapping
|
|
36
|
+
* @returns <zh/> G6 数据 | <en/> G6 data
|
|
37
|
+
*/
|
|
38
|
+
export declare function layoutMapping2GraphData(layoutMapping: LayoutMapping): GraphData;
|
|
39
|
+
/**
|
|
40
|
+
* <zh/> 将 @antv/layout 布局适配为 G6 布局
|
|
41
|
+
*
|
|
42
|
+
* <en/> Adapt @antv/layout layout to G6 layout
|
|
43
|
+
* @param Ctor - <zh/> 布局类 | <en/> Layout class
|
|
44
|
+
* @param context - <zh/> 运行时上下文 | <en/> Runtime context
|
|
45
|
+
* @returns <zh/> G6 布局类 | <en/> G6 layout class
|
|
46
|
+
*/
|
|
47
|
+
export declare function layoutAdapter(Ctor: new (options?: any) => AntVLayout, context: RuntimeContext): new (options?: any) => BaseLayout;
|
|
48
|
+
/**
|
|
49
|
+
* <zh/> 调用布局成员方法
|
|
50
|
+
*
|
|
51
|
+
* <en/> Call layout member methods
|
|
52
|
+
* @description
|
|
53
|
+
* <zh/> 提供一种通用的调用方式来调用 G6 布局和 \@antv/layout 布局上的方法
|
|
54
|
+
*
|
|
55
|
+
* <en/> Provide a common way to call methods on G6 layout and \@antv/layout layout
|
|
56
|
+
* @param layout - <zh/> 布局实例 | <en/> Layout instance
|
|
57
|
+
* @param method - <zh/> 方法名 | <en/> Method name
|
|
58
|
+
* @param args - <zh/> 参数 | <en/> Arguments
|
|
59
|
+
* @returns <zh/> 返回值 | <en/> Return value
|
|
60
|
+
*/
|
|
61
|
+
export declare function invokeLayoutMethod(layout: BaseLayout, method: string, ...args: unknown[]): any;
|
|
62
|
+
/**
|
|
63
|
+
* <zh/> 获取布局成员属性
|
|
64
|
+
*
|
|
65
|
+
* <en/> Get layout member properties
|
|
66
|
+
* @param layout - <zh/> 布局实例 | <en/> Layout instance
|
|
67
|
+
* @param name - <zh/> 属性名 | <en/> Property name
|
|
68
|
+
* @returns <zh/> 返回值 | <en/> Return value
|
|
69
|
+
*/
|
|
70
|
+
export declare function getLayoutProperty(layout: BaseLayout, name: string): any;
|
|
@@ -103,14 +103,16 @@ export declare function getPolygonIntersectPoint(p: Point, center: Point, points
|
|
|
103
103
|
line?: LineSegment;
|
|
104
104
|
};
|
|
105
105
|
/**
|
|
106
|
-
* <zh/>
|
|
106
|
+
* <zh/> 判断点是否在多边形内部
|
|
107
107
|
*
|
|
108
108
|
* <en/> Whether point is inside the polygon (ray algo)
|
|
109
109
|
* @param point - <zh/> 点 | <en/> point
|
|
110
110
|
* @param points - <zh/> 多边形顶点 | <en/> polygon vertices
|
|
111
|
+
* @param start - <zh/> 起始索引 | <en/> start index
|
|
112
|
+
* @param end - <zh/> 结束索引 | <en/> end index
|
|
111
113
|
* @returns <zh/> 是否在多边形内部 | <en/> whether inside the polygon
|
|
112
114
|
*/
|
|
113
|
-
export declare function isPointInPolygon(point: Point, points: Point[]): boolean;
|
|
115
|
+
export declare function isPointInPolygon(point: Point, points: Point[], start?: number, end?: number): boolean;
|
|
114
116
|
/**
|
|
115
117
|
* <zh/> 获取从矩形中心到给定点的连线与矩形边缘的交点
|
|
116
118
|
*
|
|
@@ -181,3 +183,10 @@ export declare function centerOf(points: Point[]): Point;
|
|
|
181
183
|
* @returns <zh/> 排序后的点集 | <en/> sorted point set
|
|
182
184
|
*/
|
|
183
185
|
export declare function sortByClockwise(points: Point[], clockwise?: boolean): Point[];
|
|
186
|
+
/**
|
|
187
|
+
* <zh/> 给定的起点和终点,返回一个由这两个点和它们的对角点组成的数组
|
|
188
|
+
* @param start - <zh/> 起点 | <en/> start point
|
|
189
|
+
* @param end - <zh/> 终点 | <en/> end point
|
|
190
|
+
* @returns <zh/> 由这两个点和它们的对角点组成的数组 | <en/> an array consisting of these two points and their diagonal points
|
|
191
|
+
*/
|
|
192
|
+
export declare function getBoundingPoints(start: Point, end: Point): Point[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* <zh/> 从 transform 字符串中替换 translate 部分
|
|
3
|
+
*
|
|
4
|
+
* <en/> replace the translate part from the transform string
|
|
5
|
+
* @param x - <zh/> x | <en/> x
|
|
6
|
+
* @param y - <zh/> y | <en/> y
|
|
7
|
+
* @param z - <zh/> z | <en/> z
|
|
8
|
+
* @param transform - <zh/> transform 字符串 | <en/> transform string
|
|
9
|
+
*/
|
|
10
|
+
export declare function replaceTranslateInTransform(x: number, y: number, z: number, transform?: string): string;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @param style - 样式
|
|
7
7
|
* @returns 水印的 base64
|
|
8
8
|
*/
|
|
9
|
-
export declare function
|
|
9
|
+
export declare function getTextWatermark(width: number, height: number, text: string, style: any): Promise<string>;
|
|
10
10
|
/**
|
|
11
11
|
* Get the image base64 of the watermark.
|
|
12
12
|
* @param width - width
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { isString, upperFirst } from '@antv/util';
|
|
2
2
|
import { DEFAULT_ELEMENTS_ANIMATION_OPTIONS } from '../constants';
|
|
3
3
|
import { getExtension } from '../registry';
|
|
4
|
-
import { createAnimationsProxy,
|
|
4
|
+
import { createAnimationsProxy, inferDefaultValue, preprocessKeyframes } from '../utils/animation';
|
|
5
|
+
import { replaceTranslateInTransform } from '../utils/transform';
|
|
5
6
|
/**
|
|
6
7
|
* <zh/> 动画 Spec 执行器
|
|
7
8
|
*
|
|
@@ -29,7 +30,9 @@ export const executor = (element, animation, commonEffectTiming, context) => {
|
|
|
29
30
|
*/
|
|
30
31
|
const getKeyframeStyle = (shapeID) => {
|
|
31
32
|
if (shapeID) {
|
|
32
|
-
const shape = element.
|
|
33
|
+
const shape = element.getShape(shapeID);
|
|
34
|
+
if (!shape)
|
|
35
|
+
return null;
|
|
33
36
|
const name = `get${upperFirst(shapeID)}Style`;
|
|
34
37
|
const styler = element?.[name]?.bind(element) || ((attrs) => attrs);
|
|
35
38
|
const fromStyle = styler?.({ ...element.attributes, ...originalStyle }) || {};
|
|
@@ -43,33 +46,42 @@ export const executor = (element, animation, commonEffectTiming, context) => {
|
|
|
43
46
|
return { shape, fromStyle, toStyle };
|
|
44
47
|
}
|
|
45
48
|
};
|
|
46
|
-
let
|
|
47
|
-
const
|
|
49
|
+
let mainResult;
|
|
50
|
+
const subResults = animations
|
|
48
51
|
.map(({ fields, shape: shapeID, states: enabledStates, ...individualEffectTiming }) => {
|
|
49
52
|
if (enabledStates === undefined || enabledStates?.some((state) => states.includes(state))) {
|
|
50
|
-
const
|
|
51
|
-
if (!
|
|
53
|
+
const keyframeStyle = getKeyframeStyle(shapeID);
|
|
54
|
+
if (!keyframeStyle)
|
|
52
55
|
return null;
|
|
56
|
+
const { shape, fromStyle, toStyle } = keyframeStyle;
|
|
53
57
|
const keyframes = [{}, {}];
|
|
54
58
|
fields.forEach((attr) => {
|
|
55
59
|
Object.assign(keyframes[0], { [attr]: fromStyle[attr] ?? inferDefaultValue(attr) });
|
|
56
60
|
Object.assign(keyframes[1], { [attr]: toStyle[attr] ?? inferDefaultValue(attr) });
|
|
57
61
|
});
|
|
58
|
-
const
|
|
62
|
+
const translateAttrs = ['x', 'y', 'z'];
|
|
63
|
+
// x/y -> translate
|
|
64
|
+
if (keyframes.some((keyframe) => Object.keys(keyframe).some((attr) => translateAttrs.includes(attr)))) {
|
|
65
|
+
const { x = 0, y = 0, z = 0, transform = '' } = shape.attributes || {};
|
|
66
|
+
keyframes.forEach((keyframe) => {
|
|
67
|
+
keyframe.transform = replaceTranslateInTransform(keyframe.x || x, keyframe.y || y, keyframe.z || z, transform);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
const result = shape.animate(preprocessKeyframes(keyframes), {
|
|
59
71
|
...DEFAULT_ELEMENTS_ANIMATION_OPTIONS,
|
|
60
72
|
...commonEffectTiming,
|
|
61
73
|
...individualEffectTiming,
|
|
62
74
|
});
|
|
63
75
|
if (shapeID === undefined)
|
|
64
|
-
|
|
76
|
+
mainResult = result;
|
|
65
77
|
return result;
|
|
66
78
|
}
|
|
67
79
|
return null;
|
|
68
80
|
})
|
|
69
81
|
.filter(Boolean);
|
|
70
|
-
const
|
|
71
|
-
if (!
|
|
82
|
+
const result = mainResult || subResults?.[0];
|
|
83
|
+
if (!result)
|
|
72
84
|
return null;
|
|
73
|
-
return createAnimationsProxy(
|
|
85
|
+
return createAnimationsProxy(result, subResults.filter((result) => result !== result));
|
|
74
86
|
};
|
|
75
87
|
//# sourceMappingURL=executor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"src/","sources":["animations/executor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,kCAAkC,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,qBAAqB,EAAE,
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"src/","sources":["animations/executor.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { State } from '../types';
|
|
1
|
+
import type { IAnimation, IAnimationEffectTiming } from '@antv/g';
|
|
2
|
+
import type { Element, State } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* <zh/> 为 string 时,会从注册的动画中获取
|
|
5
5
|
*
|
|
@@ -10,7 +10,7 @@ export type STDAnimation = ConfigurableAnimationOptions[];
|
|
|
10
10
|
interface ConfigurableAnimationOptions extends AnimationEffectTiming {
|
|
11
11
|
fields: string[];
|
|
12
12
|
shape?: string;
|
|
13
|
-
states?:
|
|
13
|
+
states?: State[];
|
|
14
14
|
}
|
|
15
15
|
export interface AnimationContext {
|
|
16
16
|
/**
|
|
@@ -51,5 +51,5 @@ export interface AnimationContext {
|
|
|
51
51
|
states: State[];
|
|
52
52
|
}
|
|
53
53
|
export type AnimationEffectTiming = Partial<Pick<IAnimationEffectTiming, 'duration' | 'delay' | 'easing' | 'iterations' | 'direction' | 'fill'>>;
|
|
54
|
-
export type AnimationExecutor = (shape:
|
|
54
|
+
export type AnimationExecutor = (shape: Element, animation: Animation | false, baseEffectTiming: AnimationEffectTiming, context: AnimationContext) => IAnimation | null;
|
|
55
55
|
export {};
|