@antv/g6 5.0.43 → 5.0.45
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 +19 -19
- package/dist/lib/layouts/types.d.ts +2 -2
- package/dist/lib/plugins/edge-filter-lens/index.d.ts +2 -2
- package/dist/lib/plugins/grid-line.d.ts +19 -1
- package/dist/lib/plugins/hull/hull/format.d.ts +9 -0
- package/dist/lib/plugins/hull/hull/grid_handle.d.ts +15 -0
- package/dist/lib/plugins/hull/hull/index.d.ts +3 -0
- package/dist/lib/plugins/hull/hull/monotone-convex-hull-2d.d.ts +2 -0
- package/dist/lib/plugins/hull/hull/robust-orientation.d.ts +2 -0
- package/dist/lib/plugins/hull/hull/robust-scale.d.ts +1 -0
- package/dist/lib/plugins/hull/hull/robust-segment-intersect.d.ts +2 -0
- package/dist/lib/plugins/hull/hull/robust-subtract.d.ts +1 -0
- package/dist/lib/plugins/hull/hull/robust-sum.d.ts +1 -0
- package/dist/lib/plugins/hull/hull/two-product.d.ts +1 -0
- package/dist/lib/plugins/hull/hull/two-sum.d.ts +1 -0
- package/dist/lib/plugins/toolbar/util.d.ts +4 -0
- package/dist/lib/runtime/graph.d.ts +24 -0
- package/dist/lib/transforms/process-parallel-edges.d.ts +14 -2
- package/dist/lib/utils/element.d.ts +9 -9
- package/dist/lib/utils/pinch.d.ts +47 -3
- package/dist/lib/utils/shortcut.d.ts +3 -1
- package/dist/lib/version.d.ts +1 -1
- package/esm/animations/executor.js.map +1 -1
- package/esm/animations/index.js.map +1 -1
- package/esm/animations/types.js.map +1 -1
- package/esm/behaviors/auto-adapt-label.js.map +1 -1
- package/esm/behaviors/base-behavior.js.map +1 -1
- package/esm/behaviors/brush-select.js.map +1 -1
- package/esm/behaviors/click-select.js.map +1 -1
- package/esm/behaviors/collapse-expand.js.map +1 -1
- package/esm/behaviors/create-edge.js.map +1 -1
- package/esm/behaviors/drag-canvas.js +2 -1
- package/esm/behaviors/drag-canvas.js.map +1 -1
- package/esm/behaviors/drag-element-force.js.map +1 -1
- package/esm/behaviors/drag-element.js.map +1 -1
- package/esm/behaviors/fix-element-size.js.map +1 -1
- package/esm/behaviors/focus-element.js.map +1 -1
- package/esm/behaviors/hover-activate.js.map +1 -1
- package/esm/behaviors/index.js.map +1 -1
- package/esm/behaviors/lasso-select.js.map +1 -1
- package/esm/behaviors/optimize-viewport-transform.js.map +1 -1
- package/esm/behaviors/scroll-canvas.js.map +1 -1
- package/esm/behaviors/types.js.map +1 -1
- package/esm/behaviors/zoom-canvas.js.map +1 -1
- package/esm/constants/animation.js.map +1 -1
- package/esm/constants/change.js.map +1 -1
- package/esm/constants/element.js.map +1 -1
- package/esm/constants/events/animation.js.map +1 -1
- package/esm/constants/events/canvas.js.map +1 -1
- package/esm/constants/events/combo.js.map +1 -1
- package/esm/constants/events/common.js.map +1 -1
- package/esm/constants/events/container.js.map +1 -1
- package/esm/constants/events/edge.js.map +1 -1
- package/esm/constants/events/graph.js.map +1 -1
- package/esm/constants/events/history.js.map +1 -1
- package/esm/constants/events/index.js.map +1 -1
- package/esm/constants/events/node.js.map +1 -1
- package/esm/constants/graphlib.js.map +1 -1
- package/esm/constants/index.js.map +1 -1
- package/esm/constants/registry.js.map +1 -1
- package/esm/elements/base-element.js.map +1 -1
- package/esm/elements/combos/base-combo.js.map +1 -1
- package/esm/elements/combos/circle.js.map +1 -1
- package/esm/elements/combos/index.js.map +1 -1
- package/esm/elements/combos/rect.js.map +1 -1
- package/esm/elements/edges/base-edge.js.map +1 -1
- package/esm/elements/edges/cubic-horizontal.js.map +1 -1
- package/esm/elements/edges/cubic-radial.js.map +1 -1
- package/esm/elements/edges/cubic-vertical.js.map +1 -1
- package/esm/elements/edges/cubic.js.map +1 -1
- package/esm/elements/edges/index.js.map +1 -1
- package/esm/elements/edges/line.js.map +1 -1
- package/esm/elements/edges/polyline.js.map +1 -1
- package/esm/elements/edges/quadratic.js.map +1 -1
- package/esm/elements/effect.js.map +1 -1
- package/esm/elements/index.js.map +1 -1
- package/esm/elements/nodes/base-node.js.map +1 -1
- package/esm/elements/nodes/circle.js.map +1 -1
- package/esm/elements/nodes/diamond.js.map +1 -1
- package/esm/elements/nodes/donut.js.map +1 -1
- package/esm/elements/nodes/ellipse.js.map +1 -1
- package/esm/elements/nodes/hexagon.js.map +1 -1
- package/esm/elements/nodes/html.js.map +1 -1
- package/esm/elements/nodes/image.js.map +1 -1
- package/esm/elements/nodes/index.js.map +1 -1
- package/esm/elements/nodes/rect.js.map +1 -1
- package/esm/elements/nodes/star.js.map +1 -1
- package/esm/elements/nodes/triangle.js.map +1 -1
- package/esm/elements/shapes/badge.js.map +1 -1
- package/esm/elements/shapes/base-shape.js.map +1 -1
- package/esm/elements/shapes/contour.js.map +1 -1
- package/esm/elements/shapes/icon.js.map +1 -1
- package/esm/elements/shapes/image.js.map +1 -1
- package/esm/elements/shapes/index.js.map +1 -1
- package/esm/elements/shapes/label.js.map +1 -1
- package/esm/elements/shapes/polygon.js.map +1 -1
- package/esm/exports.js.map +1 -1
- package/esm/index.js.map +1 -1
- package/esm/layouts/base-layout.js.map +1 -1
- package/esm/layouts/fishbone.js.map +1 -1
- package/esm/layouts/index.js.map +1 -1
- package/esm/layouts/snake.js.map +1 -1
- package/esm/layouts/types.d.ts +2 -2
- package/esm/layouts/types.js.map +1 -1
- package/esm/palettes/index.js.map +1 -1
- package/esm/palettes/types.js.map +1 -1
- package/esm/plugins/background/index.js.map +1 -1
- package/esm/plugins/base-plugin.js.map +1 -1
- package/esm/plugins/bubble-sets.js.map +1 -1
- package/esm/plugins/camera-setting.js.map +1 -1
- package/esm/plugins/contextmenu/index.js.map +1 -1
- package/esm/plugins/contextmenu/util.js.map +1 -1
- package/esm/plugins/edge-bundling/index.js.map +1 -1
- package/esm/plugins/edge-filter-lens/index.d.ts +2 -2
- package/esm/plugins/edge-filter-lens/index.js +2 -0
- package/esm/plugins/edge-filter-lens/index.js.map +1 -1
- package/esm/plugins/fisheye/index.js +3 -0
- package/esm/plugins/fisheye/index.js.map +1 -1
- package/esm/plugins/fullscreen/index.js.map +1 -1
- package/esm/plugins/grid-line.d.ts +19 -1
- package/esm/plugins/grid-line.js +42 -5
- package/esm/plugins/grid-line.js.map +1 -1
- package/esm/plugins/history/index.js.map +1 -1
- package/esm/plugins/history/util.js.map +1 -1
- package/esm/plugins/hull/hull/format.d.ts +9 -0
- package/esm/plugins/hull/hull/format.js +20 -0
- package/esm/plugins/hull/hull/format.js.map +1 -0
- package/esm/plugins/hull/hull/grid_handle.d.ts +15 -0
- package/esm/plugins/hull/hull/grid_handle.js +66 -0
- package/esm/plugins/hull/hull/grid_handle.js.map +1 -0
- package/esm/plugins/hull/hull/index.d.ts +3 -0
- package/esm/plugins/hull/hull/index.js +150 -0
- package/esm/plugins/hull/hull/index.js.map +1 -0
- package/esm/plugins/hull/hull/monotone-convex-hull-2d.d.ts +2 -0
- package/esm/plugins/hull/hull/monotone-convex-hull-2d.js +63 -0
- package/esm/plugins/hull/hull/monotone-convex-hull-2d.js.map +1 -0
- package/esm/plugins/hull/hull/robust-orientation.d.ts +2 -0
- package/esm/plugins/hull/hull/robust-orientation.js +145 -0
- package/esm/plugins/hull/hull/robust-orientation.js.map +1 -0
- package/esm/plugins/hull/hull/robust-scale.d.ts +1 -0
- package/esm/plugins/hull/hull/robust-scale.js +47 -0
- package/esm/plugins/hull/hull/robust-scale.js.map +1 -0
- package/esm/plugins/hull/hull/robust-segment-intersect.d.ts +2 -0
- package/esm/plugins/hull/hull/robust-segment-intersect.js +29 -0
- package/esm/plugins/hull/hull/robust-segment-intersect.js.map +1 -0
- package/esm/plugins/hull/hull/robust-subtract.d.ts +1 -0
- package/esm/plugins/hull/hull/robust-subtract.js +161 -0
- package/esm/plugins/hull/hull/robust-subtract.js.map +1 -0
- package/esm/plugins/hull/hull/robust-sum.d.ts +1 -0
- package/esm/plugins/hull/hull/robust-sum.js +155 -0
- package/esm/plugins/hull/hull/robust-sum.js.map +1 -0
- package/esm/plugins/hull/hull/two-product.d.ts +1 -0
- package/esm/plugins/hull/hull/two-product.js +24 -0
- package/esm/plugins/hull/hull/two-product.js.map +1 -0
- package/esm/plugins/hull/hull/two-sum.d.ts +1 -0
- package/esm/plugins/hull/hull/two-sum.js +15 -0
- package/esm/plugins/hull/hull/two-sum.js.map +1 -0
- package/esm/plugins/hull/index.js +1 -1
- package/esm/plugins/hull/index.js.map +1 -1
- package/esm/plugins/hull/util.js.map +1 -1
- package/esm/plugins/index.js.map +1 -1
- package/esm/plugins/legend.js.map +1 -1
- package/esm/plugins/minimap/index.js +1 -1
- package/esm/plugins/minimap/index.js.map +1 -1
- package/esm/plugins/snapline/index.js.map +1 -1
- package/esm/plugins/timebar.js.map +1 -1
- package/esm/plugins/toolbar/index.js +6 -3
- package/esm/plugins/toolbar/index.js.map +1 -1
- package/esm/plugins/toolbar/util.d.ts +4 -0
- package/esm/plugins/toolbar/util.js.map +1 -1
- package/esm/plugins/tooltip.js.map +1 -1
- package/esm/plugins/types.js.map +1 -1
- package/esm/plugins/utils/canvas.js.map +1 -1
- package/esm/plugins/utils/dom.js.map +1 -1
- package/esm/plugins/watermark/index.js.map +1 -1
- package/esm/plugins/watermark/util.js.map +1 -1
- package/esm/preset.js.map +1 -1
- package/esm/registry/build-in.js.map +1 -1
- package/esm/registry/extension/index.js.map +1 -1
- package/esm/registry/extension/types.js.map +1 -1
- package/esm/registry/get.js.map +1 -1
- package/esm/registry/register.js.map +1 -1
- package/esm/registry/store.js.map +1 -1
- package/esm/registry/types.js.map +1 -1
- package/esm/runtime/animation.js.map +1 -1
- package/esm/runtime/batch.js.map +1 -1
- package/esm/runtime/behavior.js.map +1 -1
- package/esm/runtime/canvas.js.map +1 -1
- package/esm/runtime/data.js.map +1 -1
- package/esm/runtime/element.js.map +1 -1
- package/esm/runtime/graph.d.ts +24 -0
- package/esm/runtime/graph.js +4 -7
- package/esm/runtime/graph.js.map +1 -1
- package/esm/runtime/layout.js +4 -4
- package/esm/runtime/layout.js.map +1 -1
- package/esm/runtime/options.js.map +1 -1
- package/esm/runtime/plugin.js.map +1 -1
- package/esm/runtime/transform.js.map +1 -1
- package/esm/runtime/types.js.map +1 -1
- package/esm/runtime/viewport.js.map +1 -1
- package/esm/spec/behavior.js.map +1 -1
- package/esm/spec/canvas.js.map +1 -1
- package/esm/spec/data.js.map +1 -1
- package/esm/spec/element/animation.js.map +1 -1
- package/esm/spec/element/combo.js.map +1 -1
- package/esm/spec/element/edge.js.map +1 -1
- package/esm/spec/element/node.js.map +1 -1
- package/esm/spec/element/palette.js.map +1 -1
- package/esm/spec/graph.js.map +1 -1
- package/esm/spec/index.js.map +1 -1
- package/esm/spec/layout.js.map +1 -1
- package/esm/spec/plugin.js.map +1 -1
- package/esm/spec/theme.js.map +1 -1
- package/esm/spec/transform.js.map +1 -1
- package/esm/spec/viewport.js.map +1 -1
- package/esm/themes/base.js.map +1 -1
- package/esm/themes/dark.js.map +1 -1
- package/esm/themes/index.js.map +1 -1
- package/esm/themes/light.js.map +1 -1
- package/esm/themes/types.js.map +1 -1
- package/esm/transforms/arrange-draw-order.js.map +1 -1
- package/esm/transforms/base-transform.js.map +1 -1
- package/esm/transforms/collapse-expand-combo.js.map +1 -1
- package/esm/transforms/collapse-expand-node.js.map +1 -1
- package/esm/transforms/get-edge-actual-ends.js.map +1 -1
- package/esm/transforms/index.js.map +1 -1
- package/esm/transforms/map-node-size.js.map +1 -1
- package/esm/transforms/place-radial-labels.js.map +1 -1
- package/esm/transforms/process-parallel-edges.d.ts +14 -2
- package/esm/transforms/process-parallel-edges.js +35 -10
- package/esm/transforms/process-parallel-edges.js.map +1 -1
- package/esm/transforms/types.js.map +1 -1
- package/esm/transforms/update-related-edge.js.map +1 -1
- package/esm/transforms/utils.js.map +1 -1
- package/esm/types/anchor.js.map +1 -1
- package/esm/types/animation.js.map +1 -1
- package/esm/types/canvas.js.map +1 -1
- package/esm/types/centrality.js.map +1 -1
- package/esm/types/change.js.map +1 -1
- package/esm/types/combo.js.map +1 -1
- package/esm/types/data.js.map +1 -1
- package/esm/types/edge.js.map +1 -1
- package/esm/types/element.js.map +1 -1
- package/esm/types/enum.js.map +1 -1
- package/esm/types/event.js.map +1 -1
- package/esm/types/graphlib.js.map +1 -1
- package/esm/types/history.js.map +1 -1
- package/esm/types/id.js.map +1 -1
- package/esm/types/index.js.map +1 -1
- package/esm/types/layout.js.map +1 -1
- package/esm/types/node.js.map +1 -1
- package/esm/types/padding.js.map +1 -1
- package/esm/types/placement.js.map +1 -1
- package/esm/types/plugin.js.map +1 -1
- package/esm/types/point.js.map +1 -1
- package/esm/types/prefix.js.map +1 -1
- package/esm/types/router.js.map +1 -1
- package/esm/types/size.js.map +1 -1
- package/esm/types/state.js.map +1 -1
- package/esm/types/style.js.map +1 -1
- package/esm/types/tree.js.map +1 -1
- package/esm/types/vector.js.map +1 -1
- package/esm/types/viewport.js.map +1 -1
- package/esm/utils/anchor.js.map +1 -1
- package/esm/utils/animation.js.map +1 -1
- package/esm/utils/array.js.map +1 -1
- package/esm/utils/bbox.js.map +1 -1
- package/esm/utils/cache.js.map +1 -1
- package/esm/utils/centrality.js.map +1 -1
- package/esm/utils/change.js.map +1 -1
- package/esm/utils/collapsibility.js.map +1 -1
- package/esm/utils/data.js.map +1 -1
- package/esm/utils/diff.js.map +1 -1
- package/esm/utils/dom.js.map +1 -1
- package/esm/utils/edge.js +5 -4
- package/esm/utils/edge.js.map +1 -1
- package/esm/utils/element.d.ts +9 -9
- package/esm/utils/element.js +30 -20
- package/esm/utils/element.js.map +1 -1
- package/esm/utils/event/events.js.map +1 -1
- package/esm/utils/event/index.js.map +1 -1
- package/esm/utils/extension.js.map +1 -1
- package/esm/utils/graphlib.js.map +1 -1
- package/esm/utils/id.js.map +1 -1
- package/esm/utils/is.js.map +1 -1
- package/esm/utils/layout.js.map +1 -1
- package/esm/utils/line.js.map +1 -1
- package/esm/utils/math.js.map +1 -1
- package/esm/utils/node.js.map +1 -1
- package/esm/utils/padding.js.map +1 -1
- package/esm/utils/palette.js.map +1 -1
- package/esm/utils/path.js.map +1 -1
- package/esm/utils/pinch.d.ts +47 -3
- package/esm/utils/pinch.js +57 -6
- package/esm/utils/pinch.js.map +1 -1
- package/esm/utils/placement.js.map +1 -1
- package/esm/utils/point.js.map +1 -1
- package/esm/utils/polygon.js.map +1 -1
- package/esm/utils/position.js.map +1 -1
- package/esm/utils/prefix.js.map +1 -1
- package/esm/utils/print.js.map +1 -1
- package/esm/utils/relation.js.map +1 -1
- package/esm/utils/router/orth.js.map +1 -1
- package/esm/utils/router/shortest-path.js.map +1 -1
- package/esm/utils/scale.js.map +1 -1
- package/esm/utils/shape.js.map +1 -1
- package/esm/utils/shortcut.d.ts +3 -1
- package/esm/utils/shortcut.js +4 -2
- package/esm/utils/shortcut.js.map +1 -1
- package/esm/utils/size.js.map +1 -1
- package/esm/utils/state.js.map +1 -1
- package/esm/utils/style.js.map +1 -1
- package/esm/utils/symbol.js.map +1 -1
- package/esm/utils/text.js.map +1 -1
- package/esm/utils/theme.js.map +1 -1
- package/esm/utils/transform.js.map +1 -1
- package/esm/utils/traverse.js.map +1 -1
- package/esm/utils/tree.js.map +1 -1
- package/esm/utils/vector.js.map +1 -1
- package/esm/utils/visibility.js.map +1 -1
- package/esm/utils/z-index.js.map +1 -1
- package/esm/version.d.ts +1 -1
- package/esm/version.js +1 -1
- package/esm/version.js.map +1 -1
- package/lib/animations/executor.js.map +1 -1
- package/lib/animations/index.js.map +1 -1
- package/lib/animations/types.js.map +1 -1
- package/lib/behaviors/auto-adapt-label.js.map +1 -1
- package/lib/behaviors/base-behavior.js.map +1 -1
- package/lib/behaviors/brush-select.js.map +1 -1
- package/lib/behaviors/click-select.js.map +1 -1
- package/lib/behaviors/collapse-expand.js.map +1 -1
- package/lib/behaviors/create-edge.js.map +1 -1
- package/lib/behaviors/drag-canvas.js +2 -1
- package/lib/behaviors/drag-canvas.js.map +1 -1
- package/lib/behaviors/drag-element-force.js.map +1 -1
- package/lib/behaviors/drag-element.js.map +1 -1
- package/lib/behaviors/fix-element-size.js.map +1 -1
- package/lib/behaviors/focus-element.js.map +1 -1
- package/lib/behaviors/hover-activate.js.map +1 -1
- package/lib/behaviors/index.js.map +1 -1
- package/lib/behaviors/lasso-select.js.map +1 -1
- package/lib/behaviors/optimize-viewport-transform.js.map +1 -1
- package/lib/behaviors/scroll-canvas.js.map +1 -1
- package/lib/behaviors/types.js.map +1 -1
- package/lib/behaviors/zoom-canvas.js.map +1 -1
- package/lib/constants/animation.js.map +1 -1
- package/lib/constants/change.js.map +1 -1
- package/lib/constants/element.js.map +1 -1
- package/lib/constants/events/animation.js.map +1 -1
- package/lib/constants/events/canvas.js.map +1 -1
- package/lib/constants/events/combo.js.map +1 -1
- package/lib/constants/events/common.js.map +1 -1
- package/lib/constants/events/container.js.map +1 -1
- package/lib/constants/events/edge.js.map +1 -1
- package/lib/constants/events/graph.js.map +1 -1
- package/lib/constants/events/history.js.map +1 -1
- package/lib/constants/events/index.js.map +1 -1
- package/lib/constants/events/node.js.map +1 -1
- package/lib/constants/graphlib.js.map +1 -1
- package/lib/constants/index.js.map +1 -1
- package/lib/constants/registry.js.map +1 -1
- package/lib/elements/base-element.js.map +1 -1
- package/lib/elements/combos/base-combo.js.map +1 -1
- package/lib/elements/combos/circle.js.map +1 -1
- package/lib/elements/combos/index.js.map +1 -1
- package/lib/elements/combos/rect.js.map +1 -1
- package/lib/elements/edges/base-edge.js.map +1 -1
- package/lib/elements/edges/cubic-horizontal.js.map +1 -1
- package/lib/elements/edges/cubic-radial.js.map +1 -1
- package/lib/elements/edges/cubic-vertical.js.map +1 -1
- package/lib/elements/edges/cubic.js.map +1 -1
- package/lib/elements/edges/index.js.map +1 -1
- package/lib/elements/edges/line.js.map +1 -1
- package/lib/elements/edges/polyline.js.map +1 -1
- package/lib/elements/edges/quadratic.js.map +1 -1
- package/lib/elements/effect.js.map +1 -1
- package/lib/elements/index.js.map +1 -1
- package/lib/elements/nodes/base-node.js.map +1 -1
- package/lib/elements/nodes/circle.js.map +1 -1
- package/lib/elements/nodes/diamond.js.map +1 -1
- package/lib/elements/nodes/donut.js.map +1 -1
- package/lib/elements/nodes/ellipse.js.map +1 -1
- package/lib/elements/nodes/hexagon.js.map +1 -1
- package/lib/elements/nodes/html.js.map +1 -1
- package/lib/elements/nodes/image.js.map +1 -1
- package/lib/elements/nodes/index.js.map +1 -1
- package/lib/elements/nodes/rect.js.map +1 -1
- package/lib/elements/nodes/star.js.map +1 -1
- package/lib/elements/nodes/triangle.js.map +1 -1
- package/lib/elements/shapes/badge.js.map +1 -1
- package/lib/elements/shapes/base-shape.js.map +1 -1
- package/lib/elements/shapes/contour.js.map +1 -1
- package/lib/elements/shapes/icon.js.map +1 -1
- package/lib/elements/shapes/image.js.map +1 -1
- package/lib/elements/shapes/index.js.map +1 -1
- package/lib/elements/shapes/label.js.map +1 -1
- package/lib/elements/shapes/polygon.js.map +1 -1
- package/lib/exports.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/layouts/base-layout.js.map +1 -1
- package/lib/layouts/fishbone.js.map +1 -1
- package/lib/layouts/index.js.map +1 -1
- package/lib/layouts/snake.js.map +1 -1
- package/lib/layouts/types.d.ts +2 -2
- package/lib/layouts/types.js.map +1 -1
- package/lib/palettes/index.js.map +1 -1
- package/lib/palettes/types.js.map +1 -1
- package/lib/plugins/background/index.js.map +1 -1
- package/lib/plugins/base-plugin.js.map +1 -1
- package/lib/plugins/bubble-sets.js.map +1 -1
- package/lib/plugins/camera-setting.js.map +1 -1
- package/lib/plugins/contextmenu/index.js.map +1 -1
- package/lib/plugins/contextmenu/util.js.map +1 -1
- package/lib/plugins/edge-bundling/index.js.map +1 -1
- package/lib/plugins/edge-filter-lens/index.d.ts +2 -2
- package/lib/plugins/edge-filter-lens/index.js +2 -0
- package/lib/plugins/edge-filter-lens/index.js.map +1 -1
- package/lib/plugins/fisheye/index.js +3 -0
- package/lib/plugins/fisheye/index.js.map +1 -1
- package/lib/plugins/fullscreen/index.js.map +1 -1
- package/lib/plugins/grid-line.d.ts +19 -1
- package/lib/plugins/grid-line.js +41 -4
- package/lib/plugins/grid-line.js.map +1 -1
- package/lib/plugins/history/index.js.map +1 -1
- package/lib/plugins/history/util.js.map +1 -1
- package/lib/plugins/hull/hull/format.d.ts +9 -0
- package/lib/plugins/hull/hull/format.js +23 -0
- package/lib/plugins/hull/hull/format.js.map +1 -0
- package/lib/plugins/hull/hull/grid_handle.d.ts +15 -0
- package/lib/plugins/hull/hull/grid_handle.js +71 -0
- package/lib/plugins/hull/hull/grid_handle.js.map +1 -0
- package/lib/plugins/hull/hull/index.d.ts +3 -0
- package/lib/plugins/hull/hull/index.js +153 -0
- package/lib/plugins/hull/hull/index.js.map +1 -0
- package/lib/plugins/hull/hull/monotone-convex-hull-2d.d.ts +2 -0
- package/lib/plugins/hull/hull/monotone-convex-hull-2d.js +68 -0
- package/lib/plugins/hull/hull/monotone-convex-hull-2d.js.map +1 -0
- package/lib/plugins/hull/hull/robust-orientation.d.ts +2 -0
- package/lib/plugins/hull/hull/robust-orientation.js +146 -0
- package/lib/plugins/hull/hull/robust-orientation.js.map +1 -0
- package/lib/plugins/hull/hull/robust-scale.d.ts +1 -0
- package/lib/plugins/hull/hull/robust-scale.js +49 -0
- package/lib/plugins/hull/hull/robust-scale.js.map +1 -0
- package/lib/plugins/hull/hull/robust-segment-intersect.d.ts +2 -0
- package/lib/plugins/hull/hull/robust-segment-intersect.js +35 -0
- package/lib/plugins/hull/hull/robust-segment-intersect.js.map +1 -0
- package/lib/plugins/hull/hull/robust-subtract.d.ts +1 -0
- package/lib/plugins/hull/hull/robust-subtract.js +163 -0
- package/lib/plugins/hull/hull/robust-subtract.js.map +1 -0
- package/lib/plugins/hull/hull/robust-sum.d.ts +1 -0
- package/lib/plugins/hull/hull/robust-sum.js +157 -0
- package/lib/plugins/hull/hull/robust-sum.js.map +1 -0
- package/lib/plugins/hull/hull/two-product.d.ts +1 -0
- package/lib/plugins/hull/hull/two-product.js +26 -0
- package/lib/plugins/hull/hull/two-product.js.map +1 -0
- package/lib/plugins/hull/hull/two-sum.d.ts +1 -0
- package/lib/plugins/hull/hull/two-sum.js +17 -0
- package/lib/plugins/hull/hull/two-sum.js.map +1 -0
- package/lib/plugins/hull/index.js +2 -5
- package/lib/plugins/hull/index.js.map +1 -1
- package/lib/plugins/hull/util.js.map +1 -1
- package/lib/plugins/index.js.map +1 -1
- package/lib/plugins/legend.js.map +1 -1
- package/lib/plugins/minimap/index.js +1 -1
- package/lib/plugins/minimap/index.js.map +1 -1
- package/lib/plugins/snapline/index.js.map +1 -1
- package/lib/plugins/timebar.js.map +1 -1
- package/lib/plugins/toolbar/index.js +6 -3
- package/lib/plugins/toolbar/index.js.map +1 -1
- package/lib/plugins/toolbar/util.d.ts +4 -0
- package/lib/plugins/toolbar/util.js.map +1 -1
- package/lib/plugins/tooltip.js.map +1 -1
- package/lib/plugins/types.js.map +1 -1
- package/lib/plugins/utils/canvas.js.map +1 -1
- package/lib/plugins/utils/dom.js.map +1 -1
- package/lib/plugins/watermark/index.js.map +1 -1
- package/lib/plugins/watermark/util.js.map +1 -1
- package/lib/preset.js.map +1 -1
- package/lib/registry/build-in.js.map +1 -1
- package/lib/registry/extension/index.js.map +1 -1
- package/lib/registry/extension/types.js.map +1 -1
- package/lib/registry/get.js.map +1 -1
- package/lib/registry/register.js.map +1 -1
- package/lib/registry/store.js.map +1 -1
- package/lib/registry/types.js.map +1 -1
- package/lib/runtime/animation.js.map +1 -1
- package/lib/runtime/batch.js.map +1 -1
- package/lib/runtime/behavior.js.map +1 -1
- package/lib/runtime/canvas.js.map +1 -1
- package/lib/runtime/data.js.map +1 -1
- package/lib/runtime/element.js.map +1 -1
- package/lib/runtime/graph.d.ts +24 -0
- package/lib/runtime/graph.js +4 -7
- package/lib/runtime/graph.js.map +1 -1
- package/lib/runtime/layout.js +4 -4
- package/lib/runtime/layout.js.map +1 -1
- package/lib/runtime/options.js.map +1 -1
- package/lib/runtime/plugin.js.map +1 -1
- package/lib/runtime/transform.js.map +1 -1
- package/lib/runtime/types.js.map +1 -1
- package/lib/runtime/viewport.js.map +1 -1
- package/lib/spec/behavior.js.map +1 -1
- package/lib/spec/canvas.js.map +1 -1
- package/lib/spec/data.js.map +1 -1
- package/lib/spec/element/animation.js.map +1 -1
- package/lib/spec/element/combo.js.map +1 -1
- package/lib/spec/element/edge.js.map +1 -1
- package/lib/spec/element/node.js.map +1 -1
- package/lib/spec/element/palette.js.map +1 -1
- package/lib/spec/graph.js.map +1 -1
- package/lib/spec/index.js.map +1 -1
- package/lib/spec/layout.js.map +1 -1
- package/lib/spec/plugin.js.map +1 -1
- package/lib/spec/theme.js.map +1 -1
- package/lib/spec/transform.js.map +1 -1
- package/lib/spec/viewport.js.map +1 -1
- package/lib/themes/base.js.map +1 -1
- package/lib/themes/dark.js.map +1 -1
- package/lib/themes/index.js.map +1 -1
- package/lib/themes/light.js.map +1 -1
- package/lib/themes/types.js.map +1 -1
- package/lib/transforms/arrange-draw-order.js.map +1 -1
- package/lib/transforms/base-transform.js.map +1 -1
- package/lib/transforms/collapse-expand-combo.js.map +1 -1
- package/lib/transforms/collapse-expand-node.js.map +1 -1
- package/lib/transforms/get-edge-actual-ends.js.map +1 -1
- package/lib/transforms/index.js.map +1 -1
- package/lib/transforms/map-node-size.js.map +1 -1
- package/lib/transforms/place-radial-labels.js.map +1 -1
- package/lib/transforms/process-parallel-edges.d.ts +14 -2
- package/lib/transforms/process-parallel-edges.js +35 -10
- package/lib/transforms/process-parallel-edges.js.map +1 -1
- package/lib/transforms/types.js.map +1 -1
- package/lib/transforms/update-related-edge.js.map +1 -1
- package/lib/transforms/utils.js.map +1 -1
- package/lib/types/anchor.js.map +1 -1
- package/lib/types/animation.js.map +1 -1
- package/lib/types/canvas.js.map +1 -1
- package/lib/types/centrality.js.map +1 -1
- package/lib/types/change.js.map +1 -1
- package/lib/types/combo.js.map +1 -1
- package/lib/types/data.js.map +1 -1
- package/lib/types/edge.js.map +1 -1
- package/lib/types/element.js.map +1 -1
- package/lib/types/enum.js.map +1 -1
- package/lib/types/event.js.map +1 -1
- package/lib/types/graphlib.js.map +1 -1
- package/lib/types/history.js.map +1 -1
- package/lib/types/id.js.map +1 -1
- package/lib/types/index.js.map +1 -1
- package/lib/types/layout.js.map +1 -1
- package/lib/types/node.js.map +1 -1
- package/lib/types/padding.js.map +1 -1
- package/lib/types/placement.js.map +1 -1
- package/lib/types/plugin.js.map +1 -1
- package/lib/types/point.js.map +1 -1
- package/lib/types/prefix.js.map +1 -1
- package/lib/types/router.js.map +1 -1
- package/lib/types/size.js.map +1 -1
- package/lib/types/state.js.map +1 -1
- package/lib/types/style.js.map +1 -1
- package/lib/types/tree.js.map +1 -1
- package/lib/types/vector.js.map +1 -1
- package/lib/types/viewport.js.map +1 -1
- package/lib/utils/anchor.js.map +1 -1
- package/lib/utils/animation.js.map +1 -1
- package/lib/utils/array.js.map +1 -1
- package/lib/utils/bbox.js.map +1 -1
- package/lib/utils/cache.js.map +1 -1
- package/lib/utils/centrality.js.map +1 -1
- package/lib/utils/change.js.map +1 -1
- package/lib/utils/collapsibility.js.map +1 -1
- package/lib/utils/data.js.map +1 -1
- package/lib/utils/diff.js.map +1 -1
- package/lib/utils/dom.js.map +1 -1
- package/lib/utils/edge.js +5 -4
- package/lib/utils/edge.js.map +1 -1
- package/lib/utils/element.d.ts +9 -9
- package/lib/utils/element.js +30 -20
- package/lib/utils/element.js.map +1 -1
- package/lib/utils/event/events.js.map +1 -1
- package/lib/utils/event/index.js.map +1 -1
- package/lib/utils/extension.js.map +1 -1
- package/lib/utils/graphlib.js.map +1 -1
- package/lib/utils/id.js.map +1 -1
- package/lib/utils/is.js.map +1 -1
- package/lib/utils/layout.js.map +1 -1
- package/lib/utils/line.js.map +1 -1
- package/lib/utils/math.js.map +1 -1
- package/lib/utils/node.js.map +1 -1
- package/lib/utils/padding.js.map +1 -1
- package/lib/utils/palette.js.map +1 -1
- package/lib/utils/path.js.map +1 -1
- package/lib/utils/pinch.d.ts +47 -3
- package/lib/utils/pinch.js +57 -6
- package/lib/utils/pinch.js.map +1 -1
- package/lib/utils/placement.js.map +1 -1
- package/lib/utils/point.js.map +1 -1
- package/lib/utils/polygon.js.map +1 -1
- package/lib/utils/position.js.map +1 -1
- package/lib/utils/prefix.js.map +1 -1
- package/lib/utils/print.js.map +1 -1
- package/lib/utils/relation.js.map +1 -1
- package/lib/utils/router/orth.js.map +1 -1
- package/lib/utils/router/shortest-path.js.map +1 -1
- package/lib/utils/scale.js.map +1 -1
- package/lib/utils/shape.js.map +1 -1
- package/lib/utils/shortcut.d.ts +3 -1
- package/lib/utils/shortcut.js +4 -2
- package/lib/utils/shortcut.js.map +1 -1
- package/lib/utils/size.js.map +1 -1
- package/lib/utils/state.js.map +1 -1
- package/lib/utils/style.js.map +1 -1
- package/lib/utils/symbol.js.map +1 -1
- package/lib/utils/text.js.map +1 -1
- package/lib/utils/theme.js.map +1 -1
- package/lib/utils/transform.js.map +1 -1
- package/lib/utils/traverse.js.map +1 -1
- package/lib/utils/tree.js.map +1 -1
- package/lib/utils/vector.js.map +1 -1
- package/lib/utils/visibility.js.map +1 -1
- package/lib/utils/z-index.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +3 -4
- package/src/behaviors/drag-canvas.ts +2 -1
- package/src/layouts/types.ts +2 -2
- package/src/plugins/edge-filter-lens/index.ts +4 -4
- package/src/plugins/fisheye/index.ts +2 -0
- package/src/plugins/grid-line.ts +72 -8
- package/src/plugins/hull/hull/README.md +1 -0
- package/src/plugins/hull/hull/format.ts +29 -0
- package/src/plugins/hull/hull/grid_handle.ts +73 -0
- package/src/plugins/hull/hull/index.ts +203 -0
- package/src/plugins/hull/hull/monotone-convex-hull-2d.ts +76 -0
- package/src/plugins/hull/hull/robust-orientation.ts +443 -0
- package/src/plugins/hull/hull/robust-scale.ts +53 -0
- package/src/plugins/hull/hull/robust-segment-intersect.ts +29 -0
- package/src/plugins/hull/hull/robust-subtract.ts +187 -0
- package/src/plugins/hull/hull/robust-sum.ts +175 -0
- package/src/plugins/hull/hull/two-product.ts +31 -0
- package/src/plugins/hull/hull/two-sum.ts +17 -0
- package/src/plugins/hull/index.ts +1 -1
- package/src/plugins/minimap/index.ts +4 -8
- package/src/plugins/toolbar/index.ts +1 -1
- package/src/plugins/toolbar/util.ts +4 -0
- package/src/runtime/graph.ts +28 -4
- package/src/runtime/layout.ts +4 -4
- package/src/transforms/process-parallel-edges.ts +41 -10
- package/src/utils/edge.ts +5 -4
- package/src/utils/element.ts +33 -22
- package/src/utils/pinch.ts +79 -6
- package/src/utils/shortcut.ts +5 -3
- package/src/version.ts +1 -1
package/lib/utils/theme.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.js","sourceRoot":"
|
|
1
|
+
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../../src/utils/theme.ts"],"names":[],"mappings":";;AAYA,0BAUC;AAtBD,4CAAiD;AACjD,yCAA+C;AAE/C,mCAAgC;AAEhC;;;;;;GAMG;AACH,SAAgB,OAAO,CAAC,OAAqB;IAC3C,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;IAC1B,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,CAAC;IAEtB,MAAM,YAAY,GAAG,IAAA,kBAAY,EAAC,6BAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAElE,IAAI,YAAY;QAAE,OAAO,YAAY,CAAC;IAEtC,aAAK,CAAC,IAAI,CAAC,gBAAgB,KAAK,qBAAqB,CAAC,CAAC;IACvD,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform.js","sourceRoot":"
|
|
1
|
+
{"version":3,"file":"transform.js","sourceRoot":"","sources":["../../src/utils/transform.ts"],"names":[],"mappings":";;AAaA,kEAwCC;AApDD,qCAAsC;AAEtC;;;;;;;;;GASG;A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AC,IAAI,CAAC,CAAC;IAEjC,IAAI,QAAQ,EAAE,CAAC;QACb,KAAK,MAAM,KAAK,IAAI,QAAQ,EAAE,CAAC;YAC7B,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;QAClD,CAAC;IACH,CAAC;IAED,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAC1C,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,GAAG,CAAI,IAAO,EAAE,OAAyC,EAAE,SAAuC;IAChH,MAAM,KAAK,GAAkB,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAEzC,OAAO,KAAK,CAAC,MAAM,EAAE,CAAC;QACpB,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,GAAG,KAAK,CAAC,KAAK,EAAG,CAAC;QAExC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAExB,MAAM,QAAQ,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;QAEpC,IAAI,QAAQ,EAAE,CAAC;YACb,KAAK,MAAM,KAAK,IAAI,QAAQ,EAAE,CAAC;gBAC7B,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;YACjC,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/lib/utils/tree.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree.js","sourceRoot":"
|
|
1
|
+
{"version":3,"file":"tree.js","sourceRoot":"","sources":["../../src/utils/tree.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAkBA,0CA6BC;AA7CD,yCAAiC;AAQjC;;;;;;;GAOG;AACH,SAAgB,eAAe,CAAC,QAAkB,EAAE,MAAuB;IACzE,MAAM,EACJ,WAAW,GAAG,CAAC,KAAe,EAAE,KAAa,EAA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AAC,CAAC,CAAC;AACtB,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,SAAS,CAAC,CAAoB;IAC5C,OAAO,IAAA,cAAS,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5C,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,GAAG,CAAC,CAAoB;IACtC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;IACjB,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;QAAE,OAAO,CAAC,CAAC;IACvB,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visibility.js","sourceRoot":"
|
|
1
|
+
{"version":3,"file":"visibility.js","sourceRoot":"","sources":["../../src/utils/visibility.ts"],"names":[],"mappings":";;AAcA,sCAaC;AAzBD;;;;;;;;;;;GAWG;AACH,SAAgB,aAAa,CAC3B,KAAoB,EACpB,KAAmC,EACnC,MAA0C;IAE1C,MAAM,QAAQ,GAAG,CAAC,IAAmB,EAAE,EAAE;QACvC,IAAI,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;YAAE,OAAO;QACpC,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC;IAChC,CAAC,CAAC;IAEF,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACrB,QAAQ,CAAC,IAAqB,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/lib/utils/z-index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"z-index.js","sourceRoot":"
|
|
1
|
+
{"version":3,"file":"z-index.js","sourceRoot":"","sources":["../../src/utils/z-index.ts"],"names":[],"mappings":";;AAQA,kCAEC;AARD;;;;;GAKG;AACH,SAAgB,WAAW,CAAC,KAAmB;;IAC7C,OAAO,CAAA,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK,0CAAE,MAAM,KAAI,CAAC,CAAC;AACnC,CAAC"}
|
package/lib/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "5.0.
|
|
1
|
+
export declare const version = "5.0.45";
|
package/lib/version.js
CHANGED
package/lib/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,QAAQ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/g6",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.45",
|
|
4
4
|
"description": "A Graph Visualization Framework in JavaScript",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"antv",
|
|
@@ -42,8 +42,7 @@
|
|
|
42
42
|
"@antv/hierarchy": "^0.6.14",
|
|
43
43
|
"@antv/layout": "1.2.14-beta.9",
|
|
44
44
|
"@antv/util": "^3.3.10",
|
|
45
|
-
"bubblesets-js": "^2.3.4"
|
|
46
|
-
"hull.js": "^1.0.6"
|
|
45
|
+
"bubblesets-js": "^2.3.4"
|
|
47
46
|
},
|
|
48
47
|
"devDependencies": {
|
|
49
48
|
"@antv/g-svg": "^2.0.27",
|
|
@@ -64,7 +63,7 @@
|
|
|
64
63
|
"limit-size": [
|
|
65
64
|
{
|
|
66
65
|
"gzip": true,
|
|
67
|
-
"limit": "
|
|
66
|
+
"limit": "330 Kb",
|
|
68
67
|
"path": "dist/g6.min.js"
|
|
69
68
|
},
|
|
70
69
|
{
|
|
@@ -5,6 +5,7 @@ import type { RuntimeContext } from '../runtime/types';
|
|
|
5
5
|
import type { IDragEvent, IKeyboardEvent, IPointerEvent, Vector2, ViewportAnimationEffectTiming } from '../types';
|
|
6
6
|
import { getExpandedBBox, getPointBBox, isPointInBBox } from '../utils/bbox';
|
|
7
7
|
import { parsePadding } from '../utils/padding';
|
|
8
|
+
import { PinchHandler } from '../utils/pinch';
|
|
8
9
|
import type { ShortcutKey } from '../utils/shortcut';
|
|
9
10
|
import { Shortcut } from '../utils/shortcut';
|
|
10
11
|
import { multiply, subtract } from '../utils/vector';
|
|
@@ -144,7 +145,7 @@ export class DragCanvas extends BaseBehavior<DragCanvasOptions> {
|
|
|
144
145
|
};
|
|
145
146
|
|
|
146
147
|
private onDrag = (event: IDragEvent) => {
|
|
147
|
-
if (!this.isDragging) return;
|
|
148
|
+
if (!this.isDragging || PinchHandler.isPinching) return;
|
|
148
149
|
const x = event.movement?.x ?? event.dx;
|
|
149
150
|
const y = event.movement?.y ?? event.dy;
|
|
150
151
|
if ((x | y) !== 0) {
|
package/src/layouts/types.ts
CHANGED
|
@@ -99,7 +99,7 @@ interface RadialLayout extends BaseLayoutOptions, RadialLayoutOptions {
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
interface FruchtermanLayout extends BaseLayoutOptions, FruchtermanLayoutOptions {
|
|
102
|
-
type: 'fruchterman' | '
|
|
102
|
+
type: 'fruchterman' | 'fruchterman-gpu';
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
interface D3ForceLayout extends BaseLayoutOptions, D3ForceLayoutOptions {
|
|
@@ -115,7 +115,7 @@ interface ForceLayout extends BaseLayoutOptions, ForceLayoutOptions {
|
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
interface ForceAtlas2 extends BaseLayoutOptions, ForceAtlas2LayoutOptions {
|
|
118
|
-
type: '
|
|
118
|
+
type: 'force-atlas2';
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
interface AntVDagreLayout extends BaseLayoutOptions, AntVDagreLayoutOptions {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { BaseStyleProps } from '@antv/g';
|
|
2
1
|
import { CommonEvent } from '../../constants';
|
|
3
|
-
import { Circle } from '../../elements';
|
|
2
|
+
import { Circle, type CircleStyleProps } from '../../elements';
|
|
4
3
|
import type { RuntimeContext } from '../../runtime/types';
|
|
5
4
|
import type { EdgeData, GraphData, NodeData } from '../../spec';
|
|
6
5
|
import type { EdgeStyle } from '../../spec/element/edge';
|
|
@@ -100,7 +99,7 @@ export interface EdgeFilterLensOptions extends BasePluginOptions {
|
|
|
100
99
|
*
|
|
101
100
|
* <en/> The style of the lens
|
|
102
101
|
*/
|
|
103
|
-
style?:
|
|
102
|
+
style?: Partial<CircleStyleProps>;
|
|
104
103
|
/**
|
|
105
104
|
* <zh/> 在透镜中节点的样式
|
|
106
105
|
*
|
|
@@ -122,7 +121,7 @@ export interface EdgeFilterLensOptions extends BasePluginOptions {
|
|
|
122
121
|
preventDefault?: boolean;
|
|
123
122
|
}
|
|
124
123
|
|
|
125
|
-
const defaultLensStyle:
|
|
124
|
+
const defaultLensStyle: Exclude<CircleStyleProps, 'r'> = {
|
|
126
125
|
fill: '#fff',
|
|
127
126
|
fillOpacity: 1,
|
|
128
127
|
lineWidth: 1,
|
|
@@ -388,6 +387,7 @@ export class EdgeFilterLens extends BasePlugin<EdgeFilterLensOptions> {
|
|
|
388
387
|
public update(options: Partial<EdgeFilterLensOptions>) {
|
|
389
388
|
this.unbindEvents();
|
|
390
389
|
super.update(options);
|
|
390
|
+
this.r = options.r ?? this.r;
|
|
391
391
|
this.bindEvents();
|
|
392
392
|
}
|
|
393
393
|
|
|
@@ -466,6 +466,8 @@ export class Fisheye extends BasePlugin<FisheyeOptions> {
|
|
|
466
466
|
public update(options: Partial<FisheyeOptions>) {
|
|
467
467
|
this.unbindEvents();
|
|
468
468
|
super.update(options);
|
|
469
|
+
this.r = options.r ?? this.r;
|
|
470
|
+
this.d = options.d ?? this.d;
|
|
469
471
|
this.bindEvents();
|
|
470
472
|
}
|
|
471
473
|
|
package/src/plugins/grid-line.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { isBoolean } from '@antv/util';
|
|
1
2
|
import { GraphEvent } from '../constants';
|
|
2
3
|
import type { RuntimeContext } from '../runtime/types';
|
|
3
|
-
import type { Point } from '../types';
|
|
4
|
+
import type { IViewportEvent, Point } from '../types';
|
|
4
5
|
import { ViewportEvent } from '../utils/event';
|
|
5
|
-
import { add, mod } from '../utils/vector';
|
|
6
|
+
import { add, mod, multiply } from '../utils/vector';
|
|
6
7
|
import { BasePlugin, BasePluginOptions } from './base-plugin';
|
|
7
8
|
import { createPluginContainer } from './utils/dom';
|
|
8
9
|
|
|
@@ -75,7 +76,22 @@ export interface GridLineOptions extends BasePluginOptions {
|
|
|
75
76
|
* <en/> Whether to follow with the graph
|
|
76
77
|
* @defaultValue false
|
|
77
78
|
*/
|
|
78
|
-
follow?:
|
|
79
|
+
follow?:
|
|
80
|
+
| boolean
|
|
81
|
+
| {
|
|
82
|
+
/**
|
|
83
|
+
* <zh/> 是否跟随图平移
|
|
84
|
+
*
|
|
85
|
+
* <en/> Whether to follow the graph translation
|
|
86
|
+
*/
|
|
87
|
+
translate?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* <zh/> 是否跟随图缩放
|
|
90
|
+
*
|
|
91
|
+
* <en/> Whether to follow the graph zoom
|
|
92
|
+
*/
|
|
93
|
+
zoom?: boolean;
|
|
94
|
+
};
|
|
79
95
|
}
|
|
80
96
|
|
|
81
97
|
/**
|
|
@@ -99,8 +115,9 @@ export class GridLine extends BasePlugin<GridLineOptions> {
|
|
|
99
115
|
};
|
|
100
116
|
|
|
101
117
|
private $element: HTMLElement = createPluginContainer('grid-line', true);
|
|
102
|
-
|
|
103
118
|
private offset: Point = [0, 0];
|
|
119
|
+
private currentScale: number = 1;
|
|
120
|
+
private baseSize: number;
|
|
104
121
|
|
|
105
122
|
constructor(context: RuntimeContext, options: GridLineOptions) {
|
|
106
123
|
super(context, Object.assign({}, GridLine.defaultOptions, options));
|
|
@@ -108,6 +125,8 @@ export class GridLine extends BasePlugin<GridLineOptions> {
|
|
|
108
125
|
const $container = this.context.canvas.getContainer()!;
|
|
109
126
|
$container.prepend(this.$element);
|
|
110
127
|
|
|
128
|
+
this.baseSize = this.options.size;
|
|
129
|
+
|
|
111
130
|
this.updateStyle();
|
|
112
131
|
this.bindEvents();
|
|
113
132
|
}
|
|
@@ -121,6 +140,11 @@ export class GridLine extends BasePlugin<GridLineOptions> {
|
|
|
121
140
|
*/
|
|
122
141
|
public update(options: Partial<GridLineOptions>) {
|
|
123
142
|
super.update(options);
|
|
143
|
+
|
|
144
|
+
if (options.size !== undefined) {
|
|
145
|
+
this.baseSize = options.size;
|
|
146
|
+
}
|
|
147
|
+
|
|
124
148
|
this.updateStyle();
|
|
125
149
|
}
|
|
126
150
|
|
|
@@ -130,22 +154,49 @@ export class GridLine extends BasePlugin<GridLineOptions> {
|
|
|
130
154
|
}
|
|
131
155
|
|
|
132
156
|
private updateStyle() {
|
|
133
|
-
const {
|
|
157
|
+
const { stroke, lineWidth, border, borderLineWidth, borderStroke, borderStyle } = this.options;
|
|
158
|
+
|
|
159
|
+
const scaledSize = this.baseSize * this.currentScale;
|
|
134
160
|
|
|
135
161
|
Object.assign(this.$element.style, {
|
|
136
162
|
border: border ? `${borderLineWidth}px ${borderStyle} ${borderStroke}` : 'none',
|
|
137
163
|
backgroundImage: `linear-gradient(${stroke} ${lineWidth}px, transparent ${lineWidth}px), linear-gradient(90deg, ${stroke} ${lineWidth}px, transparent ${lineWidth}px)`,
|
|
138
|
-
backgroundSize: `${
|
|
164
|
+
backgroundSize: `${scaledSize}px ${scaledSize}px`,
|
|
139
165
|
backgroundRepeat: 'repeat',
|
|
140
166
|
});
|
|
141
167
|
}
|
|
142
168
|
|
|
143
169
|
private updateOffset(delta: Point) {
|
|
144
|
-
|
|
170
|
+
const scaledSize = this.baseSize * this.currentScale;
|
|
171
|
+
this.offset = mod(add(this.offset, delta), scaledSize);
|
|
145
172
|
this.$element.style.backgroundPosition = `${this.offset[0]}px ${this.offset[1]}px`;
|
|
146
173
|
}
|
|
147
174
|
|
|
148
|
-
private
|
|
175
|
+
private followZoom = (event: IViewportEvent) => {
|
|
176
|
+
const {
|
|
177
|
+
data: { scale, origin },
|
|
178
|
+
} = event;
|
|
179
|
+
|
|
180
|
+
if (!scale) return;
|
|
181
|
+
|
|
182
|
+
const prevScale = this.currentScale;
|
|
183
|
+
this.currentScale = scale;
|
|
184
|
+
|
|
185
|
+
const deltaScale = scale / prevScale;
|
|
186
|
+
const positionOffset = multiply(origin || this.context.graph.getCanvasCenter(), 1 - deltaScale);
|
|
187
|
+
const scaledSize = this.baseSize * scale;
|
|
188
|
+
|
|
189
|
+
const scaledOffset = multiply(this.offset, deltaScale);
|
|
190
|
+
const modulatedOffset = mod(scaledOffset, scaledSize);
|
|
191
|
+
const newOffset = add(modulatedOffset, positionOffset);
|
|
192
|
+
|
|
193
|
+
this.$element.style.backgroundSize = `${scaledSize}px ${scaledSize}px`;
|
|
194
|
+
this.$element.style.backgroundPosition = `${newOffset[0]}px ${newOffset[1]}px`;
|
|
195
|
+
|
|
196
|
+
this.offset = mod(newOffset, scaledSize);
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
private followTranslate = (event: IViewportEvent) => {
|
|
149
200
|
if (!this.options.follow) return;
|
|
150
201
|
const {
|
|
151
202
|
data: { translate },
|
|
@@ -153,6 +204,19 @@ export class GridLine extends BasePlugin<GridLineOptions> {
|
|
|
153
204
|
if (translate) this.updateOffset(translate);
|
|
154
205
|
};
|
|
155
206
|
|
|
207
|
+
private parseFollow(follow: GridLineOptions['follow']): { translate: boolean; zoom: boolean } {
|
|
208
|
+
return isBoolean(follow)
|
|
209
|
+
? { translate: follow, zoom: follow }
|
|
210
|
+
: { translate: follow?.translate ?? false, zoom: follow?.zoom ?? false };
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
private onTransform = (event: ViewportEvent) => {
|
|
214
|
+
const follow = this.parseFollow(this.options.follow);
|
|
215
|
+
|
|
216
|
+
if (follow.zoom) this.followZoom(event);
|
|
217
|
+
if (follow.translate) this.followTranslate(event);
|
|
218
|
+
};
|
|
219
|
+
|
|
156
220
|
/**
|
|
157
221
|
* <zh/> 销毁网格线
|
|
158
222
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
> Code copied from [hull-js](https://github.com/hull/hull-js), and fix the issue [[Bug]: hull.js Code Injection Vulnerability #6605](https://github.com/antvis/G6/issues/6605).
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Point } from '../../../types';
|
|
2
|
+
|
|
3
|
+
export type PointObject = Record<string, number>;
|
|
4
|
+
export type BBox = [number, number, number, number];
|
|
5
|
+
export type FormatTuple = [string, string];
|
|
6
|
+
|
|
7
|
+
export const formatUtil = {
|
|
8
|
+
toXy<T extends PointObject>(pointset: T[] | Point[], format?: FormatTuple): T[] | Point[] {
|
|
9
|
+
if (!format) return [...pointset] as Point[];
|
|
10
|
+
|
|
11
|
+
const xProperty = format[0].slice(1);
|
|
12
|
+
const yProperty = format[1].slice(1);
|
|
13
|
+
|
|
14
|
+
return (pointset as T[]).map((pt) => [pt[xProperty], pt[yProperty]]) as Point[];
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
fromXy(coordinates: Point[], format?: FormatTuple): Point[] | PointObject[] {
|
|
18
|
+
if (!format) return [...coordinates];
|
|
19
|
+
|
|
20
|
+
const xProperty = format[0].slice(1);
|
|
21
|
+
const yProperty = format[1].slice(1);
|
|
22
|
+
|
|
23
|
+
return coordinates.map(([x, y]) => ({
|
|
24
|
+
[xProperty]: x,
|
|
25
|
+
[yProperty]: y,
|
|
26
|
+
}));
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
export type PointConverter = typeof formatUtil;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { Point } from '../../../types';
|
|
2
|
+
import type { BBox } from './format';
|
|
3
|
+
|
|
4
|
+
export class Grid {
|
|
5
|
+
private _cells: Point[][][] = [];
|
|
6
|
+
private _cellSize: number;
|
|
7
|
+
private _reverseCellSize: number;
|
|
8
|
+
constructor(points: Point[], cellSize: number) {
|
|
9
|
+
this._cellSize = cellSize;
|
|
10
|
+
this._reverseCellSize = 1 / cellSize;
|
|
11
|
+
for (const point of points) {
|
|
12
|
+
const x = this.coordToCellNum(point[0]);
|
|
13
|
+
const y = this.coordToCellNum(point[1]);
|
|
14
|
+
|
|
15
|
+
if (!this._cells[x]) {
|
|
16
|
+
this._cells[x] = [];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (!this._cells[x][y]) {
|
|
20
|
+
this._cells[x][y] = [];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
this._cells[x][y].push(point);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
cellPoints(x: number, y: number): Point[] {
|
|
27
|
+
return this._cells[x]?.[y] || [];
|
|
28
|
+
}
|
|
29
|
+
rangePoints(bbox: BBox): Point[] {
|
|
30
|
+
const tlCellX = this.coordToCellNum(bbox[0]);
|
|
31
|
+
const tlCellY = this.coordToCellNum(bbox[1]);
|
|
32
|
+
const brCellX = this.coordToCellNum(bbox[2]);
|
|
33
|
+
const brCellY = this.coordToCellNum(bbox[3]);
|
|
34
|
+
const points: Point[] = [];
|
|
35
|
+
for (let x = tlCellX; x <= brCellX; x++) {
|
|
36
|
+
for (let y = tlCellY; y <= brCellY; y++) {
|
|
37
|
+
const cell = this.cellPoints(x, y);
|
|
38
|
+
for (const point of cell) {
|
|
39
|
+
points.push(point);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return points;
|
|
44
|
+
}
|
|
45
|
+
removePoint(point: Point): Point[] {
|
|
46
|
+
const cellX = this.coordToCellNum(point[0]);
|
|
47
|
+
const cellY = this.coordToCellNum(point[1]);
|
|
48
|
+
const cell = this._cells[cellX][cellY];
|
|
49
|
+
const index = cell.findIndex(([px, py]) => px === point[0] && py === point[1]);
|
|
50
|
+
if (index > -1) {
|
|
51
|
+
cell.splice(index, 1);
|
|
52
|
+
}
|
|
53
|
+
return cell;
|
|
54
|
+
}
|
|
55
|
+
private trunc(val: number): number {
|
|
56
|
+
return Math.trunc(val);
|
|
57
|
+
}
|
|
58
|
+
coordToCellNum(x: number): number {
|
|
59
|
+
return this.trunc(x * this._reverseCellSize);
|
|
60
|
+
}
|
|
61
|
+
extendBbox(bbox: BBox, scaleFactor: number): BBox {
|
|
62
|
+
return [
|
|
63
|
+
bbox[0] - scaleFactor * this._cellSize,
|
|
64
|
+
bbox[1] - scaleFactor * this._cellSize,
|
|
65
|
+
bbox[2] + scaleFactor * this._cellSize,
|
|
66
|
+
bbox[3] + scaleFactor * this._cellSize,
|
|
67
|
+
];
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function grid(points: Point[], cellSize: number): Grid {
|
|
72
|
+
return new Grid(points, cellSize);
|
|
73
|
+
}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import type { Point } from '../../../types';
|
|
2
|
+
import type { BBox, FormatTuple } from './format';
|
|
3
|
+
import { formatUtil } from './format';
|
|
4
|
+
import type { Grid } from './grid_handle';
|
|
5
|
+
import { grid } from './grid_handle';
|
|
6
|
+
import { monotoneConvexHull2D as convexHull } from './monotone-convex-hull-2d';
|
|
7
|
+
import { segmentsIntersect as intersect } from './robust-segment-intersect';
|
|
8
|
+
|
|
9
|
+
function _filterDuplicates(pointset: Point[]) {
|
|
10
|
+
const unique = [pointset[0]];
|
|
11
|
+
let lastPoint = pointset[0];
|
|
12
|
+
for (let i = 1; i < pointset.length; i++) {
|
|
13
|
+
const currentPoint = pointset[i];
|
|
14
|
+
if (lastPoint[0] !== currentPoint[0] || lastPoint[1] !== currentPoint[1]) {
|
|
15
|
+
unique.push(currentPoint);
|
|
16
|
+
}
|
|
17
|
+
lastPoint = currentPoint;
|
|
18
|
+
}
|
|
19
|
+
return unique;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function _sortByX(pointset: Point[]) {
|
|
23
|
+
return pointset.sort(function (a, b) {
|
|
24
|
+
return a[0] - b[0] || a[1] - b[1];
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function _sqLength(a: Point, b: Point) {
|
|
29
|
+
return Math.pow(b[0] - a[0], 2) + Math.pow(b[1] - a[1], 2);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function _cos(o: Point, a: Point, b: Point) {
|
|
33
|
+
const aShifted = [a[0] - o[0], a[1] - o[1]],
|
|
34
|
+
bShifted = [b[0] - o[0], b[1] - o[1]],
|
|
35
|
+
sqALen = _sqLength(o, a),
|
|
36
|
+
sqBLen = _sqLength(o, b),
|
|
37
|
+
dot = aShifted[0] * bShifted[0] + aShifted[1] * bShifted[1];
|
|
38
|
+
|
|
39
|
+
return dot / Math.sqrt(sqALen * sqBLen);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function _intersect(segment: [Point, Point], pointset: Point[]) {
|
|
43
|
+
for (let i = 0; i < pointset.length - 1; i++) {
|
|
44
|
+
const seg = [pointset[i], pointset[i + 1]];
|
|
45
|
+
if (
|
|
46
|
+
(segment[0][0] === seg[0][0] && segment[0][1] === seg[0][1]) ||
|
|
47
|
+
(segment[0][0] === seg[1][0] && segment[0][1] === seg[1][1])
|
|
48
|
+
) {
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
if (intersect(segment[0], segment[1], seg[0], seg[1])) {
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function _occupiedArea(pointset: Point[]) {
|
|
59
|
+
let minX = Infinity;
|
|
60
|
+
let minY = Infinity;
|
|
61
|
+
let maxX = -Infinity;
|
|
62
|
+
let maxY = -Infinity;
|
|
63
|
+
|
|
64
|
+
for (let i = pointset.length - 1; i >= 0; i--) {
|
|
65
|
+
if (pointset[i][0] < minX) {
|
|
66
|
+
minX = pointset[i][0];
|
|
67
|
+
}
|
|
68
|
+
if (pointset[i][1] < minY) {
|
|
69
|
+
minY = pointset[i][1];
|
|
70
|
+
}
|
|
71
|
+
if (pointset[i][0] > maxX) {
|
|
72
|
+
maxX = pointset[i][0];
|
|
73
|
+
}
|
|
74
|
+
if (pointset[i][1] > maxY) {
|
|
75
|
+
maxY = pointset[i][1];
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return [
|
|
80
|
+
maxX - minX, // width
|
|
81
|
+
maxY - minY, // height
|
|
82
|
+
];
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function _bBoxAround(edge: [Point, Point]): BBox {
|
|
86
|
+
return [
|
|
87
|
+
Math.min(edge[0][0], edge[1][0]), // left
|
|
88
|
+
Math.min(edge[0][1], edge[1][1]), // top
|
|
89
|
+
Math.max(edge[0][0], edge[1][0]), // right
|
|
90
|
+
Math.max(edge[0][1], edge[1][1]), // bottom
|
|
91
|
+
];
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function _midPoint(edge: [Point, Point], innerPoints: Point[], convex: Point[]) {
|
|
95
|
+
let point = null,
|
|
96
|
+
angle1Cos = MAX_CONCAVE_ANGLE_COS,
|
|
97
|
+
angle2Cos = MAX_CONCAVE_ANGLE_COS,
|
|
98
|
+
a1Cos,
|
|
99
|
+
a2Cos;
|
|
100
|
+
|
|
101
|
+
for (let i = 0; i < innerPoints.length; i++) {
|
|
102
|
+
a1Cos = _cos(edge[0], edge[1], innerPoints[i]);
|
|
103
|
+
a2Cos = _cos(edge[1], edge[0], innerPoints[i]);
|
|
104
|
+
|
|
105
|
+
if (
|
|
106
|
+
a1Cos > angle1Cos &&
|
|
107
|
+
a2Cos > angle2Cos &&
|
|
108
|
+
!_intersect([edge[0], innerPoints[i]], convex) &&
|
|
109
|
+
!_intersect([edge[1], innerPoints[i]], convex)
|
|
110
|
+
) {
|
|
111
|
+
angle1Cos = a1Cos;
|
|
112
|
+
angle2Cos = a2Cos;
|
|
113
|
+
point = innerPoints[i];
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return point;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function _concave(
|
|
121
|
+
convex: Point[],
|
|
122
|
+
maxSqEdgeLen: number,
|
|
123
|
+
maxSearchArea: [number, number],
|
|
124
|
+
grid: Grid,
|
|
125
|
+
edgeSkipList: Set<string>,
|
|
126
|
+
) {
|
|
127
|
+
let midPointInserted = false;
|
|
128
|
+
|
|
129
|
+
for (let i = 0; i < convex.length - 1; i++) {
|
|
130
|
+
const edge: [Point, Point] = [convex[i], convex[i + 1]];
|
|
131
|
+
// generate a key in the format X0,Y0,X1,Y1
|
|
132
|
+
const keyInSkipList = edge[0][0] + ',' + edge[0][1] + ',' + edge[1][0] + ',' + edge[1][1];
|
|
133
|
+
|
|
134
|
+
if (_sqLength(edge[0], edge[1]) < maxSqEdgeLen || edgeSkipList.has(keyInSkipList)) {
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
let scaleFactor = 0;
|
|
139
|
+
let bBoxAround = _bBoxAround(edge);
|
|
140
|
+
let bBoxWidth;
|
|
141
|
+
let bBoxHeight;
|
|
142
|
+
let midPoint;
|
|
143
|
+
do {
|
|
144
|
+
bBoxAround = grid.extendBbox(bBoxAround, scaleFactor);
|
|
145
|
+
bBoxWidth = bBoxAround[2] - bBoxAround[0];
|
|
146
|
+
bBoxHeight = bBoxAround[3] - bBoxAround[1];
|
|
147
|
+
|
|
148
|
+
midPoint = _midPoint(edge, grid.rangePoints(bBoxAround), convex);
|
|
149
|
+
scaleFactor++;
|
|
150
|
+
} while (midPoint === null && (maxSearchArea[0] > bBoxWidth || maxSearchArea[1] > bBoxHeight));
|
|
151
|
+
|
|
152
|
+
if (bBoxWidth >= maxSearchArea[0] && bBoxHeight >= maxSearchArea[1]) {
|
|
153
|
+
edgeSkipList.add(keyInSkipList);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if (midPoint !== null) {
|
|
157
|
+
convex.splice(i + 1, 0, midPoint);
|
|
158
|
+
grid.removePoint(midPoint);
|
|
159
|
+
midPointInserted = true;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
if (midPointInserted) {
|
|
164
|
+
return _concave(convex, maxSqEdgeLen, maxSearchArea, grid, edgeSkipList);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
return convex;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export function hull(pointset: Point[], concavity: number, format?: FormatTuple): Point[] {
|
|
171
|
+
const maxEdgeLen = concavity || 20;
|
|
172
|
+
|
|
173
|
+
const points = _filterDuplicates(_sortByX(formatUtil.toXy(pointset, format) as Point[]));
|
|
174
|
+
|
|
175
|
+
if (points.length < 4) {
|
|
176
|
+
const concave = points.concat([points[0]]);
|
|
177
|
+
return (format ? formatUtil.fromXy(concave, format) : concave) as Point[];
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
const occupiedArea = _occupiedArea(points);
|
|
181
|
+
const maxSearchArea: [number, number] = [
|
|
182
|
+
occupiedArea[0] * MAX_SEARCH_BBOX_SIZE_PERCENT,
|
|
183
|
+
occupiedArea[1] * MAX_SEARCH_BBOX_SIZE_PERCENT,
|
|
184
|
+
];
|
|
185
|
+
|
|
186
|
+
const convex = convexHull(points)
|
|
187
|
+
.reverse()
|
|
188
|
+
.map((idx: number) => points[idx]); // ccw -> cw, indices -> points
|
|
189
|
+
convex.push(convex[0]);
|
|
190
|
+
|
|
191
|
+
const innerPoints = points.filter(function (pt) {
|
|
192
|
+
return convex.indexOf(pt) < 0;
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
const cellSize = Math.ceil(1 / (points.length / (occupiedArea[0] * occupiedArea[1])));
|
|
196
|
+
|
|
197
|
+
const concave = _concave(convex, Math.pow(maxEdgeLen, 2), maxSearchArea, grid(innerPoints, cellSize), new Set());
|
|
198
|
+
|
|
199
|
+
return (format ? formatUtil.fromXy(concave, format) : concave) as Point[];
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
const MAX_CONCAVE_ANGLE_COS = Math.cos(90 / (180 / Math.PI)); // angle = 90 deg
|
|
203
|
+
const MAX_SEARCH_BBOX_SIZE_PERCENT = 0.6;
|