@antv/g6 5.0.0-beta.30 → 5.0.0-beta.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/g6.min.js +2 -2
- package/dist/lib/behaviors/focus-element.d.ts +29 -0
- package/dist/lib/behaviors/hover-element.d.ts +61 -0
- package/dist/lib/{src/behaviors → behaviors}/index.d.ts +4 -0
- 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 +1 -1
- package/dist/lib/{src/constants → constants}/events/node.d.ts +1 -1
- package/dist/lib/{src/elements → elements}/nodes/base-node.d.ts +1 -1
- 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/{src/exports.d.ts → exports.d.ts} +10 -2
- package/dist/lib/{src/layouts → layouts}/index.d.ts +1 -1
- package/dist/lib/{src/plugins → plugins}/index.d.ts +2 -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 +1 -1
- package/dist/lib/{src/runtime → runtime}/behavior.d.ts +1 -0
- package/dist/lib/{src/runtime → runtime}/element.d.ts +2 -2
- package/dist/lib/{src/utils → utils}/dom.d.ts +10 -0
- package/dist/lib/{src/utils → utils}/element.d.ts +6 -0
- 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}/traverse.d.ts +9 -0
- package/esm/behaviors/focus-element.d.ts +29 -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 +61 -0
- package/esm/behaviors/hover-element.js +85 -0
- package/esm/behaviors/hover-element.js.map +1 -0
- package/esm/behaviors/index.d.ts +4 -0
- package/esm/behaviors/index.js +2 -0
- package/esm/behaviors/index.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 +1 -1
- 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/elements/nodes/base-node.d.ts +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 +10 -2
- package/esm/exports.js +5 -0
- package/esm/exports.js.map +1 -1
- package/esm/plugins/contextmenu.js +2 -3
- package/esm/plugins/contextmenu.js.map +1 -1
- 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/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 +1 -1
- package/esm/plugins/tooltip.js +3 -3
- package/esm/registry/build-in.js +7 -3
- package/esm/registry/build-in.js.map +1 -1
- package/esm/registry/extension/index.js +5 -7
- package/esm/registry/extension/index.js.map +1 -1
- package/esm/runtime/behavior.d.ts +1 -0
- package/esm/runtime/behavior.js +12 -2
- package/esm/runtime/behavior.js.map +1 -1
- package/esm/runtime/canvas.js +6 -1
- package/esm/runtime/canvas.js.map +1 -1
- package/esm/runtime/data.js +1 -1
- package/esm/runtime/data.js.map +1 -1
- package/esm/runtime/element.d.ts +2 -2
- package/esm/runtime/element.js +8 -3
- package/esm/runtime/element.js.map +1 -1
- package/esm/runtime/graph.js +4 -3
- 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/themes/base.js +7 -0
- package/esm/themes/base.js.map +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 +6 -0
- package/esm/utils/element.js +15 -0
- package/esm/utils/element.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/traverse.d.ts +9 -0
- package/esm/utils/traverse.js +21 -0
- package/esm/utils/traverse.js.map +1 -1
- package/lib/behaviors/focus-element.d.ts +29 -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 +61 -0
- package/lib/behaviors/hover-element.js +89 -0
- package/lib/behaviors/hover-element.js.map +1 -0
- package/lib/behaviors/index.d.ts +4 -0
- package/lib/behaviors/index.js +5 -1
- package/lib/behaviors/index.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 +1 -1
- 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/elements/nodes/base-node.d.ts +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 +10 -2
- package/lib/exports.js +8 -1
- package/lib/exports.js.map +1 -1
- package/lib/plugins/contextmenu.js +1 -2
- package/lib/plugins/contextmenu.js.map +1 -1
- 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/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 +1 -1
- package/lib/plugins/tooltip.js +3 -3
- package/lib/registry/build-in.js +4 -0
- package/lib/registry/build-in.js.map +1 -1
- package/lib/registry/extension/index.js +5 -7
- package/lib/registry/extension/index.js.map +1 -1
- package/lib/runtime/behavior.d.ts +1 -0
- package/lib/runtime/behavior.js +12 -2
- package/lib/runtime/behavior.js.map +1 -1
- package/lib/runtime/canvas.js +6 -1
- package/lib/runtime/canvas.js.map +1 -1
- package/lib/runtime/data.js +1 -1
- package/lib/runtime/data.js.map +1 -1
- package/lib/runtime/element.d.ts +2 -2
- package/lib/runtime/element.js +12 -7
- package/lib/runtime/element.js.map +1 -1
- package/lib/runtime/graph.js +4 -3
- 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/themes/base.js +7 -0
- package/lib/themes/base.js.map +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 +6 -0
- package/lib/utils/element.js +17 -1
- package/lib/utils/element.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/traverse.d.ts +9 -0
- package/lib/utils/traverse.js +23 -1
- package/lib/utils/traverse.js.map +1 -1
- package/package.json +13 -13
- package/src/behaviors/focus-element.ts +89 -0
- package/src/behaviors/hover-element.ts +147 -0
- package/src/behaviors/index.ts +4 -0
- 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 +1 -1
- package/src/constants/events/node.ts +1 -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 +8 -0
- package/src/plugins/contextmenu.ts +2 -3
- package/src/plugins/index.ts +2 -0
- package/src/plugins/toolbar/index.ts +125 -0
- package/src/plugins/toolbar/util.ts +117 -0
- package/src/plugins/tooltip.ts +3 -3
- package/src/registry/build-in.ts +7 -2
- package/src/registry/extension/index.ts +5 -7
- package/src/runtime/behavior.ts +13 -2
- package/src/runtime/canvas.ts +6 -1
- package/src/runtime/data.ts +1 -1
- package/src/runtime/element.ts +8 -3
- package/src/runtime/graph.ts +4 -3
- package/src/runtime/layout.ts +5 -1
- package/src/themes/base.ts +7 -0
- package/src/utils/dom.ts +32 -0
- package/src/utils/element.ts +16 -0
- package/src/utils/id.ts +12 -1
- package/src/utils/relation.ts +84 -0
- 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/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}/collapse-expand.d.ts +0 -0
- /package/dist/lib/{src/behaviors → behaviors}/drag-canvas.d.ts +0 -0
- /package/dist/lib/{src/behaviors → behaviors}/drag-element.d.ts +0 -0
- /package/dist/lib/{src/behaviors → behaviors}/types.d.ts +0 -0
- /package/dist/lib/{src/behaviors → behaviors}/zoom-canvas.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/constants → constants}/index.d.ts +0 -0
- /package/dist/lib/{src/elements → elements}/combos/base-combo.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/base-edge.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}/contextmenu.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/index.d.ts +0 -0
- /package/dist/lib/{src/registry → registry}/extension/types.d.ts +0 -0
- /package/dist/lib/{src/registry → registry}/index.d.ts +0 -0
- /package/dist/lib/{src/registry → registry}/types.d.ts +0 -0
- /package/dist/lib/{src/runtime → runtime}/canvas.d.ts +0 -0
- /package/dist/lib/{src/runtime → runtime}/data.d.ts +0 -0
- /package/dist/lib/{src/runtime → runtime}/graph.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}/plugin.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}/behavior.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}/event.d.ts +0 -0
- /package/dist/lib/{src/types → types}/graphlib.d.ts +0 -0
- /package/dist/lib/{src/types → types}/index.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}/bbox.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/events.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}/shortcut.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
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { FederatedMouseEvent } from '@antv/g';
|
|
2
|
+
import type { RuntimeContext } from '../runtime/types';
|
|
3
|
+
import type { BehaviorEvent, ViewportAnimationEffectTiming } from '../types';
|
|
4
|
+
import type { BaseBehaviorOptions } from './base-behavior';
|
|
5
|
+
import { BaseBehavior } from './base-behavior';
|
|
6
|
+
export interface FocusElementOptions extends BaseBehaviorOptions {
|
|
7
|
+
/**
|
|
8
|
+
* <zh/> 是否启用动画以及动画配置
|
|
9
|
+
*
|
|
10
|
+
* <en/> Whether to enable animation
|
|
11
|
+
*/
|
|
12
|
+
animation?: ViewportAnimationEffectTiming;
|
|
13
|
+
/**
|
|
14
|
+
* <zh/> 是否启用聚焦功能
|
|
15
|
+
*
|
|
16
|
+
* <en/> Whether to enable the function of dragging the node
|
|
17
|
+
*/
|
|
18
|
+
enable?: boolean | ((event: BehaviorEvent<FederatedMouseEvent> | BehaviorEvent<KeyboardEvent>) => boolean);
|
|
19
|
+
}
|
|
20
|
+
export declare class FocusElement extends BaseBehavior<FocusElementOptions> {
|
|
21
|
+
static defaultOptions: Partial<FocusElementOptions>;
|
|
22
|
+
constructor(context: RuntimeContext, options: FocusElementOptions);
|
|
23
|
+
private bindEvents;
|
|
24
|
+
private getSelectedNodeIDs;
|
|
25
|
+
private clickFocusElement;
|
|
26
|
+
private validate;
|
|
27
|
+
private unbindEvents;
|
|
28
|
+
destroy(): void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { FederatedMouseEvent } from '@antv/g';
|
|
2
|
+
import type { RuntimeContext } from '../runtime/types';
|
|
3
|
+
import type { BehaviorEvent, State } from '../types';
|
|
4
|
+
import type { BaseBehaviorOptions } from './base-behavior';
|
|
5
|
+
import { BaseBehavior } from './base-behavior';
|
|
6
|
+
export interface HoverElementOptions extends BaseBehaviorOptions {
|
|
7
|
+
/**
|
|
8
|
+
* <zh/> 是否启用动画
|
|
9
|
+
*
|
|
10
|
+
* <en/> Whether to enable animation
|
|
11
|
+
*/
|
|
12
|
+
animation?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* <zh/> 是否启用悬浮元素的功能
|
|
15
|
+
*
|
|
16
|
+
* <en/> Whether to enable hover element function
|
|
17
|
+
*/
|
|
18
|
+
enable?: boolean | ((event: BehaviorEvent<FederatedMouseEvent>) => boolean);
|
|
19
|
+
/**
|
|
20
|
+
* <zh/> 激活元素的n度关系,默认为0,表示只激活当前节点,1表示激活当前节点及其直接相邻的节点和边,以此类推
|
|
21
|
+
*
|
|
22
|
+
* <en/> N-degree relationship of the hovered element, default to 0, which means only the current node is activated, 1 means the current node and its directly adjacent nodes and edges are activated, etc
|
|
23
|
+
*/
|
|
24
|
+
degree?: number;
|
|
25
|
+
/**
|
|
26
|
+
* <zh/> 激活元素的状态,默认为 active
|
|
27
|
+
*
|
|
28
|
+
* <en/> Active element state, default to active
|
|
29
|
+
*/
|
|
30
|
+
activeState?: State;
|
|
31
|
+
/**
|
|
32
|
+
* <zh/> 非激活元素的状态,默认为 default
|
|
33
|
+
*
|
|
34
|
+
* <en/> Inactive element state, default to default
|
|
35
|
+
*/
|
|
36
|
+
inactiveState?: State;
|
|
37
|
+
/**
|
|
38
|
+
* <zh/> 当元素被悬停时的回调
|
|
39
|
+
*
|
|
40
|
+
* <en/> Callback when the element is hovered
|
|
41
|
+
*/
|
|
42
|
+
onHover?: (event: BehaviorEvent<FederatedMouseEvent>) => void;
|
|
43
|
+
/**
|
|
44
|
+
* <zh/> 当悬停结束时的回调
|
|
45
|
+
*
|
|
46
|
+
* <en/> Callback when the hover ends
|
|
47
|
+
*/
|
|
48
|
+
onHoverEnd?: (event: BehaviorEvent<FederatedMouseEvent>) => void;
|
|
49
|
+
}
|
|
50
|
+
export declare class HoverElement extends BaseBehavior<HoverElementOptions> {
|
|
51
|
+
static defaultOptions: Partial<HoverElementOptions>;
|
|
52
|
+
constructor(context: RuntimeContext, options: HoverElementOptions);
|
|
53
|
+
private bindEvents;
|
|
54
|
+
private hoverElement;
|
|
55
|
+
private hoverEndElement;
|
|
56
|
+
private updateElementsState;
|
|
57
|
+
private getElementsState;
|
|
58
|
+
private validate;
|
|
59
|
+
private unbindEvents;
|
|
60
|
+
destroy(): void;
|
|
61
|
+
}
|
|
@@ -2,9 +2,13 @@ export { BaseBehavior } from './base-behavior';
|
|
|
2
2
|
export { CollapseExpand } from './collapse-expand';
|
|
3
3
|
export { DragCanvas } from './drag-canvas';
|
|
4
4
|
export { DragElement } from './drag-element';
|
|
5
|
+
export { FocusElement } from './focus-element';
|
|
6
|
+
export { HoverElement } from './hover-element';
|
|
5
7
|
export { ZoomCanvas } from './zoom-canvas';
|
|
6
8
|
export type { BaseBehaviorOptions } from './base-behavior';
|
|
7
9
|
export type { CollapseExpandOptions } from './collapse-expand';
|
|
8
10
|
export type { DragCanvasOptions } from './drag-canvas';
|
|
9
11
|
export type { DragElementOptions } from './drag-element';
|
|
12
|
+
export type { FocusElementOptions } from './focus-element';
|
|
13
|
+
export type { HoverElementOptions } from './hover-element';
|
|
10
14
|
export type { ZoomCanvasOptions } from './zoom-canvas';
|
|
@@ -3,3 +3,4 @@
|
|
|
3
3
|
* <en/> According to the different nodes, the size of the icon is automatically calculated, and then multiplied by the following scaling factor to prevent it from being too close.
|
|
4
4
|
*/
|
|
5
5
|
export declare const ICON_SIZE_RATIO = 0.8;
|
|
6
|
+
export declare const ELEMENT_TYPES: readonly ["node", "edge", "combo"];
|
|
@@ -30,7 +30,7 @@ export declare abstract class BaseNode<S extends BaseNodeStyleProps = any> exten
|
|
|
30
30
|
type: string;
|
|
31
31
|
static defaultStyleProps: Partial<BaseNodeStyleProps>;
|
|
32
32
|
constructor(options: DisplayObjectConfig<S>);
|
|
33
|
-
protected getSize(attributes?: Required<S>): import("
|
|
33
|
+
protected getSize(attributes?: Required<S>): import("src/types/vector").Vector3;
|
|
34
34
|
protected getKeyStyle(attributes: Required<S>): any;
|
|
35
35
|
protected getLabelStyle(attributes: Required<S>): false | LabelStyleProps;
|
|
36
36
|
protected getHaloStyle(attributes: Required<S>): any;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { DisplayObjectConfig } from '@antv/g';
|
|
2
|
+
import type { Point } from '../../types';
|
|
3
|
+
import type { IconStyleProps } from '../shapes';
|
|
4
|
+
import type { ParsedPolygonStyleProps, PolygonStyleProps } from './polygon';
|
|
5
|
+
import { Polygon } from './polygon';
|
|
6
|
+
export type HexagonStyleProps = PolygonStyleProps & ExtendsStyleProps;
|
|
7
|
+
type ParsedHexagonStyleProps = ParsedPolygonStyleProps & Required<HexagonStyleProps>;
|
|
8
|
+
type ExtendsStyleProps = {
|
|
9
|
+
/**
|
|
10
|
+
* <zh/> 外半径
|
|
11
|
+
* <en/> outer radius
|
|
12
|
+
*/
|
|
13
|
+
outerR?: number;
|
|
14
|
+
};
|
|
15
|
+
export declare class Hexagon extends Polygon {
|
|
16
|
+
constructor(options: DisplayObjectConfig<HexagonStyleProps>);
|
|
17
|
+
private getOuterR;
|
|
18
|
+
protected getPoints(attributes: ParsedHexagonStyleProps): Point[];
|
|
19
|
+
protected getIconStyle(attributes: ParsedHexagonStyleProps): false | IconStyleProps;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -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';
|
|
@@ -10,6 +11,7 @@ export type { BaseNodeStyleProps } from './base-node';
|
|
|
10
11
|
export type { CircleStyleProps } from './circle';
|
|
11
12
|
export type { DiamondStyleProps } from './diamond';
|
|
12
13
|
export type { EllipseStyleProps } from './ellipse';
|
|
14
|
+
export type { HexagonStyleProps } from './hexagon';
|
|
13
15
|
export type { ImageStyleProps } from './image';
|
|
14
16
|
export type { RectStyleProps } from './rect';
|
|
15
17
|
export type { StarStyleProps } from './star';
|
|
@@ -7,7 +7,7 @@ type BadgeOptions = DisplayObjectConfig<BadgeStyleProps>;
|
|
|
7
7
|
export declare class Badge extends BaseShape<BadgeStyleProps> {
|
|
8
8
|
static defaultStyleProps: Partial<BadgeStyleProps>;
|
|
9
9
|
constructor(options: BadgeOptions);
|
|
10
|
-
protected getBadgeStyle(attributes: ParsedBadgeStyleProps): Omit<Required<LabelStyleProps>, "transform" | "x" | "y" | "zIndex" | "className" | "transformOrigin" | "context">;
|
|
10
|
+
protected getBadgeStyle(attributes: ParsedBadgeStyleProps): Omit<Required<LabelStyleProps>, "transform" | "x" | "y" | "z" | "zIndex" | "className" | "transformOrigin" | "context">;
|
|
11
11
|
render(attributes?: ParsedBadgeStyleProps, container?: Group): void;
|
|
12
12
|
connectedCallback(): void;
|
|
13
13
|
}
|
|
@@ -51,7 +51,8 @@ export declare abstract class BaseShape<StyleProps extends BaseShapeStyleProps>
|
|
|
51
51
|
* @param attributes - <zh/> 属性对象 | <en/> attribute object
|
|
52
52
|
* @returns <zh/> 仅包含样式属性的对象 | <en/> An object containing only the style properties.
|
|
53
53
|
*/
|
|
54
|
-
getGraphicStyle<T extends Record<string, any>>(attributes: T): Omit<T, 'x' | 'y' | 'transform' | 'transformOrigin' | 'className' | 'context' | 'zIndex'>;
|
|
54
|
+
getGraphicStyle<T extends Record<string, any>>(attributes: T): Omit<T, 'x' | 'y' | 'z' | 'transform' | 'transformOrigin' | 'className' | 'context' | 'zIndex'>;
|
|
55
55
|
animate(keyframes: Keyframe[], options?: number | KeyframeAnimationOptions): IAnimation | null;
|
|
56
56
|
private setVisibility;
|
|
57
|
+
destroy(): void;
|
|
57
58
|
}
|
|
@@ -1,24 +1,32 @@
|
|
|
1
1
|
import { idOf } from './utils/id';
|
|
2
|
+
import { omitStyleProps, subStyleProps } from './utils/prefix';
|
|
2
3
|
import { treeToGraphData } from './utils/tree';
|
|
3
4
|
export { BaseBehavior } from './behaviors';
|
|
4
5
|
export { CanvasEvent, ComboEvent, CommonEvent, ContainerEvent, EdgeEvent, GraphEvent, NodeEvent } from './constants';
|
|
5
6
|
export { BaseCombo } from './elements/combos';
|
|
6
7
|
export { BaseEdge } from './elements/edges';
|
|
7
8
|
export { BaseNode } from './elements/nodes';
|
|
9
|
+
export { BaseShape } from './elements/shapes';
|
|
10
|
+
export { BasePlugin } from './plugins';
|
|
8
11
|
export { getExtension, getExtensions, register } from './registry';
|
|
9
12
|
export { Graph } from './runtime/graph';
|
|
10
13
|
export type { BaseBehaviorOptions } from './behaviors';
|
|
11
14
|
export type { BaseComboStyleProps } from './elements/combos';
|
|
12
15
|
export type { BaseEdgeStyleProps } from './elements/edges';
|
|
13
16
|
export type { BaseNodeStyleProps } from './elements/nodes';
|
|
17
|
+
export type { BaseShapeStyleProps } from './elements/shapes';
|
|
18
|
+
export type { BasePluginOptions } from './plugins';
|
|
19
|
+
export type { RuntimeContext } from './runtime/types';
|
|
14
20
|
export type { BehaviorOptions, CanvasOptions, ComboData, ComboOptions, EdgeData, EdgeOptions, G6Spec, GraphData, LayoutOptions, NodeData, NodeOptions, PluginOptions, ThemeOptions, ViewportOptions, } from './spec';
|
|
15
21
|
export type { Point, Vector2, Vector3 } from './types';
|
|
16
22
|
declare const Utils: {
|
|
17
23
|
idOf: typeof idOf;
|
|
18
24
|
treeToGraphData: typeof treeToGraphData;
|
|
25
|
+
subStyleProps: typeof subStyleProps;
|
|
26
|
+
omitStyleProps: typeof omitStyleProps;
|
|
19
27
|
};
|
|
20
28
|
declare const Theme: {
|
|
21
|
-
dark: import("
|
|
22
|
-
light: import("
|
|
29
|
+
dark: import("src/themes/types").Theme;
|
|
30
|
+
light: import("src/themes/types").Theme;
|
|
23
31
|
};
|
|
24
32
|
export { Theme, Utils };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/// <reference types="
|
|
1
|
+
/// <reference types="src/layouts/hierarchy" />
|
|
2
2
|
export { compactBox, dendrogram, indented, mindmap } from '@antv/hierarchy';
|
|
3
3
|
export { AntVDagreLayout, CircularLayout, ComboCombinedLayout, ConcentricLayout, D3ForceLayout, DagreLayout, ForceAtlas2Layout, ForceLayout, FruchtermanLayout, GridLayout, MDSLayout, RadialLayout, RandomLayout, } from '@antv/layout';
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export { BasePlugin } from './base-plugin';
|
|
2
2
|
export { Contextmenu } from './contextmenu';
|
|
3
3
|
export { GridLine } from './grid-line';
|
|
4
|
+
export { Toolbar } from './toolbar';
|
|
4
5
|
export { Tooltip } from './tooltip';
|
|
5
6
|
export { Watermark } from './watermark';
|
|
6
7
|
export type { BasePluginOptions } from './base-plugin';
|
|
7
8
|
export type { ContextmenuOptions } from './contextmenu';
|
|
8
9
|
export type { GridLineOptions } from './grid-line';
|
|
10
|
+
export type { ToolbarOptions } from './toolbar';
|
|
9
11
|
export type { TooltipOptions } from './tooltip';
|
|
10
12
|
export type { WatermarkOptions } from './watermark';
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { RuntimeContext } from '../../runtime/types';
|
|
2
|
+
import type { BasePluginOptions } from '../base-plugin';
|
|
3
|
+
import { BasePlugin } from '../base-plugin';
|
|
4
|
+
import type { Position, ToolbarItem } from './util';
|
|
5
|
+
/**
|
|
6
|
+
* <zh/> Toolbar 工具栏的配置项。
|
|
7
|
+
* <en/> The configuration item of the Toolbar toolbar.
|
|
8
|
+
*/
|
|
9
|
+
export type ToolbarOptions = BasePluginOptions & {
|
|
10
|
+
/**
|
|
11
|
+
* <zh/> 给工具栏的 DOM 追加的 classname,便于自定义样式。默认是包含 `g6-toolbar`。
|
|
12
|
+
* <en/> The classname appended to the menu DOM for custom styles. The default is `g6-toolbar`.
|
|
13
|
+
*/
|
|
14
|
+
className?: string;
|
|
15
|
+
/**
|
|
16
|
+
* <zh/> Toolbar 的位置,相对于画布,默认为 `top-left`,最终会影响 DOM 的 style 样式。
|
|
17
|
+
* <en/> The position of the Toolbar relative to the canvas, default is `top-left`, which will ultimately affect the style of the DOM.
|
|
18
|
+
*/
|
|
19
|
+
position?: Position;
|
|
20
|
+
/**
|
|
21
|
+
* <zh/> 工具栏显式的 style 样式,可以用来设置它相对于画布的位置、背景容器样式等。
|
|
22
|
+
* <en/> The style style of the Toolbar, which can be used to set its position relative to the canvas.
|
|
23
|
+
*/
|
|
24
|
+
style?: Partial<CSSStyleDeclaration>;
|
|
25
|
+
/**
|
|
26
|
+
* <zh/> 当工具栏被点击后,触发的回调方法。
|
|
27
|
+
* <en/> The callback method triggered when the toolbar item is clicked.
|
|
28
|
+
*/
|
|
29
|
+
onClick?: (value: string, target: Element) => void;
|
|
30
|
+
/**
|
|
31
|
+
* <zh/> 返回工具栏的项目列表,支持 `Promise` 类型的返回值。
|
|
32
|
+
* <en/> Return the list of toolbar items, support return a `Promise` as items.
|
|
33
|
+
*/
|
|
34
|
+
getItems: () => ToolbarItem[] | Promise<ToolbarItem[]>;
|
|
35
|
+
/**
|
|
36
|
+
* <zh/> 插件是否可用,默认 `true`。
|
|
37
|
+
* <en/> Whether the plugin is available, default is `true`.
|
|
38
|
+
*/
|
|
39
|
+
enable?: boolean;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* <zh/> 工具栏,支持配置工具栏项目,以及点击之后的回调方法。
|
|
43
|
+
* <en/> Toolbar, support configuration of toolbar items, and callback methods after clicking.
|
|
44
|
+
*/
|
|
45
|
+
export declare class Toolbar extends BasePlugin<ToolbarOptions> {
|
|
46
|
+
static defaultOptions: Partial<ToolbarOptions>;
|
|
47
|
+
private $element;
|
|
48
|
+
constructor(context: RuntimeContext, options: ToolbarOptions);
|
|
49
|
+
/**
|
|
50
|
+
* <zh/> 更新工具栏的配置项。
|
|
51
|
+
* <en/> Update the configuration of the toolbar.
|
|
52
|
+
* @param options - 配置项
|
|
53
|
+
*/
|
|
54
|
+
update(options: Partial<ToolbarOptions>): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* <zh/> 销毁工具栏。
|
|
57
|
+
* <en/> Destroy the toolbar.
|
|
58
|
+
*/
|
|
59
|
+
destroy(): void;
|
|
60
|
+
private getDOMContent;
|
|
61
|
+
private onToolbarItemClick;
|
|
62
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { CornerPlacement } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* <zh/> 工具栏显示项目。
|
|
4
|
+
* <en/> The item of the toolbar.
|
|
5
|
+
*/
|
|
6
|
+
export type ToolbarItem = {
|
|
7
|
+
/**
|
|
8
|
+
* <zh/> 可以使用 id 来配置内置的工具栏项,可以是 'zoom-in'、'zoom-out'、'auto-fit'、'reset' 等值,也可以配合三方的 iconfont 使用,原理是通过 id 来匹配内置的 svg symbol。See: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/symbol。
|
|
9
|
+
* <en/> You can use id to configure the built-in toolbar items, which can be values such as 'zoom-in', 'zoom-out', 'auto-fit', 'reset', etc. One of the two configurations with `marker`. The principle is to match the built-in svg symbol through id. See: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/symbol.
|
|
10
|
+
*/
|
|
11
|
+
readonly id: 'zoom-in' | 'zoom-out' | 'redo' | 'undo' | 'edit' | 'delete' | 'auto-fit' | 'export' | 'reset' | string;
|
|
12
|
+
/**
|
|
13
|
+
* <zh/> 工具栏项对应的值,在 onClick 中作为回调参数。
|
|
14
|
+
* <en/> The value corresponding to the toolbar item, used as a callback parameter in `onClick`.
|
|
15
|
+
*/
|
|
16
|
+
readonly value: string;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* <zh/> Toolbar 的位置,相对于画布,默认为 `top-left`,最终会影响 DOM 的 style 样式。
|
|
20
|
+
* <en/> The position of the Toolbar relative to the canvas, default is `top-left`, which will ultimately affect the style of the DOM.
|
|
21
|
+
*/
|
|
22
|
+
export type Position = CornerPlacement;
|
|
23
|
+
/**
|
|
24
|
+
* <zh/> 解析 toolbar 的 position 为位置样式。
|
|
25
|
+
* <en/> Parse the position of the toolbar into position style.
|
|
26
|
+
* @param position - position
|
|
27
|
+
* @returns style
|
|
28
|
+
*/
|
|
29
|
+
export declare function parsePositionToStyle(position: Position): Partial<CSSStyleDeclaration>;
|
|
30
|
+
/**
|
|
31
|
+
* 内置默认的 toolbar 的 CSS 样式。
|
|
32
|
+
*/
|
|
33
|
+
export declare const TOOLBAR_CSS = "\n .g6-toolbar {\n position: absolute;\n z-index: 100;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n border-radius: 4px;\n box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.1);\n opacity: 0.65;\n } \n .g6-toolbar .g6-toolbar-item {\n display: inline-block;\n width: 16px;\n height: 16px;\n padding: 4px;\n cursor: pointer;\n box-sizing: content-box;\n }\n\n .g6-toolbar .g6-toolbar-item:hover {\n background-color: #f0f0f0;\n }\n\n .g6-toolbar .g6-toolbar-item svg {\n display: inline-block;\n width: 100%;\n height: 100%;\n pointer-events: none;\n }\n";
|
|
34
|
+
export declare const BUILD_IN_SVG_ICON = "\n <svg>\n <symbol id=\"zoom-in\" viewBox=\"64 64 896 896\">\n <path d=\"M637 443H519V309c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v134H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h118v134c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V519h118c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z\"></path>\n </symbol>\n <symbol id=\"zoom-out\" viewBox=\"64 64 896 896\">\n <path d=\"M637 443H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h312c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z\"></path>\n </symbol>\n <symbol id=\"edit\" viewBox=\"64 64 896 896\">\n <path d=\"M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z\"></path>\n </symbol>\n <symbol id=\"delete\" viewBox=\"64 64 896 896\">\n <path d=\"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z\"></path>\n </symbol>\n <symbol id=\"redo\" viewBox=\"64 64 896 896\">\n <path d=\"M758.2 839.1C851.8 765.9 912 651.9 912 523.9 912 303 733.5 124.3 512.6 124 291.4 123.7 112 302.8 112 523.9c0 125.2 57.5 236.9 147.6 310.2 3.5 2.8 8.6 2.2 11.4-1.3l39.4-50.5c2.7-3.4 2.1-8.3-1.2-11.1-8.1-6.6-15.9-13.7-23.4-21.2a318.64 318.64 0 01-68.6-101.7C200.4 609 192 567.1 192 523.9s8.4-85.1 25.1-124.5c16.1-38.1 39.2-72.3 68.6-101.7 29.4-29.4 63.6-52.5 101.7-68.6C426.9 212.4 468.8 204 512 204s85.1 8.4 124.5 25.1c38.1 16.1 72.3 39.2 101.7 68.6 29.4 29.4 52.5 63.6 68.6 101.7 16.7 39.4 25.1 81.3 25.1 124.5s-8.4 85.1-25.1 124.5a318.64 318.64 0 01-68.6 101.7c-9.3 9.3-19.1 18-29.3 26L668.2 724a8 8 0 00-14.1 3l-39.6 162.2c-1.2 5 2.6 9.9 7.7 9.9l167 .8c6.7 0 10.5-7.7 6.3-12.9l-37.3-47.9z\"></path>\n </symbol>\n <symbol id=\"undo\" viewBox=\"64 64 896 896\">\n <path d=\"M511.4 124C290.5 124.3 112 303 112 523.9c0 128 60.2 242 153.8 315.2l-37.5 48c-4.1 5.3-.3 13 6.3 12.9l167-.8c5.2 0 9-4.9 7.7-9.9L369.8 727a8 8 0 00-14.1-3L315 776.1c-10.2-8-20-16.7-29.3-26a318.64 318.64 0 01-68.6-101.7C200.4 609 192 567.1 192 523.9s8.4-85.1 25.1-124.5c16.1-38.1 39.2-72.3 68.6-101.7 29.4-29.4 63.6-52.5 101.7-68.6C426.9 212.4 468.8 204 512 204s85.1 8.4 124.5 25.1c38.1 16.1 72.3 39.2 101.7 68.6 29.4 29.4 52.5 63.6 68.6 101.7 16.7 39.4 25.1 81.3 25.1 124.5s-8.4 85.1-25.1 124.5a318.64 318.64 0 01-68.6 101.7c-7.5 7.5-15.3 14.5-23.4 21.2a7.93 7.93 0 00-1.2 11.1l39.4 50.5c2.8 3.5 7.9 4.1 11.4 1.3C854.5 760.8 912 649.1 912 523.9c0-221.1-179.4-400.2-400.6-399.9z\"></path>\n </symbol>\n <symbol id=\"export\" viewBox=\"64 64 896 896\">\n <path d=\"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM770.87 199.13l-52.2-52.2a8.01 8.01 0 014.7-13.6l179.4-21c5.1-.6 9.5 3.7 8.9 8.9l-21 179.4c-.8 6.6-8.9 9.4-13.6 4.7l-52.4-52.4-256.2 256.2a8.03 8.03 0 01-11.3 0l-42.4-42.4a8.03 8.03 0 010-11.3l256.1-256.3z\"></path>\n </symbol>\n <symbol id=\"auto-fit\" viewBox=\"64 64 896 896\">\n <path d=\"M952 474H829.8C812.5 327.6 696.4 211.5 550 194.2V72c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v122.2C327.6 211.5 211.5 327.6 194.2 474H72c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h122.2C211.5 696.4 327.6 812.5 474 829.8V952c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V829.8C696.4 812.5 812.5 696.4 829.8 550H952c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zM512 756c-134.8 0-244-109.2-244-244s109.2-244 244-244 244 109.2 244 244-109.2 244-244 244z\"></path>\n <path d=\"M512 392c-32.1 0-62.1 12.4-84.8 35.2-22.7 22.7-35.2 52.7-35.2 84.8s12.5 62.1 35.2 84.8C449.9 619.4 480 632 512 632s62.1-12.5 84.8-35.2C619.4 574.1 632 544 632 512s-12.5-62.1-35.2-84.8A118.57 118.57 0 00512 392z\"></path>\n </symbol>\n <symbol id=\"reset\" viewBox=\"64 64 896 896\">\n <path d=\"M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z\"></path>\n </symbol>\n </svg>\n";
|
|
@@ -22,7 +22,7 @@ export declare class Tooltip extends BasePlugin<TooltipOptions> {
|
|
|
22
22
|
};
|
|
23
23
|
update(options: Partial<TooltipOptions>): void;
|
|
24
24
|
private render;
|
|
25
|
-
private
|
|
25
|
+
private unbindEvents;
|
|
26
26
|
private bindEvents;
|
|
27
27
|
private isEnable;
|
|
28
28
|
onClick: (e: ElementEvent) => void;
|
|
@@ -14,7 +14,7 @@ export declare class ElementController {
|
|
|
14
14
|
private emit;
|
|
15
15
|
private forEachElementData;
|
|
16
16
|
private getTheme;
|
|
17
|
-
getThemeStyle(elementType: ElementType): import("
|
|
17
|
+
getThemeStyle(elementType: ElementType): import("src/spec/element/node").NodeStyle | import("src/spec/element/edge").EdgeStyle | import("src/spec/element/combo").ComboStyle;
|
|
18
18
|
getThemeStateStyle(elementType: ElementType, states: State[]): any;
|
|
19
19
|
private paletteStyle;
|
|
20
20
|
private computePaletteStyle;
|
|
@@ -57,7 +57,7 @@ export declare class ElementController {
|
|
|
57
57
|
private computeStyle;
|
|
58
58
|
getElement<T extends DisplayObject = BaseShape<any>>(id: ID): T | undefined;
|
|
59
59
|
getNodes(): Node[];
|
|
60
|
-
getEdges(): import("
|
|
60
|
+
getEdges(): import("src").BaseEdge[];
|
|
61
61
|
getCombos(): Combo[];
|
|
62
62
|
private getAnimation;
|
|
63
63
|
private getAnimationExecutor;
|
|
@@ -11,3 +11,13 @@ export declare function sizeOf(container: HTMLElement): [number, number];
|
|
|
11
11
|
* @returns plugin DOM element
|
|
12
12
|
*/
|
|
13
13
|
export declare function createPluginContainer(type: string, cover?: boolean): HTMLDivElement;
|
|
14
|
+
/**
|
|
15
|
+
* Create a DOM element, if exists, remove it and create a new one.
|
|
16
|
+
* @param id - id
|
|
17
|
+
* @param tag - tag
|
|
18
|
+
* @param style - style
|
|
19
|
+
* @param innerHTML - innerHTML
|
|
20
|
+
* @param container - container
|
|
21
|
+
* @returns new DOM element
|
|
22
|
+
*/
|
|
23
|
+
export declare function insertDOM(id: string, tag?: string, style?: Partial<CSSStyleDeclaration>, innerHTML?: string, container?: HTMLElement): HTMLElement;
|
|
@@ -200,3 +200,9 @@ export declare function isVisible(element: DisplayObject): boolean;
|
|
|
200
200
|
* @param style - <zh/> 样式 | <en/> style
|
|
201
201
|
*/
|
|
202
202
|
export declare function updateStyle<T extends DisplayObject>(shape: T, style: Record<string, unknown>): void;
|
|
203
|
+
/**
|
|
204
|
+
* Get Hexagon PathArray
|
|
205
|
+
* @param outerR - <zh/> 外接圆半径 | <en/> the radius of circumscribed circle
|
|
206
|
+
* @returns The PathArray for G
|
|
207
|
+
*/
|
|
208
|
+
export declare function getHexagonPoints(outerR: number): Point[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ID } from '@antv/graphlib';
|
|
2
|
-
import type { ComboData, EdgeData, NodeData } from '../spec';
|
|
2
|
+
import type { ComboData, EdgeData, GraphData, NodeData } from '../spec';
|
|
3
3
|
/**
|
|
4
4
|
* <zh/> 获取节点/边/Combo 的 ID
|
|
5
5
|
*
|
|
@@ -16,3 +16,11 @@ export declare function idOf(data: Partial<NodeData | EdgeData | ComboData>): ID
|
|
|
16
16
|
* @returns <zh/> 节点/Combo 的父节点 ID | <en/> parent id of node/combo
|
|
17
17
|
*/
|
|
18
18
|
export declare function parentIdOf(data: Partial<NodeData | ComboData>): ID | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* <zh/> 获取图数据中所有节点/边/Combo 的 ID
|
|
21
|
+
*
|
|
22
|
+
* <en/> Get the IDs of all nodes/edges/combos in the graph data
|
|
23
|
+
* @param data - <zh/> 图数据 | <en/> graph data
|
|
24
|
+
* @returns - <zh/> 返回元素 ID 数组 | <en/> Returns an array of element IDs
|
|
25
|
+
*/
|
|
26
|
+
export declare function getIds(data: GraphData): ID[];
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ID } from '@antv/graphlib';
|
|
2
|
+
import type { Graph } from '../runtime/graph';
|
|
3
|
+
import type { ElementType } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* <zh/> 获取指定元素在 n 度关系内的所有元素的 ID
|
|
6
|
+
*
|
|
7
|
+
* <en/> Get the IDs of all elements within an n-degree relationship from the specified element
|
|
8
|
+
* @description
|
|
9
|
+
* <zh/> 对于节点,0 度关系是节点本身,1 度关系包括节点的直接相邻节点和边,以此类推。
|
|
10
|
+
* 对于边,0 度关系是边本身,1 度关系包括边本身及其两个端点,以此类推。
|
|
11
|
+
*
|
|
12
|
+
* <en/> For a node, 0-degree relationship includes the node itself; 1-degree relationship includes the node's direct neighbors and their connecting edges, etc.
|
|
13
|
+
* For an edge, 0-degree relationship includes the edge itself; 1-degree relationship includes the edge and its two endpoints, etc
|
|
14
|
+
* @param graph - <zh/> 图实例 | <en/> graph instance
|
|
15
|
+
* @param elementType - <zh/> 元素类型 | <en/> element type
|
|
16
|
+
* @param elementId - <zh/> 起始元素的 ID | <en/> start element ID
|
|
17
|
+
* @param degree - <zh/> 指定的度数 | <en/> the specified degree
|
|
18
|
+
* @returns - <zh/> 返回节点和边的 ID 数组 | <en/> Returns an array of node and edge IDs
|
|
19
|
+
*/
|
|
20
|
+
export declare function getElementNthDegreeIds(graph: Graph, elementType: ElementType, elementId: ID, degree: number): ID[];
|
|
21
|
+
/**
|
|
22
|
+
* <zh/> 获取指定节点在 n 度关系内的所有元素的 ID
|
|
23
|
+
*
|
|
24
|
+
* <en/> Get all elements IDs within n-degree relationship of the specified node
|
|
25
|
+
* @description
|
|
26
|
+
* <zh/> 节点的 0 度关系是节点本身,1 度关系是节点的直接相邻节点和边,以此类推
|
|
27
|
+
*
|
|
28
|
+
* <en/> 0-degree relationship of a node is the node itself; 1-degree relationship is the node's neighboring nodes and related edges, etc
|
|
29
|
+
* @param graph - <zh/> 图实例 | <en/> graph instance
|
|
30
|
+
* @param startNodeId - <zh/> 起始节点的 ID | <en/> The ID of the starting node
|
|
31
|
+
* @param degree - <zh/> 指定的度数 | <en/> The specified degree
|
|
32
|
+
* @returns - <zh/> 返回节点和边的 ID 数组 | <en/> Returns an array of node and edge IDs
|
|
33
|
+
*/
|
|
34
|
+
export declare function getNodeNthDegreeIds(graph: Graph, startNodeId: ID, degree: number): ID[];
|
|
@@ -12,3 +12,12 @@ export type HierarchyStructure<T> = T & {
|
|
|
12
12
|
* @param depth - <zh/> 当前深度 | <en/> current depth
|
|
13
13
|
*/
|
|
14
14
|
export declare function dfs<N>(node: N, visitor: (node: N, depth: number) => void, navigator: (node: N) => N[] | undefined, mode: 'BT' | 'TB', depth?: number): void;
|
|
15
|
+
/**
|
|
16
|
+
* <zh/> 执行广度优先遍历
|
|
17
|
+
*
|
|
18
|
+
* <en/> perform breadth first traversal
|
|
19
|
+
* @param node - <zh/> 起始节点 | <en/> start node
|
|
20
|
+
* @param visitor - <zh/> 访问节点函数 | <en/> visitor function
|
|
21
|
+
* @param navigator - <zh/> 获取子节点函数 | <en/> get children function
|
|
22
|
+
*/
|
|
23
|
+
export declare function bfs<N>(node: N, visitor: (node: N, depth: number) => void, navigator: (node: N) => N[] | undefined): void;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { FederatedMouseEvent } from '@antv/g';
|
|
2
|
+
import type { RuntimeContext } from '../runtime/types';
|
|
3
|
+
import type { BehaviorEvent, ViewportAnimationEffectTiming } from '../types';
|
|
4
|
+
import type { BaseBehaviorOptions } from './base-behavior';
|
|
5
|
+
import { BaseBehavior } from './base-behavior';
|
|
6
|
+
export interface FocusElementOptions extends BaseBehaviorOptions {
|
|
7
|
+
/**
|
|
8
|
+
* <zh/> 是否启用动画以及动画配置
|
|
9
|
+
*
|
|
10
|
+
* <en/> Whether to enable animation
|
|
11
|
+
*/
|
|
12
|
+
animation?: ViewportAnimationEffectTiming;
|
|
13
|
+
/**
|
|
14
|
+
* <zh/> 是否启用聚焦功能
|
|
15
|
+
*
|
|
16
|
+
* <en/> Whether to enable the function of dragging the node
|
|
17
|
+
*/
|
|
18
|
+
enable?: boolean | ((event: BehaviorEvent<FederatedMouseEvent> | BehaviorEvent<KeyboardEvent>) => boolean);
|
|
19
|
+
}
|
|
20
|
+
export declare class FocusElement extends BaseBehavior<FocusElementOptions> {
|
|
21
|
+
static defaultOptions: Partial<FocusElementOptions>;
|
|
22
|
+
constructor(context: RuntimeContext, options: FocusElementOptions);
|
|
23
|
+
private bindEvents;
|
|
24
|
+
private getSelectedNodeIDs;
|
|
25
|
+
private clickFocusElement;
|
|
26
|
+
private validate;
|
|
27
|
+
private unbindEvents;
|
|
28
|
+
destroy(): void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { isFunction } from '@antv/util';
|
|
2
|
+
import { CommonEvent } from '../constants';
|
|
3
|
+
import { BaseBehavior } from './base-behavior';
|
|
4
|
+
const FOCUS_ELEMENT_TYPES = ['node', 'combo'];
|
|
5
|
+
export class FocusElement extends BaseBehavior {
|
|
6
|
+
static defaultOptions = {
|
|
7
|
+
animation: {
|
|
8
|
+
easing: 'ease-in',
|
|
9
|
+
duration: 500,
|
|
10
|
+
},
|
|
11
|
+
enable: true,
|
|
12
|
+
};
|
|
13
|
+
constructor(context, options) {
|
|
14
|
+
super(context, Object.assign({}, FocusElement.defaultOptions, options));
|
|
15
|
+
this.bindEvents();
|
|
16
|
+
}
|
|
17
|
+
bindEvents() {
|
|
18
|
+
const { graph } = this.context;
|
|
19
|
+
this.unbindEvents();
|
|
20
|
+
FOCUS_ELEMENT_TYPES.forEach((type) => {
|
|
21
|
+
graph.on(`${type}:${CommonEvent.CLICK}`, this.clickFocusElement);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
getSelectedNodeIDs(currTarget) {
|
|
25
|
+
return Array.from(new Set(this.context.graph
|
|
26
|
+
.getElementDataByState('node', this.options.state)
|
|
27
|
+
.map((node) => node.id)
|
|
28
|
+
.concat(currTarget)));
|
|
29
|
+
}
|
|
30
|
+
clickFocusElement = async (event) => {
|
|
31
|
+
if (!this.validate(event))
|
|
32
|
+
return;
|
|
33
|
+
const { animation } = this.options;
|
|
34
|
+
const { graph } = this.context;
|
|
35
|
+
const id = this.getSelectedNodeIDs([event.target.id]);
|
|
36
|
+
await graph.focusElement(id, animation);
|
|
37
|
+
};
|
|
38
|
+
validate(event) {
|
|
39
|
+
if (this.destroyed)
|
|
40
|
+
return false;
|
|
41
|
+
const { enable } = this.options;
|
|
42
|
+
if (isFunction(enable))
|
|
43
|
+
return enable(event);
|
|
44
|
+
return !!enable;
|
|
45
|
+
}
|
|
46
|
+
unbindEvents() {
|
|
47
|
+
const { graph } = this.context;
|
|
48
|
+
FOCUS_ELEMENT_TYPES.forEach((type) => {
|
|
49
|
+
graph.off(`${type}:${CommonEvent.CLICK}`, this.clickFocusElement);
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
destroy() {
|
|
53
|
+
this.unbindEvents();
|
|
54
|
+
super.destroy();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=focus-element.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"focus-element.js","sourceRoot":"src/","sources":["behaviors/focus-element.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAI3C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAiB9C,MAAM,OAAO,YAAa,SAAQ,YAAiC;IACjE,MAAM,CAAC,cAAc,GAAiC;QACpD,SAAS,EAAE;YACT,MAAM,EAAE,SAAS;YACjB,QAAQ,EAAE,GAAG;SACd;QACD,MAAM,EAAE,IAAI;KACb,CAAC;IAEF,YAAY,OAAuB,EAAE,OAA4B;QAC/D,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,YAAY,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC,CAAC;QACxE,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;IAEO,UAAU;QAChB,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC;QAC/B,IAAI,CAAC,YAAY,EAAE,CAAC;QAEpB,mBAAmB,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YACnC,KAAK,CAAC,EAAE,CAAC,GAAG,IAAI,IAAI,WAAW,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC;QACnE,CAAC,CAAC,CAAC;IACL,CAAC;IAEO,kBAAkB,CAAC,UAAgB;QACzC,OAAO,KAAK,CAAC,IAAI,CACf,IAAI,GAAG,CACL,IAAI,CAAC,OAAO,CAAC,KAAK;aACf,qBAAqB,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;aACjD,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;aACtB,MAAM,CAAC,UAAU,CAAC,CACtB,CACF,CAAC;IACJ,CAAC;IAEO,iBAAiB,GAAG,KAAK,EAAE,KAAyC,EAAE,EAAE;QAC9E,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;YAAE,OAAO;QAClC,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC;QACnC,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC;QAC/B,MAAM,EAAE,GAAG,IAAI,CAAC,kBAAkB,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;QAEtD,MAAM,KAAK,CAAC,YAAY,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;IAC1C,CAAC,CAAC;IAEM,QAAQ,CAAC,KAAyC;QACxD,IAAI,IAAI,CAAC,SAAS;YAAE,OAAO,KAAK,CAAC;QACjC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC;QAChC,IAAI,UAAU,CAAC,MAAM,CAAC;YAAE,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;QAC7C,OAAO,CAAC,CAAC,MAAM,CAAC;IAClB,CAAC;IAEO,YAAY;QAClB,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC;QAE/B,mBAAmB,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YACnC,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,IAAI,WAAW,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC;QACpE,CAAC,CAAC,CAAC;IACL,CAAC;IAEM,OAAO;QACZ,IAAI,CAAC,YAAY,EAAE,CAAC;QACpB,KAAK,CAAC,OAAO,EAAE,CAAC;IAClB,CAAC"}
|