@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
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { RuntimeContext } from '../runtime/types';
|
|
2
|
-
import
|
|
3
|
-
|
|
2
|
+
import { BasePlugin, BasePluginOptions } from './base-plugin';
|
|
3
|
+
/**
|
|
4
|
+
* <zh/> 网格线配置项
|
|
5
|
+
*
|
|
6
|
+
* <en/> Grid line options
|
|
7
|
+
*/
|
|
4
8
|
export interface GridLineOptions extends BasePluginOptions {
|
|
5
9
|
/**
|
|
6
10
|
* <zh/> 网格线颜色
|
|
@@ -42,6 +46,10 @@ export interface GridLineOptions extends BasePluginOptions {
|
|
|
42
46
|
*
|
|
43
47
|
* <en/> Border color
|
|
44
48
|
* @defaultValue '#0001'
|
|
49
|
+
* @remarks
|
|
50
|
+
* <zh/> 完整属性定义参考 [CSS border-color](https://developer.mozilla.org/zh-CN/docs/Web/CSS/border-color)
|
|
51
|
+
*
|
|
52
|
+
* <en/> Refer to [CSS border-color](https://developer.mozilla.org/en-US/docs/Web/CSS/border-color) for the complete property definition
|
|
45
53
|
*/
|
|
46
54
|
borderStroke?: string;
|
|
47
55
|
/**
|
|
@@ -49,6 +57,10 @@ export interface GridLineOptions extends BasePluginOptions {
|
|
|
49
57
|
*
|
|
50
58
|
* <en/> Border style
|
|
51
59
|
* @defaultValue 'solid'
|
|
60
|
+
* @remarks
|
|
61
|
+
* <zh/> 完整属性定义参考 [CSS border-style](https://developer.mozilla.org/zh-CN/docs/Web/CSS/border-style)
|
|
62
|
+
*
|
|
63
|
+
* <en/> Refer to [CSS border-style](https://developer.mozilla.org/en-US/docs/Web/CSS/border-style) for the complete property definition
|
|
52
64
|
*/
|
|
53
65
|
borderStyle?: string;
|
|
54
66
|
/**
|
|
@@ -59,15 +71,36 @@ export interface GridLineOptions extends BasePluginOptions {
|
|
|
59
71
|
*/
|
|
60
72
|
follow?: boolean;
|
|
61
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* <zh/> 网格线
|
|
76
|
+
*
|
|
77
|
+
* <en/> Grid line
|
|
78
|
+
* @remarks
|
|
79
|
+
* <zh/> 网格线插件,多用于辅助绘图
|
|
80
|
+
*
|
|
81
|
+
* <en/> Grid line plugin, often used to auxiliary drawing
|
|
82
|
+
*/
|
|
62
83
|
export declare class GridLine extends BasePlugin<GridLineOptions> {
|
|
63
84
|
static defaultOptions: Partial<GridLineOptions>;
|
|
64
85
|
private $element;
|
|
65
86
|
private offset;
|
|
66
87
|
constructor(context: RuntimeContext, options: GridLineOptions);
|
|
88
|
+
/**
|
|
89
|
+
* <zh/> 更新网格线配置
|
|
90
|
+
*
|
|
91
|
+
* <en/> Update the configuration of the grid line
|
|
92
|
+
* @param options - <zh/> 配置项 | <en/> options
|
|
93
|
+
* @internal
|
|
94
|
+
*/
|
|
67
95
|
update(options: Partial<GridLineOptions>): void;
|
|
68
96
|
private bindEvents;
|
|
69
97
|
private updateStyle;
|
|
70
98
|
private updateOffset;
|
|
71
99
|
private onTransform;
|
|
100
|
+
/**
|
|
101
|
+
* <zh/> 销毁网格线
|
|
102
|
+
*
|
|
103
|
+
* <en/> Destroy the grid line
|
|
104
|
+
*/
|
|
72
105
|
destroy(): void;
|
|
73
106
|
}
|
|
@@ -1,11 +1,20 @@
|
|
|
1
|
+
import { HistoryEvent } from '../../constants/events/history';
|
|
1
2
|
import type { RuntimeContext } from '../../runtime/types';
|
|
3
|
+
import { Loosen } from '../../types';
|
|
4
|
+
import type { Command } from '../../types/history';
|
|
2
5
|
import type { BasePluginOptions } from '../base-plugin';
|
|
3
6
|
import { BasePlugin } from '../base-plugin';
|
|
4
|
-
|
|
5
|
-
|
|
7
|
+
/**
|
|
8
|
+
* <zh/> 历史记录配置项
|
|
9
|
+
*
|
|
10
|
+
* <en/> History options
|
|
11
|
+
*/
|
|
6
12
|
export interface HistoryOptions extends BasePluginOptions {
|
|
7
13
|
/**
|
|
8
|
-
* <zh/>
|
|
14
|
+
* <zh/> 最多记录该数据长度的历史记录
|
|
15
|
+
*
|
|
16
|
+
* <en/> The maximum number of history records
|
|
17
|
+
* @defaultValue 0(不做限制)
|
|
9
18
|
*/
|
|
10
19
|
stackSize?: number;
|
|
11
20
|
/**
|
|
@@ -27,6 +36,15 @@ export interface HistoryOptions extends BasePluginOptions {
|
|
|
27
36
|
*/
|
|
28
37
|
executeCommand?: (cmd: Command) => void;
|
|
29
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* <zh/> 历史记录
|
|
41
|
+
*
|
|
42
|
+
* <en/> History
|
|
43
|
+
* @remarks
|
|
44
|
+
* <zh/> 历史记录用于记录图的数据变化,支持撤销和重做等操作。
|
|
45
|
+
*
|
|
46
|
+
* <en/> History is used to record data changes in the graph and supports operations such as undo and redo.
|
|
47
|
+
*/
|
|
30
48
|
export declare class History extends BasePlugin<HistoryOptions> {
|
|
31
49
|
static defaultOptions: Partial<HistoryOptions>;
|
|
32
50
|
private emitter;
|
|
@@ -39,44 +57,64 @@ export declare class History extends BasePlugin<HistoryOptions> {
|
|
|
39
57
|
constructor(context: RuntimeContext, options: HistoryOptions);
|
|
40
58
|
/**
|
|
41
59
|
* <zh/> 是否可以执行撤销操作
|
|
60
|
+
*
|
|
42
61
|
* <en/> Whether undo can be done
|
|
43
62
|
* @returns <zh/> 是否可以执行撤销操作 | <en/> Whether undo can be done
|
|
44
63
|
*/
|
|
45
|
-
canUndo
|
|
64
|
+
canUndo(): boolean;
|
|
46
65
|
/**
|
|
47
66
|
* <zh/> 是否可以执行重做操作
|
|
67
|
+
*
|
|
48
68
|
* <en/> Whether redo can be done
|
|
49
69
|
* @returns <zh/> 是否可以执行重做操作 | <en/> Whether redo can be done
|
|
50
70
|
*/
|
|
51
|
-
canRedo
|
|
71
|
+
canRedo(): boolean;
|
|
52
72
|
/**
|
|
53
73
|
* <zh/> 执行撤销
|
|
74
|
+
*
|
|
54
75
|
* <en/> Execute undo
|
|
55
76
|
* @returns <zh/> 返回当前实例 | <en/> Return the current instance
|
|
56
77
|
*/
|
|
57
|
-
undo
|
|
78
|
+
undo(): this;
|
|
58
79
|
/**
|
|
59
80
|
* <zh/> 执行重做
|
|
81
|
+
*
|
|
60
82
|
* <en/> Execute redo
|
|
61
83
|
* @returns <zh/> 返回当前实例 | <en/> Return the current instance
|
|
62
84
|
*/
|
|
63
|
-
redo
|
|
85
|
+
redo(): this;
|
|
64
86
|
/**
|
|
65
87
|
* <zh/> 执行撤销且不计入历史记录
|
|
88
|
+
*
|
|
66
89
|
* <en/> Execute undo and do not record in history
|
|
67
90
|
* @returns <zh/> 返回当前实例 | <en/> Return the current instance
|
|
68
91
|
*/
|
|
69
|
-
undoAndCancel
|
|
92
|
+
undoAndCancel(): this;
|
|
70
93
|
private executeCommand;
|
|
71
94
|
private addCommand;
|
|
72
95
|
private initBatchCommand;
|
|
73
96
|
private undoStackPush;
|
|
74
97
|
/**
|
|
75
98
|
* <zh/> 清空历史记录
|
|
99
|
+
*
|
|
76
100
|
* <en/> Clear history
|
|
77
101
|
*/
|
|
78
102
|
clear(): void;
|
|
79
|
-
|
|
80
|
-
|
|
103
|
+
private notify;
|
|
104
|
+
/**
|
|
105
|
+
* <zh/> 监听历史记录事件
|
|
106
|
+
*
|
|
107
|
+
* <en/> Listen to history events
|
|
108
|
+
* @param event - <zh/> 事件名称 | <en/> Event name
|
|
109
|
+
* @param handler - <zh/> 事件处理函数 | <en/> Event handler
|
|
110
|
+
*/
|
|
111
|
+
on(event: Loosen<HistoryEvent>, handler: (e: {
|
|
112
|
+
cmd?: Command | null;
|
|
113
|
+
}) => void): void;
|
|
114
|
+
/**
|
|
115
|
+
* <zh/> 销毁
|
|
116
|
+
*
|
|
117
|
+
* <en/> Destroy
|
|
118
|
+
*/
|
|
81
119
|
destroy(): void;
|
|
82
120
|
}
|
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
import type { RuntimeContext } from '../../runtime/types';
|
|
2
|
-
import type { GraphData } from '../../spec';
|
|
3
2
|
import type { DataChange } from '../../types';
|
|
4
|
-
|
|
5
|
-
current: CommandData;
|
|
6
|
-
original: CommandData;
|
|
7
|
-
animation: boolean;
|
|
8
|
-
};
|
|
9
|
-
export type CommandData = {
|
|
10
|
-
add: GraphData;
|
|
11
|
-
update: GraphData;
|
|
12
|
-
remove: GraphData;
|
|
13
|
-
};
|
|
3
|
+
import type { Command } from '../../types/history';
|
|
14
4
|
/**
|
|
15
5
|
* <zh/> 对齐两个对象的字段。若目标对象缺少字段,则会添加默认值。
|
|
16
6
|
*
|
|
@@ -3,6 +3,11 @@ import type { RuntimeContext } from '../../runtime/types';
|
|
|
3
3
|
import type { CallableValue, ID } from '../../types';
|
|
4
4
|
import type { BasePluginOptions } from '../base-plugin';
|
|
5
5
|
import { BasePlugin } from '../base-plugin';
|
|
6
|
+
/**
|
|
7
|
+
* <zh/> Hull 配置项
|
|
8
|
+
*
|
|
9
|
+
* <en/> Hull options
|
|
10
|
+
*/
|
|
6
11
|
export interface HullOptions extends BasePluginOptions, ContourStyleProps {
|
|
7
12
|
/**
|
|
8
13
|
* <zh/> Hull 内的元素
|
|
@@ -18,29 +23,48 @@ export interface HullOptions extends BasePluginOptions, ContourStyleProps {
|
|
|
18
23
|
*/
|
|
19
24
|
concavity?: number;
|
|
20
25
|
/**
|
|
21
|
-
* <zh/>
|
|
26
|
+
* <zh/> 内边距
|
|
22
27
|
*
|
|
23
|
-
* <en/> Padding
|
|
28
|
+
* <en/> Padding
|
|
24
29
|
* @defaultValue 10
|
|
25
30
|
*/
|
|
26
31
|
padding?: number;
|
|
27
32
|
/**
|
|
28
|
-
* <zh/>
|
|
33
|
+
* <zh/> 拐角类型
|
|
29
34
|
*
|
|
30
|
-
* <en/> Corner type
|
|
35
|
+
* <en/> Corner type
|
|
31
36
|
* @defaultValue 'rounded'
|
|
32
37
|
*/
|
|
33
38
|
corner?: 'rounded' | 'smooth' | 'sharp';
|
|
34
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* <zh/> 轮廓
|
|
42
|
+
*
|
|
43
|
+
* <en/> Hull
|
|
44
|
+
* @remarks
|
|
45
|
+
* <zh/> 轮廓包围(Hull)用于处理和表示一组点的凸多边形包围盒。轮廓包围分为两种形态:凸包和凹包。
|
|
46
|
+
*
|
|
47
|
+
* <zh/> 凸包(Convex Hull):这是一个凸多边形,它包含所有的点,并且没有任何凹陷。你可以将其想象为一组点的最小包围盒,没有任何点在这个多边形的外部。
|
|
48
|
+
*
|
|
49
|
+
* <zh/> 凹包(Concave Hull):这是一个凹多边形,它同样包含所有的点,但是可能会有凹陷。凹包的凹陷程度由 concavity 参数控制。concavity 越大,凹陷越小。当 concavity 为 Infinity 时,凹包就变成了凸包。
|
|
50
|
+
*
|
|
51
|
+
* <en/> Hull is used to process and represent the convex polygon bounding box of a set of points. Hull has two forms: convex hull and concave hull.
|
|
52
|
+
*
|
|
53
|
+
* <en/> Convex Hull: This is a convex polygon that contains all points and has no concave. You can think of it as the smallest bounding box of a set of points, with no points outside the polygon.
|
|
54
|
+
*
|
|
55
|
+
* <en/> Concave Hull: This is a concave polygon that also contains all points, but may have concave. The concavity of the concave hull is controlled by the concavity parameter. The larger the concavity, the smaller the concave. When concavity is Infinity, the concave hull becomes a convex hull.
|
|
56
|
+
*/
|
|
35
57
|
export declare class Hull extends BasePlugin<HullOptions> {
|
|
36
58
|
private shape;
|
|
37
59
|
/**
|
|
38
60
|
* <zh/> 在 Hull 上的元素
|
|
61
|
+
*
|
|
39
62
|
* <en/> Element Ids on Hull
|
|
40
63
|
*/
|
|
41
64
|
private hullMemberIds;
|
|
42
65
|
/**
|
|
43
66
|
* <zh/> Hull 绘制路径
|
|
67
|
+
*
|
|
44
68
|
* <en/> Hull path
|
|
45
69
|
*/
|
|
46
70
|
private path;
|
|
@@ -1,23 +1,62 @@
|
|
|
1
|
-
import type { CategoryOptions } from '@antv/component';
|
|
2
1
|
import { Selection } from '@antv/component';
|
|
2
|
+
import { CategoryStyleProps } from '@antv/component/lib/ui/legend/types';
|
|
3
3
|
import type { RuntimeContext } from '../runtime/types';
|
|
4
4
|
import type { ElementDatum } from '../types';
|
|
5
5
|
import type { CardinalPlacement } from '../types/placement';
|
|
6
6
|
import type { BasePluginOptions } from './base-plugin';
|
|
7
7
|
import { BasePlugin } from './base-plugin';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
/**
|
|
9
|
+
* <zh/> 图例配置项
|
|
10
|
+
*
|
|
11
|
+
* <en/> Legend options
|
|
12
|
+
*/
|
|
13
|
+
export interface LegendOptions extends BasePluginOptions, Omit<CategoryStyleProps, 'data'> {
|
|
14
|
+
/**
|
|
15
|
+
* <zh/> 图例触发行为
|
|
16
|
+
* - `'hover'`:鼠标移入图例项时触发
|
|
17
|
+
* - `'click'`:鼠标点击图例项时触发
|
|
18
|
+
*
|
|
19
|
+
* <en/> Legend trigger behavior
|
|
20
|
+
* - `'hover'`:mouseover the legend item
|
|
21
|
+
* - `'click'`:click the legend item
|
|
22
|
+
* @defaultValue 'hover'
|
|
23
|
+
*/
|
|
11
24
|
trigger?: 'hover' | 'click';
|
|
12
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* <zh/> 图例在画布中的相对位置,默认为 'bottom',代表在画布正下方
|
|
27
|
+
*
|
|
28
|
+
* <en/> Relative position of the legend in the canvas, defaults to 'bottom', representing the bottom of the canvas
|
|
29
|
+
* @defaultValue 'bottom'
|
|
30
|
+
*/
|
|
13
31
|
position?: CardinalPlacement;
|
|
14
|
-
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
32
|
+
/**
|
|
33
|
+
* <zh/> 节点分类标识
|
|
34
|
+
*
|
|
35
|
+
* <en/> Node Classification Identifier
|
|
36
|
+
*/
|
|
37
|
+
nodeField?: string | ((item: ElementDatum) => string);
|
|
38
|
+
/**
|
|
39
|
+
* <zh/> 边分类标识
|
|
40
|
+
*
|
|
41
|
+
* <en/> Edge Classification Identifier
|
|
42
|
+
*/
|
|
43
|
+
edgeField?: string | ((item: ElementDatum) => string);
|
|
44
|
+
/**
|
|
45
|
+
* <zh/> 组合分类标识
|
|
46
|
+
*
|
|
47
|
+
* <en/> Combo Classification Identifier
|
|
48
|
+
*/
|
|
49
|
+
comboField?: string | ((item: ElementDatum) => string);
|
|
20
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* <zh/> 图例
|
|
53
|
+
*
|
|
54
|
+
* <en/> Legend
|
|
55
|
+
* @remarks
|
|
56
|
+
* <zh/> 图例插件用于展示图中元素的分类信息,支持节点、边、组合的分类信息展示。
|
|
57
|
+
*
|
|
58
|
+
* <en/> The legend plugin is used to display the classification information of elements in the graph, and supports the display of classification information of nodes, edges, and combos.
|
|
59
|
+
*/
|
|
21
60
|
export declare class Legend extends BasePlugin<LegendOptions> {
|
|
22
61
|
static defaultOptions: Partial<LegendOptions>;
|
|
23
62
|
private typePrefix;
|
|
@@ -26,17 +65,54 @@ export declare class Legend extends BasePlugin<LegendOptions> {
|
|
|
26
65
|
private fieldMap;
|
|
27
66
|
private selectedItems;
|
|
28
67
|
constructor(context: RuntimeContext, options: LegendOptions);
|
|
68
|
+
/**
|
|
69
|
+
* <zh/> 更新图例配置
|
|
70
|
+
*
|
|
71
|
+
* <en/> Update the legend configuration
|
|
72
|
+
* @param options - <zh/> 图例配置项 | <en/> Legend configuration item
|
|
73
|
+
* @internal
|
|
74
|
+
*/
|
|
29
75
|
update(options: Partial<LegendOptions>): void;
|
|
30
76
|
private clear;
|
|
31
77
|
private bindEvents;
|
|
32
78
|
private changeState;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
79
|
+
/**
|
|
80
|
+
* <zh/> 图例元素点击事件
|
|
81
|
+
*
|
|
82
|
+
* <en/> Legend element click event
|
|
83
|
+
* @param event - <zh/> 点击的元素 | <en/> The element that is clicked
|
|
84
|
+
*/
|
|
85
|
+
click: (event: Selection) => void;
|
|
86
|
+
/**
|
|
87
|
+
* <zh/> 图例元素移出事件
|
|
88
|
+
*
|
|
89
|
+
* <en/> Legend element mouseleave event
|
|
90
|
+
* @param event - <zh/> 移出的元素 | <en/> The element that is moved out
|
|
91
|
+
*/
|
|
92
|
+
mouseleave: (event: Selection) => void;
|
|
93
|
+
/**
|
|
94
|
+
* <zh/> 图例元素移入事件
|
|
95
|
+
*
|
|
96
|
+
* <en/> Legend element mouseenter event
|
|
97
|
+
* @param event - <zh/> 移入的元素 | <en/> The element that is moved in
|
|
98
|
+
*/
|
|
99
|
+
mouseenter: (event: Selection) => void;
|
|
100
|
+
/**
|
|
101
|
+
* <zh/> 刷新图例元素状态
|
|
102
|
+
*
|
|
103
|
+
* <en/> Refresh the status of the legend element
|
|
104
|
+
*/
|
|
36
105
|
updateElement(): void;
|
|
37
106
|
private setFieldMap;
|
|
38
107
|
private getEvents;
|
|
39
108
|
private getMarkerData;
|
|
109
|
+
/**
|
|
110
|
+
* <zh/> 图例布局
|
|
111
|
+
*
|
|
112
|
+
* <en/> Legend layout
|
|
113
|
+
* @param position - <zh/> 图例位置| <en/> Legend position
|
|
114
|
+
* @returns <zh/> 图例布局样式| <en/> Legend layout style
|
|
115
|
+
*/
|
|
40
116
|
layout: (position: CardinalPlacement) => {
|
|
41
117
|
display: string;
|
|
42
118
|
flexDirection: string;
|
|
@@ -44,6 +120,10 @@ export declare class Legend extends BasePlugin<LegendOptions> {
|
|
|
44
120
|
alignItems: string;
|
|
45
121
|
};
|
|
46
122
|
private createElement;
|
|
123
|
+
/**
|
|
124
|
+
* <zh/>销毁图例
|
|
125
|
+
*
|
|
126
|
+
* <en/> Destroy the legend
|
|
127
|
+
*/
|
|
47
128
|
destroy(): void;
|
|
48
129
|
}
|
|
49
|
-
export {};
|
|
@@ -21,16 +21,17 @@ export interface TimebarOptions extends BasePluginOptions {
|
|
|
21
21
|
* @remarks
|
|
22
22
|
* <zh/> 设置后 `position` 会失效
|
|
23
23
|
*
|
|
24
|
-
* <en/>
|
|
24
|
+
* <en/> `position` will be invalidated after setting `x`
|
|
25
25
|
*/
|
|
26
26
|
x?: number;
|
|
27
27
|
/**
|
|
28
28
|
* <zh/> Y 位置
|
|
29
29
|
*
|
|
30
30
|
* <en/> Y position
|
|
31
|
+
* @remarks
|
|
31
32
|
* <zh/> 设置后 `position` 会失效
|
|
32
33
|
*
|
|
33
|
-
* <en/>
|
|
34
|
+
* <en/> `position` will be invalidated after setting `y`
|
|
34
35
|
*/
|
|
35
36
|
y?: number;
|
|
36
37
|
/**
|
|
@@ -48,9 +49,9 @@ export interface TimebarOptions extends BasePluginOptions {
|
|
|
48
49
|
*/
|
|
49
50
|
height?: number;
|
|
50
51
|
/**
|
|
51
|
-
* <zh/> Timebar
|
|
52
|
+
* <zh/> Timebar 的位置
|
|
52
53
|
*
|
|
53
|
-
* <en/> Timebar location
|
|
54
|
+
* <en/> Timebar location
|
|
54
55
|
* @defaultValue 'bottom'
|
|
55
56
|
*/
|
|
56
57
|
position?: 'bottom' | 'top';
|
|
@@ -65,9 +66,9 @@ export interface TimebarOptions extends BasePluginOptions {
|
|
|
65
66
|
*
|
|
66
67
|
* <en/> Time data
|
|
67
68
|
* @remarks
|
|
68
|
-
* <zh/> timebarType 为 'chart' 时,需要额外传入 value 字段作为图表数据
|
|
69
|
+
* <zh/> `timebarType` 为 `'chart'` 时,需要额外传入 `value` 字段作为图表数据
|
|
69
70
|
*
|
|
70
|
-
* <en/> When timebarType is 'chart'
|
|
71
|
+
* <en/> When `timebarType` is `'chart'`, you need to pass in the `value` field as chart data
|
|
71
72
|
*/
|
|
72
73
|
data: number[] | {
|
|
73
74
|
time: number;
|
|
@@ -75,12 +76,12 @@ export interface TimebarOptions extends BasePluginOptions {
|
|
|
75
76
|
}[];
|
|
76
77
|
/**
|
|
77
78
|
* <zh/> Timebar 展示类型
|
|
78
|
-
* - time
|
|
79
|
-
* - chart
|
|
79
|
+
* - `'time'`: 显示为时间轴
|
|
80
|
+
* - `'chart'`: 显示为趋势图
|
|
80
81
|
*
|
|
81
82
|
* <en/> Timebar Displays the type
|
|
82
|
-
* - time
|
|
83
|
-
* - chart
|
|
83
|
+
* - `'time'`: Display as a timeline
|
|
84
|
+
* - `'chart'`: Display as a trend chart
|
|
84
85
|
* @defaultValue 'time'
|
|
85
86
|
*/
|
|
86
87
|
timebarType?: 'time' | 'chart';
|
|
@@ -92,12 +93,12 @@ export interface TimebarOptions extends BasePluginOptions {
|
|
|
92
93
|
elementTypes?: ElementType[];
|
|
93
94
|
/**
|
|
94
95
|
* <zh/> 筛选模式
|
|
95
|
-
* - modify
|
|
96
|
-
* - visibility
|
|
96
|
+
* - `'modify'`: 通过修改图数据进行筛选
|
|
97
|
+
* - `'visibility'`: 通过修改元素可见性进行筛选
|
|
97
98
|
*
|
|
98
99
|
* <en/> Filter mode
|
|
99
|
-
* - modify
|
|
100
|
-
* - visibility
|
|
100
|
+
* - `'modify'`: Filter by modifying the graph data.
|
|
101
|
+
* - `'visibility'`: Filter by modifying element visibility
|
|
101
102
|
* @defaultValue 'modify'
|
|
102
103
|
*/
|
|
103
104
|
mode?: 'modify' | 'visibility';
|
|
@@ -117,6 +118,7 @@ export interface TimebarOptions extends BasePluginOptions {
|
|
|
117
118
|
* <zh/> 是否循环播放
|
|
118
119
|
*
|
|
119
120
|
* <en/> Whether to loop
|
|
121
|
+
* @defaultValue false
|
|
120
122
|
*/
|
|
121
123
|
loop?: boolean;
|
|
122
124
|
/**
|
|
@@ -204,6 +206,13 @@ export declare class Timebar extends BasePlugin<TimebarOptions> {
|
|
|
204
206
|
* <en/> Reset
|
|
205
207
|
*/
|
|
206
208
|
reset(): void;
|
|
209
|
+
/**
|
|
210
|
+
* <zh/> 更新时间条配置项
|
|
211
|
+
*
|
|
212
|
+
* <en/> Update timebar configuration options
|
|
213
|
+
* @param options - <zh/> 配置项 | <en/> Options
|
|
214
|
+
* @internal
|
|
215
|
+
*/
|
|
207
216
|
update(options: Partial<TimebarOptions>): void;
|
|
208
217
|
/**
|
|
209
218
|
* <zh/> 备份数据
|
|
@@ -1,60 +1,67 @@
|
|
|
1
1
|
import type { RuntimeContext } from '../../runtime/types';
|
|
2
|
+
import type { CornerPlacement } from '../../types';
|
|
2
3
|
import type { BasePluginOptions } from '../base-plugin';
|
|
3
4
|
import { BasePlugin } from '../base-plugin';
|
|
4
|
-
import type {
|
|
5
|
+
import type { ToolbarItem } from './util';
|
|
5
6
|
/**
|
|
6
|
-
* <zh/> Toolbar
|
|
7
|
-
*
|
|
7
|
+
* <zh/> Toolbar 工具栏的配置项
|
|
8
|
+
*
|
|
9
|
+
* <en/> The configuration item of the Toolbar toolbar
|
|
8
10
|
*/
|
|
9
|
-
export
|
|
11
|
+
export interface ToolbarOptions extends BasePluginOptions {
|
|
10
12
|
/**
|
|
11
|
-
* <zh/> 给工具栏的 DOM 追加的 classname,便于自定义样式。默认是包含 `g6-toolbar
|
|
12
|
-
*
|
|
13
|
+
* <zh/> 给工具栏的 DOM 追加的 classname,便于自定义样式。默认是包含 `g6-toolbar`
|
|
14
|
+
*
|
|
15
|
+
* <en/> The classname appended to the menu DOM for custom styles. The default is `g6-toolbar`
|
|
13
16
|
*/
|
|
14
17
|
className?: string;
|
|
15
18
|
/**
|
|
16
|
-
* <zh/> Toolbar
|
|
17
|
-
*
|
|
19
|
+
* <zh/> Toolbar 的位置,相对于画布,会影响 DOM 的 style 样式
|
|
20
|
+
*
|
|
21
|
+
* <en/> The position of the Toolbar relative to the canvas, which will affect the style of the DOM
|
|
22
|
+
* @defaultValue 'top-left'
|
|
18
23
|
*/
|
|
19
|
-
position?:
|
|
24
|
+
position?: CornerPlacement;
|
|
20
25
|
/**
|
|
21
|
-
* <zh/> 工具栏显式的 style
|
|
22
|
-
*
|
|
26
|
+
* <zh/> 工具栏显式的 style 样式,可以用来设置它相对于画布的位置、背景容器样式等
|
|
27
|
+
*
|
|
28
|
+
* <en/> The style style of the Toolbar, which can be used to set its position relative to the canvas
|
|
23
29
|
*/
|
|
24
30
|
style?: Partial<CSSStyleDeclaration>;
|
|
25
31
|
/**
|
|
26
|
-
* <zh/>
|
|
27
|
-
*
|
|
32
|
+
* <zh/> 当工具栏被点击后,触发的回调方法
|
|
33
|
+
*
|
|
34
|
+
* <en/> The callback method triggered when the toolbar item is clicked
|
|
28
35
|
*/
|
|
29
36
|
onClick?: (value: string, target: Element) => void;
|
|
30
37
|
/**
|
|
31
|
-
* <zh/> 返回工具栏的项目列表,支持 `Promise`
|
|
32
|
-
*
|
|
38
|
+
* <zh/> 返回工具栏的项目列表,支持 `Promise` 类型的返回值
|
|
39
|
+
*
|
|
40
|
+
* <en/> Return the list of toolbar items, support return a `Promise` as items
|
|
33
41
|
*/
|
|
34
42
|
getItems: () => ToolbarItem[] | Promise<ToolbarItem[]>;
|
|
35
|
-
|
|
36
|
-
* <zh/> 插件是否可用,默认 `true`。
|
|
37
|
-
* <en/> Whether the plugin is available, default is `true`.
|
|
38
|
-
*/
|
|
39
|
-
enable?: boolean;
|
|
40
|
-
};
|
|
43
|
+
}
|
|
41
44
|
/**
|
|
42
|
-
* <zh/>
|
|
43
|
-
*
|
|
45
|
+
* <zh/> 工具栏,支持配置工具栏项目,以及点击之后的回调方法
|
|
46
|
+
*
|
|
47
|
+
* <en/> Toolbar, support configuration of toolbar items, and callback methods after clicking
|
|
44
48
|
*/
|
|
45
49
|
export declare class Toolbar extends BasePlugin<ToolbarOptions> {
|
|
46
50
|
static defaultOptions: Partial<ToolbarOptions>;
|
|
47
51
|
private $element;
|
|
48
52
|
constructor(context: RuntimeContext, options: ToolbarOptions);
|
|
49
53
|
/**
|
|
50
|
-
* <zh/>
|
|
51
|
-
*
|
|
52
|
-
*
|
|
54
|
+
* <zh/> 更新工具栏的配置项
|
|
55
|
+
*
|
|
56
|
+
* <en/> Update the configuration of the toolbar
|
|
57
|
+
* @param options - <zh/> 工具栏的配置项 | <en/> The configuration item of the toolbar
|
|
58
|
+
* @internal
|
|
53
59
|
*/
|
|
54
60
|
update(options: Partial<ToolbarOptions>): Promise<void>;
|
|
55
61
|
/**
|
|
56
|
-
* <zh/>
|
|
57
|
-
*
|
|
62
|
+
* <zh/> 销毁工具栏
|
|
63
|
+
*
|
|
64
|
+
* <en/> Destroy the toolbar
|
|
58
65
|
*/
|
|
59
66
|
destroy(): void;
|
|
60
67
|
private getDOMContent;
|
|
@@ -1,34 +1,33 @@
|
|
|
1
|
-
import { CornerPlacement } from '../../types';
|
|
1
|
+
import type { CornerPlacement } from '../../types';
|
|
2
2
|
/**
|
|
3
3
|
* <zh/> 工具栏显示项目。
|
|
4
|
+
*
|
|
4
5
|
* <en/> The item of the toolbar.
|
|
5
6
|
*/
|
|
6
|
-
export
|
|
7
|
+
export interface ToolbarItem {
|
|
7
8
|
/**
|
|
8
9
|
* <zh/> 可以使用 id 来配置内置的工具栏项,可以是 'zoom-in'、'zoom-out'、'auto-fit'、'reset' 等值,也可以配合三方的 iconfont 使用,原理是通过 id 来匹配内置的 svg symbol。See: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/symbol。
|
|
10
|
+
*
|
|
9
11
|
* <en/> You can use id to configure the built-in toolbar items, which can be values such as 'zoom-in', 'zoom-out', 'auto-fit', 'reset', etc. One of the two configurations with `marker`. The principle is to match the built-in svg symbol through id. See: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/symbol.
|
|
10
12
|
*/
|
|
11
13
|
readonly id: 'zoom-in' | 'zoom-out' | 'redo' | 'undo' | 'edit' | 'delete' | 'auto-fit' | 'export' | 'reset' | string;
|
|
12
14
|
/**
|
|
13
15
|
* <zh/> 工具栏项对应的值,在 onClick 中作为回调参数。
|
|
16
|
+
*
|
|
14
17
|
* <en/> The value corresponding to the toolbar item, used as a callback parameter in `onClick`.
|
|
15
18
|
*/
|
|
16
19
|
readonly value: string;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* <zh/> Toolbar 的位置,相对于画布,默认为 `top-left`,最终会影响 DOM 的 style 样式。
|
|
20
|
-
* <en/> The position of the Toolbar relative to the canvas, default is `top-left`, which will ultimately affect the style of the DOM.
|
|
21
|
-
*/
|
|
22
|
-
export type Position = CornerPlacement;
|
|
20
|
+
}
|
|
23
21
|
/**
|
|
24
22
|
* <zh/> 解析 toolbar 的 position 为位置样式。
|
|
23
|
+
*
|
|
25
24
|
* <en/> Parse the position of the toolbar into position style.
|
|
26
25
|
* @param position - position
|
|
27
26
|
* @returns style
|
|
28
27
|
*/
|
|
29
|
-
export declare function parsePositionToStyle(position:
|
|
28
|
+
export declare function parsePositionToStyle(position: CornerPlacement): Partial<CSSStyleDeclaration>;
|
|
30
29
|
/**
|
|
31
30
|
* 内置默认的 toolbar 的 CSS 样式。
|
|
32
31
|
*/
|
|
33
|
-
export declare const TOOLBAR_CSS = "\n .g6-toolbar {\n position: absolute;\n z-index: 100;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n border-radius: 4px;\n box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.1);\n opacity: 0.65;\n }
|
|
32
|
+
export declare const TOOLBAR_CSS = "\n .g6-toolbar {\n position: absolute;\n z-index: 100;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n border-radius: 4px;\n box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.1);\n opacity: 0.65;\n }\n .g6-toolbar .g6-toolbar-item {\n display: inline-block;\n width: 16px;\n height: 16px;\n padding: 4px;\n cursor: pointer;\n box-sizing: content-box;\n }\n\n .g6-toolbar .g6-toolbar-item:hover {\n background-color: #f0f0f0;\n }\n\n .g6-toolbar .g6-toolbar-item svg {\n display: inline-block;\n width: 100%;\n height: 100%;\n pointer-events: none;\n }\n";
|
|
34
33
|
export declare const BUILD_IN_SVG_ICON = "\n <svg>\n <symbol id=\"zoom-in\" viewBox=\"64 64 896 896\">\n <path d=\"M637 443H519V309c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v134H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h118v134c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V519h118c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z\"></path>\n </symbol>\n <symbol id=\"zoom-out\" viewBox=\"64 64 896 896\">\n <path d=\"M637 443H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h312c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z\"></path>\n </symbol>\n <symbol id=\"edit\" viewBox=\"64 64 896 896\">\n <path d=\"M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z\"></path>\n </symbol>\n <symbol id=\"delete\" viewBox=\"64 64 896 896\">\n <path d=\"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z\"></path>\n </symbol>\n <symbol id=\"redo\" viewBox=\"64 64 896 896\">\n <path d=\"M758.2 839.1C851.8 765.9 912 651.9 912 523.9 912 303 733.5 124.3 512.6 124 291.4 123.7 112 302.8 112 523.9c0 125.2 57.5 236.9 147.6 310.2 3.5 2.8 8.6 2.2 11.4-1.3l39.4-50.5c2.7-3.4 2.1-8.3-1.2-11.1-8.1-6.6-15.9-13.7-23.4-21.2a318.64 318.64 0 01-68.6-101.7C200.4 609 192 567.1 192 523.9s8.4-85.1 25.1-124.5c16.1-38.1 39.2-72.3 68.6-101.7 29.4-29.4 63.6-52.5 101.7-68.6C426.9 212.4 468.8 204 512 204s85.1 8.4 124.5 25.1c38.1 16.1 72.3 39.2 101.7 68.6 29.4 29.4 52.5 63.6 68.6 101.7 16.7 39.4 25.1 81.3 25.1 124.5s-8.4 85.1-25.1 124.5a318.64 318.64 0 01-68.6 101.7c-9.3 9.3-19.1 18-29.3 26L668.2 724a8 8 0 00-14.1 3l-39.6 162.2c-1.2 5 2.6 9.9 7.7 9.9l167 .8c6.7 0 10.5-7.7 6.3-12.9l-37.3-47.9z\"></path>\n </symbol>\n <symbol id=\"undo\" viewBox=\"64 64 896 896\">\n <path d=\"M511.4 124C290.5 124.3 112 303 112 523.9c0 128 60.2 242 153.8 315.2l-37.5 48c-4.1 5.3-.3 13 6.3 12.9l167-.8c5.2 0 9-4.9 7.7-9.9L369.8 727a8 8 0 00-14.1-3L315 776.1c-10.2-8-20-16.7-29.3-26a318.64 318.64 0 01-68.6-101.7C200.4 609 192 567.1 192 523.9s8.4-85.1 25.1-124.5c16.1-38.1 39.2-72.3 68.6-101.7 29.4-29.4 63.6-52.5 101.7-68.6C426.9 212.4 468.8 204 512 204s85.1 8.4 124.5 25.1c38.1 16.1 72.3 39.2 101.7 68.6 29.4 29.4 52.5 63.6 68.6 101.7 16.7 39.4 25.1 81.3 25.1 124.5s-8.4 85.1-25.1 124.5a318.64 318.64 0 01-68.6 101.7c-7.5 7.5-15.3 14.5-23.4 21.2a7.93 7.93 0 00-1.2 11.1l39.4 50.5c2.8 3.5 7.9 4.1 11.4 1.3C854.5 760.8 912 649.1 912 523.9c0-221.1-179.4-400.2-400.6-399.9z\"></path>\n </symbol>\n <symbol id=\"export\" viewBox=\"64 64 896 896\">\n <path d=\"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM770.87 199.13l-52.2-52.2a8.01 8.01 0 014.7-13.6l179.4-21c5.1-.6 9.5 3.7 8.9 8.9l-21 179.4c-.8 6.6-8.9 9.4-13.6 4.7l-52.4-52.4-256.2 256.2a8.03 8.03 0 01-11.3 0l-42.4-42.4a8.03 8.03 0 010-11.3l256.1-256.3z\"></path>\n </symbol>\n <symbol id=\"auto-fit\" viewBox=\"64 64 896 896\">\n <path d=\"M952 474H829.8C812.5 327.6 696.4 211.5 550 194.2V72c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v122.2C327.6 211.5 211.5 327.6 194.2 474H72c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h122.2C211.5 696.4 327.6 812.5 474 829.8V952c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V829.8C696.4 812.5 812.5 696.4 829.8 550H952c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zM512 756c-134.8 0-244-109.2-244-244s109.2-244 244-244 244 109.2 244 244-109.2 244-244 244z\"></path>\n <path d=\"M512 392c-32.1 0-62.1 12.4-84.8 35.2-22.7 22.7-35.2 52.7-35.2 84.8s12.5 62.1 35.2 84.8C449.9 619.4 480 632 512 632s62.1-12.5 84.8-35.2C619.4 574.1 632 544 632 512s-12.5-62.1-35.2-84.8A118.57 118.57 0 00512 392z\"></path>\n </symbol>\n <symbol id=\"reset\" viewBox=\"64 64 896 896\">\n <path d=\"M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z\"></path>\n </symbol>\n </svg>\n";
|