@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
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { CategoryOptions } from '@antv/component';
|
|
2
|
+
import { Selection } from '@antv/component';
|
|
3
|
+
import type { RuntimeContext } from '../runtime/types';
|
|
4
|
+
import type { ElementDatum } from '../types';
|
|
5
|
+
import type { CardinalPlacement } from '../types/placement';
|
|
6
|
+
import type { BasePluginOptions } from './base-plugin';
|
|
7
|
+
import { BasePlugin } from './base-plugin';
|
|
8
|
+
type Field = string | ((item: ElementDatum) => string);
|
|
9
|
+
export interface LegendOptions extends BasePluginOptions, Omit<CategoryOptions, 'data'> {
|
|
10
|
+
/** <zh/> 触发方式 | <en/> Event type that triggers display of legend */
|
|
11
|
+
trigger?: 'hover' | 'click';
|
|
12
|
+
/** <zh/> 位置 | <en/> Legend position */
|
|
13
|
+
position?: CardinalPlacement;
|
|
14
|
+
/** <zh/> 节点分类标识 | <en/> Node Classification Identifier */
|
|
15
|
+
nodeField?: Field;
|
|
16
|
+
/** <zh/> 边分类标识 | <en/> Edge Classification Identifier */
|
|
17
|
+
edgeField?: Field;
|
|
18
|
+
/** <zh/> Combo分类标识 | <en/> Combo Classification Identifier */
|
|
19
|
+
comboField?: Field;
|
|
20
|
+
}
|
|
21
|
+
export declare class Legend extends BasePlugin<LegendOptions> {
|
|
22
|
+
static defaultOptions: Partial<LegendOptions>;
|
|
23
|
+
private typePrefix;
|
|
24
|
+
private element;
|
|
25
|
+
private draw;
|
|
26
|
+
private fieldMap;
|
|
27
|
+
private selectedItems;
|
|
28
|
+
constructor(context: RuntimeContext, options: LegendOptions);
|
|
29
|
+
update(options: Partial<LegendOptions>): void;
|
|
30
|
+
private clear;
|
|
31
|
+
private bindEvents;
|
|
32
|
+
private changeState;
|
|
33
|
+
click: (el: Selection) => void;
|
|
34
|
+
mouseleave: (el: Selection) => void;
|
|
35
|
+
mouseenter: (el: Selection) => void;
|
|
36
|
+
updateElement(): void;
|
|
37
|
+
private setFieldMap;
|
|
38
|
+
private getEvents;
|
|
39
|
+
private getMarkerData;
|
|
40
|
+
layout: (position: CardinalPlacement) => {
|
|
41
|
+
display: string;
|
|
42
|
+
flexDirection: string;
|
|
43
|
+
justifyContent: string;
|
|
44
|
+
alignItems: string;
|
|
45
|
+
};
|
|
46
|
+
private createElement;
|
|
47
|
+
destroy(): void;
|
|
48
|
+
}
|
|
49
|
+
export {};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { TooltipStyleProps } from '@antv/component';
|
|
2
2
|
import type { RuntimeContext } from '../runtime/types';
|
|
3
|
-
import type {
|
|
3
|
+
import type { Element, ElementDatum, ElementType, IPointerEvent } from '../types';
|
|
4
4
|
import type { BasePluginOptions } from './base-plugin';
|
|
5
5
|
import { BasePlugin } from './base-plugin';
|
|
6
6
|
export interface TooltipOptions extends BasePluginOptions, Pick<TooltipStyleProps, 'position' | 'offset' | 'enterable' | 'style' | 'container'> {
|
|
7
7
|
/** <zh/> 触发方式 | <en/> Event type that triggers display of tooltip */
|
|
8
8
|
trigger?: 'hover' | 'click';
|
|
9
9
|
/** <zh/> 自定义内容 | <en/> Function for getting tooltip content */
|
|
10
|
-
getContent?: (evt:
|
|
10
|
+
getContent?: (evt: IElementEvent, items: ElementDatum[]) => HTMLElement | string;
|
|
11
11
|
/** <zh/> 是否启用 | <en/> Is enable */
|
|
12
|
-
enable?: boolean | ((evt:
|
|
12
|
+
enable?: boolean | ((evt: IElementEvent) => boolean);
|
|
13
13
|
}
|
|
14
14
|
export declare class Tooltip extends BasePlugin<TooltipOptions> {
|
|
15
15
|
static defaultOptions: Partial<TooltipOptions>;
|
|
@@ -18,22 +18,24 @@ export declare class Tooltip extends BasePlugin<TooltipOptions> {
|
|
|
18
18
|
private container;
|
|
19
19
|
constructor(context: RuntimeContext, options: TooltipOptions);
|
|
20
20
|
getEvents(): {
|
|
21
|
-
[key: string]:
|
|
21
|
+
[key: string]: (event: IElementEvent) => void;
|
|
22
22
|
};
|
|
23
23
|
update(options: Partial<TooltipOptions>): void;
|
|
24
24
|
private render;
|
|
25
25
|
private unbindEvents;
|
|
26
26
|
private bindEvents;
|
|
27
27
|
private isEnable;
|
|
28
|
-
onClick: (e:
|
|
29
|
-
onPointerMove: (e:
|
|
30
|
-
onPointerLeave: (e:
|
|
31
|
-
onCanvasMove: (e:
|
|
28
|
+
onClick: (e: IElementEvent) => void;
|
|
29
|
+
onPointerMove: (e: IElementEvent) => void;
|
|
30
|
+
onPointerLeave: (e: IElementEvent) => void;
|
|
31
|
+
onCanvasMove: (e: IElementEvent) => void;
|
|
32
32
|
private onPointerEnter;
|
|
33
33
|
showTooltipById: (id: string, elementType?: ElementType) => void;
|
|
34
34
|
private getItems;
|
|
35
|
-
showTooltip: (e:
|
|
36
|
-
hideTooltip: (e?:
|
|
35
|
+
showTooltip: (e: IElementEvent) => void;
|
|
36
|
+
hideTooltip: (e?: IElementEvent) => void;
|
|
37
37
|
private initTooltip;
|
|
38
38
|
destroy(): void;
|
|
39
39
|
}
|
|
40
|
+
type IElementEvent = IPointerEvent<Element>;
|
|
41
|
+
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type EventEmitter from '@antv/event-emitter';
|
|
2
2
|
import type { RuntimeContext } from '../../runtime/types';
|
|
3
|
-
import type {
|
|
3
|
+
import type { IEvent } from '../../types';
|
|
4
4
|
import type { ExtensionOptions, LooselyExtensionOption, STDExtensionOption } from './types';
|
|
5
5
|
export declare abstract class ExtensionController<Extension extends BaseExtension<LooselyExtensionOption>> {
|
|
6
6
|
protected context: RuntimeContext;
|
|
7
7
|
protected extensions: STDExtensionOption[];
|
|
8
8
|
protected extensionMap: Record<string, Extension>;
|
|
9
|
-
abstract category: 'plugin' | 'behavior';
|
|
9
|
+
abstract category: 'plugin' | 'behavior' | 'transform';
|
|
10
10
|
constructor(context: RuntimeContext);
|
|
11
11
|
setExtensions(extensions: ExtensionOptions): void;
|
|
12
12
|
protected createExtension(extension: STDExtensionOption): void;
|
|
@@ -25,7 +25,7 @@ export declare abstract class ExtensionController<Extension extends BaseExtensio
|
|
|
25
25
|
export declare class BaseExtension<T extends LooselyExtensionOption> {
|
|
26
26
|
protected context: RuntimeContext;
|
|
27
27
|
protected options: Required<T>;
|
|
28
|
-
protected events: [EventEmitter | HTMLElement, string,
|
|
28
|
+
protected events: [EventEmitter | HTMLElement, string, (event: IEvent) => void][];
|
|
29
29
|
destroyed: boolean;
|
|
30
30
|
constructor(context: RuntimeContext, options: T);
|
|
31
31
|
update(options: Partial<T>): void;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ExtensionCategory } from '../constants';
|
|
2
|
+
import type { Loosen } from '../types';
|
|
3
|
+
import type { ExtensionRegistry } from './types';
|
|
2
4
|
/**
|
|
3
5
|
* <zh/> 注册一个新的扩展。
|
|
4
6
|
*
|
|
@@ -29,7 +31,7 @@ import type { ExtensionCategory, ExtensionRegistry } from './types';
|
|
|
29
31
|
* ```
|
|
30
32
|
* @public
|
|
31
33
|
*/
|
|
32
|
-
export declare function register<T extends ExtensionCategory>(category: T
|
|
34
|
+
export declare function register<T extends ExtensionCategory>(category: Loosen<T>, type: string, Ctor: ExtensionRegistry[T][string]): void;
|
|
33
35
|
/**
|
|
34
36
|
* <zh/> 根据类别和类型获取扩展
|
|
35
37
|
*
|
|
@@ -39,7 +41,7 @@ export declare function register<T extends ExtensionCategory>(category: T, type:
|
|
|
39
41
|
* @returns <zh/> 注册的扩展 | <en/> Registered extension
|
|
40
42
|
* @internal
|
|
41
43
|
*/
|
|
42
|
-
export declare function getExtension<T extends ExtensionCategory>(category: T
|
|
44
|
+
export declare function getExtension<T extends ExtensionCategory>(category: Loosen<T>, type: string): ExtensionRegistry[T][string] | undefined;
|
|
43
45
|
/**
|
|
44
46
|
* <zh/> 根据类别获取扩展
|
|
45
47
|
*
|
|
@@ -48,7 +50,7 @@ export declare function getExtension<T extends ExtensionCategory>(category: T, t
|
|
|
48
50
|
* @returns <zh/> 注册的扩展 | <en/> Registered extension
|
|
49
51
|
* @internal
|
|
50
52
|
*/
|
|
51
|
-
export declare function getExtensions<T extends ExtensionCategory
|
|
53
|
+
export declare function getExtensions<T extends Loosen<ExtensionCategory>>(category: T): ExtensionRegistry[T];
|
|
52
54
|
/**
|
|
53
55
|
* <zh/> 注册内置扩展
|
|
54
56
|
*
|
|
@@ -4,6 +4,7 @@ import type { Behavior } from '../behaviors/types';
|
|
|
4
4
|
import type { STDPalette } from '../palettes/types';
|
|
5
5
|
import type { Plugin } from '../plugins/types';
|
|
6
6
|
import type { Theme } from '../themes/types';
|
|
7
|
+
import type { Transform } from '../transforms/types';
|
|
7
8
|
import type { Combo, Edge, Node } from '../types';
|
|
8
9
|
/**
|
|
9
10
|
* <zh/> 扩展注册表
|
|
@@ -32,10 +33,7 @@ export interface ExtensionRegistry {
|
|
|
32
33
|
new (...args: any[]): Plugin;
|
|
33
34
|
}>;
|
|
34
35
|
animation: Record<string, STDAnimation>;
|
|
36
|
+
transform: Record<string, {
|
|
37
|
+
new (...args: any[]): Transform;
|
|
38
|
+
}>;
|
|
35
39
|
}
|
|
36
|
-
/**
|
|
37
|
-
* <zh/> 扩展分类
|
|
38
|
-
*
|
|
39
|
-
* <en/> Extension category
|
|
40
|
-
*/
|
|
41
|
-
export type ExtensionCategory = keyof ExtensionRegistry;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RuntimeContext } from './types';
|
|
2
|
+
export declare class BatchController {
|
|
3
|
+
private context;
|
|
4
|
+
private batchCount;
|
|
5
|
+
constructor(context: RuntimeContext);
|
|
6
|
+
private emit;
|
|
7
|
+
startBatch(initiate?: boolean): void;
|
|
8
|
+
endBatch(): void;
|
|
9
|
+
get isBatching(): boolean;
|
|
10
|
+
destroy(): void;
|
|
11
|
+
}
|
|
@@ -5,7 +5,7 @@ import type { RuntimeContext } from './types';
|
|
|
5
5
|
export declare class BehaviorController extends ExtensionController<BaseBehavior<CustomBehaviorOption>> {
|
|
6
6
|
/** <zh/> 当前事件的目标 | <en/> The current event target */
|
|
7
7
|
private currentTarget;
|
|
8
|
-
category:
|
|
8
|
+
category: "behavior";
|
|
9
9
|
constructor(context: RuntimeContext);
|
|
10
10
|
setBehaviors(behaviors: BehaviorOptions): void;
|
|
11
11
|
private forwardEvents;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Cursor,
|
|
1
|
+
import type { Cursor, DisplayObject, CanvasConfig as GCanvasConfig, DataURLOptions as GDataURLOptions, IRenderer, PointLike } from '@antv/g';
|
|
2
2
|
import { Canvas as GCanvas } from '@antv/g';
|
|
3
3
|
import type { CanvasOptions } from '../spec/canvas';
|
|
4
4
|
import type { CanvasLayer } from '../types/canvas';
|
|
@@ -6,6 +6,18 @@ export interface CanvasConfig extends Pick<GCanvasConfig, 'container' | 'deviceP
|
|
|
6
6
|
renderer?: CanvasOptions['renderer'];
|
|
7
7
|
background?: string;
|
|
8
8
|
}
|
|
9
|
+
export interface DataURLOptions extends GDataURLOptions {
|
|
10
|
+
/**
|
|
11
|
+
* <zh/> 导出模式
|
|
12
|
+
* - viewport: 导出视口内容
|
|
13
|
+
* - overall: 导出整个画布
|
|
14
|
+
*
|
|
15
|
+
* <en/> export mode
|
|
16
|
+
* - viewport: export the content of the viewport
|
|
17
|
+
* - overall: export the entire canvas
|
|
18
|
+
*/
|
|
19
|
+
mode?: 'viewport' | 'overall';
|
|
20
|
+
}
|
|
9
21
|
/**
|
|
10
22
|
* @deprecated this canvas will be replace by layered canvas
|
|
11
23
|
*/
|
|
@@ -15,18 +27,17 @@ export declare class Canvas {
|
|
|
15
27
|
main: GCanvas;
|
|
16
28
|
label: GCanvas;
|
|
17
29
|
transient: GCanvas;
|
|
18
|
-
transientLabel: GCanvas;
|
|
19
30
|
get canvas(): {
|
|
20
31
|
main: GCanvas;
|
|
21
32
|
label: GCanvas;
|
|
22
33
|
transient: GCanvas;
|
|
23
|
-
transientLabel: GCanvas;
|
|
24
34
|
background: GCanvas;
|
|
25
35
|
};
|
|
26
36
|
get document(): import("@antv/g").Document;
|
|
27
37
|
renderers: Record<CanvasLayer, IRenderer>;
|
|
38
|
+
private initialized;
|
|
28
39
|
constructor(config: CanvasConfig);
|
|
29
|
-
init(): Promise<
|
|
40
|
+
init(): Promise<void>;
|
|
30
41
|
getRendererType(layer?: CanvasLayer): "canvas" | "svg" | "gpu" | "unknown";
|
|
31
42
|
get context(): import("@antv/g").CanvasContext;
|
|
32
43
|
getDevice(): any;
|
|
@@ -46,6 +46,7 @@ export declare class DataController {
|
|
|
46
46
|
* @returns <zh/> 数据变更 | <en/> data changes
|
|
47
47
|
*/
|
|
48
48
|
getChanges(): DataChange[];
|
|
49
|
+
clearChanges(): void;
|
|
49
50
|
batch(callback: () => void): void;
|
|
50
51
|
/**
|
|
51
52
|
* <zh/> 执行操作而不会留下记录
|
|
@@ -69,9 +70,8 @@ export declare class DataController {
|
|
|
69
70
|
getComboData(ids?: ID[]): ComboData[];
|
|
70
71
|
getAncestorsData(id: ID, hierarchy: HierarchyKey): NodeLikeData[];
|
|
71
72
|
getDescendantsData(id: ID): NodeLikeData[];
|
|
72
|
-
getParentData(id: ID, hierarchy
|
|
73
|
+
getParentData(id: ID, hierarchy: HierarchyKey): NodeLikeData | undefined;
|
|
73
74
|
getChildrenData(id: ID): NodeLikeData[];
|
|
74
|
-
private inferStructureKey;
|
|
75
75
|
/**
|
|
76
76
|
* <zh/> 获取指定类型元素的数据
|
|
77
77
|
*
|
|
@@ -79,7 +79,7 @@ export declare class DataController {
|
|
|
79
79
|
* @param elementType - <zh/> 元素类型 | <en/> element type
|
|
80
80
|
* @returns <zh/> 元素数据 | <en/> element data
|
|
81
81
|
*/
|
|
82
|
-
getElementData(elementType: ElementType): NodeData[] | EdgeData[]
|
|
82
|
+
getElementData(elementType: ElementType): NodeData[] | EdgeData[];
|
|
83
83
|
/**
|
|
84
84
|
* <zh/> 根据 ID 获取元素的数据,不用关心元素的类型
|
|
85
85
|
*
|
|
@@ -96,7 +96,7 @@ export declare class DataController {
|
|
|
96
96
|
* @returns <zh/> 节点和 combo 的数据 | <en/> node and combo data
|
|
97
97
|
*/
|
|
98
98
|
getNodeLikeData(ids?: ID[]): NodeLikeData[];
|
|
99
|
-
getElementDataByState(elementType: ElementType, state: string): (NodeData |
|
|
99
|
+
getElementDataByState(elementType: ElementType, state: string): (NodeData | EdgeData)[];
|
|
100
100
|
getElementState(id: ID): State[];
|
|
101
101
|
hasNode(id: ID): boolean;
|
|
102
102
|
hasEdge(id: ID): boolean;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { DisplayObject, IAnimation } from '@antv/g';
|
|
2
2
|
import type { ID } from '@antv/graphlib';
|
|
3
|
-
import type { BaseShape } from '../elements/shapes';
|
|
4
3
|
import type { AnimationStage } from '../spec/element/animation';
|
|
5
|
-
import type { Combo, ElementDatum, ElementType, Node, State } from '../types';
|
|
4
|
+
import type { Combo, Element, ElementDatum, ElementType, Node, State } from '../types';
|
|
6
5
|
import type { RuntimeContext } from './types';
|
|
7
6
|
export declare class ElementController {
|
|
8
7
|
private context;
|
|
@@ -14,7 +13,7 @@ export declare class ElementController {
|
|
|
14
13
|
private emit;
|
|
15
14
|
private forEachElementData;
|
|
16
15
|
private getTheme;
|
|
17
|
-
getThemeStyle(elementType: ElementType): import("
|
|
16
|
+
getThemeStyle(elementType: ElementType): import("../spec/element/node").NodeStyle | import("../spec/element/edge").EdgeStyle;
|
|
18
17
|
getThemeStateStyle(elementType: ElementType, states: State[]): any;
|
|
19
18
|
private paletteStyle;
|
|
20
19
|
private computePaletteStyle;
|
|
@@ -55,9 +54,9 @@ export declare class ElementController {
|
|
|
55
54
|
private computeElementsStatesStyle;
|
|
56
55
|
getStateStyle(id: ID): Record<string, unknown>;
|
|
57
56
|
private computeStyle;
|
|
58
|
-
getElement<T extends
|
|
57
|
+
getElement<T extends Element>(id: ID): T | undefined;
|
|
59
58
|
getNodes(): Node[];
|
|
60
|
-
getEdges(): import("
|
|
59
|
+
getEdges(): import("..").BaseEdge[];
|
|
61
60
|
getCombos(): Combo[];
|
|
62
61
|
private getAnimation;
|
|
63
62
|
private getAnimationExecutor;
|
|
@@ -80,24 +79,8 @@ export declare class ElementController {
|
|
|
80
79
|
* <en/> start render process
|
|
81
80
|
*/
|
|
82
81
|
draw(drawContext?: DrawContext): Promise<void>;
|
|
83
|
-
private
|
|
84
|
-
|
|
85
|
-
* 如果更新了节点 / combo,需要更新连接的边
|
|
86
|
-
* If the node / combo is updated, the connected edge and the combo it is in need to be updated
|
|
87
|
-
*/
|
|
88
|
-
private updateRelatedEdgeFlow;
|
|
89
|
-
/**
|
|
90
|
-
* <zh/> 调整元素绘制顺序
|
|
91
|
-
*
|
|
92
|
-
* <en/> Adjust the drawing order of elements
|
|
93
|
-
*/
|
|
94
|
-
private arrangeDrawOrderFlow;
|
|
95
|
-
/**
|
|
96
|
-
* <zh/> 处理元素的收起和展开
|
|
97
|
-
*
|
|
98
|
-
* <en/> Process the collapse and expand of elements
|
|
99
|
-
*/
|
|
100
|
-
private collapseExpandFlow;
|
|
82
|
+
private computeChangesAndDrawData;
|
|
83
|
+
private transformData;
|
|
101
84
|
private createElement;
|
|
102
85
|
private getCreateTasks;
|
|
103
86
|
/**
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import EventEmitter from '@antv/event-emitter';
|
|
2
|
-
import type { AABB, BaseStyleProps
|
|
2
|
+
import type { AABB, BaseStyleProps } from '@antv/g';
|
|
3
3
|
import type { ID } from '@antv/graphlib';
|
|
4
|
-
import type {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import type {
|
|
4
|
+
import type { Plugin } from '../plugins/types';
|
|
5
|
+
import type { BehaviorOptions, ComboData, ComboOptions, EdgeData, EdgeOptions, G6Spec, GraphData, LayoutOptions, NodeData, NodeOptions, PluginOptions, ThemeOptions, TransformOptions } from '../spec';
|
|
6
|
+
import type { UpdateBehaviorOption } from '../spec/behavior';
|
|
7
|
+
import type { UpdatePluginOption } from '../spec/plugin';
|
|
8
|
+
import type { UpdateTransformOption } from '../spec/transform';
|
|
9
|
+
import type { CallableValue, DataID, EdgeDirection, ElementType, FitViewOptions, IEvent, NodeLikeData, PartialEdgeData, PartialGraphData, PartialNodeLikeData, Point, Position, State, ViewportAnimationEffectTiming } from '../types';
|
|
10
|
+
import type { DataURLOptions } from './canvas';
|
|
8
11
|
import { Canvas } from './canvas';
|
|
9
12
|
import type { HierarchyKey } from './data';
|
|
10
13
|
export declare class Graph extends EventEmitter {
|
|
@@ -86,6 +89,35 @@ export declare class Graph extends EventEmitter {
|
|
|
86
89
|
* @returns <zh/> 插件配置 | <en/> plugin configuration
|
|
87
90
|
*/
|
|
88
91
|
getPlugins(): PluginOptions;
|
|
92
|
+
/**
|
|
93
|
+
* <zh/> 获取插件实例
|
|
94
|
+
*
|
|
95
|
+
* <en/> Get plugin instance
|
|
96
|
+
* @param key - <zh/> 插件 key | <en/> plugin key
|
|
97
|
+
* @returns <zh/> 插件实例 | <en/> plugin instance
|
|
98
|
+
*/
|
|
99
|
+
getPluginInstance<T extends Plugin>(key: string): T;
|
|
100
|
+
/**
|
|
101
|
+
* <zh/> 设置数据转换器
|
|
102
|
+
*
|
|
103
|
+
* <en/> Set data transforms
|
|
104
|
+
* @param transforms - <zh/> 数据转换配置 | <en/> data transform configuration
|
|
105
|
+
*/
|
|
106
|
+
setTransforms(transforms: CallableValue<TransformOptions>): void;
|
|
107
|
+
/**
|
|
108
|
+
* <zh/> 更新数据转换器
|
|
109
|
+
*
|
|
110
|
+
* <en/> Update data transform
|
|
111
|
+
* @param transform - <zh/> 数据转换配置 | <en/> data transform configuration
|
|
112
|
+
*/
|
|
113
|
+
updateTransform(transform: UpdateTransformOption): void;
|
|
114
|
+
/**
|
|
115
|
+
* <zh/> 获取数据转换器
|
|
116
|
+
*
|
|
117
|
+
* <en/> Get data transforms
|
|
118
|
+
* @returns <zh/> 数据转换器实例 | <en/> data transform instance
|
|
119
|
+
*/
|
|
120
|
+
getTransforms(): TransformOptions;
|
|
89
121
|
getData(): GraphData;
|
|
90
122
|
getNodeData(): NodeData[];
|
|
91
123
|
getNodeData(id: ID): NodeData;
|
|
@@ -145,7 +177,7 @@ export declare class Graph extends EventEmitter {
|
|
|
145
177
|
getElementDataByState(elementType: 'node', state: State): NodeData[];
|
|
146
178
|
getElementDataByState(elementType: 'edge', state: State): EdgeData[];
|
|
147
179
|
getElementDataByState(elementType: 'combo', state: State): ComboData[];
|
|
148
|
-
private
|
|
180
|
+
private initCanvas;
|
|
149
181
|
private createRuntime;
|
|
150
182
|
private prepare;
|
|
151
183
|
/**
|
|
@@ -424,6 +456,21 @@ export declare class Graph extends EventEmitter {
|
|
|
424
456
|
collapse(id: ID, animation?: boolean): Promise<void>;
|
|
425
457
|
expand(id: ID, animation?: boolean): Promise<void>;
|
|
426
458
|
private setElementCollapsibility;
|
|
459
|
+
/**
|
|
460
|
+
* <zh/> 导出画布内容为 DataURL
|
|
461
|
+
*
|
|
462
|
+
* <en/> Export canvas content as DataURL
|
|
463
|
+
* @param options - <zh/> 导出配置 | <en/> export configuration
|
|
464
|
+
* @param mode
|
|
465
|
+
* <zh/> 导出模式
|
|
466
|
+
* - viewport: 导出视口内容
|
|
467
|
+
* - overall: 导出整个画布
|
|
468
|
+
*
|
|
469
|
+
* <en/> export mode
|
|
470
|
+
* - viewport: export the content of the viewport
|
|
471
|
+
* - overall: export the entire canvas
|
|
472
|
+
* @returns <zh/> DataURL | <en/> DataURL
|
|
473
|
+
*/
|
|
427
474
|
toDataURL(options?: Partial<DataURLOptions>): Promise<string>;
|
|
428
475
|
getCanvasByViewport(point: Point): Point;
|
|
429
476
|
getViewportByCanvas(point: Point): Point;
|
|
@@ -438,4 +485,22 @@ export declare class Graph extends EventEmitter {
|
|
|
438
485
|
getViewportCenter(): Point;
|
|
439
486
|
getCanvasCenter(): Point;
|
|
440
487
|
private onResize;
|
|
488
|
+
/**
|
|
489
|
+
* <zh/> 监听事件
|
|
490
|
+
*
|
|
491
|
+
* <en/> Listen to events
|
|
492
|
+
* @param eventName - <zh/> 事件名称 | <en/> event name
|
|
493
|
+
* @param callback - <zh/> 回调函数 | <en/> callback function
|
|
494
|
+
* @returns <zh/> Graph 实例 | <en/> Graph instance
|
|
495
|
+
*/
|
|
496
|
+
on<T extends IEvent = IEvent>(eventName: string, callback: (event: T) => void): this;
|
|
497
|
+
/**
|
|
498
|
+
* <zh/> 一次性监听事件
|
|
499
|
+
*
|
|
500
|
+
* <en/> Listen to events once
|
|
501
|
+
* @param eventName - <zh/> 事件名称 | <en/> event name
|
|
502
|
+
* @param callback - <zh/> 回调函数 | <en/> callback function
|
|
503
|
+
* @returns <zh/> Graph 实例 | <en/> Graph instance
|
|
504
|
+
*/
|
|
505
|
+
once<T extends IEvent = IEvent>(eventName: string, callback: (event: T) => void): this;
|
|
441
506
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Graph as Graphlib } from '@antv/graphlib';
|
|
2
|
-
import type { LayoutMapping } from '@antv/layout';
|
|
2
|
+
import type { Layout, LayoutMapping } from '@antv/layout';
|
|
3
3
|
import type { EdgeData, NodeData } from '../spec';
|
|
4
4
|
import type { STDLayoutOptions } from '../spec/layout';
|
|
5
5
|
import type { RuntimeContext } from './types';
|
|
@@ -8,21 +8,15 @@ export declare class LayoutController {
|
|
|
8
8
|
private context;
|
|
9
9
|
private supervisor?;
|
|
10
10
|
private instance?;
|
|
11
|
+
private instances;
|
|
11
12
|
private animationResult?;
|
|
12
13
|
private get presetOptions();
|
|
13
14
|
private get options();
|
|
14
15
|
constructor(context: RuntimeContext);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
*
|
|
18
|
-
* <en/> Initialize layout position
|
|
19
|
-
* @param model - <zh/> 布局数据 | <en/> Layout data
|
|
20
|
-
* @param options - <zh/> 预设布局配置项 | <en/> Preset layout options
|
|
21
|
-
* @returns <zh/> 布局结果 | <en/> Layout result
|
|
22
|
-
*/
|
|
23
|
-
private presetLayout;
|
|
16
|
+
getLayoutInstance(): Layout<unknown>[];
|
|
17
|
+
getLayoutInstance(index: number): Layout<unknown>;
|
|
24
18
|
layout(): Promise<void>;
|
|
25
|
-
stepLayout(model: LayoutGraphlibModel, options: STDLayoutOptions): Promise<LayoutMapping>;
|
|
19
|
+
stepLayout(model: LayoutGraphlibModel, options: STDLayoutOptions, index: number): Promise<LayoutMapping>;
|
|
26
20
|
private graphLayout;
|
|
27
21
|
private treeLayout;
|
|
28
22
|
stopLayout(): void;
|
|
@@ -3,7 +3,8 @@ import { ExtensionController } from '../registry/extension';
|
|
|
3
3
|
import type { CustomPluginOption, PluginOptions } from '../spec/plugin';
|
|
4
4
|
import type { RuntimeContext } from './types';
|
|
5
5
|
export declare class PluginController extends ExtensionController<BasePlugin<CustomPluginOption>> {
|
|
6
|
-
category:
|
|
6
|
+
category: "plugin";
|
|
7
7
|
constructor(context: RuntimeContext);
|
|
8
8
|
setPlugins(plugins: PluginOptions): void;
|
|
9
|
+
getPluginInstance(key: string): BasePlugin<CustomPluginOption>;
|
|
9
10
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ExtensionController } from '../registry/extension';
|
|
2
|
+
import type { CustomTransformOption, TransformOptions } from '../spec/transform';
|
|
3
|
+
import { BaseTransform } from '../transforms';
|
|
4
|
+
import type { RuntimeContext } from './types';
|
|
5
|
+
export declare const REQUIRED_TRANSFORMS: TransformOptions;
|
|
6
|
+
export declare class TransformController extends ExtensionController<BaseTransform<CustomTransformOption>> {
|
|
7
|
+
category: "transform";
|
|
8
|
+
constructor(context: RuntimeContext);
|
|
9
|
+
setTransforms(transforms: TransformOptions): void;
|
|
10
|
+
getTransformInstance(key?: string): BaseTransform<CustomTransformOption> | Record<string, BaseTransform<CustomTransformOption>>;
|
|
11
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { G6Spec } from '../spec';
|
|
2
|
+
import type { BatchController } from './batch';
|
|
2
3
|
import type { BehaviorController } from './behavior';
|
|
3
4
|
import type { Canvas } from './canvas';
|
|
4
5
|
import type { DataController } from './data';
|
|
@@ -6,6 +7,7 @@ import type { ElementController } from './element';
|
|
|
6
7
|
import type { Graph } from './graph';
|
|
7
8
|
import type { LayoutController } from './layout';
|
|
8
9
|
import type { PluginController } from './plugin';
|
|
10
|
+
import type { TransformController } from './transform';
|
|
9
11
|
import type { ViewportController } from './viewport';
|
|
10
12
|
export interface RuntimeContext {
|
|
11
13
|
/**
|
|
@@ -32,6 +34,12 @@ export interface RuntimeContext {
|
|
|
32
34
|
* <en/> Data model
|
|
33
35
|
*/
|
|
34
36
|
model: DataController;
|
|
37
|
+
/**
|
|
38
|
+
* <zh/> 数据转换控制器
|
|
39
|
+
*
|
|
40
|
+
* <en/> Data transform controller
|
|
41
|
+
*/
|
|
42
|
+
transform: TransformController;
|
|
35
43
|
/**
|
|
36
44
|
* <zh/> 元素控制器
|
|
37
45
|
*
|
|
@@ -66,4 +74,10 @@ export interface RuntimeContext {
|
|
|
66
74
|
* <en/> Plugin controller
|
|
67
75
|
*/
|
|
68
76
|
plugin?: PluginController;
|
|
77
|
+
/**
|
|
78
|
+
* <zh/> 批量操作控制器
|
|
79
|
+
*
|
|
80
|
+
* <en/> Batch operation controller
|
|
81
|
+
*/
|
|
82
|
+
batch?: BatchController;
|
|
69
83
|
}
|
package/dist/lib/spec/index.d.ts
CHANGED
|
@@ -8,4 +8,5 @@ export type { LayoutOptions } from './layout';
|
|
|
8
8
|
export type { PluginOptions } from './plugin';
|
|
9
9
|
export type { G6Spec } from './spec';
|
|
10
10
|
export type { ThemeOptions } from './theme';
|
|
11
|
+
export type { TransformOptions } from './transform';
|
|
11
12
|
export type { ViewportOptions } from './viewport';
|
package/dist/lib/spec/spec.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import type { NodeOptions } from './element/node';
|
|
|
8
8
|
import type { LayoutOptions } from './layout';
|
|
9
9
|
import type { PluginOptions } from './plugin';
|
|
10
10
|
import type { ThemeOptions } from './theme';
|
|
11
|
+
import type { TransformOptions } from './transform';
|
|
11
12
|
import type { ViewportOptions } from './viewport';
|
|
12
13
|
/**
|
|
13
14
|
* <zh/> Spec 定义
|
|
@@ -73,4 +74,10 @@ export interface G6Spec extends CanvasOptions, ViewportOptions {
|
|
|
73
74
|
* <en/> Canvas plugins
|
|
74
75
|
*/
|
|
75
76
|
plugins?: PluginOptions;
|
|
77
|
+
/**
|
|
78
|
+
* <zh/> 数据转换器
|
|
79
|
+
*
|
|
80
|
+
* <en/> Data transforms
|
|
81
|
+
*/
|
|
82
|
+
transforms?: TransformOptions;
|
|
76
83
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ExtensionOptions } from '../registry/extension/types';
|
|
2
|
+
import type { BuiltInTransformOptions } from '../transforms/types';
|
|
3
|
+
export type TransformOptions = ExtensionOptions<BuiltInTransformOptions>;
|
|
4
|
+
export interface UpdateTransformOption {
|
|
5
|
+
key: string;
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
}
|
|
8
|
+
export interface CustomTransformOption {
|
|
9
|
+
type?: string;
|
|
10
|
+
key?: string;
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BaseTransform } from './base-transform';
|
|
2
|
+
import type { DrawData } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* <zh/> 调整元素绘制顺序
|
|
5
|
+
*
|
|
6
|
+
* <en/> Adjust the drawing order of elements
|
|
7
|
+
*/
|
|
8
|
+
export declare class ArrangeDrawOrder extends BaseTransform {
|
|
9
|
+
beforeDraw(input: DrawData): DrawData;
|
|
10
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BaseExtension } from '../registry/extension';
|
|
2
|
+
import type { CustomBehaviorOption } from '../spec/behavior';
|
|
3
|
+
import type { DrawData } from './types';
|
|
4
|
+
export type BaseTransformOptions = CustomBehaviorOption;
|
|
5
|
+
export declare abstract class BaseTransform<T extends BaseTransformOptions = BaseTransformOptions> extends BaseExtension<T> {
|
|
6
|
+
beforeDraw(data: DrawData): DrawData;
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BaseTransform } from './base-transform';
|
|
2
|
+
import type { DrawData } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* <zh/> 处理元素的收起和展开
|
|
5
|
+
*
|
|
6
|
+
* <en/> Process the collapse and expand of elements
|
|
7
|
+
*/
|
|
8
|
+
export declare class CollapseExpandCombo extends BaseTransform {
|
|
9
|
+
beforeDraw(input: DrawData): DrawData;
|
|
10
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { ArrangeDrawOrder } from './arrange-draw-order';
|
|
2
|
+
export { BaseTransform } from './base-transform';
|
|
3
|
+
export { CollapseExpandCombo } from './collapse-expand-combo';
|
|
4
|
+
export { ProcessParallelEdges } from './process-parallel-edges';
|
|
5
|
+
export { UpdateRelatedEdge } from './update-related-edge';
|
|
6
|
+
export type { BaseTransformOptions } from './base-transform';
|