@antv/g6 5.0.0-beta.37 → 5.0.0-beta.38
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/animations/executor.d.ts +4 -5
- package/dist/lib/animations/index.d.ts +22 -8
- package/dist/lib/animations/types.d.ts +78 -20
- package/dist/lib/behaviors/collapse-expand.d.ts +10 -1
- package/dist/lib/behaviors/drag-canvas.d.ts +1 -0
- package/dist/lib/behaviors/hover-element.d.ts +2 -0
- package/dist/lib/constants/animation.d.ts +3 -2
- package/dist/lib/constants/events/animation.d.ts +2 -0
- package/dist/lib/constants/events/graph.d.ts +0 -12
- package/dist/lib/elements/base-element.d.ts +35 -0
- package/dist/lib/elements/combos/base-combo.d.ts +8 -32
- package/dist/lib/elements/combos/circle.d.ts +1 -2
- package/dist/lib/elements/edges/base-edge.d.ts +21 -30
- package/dist/lib/elements/nodes/base-node.d.ts +7 -27
- package/dist/lib/elements/nodes/html.d.ts +2 -1
- package/dist/lib/elements/shapes/badge.d.ts +1 -1
- package/dist/lib/elements/shapes/base-shape.d.ts +6 -0
- package/dist/lib/exports.d.ts +3 -2
- package/dist/lib/layouts/types.d.ts +1 -1
- package/dist/lib/plugins/background/index.d.ts +38 -0
- package/dist/lib/plugins/{contextmenu.d.ts → contextmenu/index.d.ts} +5 -5
- package/dist/lib/plugins/index.d.ts +2 -0
- package/{lib/plugins/watermark.d.ts → dist/lib/plugins/watermark/index.d.ts} +3 -3
- package/dist/lib/runtime/animation.d.ts +54 -0
- package/dist/lib/runtime/canvas.d.ts +0 -2
- package/dist/lib/runtime/data.d.ts +4 -4
- package/dist/lib/runtime/element.d.ts +26 -40
- package/dist/lib/runtime/graph.d.ts +1 -0
- package/dist/lib/runtime/layout.d.ts +7 -0
- package/dist/lib/runtime/transform.d.ts +1 -0
- package/dist/lib/runtime/types.d.ts +7 -0
- package/dist/lib/spec/data.d.ts +14 -0
- package/dist/lib/spec/element/animation.d.ts +3 -9
- package/dist/lib/spec/element/combo.d.ts +4 -3
- package/dist/lib/spec/element/edge.d.ts +4 -3
- package/dist/lib/spec/element/node.d.ts +4 -3
- package/dist/lib/transforms/base-transform.d.ts +2 -1
- package/dist/lib/transforms/collapse-expand-combo.d.ts +4 -3
- package/dist/lib/transforms/collapse-expand-node.d.ts +12 -0
- package/dist/lib/transforms/get-edge-actual-ends.d.ts +13 -0
- package/dist/lib/transforms/index.d.ts +2 -0
- package/dist/lib/transforms/process-parallel-edges.d.ts +6 -4
- package/dist/lib/transforms/types.d.ts +2 -2
- package/dist/lib/transforms/update-related-edge.d.ts +2 -1
- package/dist/lib/transforms/utils.d.ts +13 -0
- package/dist/lib/types/animation.d.ts +1 -2
- package/dist/lib/types/node.d.ts +12 -0
- package/dist/lib/utils/animation.d.ts +17 -29
- package/dist/lib/utils/collapsibility.d.ts +9 -0
- package/dist/lib/utils/element.d.ts +19 -2
- package/dist/lib/utils/theme.d.ts +9 -0
- package/dist/lib/utils/transform.d.ts +14 -0
- package/esm/animations/executor.d.ts +4 -5
- package/esm/animations/executor.js +31 -48
- package/esm/animations/executor.js.map +1 -1
- package/esm/animations/index.d.ts +22 -8
- package/esm/animations/index.js +10 -12
- package/esm/animations/index.js.map +1 -1
- package/esm/animations/types.d.ts +78 -20
- package/esm/behaviors/collapse-expand.d.ts +10 -1
- package/esm/behaviors/collapse-expand.js +15 -6
- package/esm/behaviors/collapse-expand.js.map +1 -1
- package/esm/behaviors/create-edge.js +2 -2
- package/esm/behaviors/create-edge.js.map +1 -1
- package/esm/behaviors/drag-canvas.d.ts +1 -0
- package/esm/behaviors/drag-canvas.js +5 -1
- package/esm/behaviors/drag-canvas.js.map +1 -1
- package/esm/behaviors/drag-element.js +2 -2
- package/esm/behaviors/drag-element.js.map +1 -1
- package/esm/behaviors/hover-element.d.ts +2 -0
- package/esm/behaviors/hover-element.js +12 -2
- package/esm/behaviors/hover-element.js.map +1 -1
- package/esm/constants/animation.d.ts +3 -2
- package/esm/constants/animation.js.map +1 -1
- package/esm/constants/events/animation.d.ts +2 -0
- package/esm/constants/events/animation.js +2 -0
- package/esm/constants/events/animation.js.map +1 -1
- package/esm/constants/events/graph.d.ts +0 -12
- package/esm/constants/events/graph.js +0 -12
- package/esm/constants/events/graph.js.map +1 -1
- package/esm/elements/base-element.d.ts +35 -0
- package/esm/elements/base-element.js +42 -0
- package/esm/elements/base-element.js.map +1 -0
- package/esm/elements/combos/base-combo.d.ts +8 -32
- package/esm/elements/combos/base-combo.js +53 -55
- package/esm/elements/combos/base-combo.js.map +1 -1
- package/esm/elements/combos/circle.d.ts +1 -2
- package/esm/elements/combos/circle.js +1 -12
- package/esm/elements/combos/circle.js.map +1 -1
- package/esm/elements/combos/rect.js +1 -2
- package/esm/elements/combos/rect.js.map +1 -1
- package/esm/elements/edges/base-edge.d.ts +21 -30
- package/esm/elements/edges/base-edge.js +38 -35
- package/esm/elements/edges/base-edge.js.map +1 -1
- package/esm/elements/edges/polyline.js +8 -4
- package/esm/elements/edges/polyline.js.map +1 -1
- package/esm/elements/nodes/base-node.d.ts +7 -27
- package/esm/elements/nodes/base-node.js +16 -38
- package/esm/elements/nodes/base-node.js.map +1 -1
- package/esm/elements/nodes/html.d.ts +2 -1
- package/esm/elements/nodes/html.js +8 -1
- package/esm/elements/nodes/html.js.map +1 -1
- package/esm/elements/shapes/badge.d.ts +1 -1
- package/esm/elements/shapes/base-shape.d.ts +6 -0
- package/esm/elements/shapes/base-shape.js +23 -6
- package/esm/elements/shapes/base-shape.js.map +1 -1
- package/esm/exports.d.ts +3 -2
- package/esm/layouts/types.d.ts +1 -1
- package/esm/plugins/background/index.d.ts +38 -0
- package/esm/plugins/background/index.js +49 -0
- package/esm/plugins/background/index.js.map +1 -0
- package/esm/plugins/{contextmenu.d.ts → contextmenu/index.d.ts} +5 -5
- package/esm/plugins/{contextmenu.js → contextmenu/index.js} +4 -4
- package/esm/plugins/contextmenu/index.js.map +1 -0
- package/esm/{utils/contextmenu.js → plugins/contextmenu/util.js} +1 -1
- package/esm/{utils/contextmenu.js.map → plugins/contextmenu/util.js.map} +1 -1
- package/esm/plugins/history/index.js +1 -1
- package/esm/plugins/history/index.js.map +1 -1
- package/esm/plugins/history/{utils.js → util.js} +1 -1
- package/esm/plugins/history/util.js.map +1 -0
- package/esm/plugins/index.d.ts +2 -0
- package/esm/plugins/index.js +1 -0
- package/esm/plugins/index.js.map +1 -1
- package/esm/plugins/timebar.js +1 -1
- package/esm/plugins/timebar.js.map +1 -1
- package/{dist/lib/plugins/watermark.d.ts → esm/plugins/watermark/index.d.ts} +3 -3
- package/esm/plugins/{watermark.js → watermark/index.js} +4 -4
- package/esm/plugins/watermark/index.js.map +1 -0
- package/esm/{utils/watermark.js → plugins/watermark/util.js} +1 -1
- package/esm/plugins/watermark/util.js.map +1 -0
- package/esm/registry/build-in.js +14 -6
- package/esm/registry/build-in.js.map +1 -1
- package/esm/runtime/animation.d.ts +54 -0
- package/esm/runtime/animation.js +139 -0
- package/esm/runtime/animation.js.map +1 -0
- package/esm/runtime/canvas.d.ts +0 -2
- package/esm/runtime/canvas.js +0 -21
- package/esm/runtime/canvas.js.map +1 -1
- package/esm/runtime/data.d.ts +4 -4
- package/esm/runtime/data.js +16 -17
- package/esm/runtime/data.js.map +1 -1
- package/esm/runtime/element.d.ts +26 -40
- package/esm/runtime/element.js +218 -179
- package/esm/runtime/element.js.map +1 -1
- package/esm/runtime/graph.d.ts +1 -0
- package/esm/runtime/graph.js +44 -11
- package/esm/runtime/graph.js.map +1 -1
- package/esm/runtime/layout.d.ts +7 -0
- package/esm/runtime/layout.js +44 -3
- package/esm/runtime/layout.js.map +1 -1
- package/esm/runtime/transform.d.ts +1 -0
- package/esm/runtime/transform.js +9 -2
- package/esm/runtime/transform.js.map +1 -1
- package/esm/runtime/types.d.ts +7 -0
- package/esm/runtime/viewport.js +2 -2
- package/esm/runtime/viewport.js.map +1 -1
- package/esm/spec/data.d.ts +14 -0
- package/esm/spec/element/animation.d.ts +3 -9
- package/esm/spec/element/combo.d.ts +4 -3
- package/esm/spec/element/edge.d.ts +4 -3
- package/esm/spec/element/node.d.ts +4 -3
- package/esm/themes/base.js +14 -10
- package/esm/themes/base.js.map +1 -1
- package/esm/transforms/base-transform.d.ts +2 -1
- package/esm/transforms/base-transform.js +1 -1
- package/esm/transforms/base-transform.js.map +1 -1
- package/esm/transforms/collapse-expand-combo.d.ts +4 -3
- package/esm/transforms/collapse-expand-combo.js +9 -25
- package/esm/transforms/collapse-expand-combo.js.map +1 -1
- package/esm/transforms/collapse-expand-node.d.ts +12 -0
- package/esm/transforms/collapse-expand-node.js +91 -0
- package/esm/transforms/collapse-expand-node.js.map +1 -0
- package/esm/transforms/get-edge-actual-ends.d.ts +13 -0
- package/esm/transforms/get-edge-actual-ends.js +36 -0
- package/esm/transforms/get-edge-actual-ends.js.map +1 -0
- package/esm/transforms/index.d.ts +2 -0
- package/esm/transforms/index.js +2 -0
- package/esm/transforms/index.js.map +1 -1
- package/esm/transforms/process-parallel-edges.d.ts +6 -4
- package/esm/transforms/process-parallel-edges.js +42 -27
- package/esm/transforms/process-parallel-edges.js.map +1 -1
- package/esm/transforms/types.d.ts +2 -2
- package/esm/transforms/types.js +1 -10
- package/esm/transforms/types.js.map +1 -1
- package/esm/transforms/update-related-edge.d.ts +2 -1
- package/esm/transforms/update-related-edge.js +4 -1
- package/esm/transforms/update-related-edge.js.map +1 -1
- package/esm/transforms/utils.d.ts +13 -0
- package/esm/transforms/utils.js +25 -0
- package/esm/transforms/utils.js.map +1 -0
- package/esm/types/animation.d.ts +1 -2
- package/esm/types/node.d.ts +12 -0
- package/esm/utils/animation.d.ts +17 -29
- package/esm/utils/animation.js +64 -54
- package/esm/utils/animation.js.map +1 -1
- package/esm/utils/cache.js +0 -1
- package/esm/utils/cache.js.map +1 -1
- package/esm/utils/collapsibility.d.ts +9 -0
- package/esm/utils/collapsibility.js +11 -0
- package/esm/utils/collapsibility.js.map +1 -0
- package/esm/utils/dom.js +1 -2
- package/esm/utils/dom.js.map +1 -1
- package/esm/utils/edge.js +2 -1
- package/esm/utils/edge.js.map +1 -1
- package/esm/utils/element.d.ts +19 -2
- package/esm/utils/element.js +24 -3
- package/esm/utils/element.js.map +1 -1
- package/esm/utils/theme.d.ts +9 -0
- package/esm/utils/theme.js +17 -0
- package/esm/utils/theme.js.map +1 -0
- package/esm/utils/transform.d.ts +14 -0
- package/esm/utils/transform.js +24 -0
- package/esm/utils/transform.js.map +1 -1
- package/lib/animations/executor.d.ts +4 -5
- package/lib/animations/executor.js +30 -47
- package/lib/animations/executor.js.map +1 -1
- package/lib/animations/index.d.ts +22 -8
- package/lib/animations/index.js +12 -14
- package/lib/animations/index.js.map +1 -1
- package/lib/animations/types.d.ts +78 -20
- package/lib/behaviors/collapse-expand.d.ts +10 -1
- package/lib/behaviors/collapse-expand.js +15 -6
- package/lib/behaviors/collapse-expand.js.map +1 -1
- package/lib/behaviors/create-edge.js +2 -2
- package/lib/behaviors/create-edge.js.map +1 -1
- package/lib/behaviors/drag-canvas.d.ts +1 -0
- package/lib/behaviors/drag-canvas.js +5 -1
- package/lib/behaviors/drag-canvas.js.map +1 -1
- package/lib/behaviors/drag-element.js +2 -2
- package/lib/behaviors/drag-element.js.map +1 -1
- package/lib/behaviors/hover-element.d.ts +2 -0
- package/lib/behaviors/hover-element.js +12 -2
- package/lib/behaviors/hover-element.js.map +1 -1
- package/lib/constants/animation.d.ts +3 -2
- package/lib/constants/animation.js.map +1 -1
- package/lib/constants/events/animation.d.ts +2 -0
- package/lib/constants/events/animation.js +2 -0
- package/lib/constants/events/animation.js.map +1 -1
- package/lib/constants/events/graph.d.ts +0 -12
- package/lib/constants/events/graph.js +0 -12
- package/lib/constants/events/graph.js.map +1 -1
- package/lib/elements/base-element.d.ts +35 -0
- package/lib/elements/base-element.js +46 -0
- package/lib/elements/base-element.js.map +1 -0
- package/lib/elements/combos/base-combo.d.ts +8 -32
- package/lib/elements/combos/base-combo.js +52 -54
- package/lib/elements/combos/base-combo.js.map +1 -1
- package/lib/elements/combos/circle.d.ts +1 -2
- package/lib/elements/combos/circle.js +1 -12
- package/lib/elements/combos/circle.js.map +1 -1
- package/lib/elements/combos/rect.js +1 -2
- package/lib/elements/combos/rect.js.map +1 -1
- package/lib/elements/edges/base-edge.d.ts +21 -30
- package/lib/elements/edges/base-edge.js +38 -35
- package/lib/elements/edges/base-edge.js.map +1 -1
- package/lib/elements/edges/polyline.js +8 -4
- package/lib/elements/edges/polyline.js.map +1 -1
- package/lib/elements/nodes/base-node.d.ts +7 -27
- package/lib/elements/nodes/base-node.js +15 -37
- package/lib/elements/nodes/base-node.js.map +1 -1
- package/lib/elements/nodes/html.d.ts +2 -1
- package/lib/elements/nodes/html.js +8 -1
- package/lib/elements/nodes/html.js.map +1 -1
- package/lib/elements/shapes/badge.d.ts +1 -1
- package/lib/elements/shapes/base-shape.d.ts +6 -0
- package/lib/elements/shapes/base-shape.js +23 -6
- package/lib/elements/shapes/base-shape.js.map +1 -1
- package/lib/exports.d.ts +3 -2
- package/lib/layouts/types.d.ts +1 -1
- package/lib/plugins/background/index.d.ts +38 -0
- package/lib/plugins/background/index.js +53 -0
- package/lib/plugins/background/index.js.map +1 -0
- package/lib/plugins/{contextmenu.d.ts → contextmenu/index.d.ts} +5 -5
- package/lib/plugins/{contextmenu.js → contextmenu/index.js} +6 -6
- package/lib/plugins/{contextmenu.js.map → contextmenu/index.js.map} +1 -1
- package/lib/{utils/contextmenu.js → plugins/contextmenu/util.js} +1 -1
- package/lib/{utils/contextmenu.js.map → plugins/contextmenu/util.js.map} +1 -1
- package/lib/plugins/history/index.js +2 -2
- package/lib/plugins/history/index.js.map +1 -1
- package/lib/plugins/history/{utils.js → util.js} +1 -1
- package/lib/plugins/history/util.js.map +1 -0
- package/lib/plugins/index.d.ts +2 -0
- package/lib/plugins/index.js +3 -1
- package/lib/plugins/index.js.map +1 -1
- package/lib/plugins/timebar.js +1 -1
- package/lib/plugins/timebar.js.map +1 -1
- package/{esm/plugins/watermark.d.ts → lib/plugins/watermark/index.d.ts} +3 -3
- package/lib/plugins/{watermark.js → watermark/index.js} +6 -6
- package/lib/plugins/watermark/index.js.map +1 -0
- package/lib/{utils/watermark.js → plugins/watermark/util.js} +1 -1
- package/lib/plugins/watermark/util.js.map +1 -0
- package/lib/registry/build-in.js +11 -3
- package/lib/registry/build-in.js.map +1 -1
- package/lib/runtime/animation.d.ts +54 -0
- package/lib/runtime/animation.js +143 -0
- package/lib/runtime/animation.js.map +1 -0
- package/lib/runtime/canvas.d.ts +0 -2
- package/lib/runtime/canvas.js +0 -21
- package/lib/runtime/canvas.js.map +1 -1
- package/lib/runtime/data.d.ts +4 -4
- package/lib/runtime/data.js +15 -16
- package/lib/runtime/data.js.map +1 -1
- package/lib/runtime/element.d.ts +26 -40
- package/lib/runtime/element.js +215 -176
- package/lib/runtime/element.js.map +1 -1
- package/lib/runtime/graph.d.ts +1 -0
- package/lib/runtime/graph.js +44 -11
- package/lib/runtime/graph.js.map +1 -1
- package/lib/runtime/layout.d.ts +7 -0
- package/lib/runtime/layout.js +43 -2
- package/lib/runtime/layout.js.map +1 -1
- package/lib/runtime/transform.d.ts +1 -0
- package/lib/runtime/transform.js +9 -2
- package/lib/runtime/transform.js.map +1 -1
- package/lib/runtime/types.d.ts +7 -0
- package/lib/runtime/viewport.js +1 -1
- package/lib/runtime/viewport.js.map +1 -1
- package/lib/spec/data.d.ts +14 -0
- package/lib/spec/element/animation.d.ts +3 -9
- package/lib/spec/element/combo.d.ts +4 -3
- package/lib/spec/element/edge.d.ts +4 -3
- package/lib/spec/element/node.d.ts +4 -3
- package/lib/themes/base.js +14 -10
- package/lib/themes/base.js.map +1 -1
- package/lib/transforms/base-transform.d.ts +2 -1
- package/lib/transforms/base-transform.js +1 -1
- package/lib/transforms/base-transform.js.map +1 -1
- package/lib/transforms/collapse-expand-combo.d.ts +4 -3
- package/lib/transforms/collapse-expand-combo.js +13 -29
- package/lib/transforms/collapse-expand-combo.js.map +1 -1
- package/lib/transforms/collapse-expand-node.d.ts +12 -0
- package/lib/transforms/collapse-expand-node.js +95 -0
- package/lib/transforms/collapse-expand-node.js.map +1 -0
- package/lib/transforms/get-edge-actual-ends.d.ts +13 -0
- package/lib/transforms/get-edge-actual-ends.js +41 -0
- package/lib/transforms/get-edge-actual-ends.js.map +1 -0
- package/lib/transforms/index.d.ts +2 -0
- package/lib/transforms/index.js +5 -1
- package/lib/transforms/index.js.map +1 -1
- package/lib/transforms/process-parallel-edges.d.ts +6 -4
- package/lib/transforms/process-parallel-edges.js +41 -26
- package/lib/transforms/process-parallel-edges.js.map +1 -1
- package/lib/transforms/types.d.ts +2 -2
- package/lib/transforms/types.js +0 -12
- package/lib/transforms/types.js.map +1 -1
- package/lib/transforms/update-related-edge.d.ts +2 -1
- package/lib/transforms/update-related-edge.js +4 -1
- package/lib/transforms/update-related-edge.js.map +1 -1
- package/lib/transforms/utils.d.ts +13 -0
- package/lib/transforms/utils.js +29 -0
- package/lib/transforms/utils.js.map +1 -0
- package/lib/types/animation.d.ts +1 -2
- package/lib/types/node.d.ts +12 -0
- package/lib/utils/animation.d.ts +17 -29
- package/lib/utils/animation.js +65 -56
- package/lib/utils/animation.js.map +1 -1
- package/lib/utils/cache.js +0 -1
- package/lib/utils/cache.js.map +1 -1
- package/lib/utils/collapsibility.d.ts +9 -0
- package/lib/utils/collapsibility.js +15 -0
- package/lib/utils/collapsibility.js.map +1 -0
- package/lib/utils/dom.js +1 -2
- package/lib/utils/dom.js.map +1 -1
- package/lib/utils/edge.js +2 -1
- package/lib/utils/edge.js.map +1 -1
- package/lib/utils/element.d.ts +19 -2
- package/lib/utils/element.js +26 -3
- package/lib/utils/element.js.map +1 -1
- package/lib/utils/theme.d.ts +9 -0
- package/lib/utils/theme.js +21 -0
- package/lib/utils/theme.js.map +1 -0
- package/lib/utils/transform.d.ts +14 -0
- package/lib/utils/transform.js +26 -1
- package/lib/utils/transform.js.map +1 -1
- package/package.json +6 -6
- package/src/animations/executor.ts +39 -61
- package/src/animations/index.ts +19 -15
- package/src/animations/types.ts +82 -27
- package/src/behaviors/collapse-expand.ts +25 -9
- package/src/behaviors/create-edge.ts +2 -2
- package/src/behaviors/drag-canvas.ts +6 -1
- package/src/behaviors/drag-element.ts +2 -2
- package/src/behaviors/hover-element.ts +17 -3
- package/src/constants/animation.ts +4 -2
- package/src/constants/events/animation.ts +2 -0
- package/src/constants/events/graph.ts +0 -12
- package/src/elements/base-element.ts +52 -0
- package/src/elements/combos/base-combo.ts +66 -74
- package/src/elements/combos/circle.ts +2 -20
- package/src/elements/combos/rect.ts +1 -2
- package/src/elements/edges/base-edge.ts +57 -45
- package/src/elements/edges/polyline.ts +8 -4
- package/src/elements/nodes/base-node.ts +20 -47
- package/src/elements/nodes/html.ts +9 -1
- package/src/elements/shapes/base-shape.ts +24 -9
- package/src/exports.ts +3 -2
- package/src/layouts/types.ts +1 -1
- package/src/plugins/background/index.ts +65 -0
- package/src/plugins/{contextmenu.ts → contextmenu/index.ts} +7 -7
- package/src/plugins/history/index.ts +1 -1
- package/src/plugins/index.ts +2 -0
- package/src/plugins/timebar.ts +1 -1
- package/src/plugins/{watermark.ts → watermark/index.ts} +5 -5
- package/src/registry/build-in.ts +21 -5
- package/src/runtime/animation.ts +186 -0
- package/src/runtime/canvas.ts +0 -24
- package/src/runtime/data.ts +16 -19
- package/src/runtime/element.ts +289 -255
- package/src/runtime/graph.ts +44 -11
- package/src/runtime/layout.ts +51 -4
- package/src/runtime/transform.ts +10 -2
- package/src/runtime/types.ts +7 -0
- package/src/runtime/viewport.ts +2 -2
- package/src/spec/data.ts +14 -1
- package/src/spec/element/animation.ts +3 -13
- package/src/spec/element/combo.ts +4 -3
- package/src/spec/element/edge.ts +4 -3
- package/src/spec/element/node.ts +4 -3
- package/src/themes/base.ts +14 -10
- package/src/transforms/base-transform.ts +2 -1
- package/src/transforms/collapse-expand-combo.ts +11 -32
- package/src/transforms/collapse-expand-node.ts +107 -0
- package/src/transforms/get-edge-actual-ends.ts +45 -0
- package/src/transforms/index.ts +2 -0
- package/src/transforms/process-parallel-edges.ts +50 -36
- package/src/transforms/types.ts +5 -5
- package/src/transforms/update-related-edge.ts +5 -1
- package/src/transforms/utils.ts +31 -0
- package/src/types/animation.ts +1 -3
- package/src/types/node.ts +12 -0
- package/src/utils/animation.ts +73 -63
- package/src/utils/cache.ts +0 -1
- package/src/utils/collapsibility.ts +12 -0
- package/src/utils/dom.ts +1 -2
- package/src/utils/edge.ts +2 -1
- package/src/utils/element.ts +28 -3
- package/src/utils/theme.ts +18 -0
- package/src/utils/transform.ts +33 -0
- package/dist/lib/utils/combo.d.ts +0 -34
- package/esm/plugins/contextmenu.js.map +0 -1
- package/esm/plugins/history/utils.js.map +0 -1
- package/esm/plugins/watermark.js.map +0 -1
- package/esm/utils/combo.d.ts +0 -34
- package/esm/utils/combo.js +0 -111
- package/esm/utils/combo.js.map +0 -1
- package/esm/utils/watermark.js.map +0 -1
- package/lib/plugins/history/utils.js.map +0 -1
- package/lib/plugins/watermark.js.map +0 -1
- package/lib/utils/combo.d.ts +0 -34
- package/lib/utils/combo.js +0 -117
- package/lib/utils/combo.js.map +0 -1
- package/lib/utils/watermark.js.map +0 -1
- package/src/utils/combo.ts +0 -134
- /package/dist/lib/{utils/contextmenu.d.ts → plugins/contextmenu/util.d.ts} +0 -0
- /package/dist/lib/plugins/history/{utils.d.ts → util.d.ts} +0 -0
- /package/dist/lib/{utils/watermark.d.ts → plugins/watermark/util.d.ts} +0 -0
- /package/esm/{utils/contextmenu.d.ts → plugins/contextmenu/util.d.ts} +0 -0
- /package/esm/plugins/history/{utils.d.ts → util.d.ts} +0 -0
- /package/esm/{utils/watermark.d.ts → plugins/watermark/util.d.ts} +0 -0
- /package/lib/{utils/contextmenu.d.ts → plugins/contextmenu/util.d.ts} +0 -0
- /package/lib/plugins/history/{utils.d.ts → util.d.ts} +0 -0
- /package/lib/{utils/watermark.d.ts → plugins/watermark/util.d.ts} +0 -0
- /package/src/{utils/contextmenu.ts → plugins/contextmenu/util.ts} +0 -0
- /package/src/plugins/history/{utils.ts → util.ts} +0 -0
- /package/src/{utils/watermark.ts → plugins/watermark/util.ts} +0 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { RuntimeContext } from '../../runtime/types';
|
|
2
|
+
import type { BasePluginOptions } from '../base-plugin';
|
|
3
|
+
import { BasePlugin } from '../base-plugin';
|
|
4
|
+
/**
|
|
5
|
+
* <zh/> 背景配置项
|
|
6
|
+
*
|
|
7
|
+
* <en/> Background options
|
|
8
|
+
*/
|
|
9
|
+
export interface BackgroundOptions extends BasePluginOptions, CSSStyleDeclaration {
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* <zh/> 背景图
|
|
13
|
+
*
|
|
14
|
+
* <en/> Background image
|
|
15
|
+
* @remarks
|
|
16
|
+
* <zh/> 支持为图画布设置一个背景图片,让画布更有层次感、叙事性。
|
|
17
|
+
*
|
|
18
|
+
* <en/> Support setting a background image for the canvas to make the canvas more hierarchical and narrative.
|
|
19
|
+
*/
|
|
20
|
+
export declare class Background extends BasePlugin<BackgroundOptions> {
|
|
21
|
+
static defaultOptions: Partial<BackgroundOptions>;
|
|
22
|
+
private $element;
|
|
23
|
+
constructor(context: RuntimeContext, options: BackgroundOptions);
|
|
24
|
+
/**
|
|
25
|
+
* <zh/> 更新背景图配置
|
|
26
|
+
*
|
|
27
|
+
* <en/> Update the background image configuration
|
|
28
|
+
* @param options - <zh/> 配置项 | <en/> Options
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
update(options: Partial<BackgroundOptions>): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* <zh/> 销毁背景图
|
|
34
|
+
*
|
|
35
|
+
* <en/> Destroy the background image
|
|
36
|
+
*/
|
|
37
|
+
destroy(): void;
|
|
38
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { RuntimeContext } from '
|
|
2
|
-
import type { IElementEvent } from '
|
|
3
|
-
import type {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
1
|
+
import type { RuntimeContext } from '../../runtime/types';
|
|
2
|
+
import type { IElementEvent } from '../../types/event';
|
|
3
|
+
import type { BasePluginOptions } from '../base-plugin';
|
|
4
|
+
import { BasePlugin } from '../base-plugin';
|
|
5
|
+
import type { Item } from './util';
|
|
6
6
|
/**
|
|
7
7
|
* <zh/> 上下文菜单配置项
|
|
8
8
|
*
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { Background } from './background';
|
|
1
2
|
export { BasePlugin } from './base-plugin';
|
|
2
3
|
export { BubbleSets } from './bubble-sets';
|
|
3
4
|
export { CameraSetting } from './camera-setting';
|
|
@@ -10,6 +11,7 @@ export { Timebar } from './timebar';
|
|
|
10
11
|
export { Toolbar } from './toolbar';
|
|
11
12
|
export { Tooltip } from './tooltip';
|
|
12
13
|
export { Watermark } from './watermark';
|
|
14
|
+
export type { BackgroundOptions } from './background';
|
|
13
15
|
export type { BasePluginOptions } from './base-plugin';
|
|
14
16
|
export type { BubbleSetsOptions } from './bubble-sets';
|
|
15
17
|
export type { CameraSettingOptions } from './camera-setting';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { RuntimeContext } from '
|
|
2
|
-
import type { BasePluginOptions } from '
|
|
3
|
-
import { BasePlugin } from '
|
|
1
|
+
import type { RuntimeContext } from '../../runtime/types';
|
|
2
|
+
import type { BasePluginOptions } from '../base-plugin';
|
|
3
|
+
import { BasePlugin } from '../base-plugin';
|
|
4
4
|
/**
|
|
5
5
|
* <zh/> 水印配置项
|
|
6
6
|
*
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { IAnimation } from '@antv/g';
|
|
2
|
+
import type { AnimationContext, AnimationEffectTiming } from '../animations/types';
|
|
3
|
+
import type { ID, Point } from '../types';
|
|
4
|
+
import type { RuntimeContext } from './types';
|
|
5
|
+
export declare class Animation {
|
|
6
|
+
private context;
|
|
7
|
+
constructor(context: RuntimeContext);
|
|
8
|
+
private tasks;
|
|
9
|
+
private animations;
|
|
10
|
+
private getTasks;
|
|
11
|
+
add(context: AnimationContext, callbacks?: AnimationCallbacks): void;
|
|
12
|
+
animate(localAnimation?: AnimationEffectTiming | boolean, callbacks?: AnimationCallbacks, extendOptions?: ExtendOptions): IAnimation | null;
|
|
13
|
+
/**
|
|
14
|
+
* <zh/> 推断额外的动画样式
|
|
15
|
+
*
|
|
16
|
+
* <en/> Infer additional animation styles
|
|
17
|
+
* @param context - <zh/> 动画上下文 | <en/> Animation context
|
|
18
|
+
* @param options - <zh/> 扩展选项 | <en/> Extend options
|
|
19
|
+
* @returns <zh/> 始态样式与终态样式 | <en/> Initial style and final style
|
|
20
|
+
*/
|
|
21
|
+
inferStyle(context: AnimationContext, options?: ExtendOptions): [Record<string, unknown>, Record<string, unknown>];
|
|
22
|
+
stop(): void;
|
|
23
|
+
clear(): void;
|
|
24
|
+
destroy(): void;
|
|
25
|
+
}
|
|
26
|
+
interface AnimationCallbacks {
|
|
27
|
+
before?: () => void;
|
|
28
|
+
beforeAnimate?: (animation: IAnimation) => void;
|
|
29
|
+
afterAnimate?: (animation: IAnimation) => void;
|
|
30
|
+
after?: () => void;
|
|
31
|
+
}
|
|
32
|
+
interface ExtendOptions {
|
|
33
|
+
/**
|
|
34
|
+
* <zh/> stage 为 collapse 时,指定当前展开/收起的目标元素及其后代元素
|
|
35
|
+
*
|
|
36
|
+
* <en/> When the stage is collapse, specify the target element and its descendants to expand/collapse
|
|
37
|
+
*/
|
|
38
|
+
collapse?: {
|
|
39
|
+
target: ID;
|
|
40
|
+
descendants: ID[];
|
|
41
|
+
position: Point;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* <zh/> stage 为 expand 时,指定当前展开/收起的目标元素及其后代元素
|
|
45
|
+
*
|
|
46
|
+
* <en/> When the stage is expand, specify the target element and its descendants to expand/collapse
|
|
47
|
+
*/
|
|
48
|
+
expand?: {
|
|
49
|
+
target: ID;
|
|
50
|
+
descendants: ID[];
|
|
51
|
+
position: Point;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
export {};
|
|
@@ -42,8 +42,6 @@ export declare class Canvas {
|
|
|
42
42
|
get context(): import("@antv/g").CanvasContext;
|
|
43
43
|
getDevice(): any;
|
|
44
44
|
getConfig(): CanvasConfig;
|
|
45
|
-
private backgroundElement;
|
|
46
|
-
private initBackgroundElement;
|
|
47
45
|
setBackground(background?: string | undefined): void;
|
|
48
46
|
setCursor(cursor: Cursor): void;
|
|
49
47
|
getSize(): [number, number];
|
|
@@ -68,9 +68,9 @@ export declare class DataController {
|
|
|
68
68
|
getNodeData(ids?: ID[]): NodeData[];
|
|
69
69
|
getEdgeData(ids?: ID[]): EdgeData[];
|
|
70
70
|
getComboData(ids?: ID[]): ComboData[];
|
|
71
|
-
getAncestorsData(id: ID,
|
|
71
|
+
getAncestorsData(id: ID, hierarchyKey: HierarchyKey): NodeLikeData[];
|
|
72
72
|
getDescendantsData(id: ID): NodeLikeData[];
|
|
73
|
-
getParentData(id: ID,
|
|
73
|
+
getParentData(id: ID, hierarchyKey: HierarchyKey): NodeLikeData | undefined;
|
|
74
74
|
getChildrenData(id: ID): NodeLikeData[];
|
|
75
75
|
/**
|
|
76
76
|
* <zh/> 获取指定类型元素的数据
|
|
@@ -134,10 +134,10 @@ export declare class DataController {
|
|
|
134
134
|
* <en/> Set the parent node of the node
|
|
135
135
|
* @param id - <zh/> 节点 ID | <en/> node ID
|
|
136
136
|
* @param parent - <zh/> 父节点 ID | <en/> parent node ID
|
|
137
|
-
* @param
|
|
137
|
+
* @param hierarchyKey - <zh/> 层次结构类型 | <en/> hierarchy type
|
|
138
138
|
* @param update - <zh/> 添加新/旧父节点数据更新记录 | <en/> add new/old parent node data update record
|
|
139
139
|
*/
|
|
140
|
-
setParent(id: ID, parent: ID | undefined,
|
|
140
|
+
setParent(id: ID, parent: ID | undefined, hierarchyKey: HierarchyKey, update?: boolean): void;
|
|
141
141
|
/**
|
|
142
142
|
* <zh/> 刷新 combo 数据
|
|
143
143
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BaseStyleProps
|
|
1
|
+
import type { BaseStyleProps } from '@antv/g';
|
|
2
2
|
import type { AnimationStage } from '../spec/element/animation';
|
|
3
3
|
import type { Combo, Element, ElementDatum, ElementType, ID, Node, State } from '../types';
|
|
4
4
|
import type { RuntimeContext } from './types';
|
|
@@ -54,63 +54,49 @@ export declare class ElementController {
|
|
|
54
54
|
getNodes(): Node[];
|
|
55
55
|
getEdges(): import("..").BaseEdge[];
|
|
56
56
|
getCombos(): Combo[];
|
|
57
|
-
private getAnimation;
|
|
58
|
-
private getAnimationExecutor;
|
|
59
|
-
/**
|
|
60
|
-
* <zh/> 获取边端点连接上下文
|
|
61
|
-
*
|
|
62
|
-
* <en/> Get edge end context
|
|
63
|
-
* @returns <zh/> 边端点连接上下文 | <en/> edge end context
|
|
64
|
-
* @remarks
|
|
65
|
-
* <zh/> 只提供了最基本的节点示例和连接点位置信息,更多的上下文信息需要在边元素中计算
|
|
66
|
-
*
|
|
67
|
-
* <en/> Only the most basic node instances and connection point position information are provided, and more context information needs to be calculated in the edge element
|
|
68
|
-
*/
|
|
69
|
-
private getEdgeEndsContext;
|
|
70
57
|
getElementComputedStyle(elementType: ElementType, datum: ElementDatum): any;
|
|
71
58
|
/**
|
|
72
59
|
* <zh/> 开始绘制流程
|
|
73
60
|
*
|
|
74
61
|
* <en/> start render process
|
|
75
62
|
*/
|
|
76
|
-
draw(
|
|
63
|
+
draw(context?: DrawContext): import("@antv/g").IAnimation | null;
|
|
77
64
|
private computeChangesAndDrawData;
|
|
78
65
|
private transformData;
|
|
79
66
|
private createElement;
|
|
80
|
-
private
|
|
67
|
+
private createElements;
|
|
68
|
+
private updateElement;
|
|
69
|
+
private updateElements;
|
|
70
|
+
private destroyElement;
|
|
71
|
+
private destroyElements;
|
|
72
|
+
private clearElement;
|
|
81
73
|
/**
|
|
82
|
-
* <zh/>
|
|
83
|
-
* - show: 立即将元素显示出来,然后执行动画
|
|
84
|
-
* - hide: 先执行动画,然后隐藏元素
|
|
85
|
-
*
|
|
86
|
-
* 如果在调用 hide 后立即调用 show,hide 动画完成后会将元素隐藏
|
|
74
|
+
* <zh/> 收起节点
|
|
87
75
|
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
* <
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
*
|
|
76
|
+
* <en/> collapse node
|
|
77
|
+
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
78
|
+
* @param animation - <zh/> 是否使用动画,默认为 true | <en/> Whether to use animation, default is true
|
|
79
|
+
*/
|
|
80
|
+
collapseNode(id: ID, animation: boolean): Promise<void>;
|
|
81
|
+
/**
|
|
82
|
+
* <zh/> 展开节点
|
|
95
83
|
*
|
|
96
|
-
*
|
|
84
|
+
* <en/> expand node
|
|
85
|
+
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
86
|
+
* @param animation - <zh/> 是否使用动画,默认为 true | <en/> Whether to use animation, default is true
|
|
97
87
|
*/
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
private destroyElement;
|
|
102
|
-
private getDestroyTasks;
|
|
103
|
-
private clearElement;
|
|
88
|
+
expandNode(id: ID, animation: boolean): Promise<void>;
|
|
89
|
+
collapseCombo(id: ID, animation: boolean): Promise<void>;
|
|
90
|
+
expandCombo(id: ID, animation: boolean): Promise<void>;
|
|
104
91
|
destroy(): void;
|
|
105
92
|
}
|
|
106
|
-
|
|
107
|
-
type DrawContext = {
|
|
108
|
-
animator?: AnimationExecutor;
|
|
93
|
+
export interface DrawContext {
|
|
109
94
|
/** <zh/> 是否使用动画,默认为 true | <en/> Whether to use animation, default is true */
|
|
110
95
|
animation: boolean;
|
|
111
96
|
/** <zh/> 当前绘制阶段 | <en/> Current draw stage */
|
|
112
97
|
stage?: AnimationStage;
|
|
113
98
|
/** <zh/> 是否不抛出事件 | <en/> Whether not to throw events */
|
|
114
99
|
silence?: boolean;
|
|
115
|
-
|
|
116
|
-
|
|
100
|
+
/** <zh/> 收起/展开的对象 ID | <en/> ID of the object to collapse/expand */
|
|
101
|
+
collapseExpandTarget?: ID;
|
|
102
|
+
}
|
|
@@ -13,6 +13,13 @@ export declare class LayoutController {
|
|
|
13
13
|
constructor(context: RuntimeContext);
|
|
14
14
|
getLayoutInstance(): BaseLayout[];
|
|
15
15
|
layout(): Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* <zh/> 模拟布局
|
|
18
|
+
*
|
|
19
|
+
* <en/> Simulate layout
|
|
20
|
+
* @returns <zh/> 模拟布局结果 | <en/> Simulated layout result
|
|
21
|
+
*/
|
|
22
|
+
simulate(): Promise<GraphData>;
|
|
16
23
|
stepLayout(data: GraphData, options: STDLayoutOptions, index: number): Promise<GraphData>;
|
|
17
24
|
private graphLayout;
|
|
18
25
|
private treeLayout;
|
|
@@ -6,6 +6,7 @@ export declare const REQUIRED_TRANSFORMS: TransformOptions;
|
|
|
6
6
|
export declare class TransformController extends ExtensionController<BaseTransform<CustomTransformOption>> {
|
|
7
7
|
category: "transform";
|
|
8
8
|
constructor(context: RuntimeContext);
|
|
9
|
+
protected getTransforms(): void;
|
|
9
10
|
setTransforms(transforms: TransformOptions): void;
|
|
10
11
|
getTransformInstance(key?: string): BaseTransform<CustomTransformOption> | Record<string, BaseTransform<CustomTransformOption>>;
|
|
11
12
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { GraphOptions } from '../spec';
|
|
2
|
+
import type { Animation } from './animation';
|
|
2
3
|
import type { BatchController } from './batch';
|
|
3
4
|
import type { BehaviorController } from './behavior';
|
|
4
5
|
import type { Canvas } from './canvas';
|
|
@@ -50,6 +51,12 @@ export interface RuntimeContext {
|
|
|
50
51
|
* <en/> Only available after drawing starts
|
|
51
52
|
*/
|
|
52
53
|
element?: ElementController;
|
|
54
|
+
/**
|
|
55
|
+
* <zh/> 元素动画执行器
|
|
56
|
+
*
|
|
57
|
+
* <en/> Element animation executor
|
|
58
|
+
*/
|
|
59
|
+
animation?: Animation;
|
|
53
60
|
/**
|
|
54
61
|
* <zh/> 视口控制器
|
|
55
62
|
*
|
package/dist/lib/spec/data.d.ts
CHANGED
|
@@ -176,6 +176,20 @@ export interface EdgeData {
|
|
|
176
176
|
* <en/> Target node ID
|
|
177
177
|
*/
|
|
178
178
|
target: ID;
|
|
179
|
+
/**
|
|
180
|
+
* <zh/> 边的起点 shape
|
|
181
|
+
*
|
|
182
|
+
* <en/> The source shape. Represents the start of the edge
|
|
183
|
+
* @internal
|
|
184
|
+
*/
|
|
185
|
+
sourceNode?: ID;
|
|
186
|
+
/**
|
|
187
|
+
* <zh/> 边的终点 shape
|
|
188
|
+
*
|
|
189
|
+
* <en/> The source shape. Represents the start of the edge
|
|
190
|
+
* @internal
|
|
191
|
+
*/
|
|
192
|
+
targetNode?: ID;
|
|
179
193
|
/**
|
|
180
194
|
* <zh/> 边类型
|
|
181
195
|
*
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import type { Animation } from '../../animations/types';
|
|
2
|
-
export type AnimationOptions = false | ({
|
|
3
|
-
[STAGE in AnimationStage]?: Animation;
|
|
4
|
-
} & {
|
|
5
|
-
[key: string]: Animation;
|
|
6
|
-
});
|
|
7
1
|
/**
|
|
8
|
-
* <zh/>
|
|
2
|
+
* <zh/> 元素动画执行阶段
|
|
9
3
|
*
|
|
10
|
-
* <en/>
|
|
4
|
+
* <en/> Stage of element animation execution
|
|
11
5
|
*/
|
|
12
|
-
export type AnimationStage = 'enter' | 'update' | 'exit' | '
|
|
6
|
+
export type AnimationStage = 'enter' | 'update' | 'exit' | 'show' | 'hide' | 'collapse' | 'expand' | string;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { AnimationOptions } from '../../animations/types';
|
|
1
2
|
import type { BaseComboStyleProps } from '../../elements/combos';
|
|
2
3
|
import type { CallableObject } from '../../types';
|
|
3
4
|
import type { ComboData } from '../data';
|
|
4
|
-
import type {
|
|
5
|
+
import type { AnimationStage } from './animation';
|
|
5
6
|
import type { PaletteOptions } from './palette';
|
|
6
7
|
/**
|
|
7
8
|
* <zh/> Combo 配置项
|
|
@@ -32,7 +33,7 @@ export interface ComboOptions {
|
|
|
32
33
|
*
|
|
33
34
|
* <en/> Combo animation
|
|
34
35
|
*/
|
|
35
|
-
animation?: AnimationOptions
|
|
36
|
+
animation?: false | Record<AnimationStage, false | string | AnimationOptions[]>;
|
|
36
37
|
/**
|
|
37
38
|
* <zh/> 色板
|
|
38
39
|
*
|
|
@@ -43,7 +44,7 @@ export interface ComboOptions {
|
|
|
43
44
|
export interface StaticComboOptions {
|
|
44
45
|
style?: ComboStyle;
|
|
45
46
|
state?: Record<string, ComboStyle>;
|
|
46
|
-
animation?: AnimationOptions
|
|
47
|
+
animation?: false | Record<AnimationStage, false | string | AnimationOptions[]>;
|
|
47
48
|
palette?: PaletteOptions;
|
|
48
49
|
}
|
|
49
50
|
export interface ComboStyle extends Partial<BaseComboStyleProps> {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { AnimationOptions } from '../../animations/types';
|
|
1
2
|
import type { BaseEdgeStyleProps } from '../../elements/edges';
|
|
2
3
|
import type { CallableObject } from '../../types';
|
|
3
4
|
import type { EdgeData } from '../data';
|
|
4
|
-
import type {
|
|
5
|
+
import type { AnimationStage } from './animation';
|
|
5
6
|
import type { PaletteOptions } from './palette';
|
|
6
7
|
/**
|
|
7
8
|
* <zh/> 边配置项
|
|
@@ -32,7 +33,7 @@ export interface EdgeOptions {
|
|
|
32
33
|
*
|
|
33
34
|
* <en/> Edge animation
|
|
34
35
|
*/
|
|
35
|
-
animation?: AnimationOptions
|
|
36
|
+
animation?: false | Record<AnimationStage, false | string | AnimationOptions[]>;
|
|
36
37
|
/**
|
|
37
38
|
* <zh/> 色板
|
|
38
39
|
*
|
|
@@ -43,7 +44,7 @@ export interface EdgeOptions {
|
|
|
43
44
|
export interface StaticEdgeOptions {
|
|
44
45
|
style?: EdgeStyle;
|
|
45
46
|
state?: Record<string, EdgeStyle>;
|
|
46
|
-
animation?: AnimationOptions
|
|
47
|
+
animation?: false | Record<AnimationStage, false | string | AnimationOptions[]>;
|
|
47
48
|
palette?: PaletteOptions;
|
|
48
49
|
}
|
|
49
50
|
export interface EdgeStyle extends Partial<BaseEdgeStyleProps> {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { AnimationOptions } from '../../animations/types';
|
|
1
2
|
import type { BaseNodeStyleProps } from '../../elements/nodes';
|
|
2
3
|
import type { CallableObject } from '../../types';
|
|
3
4
|
import type { NodeData } from '../data';
|
|
4
|
-
import type {
|
|
5
|
+
import type { AnimationStage } from './animation';
|
|
5
6
|
import type { PaletteOptions } from './palette';
|
|
6
7
|
/**
|
|
7
8
|
* <zh/> 节点配置项
|
|
@@ -32,7 +33,7 @@ export interface NodeOptions {
|
|
|
32
33
|
*
|
|
33
34
|
* <en/> Node animation
|
|
34
35
|
*/
|
|
35
|
-
animation?: AnimationOptions
|
|
36
|
+
animation?: false | Record<AnimationStage, false | string | AnimationOptions[]>;
|
|
36
37
|
/**
|
|
37
38
|
* <zh/> 色板
|
|
38
39
|
*
|
|
@@ -43,7 +44,7 @@ export interface NodeOptions {
|
|
|
43
44
|
export interface StaticNodeOptions {
|
|
44
45
|
style?: NodeStyle;
|
|
45
46
|
state?: Record<string, NodeStyle>;
|
|
46
|
-
animation?: AnimationOptions
|
|
47
|
+
animation?: false | Record<AnimationStage, false | string | AnimationOptions[]>;
|
|
47
48
|
palette?: PaletteOptions;
|
|
48
49
|
}
|
|
49
50
|
export interface NodeStyle extends Partial<BaseNodeStyleProps> {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { BaseExtension } from '../registry/extension';
|
|
2
|
+
import type { DrawContext } from '../runtime/element';
|
|
2
3
|
import type { CustomBehaviorOption } from '../spec/behavior';
|
|
3
4
|
import type { DrawData } from './types';
|
|
4
5
|
export type BaseTransformOptions = CustomBehaviorOption;
|
|
5
6
|
export declare abstract class BaseTransform<T extends BaseTransformOptions = BaseTransformOptions> extends BaseExtension<T> {
|
|
6
|
-
beforeDraw(data: DrawData): DrawData;
|
|
7
|
+
beforeDraw(data: DrawData, context: DrawContext): DrawData;
|
|
7
8
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import type { DrawContext } from '../runtime/element';
|
|
1
2
|
import { BaseTransform } from './base-transform';
|
|
2
3
|
import type { DrawData } from './types';
|
|
3
4
|
/**
|
|
4
|
-
* <zh/>
|
|
5
|
+
* <zh/> 处理组合的收起和展开
|
|
5
6
|
*
|
|
6
|
-
* <en/> Process the collapse and expand of
|
|
7
|
+
* <en/> Process the collapse and expand of combos
|
|
7
8
|
*/
|
|
8
9
|
export declare class CollapseExpandCombo extends BaseTransform {
|
|
9
|
-
beforeDraw(input: DrawData): DrawData;
|
|
10
|
+
beforeDraw(input: DrawData, context: DrawContext): DrawData;
|
|
10
11
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseTransform } from './base-transform';
|
|
2
|
+
import type { DrawData } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* <zh/> 处理(树图)节点的收起和展开
|
|
5
|
+
*
|
|
6
|
+
* <en/> Process the collapse and expand of (tree)nodes
|
|
7
|
+
*/
|
|
8
|
+
export declare class CollapseExpandNode extends BaseTransform {
|
|
9
|
+
private getElement;
|
|
10
|
+
private handleExpand;
|
|
11
|
+
beforeDraw(input: DrawData): DrawData;
|
|
12
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DataController } from '../runtime/data';
|
|
2
|
+
import type { EdgeData } from '../spec';
|
|
3
|
+
import { BaseTransform } from './base-transform';
|
|
4
|
+
import type { DrawData } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* <zh/> 获取边的实际端点
|
|
7
|
+
*
|
|
8
|
+
* <en/> Get the actual endpoints of the edge
|
|
9
|
+
*/
|
|
10
|
+
export declare class GetEdgeActualEnds extends BaseTransform {
|
|
11
|
+
beforeDraw(input: DrawData): DrawData;
|
|
12
|
+
}
|
|
13
|
+
export declare const getEdgeEndsContext: (model: DataController, edge: EdgeData) => EdgeData;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { ArrangeDrawOrder } from './arrange-draw-order';
|
|
2
2
|
export { BaseTransform } from './base-transform';
|
|
3
3
|
export { CollapseExpandCombo } from './collapse-expand-combo';
|
|
4
|
+
export { CollapseExpandNode } from './collapse-expand-node';
|
|
5
|
+
export { GetEdgeActualEnds } from './get-edge-actual-ends';
|
|
4
6
|
export { ProcessParallelEdges } from './process-parallel-edges';
|
|
5
7
|
export { UpdateRelatedEdge } from './update-related-edge';
|
|
6
8
|
export type { BaseTransformOptions } from './base-transform';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PathStyleProps } from '@antv/g';
|
|
2
2
|
import type { RuntimeContext } from '../runtime/types';
|
|
3
3
|
import type { EdgeData } from '../spec';
|
|
4
|
-
import type {
|
|
4
|
+
import type { CallableValue, ID } from '../types';
|
|
5
5
|
import type { BaseTransformOptions } from './base-transform';
|
|
6
6
|
import { BaseTransform } from './base-transform';
|
|
7
7
|
import type { DrawData } from './types';
|
|
@@ -36,7 +36,7 @@ export interface ProcessParallelEdgesOptions extends BaseTransformOptions {
|
|
|
36
36
|
*
|
|
37
37
|
* <en/> The style of the merged edge, only valid for merging mode
|
|
38
38
|
*/
|
|
39
|
-
style?: PathStyleProps
|
|
39
|
+
style?: CallableValue<PathStyleProps, EdgeData[]>;
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
42
|
* <zh/> 处理平行边,即多条边共享同一源节点和目标节点
|
|
@@ -45,11 +45,13 @@ export interface ProcessParallelEdgesOptions extends BaseTransformOptions {
|
|
|
45
45
|
*/
|
|
46
46
|
export declare class ProcessParallelEdges extends BaseTransform<ProcessParallelEdgesOptions> {
|
|
47
47
|
static defaultOptions: Partial<ProcessParallelEdgesOptions>;
|
|
48
|
+
private cacheMergeStyle;
|
|
48
49
|
constructor(context: RuntimeContext, options: ProcessParallelEdgesOptions);
|
|
49
50
|
beforeDraw(input: DrawData): DrawData;
|
|
50
51
|
private getAffectedParallelEdges;
|
|
51
|
-
protected applyBundlingStyle: (
|
|
52
|
-
|
|
52
|
+
protected applyBundlingStyle: (input: DrawData, edges: Map<ID, EdgeData>, distance: number) => void;
|
|
53
|
+
private resetEdgeStyle;
|
|
54
|
+
protected applyMergingStyle: (input: DrawData, edges: Map<ID, EdgeData>) => void;
|
|
53
55
|
}
|
|
54
56
|
/**
|
|
55
57
|
* <zh/> 按照端点分组
|
|
@@ -8,11 +8,11 @@ export type Transform = BaseTransform<any>;
|
|
|
8
8
|
*
|
|
9
9
|
* <en/> In Element Controller, in order to improve query performance, use Map to store data uniformly
|
|
10
10
|
*/
|
|
11
|
-
export
|
|
11
|
+
export type ProcedureData = {
|
|
12
12
|
nodes: Map<ID, NodeData>;
|
|
13
13
|
edges: Map<ID, EdgeData>;
|
|
14
14
|
combos: Map<ID, ComboData>;
|
|
15
|
-
}
|
|
15
|
+
};
|
|
16
16
|
export type DrawData = {
|
|
17
17
|
add: ProcedureData;
|
|
18
18
|
update: ProcedureData;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DrawContext } from '../runtime/element';
|
|
1
2
|
import { BaseTransform } from './base-transform';
|
|
2
3
|
import type { DrawData } from './types';
|
|
3
4
|
/**
|
|
@@ -5,5 +6,5 @@ import type { DrawData } from './types';
|
|
|
5
6
|
* If the node / combo is updated, the connected edge and the combo it is in need to be updated
|
|
6
7
|
*/
|
|
7
8
|
export declare class UpdateRelatedEdge extends BaseTransform {
|
|
8
|
-
beforeDraw(input: DrawData): DrawData;
|
|
9
|
+
beforeDraw(input: DrawData, context: DrawContext): DrawData;
|
|
9
10
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ElementDatum, ElementType } from '../types';
|
|
2
|
+
import type { DrawData } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* <zh/> 重新分配绘制任务
|
|
5
|
+
*
|
|
6
|
+
* <en/> Reassign drawing tasks
|
|
7
|
+
* @param input - <zh>绘制数据 | <en>DrawData
|
|
8
|
+
* @param type - <zh>类型 | <en>type
|
|
9
|
+
* @param elementType - <zh>元素类型 | <en>element type
|
|
10
|
+
* @param datum - <zh>数据 | <en>data
|
|
11
|
+
* @param overwrite - <zh>是否覆盖现有数据 | <en>whether to overwrite existing data
|
|
12
|
+
*/
|
|
13
|
+
export declare function reassignTo(input: DrawData, type: 'add' | 'update' | 'remove', elementType: ElementType, datum: ElementDatum, overwrite?: boolean): void;
|
package/dist/lib/types/node.d.ts
CHANGED
|
@@ -48,6 +48,18 @@ export interface NodeBadgeStyleProps extends BadgeStyleProps {
|
|
|
48
48
|
* <en/> Badge position relative to the node (keyShape)
|
|
49
49
|
*/
|
|
50
50
|
placement?: CardinalPlacement | CornerPlacement;
|
|
51
|
+
/**
|
|
52
|
+
* <zh/> 徽标在 x 轴方向上的偏移量
|
|
53
|
+
*
|
|
54
|
+
* <en/> The offset of the badge in the x-axis direction
|
|
55
|
+
*/
|
|
56
|
+
offsetX?: number;
|
|
57
|
+
/**
|
|
58
|
+
* <zh/> 徽标在 y 轴方向上的偏移量
|
|
59
|
+
*
|
|
60
|
+
* <en/> The offset of the badge in the y-axis direction
|
|
61
|
+
*/
|
|
62
|
+
offsetY?: number;
|
|
51
63
|
}
|
|
52
64
|
/**
|
|
53
65
|
* <zh/> 连接桩样式配置项
|