@antv/g6 4.8.14 → 5.0.0-alpha.2
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 -3
- package/esm/constant/index.d.ts +1 -0
- package/esm/constant/index.js +2 -0
- package/esm/constant/index.js.map +1 -0
- package/esm/constant/shape.d.ts +27 -0
- package/esm/constant/shape.js +26 -0
- package/esm/constant/shape.js.map +1 -0
- package/esm/index.d.ts +124 -0
- package/esm/index.js +11 -0
- package/esm/index.js.map +1 -0
- package/esm/item/combo.d.ts +4 -0
- package/esm/item/combo.js +4 -0
- package/esm/item/combo.js.map +1 -0
- package/esm/item/edge.d.ts +54 -0
- package/esm/item/edge.js +113 -0
- package/esm/item/edge.js.map +1 -0
- package/esm/item/item.d.ts +189 -0
- package/esm/item/item.js +636 -0
- package/esm/item/item.js.map +1 -0
- package/esm/item/node.d.ts +54 -0
- package/esm/item/node.js +170 -0
- package/esm/item/node.js.map +1 -0
- package/esm/runtime/controller/data.d.ts +65 -0
- package/esm/runtime/controller/data.js +489 -0
- package/esm/runtime/controller/data.js.map +1 -0
- package/esm/runtime/controller/extension.d.ts +9 -0
- package/esm/runtime/controller/extension.js +11 -0
- package/esm/runtime/controller/extension.js.map +1 -0
- package/esm/runtime/controller/index.d.ts +7 -0
- package/esm/runtime/controller/index.js +8 -0
- package/esm/runtime/controller/index.js.map +1 -0
- package/esm/runtime/controller/interaction.d.ts +51 -0
- package/esm/runtime/controller/interaction.js +259 -0
- package/esm/runtime/controller/interaction.js.map +1 -0
- package/esm/runtime/controller/item.d.ts +101 -0
- package/esm/runtime/controller/item.js +537 -0
- package/esm/runtime/controller/item.js.map +1 -0
- package/esm/runtime/controller/layout.d.ts +30 -0
- package/esm/runtime/controller/layout.js +204 -0
- package/esm/runtime/controller/layout.js.map +1 -0
- package/esm/runtime/controller/plugin.d.ts +34 -0
- package/esm/runtime/controller/plugin.js +140 -0
- package/esm/runtime/controller/plugin.js.map +1 -0
- package/esm/runtime/controller/theme.d.ts +29 -0
- package/esm/runtime/controller/theme.js +54 -0
- package/esm/runtime/controller/theme.js.map +1 -0
- package/esm/runtime/controller/viewport.d.ts +11 -0
- package/esm/runtime/controller/viewport.js +102 -0
- package/esm/runtime/controller/viewport.js.map +1 -0
- package/esm/runtime/graph.d.ts +462 -0
- package/esm/runtime/graph.js +1077 -0
- package/esm/runtime/graph.js.map +1 -0
- package/esm/runtime/hooks.d.ts +33 -0
- package/esm/runtime/hooks.js +74 -0
- package/esm/runtime/hooks.js.map +1 -0
- package/esm/stdlib/behavior/activate-relations.d.ts +62 -0
- package/esm/stdlib/behavior/activate-relations.js +81 -0
- package/esm/stdlib/behavior/activate-relations.js.map +1 -0
- package/esm/stdlib/behavior/brush-select.d.ts +110 -0
- package/esm/stdlib/behavior/brush-select.js +268 -0
- package/esm/stdlib/behavior/brush-select.js.map +1 -0
- package/esm/stdlib/behavior/click-select.d.ts +71 -0
- package/esm/stdlib/behavior/click-select.js +143 -0
- package/esm/stdlib/behavior/click-select.js.map +1 -0
- package/esm/stdlib/behavior/drag-canvas.d.ts +82 -0
- package/esm/stdlib/behavior/drag-canvas.js +246 -0
- package/esm/stdlib/behavior/drag-canvas.js.map +1 -0
- package/esm/stdlib/behavior/drag-node.d.ts +80 -0
- package/esm/stdlib/behavior/drag-node.js +250 -0
- package/esm/stdlib/behavior/drag-node.js.map +1 -0
- package/esm/stdlib/behavior/hover-activate.d.ts +41 -0
- package/esm/stdlib/behavior/hover-activate.js +63 -0
- package/esm/stdlib/behavior/hover-activate.js.map +1 -0
- package/esm/stdlib/behavior/lasso-select.d.ts +27 -0
- package/esm/stdlib/behavior/lasso-select.js +79 -0
- package/esm/stdlib/behavior/lasso-select.js.map +1 -0
- package/esm/stdlib/behavior/orbit-canvas-3d.d.ts +37 -0
- package/esm/stdlib/behavior/orbit-canvas-3d.js +62 -0
- package/esm/stdlib/behavior/orbit-canvas-3d.js.map +1 -0
- package/esm/stdlib/behavior/rotate-canvas-3d.d.ts +61 -0
- package/esm/stdlib/behavior/rotate-canvas-3d.js +123 -0
- package/esm/stdlib/behavior/rotate-canvas-3d.js.map +1 -0
- package/esm/stdlib/behavior/track-canvas-3d.d.ts +37 -0
- package/esm/stdlib/behavior/track-canvas-3d.js +62 -0
- package/esm/stdlib/behavior/track-canvas-3d.js.map +1 -0
- package/esm/stdlib/behavior/zoom-canvas-3d.d.ts +51 -0
- package/esm/stdlib/behavior/zoom-canvas-3d.js +74 -0
- package/esm/stdlib/behavior/zoom-canvas-3d.js.map +1 -0
- package/esm/stdlib/behavior/zoom-canvas.d.ts +61 -0
- package/esm/stdlib/behavior/zoom-canvas.js +160 -0
- package/esm/stdlib/behavior/zoom-canvas.js.map +1 -0
- package/esm/stdlib/data/comboFromNode.d.ts +9 -0
- package/esm/stdlib/data/comboFromNode.js +28 -0
- package/esm/stdlib/data/comboFromNode.js.map +1 -0
- package/esm/stdlib/index.d.ts +80 -0
- package/esm/stdlib/index.js +82 -0
- package/esm/stdlib/index.js.map +1 -0
- package/esm/stdlib/item/edge/base.d.ts +111 -0
- package/esm/stdlib/item/edge/base.js +341 -0
- package/esm/stdlib/item/edge/base.js.map +1 -0
- package/esm/stdlib/item/edge/index.d.ts +1 -0
- package/esm/stdlib/item/edge/index.js +2 -0
- package/esm/stdlib/item/edge/index.js.map +1 -0
- package/esm/stdlib/item/edge/line.d.ts +33 -0
- package/esm/stdlib/item/edge/line.js +45 -0
- package/esm/stdlib/item/edge/line.js.map +1 -0
- package/esm/stdlib/item/node/base.d.ts +137 -0
- package/esm/stdlib/item/node/base.js +414 -0
- package/esm/stdlib/item/node/base.js.map +1 -0
- package/esm/stdlib/item/node/base3d.d.ts +72 -0
- package/esm/stdlib/item/node/base3d.js +113 -0
- package/esm/stdlib/item/node/base3d.js.map +1 -0
- package/esm/stdlib/item/node/circle.d.ts +30 -0
- package/esm/stdlib/item/node/circle.js +56 -0
- package/esm/stdlib/item/node/circle.js.map +1 -0
- package/esm/stdlib/item/node/index.d.ts +2 -0
- package/esm/stdlib/item/node/index.js +3 -0
- package/esm/stdlib/item/node/index.js.map +1 -0
- package/esm/stdlib/item/node/sphere.d.ts +33 -0
- package/esm/stdlib/item/node/sphere.js +52 -0
- package/esm/stdlib/item/node/sphere.js.map +1 -0
- package/esm/stdlib/plugin/legend/index.d.ts +121 -0
- package/esm/stdlib/plugin/legend/index.js +587 -0
- package/esm/stdlib/plugin/legend/index.js.map +1 -0
- package/esm/stdlib/plugin/minimap/index.d.ts +106 -0
- package/esm/stdlib/plugin/minimap/index.js +578 -0
- package/esm/stdlib/plugin/minimap/index.js.map +1 -0
- package/esm/stdlib/selector/lasso.d.ts +15 -0
- package/esm/stdlib/selector/lasso.js +61 -0
- package/esm/stdlib/selector/lasso.js.map +1 -0
- package/esm/stdlib/selector/rect.d.ts +16 -0
- package/esm/stdlib/selector/rect.js +54 -0
- package/esm/stdlib/selector/rect.js.map +1 -0
- package/esm/stdlib/theme/dark.d.ts +3 -0
- package/esm/stdlib/theme/dark.js +279 -0
- package/esm/stdlib/theme/dark.js.map +1 -0
- package/esm/stdlib/theme/light.d.ts +3 -0
- package/esm/stdlib/theme/light.js +274 -0
- package/esm/stdlib/theme/light.js.map +1 -0
- package/esm/stdlib/themeSolver/base.d.ts +15 -0
- package/esm/stdlib/themeSolver/base.js +11 -0
- package/esm/stdlib/themeSolver/base.js.map +1 -0
- package/esm/stdlib/themeSolver/spec.d.ts +37 -0
- package/esm/stdlib/themeSolver/spec.js +66 -0
- package/esm/stdlib/themeSolver/spec.js.map +1 -0
- package/esm/stdlib/themeSolver/subject.d.ts +43 -0
- package/esm/stdlib/themeSolver/subject.js +396 -0
- package/esm/stdlib/themeSolver/subject.js.map +1 -0
- package/esm/types/animate.d.ts +59 -0
- package/esm/types/animate.js +2 -0
- package/esm/types/animate.js.map +1 -0
- package/esm/types/behavior.d.ts +45 -0
- package/esm/types/behavior.js +14 -0
- package/esm/types/behavior.js.map +1 -0
- package/esm/types/combo.d.ts +87 -0
- package/esm/types/combo.js +2 -0
- package/esm/types/combo.js.map +1 -0
- package/esm/types/common.d.ts +6 -0
- package/esm/types/common.js +2 -0
- package/esm/types/common.js.map +1 -0
- package/esm/types/data.d.ts +21 -0
- package/esm/types/data.js +2 -0
- package/esm/types/data.js.map +1 -0
- package/esm/types/edge.d.ts +100 -0
- package/esm/types/edge.js +2 -0
- package/esm/types/edge.js.map +1 -0
- package/esm/types/event.d.ts +30 -0
- package/esm/types/event.js +31 -0
- package/esm/types/event.js.map +1 -0
- package/esm/types/graph.d.ts +445 -0
- package/esm/types/graph.js +2 -0
- package/esm/types/graph.js.map +1 -0
- package/esm/types/hook.d.ts +97 -0
- package/esm/types/hook.js +2 -0
- package/esm/types/hook.js.map +1 -0
- package/esm/types/index.d.ts +10 -0
- package/esm/types/index.js +2 -0
- package/esm/types/index.js.map +1 -0
- package/esm/types/item.d.ts +229 -0
- package/esm/types/item.js +16 -0
- package/esm/types/item.js.map +1 -0
- package/esm/types/layout.d.ts +69 -0
- package/esm/types/layout.js +20 -0
- package/esm/types/layout.js.map +1 -0
- package/esm/types/node.d.ts +134 -0
- package/esm/types/node.js +2 -0
- package/esm/types/node.js.map +1 -0
- package/esm/types/plugin.d.ts +40 -0
- package/esm/types/plugin.js +53 -0
- package/esm/types/plugin.js.map +1 -0
- package/esm/types/render.d.ts +1 -0
- package/esm/types/render.js +2 -0
- package/esm/types/render.js.map +1 -0
- package/esm/types/spec.d.ts +65 -0
- package/esm/types/spec.js +2 -0
- package/esm/types/spec.js.map +1 -0
- package/esm/types/stdlib.d.ts +13 -0
- package/esm/types/stdlib.js +2 -0
- package/esm/types/stdlib.js.map +1 -0
- package/esm/types/theme.d.ts +102 -0
- package/esm/types/theme.js +15 -0
- package/esm/types/theme.js.map +1 -0
- package/esm/types/view.d.ts +23 -0
- package/esm/types/view.js +2 -0
- package/esm/types/view.js.map +1 -0
- package/esm/util/animate.d.ts +101 -0
- package/esm/util/animate.js +350 -0
- package/esm/util/animate.js.map +1 -0
- package/esm/util/array.d.ts +20 -0
- package/esm/util/array.js +60 -0
- package/esm/util/array.js.map +1 -0
- package/esm/util/canvas.d.ts +20 -0
- package/esm/util/canvas.js +81 -0
- package/esm/util/canvas.js.map +1 -0
- package/esm/util/event.d.ts +12 -0
- package/esm/util/event.js +26 -0
- package/esm/util/event.js.map +1 -0
- package/esm/util/extend.d.ts +21 -0
- package/esm/util/extend.js +22 -0
- package/esm/util/extend.js.map +1 -0
- package/esm/util/extension.d.ts +10 -0
- package/esm/util/extension.js +24 -0
- package/esm/util/extension.js.map +1 -0
- package/esm/util/index.d.ts +14 -0
- package/esm/util/index.js +5 -0
- package/esm/util/index.js.map +1 -0
- package/esm/util/item.d.ts +14 -0
- package/esm/util/item.js +42 -0
- package/esm/util/item.js.map +1 -0
- package/esm/util/mapper.d.ts +17 -0
- package/esm/util/mapper.js +60 -0
- package/esm/util/mapper.js.map +1 -0
- package/esm/util/math.d.ts +8 -0
- package/esm/util/math.js +9 -0
- package/esm/util/math.js.map +1 -0
- package/esm/util/point.d.ts +61 -0
- package/esm/util/point.js +160 -0
- package/esm/util/point.js.map +1 -0
- package/esm/util/shape.d.ts +105 -0
- package/esm/util/shape.js +504 -0
- package/esm/util/shape.js.map +1 -0
- package/esm/util/shape3d.d.ts +23 -0
- package/esm/util/shape3d.js +147 -0
- package/esm/util/shape3d.js.map +1 -0
- package/esm/util/text.d.ts +18 -0
- package/esm/util/text.js +36 -0
- package/esm/util/text.js.map +1 -0
- package/esm/util/type.d.ts +2 -0
- package/esm/util/type.js +2 -0
- package/esm/util/type.js.map +1 -0
- package/esm/util/zoom.d.ts +17 -0
- package/esm/util/zoom.js +36 -0
- package/esm/util/zoom.js.map +1 -0
- package/lib/constant/index.d.ts +1 -0
- package/lib/constant/index.js +18 -0
- package/lib/constant/index.js.map +1 -0
- package/lib/constant/shape.d.ts +27 -0
- package/lib/constant/shape.js +29 -0
- package/lib/constant/shape.js.map +1 -0
- package/lib/index.d.ts +124 -4
- package/lib/index.js +30 -27
- package/lib/index.js.map +1 -0
- package/lib/item/combo.d.ts +4 -0
- package/lib/item/combo.js +10 -0
- package/lib/item/combo.js.map +1 -0
- package/lib/item/edge.d.ts +54 -0
- package/lib/item/edge.js +119 -0
- package/lib/item/edge.js.map +1 -0
- package/lib/item/item.d.ts +189 -0
- package/lib/item/item.js +639 -0
- package/lib/item/item.js.map +1 -0
- package/lib/item/node.d.ts +54 -0
- package/lib/item/node.js +176 -0
- package/lib/item/node.js.map +1 -0
- package/lib/runtime/controller/data.d.ts +65 -0
- package/lib/runtime/controller/data.js +493 -0
- package/lib/runtime/controller/data.js.map +1 -0
- package/lib/runtime/controller/extension.d.ts +9 -0
- package/lib/runtime/controller/extension.js +15 -0
- package/lib/runtime/controller/extension.js.map +1 -0
- package/lib/runtime/controller/index.d.ts +7 -0
- package/lib/runtime/controller/index.js +24 -0
- package/lib/runtime/controller/index.js.map +1 -0
- package/lib/runtime/controller/interaction.d.ts +51 -0
- package/lib/runtime/controller/interaction.js +263 -0
- package/lib/runtime/controller/interaction.js.map +1 -0
- package/lib/runtime/controller/item.d.ts +101 -0
- package/lib/runtime/controller/item.js +544 -0
- package/lib/runtime/controller/item.js.map +1 -0
- package/lib/runtime/controller/layout.d.ts +30 -0
- package/lib/runtime/controller/layout.js +208 -0
- package/lib/runtime/controller/layout.js.map +1 -0
- package/lib/runtime/controller/plugin.d.ts +34 -0
- package/lib/runtime/controller/plugin.js +147 -0
- package/lib/runtime/controller/plugin.js.map +1 -0
- package/lib/runtime/controller/theme.d.ts +29 -0
- package/lib/runtime/controller/theme.js +61 -0
- package/lib/runtime/controller/theme.js.map +1 -0
- package/lib/runtime/controller/viewport.d.ts +11 -0
- package/lib/runtime/controller/viewport.js +106 -0
- package/lib/runtime/controller/viewport.js.map +1 -0
- package/lib/runtime/graph.d.ts +462 -0
- package/lib/runtime/graph.js +1083 -0
- package/lib/runtime/graph.js.map +1 -0
- package/lib/runtime/hooks.d.ts +33 -0
- package/lib/runtime/hooks.js +77 -0
- package/lib/runtime/hooks.js.map +1 -0
- package/lib/stdlib/behavior/activate-relations.d.ts +62 -0
- package/lib/stdlib/behavior/activate-relations.js +84 -0
- package/lib/stdlib/behavior/activate-relations.js.map +1 -0
- package/lib/stdlib/behavior/brush-select.d.ts +110 -0
- package/lib/stdlib/behavior/brush-select.js +271 -0
- package/lib/stdlib/behavior/brush-select.js.map +1 -0
- package/lib/stdlib/behavior/click-select.d.ts +71 -0
- package/lib/stdlib/behavior/click-select.js +146 -0
- package/lib/stdlib/behavior/click-select.js.map +1 -0
- package/lib/stdlib/behavior/drag-canvas.d.ts +82 -0
- package/lib/stdlib/behavior/drag-canvas.js +249 -0
- package/lib/stdlib/behavior/drag-canvas.js.map +1 -0
- package/lib/stdlib/behavior/drag-node.d.ts +80 -0
- package/lib/stdlib/behavior/drag-node.js +253 -0
- package/lib/stdlib/behavior/drag-node.js.map +1 -0
- package/lib/stdlib/behavior/hover-activate.d.ts +41 -0
- package/lib/stdlib/behavior/hover-activate.js +67 -0
- package/lib/stdlib/behavior/hover-activate.js.map +1 -0
- package/lib/stdlib/behavior/lasso-select.d.ts +27 -0
- package/lib/stdlib/behavior/lasso-select.js +85 -0
- package/lib/stdlib/behavior/lasso-select.js.map +1 -0
- package/lib/stdlib/behavior/orbit-canvas-3d.d.ts +37 -0
- package/lib/stdlib/behavior/orbit-canvas-3d.js +68 -0
- package/lib/stdlib/behavior/orbit-canvas-3d.js.map +1 -0
- package/lib/stdlib/behavior/rotate-canvas-3d.d.ts +61 -0
- package/lib/stdlib/behavior/rotate-canvas-3d.js +126 -0
- package/lib/stdlib/behavior/rotate-canvas-3d.js.map +1 -0
- package/lib/stdlib/behavior/track-canvas-3d.d.ts +37 -0
- package/lib/stdlib/behavior/track-canvas-3d.js +68 -0
- package/lib/stdlib/behavior/track-canvas-3d.js.map +1 -0
- package/lib/stdlib/behavior/zoom-canvas-3d.d.ts +51 -0
- package/lib/stdlib/behavior/zoom-canvas-3d.js +77 -0
- package/lib/stdlib/behavior/zoom-canvas-3d.js.map +1 -0
- package/lib/stdlib/behavior/zoom-canvas.d.ts +61 -0
- package/lib/stdlib/behavior/zoom-canvas.js +163 -0
- package/lib/stdlib/behavior/zoom-canvas.js.map +1 -0
- package/lib/stdlib/data/comboFromNode.d.ts +9 -0
- package/lib/stdlib/data/comboFromNode.js +32 -0
- package/lib/stdlib/data/comboFromNode.js.map +1 -0
- package/lib/stdlib/index.d.ts +80 -0
- package/lib/stdlib/index.js +90 -0
- package/lib/stdlib/index.js.map +1 -0
- package/lib/stdlib/item/edge/base.d.ts +111 -0
- package/lib/stdlib/item/edge/base.js +345 -0
- package/lib/stdlib/item/edge/base.js.map +1 -0
- package/lib/stdlib/item/edge/index.d.ts +1 -0
- package/lib/stdlib/item/edge/index.js +18 -0
- package/lib/stdlib/item/edge/index.js.map +1 -0
- package/lib/stdlib/item/edge/line.d.ts +33 -0
- package/lib/stdlib/item/edge/line.js +49 -0
- package/lib/stdlib/item/edge/line.js.map +1 -0
- package/lib/stdlib/item/node/base.d.ts +137 -0
- package/lib/stdlib/item/node/base.js +418 -0
- package/lib/stdlib/item/node/base.js.map +1 -0
- package/lib/stdlib/item/node/base3d.d.ts +72 -0
- package/lib/stdlib/item/node/base3d.js +117 -0
- package/lib/stdlib/item/node/base3d.js.map +1 -0
- package/lib/stdlib/item/node/circle.d.ts +30 -0
- package/lib/stdlib/item/node/circle.js +60 -0
- package/lib/stdlib/item/node/circle.js.map +1 -0
- package/lib/stdlib/item/node/index.d.ts +2 -0
- package/lib/stdlib/item/node/index.js +19 -0
- package/lib/stdlib/item/node/index.js.map +1 -0
- package/lib/stdlib/item/node/sphere.d.ts +33 -0
- package/lib/stdlib/item/node/sphere.js +56 -0
- package/lib/stdlib/item/node/sphere.js.map +1 -0
- package/lib/stdlib/plugin/legend/index.d.ts +121 -0
- package/lib/stdlib/plugin/legend/index.js +590 -0
- package/lib/stdlib/plugin/legend/index.js.map +1 -0
- package/lib/stdlib/plugin/minimap/index.d.ts +106 -0
- package/lib/stdlib/plugin/minimap/index.js +581 -0
- package/lib/stdlib/plugin/minimap/index.js.map +1 -0
- package/lib/stdlib/selector/lasso.d.ts +15 -0
- package/lib/stdlib/selector/lasso.js +63 -0
- package/lib/stdlib/selector/lasso.js.map +1 -0
- package/lib/stdlib/selector/rect.d.ts +16 -0
- package/lib/stdlib/selector/rect.js +56 -0
- package/lib/stdlib/selector/rect.js.map +1 -0
- package/lib/stdlib/theme/dark.d.ts +3 -0
- package/lib/stdlib/theme/dark.js +281 -0
- package/lib/stdlib/theme/dark.js.map +1 -0
- package/lib/stdlib/theme/light.d.ts +3 -0
- package/lib/stdlib/theme/light.js +276 -0
- package/lib/stdlib/theme/light.js.map +1 -0
- package/lib/stdlib/themeSolver/base.d.ts +15 -0
- package/lib/stdlib/themeSolver/base.js +14 -0
- package/lib/stdlib/themeSolver/base.js.map +1 -0
- package/lib/stdlib/themeSolver/spec.d.ts +37 -0
- package/lib/stdlib/themeSolver/spec.js +72 -0
- package/lib/stdlib/themeSolver/spec.js.map +1 -0
- package/lib/stdlib/themeSolver/subject.d.ts +43 -0
- package/lib/stdlib/themeSolver/subject.js +404 -0
- package/lib/stdlib/themeSolver/subject.js.map +1 -0
- package/lib/types/animate.d.ts +59 -0
- package/lib/types/animate.js +3 -0
- package/lib/types/animate.js.map +1 -0
- package/lib/types/behavior.d.ts +45 -0
- package/lib/types/behavior.js +18 -0
- package/lib/types/behavior.js.map +1 -0
- package/lib/types/combo.d.ts +87 -0
- package/lib/types/combo.js +3 -0
- package/lib/types/combo.js.map +1 -0
- package/lib/types/common.d.ts +6 -0
- package/lib/types/common.js +3 -0
- package/lib/types/common.js.map +1 -0
- package/lib/types/data.d.ts +21 -0
- package/lib/types/data.js +3 -0
- package/lib/types/data.js.map +1 -0
- package/lib/types/edge.d.ts +100 -0
- package/lib/types/edge.js +3 -0
- package/lib/types/edge.js.map +1 -0
- package/lib/types/event.d.ts +30 -0
- package/lib/types/event.js +34 -0
- package/lib/types/event.js.map +1 -0
- package/lib/types/graph.d.ts +445 -0
- package/lib/types/graph.js +3 -0
- package/lib/types/graph.js.map +1 -0
- package/lib/types/hook.d.ts +97 -0
- package/lib/types/hook.js +3 -0
- package/lib/types/hook.js.map +1 -0
- package/lib/types/index.d.ts +10 -0
- package/lib/types/index.js +7 -0
- package/lib/types/index.js.map +1 -0
- package/lib/types/item.d.ts +229 -0
- package/lib/types/item.js +19 -0
- package/lib/types/item.js.map +1 -0
- package/lib/types/layout.d.ts +69 -0
- package/lib/types/layout.js +25 -0
- package/lib/types/layout.js.map +1 -0
- package/lib/types/node.d.ts +134 -0
- package/lib/types/node.js +3 -0
- package/lib/types/node.js.map +1 -0
- package/lib/types/plugin.d.ts +40 -0
- package/lib/types/plugin.js +57 -0
- package/lib/types/plugin.js.map +1 -0
- package/lib/types/render.d.ts +1 -0
- package/lib/types/render.js +3 -0
- package/lib/types/render.js.map +1 -0
- package/lib/types/spec.d.ts +65 -0
- package/lib/types/spec.js +3 -0
- package/lib/types/spec.js.map +1 -0
- package/lib/types/stdlib.d.ts +13 -0
- package/lib/types/stdlib.js +3 -0
- package/lib/types/stdlib.js.map +1 -0
- package/lib/types/theme.d.ts +102 -0
- package/lib/types/theme.js +19 -0
- package/lib/types/theme.js.map +1 -0
- package/lib/types/view.d.ts +23 -0
- package/lib/types/view.js +3 -0
- package/lib/types/view.js.map +1 -0
- package/lib/util/animate.d.ts +101 -0
- package/lib/util/animate.js +358 -0
- package/lib/util/animate.js.map +1 -0
- package/lib/util/array.d.ts +20 -0
- package/lib/util/array.js +68 -0
- package/lib/util/array.js.map +1 -0
- package/lib/util/canvas.d.ts +20 -0
- package/lib/util/canvas.js +86 -0
- package/lib/util/canvas.js.map +1 -0
- package/lib/util/event.d.ts +12 -0
- package/lib/util/event.js +30 -0
- package/lib/util/event.js.map +1 -0
- package/lib/util/extend.d.ts +21 -0
- package/lib/util/extend.js +29 -0
- package/lib/util/extend.js.map +1 -0
- package/lib/util/extension.d.ts +10 -0
- package/lib/util/extension.js +29 -0
- package/lib/util/extension.js.map +1 -0
- package/lib/util/index.d.ts +14 -0
- package/lib/util/index.js +7 -0
- package/lib/util/index.js.map +1 -0
- package/lib/util/item.d.ts +14 -0
- package/lib/util/item.js +47 -0
- package/lib/util/item.js.map +1 -0
- package/lib/util/mapper.d.ts +17 -0
- package/lib/util/mapper.js +63 -0
- package/lib/util/mapper.js.map +1 -0
- package/lib/util/math.d.ts +8 -0
- package/lib/util/math.js +13 -0
- package/lib/util/math.js.map +1 -0
- package/lib/util/point.d.ts +61 -0
- package/lib/util/point.js +169 -0
- package/lib/util/point.js.map +1 -0
- package/lib/util/shape.d.ts +105 -0
- package/lib/util/shape.js +519 -0
- package/lib/util/shape.js.map +1 -0
- package/lib/util/shape3d.d.ts +23 -0
- package/lib/util/shape3d.js +153 -0
- package/lib/util/shape3d.js.map +1 -0
- package/lib/util/text.d.ts +18 -0
- package/lib/util/text.js +41 -0
- package/lib/util/text.js.map +1 -0
- package/lib/util/type.d.ts +2 -0
- package/lib/util/type.js +6 -0
- package/lib/util/type.js.map +1 -0
- package/lib/util/zoom.d.ts +17 -0
- package/lib/util/zoom.js +41 -0
- package/lib/util/zoom.js.map +1 -0
- package/package.json +82 -50
- package/src/constant/index.ts +1 -0
- package/src/constant/shape.ts +33 -0
- package/src/index.ts +13 -0
- package/src/item/combo.ts +5 -0
- package/src/item/edge.ts +177 -0
- package/src/item/item.ts +812 -0
- package/src/item/node.ts +275 -0
- package/src/runtime/controller/data.ts +575 -0
- package/src/runtime/controller/extension.ts +14 -0
- package/src/runtime/controller/index.ts +7 -0
- package/src/runtime/controller/interaction.ts +343 -0
- package/src/runtime/controller/item.ts +780 -0
- package/src/runtime/controller/layout.ts +251 -0
- package/src/runtime/controller/plugin.ts +171 -0
- package/src/runtime/controller/theme.ts +69 -0
- package/src/runtime/controller/viewport.ts +131 -0
- package/src/runtime/graph.ts +1439 -0
- package/src/runtime/hooks.ts +64 -0
- package/src/stdlib/behavior/activate-relations.ts +139 -0
- package/src/stdlib/behavior/brush-select.ts +386 -0
- package/src/stdlib/behavior/click-select.ts +201 -0
- package/src/stdlib/behavior/drag-canvas.ts +333 -0
- package/src/stdlib/behavior/drag-node.ts +402 -0
- package/src/stdlib/behavior/hover-activate.ts +106 -0
- package/src/stdlib/behavior/lasso-select.ts +94 -0
- package/src/stdlib/behavior/orbit-canvas-3d.ts +104 -0
- package/src/stdlib/behavior/rotate-canvas-3d.ts +172 -0
- package/src/stdlib/behavior/track-canvas-3d.ts +104 -0
- package/src/stdlib/behavior/zoom-canvas-3d.ts +127 -0
- package/src/stdlib/behavior/zoom-canvas.ts +244 -0
- package/src/stdlib/data/comboFromNode.ts +28 -0
- package/src/stdlib/index.ts +87 -0
- package/src/stdlib/item/edge/base.ts +571 -0
- package/src/stdlib/item/edge/index.ts +1 -0
- package/src/stdlib/item/edge/line.ts +98 -0
- package/src/stdlib/item/node/base.ts +726 -0
- package/src/stdlib/item/node/base3d.ts +192 -0
- package/src/stdlib/item/node/circle.ts +113 -0
- package/src/stdlib/item/node/index.ts +2 -0
- package/src/stdlib/item/node/sphere.ts +99 -0
- package/src/stdlib/plugin/legend/index.ts +733 -0
- package/src/stdlib/plugin/minimap/index.ts +689 -0
- package/src/stdlib/selector/lasso.ts +75 -0
- package/src/stdlib/selector/rect.ts +78 -0
- package/src/stdlib/theme/dark.ts +340 -0
- package/src/stdlib/theme/light.ts +333 -0
- package/src/stdlib/themeSolver/base.ts +22 -0
- package/src/stdlib/themeSolver/spec.ts +110 -0
- package/src/stdlib/themeSolver/subject.ts +502 -0
- package/src/types/animate.ts +71 -0
- package/src/types/behavior.ts +49 -0
- package/src/types/combo.ts +120 -0
- package/src/types/common.ts +7 -0
- package/src/types/data.ts +35 -0
- package/src/types/edge.ts +119 -0
- package/src/types/event.ts +47 -0
- package/src/types/graph.ts +573 -0
- package/src/types/hook.ts +98 -0
- package/src/types/index.ts +29 -0
- package/src/types/item.ts +324 -0
- package/src/types/layout.ts +138 -0
- package/src/types/node.ts +162 -0
- package/src/types/plugin.ts +77 -0
- package/src/types/render.ts +1 -0
- package/src/types/spec.ts +116 -0
- package/src/types/stdlib.ts +25 -0
- package/src/types/theme.ts +101 -0
- package/src/types/view.ts +31 -0
- package/src/util/animate.ts +430 -0
- package/src/util/array.ts +57 -0
- package/src/util/canvas.ts +95 -0
- package/src/util/event.ts +34 -0
- package/src/util/extend.ts +42 -0
- package/src/util/extension.ts +29 -0
- package/src/util/index.ts +4 -0
- package/src/util/item.ts +70 -0
- package/src/util/mapper.ts +61 -0
- package/src/util/math.ts +9 -0
- package/src/util/point.ts +195 -0
- package/src/util/shape.ts +609 -0
- package/src/util/shape3d.ts +198 -0
- package/src/util/text.ts +49 -0
- package/src/util/type.ts +4 -0
- package/src/util/zoom.ts +39 -0
- package/README.en-US.md +0 -170
- package/README.md +0 -177
- package/dist/g6.min.js.map +0 -1
- package/es/index.d.ts +0 -4
- package/es/index.js +0 -5
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.extend = void 0;
|
|
7
|
+
const stdlib_1 = __importDefault(require("../stdlib"));
|
|
8
|
+
/**
|
|
9
|
+
* Extend graph class with custom libs (extendLibrary), and extendLibrary will be merged into useLib.
|
|
10
|
+
* B1 is the Behavior lib from user, B2 is the Behavior lib of the graph to be extended(built-in graph)
|
|
11
|
+
* TODO: more templates, and might be merged to be two templates for the whole extendLibrary
|
|
12
|
+
* @param GraphClass graph class to be extended
|
|
13
|
+
* @param extendLibrary custom libs to extend
|
|
14
|
+
* @returns extended graph class
|
|
15
|
+
*/
|
|
16
|
+
const extend = (GraphClass, extendLibrary) => {
|
|
17
|
+
// merged the extendLibrary to useLib for global usage
|
|
18
|
+
Object.keys(extendLibrary).forEach((cat) => {
|
|
19
|
+
stdlib_1.default.useLib[cat] = Object.assign({}, stdlib_1.default.useLib[cat], extendLibrary[cat] || {});
|
|
20
|
+
Object.keys(stdlib_1.default.useLib[cat]).forEach((type) => {
|
|
21
|
+
const extension = stdlib_1.default.useLib[cat][type];
|
|
22
|
+
extension.type = type;
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
// @ts-expect-error
|
|
26
|
+
return GraphClass;
|
|
27
|
+
};
|
|
28
|
+
exports.extend = extend;
|
|
29
|
+
//# sourceMappingURL=extend.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extend.js","sourceRoot":"src/","sources":["util/extend.ts"],"names":[],"mappings":";;;;;;AAGA,uDAAiC;AAEjC;;;;;;;GAOG;AACI,MAAM,MAAM,GAAG,CAMpB,UAAgC,EAChC,aAKC,EAC+B,EAAE;IAClC,sDAAsD;IACtD,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QACzC,gBAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,CAClC,EAAE,EACF,gBAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,EACpB,aAAa,CAAC,GAAG,CAAC,IAAI,EAAE,CACzB,CAAC;QACF,MAAM,CAAC,IAAI,CAAC,gBAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YACjD,MAAM,SAAS,GAAG,gBAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC;YAC7C,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC;QACxB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,mBAAmB;IACnB,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AA5BW,QAAA,MAAM,UA4BjB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { StdLibCategory } from '../types/stdlib';
|
|
2
|
+
/**
|
|
3
|
+
* Get one extension from a (std)lib.
|
|
4
|
+
* @param config extension's config
|
|
5
|
+
* @param lib any lib
|
|
6
|
+
* @param {StdLibCategory} cat category of the extension
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
9
|
+
export declare const getExtension: (config: string | Function | object, lib: any, cat: StdLibCategory) => any;
|
|
10
|
+
export declare const getCatExtensions: (lib: any, cat: StdLibCategory) => any;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCatExtensions = exports.getExtension = void 0;
|
|
4
|
+
const util_1 = require("util");
|
|
5
|
+
/**
|
|
6
|
+
* Get one extension from a (std)lib.
|
|
7
|
+
* @param config extension's config
|
|
8
|
+
* @param lib any lib
|
|
9
|
+
* @param {StdLibCategory} cat category of the extension
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
const getExtension = (config, lib, cat) => {
|
|
13
|
+
var _a;
|
|
14
|
+
const catKey = `${cat}s`;
|
|
15
|
+
// TODO: whether keep function type config?
|
|
16
|
+
if ((0, util_1.isFunction)(config)) {
|
|
17
|
+
return config;
|
|
18
|
+
}
|
|
19
|
+
const type = typeof config === 'string' ? config : config.type;
|
|
20
|
+
const ext = (_a = lib[catKey]) === null || _a === void 0 ? void 0 : _a[type];
|
|
21
|
+
return ext;
|
|
22
|
+
};
|
|
23
|
+
exports.getExtension = getExtension;
|
|
24
|
+
const getCatExtensions = (lib, cat) => {
|
|
25
|
+
const catKey = `${cat}s`;
|
|
26
|
+
return lib[catKey];
|
|
27
|
+
};
|
|
28
|
+
exports.getCatExtensions = getCatExtensions;
|
|
29
|
+
//# sourceMappingURL=extension.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension.js","sourceRoot":"src/","sources":["util/extension.ts"],"names":[],"mappings":";;;AAAA,+BAAkC;AAGlC;;;;;;GAMG;AACI,MAAM,YAAY,GAAG,CAC1B,MAAkC,EAClC,GAAG,EACH,GAAmB,EACnB,EAAE;;IACF,MAAM,MAAM,GAAG,GAAG,GAAG,GAAG,CAAC;IACzB,2CAA2C;IAC3C,IAAI,IAAA,iBAAU,EAAC,MAAM,CAAC,EAAE;QACtB,OAAO,MAAM,CAAC;KACf;IACD,MAAM,IAAI,GAAG,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAE,MAAc,CAAC,IAAI,CAAC;IACxE,MAAM,GAAG,GAAG,MAAA,GAAG,CAAC,MAAM,CAAC,0CAAG,IAAI,CAAC,CAAC;IAChC,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAbW,QAAA,YAAY,gBAavB;AAEK,MAAM,gBAAgB,GAAG,CAAC,GAAG,EAAE,GAAmB,EAAE,EAAE;IAC3D,MAAM,MAAM,GAAG,GAAG,GAAG,GAAG,CAAC;IACzB,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC;AACrB,CAAC,CAAC;AAHW,QAAA,gBAAgB,oBAG3B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare const Util: {
|
|
2
|
+
extend: <B1 extends import("../types/behavior").BehaviorRegistry, B2 extends import("../types/behavior").BehaviorRegistry, T1 extends import("../types/theme").ThemeRegistry, T2 extends import("../types/theme").ThemeRegistry>(GraphClass: {
|
|
3
|
+
new (spec: import("..").Specification<B2, T2>): import("../runtime/graph").default<B2, T2>;
|
|
4
|
+
}, extendLibrary: {
|
|
5
|
+
behaviors?: B1;
|
|
6
|
+
themeSolvers?: T1;
|
|
7
|
+
nodes?: any;
|
|
8
|
+
edges?: any;
|
|
9
|
+
}) => {
|
|
10
|
+
new (spec: import("..").Specification<B1 & B2, T1 & T2>): import("../runtime/graph").default<B1 & B2, T1 & T2>;
|
|
11
|
+
};
|
|
12
|
+
isEncode: (value: any) => value is import("../types/item").Encode<any>;
|
|
13
|
+
};
|
|
14
|
+
export default Util;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const extend_1 = require("./extend");
|
|
4
|
+
const type_1 = require("./type");
|
|
5
|
+
const Util = { extend: extend_1.extend, isEncode: type_1.isEncode };
|
|
6
|
+
exports.default = Util;
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["util/index.ts"],"names":[],"mappings":";;AAAA,qCAAkC;AAClC,iCAAkC;AAClC,MAAM,IAAI,GAAG,EAAE,MAAM,EAAN,eAAM,EAAE,QAAQ,EAAR,eAAQ,EAAE,CAAC;AAClC,kBAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ID } from '@antv/graphlib';
|
|
2
|
+
import { Group } from '@antv/g';
|
|
3
|
+
import { IGraph } from '../types';
|
|
4
|
+
import Combo from '../item/combo';
|
|
5
|
+
import Edge from '../item/edge';
|
|
6
|
+
import Node from '../item/node';
|
|
7
|
+
/**
|
|
8
|
+
* Find the edges whose source and target are both in the ids.
|
|
9
|
+
* @param graph graph instance
|
|
10
|
+
* @param ids the end nodes/combos id list
|
|
11
|
+
* @returns id list of the edges meet the condition
|
|
12
|
+
*/
|
|
13
|
+
export declare const getEdgesBetween: (graph: IGraph, ids: ID[]) => ID[];
|
|
14
|
+
export declare const upsertTransientItem: (item: Node | Edge | Combo, nodeGroup: Group, edgeGroup: Group, transientItemMap: Record<string, Node | Edge | Combo | Group>, onlyDrawKeyShape?: boolean) => Group | Combo | Node | Edge;
|
package/lib/util/item.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.upsertTransientItem = exports.getEdgesBetween = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Find the edges whose source and target are both in the ids.
|
|
6
|
+
* @param graph graph instance
|
|
7
|
+
* @param ids the end nodes/combos id list
|
|
8
|
+
* @returns id list of the edges meet the condition
|
|
9
|
+
*/
|
|
10
|
+
const getEdgesBetween = (graph, ids) => {
|
|
11
|
+
const edgeIdSet = new Set();
|
|
12
|
+
ids.forEach((endId) => {
|
|
13
|
+
const edgesData = graph.getRelatedEdgesData(endId);
|
|
14
|
+
edgesData.forEach((edge) => {
|
|
15
|
+
const { source, target, id } = edge;
|
|
16
|
+
if (!graph.getItemVisible(id))
|
|
17
|
+
return; // hidden edge is not selectable
|
|
18
|
+
if (ids.includes(source) && ids.includes(target))
|
|
19
|
+
edgeIdSet.add(id);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
return Array.from(edgeIdSet);
|
|
23
|
+
};
|
|
24
|
+
exports.getEdgesBetween = getEdgesBetween;
|
|
25
|
+
const upsertTransientItem = (item, nodeGroup, edgeGroup, transientItemMap, onlyDrawKeyShape) => {
|
|
26
|
+
const transientItem = transientItemMap[item.model.id];
|
|
27
|
+
if (transientItem) {
|
|
28
|
+
return transientItem;
|
|
29
|
+
}
|
|
30
|
+
if (item.type === 'node') {
|
|
31
|
+
const transientNode = item.clone(nodeGroup, onlyDrawKeyShape, true);
|
|
32
|
+
transientItemMap[item.model.id] = transientNode;
|
|
33
|
+
transientNode.transient = true;
|
|
34
|
+
return transientNode;
|
|
35
|
+
}
|
|
36
|
+
else if (item.type === 'edge') {
|
|
37
|
+
const source = (0, exports.upsertTransientItem)(item.sourceItem, nodeGroup, edgeGroup, transientItemMap, onlyDrawKeyShape);
|
|
38
|
+
const target = (0, exports.upsertTransientItem)(item.targetItem, nodeGroup, edgeGroup, transientItemMap, onlyDrawKeyShape);
|
|
39
|
+
const transientEdge = item.clone(edgeGroup, source, target, undefined, true);
|
|
40
|
+
transientEdge.transient = true;
|
|
41
|
+
transientItemMap[item.model.id] = transientEdge;
|
|
42
|
+
return transientEdge;
|
|
43
|
+
}
|
|
44
|
+
// TODO: clone combo
|
|
45
|
+
};
|
|
46
|
+
exports.upsertTransientItem = upsertTransientItem;
|
|
47
|
+
//# sourceMappingURL=item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item.js","sourceRoot":"src/","sources":["util/item.ts"],"names":[],"mappings":";;;AAOA;;;;;GAKG;AACI,MAAM,eAAe,GAAG,CAAC,KAAa,EAAE,GAAS,EAAQ,EAAE;IAChE,MAAM,SAAS,GAAG,IAAI,GAAG,EAAM,CAAC;IAChC,GAAG,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QACpB,MAAM,SAAS,GAAG,KAAK,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;QACnD,SAAS,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YACzB,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,IAAI,CAAC;YACpC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,EAAE,CAAC;gBAAE,OAAO,CAAC,gCAAgC;YACvE,IAAI,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC;gBAAE,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACtE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,OAAO,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAC/B,CAAC,CAAC;AAXW,QAAA,eAAe,mBAW1B;AAEK,MAAM,mBAAmB,GAAG,CACjC,IAAyB,EACzB,SAAgB,EAChB,SAAgB,EAChB,gBAA6D,EAC7D,gBAA0B,EAC1B,EAAE;IACF,MAAM,aAAa,GAAG,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACtD,IAAI,aAAa,EAAE;QACjB,OAAO,aAAa,CAAC;KACtB;IACD,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE;QACxB,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,gBAAgB,EAAE,IAAI,CAAS,CAAC;QAC5E,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC;QAChD,aAAa,CAAC,SAAS,GAAG,IAAI,CAAC;QAC/B,OAAO,aAAa,CAAC;KACtB;SAAM,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE;QAC/B,MAAM,MAAM,GAAG,IAAA,2BAAmB,EAChC,IAAI,CAAC,UAAU,EACf,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,gBAAgB,CACT,CAAC;QACV,MAAM,MAAM,GAAG,IAAA,2BAAmB,EAChC,IAAI,CAAC,UAAU,EACf,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,gBAAgB,CACT,CAAC;QACV,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAC9B,SAAS,EACT,MAAM,EACN,MAAM,EACN,SAAS,EACT,IAAI,CACG,CAAC;QACV,aAAa,CAAC,SAAS,GAAG,IAAI,CAAC;QAC/B,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC;QAChD,OAAO,aAAa,CAAC;KACtB;IACD,oBAAoB;AACtB,CAAC,CAAC;AA3CW,QAAA,mBAAmB,uBA2C9B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { NodeDisplayModelData } from '../types/node';
|
|
2
|
+
/**
|
|
3
|
+
* Default mapper to transform simple styles in inner data.
|
|
4
|
+
*/
|
|
5
|
+
export declare const DEFAULT_MAPPER: {
|
|
6
|
+
node: (innerNodeModel: any) => {
|
|
7
|
+
id: any;
|
|
8
|
+
data: NodeDisplayModelData;
|
|
9
|
+
};
|
|
10
|
+
edge: (innerEdgeModel: any) => {
|
|
11
|
+
id: any;
|
|
12
|
+
source: any;
|
|
13
|
+
target: any;
|
|
14
|
+
data: NodeDisplayModelData;
|
|
15
|
+
};
|
|
16
|
+
combo: (innerComboModel: any) => any;
|
|
17
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_MAPPER = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Default mapper to transform simple styles in inner data.
|
|
6
|
+
*/
|
|
7
|
+
exports.DEFAULT_MAPPER = {
|
|
8
|
+
node: (innerNodeModel) => {
|
|
9
|
+
const { id, data } = innerNodeModel;
|
|
10
|
+
const { color, label, icon, badges, anchorPoints } = data;
|
|
11
|
+
const resultData = Object.assign(Object.assign({}, data), { keyShape: {} });
|
|
12
|
+
if (color) {
|
|
13
|
+
resultData.keyShape.fill = color;
|
|
14
|
+
}
|
|
15
|
+
if (label) {
|
|
16
|
+
resultData.labelShape = {
|
|
17
|
+
text: label,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
if (icon) {
|
|
21
|
+
resultData.iconShape = icon;
|
|
22
|
+
}
|
|
23
|
+
if (badges) {
|
|
24
|
+
resultData.badgeShapes = badges;
|
|
25
|
+
}
|
|
26
|
+
if (anchorPoints) {
|
|
27
|
+
resultData.anchorShapes = anchorPoints.map((point) => ({
|
|
28
|
+
position: point,
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
id,
|
|
33
|
+
data: resultData,
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
edge: (innerEdgeModel) => {
|
|
37
|
+
const { id, source, target, data } = innerEdgeModel;
|
|
38
|
+
const { color, label, icon, badge } = data;
|
|
39
|
+
const resultData = Object.assign(Object.assign({}, data), { keyShape: {} });
|
|
40
|
+
if (color) {
|
|
41
|
+
resultData.keyShape.stroke = color;
|
|
42
|
+
}
|
|
43
|
+
if (label) {
|
|
44
|
+
resultData.labelShape = {
|
|
45
|
+
text: label,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
if (icon) {
|
|
49
|
+
resultData.iconShape = icon;
|
|
50
|
+
}
|
|
51
|
+
if (badge) {
|
|
52
|
+
resultData.badgeShape = badge;
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
id,
|
|
56
|
+
source,
|
|
57
|
+
target,
|
|
58
|
+
data: resultData,
|
|
59
|
+
};
|
|
60
|
+
},
|
|
61
|
+
combo: (innerComboModel) => innerComboModel,
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=mapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapper.js","sourceRoot":"src/","sources":["util/mapper.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACU,QAAA,cAAc,GAAG;IAC5B,IAAI,EAAE,CAAC,cAAc,EAAE,EAAE;QACvB,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,cAAc,CAAC;QACpC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;QAC1D,MAAM,UAAU,mCAA8B,IAAI,KAAE,QAAQ,EAAE,EAAE,GAAE,CAAC;QACnE,IAAI,KAAK,EAAE;YACT,UAAU,CAAC,QAAQ,CAAC,IAAI,GAAG,KAAK,CAAC;SAClC;QACD,IAAI,KAAK,EAAE;YACT,UAAU,CAAC,UAAU,GAAG;gBACtB,IAAI,EAAE,KAAK;aACZ,CAAC;SACH;QACD,IAAI,IAAI,EAAE;YACR,UAAU,CAAC,SAAS,GAAG,IAAI,CAAC;SAC7B;QACD,IAAI,MAAM,EAAE;YACV,UAAU,CAAC,WAAW,GAAG,MAAM,CAAC;SACjC;QACD,IAAI,YAAY,EAAE;YAChB,UAAU,CAAC,YAAY,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;gBACrD,QAAQ,EAAE,KAAK;aAChB,CAAC,CAAC,CAAC;SACL;QACD,OAAO;YACL,EAAE;YACF,IAAI,EAAE,UAAU;SACjB,CAAC;IACJ,CAAC;IACD,IAAI,EAAE,CAAC,cAAc,EAAE,EAAE;QACvB,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,cAAc,CAAC;QACpD,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;QAC3C,MAAM,UAAU,mCAA8B,IAAI,KAAE,QAAQ,EAAE,EAAE,GAAE,CAAC;QACnE,IAAI,KAAK,EAAE;YACT,UAAU,CAAC,QAAQ,CAAC,MAAM,GAAG,KAAK,CAAC;SACpC;QACD,IAAI,KAAK,EAAE;YACT,UAAU,CAAC,UAAU,GAAG;gBACtB,IAAI,EAAE,KAAK;aACZ,CAAC;SACH;QACD,IAAI,IAAI,EAAE;YACR,UAAU,CAAC,SAAS,GAAG,IAAI,CAAC;SAC7B;QACD,IAAI,KAAK,EAAE;YACT,UAAU,CAAC,UAAU,GAAG,KAAK,CAAC;SAC/B;QACD,OAAO;YACL,EAAE;YACF,MAAM;YACN,MAAM;YACN,IAAI,EAAE,UAAU;SACjB,CAAC;IACJ,CAAC;IACD,KAAK,EAAE,CAAC,eAAe,EAAE,EAAE,CAAC,eAAe;CAC5C,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether the value is begween the range of [min, max]
|
|
3
|
+
* @param {number} value the value to be judged
|
|
4
|
+
* @param {number} min the min of the range
|
|
5
|
+
* @param {number} max the max of the range
|
|
6
|
+
* @return {boolean} bool the result boolean
|
|
7
|
+
*/
|
|
8
|
+
export declare const isBetween: (value: number, min: number, max: number) => boolean;
|
package/lib/util/math.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isBetween = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Whether the value is begween the range of [min, max]
|
|
6
|
+
* @param {number} value the value to be judged
|
|
7
|
+
* @param {number} min the min of the range
|
|
8
|
+
* @param {number} max the max of the range
|
|
9
|
+
* @return {boolean} bool the result boolean
|
|
10
|
+
*/
|
|
11
|
+
const isBetween = (value, min, max) => value >= min && value <= max;
|
|
12
|
+
exports.isBetween = isBetween;
|
|
13
|
+
//# sourceMappingURL=math.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"math.js","sourceRoot":"src/","sources":["util/math.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACI,MAAM,SAAS,GAAG,CAAC,KAAa,EAAE,GAAW,EAAE,GAAW,EAAE,EAAE,CACnE,KAAK,IAAI,GAAG,IAAI,KAAK,IAAI,GAAG,CAAC;AADlB,QAAA,SAAS,aACS"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Point } from '../types/common';
|
|
2
|
+
/**
|
|
3
|
+
* Find the nearest on in points to the curPoint.
|
|
4
|
+
* @param points
|
|
5
|
+
* @param curPoint
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export declare const getNearestPoint: (points: Point[], curPoint: Point) => {
|
|
9
|
+
index: number;
|
|
10
|
+
nearestPoint: Point;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Get distance by two points.
|
|
14
|
+
* @param p1 first point
|
|
15
|
+
* @param p2 second point
|
|
16
|
+
*/
|
|
17
|
+
export declare const distance: (p1: Point, p2: Point) => number;
|
|
18
|
+
/**
|
|
19
|
+
* Get point and circle intersect point.
|
|
20
|
+
* @param {ICircle} circle Circle's center x,y and radius r
|
|
21
|
+
* @param {Point} point Point x,y
|
|
22
|
+
* @return {Point} calculated intersect point
|
|
23
|
+
*/
|
|
24
|
+
export declare const getCircleIntersectByPoint: (circleProps: {
|
|
25
|
+
x: number;
|
|
26
|
+
y: number;
|
|
27
|
+
r: number;
|
|
28
|
+
}, point: Point) => Point | null;
|
|
29
|
+
/**
|
|
30
|
+
* Get point and ellipse inIntersect.
|
|
31
|
+
* @param {Object} ellipse ellipse center x,y and radius rx,ry
|
|
32
|
+
* @param {Object} point Point x,y
|
|
33
|
+
* @return {object} calculated intersect point
|
|
34
|
+
*/
|
|
35
|
+
export declare const getEllipseIntersectByPoint: (ellipseProps: {
|
|
36
|
+
rx: number;
|
|
37
|
+
ry: number;
|
|
38
|
+
x: number;
|
|
39
|
+
y: number;
|
|
40
|
+
}, point: Point) => Point;
|
|
41
|
+
/**
|
|
42
|
+
* Point and rectangular intersection point.
|
|
43
|
+
* @param {IRect} rect rect
|
|
44
|
+
* @param {Point} point point
|
|
45
|
+
* @return {PointPoint} rst;
|
|
46
|
+
*/
|
|
47
|
+
export declare const getRectIntersectByPoint: (rectProps: {
|
|
48
|
+
x: number;
|
|
49
|
+
y: number;
|
|
50
|
+
width: number;
|
|
51
|
+
height: number;
|
|
52
|
+
}, point: Point) => Point | null;
|
|
53
|
+
/**
|
|
54
|
+
* Get the intersect point of two lines.
|
|
55
|
+
* @param {Point} p0 The start point of the first line.
|
|
56
|
+
* @param {Point} p1 The end point of the first line.
|
|
57
|
+
* @param {Point} p2 The start point of the second line.
|
|
58
|
+
* @param {Point} p3 The end point of the second line.
|
|
59
|
+
* @return {Point} Calculated intersect point.
|
|
60
|
+
*/
|
|
61
|
+
export declare const getLineIntersect: (p0: Point, p1: Point, p2: Point, p3: Point) => Point | null;
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLineIntersect = exports.getRectIntersectByPoint = exports.getEllipseIntersectByPoint = exports.getCircleIntersectByPoint = exports.distance = exports.getNearestPoint = void 0;
|
|
4
|
+
const math_1 = require("./math");
|
|
5
|
+
/**
|
|
6
|
+
* Find the nearest on in points to the curPoint.
|
|
7
|
+
* @param points
|
|
8
|
+
* @param curPoint
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
const getNearestPoint = (points, curPoint) => {
|
|
12
|
+
let index = 0;
|
|
13
|
+
let nearestPoint = points[0];
|
|
14
|
+
let minDistance = (0, exports.distance)(points[0], curPoint);
|
|
15
|
+
for (let i = 0; i < points.length; i++) {
|
|
16
|
+
const point = points[i];
|
|
17
|
+
const dis = (0, exports.distance)(point, curPoint);
|
|
18
|
+
if (dis < minDistance) {
|
|
19
|
+
nearestPoint = point;
|
|
20
|
+
minDistance = dis;
|
|
21
|
+
index = i;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
index,
|
|
26
|
+
nearestPoint,
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
exports.getNearestPoint = getNearestPoint;
|
|
30
|
+
/**
|
|
31
|
+
* Get distance by two points.
|
|
32
|
+
* @param p1 first point
|
|
33
|
+
* @param p2 second point
|
|
34
|
+
*/
|
|
35
|
+
const distance = (p1, p2) => {
|
|
36
|
+
const vx = p1.x - p2.x;
|
|
37
|
+
const vy = p1.y - p2.y;
|
|
38
|
+
return Math.sqrt(vx * vx + vy * vy);
|
|
39
|
+
};
|
|
40
|
+
exports.distance = distance;
|
|
41
|
+
/**
|
|
42
|
+
* Get point and circle intersect point.
|
|
43
|
+
* @param {ICircle} circle Circle's center x,y and radius r
|
|
44
|
+
* @param {Point} point Point x,y
|
|
45
|
+
* @return {Point} calculated intersect point
|
|
46
|
+
*/
|
|
47
|
+
const getCircleIntersectByPoint = (circleProps, point) => {
|
|
48
|
+
const { x: cx, y: cy, r } = circleProps;
|
|
49
|
+
const { x, y } = point;
|
|
50
|
+
const dx = x - cx;
|
|
51
|
+
const dy = y - cy;
|
|
52
|
+
if (dx * dx + dy * dy < r * r) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
const angle = Math.atan(dy / dx);
|
|
56
|
+
return {
|
|
57
|
+
x: cx + Math.abs(r * Math.cos(angle)) * Math.sign(dx),
|
|
58
|
+
y: cy + Math.abs(r * Math.sin(angle)) * Math.sign(dy),
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
exports.getCircleIntersectByPoint = getCircleIntersectByPoint;
|
|
62
|
+
/**
|
|
63
|
+
* Get point and ellipse inIntersect.
|
|
64
|
+
* @param {Object} ellipse ellipse center x,y and radius rx,ry
|
|
65
|
+
* @param {Object} point Point x,y
|
|
66
|
+
* @return {object} calculated intersect point
|
|
67
|
+
*/
|
|
68
|
+
const getEllipseIntersectByPoint = (ellipseProps, point) => {
|
|
69
|
+
const { rx: a, ry: b, x: cx, y: cy } = ellipseProps;
|
|
70
|
+
const dx = point.x - cx;
|
|
71
|
+
const dy = point.y - cy;
|
|
72
|
+
// The angle will be in range [-PI, PI]
|
|
73
|
+
let angle = Math.atan2(dy / b, dx / a);
|
|
74
|
+
if (angle < 0) {
|
|
75
|
+
// transfer to [0, 2*PI]
|
|
76
|
+
angle += 2 * Math.PI;
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
x: cx + a * Math.cos(angle),
|
|
80
|
+
y: cy + b * Math.sin(angle),
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
exports.getEllipseIntersectByPoint = getEllipseIntersectByPoint;
|
|
84
|
+
/**
|
|
85
|
+
* Point and rectangular intersection point.
|
|
86
|
+
* @param {IRect} rect rect
|
|
87
|
+
* @param {Point} point point
|
|
88
|
+
* @return {PointPoint} rst;
|
|
89
|
+
*/
|
|
90
|
+
const getRectIntersectByPoint = (rectProps, point) => {
|
|
91
|
+
const { x, y, width, height } = rectProps;
|
|
92
|
+
const cx = x + width / 2;
|
|
93
|
+
const cy = y + height / 2;
|
|
94
|
+
const points = [];
|
|
95
|
+
const center = {
|
|
96
|
+
x: cx,
|
|
97
|
+
y: cy,
|
|
98
|
+
};
|
|
99
|
+
points.push({
|
|
100
|
+
x,
|
|
101
|
+
y,
|
|
102
|
+
});
|
|
103
|
+
points.push({
|
|
104
|
+
x: x + width,
|
|
105
|
+
y,
|
|
106
|
+
});
|
|
107
|
+
points.push({
|
|
108
|
+
x: x + width,
|
|
109
|
+
y: y + height,
|
|
110
|
+
});
|
|
111
|
+
points.push({
|
|
112
|
+
x,
|
|
113
|
+
y: y + height,
|
|
114
|
+
});
|
|
115
|
+
points.push({
|
|
116
|
+
x,
|
|
117
|
+
y,
|
|
118
|
+
});
|
|
119
|
+
let rst = null;
|
|
120
|
+
for (let i = 1; i < points.length; i++) {
|
|
121
|
+
rst = (0, exports.getLineIntersect)(points[i - 1], points[i], center, point);
|
|
122
|
+
if (rst) {
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return rst;
|
|
127
|
+
};
|
|
128
|
+
exports.getRectIntersectByPoint = getRectIntersectByPoint;
|
|
129
|
+
/**
|
|
130
|
+
* Get the intersect point of two lines.
|
|
131
|
+
* @param {Point} p0 The start point of the first line.
|
|
132
|
+
* @param {Point} p1 The end point of the first line.
|
|
133
|
+
* @param {Point} p2 The start point of the second line.
|
|
134
|
+
* @param {Point} p3 The end point of the second line.
|
|
135
|
+
* @return {Point} Calculated intersect point.
|
|
136
|
+
*/
|
|
137
|
+
const getLineIntersect = (p0, p1, p2, p3) => {
|
|
138
|
+
const tolerance = 0.0001;
|
|
139
|
+
const E = {
|
|
140
|
+
x: p2.x - p0.x,
|
|
141
|
+
y: p2.y - p0.y,
|
|
142
|
+
};
|
|
143
|
+
const D0 = {
|
|
144
|
+
x: p1.x - p0.x,
|
|
145
|
+
y: p1.y - p0.y,
|
|
146
|
+
};
|
|
147
|
+
const D1 = {
|
|
148
|
+
x: p3.x - p2.x,
|
|
149
|
+
y: p3.y - p2.y,
|
|
150
|
+
};
|
|
151
|
+
const kross = D0.x * D1.y - D0.y * D1.x;
|
|
152
|
+
const sqrKross = kross * kross;
|
|
153
|
+
const invertKross = 1 / kross;
|
|
154
|
+
const sqrLen0 = D0.x * D0.x + D0.y * D0.y;
|
|
155
|
+
const sqrLen1 = D1.x * D1.x + D1.y * D1.y;
|
|
156
|
+
if (sqrKross > tolerance * sqrLen0 * sqrLen1) {
|
|
157
|
+
const s = (E.x * D1.y - E.y * D1.x) * invertKross;
|
|
158
|
+
const t = (E.x * D0.y - E.y * D0.x) * invertKross;
|
|
159
|
+
if (!(0, math_1.isBetween)(s, 0, 1) || !(0, math_1.isBetween)(t, 0, 1))
|
|
160
|
+
return null;
|
|
161
|
+
return {
|
|
162
|
+
x: p0.x + s * D0.x,
|
|
163
|
+
y: p0.y + s * D0.y,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
return null;
|
|
167
|
+
};
|
|
168
|
+
exports.getLineIntersect = getLineIntersect;
|
|
169
|
+
//# sourceMappingURL=point.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"point.js","sourceRoot":"src/","sources":["util/point.ts"],"names":[],"mappings":";;;AACA,iCAAmC;AAEnC;;;;;GAKG;AACI,MAAM,eAAe,GAAG,CAC7B,MAAe,EACf,QAAe,EAIf,EAAE;IACF,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,YAAY,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IAC7B,IAAI,WAAW,GAAG,IAAA,gBAAQ,EAAC,MAAM,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;IAChD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QACxB,MAAM,GAAG,GAAG,IAAA,gBAAQ,EAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QACtC,IAAI,GAAG,GAAG,WAAW,EAAE;YACrB,YAAY,GAAG,KAAK,CAAC;YACrB,WAAW,GAAG,GAAG,CAAC;YAClB,KAAK,GAAG,CAAC,CAAC;SACX;KACF;IACD,OAAO;QACL,KAAK;QACL,YAAY;KACb,CAAC;AACJ,C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CAAC,GAAG,EAAE,CAAC,CAAC;YAClB,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;SACnB,CAAC;KACH;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAnCW,QAAA,gBAAgB,oBAmC3B"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { Circle, DisplayObject, Ellipse, Group, IElement, Line, Polygon, Polyline, Rect, Text, Image, Path, AABB } from '@antv/g';
|
|
2
|
+
import { Point } from '../types/common';
|
|
3
|
+
import { EdgeDisplayModel, EdgeShapeMap } from '../types/edge';
|
|
4
|
+
import { GShapeStyle, SHAPE_TYPE, ItemShapeStyles, ShapeStyle, SHAPE_TYPE_3D } from '../types/item';
|
|
5
|
+
import { NodeDisplayModel, NodeShapeMap } from '../types/node';
|
|
6
|
+
import { ComboDisplayModel } from '../types';
|
|
7
|
+
export declare const ShapeTagMap: {
|
|
8
|
+
circle: typeof Circle;
|
|
9
|
+
rect: typeof Rect;
|
|
10
|
+
ellipse: typeof Ellipse;
|
|
11
|
+
polygon: typeof Polygon;
|
|
12
|
+
line: typeof Line;
|
|
13
|
+
polyline: typeof Polyline;
|
|
14
|
+
text: typeof Text;
|
|
15
|
+
image: typeof Image;
|
|
16
|
+
path: typeof Path;
|
|
17
|
+
};
|
|
18
|
+
export declare const LOCAL_BOUNDS_DIRTY_FLAG_KEY = "data-item-local-bounds-dirty";
|
|
19
|
+
export declare const createShape: (type: SHAPE_TYPE, style: GShapeStyle, id: string) => Path | Line | Polygon | Circle | Rect | Ellipse | Text | Image;
|
|
20
|
+
/**
|
|
21
|
+
* Create (if does not exit in shapeMap) or update the shape according to the configurations.
|
|
22
|
+
* @param type shape's type
|
|
23
|
+
* @param id unique string to indicates the shape
|
|
24
|
+
* @param style style to be updated
|
|
25
|
+
* @param shapeMap the shape map of a node / edge / combo
|
|
26
|
+
* @param model data model of the node / edge / combo
|
|
27
|
+
* @returns
|
|
28
|
+
*/
|
|
29
|
+
export declare const upsertShape: (type: SHAPE_TYPE, id: string, style: GShapeStyle, shapeMap: {
|
|
30
|
+
[shapeId: string]: DisplayObject<any, any>;
|
|
31
|
+
}, model?: NodeDisplayModel | EdgeDisplayModel | ComboDisplayModel) => DisplayObject;
|
|
32
|
+
export declare const getGroupSucceedMap: (group: IElement, map?: {
|
|
33
|
+
[id: string]: IElement<any, any>;
|
|
34
|
+
}) => {
|
|
35
|
+
[id: string]: IElement<any, any>;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Update shapes in the intersaction of prevShapeMap and newShapeMap;
|
|
39
|
+
* Remove shapes in the prevShapeMap - newShapeMap (if removeDiff is true);
|
|
40
|
+
* Add shapes in the newShapeMap - prevShapeMap;
|
|
41
|
+
* @param prevShapeMap previous shape map
|
|
42
|
+
* @param newShapeMap new shape map
|
|
43
|
+
* @param group container group
|
|
44
|
+
* @returns merged shape map
|
|
45
|
+
*/
|
|
46
|
+
export declare const updateShapes: (prevShapeMap: {
|
|
47
|
+
[id: string]: DisplayObject<any, any>;
|
|
48
|
+
}, newShapeMap: {
|
|
49
|
+
[id: string]: DisplayObject<any, any>;
|
|
50
|
+
}, group: Group, removeDiff?: boolean, shouldUpdate?: (id: string) => boolean) => NodeShapeMap | EdgeShapeMap;
|
|
51
|
+
/**
|
|
52
|
+
* Format the number or array padding to an array with length 4, [padding-top, padding-right, padding-bottom, padding-left].
|
|
53
|
+
* @param value value to be formatted
|
|
54
|
+
* @param defaultArr default value
|
|
55
|
+
* @returns [padding-top, padding-right, padding-bottom, padding-left]
|
|
56
|
+
*/
|
|
57
|
+
export declare const formatPadding: (value: any, defaultArr?: number[]) => any[];
|
|
58
|
+
/**
|
|
59
|
+
* Merge multiple shape style map including undefined value in incoming map.
|
|
60
|
+
* @param styleMaps shapes' styles map array, the latter item in the array will be merged into the former
|
|
61
|
+
* @returns
|
|
62
|
+
*/
|
|
63
|
+
export declare const mergeStyles: (styleMaps: ItemShapeStyles[]) => ItemShapeStyles;
|
|
64
|
+
/**
|
|
65
|
+
* Whether two polygons are intersected.
|
|
66
|
+
* @param points1 vertex array of polygon1
|
|
67
|
+
* @param points2 vertex array of polygon2
|
|
68
|
+
*/
|
|
69
|
+
export declare const isPolygonsIntersect: (points1: number[][], points2: number[][]) => Boolean;
|
|
70
|
+
export declare const intersectBBox: (box1: Partial<AABB>, box2: Partial<AABB>) => boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Whether point is inside the polygon (ray algo)
|
|
73
|
+
* @param points
|
|
74
|
+
* @param x
|
|
75
|
+
* @param y
|
|
76
|
+
*/
|
|
77
|
+
export declare const isPointInPolygon: (points: number[][], x: number, y: number) => boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Get the intersect point of two line.
|
|
80
|
+
* @param {Point} p0 start of the first line
|
|
81
|
+
* @param {Point} p1 end of the first line
|
|
82
|
+
* @param {Point} p2 start of the second line
|
|
83
|
+
* @param {Point} p3 end of the second line
|
|
84
|
+
* @return {Point} the intersect point
|
|
85
|
+
*/
|
|
86
|
+
export declare const getLineIntersect: (p0: Point, p1: Point, p2: Point, p3: Point) => Point | null;
|
|
87
|
+
/**
|
|
88
|
+
* Will the fields in style affect the bbox.
|
|
89
|
+
* @param type shape type
|
|
90
|
+
* @param style style object
|
|
91
|
+
* @returns
|
|
92
|
+
*/
|
|
93
|
+
export declare const isStyleAffectBBox: (type: SHAPE_TYPE | SHAPE_TYPE_3D, style: ShapeStyle) => boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Estimate the width of the shape according to the given style.
|
|
96
|
+
* @param shape target shape
|
|
97
|
+
* @param style computed merged style
|
|
98
|
+
* @param bounds shape's local bounds
|
|
99
|
+
* @returns
|
|
100
|
+
*/
|
|
101
|
+
export declare const getShapeLocalBoundsByStyle: (shape: DisplayObject, style: ShapeStyle, bbox?: AABB) => {
|
|
102
|
+
min: number[];
|
|
103
|
+
max: number[];
|
|
104
|
+
center: number[];
|
|
105
|
+
};
|