@antv/g6 5.0.0-beta.35 → 5.0.0-beta.37
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 +17 -4
- 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 +24 -15
- 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/canvas.d.ts +2 -0
- 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 +4 -4
- 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 +17 -4
- package/esm/elements/nodes/html.js +9 -3
- 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 +24 -15
- 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/index.js +6 -4
- package/esm/registry/index.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/canvas.d.ts +2 -0
- package/esm/runtime/canvas.js +18 -2
- package/esm/runtime/canvas.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 +13 -17
- 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 +4 -4
- 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 +17 -4
- package/lib/elements/nodes/html.js +8 -2
- 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 +24 -15
- 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/index.js +6 -4
- package/lib/registry/index.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/canvas.d.ts +2 -0
- package/lib/runtime/canvas.js +18 -2
- package/lib/runtime/canvas.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 +12 -16
- 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 +4 -4
- 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 +24 -6
- 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 +25 -15
- 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/index.ts +4 -5
- package/src/registry/types.ts +2 -2
- package/src/runtime/behavior.ts +5 -1
- package/src/runtime/canvas.ts +21 -2
- package/src/runtime/data.ts +24 -27
- package/src/runtime/element.ts +37 -29
- package/src/runtime/graph.ts +18 -36
- 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 +4 -4
- 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
|
@@ -1,42 +1,59 @@
|
|
|
1
1
|
import type { DisplayObjectConfig, Group, PathStyleProps } from '@antv/g';
|
|
2
|
-
import type { CardinalPlacement,
|
|
2
|
+
import type { CardinalPlacement, Prefix } from '../../types';
|
|
3
3
|
import type { LabelStyleProps } from '../shapes';
|
|
4
4
|
import { BaseShape } from './base-shape';
|
|
5
|
-
interface ContourLabelStyleProps extends LabelStyleProps {
|
|
5
|
+
export interface ContourLabelStyleProps extends LabelStyleProps {
|
|
6
6
|
/**
|
|
7
|
-
* <zh/>
|
|
8
|
-
*
|
|
7
|
+
* <zh/> 标签位置
|
|
8
|
+
*
|
|
9
|
+
* <en/> Label position
|
|
10
|
+
* @defaultValue 'bottom'
|
|
9
11
|
*/
|
|
10
12
|
placement?: CardinalPlacement | 'center';
|
|
11
13
|
/**
|
|
12
|
-
* <zh/>
|
|
13
|
-
*
|
|
14
|
+
* <zh/> 标签是否贴合轮廓
|
|
15
|
+
*
|
|
16
|
+
* <en/> Whether the label is close to the contour
|
|
17
|
+
* @defaultValue true
|
|
14
18
|
*/
|
|
15
19
|
closeToPath?: boolean;
|
|
16
20
|
/**
|
|
17
|
-
* <zh/>
|
|
18
|
-
*
|
|
21
|
+
* <zh/> 标签是否跟随轮廓旋转,仅在 closeToPath 为 true 时生效
|
|
22
|
+
*
|
|
23
|
+
* <en/> Whether the label rotates with the contour. Only effective when closeToPath is true
|
|
24
|
+
* @defaultValue true
|
|
19
25
|
*/
|
|
20
26
|
autoRotate?: boolean;
|
|
21
27
|
/**
|
|
22
28
|
* <zh/> x 轴偏移量
|
|
29
|
+
*
|
|
23
30
|
* <en/> Label x-axis offset
|
|
31
|
+
* @defaultValue 0
|
|
24
32
|
*/
|
|
25
33
|
offsetX?: number;
|
|
26
34
|
/**
|
|
27
35
|
* <zh/> y 轴偏移量
|
|
36
|
+
*
|
|
28
37
|
* <en/> Label y-axis offset
|
|
38
|
+
* @defaultValue 0
|
|
29
39
|
*/
|
|
30
40
|
offsetY?: number;
|
|
31
41
|
/**
|
|
32
42
|
* <zh/> 文本的最大宽度,超出会自动省略
|
|
43
|
+
*
|
|
33
44
|
* <en/> The maximum width of the text, which will be automatically ellipsis if exceeded
|
|
34
45
|
*/
|
|
35
46
|
maxWidth?: number;
|
|
36
47
|
}
|
|
37
|
-
export
|
|
48
|
+
export interface ContourStyleProps extends PathStyleProps, Prefix<'label', ContourLabelStyleProps> {
|
|
49
|
+
/**
|
|
50
|
+
* <zh/> 是否显示标签
|
|
51
|
+
*
|
|
52
|
+
* <en/> Whether to display the label
|
|
53
|
+
* @defaultValue true
|
|
54
|
+
*/
|
|
38
55
|
label?: boolean;
|
|
39
|
-
}
|
|
56
|
+
}
|
|
40
57
|
type ParsedContourStyleProps = Required<ContourStyleProps>;
|
|
41
58
|
type ContourOptions = DisplayObjectConfig<ContourStyleProps>;
|
|
42
59
|
export declare class Contour extends BaseShape<ContourStyleProps> {
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { DisplayObjectConfig, Group, ImageStyleProps, TextStyleProps } from '@antv/g';
|
|
2
2
|
import type { BaseShapeStyleProps } from './base-shape';
|
|
3
3
|
import { BaseShape } from './base-shape';
|
|
4
|
-
export
|
|
4
|
+
export interface IconStyleProps extends BaseShapeStyleProps, Partial<TextStyleProps>, Omit<ImageStyleProps, 'z'> {
|
|
5
|
+
}
|
|
5
6
|
type IconOptions = DisplayObjectConfig<IconStyleProps>;
|
|
6
7
|
export declare class Icon extends BaseShape<IconStyleProps> {
|
|
7
8
|
constructor(options: IconOptions);
|
|
8
9
|
private isGImage;
|
|
9
10
|
protected getIconStyle(attributes?: IconStyleProps): IconStyleProps;
|
|
10
|
-
render(attributes?:
|
|
11
|
+
render(attributes?: IconStyleProps & import("@antv/g").BaseCustomElementStyleProps, container?: Group): void;
|
|
11
12
|
connectedCallback(): void;
|
|
12
13
|
}
|
|
13
14
|
export {};
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
import { DisplayObjectConfig, Group, RectStyleProps, TextStyleProps } from '@antv/g';
|
|
2
2
|
import type { Padding } from '../../types/padding';
|
|
3
|
-
import type {
|
|
4
|
-
import type { BaseShapeStyleProps } from './base-shape';
|
|
3
|
+
import type { Prefix } from '../../types/prefix';
|
|
5
4
|
import { BaseShape } from './base-shape';
|
|
6
|
-
export
|
|
5
|
+
export interface LabelStyleProps extends TextStyleProps, Prefix<'background', RectStyleProps> {
|
|
6
|
+
/**
|
|
7
|
+
* <zh/> 是否显示背景
|
|
8
|
+
*
|
|
9
|
+
* <en/> Whether to show background
|
|
10
|
+
*/
|
|
7
11
|
background?: boolean;
|
|
8
|
-
|
|
12
|
+
/**
|
|
13
|
+
* <zh/> 标签内边距
|
|
14
|
+
*
|
|
15
|
+
* <en/> Label padding
|
|
16
|
+
* @defaultValue 0
|
|
17
|
+
*/
|
|
9
18
|
padding?: Padding;
|
|
10
|
-
}
|
|
19
|
+
}
|
|
11
20
|
type ParsedLabelStyleProps = Required<LabelStyleProps>;
|
|
12
21
|
type LabelOptions = DisplayObjectConfig<LabelStyleProps>;
|
|
13
22
|
export declare class Label extends BaseShape<LabelStyleProps> {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { DisplayObjectConfig, PolygonStyleProps as GPolygonStyleProps, Group } from '@antv/g';
|
|
2
|
+
import type { Point } from '../../types';
|
|
3
|
+
import type { BaseNodeStyleProps } from '../nodes/base-node';
|
|
4
|
+
import { BaseNode } from '../nodes/base-node';
|
|
5
|
+
/**
|
|
6
|
+
* <zh/> 多边形节点样式配置项
|
|
7
|
+
*
|
|
8
|
+
* <en/> Polygon node style props
|
|
9
|
+
*/
|
|
10
|
+
export interface PolygonStyleProps extends BaseNodeStyleProps {
|
|
11
|
+
/**
|
|
12
|
+
* <zh/> 多边形的顶点坐标
|
|
13
|
+
*
|
|
14
|
+
* <en/> The vertex coordinates of the polygon
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
points?: ([number, number] | [number, number, number])[];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Abstract class for polygon nodes,i.e triangle, diamond, hexagon, etc.
|
|
21
|
+
*/
|
|
22
|
+
export declare abstract class Polygon<T extends PolygonStyleProps = PolygonStyleProps> extends BaseNode<T> {
|
|
23
|
+
constructor(options: DisplayObjectConfig<T>);
|
|
24
|
+
get parsedAttributes(): Required<T>;
|
|
25
|
+
protected drawKeyShape(attributes: Required<T>, container: Group): any;
|
|
26
|
+
protected getKeyStyle(attributes: Required<T>): GPolygonStyleProps;
|
|
27
|
+
protected abstract getPoints(attributes: Required<T>): Point[];
|
|
28
|
+
getIntersectPoint(point: Point): Point;
|
|
29
|
+
}
|
package/dist/lib/exports.d.ts
CHANGED
|
@@ -1,29 +1,39 @@
|
|
|
1
|
-
export { BaseBehavior, BrushSelect, ClickElement, CollapseExpand, CreateEdge, DragCanvas, DragElement, DragElementForce, FocusElement, HoverElement, LassoSelect, ZoomCanvas, } from './behaviors';
|
|
2
|
-
export { CanvasEvent, ComboEvent, CommonEvent, ContainerEvent, EdgeEvent, ExtensionCategory, GraphEvent, NodeEvent, } from './constants';
|
|
1
|
+
export { BaseBehavior, BrushSelect, ClickElement, CollapseExpand, CreateEdge, DragCanvas, DragElement, DragElementForce, FocusElement, HoverElement, LassoSelect, ScrollCanvas, ZoomCanvas, } from './behaviors';
|
|
2
|
+
export { CanvasEvent, ComboEvent, CommonEvent, ContainerEvent, EdgeEvent, ExtensionCategory, GraphEvent, HistoryEvent, NodeEvent, } from './constants';
|
|
3
3
|
export { BaseCombo, CircleCombo, RectCombo } from './elements/combos';
|
|
4
4
|
export { BaseEdge, Cubic, CubicHorizontal, CubicVertical, Line, Polyline, Quadratic } from './elements/edges';
|
|
5
5
|
export { BaseNode, Circle, Diamond, Donut, Ellipse, HTML, Hexagon, Image, Rect, Star, Triangle, } from './elements/nodes';
|
|
6
6
|
export { BaseShape } from './elements/shapes';
|
|
7
|
-
export { AntVDagreLayout, CircularLayout, ComboCombinedLayout, ConcentricLayout, D3Force3DLayout, D3ForceLayout, DagreLayout, ForceAtlas2Layout, ForceLayout, FruchtermanLayout, GridLayout, MDSLayout, RadialLayout, RandomLayout, compactBox, dendrogram, indented, mindmap, } from './layouts';
|
|
7
|
+
export { AntVDagreLayout, BaseLayout, CircularLayout, ComboCombinedLayout, ConcentricLayout, D3Force3DLayout, D3ForceLayout, DagreLayout, ForceAtlas2Layout, ForceLayout, FruchtermanLayout, GridLayout, MDSLayout, RadialLayout, RandomLayout, compactBox, dendrogram, indented, mindmap, } from './layouts';
|
|
8
8
|
export { BasePlugin, BubbleSets, CameraSetting, Contextmenu, GridLine, History, Hull, Legend, Timebar, Toolbar, Tooltip, Watermark, } from './plugins';
|
|
9
9
|
export { getExtension, getExtensions, register } from './registry';
|
|
10
10
|
export { Graph } from './runtime/graph';
|
|
11
11
|
export { BaseTransform } from './transforms';
|
|
12
12
|
export { idOf } from './utils/id';
|
|
13
|
+
export { invokeLayoutMethod } from './utils/layout';
|
|
13
14
|
export { omitStyleProps, subStyleProps } from './utils/prefix';
|
|
14
15
|
export { Shortcut } from './utils/shortcut';
|
|
15
16
|
export { parseSize } from './utils/size';
|
|
16
17
|
export { treeToGraphData } from './utils/tree';
|
|
17
18
|
export type { BaseStyleProps } from '@antv/g';
|
|
18
19
|
export type { AntVDagreLayoutOptions, CircularLayoutOptions, ComboCombinedLayoutOptions, ConcentricLayoutOptions, D3Force3DLayoutOptions, D3ForceLayoutOptions, DagreLayoutOptions, ForceAtlas2LayoutOptions, ForceLayoutOptions, FruchtermanLayoutOptions, GridLayoutOptions, MDSLayoutOptions, RadialLayoutOptions, RandomLayoutOptions, } from '@antv/layout';
|
|
19
|
-
export type {
|
|
20
|
+
export type { PathArray } from '@antv/util';
|
|
21
|
+
export type { AnimationContext, AnimationEffectTiming, AnimationExecutor } from './animations/types';
|
|
22
|
+
export type { BaseBehaviorOptions, BrushSelectOptions, ClickElementOptions, CollapseExpandOptions, CreateEdgeOptions, DragCanvasOptions, DragElementForceOptions, DragElementOptions, FocusElementOptions, HoverElementOptions, LassoSelectOptions, ScrollCanvasOptions, ZoomCanvasOptions, } from './behaviors';
|
|
20
23
|
export type { BaseComboStyleProps, CircleComboStyleProps, RectComboStyleProps } from './elements/combos';
|
|
21
24
|
export type { BaseEdgeStyleProps, CubicHorizontalStyleProps, CubicStyleProps, CubicVerticalStyleProps, LineStyleProps, PolylineStyleProps, QuadraticStyleProps, } from './elements/edges';
|
|
22
|
-
export type { BaseNodeStyleProps, CircleStyleProps, DiamondStyleProps, EllipseStyleProps, HTMLStyleProps, HexagonStyleProps, ImageStyleProps, RectStyleProps, StarStyleProps, TriangleStyleProps, } from './elements/nodes';
|
|
23
|
-
export type { BaseShapeStyleProps } from './elements/shapes';
|
|
25
|
+
export type { BaseNodeStyleProps, CircleStyleProps, DiamondStyleProps, DonutStyleProps, EllipseStyleProps, HTMLStyleProps, HexagonStyleProps, ImageStyleProps, RectStyleProps, StarStyleProps, TriangleStyleProps, } from './elements/nodes';
|
|
26
|
+
export type { BadgeStyleProps, BaseShapeStyleProps, IconStyleProps, LabelStyleProps, PolygonStyleProps, } from './elements/shapes';
|
|
27
|
+
export type { ContourLabelStyleProps, ContourStyleProps } from './elements/shapes/contour';
|
|
28
|
+
export type { AnimationOptions, BaseLayoutOptions, WebWorkerLayoutOptions } from './layouts/types';
|
|
29
|
+
export type { CategoricalPalette } from './palettes/types';
|
|
24
30
|
export type { BasePluginOptions, BubbleSetsOptions, CameraSettingOptions, ContextmenuOptions, GridLineOptions, HistoryOptions, HullOptions, LegendOptions, TimebarOptions, ToolbarOptions, TooltipOptions, WatermarkOptions, } from './plugins';
|
|
25
31
|
export type { RuntimeContext } from './runtime/types';
|
|
26
|
-
export type { BehaviorOptions, CanvasOptions, ComboData, ComboOptions, EdgeData, EdgeOptions, GraphData, GraphOptions,
|
|
32
|
+
export type { BehaviorOptions, CanvasOptions, ComboData, ComboOptions, EdgeData, EdgeOptions, GraphData, GraphOptions, NodeData, NodeOptions, PluginOptions, ThemeOptions, ViewportOptions, } from './spec';
|
|
33
|
+
export type { CustomBehaviorOption } from './spec/behavior';
|
|
34
|
+
export type { LayoutOptions, STDLayoutOptions, SingleLayoutOptions } from './spec/layout';
|
|
35
|
+
export type { CustomPluginOption } from './spec/plugin';
|
|
27
36
|
export type { BaseTransformOptions } from './transforms';
|
|
28
|
-
export type { CardinalPlacement, Combo, CornerPlacement, DirectionalPlacement, Edge, Element, ElementType, IAnimateEvent, ID, IDragEvent, IElementLifeCycleEvent, IEvent, IGraphLifeCycleEvent, IKeyboardEvent, IPointerEvent, IViewportEvent, IWheelEvent, Node, Placement, Point, RelativePlacement, State, Vector2, Vector3, ViewportAnimationEffectTiming, } from './types';
|
|
37
|
+
export type { BaseElementStyleProps, CallableValue, CardinalPlacement, CollapsedMarkerStyleProps, Combo, CornerPlacement, DirectionalPlacement, Edge, EdgeArrowStyleProps, EdgeLabelStyleProps, Element, ElementDatum, ElementType, FitViewOptions, IAnimateEvent, ID, IDragEvent, IElementDragEvent, IElementEvent, IElementLifeCycleEvent, IEvent, IGraphLifeCycleEvent, IKeyboardEvent, IPointerEvent, IViewportEvent, IWheelEvent, LoopPlacement, LoopStyleProps, Node, NodeBadgeStyleProps, NodeLabelStyleProps, NodeLikeData, NodePortStyleProps, Padding, Placement, Point, PortStyleProps, Prefix, PrefixKey, RelativePlacement, Size, State, TransformOptions, TriangleDirection, Vector2, Vector3, ViewportAnimationEffectTiming, } from './types';
|
|
38
|
+
export type { Command, CommandData } from './types/history';
|
|
29
39
|
export type { ShortcutKey } from './utils/shortcut';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { GraphData } from '../spec';
|
|
2
|
+
import type { BaseLayoutOptions } from './types';
|
|
3
|
+
export declare abstract class BaseLayout<O extends BaseLayoutOptions = any> {
|
|
4
|
+
abstract id: string;
|
|
5
|
+
options: O;
|
|
6
|
+
constructor(options?: O);
|
|
7
|
+
stop?: () => void;
|
|
8
|
+
tick?: (iterations?: number) => GraphData;
|
|
9
|
+
abstract execute(model: GraphData, options?: O): Promise<GraphData>;
|
|
10
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
/// <reference types="src/layouts/hierarchy" />
|
|
2
2
|
export { compactBox, dendrogram, indented, mindmap } from '@antv/hierarchy';
|
|
3
3
|
export { AntVDagreLayout, CircularLayout, ComboCombinedLayout, ConcentricLayout, D3Force3DLayout, D3ForceLayout, DagreLayout, ForceAtlas2Layout, ForceLayout, FruchtermanLayout, GridLayout, MDSLayout, RadialLayout, RandomLayout, } from '@antv/layout';
|
|
4
|
+
export { BaseLayout } from './base-layout';
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import type { AntVDagreLayoutOptions, CircularLayoutOptions, ConcentricLayoutOptions, D3Force3DLayoutOptions, D3ForceLayoutOptions, DagreLayoutOptions, ForceAtlas2LayoutOptions, ForceLayoutOptions, FruchtermanLayoutOptions, GridLayoutOptions, MDSLayoutOptions, RadialLayoutOptions, RandomLayoutOptions } from '@antv/layout';
|
|
1
|
+
import type { AntVDagreLayoutOptions, LayoutWithIterations as AntVIterativeLayout, Layout as AntVNonIterativeLayout, CircularLayoutOptions, ConcentricLayoutOptions, D3Force3DLayoutOptions, D3ForceLayoutOptions, DagreLayoutOptions, ForceAtlas2LayoutOptions, ForceLayoutOptions, FruchtermanLayoutOptions, GridLayoutOptions, MDSLayoutOptions, RadialLayoutOptions, RandomLayoutOptions } from '@antv/layout';
|
|
2
2
|
import type { NodeData } from '../spec/data';
|
|
3
|
+
import type { BaseLayout } from './base-layout';
|
|
3
4
|
export type BuiltInLayoutOptions = AntVDagreLayout | CircularLayout | ConcentricLayout | D3ForceLayout | D3Force3DLayout | DagreLayout | ForceAtlas2 | ForceLayout | FruchtermanLayout | GridLayout | MDSLayout | RadialLayout | RandomLayout;
|
|
4
|
-
export interface BaseLayoutOptions extends AnimationOptions, WebWorkerLayoutOptions {
|
|
5
|
+
export interface BaseLayoutOptions extends AnimationOptions, WebWorkerLayoutOptions, Record<string, any> {
|
|
6
|
+
/**
|
|
7
|
+
* <zh/> 布局类型
|
|
8
|
+
*
|
|
9
|
+
* <en/> Layout type
|
|
10
|
+
*/
|
|
5
11
|
type: string;
|
|
6
12
|
/**
|
|
7
13
|
* <zh/> 参与该布局的节点
|
|
@@ -10,8 +16,7 @@ export interface BaseLayoutOptions extends AnimationOptions, WebWorkerLayoutOpti
|
|
|
10
16
|
* @param node - <zh/> 节点数据 | <en/> node data
|
|
11
17
|
* @returns <zh/> 是否参与布局 | <en/> Whether to participate in the layout
|
|
12
18
|
*/
|
|
13
|
-
|
|
14
|
-
[key: string]: any;
|
|
19
|
+
nodeFilter?: (node: NodeData) => boolean;
|
|
15
20
|
}
|
|
16
21
|
interface CircularLayout extends BaseLayoutOptions, CircularLayoutOptions {
|
|
17
22
|
type: 'circular';
|
|
@@ -74,4 +79,6 @@ export interface WebWorkerLayoutOptions {
|
|
|
74
79
|
*/
|
|
75
80
|
iterations?: number;
|
|
76
81
|
}
|
|
82
|
+
export type AntVLayout = AntVNonIterativeLayout<any> | AntVIterativeLayout<any>;
|
|
83
|
+
export type Layout = BaseLayout | AntVLayout;
|
|
77
84
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseExtension } from '../registry/extension';
|
|
2
2
|
import type { CustomPluginOption } from '../spec/plugin';
|
|
3
|
-
export
|
|
3
|
+
export interface BasePluginOptions extends CustomPluginOption {
|
|
4
|
+
}
|
|
4
5
|
export declare abstract class BasePlugin<T extends BasePluginOptions> extends BaseExtension<T> {
|
|
5
6
|
}
|
|
@@ -4,6 +4,11 @@ import type { RuntimeContext } from '../runtime/types';
|
|
|
4
4
|
import type { CallableValue, ID } from '../types';
|
|
5
5
|
import type { BasePluginOptions } from './base-plugin';
|
|
6
6
|
import { BasePlugin } from './base-plugin';
|
|
7
|
+
/**
|
|
8
|
+
* <zh/> 气泡集配置项
|
|
9
|
+
*
|
|
10
|
+
* <en/> BubbleSets options
|
|
11
|
+
*/
|
|
7
12
|
export interface BubbleSetsOptions extends BasePluginOptions, IBubbleSetOptions, ContourStyleProps {
|
|
8
13
|
/**
|
|
9
14
|
* <zh/> 成员元素,包括节点和边
|
|
@@ -18,6 +23,19 @@ export interface BubbleSetsOptions extends BasePluginOptions, IBubbleSetOptions,
|
|
|
18
23
|
*/
|
|
19
24
|
avoidMembers?: ID[];
|
|
20
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* <zh/> 气泡集
|
|
28
|
+
*
|
|
29
|
+
* <en/> BubbleSets
|
|
30
|
+
* @remarks
|
|
31
|
+
* <zh/> BubbleSets 最初由 Christopher Collins 在 2009 年的论文 "Bubble Sets: Revealing Set Relations with Isocontours over Existing Visualizations" 中提出。
|
|
32
|
+
*
|
|
33
|
+
* <zh/> 实现原理是通过创建一种类似于气泡的形状来表示集合。每个集合都被表示为一个独特的 "气泡",集合中的元素被包含在这个气泡内部。如果两个集合有交集,那么这两个气泡会有重叠的部分,这个重叠的部分就表示这两个集合的交集。
|
|
34
|
+
*
|
|
35
|
+
* <en/> BubbleSets was originally proposed by Christopher Collins in the 2009 paper "Bubble Sets: Revealing Set Relations with Isocontours over Existing Visualizations".
|
|
36
|
+
*
|
|
37
|
+
* <en/> The principle is to represent sets by creating a shape similar to a bubble. Each set is represented by a unique "bubble", and the elements in the set are contained within this bubble. If two sets have an intersection, then the two bubbles will have an overlapping part, which represents the intersection of the two sets.
|
|
38
|
+
*/
|
|
21
39
|
export declare class BubbleSets extends BasePlugin<BubbleSetsOptions> {
|
|
22
40
|
private shape;
|
|
23
41
|
private bubbleSets;
|
|
@@ -33,13 +51,66 @@ export declare class BubbleSets extends BasePlugin<BubbleSetsOptions> {
|
|
|
33
51
|
private drawBubbleSets;
|
|
34
52
|
private updateBubbleSetsPath;
|
|
35
53
|
private getPath;
|
|
54
|
+
/**
|
|
55
|
+
* <zh/> 添加成员元素
|
|
56
|
+
*
|
|
57
|
+
* <en/> Add member elements
|
|
58
|
+
* @param members - <zh/> 单个或多个 | <en/> single or multiple
|
|
59
|
+
*/
|
|
36
60
|
addMember(members: ID | ID[]): void;
|
|
61
|
+
/**
|
|
62
|
+
* <zh/> 移除成员元素
|
|
63
|
+
*
|
|
64
|
+
* <en/> Remove member elements
|
|
65
|
+
* @param members - <zh/> 单个或多个 | <en/> single or multiple
|
|
66
|
+
*/
|
|
37
67
|
removeMember(members: ID | ID[]): void;
|
|
68
|
+
/**
|
|
69
|
+
* <zh/> 更新成员元素
|
|
70
|
+
*
|
|
71
|
+
* <en/> Update member elements
|
|
72
|
+
* @param members - <zh/> 值或者回调函数 | <en/> value or callback function
|
|
73
|
+
*/
|
|
38
74
|
updateMember(members: CallableValue<ID[]>): void;
|
|
75
|
+
/**
|
|
76
|
+
* <zh/> 获取成员元素
|
|
77
|
+
*
|
|
78
|
+
* <en/> Get member elements
|
|
79
|
+
* @returns <zh/> 成员元素数组 | <en/> member elements array
|
|
80
|
+
*/
|
|
39
81
|
getMember(): string[];
|
|
82
|
+
/**
|
|
83
|
+
* <zh/> 添加需要避开的元素
|
|
84
|
+
*
|
|
85
|
+
* <en/> Add elements to avoid
|
|
86
|
+
* @param avoidMembers - <zh/> 单个或多个 | <en/> single or multiple
|
|
87
|
+
*/
|
|
40
88
|
addAvoidMember(avoidMembers: ID | ID[]): void;
|
|
89
|
+
/**
|
|
90
|
+
* <zh/> 移除需要避开的元素
|
|
91
|
+
*
|
|
92
|
+
* <en/> Remove elements to avoid
|
|
93
|
+
* @param avoidMembers - <zh/> 单个或多个 | <en/> single or multiple
|
|
94
|
+
*/
|
|
41
95
|
removeAvoidMember(avoidMembers: ID | ID[]): void;
|
|
96
|
+
/**
|
|
97
|
+
* <zh/> 更新需要避开的元素
|
|
98
|
+
*
|
|
99
|
+
* <en/> Update elements to avoid
|
|
100
|
+
* @param avoidMembers - <zh/> 单个或多个 | <en/> single or multiple
|
|
101
|
+
*/
|
|
42
102
|
updateAvoidMember(avoidMembers: ID | ID[]): void;
|
|
103
|
+
/**
|
|
104
|
+
* <zh/> 获取需要避开的元素
|
|
105
|
+
*
|
|
106
|
+
* <en/> Get elements to avoid
|
|
107
|
+
* @returns avoidMembers <zh/> 成员元素数组 | <en/> member elements array
|
|
108
|
+
*/
|
|
43
109
|
getAvoidMember(): string[];
|
|
110
|
+
/**
|
|
111
|
+
* <zh/> 销毁
|
|
112
|
+
*
|
|
113
|
+
* <en/> Destroy
|
|
114
|
+
*/
|
|
44
115
|
destroy(): void;
|
|
45
116
|
}
|
|
@@ -4,20 +4,24 @@ import { BasePlugin } from './base-plugin';
|
|
|
4
4
|
export interface CameraSettingOptions extends BasePluginOptions {
|
|
5
5
|
/**
|
|
6
6
|
* <zh/> 投影模式,透视投影仅在 3D 场景下有效
|
|
7
|
+
* - `'perspective'` : 透视投影
|
|
8
|
+
* - `'orthographic'` : 正交投影
|
|
7
9
|
*
|
|
8
10
|
* <en/> Projection mode, perspective projection is only valid in 3D scenes
|
|
11
|
+
* - `'perspective'` : perspective projection
|
|
12
|
+
* - `'orthographic'` : Orthogonal projection
|
|
9
13
|
*/
|
|
10
14
|
projectionMode?: 'perspective' | 'orthographic';
|
|
11
15
|
/**
|
|
12
16
|
* <zh/> 相机类型
|
|
13
|
-
* - orbiting
|
|
14
|
-
* - exploring
|
|
15
|
-
* - tracking
|
|
17
|
+
* - `'orbiting'`: 固定视点,改变相机位置
|
|
18
|
+
* - `'exploring'`: 类似 orbiting,但允许相机在北极和南极之间旋转
|
|
19
|
+
* - `'tracking'`: 固定相机位置,改变视点
|
|
16
20
|
*
|
|
17
21
|
* <en/> Camera type
|
|
18
|
-
* - orbiting
|
|
19
|
-
* - exploring
|
|
20
|
-
* - tracking
|
|
22
|
+
* - `'orbiting'`: Fixed viewpoint, change camera position
|
|
23
|
+
* - `'exploring'`: Similar to orbiting, but allows the camera to rotate between the North Pole and the South Pole
|
|
24
|
+
* - `'tracking'`: Fixed camera position, change viewpoint
|
|
21
25
|
*/
|
|
22
26
|
cameraType?: 'orbiting' | 'exploring' | 'tracking';
|
|
23
27
|
/**
|
|
@@ -40,16 +44,19 @@ export interface CameraSettingOptions extends BasePluginOptions {
|
|
|
40
44
|
fov?: number;
|
|
41
45
|
/**
|
|
42
46
|
* <zh/> 相机视口宽高比,仅在透视相机下有效
|
|
43
|
-
* -
|
|
47
|
+
* - number : 具体的宽高比
|
|
48
|
+
* - `'auto'` : 自动设置为画布的宽高比
|
|
44
49
|
*
|
|
45
50
|
* <en/> Camera viewport aspect ratio, only valid in perspective camera.
|
|
46
|
-
* -
|
|
51
|
+
* - number : Specific aspect ratio
|
|
52
|
+
* - `'auto'` : Automatically set to the aspect ratio of the canvas
|
|
47
53
|
*/
|
|
48
54
|
aspect?: number | 'auto';
|
|
49
55
|
/**
|
|
50
|
-
* <zh/>
|
|
56
|
+
* <zh/> 相机距离目标的距离
|
|
51
57
|
*
|
|
52
|
-
* <en/> The distance from the camera to the target
|
|
58
|
+
* <en/> The distance from the camera to the target
|
|
59
|
+
* @defaultValue 500
|
|
53
60
|
*/
|
|
54
61
|
distance?: number;
|
|
55
62
|
/**
|
|
@@ -90,6 +97,13 @@ export interface CameraSettingOptions extends BasePluginOptions {
|
|
|
90
97
|
*/
|
|
91
98
|
export declare class CameraSetting extends BasePlugin<CameraSettingOptions> {
|
|
92
99
|
constructor(context: RuntimeContext, options: CameraSettingOptions);
|
|
100
|
+
/**
|
|
101
|
+
* <zh/> 更新相机参数
|
|
102
|
+
*
|
|
103
|
+
* <en/> Update camera parameters
|
|
104
|
+
* @param options - <zh/> 相机配置项 | <en/> Camera configuration options
|
|
105
|
+
* @internal
|
|
106
|
+
*/
|
|
93
107
|
update(options: Partial<CameraSettingOptions>): void;
|
|
94
108
|
private bindEvents;
|
|
95
109
|
private setOptions;
|
|
@@ -1,85 +1,110 @@
|
|
|
1
1
|
import type { RuntimeContext } from '../runtime/types';
|
|
2
|
-
import type {
|
|
3
|
-
import type { IPointerEvent } from '../types/event';
|
|
2
|
+
import type { IElementEvent } from '../types/event';
|
|
4
3
|
import type { Item } from '../utils/contextmenu';
|
|
5
4
|
import type { BasePluginOptions } from './base-plugin';
|
|
6
5
|
import { BasePlugin } from './base-plugin';
|
|
7
6
|
/**
|
|
8
|
-
* <zh/>
|
|
9
|
-
*
|
|
7
|
+
* <zh/> 上下文菜单配置项
|
|
8
|
+
*
|
|
9
|
+
* <en/> Contextmenu options
|
|
10
10
|
*/
|
|
11
|
-
export
|
|
11
|
+
export interface ContextmenuOptions extends BasePluginOptions {
|
|
12
12
|
/**
|
|
13
|
-
* <zh/> 给菜单的 DOM 追加的 classname,便于自定义样式。默认是包含 `g6-contextmenu
|
|
14
|
-
*
|
|
13
|
+
* <zh/> 给菜单的 DOM 追加的 classname,便于自定义样式。默认是包含 `g6-contextmenu`
|
|
14
|
+
*
|
|
15
|
+
* <en/> The classname appended to the menu DOM for custom styles. The default is `g6-contextmenu`
|
|
16
|
+
* @defaultValue 'g6-contextmenu'
|
|
15
17
|
*/
|
|
16
18
|
className?: string;
|
|
17
19
|
/**
|
|
18
|
-
* <zh/>
|
|
19
|
-
*
|
|
20
|
+
* <zh/> 如何触发右键菜单
|
|
21
|
+
* - `'click'` : 点击触发
|
|
22
|
+
* - `'contextmenu'` : 右键触发
|
|
23
|
+
*
|
|
24
|
+
* <en/> How to trigger the context menu
|
|
25
|
+
* - `'click'` : Click trigger
|
|
26
|
+
* - `'contextmenu'` : Right-click trigger
|
|
27
|
+
* @defaultValue 'contextmenu'
|
|
20
28
|
*/
|
|
21
29
|
trigger?: 'click' | 'contextmenu';
|
|
22
30
|
/**
|
|
23
|
-
* <zh/> 菜单显式 X、Y
|
|
24
|
-
*
|
|
31
|
+
* <zh/> 菜单显式 X、Y 方向的偏移量
|
|
32
|
+
*
|
|
33
|
+
* <en/> The offset X, y direction of the menu
|
|
34
|
+
* @defaultValue [4, 4]
|
|
25
35
|
*/
|
|
26
36
|
offset?: [number, number];
|
|
27
37
|
/**
|
|
28
|
-
* <zh/>
|
|
29
|
-
*
|
|
38
|
+
* <zh/> 当菜单被点击后,触发的回调方法
|
|
39
|
+
*
|
|
40
|
+
* <en/> The callback method triggered when the menu is clicked
|
|
30
41
|
*/
|
|
31
42
|
onClick?: (v: string, target: HTMLElement) => void;
|
|
32
43
|
/**
|
|
33
|
-
* <zh/> 返回菜单的项目列表,支持 `Promise` 类型的返回值。是 `getContent`
|
|
34
|
-
*
|
|
44
|
+
* <zh/> 返回菜单的项目列表,支持 `Promise` 类型的返回值。是 `getContent` 的快捷配置
|
|
45
|
+
*
|
|
46
|
+
* <en/> Return the list of menu items, support the `Promise` type return value. It is a shortcut configuration of `getContent`
|
|
35
47
|
*/
|
|
36
48
|
getItems?: (event: IElementEvent) => Item[] | Promise<Item[]>;
|
|
37
49
|
/**
|
|
38
|
-
* <zh/> 返回菜单的内容,支持 `Promise` 类型的返回值,也可以使用 `getItems`
|
|
39
|
-
*
|
|
50
|
+
* <zh/> 返回菜单的内容,支持 `Promise` 类型的返回值,也可以使用 `getItems` 进行快捷配置
|
|
51
|
+
*
|
|
52
|
+
* <en/> Return the content of menu, support the `Promise` type return value, you can also use `getItems` for shortcut configuration
|
|
40
53
|
*/
|
|
41
54
|
getContent?: (event: IElementEvent) => HTMLElement | string | Promise<HTMLElement | string>;
|
|
42
55
|
/**
|
|
43
|
-
* <zh/>
|
|
44
|
-
*
|
|
56
|
+
* <zh/> 当 `getContent` 返回一个 `Promise` 时,使用的菜单内容
|
|
57
|
+
*
|
|
58
|
+
* <en/> The menu content when loading is used when getContent returns a Promise
|
|
45
59
|
*/
|
|
46
|
-
loadingContent
|
|
60
|
+
loadingContent?: HTMLElement | string;
|
|
47
61
|
/**
|
|
48
|
-
* <zh/>
|
|
49
|
-
*
|
|
62
|
+
* <zh/> 是否可用,通过参数判断是否支持右键菜单,默认是全部可用
|
|
63
|
+
*
|
|
64
|
+
* <en/> Whether the plugin is available, determine whether the right-click menu is supported through parameters, The default is all available
|
|
65
|
+
* @defaultValue true
|
|
50
66
|
*/
|
|
51
67
|
enable?: boolean | ((event: IElementEvent) => boolean);
|
|
52
|
-
}
|
|
68
|
+
}
|
|
53
69
|
/**
|
|
54
|
-
* <zh/>
|
|
70
|
+
* <zh/> 上下文菜单
|
|
71
|
+
*
|
|
72
|
+
* <en/> Contextmenu
|
|
73
|
+
* @remarks
|
|
74
|
+
* <zh/> 上下文菜单,也被称为右键菜单,是当用户在某个特定区域上点击后出现的一个菜单。支持在点击前后,触发自定义事件。
|
|
55
75
|
*
|
|
56
|
-
* <en/>
|
|
57
|
-
* After clicking the menu, you can trigger the corresponding event.
|
|
76
|
+
* <en/> Contextmenu, also known as the right-click menu , is a menu that appears when a user clicks on a specific area. Supports triggering custom events before and after clicking.
|
|
58
77
|
*/
|
|
59
78
|
export declare class Contextmenu extends BasePlugin<ContextmenuOptions> {
|
|
60
79
|
static defaultOptions: Partial<ContextmenuOptions>;
|
|
61
80
|
private $element;
|
|
62
81
|
constructor(context: RuntimeContext, options: ContextmenuOptions);
|
|
63
82
|
/**
|
|
64
|
-
* <zh/>
|
|
65
|
-
*
|
|
66
|
-
*
|
|
83
|
+
* <zh/> 显示上下文菜单
|
|
84
|
+
*
|
|
85
|
+
* <en/> Show the contextmenu
|
|
86
|
+
* @param event - <zh/> 元素指针事件 | <en/> Element pointer event
|
|
87
|
+
* @internal
|
|
67
88
|
*/
|
|
68
|
-
|
|
89
|
+
show(event: IElementEvent): Promise<void>;
|
|
69
90
|
/**
|
|
70
|
-
* <zh/>
|
|
71
|
-
*
|
|
91
|
+
* <zh/> 隐藏上下文菜单
|
|
92
|
+
*
|
|
93
|
+
* <en/> Hide the contextmenu
|
|
72
94
|
*/
|
|
73
|
-
|
|
95
|
+
hide(): void;
|
|
74
96
|
/**
|
|
75
|
-
* <zh/>
|
|
76
|
-
*
|
|
77
|
-
*
|
|
97
|
+
* <zh/> 更新上下文菜单的配置项
|
|
98
|
+
*
|
|
99
|
+
* <en/> Update the contextmenu options
|
|
100
|
+
* @param options - <zh/> 配置项 | <en/> Options
|
|
101
|
+
* @internal
|
|
78
102
|
*/
|
|
79
103
|
update(options: Partial<ContextmenuOptions>): void;
|
|
80
104
|
/**
|
|
81
|
-
* <zh/>
|
|
82
|
-
*
|
|
105
|
+
* <zh/> 销毁上下文菜单
|
|
106
|
+
*
|
|
107
|
+
* <en/> Destroy the contextmenu
|
|
83
108
|
*/
|
|
84
109
|
destroy(): void;
|
|
85
110
|
private getDOMContent;
|
|
@@ -88,5 +113,3 @@ export declare class Contextmenu extends BasePlugin<ContextmenuOptions> {
|
|
|
88
113
|
private onTriggerEvent;
|
|
89
114
|
private onMenuItemClick;
|
|
90
115
|
}
|
|
91
|
-
type IElementEvent = IPointerEvent<Element>;
|
|
92
|
-
export {};
|