@antv/g6 5.0.0-beta.30 → 5.0.0-beta.32
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/{src/behaviors → behaviors}/collapse-expand.d.ts +4 -5
- package/dist/lib/behaviors/create-edge.d.ts +55 -0
- package/dist/lib/{src/behaviors → behaviors}/drag-canvas.d.ts +6 -6
- package/dist/lib/{src/behaviors → behaviors}/drag-element.d.ts +5 -3
- package/dist/lib/behaviors/focus-element.d.ts +30 -0
- package/dist/lib/behaviors/hover-element.d.ts +60 -0
- package/dist/lib/{src/behaviors → behaviors}/index.d.ts +6 -0
- package/dist/lib/{src/behaviors → behaviors}/zoom-canvas.d.ts +7 -6
- package/dist/lib/{src/constants → constants}/element.d.ts +1 -0
- package/dist/lib/{src/constants → constants}/events/animation.d.ts +1 -1
- package/dist/lib/{src/constants → constants}/events/canvas.d.ts +1 -1
- package/dist/lib/{src/constants → constants}/events/common.d.ts +1 -1
- package/dist/lib/{src/constants → constants}/events/container.d.ts +1 -1
- package/dist/lib/{src/constants → constants}/events/edge.d.ts +1 -1
- package/dist/lib/{src/constants → constants}/events/graph.d.ts +6 -14
- package/dist/lib/{src/constants → constants}/events/node.d.ts +1 -1
- package/dist/lib/{src/constants → constants}/index.d.ts +1 -0
- package/dist/lib/constants/registry.d.ts +20 -0
- package/dist/lib/{src/elements → elements}/combos/base-combo.d.ts +21 -0
- package/dist/lib/{src/elements → elements}/edges/base-edge.d.ts +21 -0
- package/dist/lib/{src/elements → elements}/nodes/base-node.d.ts +21 -0
- package/dist/lib/elements/nodes/hexagon.d.ts +21 -0
- package/dist/lib/{src/elements → elements}/nodes/index.d.ts +2 -0
- package/dist/lib/{src/elements → elements}/shapes/badge.d.ts +1 -1
- package/dist/lib/{src/elements → elements}/shapes/base-shape.d.ts +2 -1
- package/dist/lib/exports.d.ts +34 -0
- package/dist/lib/{src/layouts → layouts}/index.d.ts +1 -1
- package/dist/lib/plugins/camera-setting.d.ts +95 -0
- package/dist/lib/{src/plugins → plugins}/contextmenu.d.ts +8 -5
- package/dist/lib/{src/plugins → plugins}/index.d.ts +6 -0
- package/dist/lib/plugins/legend.d.ts +49 -0
- package/dist/lib/plugins/toolbar/index.d.ts +62 -0
- package/dist/lib/plugins/toolbar/util.d.ts +34 -0
- package/dist/lib/{src/plugins → plugins}/tooltip.d.ts +13 -11
- package/dist/lib/{src/registry → registry}/extension/index.d.ts +2 -2
- package/dist/lib/{src/registry → registry}/index.d.ts +6 -4
- package/dist/lib/{src/registry → registry}/types.d.ts +0 -6
- package/dist/lib/{src/runtime → runtime}/behavior.d.ts +1 -0
- package/dist/lib/{src/runtime → runtime}/canvas.d.ts +2 -1
- package/dist/lib/{src/runtime → runtime}/data.d.ts +1 -1
- package/dist/lib/{src/runtime → runtime}/element.d.ts +2 -3
- package/dist/lib/{src/runtime → runtime}/graph.d.ts +31 -4
- package/dist/lib/{src/runtime → runtime}/plugin.d.ts +1 -0
- package/dist/lib/types/event.d.ts +43 -0
- package/dist/lib/{src/types → types}/index.d.ts +0 -1
- package/dist/lib/{src/utils → utils}/bbox.d.ts +1 -1
- package/dist/lib/{src/utils → utils}/dom.d.ts +10 -0
- package/dist/lib/{src/utils → utils}/element.d.ts +25 -11
- package/dist/lib/{src/utils → utils}/event/events.d.ts +8 -13
- package/dist/lib/{src/utils → utils}/id.d.ts +9 -1
- package/dist/lib/utils/relation.d.ts +34 -0
- package/dist/lib/{src/utils → utils}/shortcut.d.ts +10 -0
- package/dist/lib/{src/utils → utils}/traverse.d.ts +9 -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.d.ts +5 -3
- package/esm/behaviors/drag-element.js.map +1 -1
- package/esm/behaviors/focus-element.d.ts +30 -0
- package/esm/behaviors/focus-element.js +57 -0
- package/esm/behaviors/focus-element.js.map +1 -0
- package/esm/behaviors/hover-element.d.ts +60 -0
- package/esm/behaviors/hover-element.js +85 -0
- package/esm/behaviors/hover-element.js.map +1 -0
- package/esm/behaviors/index.d.ts +6 -0
- package/esm/behaviors/index.js +3 -0
- package/esm/behaviors/index.js.map +1 -1
- 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/element.d.ts +1 -0
- package/esm/constants/element.js +1 -0
- package/esm/constants/element.js.map +1 -1
- package/esm/constants/events/animation.d.ts +1 -1
- package/esm/constants/events/animation.js.map +1 -1
- package/esm/constants/events/canvas.d.ts +1 -1
- package/esm/constants/events/canvas.js.map +1 -1
- package/esm/constants/events/common.d.ts +1 -1
- package/esm/constants/events/common.js.map +1 -1
- package/esm/constants/events/container.d.ts +1 -1
- package/esm/constants/events/container.js.map +1 -1
- package/esm/constants/events/edge.d.ts +1 -1
- package/esm/constants/events/edge.js.map +1 -1
- package/esm/constants/events/graph.d.ts +6 -14
- package/esm/constants/events/graph.js +4 -12
- package/esm/constants/events/graph.js.map +1 -1
- package/esm/constants/events/node.d.ts +1 -1
- package/esm/constants/events/node.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 +20 -0
- package/esm/constants/registry.js +22 -0
- package/esm/constants/registry.js.map +1 -0
- package/esm/elements/combos/base-combo.d.ts +21 -0
- package/esm/elements/combos/base-combo.js +21 -0
- package/esm/elements/combos/base-combo.js.map +1 -1
- package/esm/elements/edges/base-edge.d.ts +21 -0
- package/esm/elements/edges/base-edge.js +21 -0
- package/esm/elements/edges/base-edge.js.map +1 -1
- package/esm/elements/nodes/base-node.d.ts +21 -0
- package/esm/elements/nodes/base-node.js +21 -0
- package/esm/elements/nodes/base-node.js.map +1 -1
- package/esm/elements/nodes/hexagon.d.ts +21 -0
- package/esm/elements/nodes/hexagon.js +20 -0
- package/esm/elements/nodes/hexagon.js.map +1 -0
- package/esm/elements/nodes/index.d.ts +2 -0
- package/esm/elements/nodes/index.js +1 -0
- package/esm/elements/nodes/index.js.map +1 -1
- package/esm/elements/shapes/badge.d.ts +1 -1
- package/esm/elements/shapes/base-shape.d.ts +2 -1
- package/esm/elements/shapes/base-shape.js +6 -1
- package/esm/elements/shapes/base-shape.js.map +1 -1
- package/esm/exports.d.ts +20 -10
- package/esm/exports.js +11 -5
- package/esm/exports.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 +2 -3
- package/esm/plugins/contextmenu.js.map +1 -1
- package/esm/plugins/index.d.ts +6 -0
- package/esm/plugins/index.js +3 -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/toolbar/index.d.ts +62 -0
- package/esm/plugins/toolbar/index.js +68 -0
- package/esm/plugins/toolbar/index.js.map +1 -0
- package/esm/plugins/toolbar/util.d.ts +34 -0
- package/esm/plugins/toolbar/util.js +88 -0
- package/esm/plugins/toolbar/util.js.map +1 -0
- package/esm/plugins/tooltip.d.ts +13 -11
- package/esm/plugins/tooltip.js +3 -4
- 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 +9 -3
- package/esm/registry/build-in.js.map +1 -1
- package/esm/registry/extension/index.d.ts +2 -2
- package/esm/registry/extension/index.js +5 -7
- package/esm/registry/extension/index.js.map +1 -1
- package/esm/registry/index.d.ts +6 -4
- package/esm/registry/index.js.map +1 -1
- package/esm/registry/types.d.ts +0 -6
- package/esm/runtime/behavior.d.ts +1 -0
- package/esm/runtime/behavior.js +15 -4
- package/esm/runtime/behavior.js.map +1 -1
- package/esm/runtime/canvas.d.ts +2 -1
- package/esm/runtime/canvas.js +74 -31
- package/esm/runtime/canvas.js.map +1 -1
- package/esm/runtime/data.d.ts +1 -1
- package/esm/runtime/data.js +1 -1
- package/esm/runtime/data.js.map +1 -1
- package/esm/runtime/element.d.ts +2 -3
- package/esm/runtime/element.js +40 -16
- package/esm/runtime/element.js.map +1 -1
- package/esm/runtime/graph.d.ts +31 -4
- package/esm/runtime/graph.js +52 -12
- package/esm/runtime/graph.js.map +1 -1
- package/esm/runtime/layout.js +5 -1
- package/esm/runtime/layout.js.map +1 -1
- package/esm/runtime/plugin.d.ts +1 -0
- package/esm/runtime/plugin.js +3 -0
- package/esm/runtime/plugin.js.map +1 -1
- package/esm/themes/base.js +7 -0
- package/esm/themes/base.js.map +1 -1
- package/esm/types/event.d.ts +42 -7
- package/esm/types/index.d.ts +0 -1
- package/esm/utils/bbox.d.ts +1 -1
- package/esm/utils/dom.d.ts +10 -0
- package/esm/utils/dom.js +22 -0
- package/esm/utils/dom.js.map +1 -1
- package/esm/utils/element.d.ts +25 -11
- package/esm/utils/element.js +34 -9
- package/esm/utils/element.js.map +1 -1
- package/esm/utils/event/events.d.ts +8 -13
- package/esm/utils/event/events.js +3 -8
- package/esm/utils/event/events.js.map +1 -1
- package/esm/utils/id.d.ts +9 -1
- package/esm/utils/id.js +10 -0
- package/esm/utils/id.js.map +1 -1
- package/esm/utils/relation.d.ts +34 -0
- package/esm/utils/relation.js +72 -0
- package/esm/utils/relation.js.map +1 -0
- package/esm/utils/shortcut.d.ts +10 -0
- package/esm/utils/shortcut.js +24 -3
- package/esm/utils/shortcut.js.map +1 -1
- package/esm/utils/traverse.d.ts +9 -0
- package/esm/utils/traverse.js +21 -0
- package/esm/utils/traverse.js.map +1 -1
- 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.d.ts +5 -3
- package/lib/behaviors/drag-element.js.map +1 -1
- package/lib/behaviors/focus-element.d.ts +30 -0
- package/lib/behaviors/focus-element.js +61 -0
- package/lib/behaviors/focus-element.js.map +1 -0
- package/lib/behaviors/hover-element.d.ts +60 -0
- package/lib/behaviors/hover-element.js +89 -0
- package/lib/behaviors/hover-element.js.map +1 -0
- package/lib/behaviors/index.d.ts +6 -0
- package/lib/behaviors/index.js +7 -1
- package/lib/behaviors/index.js.map +1 -1
- 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/element.d.ts +1 -0
- package/lib/constants/element.js +2 -1
- package/lib/constants/element.js.map +1 -1
- package/lib/constants/events/animation.d.ts +1 -1
- package/lib/constants/events/animation.js.map +1 -1
- package/lib/constants/events/canvas.d.ts +1 -1
- package/lib/constants/events/canvas.js.map +1 -1
- package/lib/constants/events/common.d.ts +1 -1
- package/lib/constants/events/common.js.map +1 -1
- package/lib/constants/events/container.d.ts +1 -1
- package/lib/constants/events/container.js.map +1 -1
- package/lib/constants/events/edge.d.ts +1 -1
- package/lib/constants/events/edge.js.map +1 -1
- package/lib/constants/events/graph.d.ts +6 -14
- package/lib/constants/events/graph.js +4 -12
- package/lib/constants/events/graph.js.map +1 -1
- package/lib/constants/events/node.d.ts +1 -1
- package/lib/constants/events/node.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 +20 -0
- package/lib/constants/registry.js +25 -0
- package/lib/constants/registry.js.map +1 -0
- package/lib/elements/combos/base-combo.d.ts +21 -0
- package/lib/elements/combos/base-combo.js +21 -0
- package/lib/elements/combos/base-combo.js.map +1 -1
- package/lib/elements/edges/base-edge.d.ts +21 -0
- package/lib/elements/edges/base-edge.js +21 -0
- package/lib/elements/edges/base-edge.js.map +1 -1
- package/lib/elements/nodes/base-node.d.ts +21 -0
- package/lib/elements/nodes/base-node.js +21 -0
- package/lib/elements/nodes/base-node.js.map +1 -1
- package/lib/elements/nodes/hexagon.d.ts +21 -0
- package/lib/elements/nodes/hexagon.js +24 -0
- package/lib/elements/nodes/hexagon.js.map +1 -0
- package/lib/elements/nodes/index.d.ts +2 -0
- package/lib/elements/nodes/index.js +3 -1
- package/lib/elements/nodes/index.js.map +1 -1
- package/lib/elements/shapes/badge.d.ts +1 -1
- package/lib/elements/shapes/base-shape.d.ts +2 -1
- package/lib/elements/shapes/base-shape.js +6 -1
- package/lib/elements/shapes/base-shape.js.map +1 -1
- package/lib/exports.d.ts +20 -10
- package/lib/exports.js +30 -1
- package/lib/exports.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 +1 -2
- package/lib/plugins/contextmenu.js.map +1 -1
- package/lib/plugins/index.d.ts +6 -0
- package/lib/plugins/index.js +7 -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/toolbar/index.d.ts +62 -0
- package/lib/plugins/toolbar/index.js +72 -0
- package/lib/plugins/toolbar/index.js.map +1 -0
- package/lib/plugins/toolbar/util.d.ts +34 -0
- package/lib/plugins/toolbar/util.js +92 -0
- package/lib/plugins/toolbar/util.js.map +1 -0
- package/lib/plugins/tooltip.d.ts +13 -11
- package/lib/plugins/tooltip.js +3 -4
- 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 +6 -0
- package/lib/registry/build-in.js.map +1 -1
- package/lib/registry/extension/index.d.ts +2 -2
- package/lib/registry/extension/index.js +5 -7
- package/lib/registry/extension/index.js.map +1 -1
- package/lib/registry/index.d.ts +6 -4
- package/lib/registry/index.js.map +1 -1
- package/lib/registry/types.d.ts +0 -6
- package/lib/runtime/behavior.d.ts +1 -0
- package/lib/runtime/behavior.js +15 -4
- package/lib/runtime/behavior.js.map +1 -1
- package/lib/runtime/canvas.d.ts +2 -1
- package/lib/runtime/canvas.js +74 -31
- package/lib/runtime/canvas.js.map +1 -1
- package/lib/runtime/data.d.ts +1 -1
- package/lib/runtime/data.js +1 -1
- package/lib/runtime/data.js.map +1 -1
- package/lib/runtime/element.d.ts +2 -3
- package/lib/runtime/element.js +42 -18
- package/lib/runtime/element.js.map +1 -1
- package/lib/runtime/graph.d.ts +31 -4
- package/lib/runtime/graph.js +51 -11
- package/lib/runtime/graph.js.map +1 -1
- package/lib/runtime/layout.js +5 -1
- package/lib/runtime/layout.js.map +1 -1
- package/lib/runtime/plugin.d.ts +1 -0
- package/lib/runtime/plugin.js +3 -0
- package/lib/runtime/plugin.js.map +1 -1
- package/lib/themes/base.js +7 -0
- package/lib/themes/base.js.map +1 -1
- package/lib/types/event.d.ts +42 -7
- package/lib/types/index.d.ts +0 -1
- package/lib/utils/bbox.d.ts +1 -1
- package/lib/utils/dom.d.ts +10 -0
- package/lib/utils/dom.js +24 -1
- package/lib/utils/dom.js.map +1 -1
- package/lib/utils/element.d.ts +25 -11
- package/lib/utils/element.js +37 -10
- package/lib/utils/element.js.map +1 -1
- package/lib/utils/event/events.d.ts +8 -13
- package/lib/utils/event/events.js +4 -10
- package/lib/utils/event/events.js.map +1 -1
- package/lib/utils/id.d.ts +9 -1
- package/lib/utils/id.js +12 -1
- package/lib/utils/id.js.map +1 -1
- package/lib/utils/relation.d.ts +34 -0
- package/lib/utils/relation.js +77 -0
- package/lib/utils/relation.js.map +1 -0
- package/lib/utils/shortcut.d.ts +10 -0
- package/lib/utils/shortcut.js +24 -3
- package/lib/utils/shortcut.js.map +1 -1
- package/lib/utils/traverse.d.ts +9 -0
- package/lib/utils/traverse.js +23 -1
- package/lib/utils/traverse.js.map +1 -1
- package/package.json +14 -14
- 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.ts +8 -11
- package/src/behaviors/focus-element.ts +90 -0
- package/src/behaviors/hover-element.ts +151 -0
- package/src/behaviors/index.ts +6 -0
- package/src/behaviors/zoom-canvas.ts +14 -9
- package/src/constants/element.ts +2 -0
- package/src/constants/events/animation.ts +1 -1
- package/src/constants/events/canvas.ts +1 -1
- package/src/constants/events/common.ts +1 -1
- package/src/constants/events/container.ts +1 -1
- package/src/constants/events/edge.ts +1 -1
- package/src/constants/events/graph.ts +5 -13
- package/src/constants/events/node.ts +1 -1
- package/src/constants/index.ts +1 -0
- package/src/constants/registry.ts +20 -0
- package/src/elements/combos/base-combo.ts +24 -0
- package/src/elements/edges/base-edge.ts +25 -1
- package/src/elements/nodes/base-node.ts +25 -1
- package/src/elements/nodes/hexagon.ts +37 -0
- package/src/elements/nodes/index.ts +2 -0
- package/src/elements/shapes/base-shape.ts +8 -2
- package/src/exports.ts +61 -10
- package/src/plugins/camera-setting.ts +153 -0
- package/src/plugins/contextmenu.ts +12 -10
- package/src/plugins/index.ts +6 -0
- package/src/plugins/legend.ts +321 -0
- package/src/plugins/toolbar/index.ts +125 -0
- package/src/plugins/toolbar/util.ts +117 -0
- package/src/plugins/tooltip.ts +19 -18
- package/src/preset.ts +2 -6
- package/src/registry/build-in.ts +17 -2
- package/src/registry/extension/index.ts +9 -11
- package/src/registry/index.ts +10 -4
- package/src/registry/types.ts +0 -7
- package/src/runtime/behavior.ts +16 -4
- package/src/runtime/canvas.ts +86 -41
- package/src/runtime/data.ts +1 -1
- package/src/runtime/element.ts +60 -23
- package/src/runtime/graph.ts +60 -15
- package/src/runtime/layout.ts +5 -1
- package/src/runtime/plugin.ts +4 -0
- package/src/themes/base.ts +7 -0
- package/src/types/event.ts +62 -7
- package/src/types/index.ts +0 -1
- package/src/utils/bbox.ts +1 -1
- package/src/utils/dom.ts +32 -0
- package/src/utils/element.ts +38 -11
- package/src/utils/event/events.ts +15 -17
- package/src/utils/id.ts +12 -1
- package/src/utils/relation.ts +84 -0
- package/src/utils/shortcut.ts +28 -3
- package/src/utils/traverse.ts +26 -0
- package/dist/lib/__tests__/demo/animation/animation-breathe.d.ts +0 -2
- package/dist/lib/__tests__/demo/animation/animation-fade-in.d.ts +0 -2
- package/dist/lib/__tests__/demo/animation/animation-translate.d.ts +0 -2
- package/dist/lib/__tests__/demo/animation/animation-wave.d.ts +0 -2
- package/dist/lib/__tests__/demo/animation/animation-zoom-in.d.ts +0 -2
- package/dist/lib/__tests__/demo/animation/controller-element-position.d.ts +0 -2
- package/dist/lib/__tests__/demo/animation/controller-element-state.d.ts +0 -2
- package/dist/lib/__tests__/demo/animation/controller-element.d.ts +0 -2
- package/dist/lib/__tests__/demo/animation/edge-cubic.d.ts +0 -2
- package/dist/lib/__tests__/demo/animation/edge-line.d.ts +0 -2
- package/dist/lib/__tests__/demo/animation/edge-quadratic.d.ts +0 -2
- package/dist/lib/__tests__/demo/animation/index.d.ts +0 -12
- package/dist/lib/__tests__/demo/animation/shape-label.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/behavior-drag-canvas.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/behavior-drag-element.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/behavior-zoom-canvas.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/combo-expand-collapse.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/combo.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/common-graph.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/edge-polyline.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/element-change-type.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/element-port.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/element-position-combo.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/element-position.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/element-state.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/element-visibility.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/element-z-index.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/graph-event.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/index.d.ts +0 -52
- package/dist/lib/__tests__/demo/case/layout-antv-dagre-flow-combo.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/layout-antv-dagre-flow.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/layout-circular-basic.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/layout-circular-configuration-translate.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/layout-circular-degree.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/layout-circular-division.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/layout-circular-spiral.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/layout-combo-combined.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/layout-compact-box-basic.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/layout-compact-box-left-align.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/layout-compact-box-top-to-bottom.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/layout-concentric.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/layout-dagre.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/layout-dendrogram-basic.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/layout-dendrogram-tb.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/layout-force.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/layout-fruchterman-basic.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/layout-fruchterman-cluster.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/layout-fruchterman-fix.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/layout-grid.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/layout-mds.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/layout-mindmap-h-custom-side.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/layout-mindmap-h-left.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/layout-mindmap-h-right.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/layout-mindmap-h.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/layout-radial-basic.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/layout-radial-configuration-translate.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/layout-radial-prevent-overlap-unstrict.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/layout-radial-prevent-overlap.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/layout-radial-sort.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/plugin-contextmenu.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/plugin-grid-line.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/plugin-tooltip.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/plugin-watermark-image.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/plugin-watermark.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/theme.d.ts +0 -2
- package/dist/lib/__tests__/demo/case/viewport-fit.d.ts +0 -2
- package/dist/lib/__tests__/demo/index.d.ts +0 -3
- package/dist/lib/__tests__/demo/static/common.d.ts +0 -45
- package/dist/lib/__tests__/demo/static/controller-element-position.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/controller-element-visibility.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/controller-element-z-index.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/controller-element.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/controller-layout-antv-dagre.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/controller-layout-circular.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/controller-layout-compact-box.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/controller-layout-d3-force.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/controller-layout-dendrogram.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/controller-layout-force.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/controller-layout-forceatlas2-wasm.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/controller-layout-fruchterman-gpu.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/controller-layout-fruchterman-wasm.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/controller-layout-grid.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/controller-layout-indented.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/controller-layout-mindmap.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/controller-layout-radial.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/controller-viewport.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/edge-arrow.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/edge-cubic-horizontal.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/edge-cubic-vertical.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/edge-cubic.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/edge-custom-arrow.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/edge-line.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/edge-loop-curve.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/edge-loop-polyline.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/edge-polyline.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/edge-port.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/edge-quadratic.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/element-label-background.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/element-label-oversized.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/graph-element.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/index.d.ts +0 -9
- package/dist/lib/__tests__/demo/static/layered-canvas.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/node-circle.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/node-diamond.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/node-ellipse.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/node-image.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/node-rect.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/node-star.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/node-triangle.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/shape-badge.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/shape-icon.d.ts +0 -2
- package/dist/lib/__tests__/demo/static/shape-label.d.ts +0 -2
- package/dist/lib/__tests__/demo/types.d.ts +0 -33
- package/dist/lib/__tests__/integration/animation.spec.d.ts +0 -1
- package/dist/lib/__tests__/integration/static.spec.d.ts +0 -1
- package/dist/lib/__tests__/main.d.ts +0 -1
- package/dist/lib/__tests__/setup.d.ts +0 -4
- package/dist/lib/__tests__/unit/behaviors/behavior-collapse-expand.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/behaviors/behavior-drag-canvas.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/behaviors/behavior-drag-element-combo.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/behaviors/behavior-drag-element.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/behaviors/behavior-zoom-canvas.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/behaviors/drag-element-bug.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/elements/change-type.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/elements/combo.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/elements/edge-polyline.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/elements/port.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/elements/position-combo.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/elements/position.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/elements/state.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/elements/visibility.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/elements/z-index.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/layouts/circular.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/layouts/combo-layout.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/layouts/compact-box.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/layouts/dagre.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/layouts/dendrogram.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/layouts/fruchterman.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/layouts/grid.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/layouts/layout-concentric.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/layouts/mds.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/layouts/mindmap.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/layouts/radial-layout.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/plugins/plugin-contextmenu.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/plugins/plugin-grid-line.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/plugins/plugin-watermark.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/plugins/tooltip.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/registry.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/runtime/canvas.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/runtime/data.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/runtime/element/visibility.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/runtime/element/z-index.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/runtime/element.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/runtime/graph/auto-resize.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/runtime/graph/graph.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/runtime/viewport.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/spec/behavior.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/spec/canvas.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/spec/data.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/spec/element/combo.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/spec/element/edge.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/spec/element/node.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/spec/index.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/spec/layout.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/spec/plugin.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/spec/theme.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/spec/viewport.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/utils/anchor.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/utils/animation.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/utils/array.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/utils/bbox.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/utils/cache.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/utils/change.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/utils/combo.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/utils/data.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/utils/diff.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/utils/dom.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/utils/edge.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/utils/element.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/utils/event.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/utils/extension.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/utils/graphlib.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/utils/id.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/utils/is.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/utils/layout.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/utils/math.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/utils/padding.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/utils/palette.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/utils/placement.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/utils/point.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/utils/position.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/utils/prefix.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/utils/random.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/utils/router.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/utils/shape.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/utils/shortcut.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/utils/size.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/utils/style.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/utils/symbol.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/utils/text.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/utils/traverse.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/utils/tree.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/utils/vector.spec.d.ts +0 -1
- package/dist/lib/__tests__/unit/utils/visibility.spec.d.ts +0 -1
- package/dist/lib/__tests__/utils/create.d.ts +0 -15
- package/dist/lib/__tests__/utils/dir.d.ts +0 -9
- package/dist/lib/__tests__/utils/get-cases.d.ts +0 -2
- package/dist/lib/__tests__/utils/index.d.ts +0 -4
- package/dist/lib/__tests__/utils/offscreen-canvas-context.d.ts +0 -21
- package/dist/lib/__tests__/utils/random.d.ts +0 -5
- package/dist/lib/__tests__/utils/sleep.d.ts +0 -1
- package/dist/lib/__tests__/utils/to-be-close-to.d.ts +0 -10
- package/dist/lib/__tests__/utils/to-match-svg-snapshot.d.ts +0 -14
- package/dist/lib/__tests__/utils/use-snapshot-matchers.d.ts +0 -9
- package/dist/lib/src/exports.d.ts +0 -24
- package/dist/lib/src/types/behavior.d.ts +0 -5
- package/dist/lib/src/types/event.d.ts +0 -8
- 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/types/behavior.d.ts +0 -5
- package/lib/types/behavior.js +0 -3
- package/lib/types/behavior.js.map +0 -1
- package/src/types/behavior.ts +0 -6
- /package/dist/lib/{src/animations → animations}/executor.d.ts +0 -0
- /package/dist/lib/{src/animations → animations}/index.d.ts +0 -0
- /package/dist/lib/{src/animations → animations}/types.d.ts +0 -0
- /package/dist/lib/{src/behaviors → behaviors}/base-behavior.d.ts +0 -0
- /package/dist/lib/{src/behaviors → behaviors}/types.d.ts +0 -0
- /package/dist/lib/{src/constants → constants}/animation.d.ts +0 -0
- /package/dist/lib/{src/constants → constants}/change.d.ts +0 -0
- /package/dist/lib/{src/constants → constants}/events/combo.d.ts +0 -0
- /package/dist/lib/{src/constants → constants}/events/index.d.ts +0 -0
- /package/dist/lib/{src/constants → constants}/graphlib.d.ts +0 -0
- /package/dist/lib/{src/elements → elements}/combos/circle.d.ts +0 -0
- /package/dist/lib/{src/elements → elements}/combos/index.d.ts +0 -0
- /package/dist/lib/{src/elements → elements}/combos/rect.d.ts +0 -0
- /package/dist/lib/{src/elements → elements}/edges/cubic-horizontal.d.ts +0 -0
- /package/dist/lib/{src/elements → elements}/edges/cubic-vertical.d.ts +0 -0
- /package/dist/lib/{src/elements → elements}/edges/cubic.d.ts +0 -0
- /package/dist/lib/{src/elements → elements}/edges/index.d.ts +0 -0
- /package/dist/lib/{src/elements → elements}/edges/line.d.ts +0 -0
- /package/dist/lib/{src/elements → elements}/edges/polyline.d.ts +0 -0
- /package/dist/lib/{src/elements → elements}/edges/quadratic.d.ts +0 -0
- /package/dist/lib/{src/elements → elements}/index.d.ts +0 -0
- /package/dist/lib/{src/elements → elements}/nodes/circle.d.ts +0 -0
- /package/dist/lib/{src/elements → elements}/nodes/diamond.d.ts +0 -0
- /package/dist/lib/{src/elements → elements}/nodes/ellipse.d.ts +0 -0
- /package/dist/lib/{src/elements → elements}/nodes/image.d.ts +0 -0
- /package/dist/lib/{src/elements → elements}/nodes/polygon.d.ts +0 -0
- /package/dist/lib/{src/elements → elements}/nodes/rect.d.ts +0 -0
- /package/dist/lib/{src/elements → elements}/nodes/star.d.ts +0 -0
- /package/dist/lib/{src/elements → elements}/nodes/triangle.d.ts +0 -0
- /package/dist/lib/{src/elements → elements}/shapes/icon.d.ts +0 -0
- /package/dist/lib/{src/elements → elements}/shapes/index.d.ts +0 -0
- /package/dist/lib/{src/elements → elements}/shapes/label.d.ts +0 -0
- /package/dist/lib/{src/index.d.ts → index.d.ts} +0 -0
- /package/dist/lib/{src/layouts → layouts}/types.d.ts +0 -0
- /package/dist/lib/{src/palettes → palettes}/index.d.ts +0 -0
- /package/dist/lib/{src/palettes → palettes}/types.d.ts +0 -0
- /package/dist/lib/{src/plugins → plugins}/base-plugin.d.ts +0 -0
- /package/dist/lib/{src/plugins → plugins}/grid-line.d.ts +0 -0
- /package/dist/lib/{src/plugins → plugins}/types.d.ts +0 -0
- /package/dist/lib/{src/plugins → plugins}/watermark.d.ts +0 -0
- /package/dist/lib/{src/preset.d.ts → preset.d.ts} +0 -0
- /package/dist/lib/{src/registry → registry}/build-in.d.ts +0 -0
- /package/dist/lib/{src/registry → registry}/extension/types.d.ts +0 -0
- /package/dist/lib/{src/runtime → runtime}/index.d.ts +0 -0
- /package/dist/lib/{src/runtime → runtime}/layout.d.ts +0 -0
- /package/dist/lib/{src/runtime → runtime}/types.d.ts +0 -0
- /package/dist/lib/{src/runtime → runtime}/viewport.d.ts +0 -0
- /package/dist/lib/{src/spec → spec}/behavior.d.ts +0 -0
- /package/dist/lib/{src/spec → spec}/canvas.d.ts +0 -0
- /package/dist/lib/{src/spec → spec}/data.d.ts +0 -0
- /package/dist/lib/{src/spec → spec}/element/animation.d.ts +0 -0
- /package/dist/lib/{src/spec → spec}/element/base.d.ts +0 -0
- /package/dist/lib/{src/spec → spec}/element/combo.d.ts +0 -0
- /package/dist/lib/{src/spec → spec}/element/edge.d.ts +0 -0
- /package/dist/lib/{src/spec → spec}/element/node.d.ts +0 -0
- /package/dist/lib/{src/spec → spec}/element/palette.d.ts +0 -0
- /package/dist/lib/{src/spec → spec}/index.d.ts +0 -0
- /package/dist/lib/{src/spec → spec}/layout.d.ts +0 -0
- /package/dist/lib/{src/spec → spec}/plugin.d.ts +0 -0
- /package/dist/lib/{src/spec → spec}/spec.d.ts +0 -0
- /package/dist/lib/{src/spec → spec}/theme.d.ts +0 -0
- /package/dist/lib/{src/spec → spec}/viewport.d.ts +0 -0
- /package/dist/lib/{src/themes → themes}/base.d.ts +0 -0
- /package/dist/lib/{src/themes → themes}/dark.d.ts +0 -0
- /package/dist/lib/{src/themes → themes}/index.d.ts +0 -0
- /package/dist/lib/{src/themes → themes}/light.d.ts +0 -0
- /package/dist/lib/{src/themes → themes}/types.d.ts +0 -0
- /package/dist/lib/{src/types → types}/anchor.d.ts +0 -0
- /package/dist/lib/{src/types → types}/animation.d.ts +0 -0
- /package/dist/lib/{src/types → types}/callable.d.ts +0 -0
- /package/dist/lib/{src/types → types}/canvas.d.ts +0 -0
- /package/dist/lib/{src/types → types}/change.d.ts +0 -0
- /package/dist/lib/{src/types → types}/data.d.ts +0 -0
- /package/dist/lib/{src/types → types}/edge.d.ts +0 -0
- /package/dist/lib/{src/types → types}/element.d.ts +0 -0
- /package/dist/lib/{src/types → types}/enum.d.ts +0 -0
- /package/dist/lib/{src/types → types}/graphlib.d.ts +0 -0
- /package/dist/lib/{src/types → types}/node.d.ts +0 -0
- /package/dist/lib/{src/types → types}/padding.d.ts +0 -0
- /package/dist/lib/{src/types → types}/placement.d.ts +0 -0
- /package/dist/lib/{src/types → types}/plugin.d.ts +0 -0
- /package/dist/lib/{src/types → types}/point.d.ts +0 -0
- /package/dist/lib/{src/types → types}/position.d.ts +0 -0
- /package/dist/lib/{src/types → types}/prefix.d.ts +0 -0
- /package/dist/lib/{src/types → types}/size.d.ts +0 -0
- /package/dist/lib/{src/types → types}/state.d.ts +0 -0
- /package/dist/lib/{src/types → types}/style.d.ts +0 -0
- /package/dist/lib/{src/types → types}/tree.d.ts +0 -0
- /package/dist/lib/{src/types → types}/vector.d.ts +0 -0
- /package/dist/lib/{src/types → types}/viewport.d.ts +0 -0
- /package/dist/lib/{src/utils → utils}/anchor.d.ts +0 -0
- /package/dist/lib/{src/utils → utils}/animation.d.ts +0 -0
- /package/dist/lib/{src/utils → utils}/array.d.ts +0 -0
- /package/dist/lib/{src/utils → utils}/cache.d.ts +0 -0
- /package/dist/lib/{src/utils → utils}/change.d.ts +0 -0
- /package/dist/lib/{src/utils → utils}/combo.d.ts +0 -0
- /package/dist/lib/{src/utils → utils}/contextmenu.d.ts +0 -0
- /package/dist/lib/{src/utils → utils}/data.d.ts +0 -0
- /package/dist/lib/{src/utils → utils}/diff.d.ts +0 -0
- /package/dist/lib/{src/utils → utils}/edge.d.ts +0 -0
- /package/dist/lib/{src/utils → utils}/event/index.d.ts +0 -0
- /package/dist/lib/{src/utils → utils}/extension.d.ts +0 -0
- /package/dist/lib/{src/utils → utils}/graphlib.d.ts +0 -0
- /package/dist/lib/{src/utils → utils}/is.d.ts +0 -0
- /package/dist/lib/{src/utils → utils}/layout.d.ts +0 -0
- /package/dist/lib/{src/utils → utils}/math.d.ts +0 -0
- /package/dist/lib/{src/utils → utils}/padding.d.ts +0 -0
- /package/dist/lib/{src/utils → utils}/palette.d.ts +0 -0
- /package/dist/lib/{src/utils → utils}/placement.d.ts +0 -0
- /package/dist/lib/{src/utils → utils}/point.d.ts +0 -0
- /package/dist/lib/{src/utils → utils}/position.d.ts +0 -0
- /package/dist/lib/{src/utils → utils}/prefix.d.ts +0 -0
- /package/dist/lib/{src/utils → utils}/router/orth.d.ts +0 -0
- /package/dist/lib/{src/utils → utils}/shape.d.ts +0 -0
- /package/dist/lib/{src/utils → utils}/size.d.ts +0 -0
- /package/dist/lib/{src/utils → utils}/style.d.ts +0 -0
- /package/dist/lib/{src/utils → utils}/symbol.d.ts +0 -0
- /package/dist/lib/{src/utils → utils}/text.d.ts +0 -0
- /package/dist/lib/{src/utils → utils}/tree.d.ts +0 -0
- /package/dist/lib/{src/utils → utils}/vector.d.ts +0 -0
- /package/dist/lib/{src/utils → utils}/visibility.d.ts +0 -0
- /package/dist/lib/{src/utils → utils}/watermark.d.ts +0 -0
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
export
|
|
1
|
+
export enum GraphEvent {
|
|
2
|
+
/** <zh/> 画布初始化之前 | <en/> Before the canvas is initialized */
|
|
3
|
+
BEFORE_CANVAS_INIT = 'beforecanvasinit',
|
|
4
|
+
/** <zh/> 画布初始化之后 | <en/> After the canvas is initialized */
|
|
5
|
+
AFTER_CANVAS_INIT = 'aftercanvasinit',
|
|
2
6
|
/** <zh/> 视口尺寸变更之前 | <en/> Before the viewport size changes */
|
|
3
7
|
BEFORE_SIZE_CHANGE = 'beforesizechange',
|
|
4
8
|
/** <zh/> 视口尺寸变更之后 | <en/> After the viewport size changes */
|
|
@@ -39,18 +43,6 @@ export const enum GraphEvent {
|
|
|
39
43
|
BEFORE_TRANSFORM = 'beforetransform',
|
|
40
44
|
/** <zh/> 可视区域变化之后 | <en/> After the visible area changes */
|
|
41
45
|
AFTER_TRANSFORM = 'aftertransform',
|
|
42
|
-
/** <zh/> 元素可见性变化之前 | <en/> Before the visibility of the element changes */
|
|
43
|
-
BEFORE_ELEMENT_VISIBILITY_CHANGE = 'beforeelementvisibilitychange',
|
|
44
|
-
/** <zh/> 元素可见性变化之后 | <en/> After the visibility of the element changes */
|
|
45
|
-
AFTER_ELEMENT_VISIBILITY_CHANGE = 'afterelementvisibilitychange',
|
|
46
|
-
/** <zh/> 元素层级变化之前 | <en/> Before the layer of the element changes */
|
|
47
|
-
BEFORE_ELEMENT_Z_INDEX_CHANGE = 'beforeelementzindexchange',
|
|
48
|
-
/** <zh/> 元素层级变化之后 | <en/> After the layer of the element changes */
|
|
49
|
-
AFTER_ELEMENT_Z_INDEX_CHANGE = 'afterelementzindexchange',
|
|
50
|
-
/** <zh/> 状态变化之前 | <en/> Before the state changes */
|
|
51
|
-
BEFORE_ELEMENT_STATE_CHANGE = 'beforeelementstatechange',
|
|
52
|
-
/** <zh/> 状态变化之后 | <en/> After the state changes */
|
|
53
|
-
AFTER_ELEMENT_STATE_CHANGE = 'afterelementstatechange',
|
|
54
46
|
}
|
|
55
47
|
|
|
56
48
|
export const enum AnimationTypeEnum {
|
package/src/constants/index.ts
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export enum ExtensionCategory {
|
|
2
|
+
/** <zh/> 节点元素 | <en/> Node element */
|
|
3
|
+
NODE = 'node',
|
|
4
|
+
/** <zh/> 边元素 | <en/> Edge element */
|
|
5
|
+
EDGE = 'edge',
|
|
6
|
+
/** <zh/> 组合元素 | <en/> Combination element */
|
|
7
|
+
COMBO = 'combo',
|
|
8
|
+
/** <zh/> 主题 | <en/> Theme */
|
|
9
|
+
THEME = 'theme',
|
|
10
|
+
/** <zh/> 色板 | <en/> Palette */
|
|
11
|
+
PALETTE = 'palette',
|
|
12
|
+
/** <zh/> 布局 | <en/> Layout */
|
|
13
|
+
LAYOUT = 'layout',
|
|
14
|
+
/** <zh/> 交互 | <en/> Behavior */
|
|
15
|
+
BEHAVIOR = 'behavior',
|
|
16
|
+
/** <zh/> 插件 | <en/> Plugin */
|
|
17
|
+
PLUGIN = 'plugin',
|
|
18
|
+
/** <zh/> 动画 | <en/> Animation */
|
|
19
|
+
ANIMATION = 'animation',
|
|
20
|
+
}
|
|
@@ -183,4 +183,28 @@ export abstract class BaseCombo<S extends BaseComboStyleProps = BaseComboStylePr
|
|
|
183
183
|
// collapsed marker
|
|
184
184
|
this.drawCollapsedMarkerShape(attributes, container);
|
|
185
185
|
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* <zh/> 在元素完成创建并执行完入场动画后调用
|
|
189
|
+
*
|
|
190
|
+
* <en/> Called after the element is created and the entrance animation is completed
|
|
191
|
+
* @override
|
|
192
|
+
*/
|
|
193
|
+
public onCreate() {}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* <zh/> 在元素更新并执行完过渡动画后调用
|
|
197
|
+
*
|
|
198
|
+
* <en/> Called after the element is updated and the transition animation is completed
|
|
199
|
+
* @override
|
|
200
|
+
*/
|
|
201
|
+
public onUpdate() {}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* <zh/> 在元素完成退场动画并销毁后调用
|
|
205
|
+
*
|
|
206
|
+
* <en/> Called after the element completes the exit animation and is destroyed
|
|
207
|
+
* @override
|
|
208
|
+
*/
|
|
209
|
+
public onDestroy() {}
|
|
186
210
|
}
|
|
@@ -227,7 +227,31 @@ export abstract class BaseEdge extends BaseShape<BaseEdgeStyleProps> {
|
|
|
227
227
|
this.drawHaloShape(attributes, container);
|
|
228
228
|
}
|
|
229
229
|
|
|
230
|
-
|
|
230
|
+
/**
|
|
231
|
+
* <zh/> 在元素完成创建并执行完入场动画后调用
|
|
232
|
+
*
|
|
233
|
+
* <en/> Called after the element is created and the entrance animation is completed
|
|
234
|
+
* @override
|
|
235
|
+
*/
|
|
236
|
+
public onCreate() {}
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* <zh/> 在元素更新并执行完过渡动画后调用
|
|
240
|
+
*
|
|
241
|
+
* <en/> Called after the element is updated and the transition animation is completed
|
|
242
|
+
* @override
|
|
243
|
+
*/
|
|
244
|
+
public onUpdate() {}
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* <zh/> 在元素完成退场动画并销毁后调用
|
|
248
|
+
*
|
|
249
|
+
* <en/> Called after the element completes the exit animation and is destroyed
|
|
250
|
+
* @override
|
|
251
|
+
*/
|
|
252
|
+
public onDestroy() {}
|
|
253
|
+
|
|
254
|
+
public animate(keyframes: Keyframe[], options?: number | KeyframeAnimationOptions) {
|
|
231
255
|
const result = super.animate(keyframes, options);
|
|
232
256
|
|
|
233
257
|
if (result) {
|
|
@@ -283,7 +283,31 @@ export abstract class BaseNode<S extends BaseNodeStyleProps = any> extends BaseS
|
|
|
283
283
|
this.drawPortShapes(attributes, container);
|
|
284
284
|
}
|
|
285
285
|
|
|
286
|
-
|
|
286
|
+
/**
|
|
287
|
+
* <zh/> 在元素完成创建并执行完入场动画后调用
|
|
288
|
+
*
|
|
289
|
+
* <en/> Called after the element is created and the entrance animation is completed
|
|
290
|
+
* @override
|
|
291
|
+
*/
|
|
292
|
+
public onCreate() {}
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* <zh/> 在元素更新并执行完过渡动画后调用
|
|
296
|
+
*
|
|
297
|
+
* <en/> Called after the element is updated and the transition animation is completed
|
|
298
|
+
* @override
|
|
299
|
+
*/
|
|
300
|
+
public onUpdate() {}
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* <zh/> 在元素完成退场动画并销毁后调用
|
|
304
|
+
*
|
|
305
|
+
* <en/> Called after the element completes the exit animation and is destroyed
|
|
306
|
+
* @override
|
|
307
|
+
*/
|
|
308
|
+
public onDestroy() {}
|
|
309
|
+
|
|
310
|
+
public animate(keyframes: Keyframe[], options?: number | KeyframeAnimationOptions) {
|
|
287
311
|
const result = super.animate(keyframes, options);
|
|
288
312
|
|
|
289
313
|
if (result) {
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { DisplayObjectConfig } from '@antv/g';
|
|
2
|
+
import { ICON_SIZE_RATIO } from '../../constants/element';
|
|
3
|
+
import type { Point } from '../../types';
|
|
4
|
+
import { getHexagonPoints } from '../../utils/element';
|
|
5
|
+
import type { IconStyleProps } from '../shapes';
|
|
6
|
+
import type { ParsedPolygonStyleProps, PolygonStyleProps } from './polygon';
|
|
7
|
+
import { Polygon } from './polygon';
|
|
8
|
+
|
|
9
|
+
export type HexagonStyleProps = PolygonStyleProps & ExtendsStyleProps;
|
|
10
|
+
type ParsedHexagonStyleProps = ParsedPolygonStyleProps & Required<HexagonStyleProps>;
|
|
11
|
+
type ExtendsStyleProps = {
|
|
12
|
+
/**
|
|
13
|
+
* <zh/> 外半径
|
|
14
|
+
* <en/> outer radius
|
|
15
|
+
*/
|
|
16
|
+
outerR?: number;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export class Hexagon extends Polygon {
|
|
20
|
+
constructor(options: DisplayObjectConfig<HexagonStyleProps>) {
|
|
21
|
+
super(options);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
private getOuterR(attributes: ParsedHexagonStyleProps): number {
|
|
25
|
+
return attributes.outerR || Math.min(...this.getSize(attributes)) / 2;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
protected getPoints(attributes: ParsedHexagonStyleProps): Point[] {
|
|
29
|
+
return getHexagonPoints(this.getOuterR(attributes));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
protected getIconStyle(attributes: ParsedHexagonStyleProps): false | IconStyleProps {
|
|
33
|
+
const style = super.getIconStyle(attributes);
|
|
34
|
+
const size = this.getOuterR(attributes) * ICON_SIZE_RATIO;
|
|
35
|
+
return style ? ({ width: size, height: size, ...style } as IconStyleProps) : false;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -2,6 +2,7 @@ export { BaseNode } from './base-node';
|
|
|
2
2
|
export { Circle } from './circle';
|
|
3
3
|
export { Diamond } from './diamond';
|
|
4
4
|
export { Ellipse } from './ellipse';
|
|
5
|
+
export { Hexagon } from './hexagon';
|
|
5
6
|
export { Image } from './image';
|
|
6
7
|
export { Rect } from './rect';
|
|
7
8
|
export { Star } from './star';
|
|
@@ -11,6 +12,7 @@ export type { BaseNodeStyleProps } from './base-node';
|
|
|
11
12
|
export type { CircleStyleProps } from './circle';
|
|
12
13
|
export type { DiamondStyleProps } from './diamond';
|
|
13
14
|
export type { EllipseStyleProps } from './ellipse';
|
|
15
|
+
export type { HexagonStyleProps } from './hexagon';
|
|
14
16
|
export type { ImageStyleProps } from './image';
|
|
15
17
|
export type { RectStyleProps } from './rect';
|
|
16
18
|
export type { StarStyleProps } from './star';
|
|
@@ -107,8 +107,8 @@ export abstract class BaseShape<StyleProps extends BaseShapeStyleProps> extends
|
|
|
107
107
|
*/
|
|
108
108
|
public getGraphicStyle<T extends Record<string, any>>(
|
|
109
109
|
attributes: T,
|
|
110
|
-
): Omit<T, 'x' | 'y' | 'transform' | 'transformOrigin' | 'className' | 'context' | 'zIndex'> {
|
|
111
|
-
const { x, y, className, transform, transformOrigin, context, zIndex, ...style } = attributes;
|
|
110
|
+
): Omit<T, 'x' | 'y' | 'z' | 'transform' | 'transformOrigin' | 'className' | 'context' | 'zIndex'> {
|
|
111
|
+
const { x, y, z, className, transform, transformOrigin, context, zIndex, ...style } = attributes;
|
|
112
112
|
return style;
|
|
113
113
|
}
|
|
114
114
|
|
|
@@ -148,4 +148,10 @@ export abstract class BaseShape<StyleProps extends BaseShapeStyleProps> extends
|
|
|
148
148
|
const { visibility } = this.attributes;
|
|
149
149
|
setVisibility(this, visibility);
|
|
150
150
|
}
|
|
151
|
+
|
|
152
|
+
public destroy(): void {
|
|
153
|
+
this.shapeMap = {};
|
|
154
|
+
this.animateMap = {};
|
|
155
|
+
super.destroy();
|
|
156
|
+
}
|
|
151
157
|
}
|
package/src/exports.ts
CHANGED
|
@@ -1,19 +1,53 @@
|
|
|
1
1
|
import { dark, light } from './themes';
|
|
2
2
|
import { idOf } from './utils/id';
|
|
3
|
+
import { omitStyleProps, subStyleProps } from './utils/prefix';
|
|
3
4
|
import { treeToGraphData } from './utils/tree';
|
|
4
5
|
|
|
5
|
-
export { BaseBehavior } from './behaviors';
|
|
6
|
-
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
export { BaseBehavior, DragCanvas, ZoomCanvas } from './behaviors';
|
|
7
|
+
export {
|
|
8
|
+
CanvasEvent,
|
|
9
|
+
ComboEvent,
|
|
10
|
+
CommonEvent,
|
|
11
|
+
ContainerEvent,
|
|
12
|
+
EdgeEvent,
|
|
13
|
+
ExtensionCategory,
|
|
14
|
+
GraphEvent,
|
|
15
|
+
NodeEvent,
|
|
16
|
+
} from './constants';
|
|
17
|
+
export { BaseCombo, CircleCombo, RectCombo } from './elements/combos';
|
|
18
|
+
export { BaseEdge, Cubic, CubicHorizontal, CubicVertical, Line, Polyline, Quadratic } from './elements/edges';
|
|
19
|
+
export { BaseNode, Circle, Diamond, Ellipse, Hexagon, Image, Rect, Star, Triangle } from './elements/nodes';
|
|
20
|
+
export { BaseShape } from './elements/shapes';
|
|
21
|
+
export { BasePlugin, CameraSetting } from './plugins';
|
|
10
22
|
export { getExtension, getExtensions, register } from './registry';
|
|
11
23
|
export { Graph } from './runtime/graph';
|
|
24
|
+
export { Shortcut } from './utils/shortcut';
|
|
12
25
|
|
|
13
|
-
export type { BaseBehaviorOptions } from './behaviors';
|
|
14
|
-
export type { BaseComboStyleProps } from './elements/combos';
|
|
15
|
-
export type {
|
|
16
|
-
|
|
26
|
+
export type { BaseBehaviorOptions, DragCanvasOptions, ZoomCanvasOptions } from './behaviors';
|
|
27
|
+
export type { BaseComboStyleProps, CircleComboStyleProps, RectComboStyleProps } from './elements/combos';
|
|
28
|
+
export type {
|
|
29
|
+
BaseEdgeStyleProps,
|
|
30
|
+
CubicHorizontalStyleProps,
|
|
31
|
+
CubicStyleProps,
|
|
32
|
+
CubicVerticalStyleProps,
|
|
33
|
+
LineStyleProps,
|
|
34
|
+
PolylineStyleProps,
|
|
35
|
+
QuadraticStyleProps,
|
|
36
|
+
} from './elements/edges';
|
|
37
|
+
export type {
|
|
38
|
+
BaseNodeStyleProps,
|
|
39
|
+
CircleStyleProps,
|
|
40
|
+
DiamondStyleProps,
|
|
41
|
+
EllipseStyleProps,
|
|
42
|
+
HexagonStyleProps,
|
|
43
|
+
ImageStyleProps,
|
|
44
|
+
RectStyleProps,
|
|
45
|
+
StarStyleProps,
|
|
46
|
+
TriangleStyleProps,
|
|
47
|
+
} from './elements/nodes';
|
|
48
|
+
export type { BaseShapeStyleProps } from './elements/shapes';
|
|
49
|
+
export type { BasePluginOptions, CameraSettingOptions } from './plugins';
|
|
50
|
+
export type { RuntimeContext } from './runtime/types';
|
|
17
51
|
export type {
|
|
18
52
|
BehaviorOptions,
|
|
19
53
|
CanvasOptions,
|
|
@@ -30,11 +64,28 @@ export type {
|
|
|
30
64
|
ThemeOptions,
|
|
31
65
|
ViewportOptions,
|
|
32
66
|
} from './spec';
|
|
33
|
-
export type {
|
|
67
|
+
export type {
|
|
68
|
+
IAnimateEvent,
|
|
69
|
+
IDragEvent,
|
|
70
|
+
IElementLifeCycleEvent,
|
|
71
|
+
IEvent,
|
|
72
|
+
IGraphLifeCycleEvent,
|
|
73
|
+
IKeyboardEvent,
|
|
74
|
+
IPointerEvent,
|
|
75
|
+
IViewportEvent,
|
|
76
|
+
IWheelEvent,
|
|
77
|
+
Point,
|
|
78
|
+
Vector2,
|
|
79
|
+
Vector3,
|
|
80
|
+
ViewportAnimationEffectTiming,
|
|
81
|
+
} from './types';
|
|
82
|
+
export type { ShortcutKey } from './utils/shortcut';
|
|
34
83
|
|
|
35
84
|
const Utils = {
|
|
36
85
|
idOf,
|
|
37
86
|
treeToGraphData,
|
|
87
|
+
subStyleProps,
|
|
88
|
+
omitStyleProps,
|
|
38
89
|
};
|
|
39
90
|
|
|
40
91
|
const Theme = {
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { GraphEvent } from '../constants';
|
|
2
|
+
import type { RuntimeContext } from '../runtime/types';
|
|
3
|
+
import type { BasePluginOptions } from './base-plugin';
|
|
4
|
+
import { BasePlugin } from './base-plugin';
|
|
5
|
+
|
|
6
|
+
export interface CameraSettingOptions extends BasePluginOptions {
|
|
7
|
+
/**
|
|
8
|
+
* <zh/> 投影模式,透视投影仅在 3D 场景下有效
|
|
9
|
+
*
|
|
10
|
+
* <en/> Projection mode, perspective projection is only valid in 3D scenes
|
|
11
|
+
*/
|
|
12
|
+
projectionMode?: 'perspective' | 'orthographic';
|
|
13
|
+
/**
|
|
14
|
+
* <zh/> 相机类型
|
|
15
|
+
* - orbiting: 固定视点,改变相机位置
|
|
16
|
+
* - exploring: 类似 orbiting,但允许相机在北极和南极之间旋转
|
|
17
|
+
* - tracking: 固定相机位置,改变视点
|
|
18
|
+
*
|
|
19
|
+
* <en/> Camera type
|
|
20
|
+
* - orbiting: Fixed viewpoint, change camera position
|
|
21
|
+
* - exploring: Similar to orbiting, but allows the camera to rotate between the North Pole and the South Pole
|
|
22
|
+
* - tracking: Fixed camera position, change viewpoint
|
|
23
|
+
*/
|
|
24
|
+
cameraType?: 'orbiting' | 'exploring' | 'tracking';
|
|
25
|
+
/**
|
|
26
|
+
* <zh/> 近平面位置
|
|
27
|
+
*
|
|
28
|
+
* <en/> The position of the near plane
|
|
29
|
+
*/
|
|
30
|
+
near?: number;
|
|
31
|
+
/**
|
|
32
|
+
* <zh/> 远平面位置
|
|
33
|
+
*
|
|
34
|
+
* <en/> The position of the far plane
|
|
35
|
+
*/
|
|
36
|
+
far?: number;
|
|
37
|
+
/**
|
|
38
|
+
* <zh/> 相机视角,仅在透视相机下有效
|
|
39
|
+
*
|
|
40
|
+
* <en/> Camera field of view, only valid in perspective camera
|
|
41
|
+
*/
|
|
42
|
+
fov?: number;
|
|
43
|
+
/**
|
|
44
|
+
* <zh/> 相机视口宽高比,仅在透视相机下有效。设置为 'auto' 时,会自动根据画布宽高比设置
|
|
45
|
+
*
|
|
46
|
+
* <en/> Camera viewport aspect ratio, only valid in perspective camera. When set to 'auto', it will be automatically set according to the canvas aspect ratio
|
|
47
|
+
*/
|
|
48
|
+
aspect?: number | 'auto';
|
|
49
|
+
/**
|
|
50
|
+
* <zh/> 相机距离目标的距离,默认为 500
|
|
51
|
+
*
|
|
52
|
+
* <en/> The distance from the camera to the target, default is 100.
|
|
53
|
+
*/
|
|
54
|
+
distance?: number;
|
|
55
|
+
/**
|
|
56
|
+
* <zh/> 最小视距
|
|
57
|
+
*
|
|
58
|
+
* <en/> Minimum distance
|
|
59
|
+
*/
|
|
60
|
+
minDistance?: number;
|
|
61
|
+
/**
|
|
62
|
+
* <zh/> 最大视距
|
|
63
|
+
*
|
|
64
|
+
* <en/> Maximum distance
|
|
65
|
+
*/
|
|
66
|
+
maxDistance?: number;
|
|
67
|
+
/**
|
|
68
|
+
* <zh/> 滚转角
|
|
69
|
+
*
|
|
70
|
+
* <en/> Roll
|
|
71
|
+
*/
|
|
72
|
+
roll?: number;
|
|
73
|
+
/**
|
|
74
|
+
* <zh/> 仰角
|
|
75
|
+
*
|
|
76
|
+
* <en/> Elevation
|
|
77
|
+
*/
|
|
78
|
+
elevation?: number;
|
|
79
|
+
/**
|
|
80
|
+
* <zh/> 方位角
|
|
81
|
+
*
|
|
82
|
+
* <en/> Azimuth
|
|
83
|
+
*/
|
|
84
|
+
azimuth?: number;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* <zh/> 配置相机参数
|
|
89
|
+
*
|
|
90
|
+
* <en/> Configure camera parameters
|
|
91
|
+
*/
|
|
92
|
+
export class CameraSetting extends BasePlugin<CameraSettingOptions> {
|
|
93
|
+
constructor(context: RuntimeContext, options: CameraSettingOptions) {
|
|
94
|
+
super(context, options);
|
|
95
|
+
this.bindEvents();
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
public update(options: Partial<CameraSettingOptions>): void {
|
|
99
|
+
this.setOptions(options);
|
|
100
|
+
super.update(options);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
private bindEvents() {
|
|
104
|
+
this.context.graph.once(GraphEvent.BEFORE_DRAW, () => this.setOptions(this.options));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
private setOptions = (options: Partial<CameraSettingOptions>) => {
|
|
108
|
+
const caller = {
|
|
109
|
+
cameraType: 'setType',
|
|
110
|
+
near: 'setNear',
|
|
111
|
+
far: 'setFar',
|
|
112
|
+
fov: 'setFov',
|
|
113
|
+
aspect: 'setAspect',
|
|
114
|
+
// 确保 projectionMode 在 near/far/fov/aspect 之后设置
|
|
115
|
+
// Ensure that projectionMode is set after near/far/fov/aspect
|
|
116
|
+
projectionMode: 'setProjectionMode',
|
|
117
|
+
distance: 'setDistance',
|
|
118
|
+
minDistance: 'setMinDistance',
|
|
119
|
+
maxDistance: 'setMaxDistance',
|
|
120
|
+
roll: 'setRoll',
|
|
121
|
+
elevation: 'setElevation',
|
|
122
|
+
azimuth: 'setAzimuth',
|
|
123
|
+
} as const;
|
|
124
|
+
|
|
125
|
+
const valueMapper = <T extends keyof CameraSettingOptions>(key: T, value: CameraSettingOptions[T]) => {
|
|
126
|
+
switch (key) {
|
|
127
|
+
case 'projectionMode':
|
|
128
|
+
return value === 'perspective' ? 1 : 0;
|
|
129
|
+
case 'cameraType':
|
|
130
|
+
return { orbiting: 0, exploring: 1, tracking: 2 }[value];
|
|
131
|
+
case 'aspect':
|
|
132
|
+
if (typeof value === 'number') return value;
|
|
133
|
+
return this.getCanvasAspect();
|
|
134
|
+
default:
|
|
135
|
+
return value;
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
Object.entries(caller).forEach(([key, method]) => {
|
|
140
|
+
const value = options[key];
|
|
141
|
+
if (value !== undefined) {
|
|
142
|
+
const actualValue = valueMapper(key, value);
|
|
143
|
+
// @ts-expect-error incorrect ts type check
|
|
144
|
+
this.context.canvas.getCamera()[method](actualValue);
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
private getCanvasAspect() {
|
|
150
|
+
const [width, height] = this.context.viewport!.getCanvasSize();
|
|
151
|
+
return width / height;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { insertCss } from 'insert-css';
|
|
2
1
|
import type { RuntimeContext } from '../runtime/types';
|
|
3
|
-
import type {
|
|
2
|
+
import type { Element } from '../types';
|
|
3
|
+
import type { IPointerEvent } from '../types/event';
|
|
4
4
|
import type { Item } from '../utils/contextmenu';
|
|
5
5
|
import { CONTEXTMENU_CSS, getContentFromItems } from '../utils/contextmenu';
|
|
6
|
-
import { createPluginContainer } from '../utils/dom';
|
|
6
|
+
import { createPluginContainer, insertDOM } from '../utils/dom';
|
|
7
7
|
import type { BasePluginOptions } from './base-plugin';
|
|
8
8
|
import { BasePlugin } from './base-plugin';
|
|
9
9
|
|
|
@@ -36,12 +36,12 @@ export type ContextmenuOptions = BasePluginOptions & {
|
|
|
36
36
|
* <zh/> 返回菜单的项目列表,支持 `Promise` 类型的返回值。是 `getContent` 的快捷配置。
|
|
37
37
|
* <en/> Return the list of menu items, support the `Promise` type return value. It is a shortcut configuration of `getContent`.
|
|
38
38
|
*/
|
|
39
|
-
getItems?: (event:
|
|
39
|
+
getItems?: (event: IElementEvent) => Item[] | Promise<Item[]>;
|
|
40
40
|
/**
|
|
41
41
|
* <zh/> 返回菜单的内容,支持 `Promise` 类型的返回值,也可以使用 `getItems` 来快捷配置。
|
|
42
42
|
* <en/> Return the content of menu, support the `Promise` type return value, you can also use `getItems` for shortcut configuration.
|
|
43
43
|
*/
|
|
44
|
-
getContent?: (event:
|
|
44
|
+
getContent?: (event: IElementEvent) => HTMLElement | string | Promise<HTMLElement | string>;
|
|
45
45
|
/**
|
|
46
46
|
* <zh/> Loading 时候的菜单内容,用于 getContent 返回 Promise 的时候。
|
|
47
47
|
* <en/> The menu content when loading is used when getContent returns a Promise.
|
|
@@ -51,7 +51,7 @@ export type ContextmenuOptions = BasePluginOptions & {
|
|
|
51
51
|
* <zh/> 插件是否可用,通过参数来判断是否支持右键菜单,默认全部可用。
|
|
52
52
|
* <en/> Whether the plugin is available, determine whether the right-click menu is supported through parameters, The default is all available.
|
|
53
53
|
*/
|
|
54
|
-
enable?: boolean | ((event:
|
|
54
|
+
enable?: boolean | ((event: IElementEvent) => boolean);
|
|
55
55
|
};
|
|
56
56
|
|
|
57
57
|
/**
|
|
@@ -77,7 +77,7 @@ export class Contextmenu extends BasePlugin<ContextmenuOptions> {
|
|
|
77
77
|
$container!.appendChild(this.$element);
|
|
78
78
|
|
|
79
79
|
// 设置样式
|
|
80
|
-
|
|
80
|
+
insertDOM('g6-contextmenu-css', 'style', {}, CONTEXTMENU_CSS, document.head);
|
|
81
81
|
|
|
82
82
|
this.update(options);
|
|
83
83
|
}
|
|
@@ -87,7 +87,7 @@ export class Contextmenu extends BasePlugin<ContextmenuOptions> {
|
|
|
87
87
|
* <en/> Display the right-click menu based on the incoming element.
|
|
88
88
|
* @param e - 事件
|
|
89
89
|
*/
|
|
90
|
-
public async showContextmenu(e:
|
|
90
|
+
public async showContextmenu(e: IElementEvent) {
|
|
91
91
|
const { enable, offset } = this.options;
|
|
92
92
|
|
|
93
93
|
if ((typeof enable === 'function' && !enable(e)) || !enable) {
|
|
@@ -140,7 +140,7 @@ export class Contextmenu extends BasePlugin<ContextmenuOptions> {
|
|
|
140
140
|
this.$element.remove();
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
private async getDOMContent(e:
|
|
143
|
+
private async getDOMContent(e: IElementEvent) {
|
|
144
144
|
const { getContent, getItems } = this.options;
|
|
145
145
|
|
|
146
146
|
if (getItems) {
|
|
@@ -173,7 +173,7 @@ export class Contextmenu extends BasePlugin<ContextmenuOptions> {
|
|
|
173
173
|
document.removeEventListener('click', this.onMenuItemClick);
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
private onTriggerEvent = (e:
|
|
176
|
+
private onTriggerEvent = (e: IElementEvent) => {
|
|
177
177
|
// `contextmenu` 事件默认会触发浏览器的右键菜单,需要阻止默认事件
|
|
178
178
|
// `click` 事件不需要阻止默认事件
|
|
179
179
|
e.preventDefault?.();
|
|
@@ -197,3 +197,5 @@ export class Contextmenu extends BasePlugin<ContextmenuOptions> {
|
|
|
197
197
|
}
|
|
198
198
|
};
|
|
199
199
|
}
|
|
200
|
+
|
|
201
|
+
type IElementEvent = IPointerEvent<Element>;
|
package/src/plugins/index.ts
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
export { BasePlugin } from './base-plugin';
|
|
2
|
+
export { CameraSetting } from './camera-setting';
|
|
2
3
|
export { Contextmenu } from './contextmenu';
|
|
3
4
|
export { GridLine } from './grid-line';
|
|
5
|
+
export { Legend } from './legend';
|
|
6
|
+
export { Toolbar } from './toolbar';
|
|
4
7
|
export { Tooltip } from './tooltip';
|
|
5
8
|
export { Watermark } from './watermark';
|
|
6
9
|
|
|
7
10
|
export type { BasePluginOptions } from './base-plugin';
|
|
11
|
+
export type { CameraSettingOptions } from './camera-setting';
|
|
8
12
|
export type { ContextmenuOptions } from './contextmenu';
|
|
9
13
|
export type { GridLineOptions } from './grid-line';
|
|
14
|
+
export type { LegendOptions } from './legend';
|
|
15
|
+
export type { ToolbarOptions } from './toolbar';
|
|
10
16
|
export type { TooltipOptions } from './tooltip';
|
|
11
17
|
export type { WatermarkOptions } from './watermark';
|