@antv/g6 5.0.0-beta.31 → 5.0.0-beta.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/g6.min.js +2 -2
- package/dist/lib/behaviors/brush-select.d.ts +104 -0
- package/dist/lib/behaviors/click-element.d.ts +77 -0
- package/dist/lib/behaviors/collapse-expand.d.ts +4 -5
- package/dist/lib/behaviors/create-edge.d.ts +55 -0
- package/dist/lib/behaviors/drag-canvas.d.ts +6 -6
- package/dist/lib/behaviors/drag-element-force.d.ts +14 -0
- package/dist/lib/behaviors/drag-element.d.ts +17 -14
- package/dist/lib/behaviors/focus-element.d.ts +4 -3
- package/dist/lib/behaviors/hover-element.d.ts +4 -5
- package/dist/lib/behaviors/index.d.ts +10 -0
- package/dist/lib/behaviors/lasso-select.d.ts +20 -0
- package/dist/lib/behaviors/types.d.ts +1 -0
- package/dist/lib/behaviors/zoom-canvas.d.ts +7 -6
- package/dist/lib/constants/change.d.ts +1 -1
- package/dist/lib/constants/events/graph.d.ts +9 -15
- package/dist/lib/constants/index.d.ts +1 -0
- package/dist/lib/constants/registry.d.ts +22 -0
- package/dist/lib/elements/combos/base-combo.d.ts +64 -6
- package/dist/lib/elements/combos/circle.d.ts +8 -12
- package/dist/lib/elements/combos/rect.d.ts +5 -9
- package/dist/lib/elements/edges/base-edge.d.ts +85 -10
- package/dist/lib/elements/edges/cubic-horizontal.d.ts +2 -2
- package/dist/lib/elements/edges/cubic-vertical.d.ts +2 -2
- package/dist/lib/elements/edges/cubic.d.ts +2 -2
- package/dist/lib/elements/edges/polyline.d.ts +2 -2
- package/dist/lib/elements/edges/quadratic.d.ts +2 -2
- package/dist/lib/elements/nodes/base-node.d.ts +125 -13
- package/dist/lib/elements/nodes/circle.d.ts +5 -8
- package/dist/lib/elements/nodes/diamond.d.ts +2 -4
- package/dist/lib/elements/nodes/ellipse.d.ts +5 -8
- package/dist/lib/elements/nodes/hexagon.d.ts +6 -9
- package/dist/lib/elements/nodes/image.d.ts +9 -11
- package/dist/lib/elements/nodes/polygon.d.ts +9 -8
- package/dist/lib/elements/nodes/rect.d.ts +2 -3
- package/dist/lib/elements/nodes/star.d.ts +7 -10
- package/dist/lib/elements/nodes/triangle.d.ts +7 -10
- package/dist/lib/exports.d.ts +18 -14
- package/dist/lib/layouts/index.d.ts +1 -1
- package/dist/lib/layouts/types.d.ts +6 -6
- package/dist/lib/palettes/index.d.ts +1 -0
- package/dist/lib/plugins/camera-setting.d.ts +95 -0
- package/dist/lib/plugins/contextmenu.d.ts +8 -5
- package/dist/lib/plugins/history/events.d.ts +21 -0
- package/dist/lib/plugins/history/index.d.ts +82 -0
- package/dist/lib/plugins/history/utils.d.ts +31 -0
- package/dist/lib/plugins/hull/index.d.ts +59 -0
- package/dist/lib/plugins/hull/shape.d.ts +49 -0
- package/dist/lib/plugins/hull/util.d.ts +12 -0
- package/dist/lib/plugins/index.d.ts +8 -0
- package/dist/lib/plugins/legend.d.ts +49 -0
- package/dist/lib/plugins/tooltip.d.ts +12 -10
- package/dist/lib/registry/extension/index.d.ts +3 -3
- package/dist/lib/registry/index.d.ts +6 -4
- package/dist/lib/registry/types.d.ts +4 -6
- package/dist/lib/runtime/batch.d.ts +11 -0
- package/dist/lib/runtime/behavior.d.ts +1 -1
- package/dist/lib/runtime/canvas.d.ts +15 -4
- package/dist/lib/runtime/data.d.ts +4 -4
- package/dist/lib/runtime/element.d.ts +6 -23
- package/dist/lib/runtime/graph.d.ts +71 -6
- package/dist/lib/runtime/layout.d.ts +5 -11
- package/dist/lib/runtime/plugin.d.ts +2 -1
- package/dist/lib/runtime/transform.d.ts +11 -0
- package/dist/lib/runtime/types.d.ts +14 -0
- package/dist/lib/spec/index.d.ts +1 -0
- package/dist/lib/spec/spec.d.ts +7 -0
- package/dist/lib/spec/transform.d.ts +12 -0
- package/dist/lib/transforms/arrange-draw-order.d.ts +10 -0
- package/dist/lib/transforms/base-transform.d.ts +7 -0
- package/dist/lib/transforms/collapse-expand-combo.d.ts +10 -0
- package/dist/lib/transforms/index.d.ts +6 -0
- package/dist/lib/transforms/process-parallel-edges.d.ts +84 -0
- package/dist/lib/transforms/types.d.ts +20 -0
- package/dist/lib/transforms/update-related-edge.d.ts +9 -0
- package/dist/lib/types/canvas.d.ts +1 -1
- package/dist/lib/types/change.d.ts +27 -10
- package/dist/lib/types/element.d.ts +6 -140
- package/dist/lib/types/event.d.ts +42 -7
- package/dist/lib/types/index.d.ts +0 -1
- package/dist/lib/types/node.d.ts +3 -3
- package/dist/lib/types/point.d.ts +1 -0
- package/dist/lib/utils/animation.d.ts +1 -1
- package/dist/lib/utils/bbox.d.ts +1 -1
- package/dist/lib/utils/behaviors/brush.d.ts +19 -0
- package/dist/lib/utils/behaviors/lasso.d.ts +13 -0
- package/dist/lib/utils/behaviors/utils.d.ts +21 -0
- package/dist/lib/utils/change.d.ts +9 -1
- package/dist/lib/utils/combo.d.ts +5 -4
- package/dist/lib/utils/edge.d.ts +11 -0
- package/dist/lib/utils/element.d.ts +19 -11
- package/dist/lib/utils/event/events.d.ts +9 -14
- package/dist/lib/utils/extension.d.ts +1 -1
- package/dist/lib/utils/id.d.ts +3 -8
- package/dist/lib/utils/line.d.ts +21 -0
- package/dist/lib/utils/path.d.ts +35 -0
- package/dist/lib/utils/point.d.ts +74 -20
- package/dist/lib/utils/polygon.d.ts +17 -0
- package/dist/lib/utils/position.d.ts +14 -1
- package/dist/lib/utils/prefix.d.ts +1 -1
- package/dist/lib/utils/shortcut.d.ts +11 -0
- package/dist/lib/utils/vector.d.ts +3 -2
- package/esm/behaviors/brush-select.d.ts +104 -0
- package/esm/behaviors/brush-select.js +199 -0
- package/esm/behaviors/brush-select.js.map +1 -0
- package/esm/behaviors/click-element.d.ts +77 -0
- package/esm/behaviors/click-element.js +108 -0
- package/esm/behaviors/click-element.js.map +1 -0
- package/esm/behaviors/collapse-expand.d.ts +4 -5
- package/esm/behaviors/collapse-expand.js +8 -4
- package/esm/behaviors/collapse-expand.js.map +1 -1
- package/esm/behaviors/create-edge.d.ts +55 -0
- package/esm/behaviors/create-edge.js +141 -0
- package/esm/behaviors/create-edge.js.map +1 -0
- package/esm/behaviors/drag-canvas.d.ts +6 -6
- package/esm/behaviors/drag-canvas.js +15 -7
- package/esm/behaviors/drag-canvas.js.map +1 -1
- package/esm/behaviors/drag-element-force.d.ts +14 -0
- package/esm/behaviors/drag-element-force.js +55 -0
- package/esm/behaviors/drag-element-force.js.map +1 -0
- package/esm/behaviors/drag-element.d.ts +17 -14
- package/esm/behaviors/drag-element.js +17 -9
- package/esm/behaviors/drag-element.js.map +1 -1
- package/esm/behaviors/focus-element.d.ts +4 -3
- package/esm/behaviors/focus-element.js.map +1 -1
- package/esm/behaviors/hover-element.d.ts +4 -5
- package/esm/behaviors/hover-element.js +2 -2
- package/esm/behaviors/hover-element.js.map +1 -1
- package/esm/behaviors/index.d.ts +10 -0
- package/esm/behaviors/index.js +5 -0
- package/esm/behaviors/index.js.map +1 -1
- package/esm/behaviors/lasso-select.d.ts +20 -0
- package/esm/behaviors/lasso-select.js +79 -0
- package/esm/behaviors/lasso-select.js.map +1 -0
- package/esm/behaviors/types.d.ts +1 -0
- package/esm/behaviors/zoom-canvas.d.ts +7 -6
- package/esm/behaviors/zoom-canvas.js +6 -2
- package/esm/behaviors/zoom-canvas.js.map +1 -1
- package/esm/constants/change.d.ts +1 -1
- package/esm/constants/change.js +12 -12
- package/esm/constants/change.js.map +1 -1
- package/esm/constants/events/graph.d.ts +9 -15
- package/esm/constants/events/graph.js +8 -16
- package/esm/constants/events/graph.js.map +1 -1
- package/esm/constants/index.d.ts +1 -0
- package/esm/constants/index.js +1 -0
- package/esm/constants/index.js.map +1 -1
- package/esm/constants/registry.d.ts +22 -0
- package/esm/constants/registry.js +24 -0
- package/esm/constants/registry.js.map +1 -0
- package/esm/elements/combos/base-combo.d.ts +64 -6
- package/esm/elements/combos/base-combo.js +21 -0
- package/esm/elements/combos/base-combo.js.map +1 -1
- package/esm/elements/combos/circle.d.ts +8 -12
- package/esm/elements/combos/circle.js.map +1 -1
- package/esm/elements/combos/rect.d.ts +5 -9
- package/esm/elements/combos/rect.js.map +1 -1
- package/esm/elements/edges/base-edge.d.ts +85 -10
- package/esm/elements/edges/base-edge.js +21 -0
- package/esm/elements/edges/base-edge.js.map +1 -1
- package/esm/elements/edges/cubic-horizontal.d.ts +2 -2
- package/esm/elements/edges/cubic-vertical.d.ts +2 -2
- package/esm/elements/edges/cubic.d.ts +2 -2
- package/esm/elements/edges/polyline.d.ts +2 -2
- package/esm/elements/edges/quadratic.d.ts +2 -2
- package/esm/elements/nodes/base-node.d.ts +125 -13
- package/esm/elements/nodes/base-node.js +25 -1
- package/esm/elements/nodes/base-node.js.map +1 -1
- package/esm/elements/nodes/circle.d.ts +5 -8
- package/esm/elements/nodes/circle.js.map +1 -1
- package/esm/elements/nodes/diamond.d.ts +2 -4
- package/esm/elements/nodes/diamond.js +2 -2
- package/esm/elements/nodes/diamond.js.map +1 -1
- package/esm/elements/nodes/ellipse.d.ts +5 -8
- package/esm/elements/nodes/ellipse.js +1 -1
- package/esm/elements/nodes/ellipse.js.map +1 -1
- package/esm/elements/nodes/hexagon.d.ts +6 -9
- package/esm/elements/nodes/hexagon.js.map +1 -1
- package/esm/elements/nodes/image.d.ts +9 -11
- package/esm/elements/nodes/image.js.map +1 -1
- package/esm/elements/nodes/polygon.d.ts +9 -8
- package/esm/elements/nodes/polygon.js +4 -1
- package/esm/elements/nodes/polygon.js.map +1 -1
- package/esm/elements/nodes/rect.d.ts +2 -3
- package/esm/elements/nodes/rect.js.map +1 -1
- package/esm/elements/nodes/star.d.ts +7 -10
- package/esm/elements/nodes/star.js.map +1 -1
- package/esm/elements/nodes/triangle.d.ts +7 -10
- package/esm/elements/nodes/triangle.js.map +1 -1
- package/esm/exports.d.ts +18 -14
- package/esm/exports.js +8 -6
- package/esm/exports.js.map +1 -1
- package/esm/layouts/index.d.ts +1 -1
- package/esm/layouts/index.js +1 -1
- package/esm/layouts/index.js.map +1 -1
- package/esm/layouts/types.d.ts +6 -6
- package/esm/palettes/index.d.ts +1 -0
- package/esm/palettes/index.js +12 -0
- package/esm/palettes/index.js.map +1 -1
- package/esm/plugins/camera-setting.d.ts +95 -0
- package/esm/plugins/camera-setting.js +65 -0
- package/esm/plugins/camera-setting.js.map +1 -0
- package/esm/plugins/contextmenu.d.ts +8 -5
- package/esm/plugins/contextmenu.js.map +1 -1
- package/esm/plugins/history/events.d.ts +21 -0
- package/esm/plugins/history/events.js +16 -0
- package/esm/plugins/history/events.js.map +1 -0
- package/esm/plugins/history/index.d.ts +82 -0
- package/esm/plugins/history/index.js +168 -0
- package/esm/plugins/history/index.js.map +1 -0
- package/esm/plugins/history/utils.d.ts +31 -0
- package/esm/plugins/history/utils.js +79 -0
- package/esm/plugins/history/utils.js.map +1 -0
- package/esm/plugins/hull/index.d.ts +59 -0
- package/esm/plugins/hull/index.js +107 -0
- package/esm/plugins/hull/index.js.map +1 -0
- package/esm/plugins/hull/shape.d.ts +49 -0
- package/esm/plugins/hull/shape.js +35 -0
- package/esm/plugins/hull/shape.js.map +1 -0
- package/esm/plugins/hull/util.d.ts +12 -0
- package/esm/plugins/hull/util.js +203 -0
- package/esm/plugins/hull/util.js.map +1 -0
- package/esm/plugins/index.d.ts +8 -0
- package/esm/plugins/index.js +4 -0
- package/esm/plugins/index.js.map +1 -1
- package/esm/plugins/legend.d.ts +49 -0
- package/esm/plugins/legend.js +267 -0
- package/esm/plugins/legend.js.map +1 -0
- package/esm/plugins/tooltip.d.ts +12 -10
- package/esm/plugins/tooltip.js +0 -1
- package/esm/plugins/tooltip.js.map +1 -1
- package/esm/preset.js +2 -5
- package/esm/preset.js.map +1 -1
- package/esm/registry/build-in.js +21 -4
- package/esm/registry/build-in.js.map +1 -1
- package/esm/registry/extension/index.d.ts +3 -3
- package/esm/registry/extension/index.js.map +1 -1
- package/esm/registry/index.d.ts +6 -4
- package/esm/registry/index.js +1 -0
- package/esm/registry/index.js.map +1 -1
- package/esm/registry/types.d.ts +4 -6
- package/esm/runtime/batch.d.ts +11 -0
- package/esm/runtime/batch.js +31 -0
- package/esm/runtime/batch.js.map +1 -0
- package/esm/runtime/behavior.d.ts +1 -1
- package/esm/runtime/behavior.js +3 -2
- package/esm/runtime/behavior.js.map +1 -1
- package/esm/runtime/canvas.d.ts +15 -4
- package/esm/runtime/canvas.js +103 -41
- package/esm/runtime/canvas.js.map +1 -1
- package/esm/runtime/data.d.ts +4 -4
- package/esm/runtime/data.js +23 -25
- package/esm/runtime/data.js.map +1 -1
- package/esm/runtime/element.d.ts +6 -23
- package/esm/runtime/element.js +48 -150
- package/esm/runtime/element.js.map +1 -1
- package/esm/runtime/graph.d.ts +71 -6
- package/esm/runtime/graph.js +105 -10
- package/esm/runtime/graph.js.map +1 -1
- package/esm/runtime/layout.d.ts +5 -11
- package/esm/runtime/layout.js +29 -75
- package/esm/runtime/layout.js.map +1 -1
- package/esm/runtime/plugin.d.ts +2 -1
- package/esm/runtime/plugin.js +3 -0
- package/esm/runtime/plugin.js.map +1 -1
- package/esm/runtime/transform.d.ts +11 -0
- package/esm/runtime/transform.js +20 -0
- package/esm/runtime/transform.js.map +1 -0
- package/esm/runtime/types.d.ts +14 -0
- package/esm/spec/index.d.ts +1 -0
- package/esm/spec/spec.d.ts +7 -0
- package/esm/spec/transform.d.ts +12 -0
- package/esm/spec/transform.js +2 -0
- package/esm/spec/transform.js.map +1 -0
- package/esm/themes/base.js +9 -1
- package/esm/themes/base.js.map +1 -1
- package/esm/transforms/arrange-draw-order.d.ts +10 -0
- package/esm/transforms/arrange-draw-order.js +27 -0
- package/esm/transforms/arrange-draw-order.js.map +1 -0
- package/esm/transforms/base-transform.d.ts +7 -0
- package/esm/transforms/base-transform.js +7 -0
- package/esm/transforms/base-transform.js.map +1 -0
- package/esm/transforms/collapse-expand-combo.d.ts +10 -0
- package/esm/transforms/collapse-expand-combo.js +82 -0
- package/esm/transforms/collapse-expand-combo.js.map +1 -0
- package/esm/transforms/index.d.ts +6 -0
- package/esm/transforms/index.js +6 -0
- package/esm/transforms/index.js.map +1 -0
- package/esm/transforms/process-parallel-edges.d.ts +84 -0
- package/esm/transforms/process-parallel-edges.js +215 -0
- package/esm/transforms/process-parallel-edges.js.map +1 -0
- package/esm/transforms/types.d.ts +20 -0
- package/esm/transforms/types.js +11 -0
- package/esm/transforms/types.js.map +1 -0
- package/esm/transforms/update-related-edge.d.ts +9 -0
- package/esm/transforms/update-related-edge.js +20 -0
- package/esm/transforms/update-related-edge.js.map +1 -0
- package/esm/types/canvas.d.ts +1 -1
- package/esm/types/change.d.ts +27 -10
- package/esm/types/element.d.ts +6 -140
- package/esm/types/event.d.ts +42 -7
- package/esm/types/index.d.ts +0 -1
- package/esm/types/node.d.ts +3 -3
- package/esm/types/point.d.ts +1 -0
- package/esm/utils/animation.d.ts +1 -1
- package/esm/utils/animation.js +6 -0
- package/esm/utils/animation.js.map +1 -1
- package/esm/utils/bbox.d.ts +1 -1
- package/esm/utils/behaviors/brush.d.ts +19 -0
- package/esm/utils/behaviors/brush.js +25 -0
- package/esm/utils/behaviors/brush.js.map +1 -0
- package/esm/utils/behaviors/lasso.d.ts +13 -0
- package/esm/utils/behaviors/lasso.js +112 -0
- package/esm/utils/behaviors/lasso.js.map +1 -0
- package/esm/utils/behaviors/utils.d.ts +21 -0
- package/esm/utils/behaviors/utils.js +42 -0
- package/esm/utils/behaviors/utils.js.map +1 -0
- package/esm/utils/change.d.ts +9 -1
- package/esm/utils/change.js +28 -0
- package/esm/utils/change.js.map +1 -1
- package/esm/utils/combo.d.ts +5 -4
- package/esm/utils/combo.js.map +1 -1
- package/esm/utils/edge.d.ts +11 -0
- package/esm/utils/edge.js +1 -1
- package/esm/utils/edge.js.map +1 -1
- package/esm/utils/element.d.ts +19 -11
- package/esm/utils/element.js +19 -9
- package/esm/utils/element.js.map +1 -1
- package/esm/utils/event/events.d.ts +9 -14
- package/esm/utils/event/events.js +3 -8
- package/esm/utils/event/events.js.map +1 -1
- package/esm/utils/extension.d.ts +1 -1
- package/esm/utils/extension.js.map +1 -1
- package/esm/utils/id.d.ts +3 -8
- package/esm/utils/id.js +8 -2
- package/esm/utils/id.js.map +1 -1
- package/esm/utils/line.d.ts +21 -0
- package/esm/utils/line.js +41 -0
- package/esm/utils/line.js.map +1 -0
- package/esm/utils/path.d.ts +35 -0
- package/esm/utils/path.js +143 -0
- package/esm/utils/path.js.map +1 -0
- package/esm/utils/point.d.ts +74 -20
- package/esm/utils/point.js +168 -44
- package/esm/utils/point.js.map +1 -1
- package/esm/utils/polygon.d.ts +17 -0
- package/esm/utils/polygon.js +62 -0
- package/esm/utils/polygon.js.map +1 -0
- package/esm/utils/position.d.ts +14 -1
- package/esm/utils/position.js +16 -0
- package/esm/utils/position.js.map +1 -1
- package/esm/utils/prefix.d.ts +1 -1
- package/esm/utils/prefix.js.map +1 -1
- package/esm/utils/shortcut.d.ts +11 -0
- package/esm/utils/shortcut.js +37 -5
- package/esm/utils/shortcut.js.map +1 -1
- package/esm/utils/style.js.map +1 -1
- package/esm/utils/vector.d.ts +3 -2
- package/esm/utils/vector.js +10 -3
- package/esm/utils/vector.js.map +1 -1
- package/lib/behaviors/brush-select.d.ts +104 -0
- package/lib/behaviors/brush-select.js +203 -0
- package/lib/behaviors/brush-select.js.map +1 -0
- package/lib/behaviors/click-element.d.ts +77 -0
- package/lib/behaviors/click-element.js +112 -0
- package/lib/behaviors/click-element.js.map +1 -0
- package/lib/behaviors/collapse-expand.d.ts +4 -5
- package/lib/behaviors/collapse-expand.js +8 -4
- package/lib/behaviors/collapse-expand.js.map +1 -1
- package/lib/behaviors/create-edge.d.ts +55 -0
- package/lib/behaviors/create-edge.js +145 -0
- package/lib/behaviors/create-edge.js.map +1 -0
- package/lib/behaviors/drag-canvas.d.ts +6 -6
- package/lib/behaviors/drag-canvas.js +15 -7
- package/lib/behaviors/drag-canvas.js.map +1 -1
- package/lib/behaviors/drag-element-force.d.ts +14 -0
- package/lib/behaviors/drag-element-force.js +59 -0
- package/lib/behaviors/drag-element-force.js.map +1 -0
- package/lib/behaviors/drag-element.d.ts +17 -14
- package/lib/behaviors/drag-element.js +17 -9
- package/lib/behaviors/drag-element.js.map +1 -1
- package/lib/behaviors/focus-element.d.ts +4 -3
- package/lib/behaviors/focus-element.js.map +1 -1
- package/lib/behaviors/hover-element.d.ts +4 -5
- package/lib/behaviors/hover-element.js +1 -1
- package/lib/behaviors/hover-element.js.map +1 -1
- package/lib/behaviors/index.d.ts +10 -0
- package/lib/behaviors/index.js +11 -1
- package/lib/behaviors/index.js.map +1 -1
- package/lib/behaviors/lasso-select.d.ts +20 -0
- package/lib/behaviors/lasso-select.js +83 -0
- package/lib/behaviors/lasso-select.js.map +1 -0
- package/lib/behaviors/types.d.ts +1 -0
- package/lib/behaviors/zoom-canvas.d.ts +7 -6
- package/lib/behaviors/zoom-canvas.js +6 -2
- package/lib/behaviors/zoom-canvas.js.map +1 -1
- package/lib/constants/change.d.ts +1 -1
- package/lib/constants/change.js +13 -13
- package/lib/constants/change.js.map +1 -1
- package/lib/constants/events/graph.d.ts +9 -15
- package/lib/constants/events/graph.js +9 -17
- package/lib/constants/events/graph.js.map +1 -1
- package/lib/constants/index.d.ts +1 -0
- package/lib/constants/index.js +1 -0
- package/lib/constants/index.js.map +1 -1
- package/lib/constants/registry.d.ts +22 -0
- package/lib/constants/registry.js +27 -0
- package/lib/constants/registry.js.map +1 -0
- package/lib/elements/combos/base-combo.d.ts +64 -6
- package/lib/elements/combos/base-combo.js +21 -0
- package/lib/elements/combos/base-combo.js.map +1 -1
- package/lib/elements/combos/circle.d.ts +8 -12
- package/lib/elements/combos/circle.js.map +1 -1
- package/lib/elements/combos/rect.d.ts +5 -9
- package/lib/elements/combos/rect.js.map +1 -1
- package/lib/elements/edges/base-edge.d.ts +85 -10
- package/lib/elements/edges/base-edge.js +21 -0
- package/lib/elements/edges/base-edge.js.map +1 -1
- package/lib/elements/edges/cubic-horizontal.d.ts +2 -2
- package/lib/elements/edges/cubic-vertical.d.ts +2 -2
- package/lib/elements/edges/cubic.d.ts +2 -2
- package/lib/elements/edges/polyline.d.ts +2 -2
- package/lib/elements/edges/quadratic.d.ts +2 -2
- package/lib/elements/nodes/base-node.d.ts +125 -13
- package/lib/elements/nodes/base-node.js +25 -1
- package/lib/elements/nodes/base-node.js.map +1 -1
- package/lib/elements/nodes/circle.d.ts +5 -8
- package/lib/elements/nodes/circle.js.map +1 -1
- package/lib/elements/nodes/diamond.d.ts +2 -4
- package/lib/elements/nodes/diamond.js +2 -2
- package/lib/elements/nodes/diamond.js.map +1 -1
- package/lib/elements/nodes/ellipse.d.ts +5 -8
- package/lib/elements/nodes/ellipse.js +1 -1
- package/lib/elements/nodes/ellipse.js.map +1 -1
- package/lib/elements/nodes/hexagon.d.ts +6 -9
- package/lib/elements/nodes/hexagon.js.map +1 -1
- package/lib/elements/nodes/image.d.ts +9 -11
- package/lib/elements/nodes/image.js.map +1 -1
- package/lib/elements/nodes/polygon.d.ts +9 -8
- package/lib/elements/nodes/polygon.js +4 -1
- package/lib/elements/nodes/polygon.js.map +1 -1
- package/lib/elements/nodes/rect.d.ts +2 -3
- package/lib/elements/nodes/rect.js.map +1 -1
- package/lib/elements/nodes/star.d.ts +7 -10
- package/lib/elements/nodes/star.js.map +1 -1
- package/lib/elements/nodes/triangle.d.ts +7 -10
- package/lib/elements/nodes/triangle.js.map +1 -1
- package/lib/exports.d.ts +18 -14
- package/lib/exports.js +26 -1
- package/lib/exports.js.map +1 -1
- package/lib/layouts/index.d.ts +1 -1
- package/lib/layouts/index.js +2 -1
- package/lib/layouts/index.js.map +1 -1
- package/lib/layouts/types.d.ts +6 -6
- package/lib/palettes/index.d.ts +1 -0
- package/lib/palettes/index.js +13 -1
- package/lib/palettes/index.js.map +1 -1
- package/lib/plugins/camera-setting.d.ts +95 -0
- package/lib/plugins/camera-setting.js +69 -0
- package/lib/plugins/camera-setting.js.map +1 -0
- package/lib/plugins/contextmenu.d.ts +8 -5
- package/lib/plugins/contextmenu.js.map +1 -1
- package/lib/plugins/history/events.d.ts +21 -0
- package/lib/plugins/history/events.js +19 -0
- package/lib/plugins/history/events.js.map +1 -0
- package/lib/plugins/history/index.d.ts +82 -0
- package/lib/plugins/history/index.js +175 -0
- package/lib/plugins/history/index.js.map +1 -0
- package/lib/plugins/history/utils.d.ts +31 -0
- package/lib/plugins/history/utils.js +84 -0
- package/lib/plugins/history/utils.js.map +1 -0
- package/lib/plugins/hull/index.d.ts +59 -0
- package/lib/plugins/hull/index.js +114 -0
- package/lib/plugins/hull/index.js.map +1 -0
- package/lib/plugins/hull/shape.d.ts +49 -0
- package/lib/plugins/hull/shape.js +39 -0
- package/lib/plugins/hull/shape.js.map +1 -0
- package/lib/plugins/hull/util.d.ts +12 -0
- package/lib/plugins/hull/util.js +207 -0
- package/lib/plugins/hull/util.js.map +1 -0
- package/lib/plugins/index.d.ts +8 -0
- package/lib/plugins/index.js +9 -1
- package/lib/plugins/index.js.map +1 -1
- package/lib/plugins/legend.d.ts +49 -0
- package/lib/plugins/legend.js +271 -0
- package/lib/plugins/legend.js.map +1 -0
- package/lib/plugins/tooltip.d.ts +12 -10
- package/lib/plugins/tooltip.js +0 -1
- package/lib/plugins/tooltip.js.map +1 -1
- package/lib/preset.js +2 -5
- package/lib/preset.js.map +1 -1
- package/lib/registry/build-in.js +17 -0
- package/lib/registry/build-in.js.map +1 -1
- package/lib/registry/extension/index.d.ts +3 -3
- package/lib/registry/extension/index.js.map +1 -1
- package/lib/registry/index.d.ts +6 -4
- package/lib/registry/index.js +1 -0
- package/lib/registry/index.js.map +1 -1
- package/lib/registry/types.d.ts +4 -6
- package/lib/runtime/batch.d.ts +11 -0
- package/lib/runtime/batch.js +35 -0
- package/lib/runtime/batch.js.map +1 -0
- package/lib/runtime/behavior.d.ts +1 -1
- package/lib/runtime/behavior.js +3 -2
- package/lib/runtime/behavior.js.map +1 -1
- package/lib/runtime/canvas.d.ts +15 -4
- package/lib/runtime/canvas.js +101 -39
- package/lib/runtime/canvas.js.map +1 -1
- package/lib/runtime/data.d.ts +4 -4
- package/lib/runtime/data.js +22 -24
- package/lib/runtime/data.js.map +1 -1
- package/lib/runtime/element.d.ts +6 -23
- package/lib/runtime/element.js +47 -149
- package/lib/runtime/element.js.map +1 -1
- package/lib/runtime/graph.d.ts +71 -6
- package/lib/runtime/graph.js +104 -9
- package/lib/runtime/graph.js.map +1 -1
- package/lib/runtime/layout.d.ts +5 -11
- package/lib/runtime/layout.js +27 -73
- package/lib/runtime/layout.js.map +1 -1
- package/lib/runtime/plugin.d.ts +2 -1
- package/lib/runtime/plugin.js +3 -0
- package/lib/runtime/plugin.js.map +1 -1
- package/lib/runtime/transform.d.ts +11 -0
- package/lib/runtime/transform.js +24 -0
- package/lib/runtime/transform.js.map +1 -0
- package/lib/runtime/types.d.ts +14 -0
- package/lib/spec/index.d.ts +1 -0
- package/lib/spec/spec.d.ts +7 -0
- package/lib/spec/transform.d.ts +12 -0
- package/lib/{types/behavior.js → spec/transform.js} +1 -1
- package/lib/spec/transform.js.map +1 -0
- package/lib/themes/base.js +9 -1
- package/lib/themes/base.js.map +1 -1
- package/lib/transforms/arrange-draw-order.d.ts +10 -0
- package/lib/transforms/arrange-draw-order.js +31 -0
- package/lib/transforms/arrange-draw-order.js.map +1 -0
- package/lib/transforms/base-transform.d.ts +7 -0
- package/lib/transforms/base-transform.js +11 -0
- package/lib/transforms/base-transform.js.map +1 -0
- package/lib/transforms/collapse-expand-combo.d.ts +10 -0
- package/lib/transforms/collapse-expand-combo.js +86 -0
- package/lib/transforms/collapse-expand-combo.js.map +1 -0
- package/lib/transforms/index.d.ts +6 -0
- package/lib/transforms/index.js +14 -0
- package/lib/transforms/index.js.map +1 -0
- package/lib/transforms/process-parallel-edges.d.ts +84 -0
- package/lib/transforms/process-parallel-edges.js +222 -0
- package/lib/transforms/process-parallel-edges.js.map +1 -0
- package/lib/transforms/types.d.ts +20 -0
- package/lib/transforms/types.js +15 -0
- package/lib/transforms/types.js.map +1 -0
- package/lib/transforms/update-related-edge.d.ts +9 -0
- package/lib/transforms/update-related-edge.js +24 -0
- package/lib/transforms/update-related-edge.js.map +1 -0
- package/lib/types/canvas.d.ts +1 -1
- package/lib/types/change.d.ts +27 -10
- package/lib/types/element.d.ts +6 -140
- package/lib/types/event.d.ts +42 -7
- package/lib/types/index.d.ts +0 -1
- package/lib/types/node.d.ts +3 -3
- package/lib/types/point.d.ts +1 -0
- package/lib/utils/animation.d.ts +1 -1
- package/lib/utils/animation.js +6 -0
- package/lib/utils/animation.js.map +1 -1
- package/lib/utils/bbox.d.ts +1 -1
- package/lib/utils/behaviors/brush.d.ts +19 -0
- package/lib/utils/behaviors/brush.js +30 -0
- package/lib/utils/behaviors/brush.js.map +1 -0
- package/lib/utils/behaviors/lasso.d.ts +13 -0
- package/lib/utils/behaviors/lasso.js +116 -0
- package/lib/utils/behaviors/lasso.js.map +1 -0
- package/lib/utils/behaviors/utils.d.ts +21 -0
- package/lib/utils/behaviors/utils.js +47 -0
- package/lib/utils/behaviors/utils.js.map +1 -0
- package/lib/utils/change.d.ts +9 -1
- package/lib/utils/change.js +30 -1
- package/lib/utils/change.js.map +1 -1
- package/lib/utils/combo.d.ts +5 -4
- package/lib/utils/combo.js.map +1 -1
- package/lib/utils/edge.d.ts +11 -0
- package/lib/utils/edge.js +2 -1
- package/lib/utils/edge.js.map +1 -1
- package/lib/utils/element.d.ts +19 -11
- package/lib/utils/element.js +21 -10
- package/lib/utils/element.js.map +1 -1
- package/lib/utils/event/events.d.ts +9 -14
- package/lib/utils/event/events.js +4 -10
- package/lib/utils/event/events.js.map +1 -1
- package/lib/utils/extension.d.ts +1 -1
- package/lib/utils/extension.js.map +1 -1
- package/lib/utils/id.d.ts +3 -8
- package/lib/utils/id.js +10 -4
- package/lib/utils/id.js.map +1 -1
- package/lib/utils/line.d.ts +21 -0
- package/lib/utils/line.js +46 -0
- package/lib/utils/line.js.map +1 -0
- package/lib/utils/path.d.ts +35 -0
- package/lib/utils/path.js +150 -0
- package/lib/utils/path.js.map +1 -0
- package/lib/utils/point.d.ts +74 -20
- package/lib/utils/point.js +178 -48
- package/lib/utils/point.js.map +1 -1
- package/lib/utils/polygon.d.ts +17 -0
- package/lib/utils/polygon.js +66 -0
- package/lib/utils/polygon.js.map +1 -0
- package/lib/utils/position.d.ts +14 -1
- package/lib/utils/position.js +18 -1
- package/lib/utils/position.js.map +1 -1
- package/lib/utils/prefix.d.ts +1 -1
- package/lib/utils/prefix.js.map +1 -1
- package/lib/utils/shortcut.d.ts +11 -0
- package/lib/utils/shortcut.js +36 -4
- package/lib/utils/shortcut.js.map +1 -1
- package/lib/utils/style.js.map +1 -1
- package/lib/utils/vector.d.ts +3 -2
- package/lib/utils/vector.js +10 -3
- package/lib/utils/vector.js.map +1 -1
- package/package.json +6 -7
- package/src/behaviors/brush-select.ts +306 -0
- package/src/behaviors/click-element.ts +182 -0
- package/src/behaviors/collapse-expand.ts +13 -11
- package/src/behaviors/create-edge.ts +206 -0
- package/src/behaviors/drag-canvas.ts +22 -14
- package/src/behaviors/drag-element-force.ts +70 -0
- package/src/behaviors/drag-element.ts +32 -25
- package/src/behaviors/focus-element.ts +7 -6
- package/src/behaviors/hover-element.ts +16 -13
- package/src/behaviors/index.ts +10 -0
- package/src/behaviors/lasso-select.ts +103 -0
- package/src/behaviors/types.ts +2 -0
- package/src/behaviors/zoom-canvas.ts +14 -9
- package/src/constants/change.ts +1 -1
- package/src/constants/events/graph.ts +8 -16
- package/src/constants/index.ts +1 -0
- package/src/constants/registry.ts +22 -0
- package/src/elements/combos/base-combo.ts +83 -10
- package/src/elements/combos/circle.ts +8 -11
- package/src/elements/combos/rect.ts +5 -8
- package/src/elements/edges/base-edge.ts +95 -14
- package/src/elements/edges/cubic-horizontal.ts +2 -2
- package/src/elements/edges/cubic-vertical.ts +2 -2
- package/src/elements/edges/cubic.ts +2 -2
- package/src/elements/edges/polyline.ts +2 -2
- package/src/elements/edges/quadratic.ts +2 -2
- package/src/elements/nodes/base-node.ts +140 -20
- package/src/elements/nodes/circle.ts +5 -7
- package/src/elements/nodes/diamond.ts +4 -6
- package/src/elements/nodes/ellipse.ts +6 -8
- package/src/elements/nodes/hexagon.ts +7 -9
- package/src/elements/nodes/image.ts +12 -13
- package/src/elements/nodes/polygon.ts +17 -11
- package/src/elements/nodes/rect.ts +3 -4
- package/src/elements/nodes/star.ts +9 -11
- package/src/elements/nodes/triangle.ts +7 -9
- package/src/exports.ts +57 -12
- package/src/layouts/index.ts +1 -0
- package/src/layouts/types.ts +7 -5
- package/src/palettes/index.ts +13 -0
- package/src/plugins/camera-setting.ts +153 -0
- package/src/plugins/contextmenu.ts +10 -7
- package/src/plugins/history/events.ts +25 -0
- package/src/plugins/history/index.ts +222 -0
- package/src/plugins/history/utils.ts +98 -0
- package/src/plugins/hull/index.ts +149 -0
- package/src/plugins/hull/shape.ts +96 -0
- package/src/plugins/hull/util.ts +222 -0
- package/src/plugins/index.ts +8 -0
- package/src/plugins/legend.ts +321 -0
- package/src/plugins/tooltip.ts +16 -15
- package/src/preset.ts +2 -6
- package/src/registry/build-in.ts +33 -3
- package/src/registry/extension/index.ts +5 -5
- package/src/registry/index.ts +11 -4
- package/src/registry/types.ts +2 -7
- package/src/runtime/batch.ts +38 -0
- package/src/runtime/behavior.ts +4 -3
- package/src/runtime/canvas.ts +130 -52
- package/src/runtime/data.ts +31 -36
- package/src/runtime/element.ts +78 -185
- package/src/runtime/graph.ts +121 -15
- package/src/runtime/layout.ts +48 -79
- package/src/runtime/plugin.ts +5 -1
- package/src/runtime/transform.ts +27 -0
- package/src/runtime/types.ts +14 -0
- package/src/spec/index.ts +1 -0
- package/src/spec/spec.ts +7 -0
- package/src/spec/transform.ts +15 -0
- package/src/themes/base.ts +9 -1
- package/src/transforms/arrange-draw-order.ts +36 -0
- package/src/transforms/base-transform.ts +11 -0
- package/src/transforms/collapse-expand-combo.ts +87 -0
- package/src/transforms/index.ts +7 -0
- package/src/transforms/process-parallel-edges.ts +286 -0
- package/src/transforms/types.ts +23 -0
- package/src/transforms/update-related-edge.ts +28 -0
- package/src/types/canvas.ts +1 -1
- package/src/types/change.ts +28 -10
- package/src/types/element.ts +6 -147
- package/src/types/event.ts +62 -7
- package/src/types/index.ts +0 -1
- package/src/types/node.ts +3 -3
- package/src/types/point.ts +1 -0
- package/src/utils/animation.ts +6 -0
- package/src/utils/bbox.ts +1 -1
- package/src/utils/behaviors/brush.ts +29 -0
- package/src/utils/behaviors/lasso.ts +127 -0
- package/src/utils/behaviors/utils.ts +47 -0
- package/src/utils/change.ts +42 -1
- package/src/utils/combo.ts +6 -5
- package/src/utils/edge.ts +6 -1
- package/src/utils/element.ts +22 -11
- package/src/utils/event/events.ts +18 -18
- package/src/utils/extension.ts +1 -1
- package/src/utils/id.ts +11 -2
- package/src/utils/line.ts +50 -0
- package/src/utils/path.ts +153 -0
- package/src/utils/point.ts +190 -51
- package/src/utils/polygon.ts +72 -0
- package/src/utils/position.ts +18 -1
- package/src/utils/prefix.ts +1 -1
- package/src/utils/shortcut.ts +41 -5
- package/src/utils/style.ts +1 -1
- package/src/utils/vector.ts +10 -3
- package/dist/lib/types/behavior.d.ts +0 -5
- package/esm/elements/types.d.ts +0 -0
- package/esm/elements/types.js +0 -15
- package/esm/elements/types.js.map +0 -1
- package/esm/types/behavior.d.ts +0 -5
- package/esm/types/behavior.js +0 -2
- package/esm/types/behavior.js.map +0 -1
- package/lib/elements/types.d.ts +0 -0
- package/lib/elements/types.js +0 -15
- package/lib/elements/types.js.map +0 -1
- package/lib/types/behavior.d.ts +0 -5
- package/lib/types/behavior.js.map +0 -1
- package/src/elements/types.ts +0 -21
- package/src/types/behavior.ts +0 -6
|
@@ -2,16 +2,17 @@ import type { DisplayObjectConfig, PolygonStyleProps as GPolygonStyleProps, Grou
|
|
|
2
2
|
import type { Point } from '../../types';
|
|
3
3
|
import type { BaseNodeStyleProps } from './base-node';
|
|
4
4
|
import { BaseNode } from './base-node';
|
|
5
|
-
export type PolygonStyleProps = BaseNodeStyleProps<
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
export type PolygonStyleProps<T extends Record<string, unknown> = Record<string, any>> = BaseNodeStyleProps<T & {
|
|
6
|
+
points: ([number, number] | [number, number, number])[];
|
|
7
|
+
}>;
|
|
8
8
|
/**
|
|
9
9
|
* Abstract class for polygon nodes,i.e triangle, diamond, hexagon, etc.
|
|
10
10
|
*/
|
|
11
|
-
export declare abstract class Polygon extends BaseNode<
|
|
12
|
-
constructor(options: DisplayObjectConfig<PolygonStyleProps
|
|
13
|
-
|
|
14
|
-
protected
|
|
15
|
-
protected
|
|
11
|
+
export declare abstract class Polygon<T extends PolygonStyleProps = PolygonStyleProps> extends BaseNode<T> {
|
|
12
|
+
constructor(options: DisplayObjectConfig<PolygonStyleProps<T>>);
|
|
13
|
+
get parsedAttributes(): Required<PolygonStyleProps<T>>;
|
|
14
|
+
protected drawKeyShape(attributes: Required<PolygonStyleProps<T>>, container: Group): any;
|
|
15
|
+
protected getKeyStyle(attributes: Required<PolygonStyleProps<T>>): GPolygonStyleProps;
|
|
16
|
+
protected abstract getPoints(attributes: Required<PolygonStyleProps<T>>): Point[];
|
|
16
17
|
getIntersectPoint(point: Point): Point;
|
|
17
18
|
}
|
|
@@ -3,16 +3,15 @@ import { Rect as GRect } from '@antv/g';
|
|
|
3
3
|
import type { IconStyleProps } from '../shapes';
|
|
4
4
|
import type { BaseNodeStyleProps } from './base-node';
|
|
5
5
|
import { BaseNode } from './base-node';
|
|
6
|
-
export type RectStyleProps = BaseNodeStyleProps
|
|
6
|
+
export type RectStyleProps = BaseNodeStyleProps;
|
|
7
7
|
type ParsedRectStyleProps = Required<RectStyleProps>;
|
|
8
|
-
type KeyStyleProps = GRectStyleProps;
|
|
9
8
|
/**
|
|
10
9
|
* Draw Rect based on BaseNode, override drawKeyShape.
|
|
11
10
|
*/
|
|
12
11
|
export declare class Rect extends BaseNode<RectStyleProps> {
|
|
13
12
|
static defaultStyleProps: Partial<RectStyleProps>;
|
|
14
13
|
constructor(options: DisplayObjectConfig<RectStyleProps>);
|
|
15
|
-
protected getKeyStyle(attributes: ParsedRectStyleProps):
|
|
14
|
+
protected getKeyStyle(attributes: ParsedRectStyleProps): GRectStyleProps;
|
|
16
15
|
protected getIconStyle(attributes: ParsedRectStyleProps): false | IconStyleProps;
|
|
17
16
|
protected drawKeyShape(attributes: ParsedRectStyleProps, container: Group): GRect | undefined;
|
|
18
17
|
}
|
|
@@ -2,23 +2,20 @@ import type { DisplayObjectConfig } from '@antv/g';
|
|
|
2
2
|
import type { Point } from '../../types';
|
|
3
3
|
import type { IconStyleProps } from '../shapes';
|
|
4
4
|
import { NodePortStyleProps } from './base-node';
|
|
5
|
-
import type {
|
|
5
|
+
import type { PolygonStyleProps } from './polygon';
|
|
6
6
|
import { Polygon } from './polygon';
|
|
7
|
-
export type StarStyleProps = PolygonStyleProps
|
|
8
|
-
type ParsedStarStyleProps = ParsedPolygonStyleProps & Required<ExtendsStyleProps>;
|
|
9
|
-
type ExtendsStyleProps = {
|
|
7
|
+
export type StarStyleProps = PolygonStyleProps<{
|
|
10
8
|
/**
|
|
11
9
|
* <zh/> 内半径
|
|
12
10
|
* <en/> Inner radius
|
|
13
11
|
*/
|
|
14
12
|
innerR?: number;
|
|
15
|
-
}
|
|
16
|
-
export declare class Star extends Polygon {
|
|
13
|
+
}>;
|
|
14
|
+
export declare class Star extends Polygon<StarStyleProps> {
|
|
17
15
|
constructor(options: DisplayObjectConfig<StarStyleProps>);
|
|
18
16
|
private getInnerR;
|
|
19
17
|
private getOuterR;
|
|
20
|
-
protected getPoints(attributes:
|
|
21
|
-
protected getIconStyle(attributes:
|
|
22
|
-
protected getPortXY(attributes:
|
|
18
|
+
protected getPoints(attributes: Required<StarStyleProps>): Point[];
|
|
19
|
+
protected getIconStyle(attributes: Required<StarStyleProps>): false | IconStyleProps;
|
|
20
|
+
protected getPortXY(attributes: Required<StarStyleProps>, style: NodePortStyleProps): Point;
|
|
23
21
|
}
|
|
24
|
-
export {};
|
|
@@ -2,23 +2,20 @@ import type { DisplayObjectConfig } from '@antv/g';
|
|
|
2
2
|
import type { Point } from '../../types';
|
|
3
3
|
import { IconStyleProps } from '../shapes';
|
|
4
4
|
import type { NodePortStyleProps } from './base-node';
|
|
5
|
-
import type {
|
|
5
|
+
import type { PolygonStyleProps } from './polygon';
|
|
6
6
|
import { Polygon } from './polygon';
|
|
7
|
-
export type TriangleStyleProps = PolygonStyleProps
|
|
8
|
-
type ParsedTriangleStyleProps = ParsedPolygonStyleProps & Required<ExtendsStyleProps>;
|
|
9
|
-
type ExtendsStyleProps = {
|
|
7
|
+
export type TriangleStyleProps = PolygonStyleProps<{
|
|
10
8
|
/**
|
|
11
9
|
* <zh/> 三角形的方向
|
|
12
10
|
* <en/> The direction of the triangle
|
|
13
11
|
*/
|
|
14
12
|
direction?: TriangleDirection;
|
|
15
|
-
}
|
|
13
|
+
}>;
|
|
16
14
|
export type TriangleDirection = 'up' | 'left' | 'right' | 'down';
|
|
17
|
-
export declare class Triangle extends Polygon {
|
|
15
|
+
export declare class Triangle extends Polygon<TriangleStyleProps> {
|
|
18
16
|
static defaultStyleProps: Partial<TriangleStyleProps>;
|
|
19
17
|
constructor(options: DisplayObjectConfig<TriangleStyleProps>);
|
|
20
|
-
protected getPoints(attributes:
|
|
21
|
-
protected getPortXY(attributes:
|
|
22
|
-
protected getIconStyle(attributes:
|
|
18
|
+
protected getPoints(attributes: Required<TriangleStyleProps>): Point[];
|
|
19
|
+
protected getPortXY(attributes: Required<TriangleStyleProps>, style: NodePortStyleProps): Point;
|
|
20
|
+
protected getIconStyle(attributes: Required<TriangleStyleProps>): false | IconStyleProps;
|
|
23
21
|
}
|
|
24
|
-
export {};
|
package/dist/lib/exports.d.ts
CHANGED
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
import { idOf } from './utils/id';
|
|
2
2
|
import { omitStyleProps, subStyleProps } from './utils/prefix';
|
|
3
3
|
import { treeToGraphData } from './utils/tree';
|
|
4
|
-
export { BaseBehavior } from './behaviors';
|
|
5
|
-
export { CanvasEvent, ComboEvent, CommonEvent, ContainerEvent, EdgeEvent, GraphEvent, NodeEvent } from './constants';
|
|
6
|
-
export { BaseCombo } from './elements/combos';
|
|
7
|
-
export { BaseEdge } from './elements/edges';
|
|
8
|
-
export { BaseNode } from './elements/nodes';
|
|
4
|
+
export { BaseBehavior, DragCanvas, ZoomCanvas } from './behaviors';
|
|
5
|
+
export { CanvasEvent, ComboEvent, CommonEvent, ContainerEvent, EdgeEvent, ExtensionCategory, GraphEvent, NodeEvent, } from './constants';
|
|
6
|
+
export { BaseCombo, CircleCombo, RectCombo } from './elements/combos';
|
|
7
|
+
export { BaseEdge, Cubic, CubicHorizontal, CubicVertical, Line, Polyline, Quadratic } from './elements/edges';
|
|
8
|
+
export { BaseNode, Circle, Diamond, Ellipse, Hexagon, Image, Rect, Star, Triangle } from './elements/nodes';
|
|
9
9
|
export { BaseShape } from './elements/shapes';
|
|
10
|
-
export { BasePlugin } from './plugins';
|
|
10
|
+
export { BasePlugin, CameraSetting, History } from './plugins';
|
|
11
11
|
export { getExtension, getExtensions, register } from './registry';
|
|
12
12
|
export { Graph } from './runtime/graph';
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export type {
|
|
16
|
-
export type {
|
|
13
|
+
export { BaseTransform } from './transforms';
|
|
14
|
+
export { Shortcut } from './utils/shortcut';
|
|
15
|
+
export type { BaseBehaviorOptions, DragCanvasOptions, ZoomCanvasOptions } from './behaviors';
|
|
16
|
+
export type { BaseComboStyleProps, CircleComboStyleProps, RectComboStyleProps } from './elements/combos';
|
|
17
|
+
export type { BaseEdgeStyleProps, CubicHorizontalStyleProps, CubicStyleProps, CubicVerticalStyleProps, LineStyleProps, PolylineStyleProps, QuadraticStyleProps, } from './elements/edges';
|
|
18
|
+
export type { BaseNodeStyleProps, CircleStyleProps, DiamondStyleProps, EllipseStyleProps, HexagonStyleProps, ImageStyleProps, RectStyleProps, StarStyleProps, TriangleStyleProps, } from './elements/nodes';
|
|
17
19
|
export type { BaseShapeStyleProps } from './elements/shapes';
|
|
18
|
-
export type { BasePluginOptions } from './plugins';
|
|
20
|
+
export type { BasePluginOptions, CameraSettingOptions, Hull } from './plugins';
|
|
19
21
|
export type { RuntimeContext } from './runtime/types';
|
|
20
22
|
export type { BehaviorOptions, CanvasOptions, ComboData, ComboOptions, EdgeData, EdgeOptions, G6Spec, GraphData, LayoutOptions, NodeData, NodeOptions, PluginOptions, ThemeOptions, ViewportOptions, } from './spec';
|
|
21
|
-
export type {
|
|
23
|
+
export type { BaseTransformOptions } from './transforms';
|
|
24
|
+
export type { IAnimateEvent, IDragEvent, IElementLifeCycleEvent, IEvent, IGraphLifeCycleEvent, IKeyboardEvent, IPointerEvent, IViewportEvent, IWheelEvent, Point, Vector2, Vector3, ViewportAnimationEffectTiming, } from './types';
|
|
25
|
+
export type { ShortcutKey } from './utils/shortcut';
|
|
22
26
|
declare const Utils: {
|
|
23
27
|
idOf: typeof idOf;
|
|
24
28
|
treeToGraphData: typeof treeToGraphData;
|
|
@@ -26,7 +30,7 @@ declare const Utils: {
|
|
|
26
30
|
omitStyleProps: typeof omitStyleProps;
|
|
27
31
|
};
|
|
28
32
|
declare const Theme: {
|
|
29
|
-
dark: import("
|
|
30
|
-
light: import("
|
|
33
|
+
dark: import("./themes/types").Theme;
|
|
34
|
+
light: import("./themes/types").Theme;
|
|
31
35
|
};
|
|
32
36
|
export { Theme, Utils };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="src/layouts/hierarchy" />
|
|
2
2
|
export { compactBox, dendrogram, indented, mindmap } from '@antv/hierarchy';
|
|
3
|
-
export { AntVDagreLayout, CircularLayout, ComboCombinedLayout, ConcentricLayout, D3ForceLayout, DagreLayout, ForceAtlas2Layout, ForceLayout, FruchtermanLayout, GridLayout, MDSLayout, RadialLayout, RandomLayout, } from '@antv/layout';
|
|
3
|
+
export { AntVDagreLayout, CircularLayout, ComboCombinedLayout, ConcentricLayout, D3Force3DLayout, D3ForceLayout, DagreLayout, ForceAtlas2Layout, ForceLayout, FruchtermanLayout, GridLayout, MDSLayout, RadialLayout, RandomLayout, } from '@antv/layout';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { AntVDagreLayoutOptions, CircularLayoutOptions, ConcentricLayoutOptions, D3ForceLayoutOptions, DagreLayoutOptions, ForceAtlas2LayoutOptions, ForceLayoutOptions, FruchtermanLayoutOptions, GridLayoutOptions, MDSLayoutOptions, RadialLayoutOptions, RandomLayoutOptions } from '@antv/layout';
|
|
1
|
+
import type { AntVDagreLayoutOptions, CircularLayoutOptions, ConcentricLayoutOptions, D3Force3DLayoutOptions, D3ForceLayoutOptions, DagreLayoutOptions, ForceAtlas2LayoutOptions, ForceLayoutOptions, FruchtermanLayoutOptions, GridLayoutOptions, MDSLayoutOptions, RadialLayoutOptions, RandomLayoutOptions } from '@antv/layout';
|
|
2
2
|
import type { NodeData } from '../spec/data';
|
|
3
|
-
export type BuiltInLayoutOptions = AntVDagreLayout | CircularLayout | ConcentricLayout | D3ForceLayout | DagreLayout | ForceAtlas2 | ForceLayout | FruchtermanLayout | GridLayout | MDSLayout | RadialLayout | RandomLayout;
|
|
4
|
-
export interface BaseLayoutOptions extends AnimationOptions, WebWorkerLayoutOptions
|
|
3
|
+
export type BuiltInLayoutOptions = AntVDagreLayout | CircularLayout | ConcentricLayout | D3ForceLayout | D3Force3DLayout | DagreLayout | ForceAtlas2 | ForceLayout | FruchtermanLayout | GridLayout | MDSLayout | RadialLayout | RandomLayout;
|
|
4
|
+
export interface BaseLayoutOptions extends AnimationOptions, WebWorkerLayoutOptions {
|
|
5
5
|
type: string;
|
|
6
6
|
/**
|
|
7
7
|
* <zh/> 参与该布局的节点
|
|
@@ -37,6 +37,9 @@ interface FruchtermanLayout extends BaseLayoutOptions, FruchtermanLayoutOptions
|
|
|
37
37
|
interface D3ForceLayout extends BaseLayoutOptions, D3ForceLayoutOptions {
|
|
38
38
|
type: 'd3force';
|
|
39
39
|
}
|
|
40
|
+
interface D3Force3DLayout extends BaseLayoutOptions, D3Force3DLayoutOptions {
|
|
41
|
+
type: 'd3force3d';
|
|
42
|
+
}
|
|
40
43
|
interface ForceLayout extends BaseLayoutOptions, ForceLayoutOptions {
|
|
41
44
|
type: 'force' | 'gforce';
|
|
42
45
|
}
|
|
@@ -49,9 +52,6 @@ interface AntVDagreLayout extends BaseLayoutOptions, AntVDagreLayoutOptions {
|
|
|
49
52
|
interface DagreLayout extends BaseLayoutOptions, DagreLayoutOptions {
|
|
50
53
|
type: 'dagre';
|
|
51
54
|
}
|
|
52
|
-
export interface PresetLayoutOptions {
|
|
53
|
-
presetLayout?: BaseLayoutOptions;
|
|
54
|
-
}
|
|
55
55
|
export interface AnimationOptions {
|
|
56
56
|
/**
|
|
57
57
|
* <zh/> 启用布局动画,对于迭代布局,会在两次迭代之间进行动画过渡
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type { RuntimeContext } from '../runtime/types';
|
|
2
|
+
import type { BasePluginOptions } from './base-plugin';
|
|
3
|
+
import { BasePlugin } from './base-plugin';
|
|
4
|
+
export interface CameraSettingOptions extends BasePluginOptions {
|
|
5
|
+
/**
|
|
6
|
+
* <zh/> 投影模式,透视投影仅在 3D 场景下有效
|
|
7
|
+
*
|
|
8
|
+
* <en/> Projection mode, perspective projection is only valid in 3D scenes
|
|
9
|
+
*/
|
|
10
|
+
projectionMode?: 'perspective' | 'orthographic';
|
|
11
|
+
/**
|
|
12
|
+
* <zh/> 相机类型
|
|
13
|
+
* - orbiting: 固定视点,改变相机位置
|
|
14
|
+
* - exploring: 类似 orbiting,但允许相机在北极和南极之间旋转
|
|
15
|
+
* - tracking: 固定相机位置,改变视点
|
|
16
|
+
*
|
|
17
|
+
* <en/> Camera type
|
|
18
|
+
* - orbiting: Fixed viewpoint, change camera position
|
|
19
|
+
* - exploring: Similar to orbiting, but allows the camera to rotate between the North Pole and the South Pole
|
|
20
|
+
* - tracking: Fixed camera position, change viewpoint
|
|
21
|
+
*/
|
|
22
|
+
cameraType?: 'orbiting' | 'exploring' | 'tracking';
|
|
23
|
+
/**
|
|
24
|
+
* <zh/> 近平面位置
|
|
25
|
+
*
|
|
26
|
+
* <en/> The position of the near plane
|
|
27
|
+
*/
|
|
28
|
+
near?: number;
|
|
29
|
+
/**
|
|
30
|
+
* <zh/> 远平面位置
|
|
31
|
+
*
|
|
32
|
+
* <en/> The position of the far plane
|
|
33
|
+
*/
|
|
34
|
+
far?: number;
|
|
35
|
+
/**
|
|
36
|
+
* <zh/> 相机视角,仅在透视相机下有效
|
|
37
|
+
*
|
|
38
|
+
* <en/> Camera field of view, only valid in perspective camera
|
|
39
|
+
*/
|
|
40
|
+
fov?: number;
|
|
41
|
+
/**
|
|
42
|
+
* <zh/> 相机视口宽高比,仅在透视相机下有效。设置为 'auto' 时,会自动根据画布宽高比设置
|
|
43
|
+
*
|
|
44
|
+
* <en/> Camera viewport aspect ratio, only valid in perspective camera. When set to 'auto', it will be automatically set according to the canvas aspect ratio
|
|
45
|
+
*/
|
|
46
|
+
aspect?: number | 'auto';
|
|
47
|
+
/**
|
|
48
|
+
* <zh/> 相机距离目标的距离,默认为 500
|
|
49
|
+
*
|
|
50
|
+
* <en/> The distance from the camera to the target, default is 100.
|
|
51
|
+
*/
|
|
52
|
+
distance?: number;
|
|
53
|
+
/**
|
|
54
|
+
* <zh/> 最小视距
|
|
55
|
+
*
|
|
56
|
+
* <en/> Minimum distance
|
|
57
|
+
*/
|
|
58
|
+
minDistance?: number;
|
|
59
|
+
/**
|
|
60
|
+
* <zh/> 最大视距
|
|
61
|
+
*
|
|
62
|
+
* <en/> Maximum distance
|
|
63
|
+
*/
|
|
64
|
+
maxDistance?: number;
|
|
65
|
+
/**
|
|
66
|
+
* <zh/> 滚转角
|
|
67
|
+
*
|
|
68
|
+
* <en/> Roll
|
|
69
|
+
*/
|
|
70
|
+
roll?: number;
|
|
71
|
+
/**
|
|
72
|
+
* <zh/> 仰角
|
|
73
|
+
*
|
|
74
|
+
* <en/> Elevation
|
|
75
|
+
*/
|
|
76
|
+
elevation?: number;
|
|
77
|
+
/**
|
|
78
|
+
* <zh/> 方位角
|
|
79
|
+
*
|
|
80
|
+
* <en/> Azimuth
|
|
81
|
+
*/
|
|
82
|
+
azimuth?: number;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* <zh/> 配置相机参数
|
|
86
|
+
*
|
|
87
|
+
* <en/> Configure camera parameters
|
|
88
|
+
*/
|
|
89
|
+
export declare class CameraSetting extends BasePlugin<CameraSettingOptions> {
|
|
90
|
+
constructor(context: RuntimeContext, options: CameraSettingOptions);
|
|
91
|
+
update(options: Partial<CameraSettingOptions>): void;
|
|
92
|
+
private bindEvents;
|
|
93
|
+
private setOptions;
|
|
94
|
+
private getCanvasAspect;
|
|
95
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { RuntimeContext } from '../runtime/types';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Element } from '../types';
|
|
3
|
+
import type { IPointerEvent } from '../types/event';
|
|
3
4
|
import type { Item } from '../utils/contextmenu';
|
|
4
5
|
import type { BasePluginOptions } from './base-plugin';
|
|
5
6
|
import { BasePlugin } from './base-plugin';
|
|
@@ -32,12 +33,12 @@ export type ContextmenuOptions = BasePluginOptions & {
|
|
|
32
33
|
* <zh/> 返回菜单的项目列表,支持 `Promise` 类型的返回值。是 `getContent` 的快捷配置。
|
|
33
34
|
* <en/> Return the list of menu items, support the `Promise` type return value. It is a shortcut configuration of `getContent`.
|
|
34
35
|
*/
|
|
35
|
-
getItems?: (event:
|
|
36
|
+
getItems?: (event: IElementEvent) => Item[] | Promise<Item[]>;
|
|
36
37
|
/**
|
|
37
38
|
* <zh/> 返回菜单的内容,支持 `Promise` 类型的返回值,也可以使用 `getItems` 来快捷配置。
|
|
38
39
|
* <en/> Return the content of menu, support the `Promise` type return value, you can also use `getItems` for shortcut configuration.
|
|
39
40
|
*/
|
|
40
|
-
getContent?: (event:
|
|
41
|
+
getContent?: (event: IElementEvent) => HTMLElement | string | Promise<HTMLElement | string>;
|
|
41
42
|
/**
|
|
42
43
|
* <zh/> Loading 时候的菜单内容,用于 getContent 返回 Promise 的时候。
|
|
43
44
|
* <en/> The menu content when loading is used when getContent returns a Promise.
|
|
@@ -47,7 +48,7 @@ export type ContextmenuOptions = BasePluginOptions & {
|
|
|
47
48
|
* <zh/> 插件是否可用,通过参数来判断是否支持右键菜单,默认全部可用。
|
|
48
49
|
* <en/> Whether the plugin is available, determine whether the right-click menu is supported through parameters, The default is all available.
|
|
49
50
|
*/
|
|
50
|
-
enable?: boolean | ((event:
|
|
51
|
+
enable?: boolean | ((event: IElementEvent) => boolean);
|
|
51
52
|
};
|
|
52
53
|
/**
|
|
53
54
|
* <zh/> 支持处理事件,并显示右键菜单,在菜单点击之后,可以触发相应的事件。
|
|
@@ -63,7 +64,7 @@ export declare class Contextmenu extends BasePlugin<ContextmenuOptions> {
|
|
|
63
64
|
* <en/> Display the right-click menu based on the incoming element.
|
|
64
65
|
* @param e - 事件
|
|
65
66
|
*/
|
|
66
|
-
showContextmenu(e:
|
|
67
|
+
showContextmenu(e: IElementEvent): Promise<void>;
|
|
67
68
|
/**
|
|
68
69
|
* <zh/> 隐藏右键菜单。
|
|
69
70
|
* <en/> Hide the right-click menu.
|
|
@@ -86,3 +87,5 @@ export declare class Contextmenu extends BasePlugin<ContextmenuOptions> {
|
|
|
86
87
|
private onTriggerEvent;
|
|
87
88
|
private onMenuItemClick;
|
|
88
89
|
}
|
|
90
|
+
type IElementEvent = IPointerEvent<Element>;
|
|
91
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Loosen } from '../../types';
|
|
2
|
+
import type { Command } from './utils';
|
|
3
|
+
export interface IHistoryEvent {
|
|
4
|
+
cmd?: Command | null;
|
|
5
|
+
}
|
|
6
|
+
export type HistoryEventHandler = (e: IHistoryEvent) => void;
|
|
7
|
+
export declare enum HistoryEvent {
|
|
8
|
+
/** <zh/> 当命令被撤销时 | <en/> When the command is undone */
|
|
9
|
+
UNDO = "undo",
|
|
10
|
+
/** <zh/> 当命令被重做时 | <en/> When the command is redone */
|
|
11
|
+
REDO = "redo",
|
|
12
|
+
/** <zh/> 当命令被取消时 | <en/> When the command is canceled */
|
|
13
|
+
CANCEL = "cancel",
|
|
14
|
+
/** <zh/> 当命令被添加到队列时 | <en/> When the command is added */
|
|
15
|
+
ADD = "add",
|
|
16
|
+
/** <zh/> 当历史队列被清空时 | <en/> When the command queue is cleared */
|
|
17
|
+
CLEAR = "clear",
|
|
18
|
+
/** <zh/> 当历史队列发生变化时 | <en/> When the command queue changes */
|
|
19
|
+
CHANGE = "change"
|
|
20
|
+
}
|
|
21
|
+
export type HistoryEventName = Loosen<HistoryEvent>;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { RuntimeContext } from '../../runtime/types';
|
|
2
|
+
import type { BasePluginOptions } from '../base-plugin';
|
|
3
|
+
import { BasePlugin } from '../base-plugin';
|
|
4
|
+
import type { HistoryEventHandler, HistoryEventName } from './events';
|
|
5
|
+
import type { Command } from './utils';
|
|
6
|
+
export interface HistoryOptions extends BasePluginOptions {
|
|
7
|
+
/**
|
|
8
|
+
* <zh/> 最多记录该数据长度的历史记录,默认为 0 表示不做限制
|
|
9
|
+
*/
|
|
10
|
+
stackSize?: number;
|
|
11
|
+
/**
|
|
12
|
+
* <zh/> 当一个命令被添加到 Undo/Redo 队列前被调用,如果该方法返回 false,那么这个命令将不会被添加到队列中。revert 为 true 时表示撤销操作,为 false 时表示重做操作
|
|
13
|
+
*
|
|
14
|
+
* <en/> Called before a command is added to the Undo/Redo queue. If this method returns false, the command will not be added to the queue. revert is true for undo operations and false for redo operations
|
|
15
|
+
*/
|
|
16
|
+
beforeAddCommand?: (cmd: Command, revert?: boolean) => boolean | void;
|
|
17
|
+
/**
|
|
18
|
+
* <zh/> 当一个命令被添加到 Undo/Redo 队列后被调用。revert 为 true 时表示撤销操作,为 false 时表示重做操作
|
|
19
|
+
*
|
|
20
|
+
* <en/> Called after a command is added to the Undo/Redo queue. revert is true for undo operations and false for redo operations
|
|
21
|
+
*/
|
|
22
|
+
afterAddCommand?: (cmd: Command, revert?: boolean) => void;
|
|
23
|
+
/**
|
|
24
|
+
* <zh/> 执行命令时的回调函数
|
|
25
|
+
*
|
|
26
|
+
* <en/> Callback function when executing a command
|
|
27
|
+
*/
|
|
28
|
+
executeCommand?: (cmd: Command) => void;
|
|
29
|
+
}
|
|
30
|
+
export declare class History extends BasePlugin<HistoryOptions> {
|
|
31
|
+
static defaultOptions: Partial<HistoryOptions>;
|
|
32
|
+
private emitter;
|
|
33
|
+
private batchChanges;
|
|
34
|
+
private batchAnimation;
|
|
35
|
+
undoStack: Command[];
|
|
36
|
+
redoStack: Command[];
|
|
37
|
+
private isFirstDraw;
|
|
38
|
+
private freezed;
|
|
39
|
+
constructor(context: RuntimeContext, options: HistoryOptions);
|
|
40
|
+
/**
|
|
41
|
+
* <zh/> 是否可以执行撤销操作
|
|
42
|
+
* <en/> Whether undo can be done
|
|
43
|
+
* @returns <zh/> 是否可以执行撤销操作 | <en/> Whether undo can be done
|
|
44
|
+
*/
|
|
45
|
+
canUndo: () => boolean;
|
|
46
|
+
/**
|
|
47
|
+
* <zh/> 是否可以执行重做操作
|
|
48
|
+
* <en/> Whether redo can be done
|
|
49
|
+
* @returns <zh/> 是否可以执行重做操作 | <en/> Whether redo can be done
|
|
50
|
+
*/
|
|
51
|
+
canRedo: () => boolean;
|
|
52
|
+
/**
|
|
53
|
+
* <zh/> 执行撤销
|
|
54
|
+
* <en/> Execute undo
|
|
55
|
+
* @returns <zh/> 返回当前实例 | <en/> Return the current instance
|
|
56
|
+
*/
|
|
57
|
+
undo: () => this;
|
|
58
|
+
/**
|
|
59
|
+
* <zh/> 执行重做
|
|
60
|
+
* <en/> Execute redo
|
|
61
|
+
* @returns <zh/> 返回当前实例 | <en/> Return the current instance
|
|
62
|
+
*/
|
|
63
|
+
redo: () => this;
|
|
64
|
+
/**
|
|
65
|
+
* <zh/> 执行撤销且不计入历史记录
|
|
66
|
+
* <en/> Execute undo and do not record in history
|
|
67
|
+
* @returns <zh/> 返回当前实例 | <en/> Return the current instance
|
|
68
|
+
*/
|
|
69
|
+
undoAndCancel: () => this;
|
|
70
|
+
private executeCommand;
|
|
71
|
+
private addCommand;
|
|
72
|
+
private initBatchCommand;
|
|
73
|
+
private undoStackPush;
|
|
74
|
+
/**
|
|
75
|
+
* <zh/> 清空历史记录
|
|
76
|
+
* <en/> Clear history
|
|
77
|
+
*/
|
|
78
|
+
clear(): void;
|
|
79
|
+
protected notify(event: HistoryEventName, cmd: Command | null): void;
|
|
80
|
+
on(event: HistoryEventName, handler: HistoryEventHandler): void;
|
|
81
|
+
destroy(): void;
|
|
82
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { RuntimeContext } from '../../runtime/types';
|
|
2
|
+
import type { GraphData } from '../../spec';
|
|
3
|
+
import type { DataChange } from '../../types';
|
|
4
|
+
export type Command = {
|
|
5
|
+
current: CommandData;
|
|
6
|
+
original: CommandData;
|
|
7
|
+
animation: boolean;
|
|
8
|
+
};
|
|
9
|
+
export type CommandData = {
|
|
10
|
+
add: GraphData;
|
|
11
|
+
update: GraphData;
|
|
12
|
+
remove: GraphData;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* <zh/> 对齐两个对象的字段。若目标对象缺少字段,则会添加默认值。
|
|
16
|
+
*
|
|
17
|
+
* <en/> Align the fields of two objects. If the target object lacks fields, default values will be added.
|
|
18
|
+
* @param refObject - <zh/> 参考对象 | <en/> Reference object
|
|
19
|
+
* @param targetObject - <zh/> 目标对象 | <en/> Target object
|
|
20
|
+
*/
|
|
21
|
+
export declare function alignFields(refObject: Record<string, any>, targetObject: Record<string, any>): void;
|
|
22
|
+
/**
|
|
23
|
+
* <zh/> 解析数据变更为历史记录命令
|
|
24
|
+
*
|
|
25
|
+
* <en/> Parse data changes into history commands
|
|
26
|
+
* @param changes - <zh/> 数据变更 | <en/> Data changes
|
|
27
|
+
* @param animation - <zh/> 是否开启动画 | <en/> Whether to enable animation
|
|
28
|
+
* @param context - <zh/> 运行时上下文 | <en/> Runtime context
|
|
29
|
+
* @returns <zh/> 历史记录命令 | <en/> History command
|
|
30
|
+
*/
|
|
31
|
+
export declare function parseCommand(changes: DataChange[], animation?: boolean, context?: RuntimeContext): Command;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { ID } from '@antv/graphlib';
|
|
2
|
+
import type { RuntimeContext } from '../../runtime/types';
|
|
3
|
+
import type { CallableValue } from '../../types';
|
|
4
|
+
import type { BasePluginOptions } from '../base-plugin';
|
|
5
|
+
import { BasePlugin } from '../base-plugin';
|
|
6
|
+
import type { HullStyleProps } from './shape';
|
|
7
|
+
export interface HullOptions extends BasePluginOptions, HullStyleProps {
|
|
8
|
+
/**
|
|
9
|
+
* <zh/> Hull 内的元素
|
|
10
|
+
* <en/> Elements in Hull
|
|
11
|
+
*/
|
|
12
|
+
members?: ID[];
|
|
13
|
+
/**
|
|
14
|
+
* <zh/> 凹度,数值越大凹度越小;默认为 Infinity 代表为 Convex Hull
|
|
15
|
+
* <en/> Concavity. Default is Infinity, which means Convex Hull
|
|
16
|
+
*/
|
|
17
|
+
concavity?: number;
|
|
18
|
+
/**
|
|
19
|
+
* <zh/> 内边距,默认为 10
|
|
20
|
+
* <en/> Padding, default is 10
|
|
21
|
+
*/
|
|
22
|
+
padding?: number;
|
|
23
|
+
/**
|
|
24
|
+
* <zh/> 拐角类型,目前支持 'rounded'、'smooth' 和 'sharp'
|
|
25
|
+
* <en/> Corner type, currently supports 'rounded', 'smooth' and 'sharp'
|
|
26
|
+
*/
|
|
27
|
+
corner?: 'rounded' | 'smooth' | 'sharp';
|
|
28
|
+
}
|
|
29
|
+
export declare class Hull extends BasePlugin<HullOptions> {
|
|
30
|
+
private shape;
|
|
31
|
+
/**
|
|
32
|
+
* <zh/> 在 Hull 上的元素
|
|
33
|
+
* <en/> Element Ids on Hull
|
|
34
|
+
*/
|
|
35
|
+
private hullMemberIds;
|
|
36
|
+
/**
|
|
37
|
+
* <zh/> Hull 绘制路径
|
|
38
|
+
* <en/> Hull path
|
|
39
|
+
*/
|
|
40
|
+
private path;
|
|
41
|
+
/**
|
|
42
|
+
* <zh> 是否初次渲染完成
|
|
43
|
+
* <en> Whether the first rendering is completed
|
|
44
|
+
*/
|
|
45
|
+
private firstRender;
|
|
46
|
+
static defaultOptions: Partial<HullOptions>;
|
|
47
|
+
constructor(context: RuntimeContext, options: HullOptions);
|
|
48
|
+
private bindEvents;
|
|
49
|
+
private getHullStyle;
|
|
50
|
+
private drawHull;
|
|
51
|
+
private updateHullPath;
|
|
52
|
+
private getHullPath;
|
|
53
|
+
private getPadding;
|
|
54
|
+
addMembers(members: ID | ID[]): void;
|
|
55
|
+
removeMembers(members: ID | ID[]): void;
|
|
56
|
+
updateMembers(members: CallableValue<ID[]>): void;
|
|
57
|
+
updateOptions(options: CallableValue<HullOptions>): void;
|
|
58
|
+
destroy(): void;
|
|
59
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { DisplayObjectConfig, Group, PathStyleProps } from '@antv/g';
|
|
2
|
+
import type { LabelStyleProps } from '../../elements/shapes';
|
|
3
|
+
import { BaseShape } from '../../elements/shapes';
|
|
4
|
+
import type { CardinalPlacement, PrefixObject } from '../../types';
|
|
5
|
+
type HullLabelStyleProps = LabelStyleProps & {
|
|
6
|
+
/**
|
|
7
|
+
* <zh/> 标签位置,可选值为 'top'、'right'、'bottom'、'left'、'center';默认为 'bottom'
|
|
8
|
+
* <en/> Label position, optional values are 'top', 'right', 'bottom', 'left', 'center'; default is 'bottom'
|
|
9
|
+
*/
|
|
10
|
+
placement?: CardinalPlacement | 'center';
|
|
11
|
+
/**
|
|
12
|
+
* <zh/> 标签是否贴合轮廓,默认为 true
|
|
13
|
+
* <en/> Whether the label is close to the contour, default is true
|
|
14
|
+
*/
|
|
15
|
+
closeToHull?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* <zh/> 标签是否跟随轮廓旋转,默认为 true,仅在 closeToHull 为 true 时生效
|
|
18
|
+
* <en/> Whether the label rotates with the contour, default is true. Only effective when closeToHull is true
|
|
19
|
+
*/
|
|
20
|
+
autoRotate?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* <zh/> x 轴偏移量
|
|
23
|
+
* <en/> Label x-axis offset
|
|
24
|
+
*/
|
|
25
|
+
offsetX?: number;
|
|
26
|
+
/**
|
|
27
|
+
* <zh/> y 轴偏移量
|
|
28
|
+
* <en/> Label y-axis offset
|
|
29
|
+
*/
|
|
30
|
+
offsetY?: number;
|
|
31
|
+
/**
|
|
32
|
+
* <zh/> 文本的最大宽度,超出会自动省略
|
|
33
|
+
* <en/> The maximum width of the text, which will be automatically ellipsis if exceeded
|
|
34
|
+
*/
|
|
35
|
+
maxWidth?: number;
|
|
36
|
+
};
|
|
37
|
+
export type HullStyleProps = PathStyleProps & {
|
|
38
|
+
label?: boolean;
|
|
39
|
+
} & PrefixObject<HullLabelStyleProps, 'label'>;
|
|
40
|
+
type ParsedHullStyleProps = Required<HullStyleProps>;
|
|
41
|
+
type HullOptions = DisplayObjectConfig<HullStyleProps>;
|
|
42
|
+
export declare class Hull extends BaseShape<HullStyleProps> {
|
|
43
|
+
static defaultStyleProps: Partial<HullStyleProps>;
|
|
44
|
+
constructor(options: HullOptions);
|
|
45
|
+
protected getLabelStyle(attributes: ParsedHullStyleProps): LabelStyleProps | false;
|
|
46
|
+
protected getContourStyle(attributes: ParsedHullStyleProps): Omit<Required<HullStyleProps>, "transform" | "x" | "y" | "z" | "zIndex" | "className" | "transformOrigin" | "context">;
|
|
47
|
+
render(attributes: ParsedHullStyleProps, container: Group): void;
|
|
48
|
+
}
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type PathArray } from '@antv/util';
|
|
2
|
+
import type { Point } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* <zh/> 计算 Hull 路径
|
|
5
|
+
*
|
|
6
|
+
* <en/> Compute Hull Path
|
|
7
|
+
* @param points - <zh/> 顶点列表 | <en/> Vertices of Hull
|
|
8
|
+
* @param padding - <zh/> 内边距 | <en/> padding
|
|
9
|
+
* @param corner - <zh/> 拐角类型,目前支持 'sharp'、'rounded' 和 'smooth' | <en/> Corner type, currently supports 'sharp', 'rounded' and 'smooth'
|
|
10
|
+
* @returns <zh/> Hull 路径 | <en/> Hull Path
|
|
11
|
+
*/
|
|
12
|
+
export declare function computeHullPath(points: Point[], padding: number, corner: 'rounded' | 'smooth' | 'sharp'): PathArray;
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
export { BasePlugin } from './base-plugin';
|
|
2
|
+
export { CameraSetting } from './camera-setting';
|
|
2
3
|
export { Contextmenu } from './contextmenu';
|
|
3
4
|
export { GridLine } from './grid-line';
|
|
5
|
+
export { History } from './history';
|
|
6
|
+
export { Hull } from './hull';
|
|
7
|
+
export { Legend } from './legend';
|
|
4
8
|
export { Toolbar } from './toolbar';
|
|
5
9
|
export { Tooltip } from './tooltip';
|
|
6
10
|
export { Watermark } from './watermark';
|
|
7
11
|
export type { BasePluginOptions } from './base-plugin';
|
|
12
|
+
export type { CameraSettingOptions } from './camera-setting';
|
|
8
13
|
export type { ContextmenuOptions } from './contextmenu';
|
|
9
14
|
export type { GridLineOptions } from './grid-line';
|
|
15
|
+
export type { HistoryOptions } from './history';
|
|
16
|
+
export type { HullOptions } from './hull';
|
|
17
|
+
export type { LegendOptions } from './legend';
|
|
10
18
|
export type { ToolbarOptions } from './toolbar';
|
|
11
19
|
export type { TooltipOptions } from './tooltip';
|
|
12
20
|
export type { WatermarkOptions } from './watermark';
|