@antv/g6 4.8.14 → 5.0.0-alpha.1
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,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.updateShapes3D = exports.upsertShape3D = exports.createShape3D = void 0;
|
|
15
|
+
const g_plugin_3d_1 = require("@antv/g-plugin-3d");
|
|
16
|
+
const shape_1 = require("./shape");
|
|
17
|
+
const GeometryTagMap = {
|
|
18
|
+
sphere: g_plugin_3d_1.SphereGeometry,
|
|
19
|
+
cubic: g_plugin_3d_1.CubeGeometry,
|
|
20
|
+
plane: g_plugin_3d_1.PlaneGeometry,
|
|
21
|
+
};
|
|
22
|
+
const GEOMETRY_SIZE = 10;
|
|
23
|
+
const createShape3D = (type, style, id, device) => {
|
|
24
|
+
// It is not a 3d Shape but 2d.
|
|
25
|
+
if (!GeometryTagMap[type]) {
|
|
26
|
+
return (0, shape_1.createShape)(type, style, id);
|
|
27
|
+
}
|
|
28
|
+
// materialType: 'phong' | 'basic', TODO: type
|
|
29
|
+
const _a = style, { materialType = 'phong' } = _a, otherStyles = __rest(_a, ["materialType"]);
|
|
30
|
+
if (!device.GeometryCache) {
|
|
31
|
+
device.GeometryCache = {};
|
|
32
|
+
}
|
|
33
|
+
// Share the same geometry & material between meshes.
|
|
34
|
+
let cachedGeometry = device.GeometryCache[type];
|
|
35
|
+
if (!cachedGeometry) {
|
|
36
|
+
cachedGeometry = device.GeometryCache[type] = new GeometryTagMap[type](device, {
|
|
37
|
+
radius: GEOMETRY_SIZE,
|
|
38
|
+
latitudeBands: 32,
|
|
39
|
+
longitudeBands: 32,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
if (!device.MaterialCache) {
|
|
43
|
+
device.MaterialCache = {};
|
|
44
|
+
}
|
|
45
|
+
if (!device.MaterialCache[materialType]) {
|
|
46
|
+
switch (materialType) {
|
|
47
|
+
case 'basic':
|
|
48
|
+
device.MaterialCache[materialType] = new g_plugin_3d_1.MeshBasicMaterial(device);
|
|
49
|
+
break;
|
|
50
|
+
case 'phong':
|
|
51
|
+
default: {
|
|
52
|
+
const materialProps = {
|
|
53
|
+
shininess: 30,
|
|
54
|
+
};
|
|
55
|
+
device.MaterialCache[materialType] = new g_plugin_3d_1.MeshPhongMaterial(device, materialProps);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
const shape = new g_plugin_3d_1.Mesh({
|
|
60
|
+
style: Object.assign(Object.assign({}, otherStyles), { geometry: cachedGeometry, material: device.MaterialCache[materialType] }),
|
|
61
|
+
id,
|
|
62
|
+
});
|
|
63
|
+
// set origin for shape
|
|
64
|
+
shape.setOrigin(0, 0, 0);
|
|
65
|
+
// Scale the shape to the correct size.
|
|
66
|
+
switch (type) {
|
|
67
|
+
case 'cube':
|
|
68
|
+
shape.scale([
|
|
69
|
+
style.width / GEOMETRY_SIZE,
|
|
70
|
+
style.height / GEOMETRY_SIZE,
|
|
71
|
+
style.depth / GEOMETRY_SIZE,
|
|
72
|
+
]);
|
|
73
|
+
break;
|
|
74
|
+
case 'plane':
|
|
75
|
+
shape.scale([style.width / GEOMETRY_SIZE, style.depth / GEOMETRY_SIZE]);
|
|
76
|
+
break;
|
|
77
|
+
case 'sphere':
|
|
78
|
+
default: {
|
|
79
|
+
const scaling = (style.r || style.radius) / GEOMETRY_SIZE;
|
|
80
|
+
shape.scale(scaling);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return shape;
|
|
84
|
+
};
|
|
85
|
+
exports.createShape3D = createShape3D;
|
|
86
|
+
const upsertShape3D = (type, id, style, shapeMap, device) => {
|
|
87
|
+
let shape = shapeMap[id];
|
|
88
|
+
if (!shape) {
|
|
89
|
+
shape = (0, exports.createShape3D)(type, style, id, device);
|
|
90
|
+
shape.setAttribute(shape_1.LOCAL_BOUNDS_DIRTY_FLAG_KEY, true);
|
|
91
|
+
}
|
|
92
|
+
else if (shape.nodeName !== type) {
|
|
93
|
+
shape.remove();
|
|
94
|
+
shape = (0, exports.createShape3D)(type, style, id, device);
|
|
95
|
+
shape.setAttribute(shape_1.LOCAL_BOUNDS_DIRTY_FLAG_KEY, true);
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
const updateStyles = {};
|
|
99
|
+
const oldStyles = shape.attributes;
|
|
100
|
+
Object.keys(style).forEach((key) => {
|
|
101
|
+
if (oldStyles[key] !== style[key]) {
|
|
102
|
+
updateStyles[key] = style[key];
|
|
103
|
+
shape.style[key] = style[key];
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
if ((0, shape_1.isStyleAffectBBox)(type, updateStyles)) {
|
|
107
|
+
shape.setAttribute(shape_1.LOCAL_BOUNDS_DIRTY_FLAG_KEY, true);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
shapeMap[id] = shape;
|
|
111
|
+
return shape;
|
|
112
|
+
};
|
|
113
|
+
exports.upsertShape3D = upsertShape3D;
|
|
114
|
+
/**
|
|
115
|
+
* Update shapes in the intersaction of prevShapeMap and newShapeMap;
|
|
116
|
+
* Remove shapes in the prevShapeMap - newShapeMap (if removeDiff is true);
|
|
117
|
+
* Add shapes in the newShapeMap - prevShapeMap;
|
|
118
|
+
* @param prevShapeMap previous shape map
|
|
119
|
+
* @param newShapeMap new shape map
|
|
120
|
+
* @param group container group
|
|
121
|
+
* @returns merged shape map
|
|
122
|
+
*/
|
|
123
|
+
const updateShapes3D = (prevShapeMap, newShapeMap, group, removeDiff = true, shouldUpdate = () => true) => {
|
|
124
|
+
const tolalMap = Object.assign(Object.assign({}, prevShapeMap), newShapeMap);
|
|
125
|
+
const finalShapeMap = Object.assign({}, prevShapeMap);
|
|
126
|
+
Object.keys(tolalMap).forEach((id) => {
|
|
127
|
+
const prevShape = prevShapeMap[id];
|
|
128
|
+
const newShape = newShapeMap[id];
|
|
129
|
+
if (newShape && !shouldUpdate(id))
|
|
130
|
+
return;
|
|
131
|
+
if (prevShape && newShape) {
|
|
132
|
+
// update intersaction
|
|
133
|
+
finalShapeMap[id] = newShape;
|
|
134
|
+
if (prevShape !== newShape) {
|
|
135
|
+
prevShape.remove();
|
|
136
|
+
}
|
|
137
|
+
group.appendChild(newShape);
|
|
138
|
+
}
|
|
139
|
+
else if (!prevShape && newShape) {
|
|
140
|
+
// add newShapeMap - prevShapeMap
|
|
141
|
+
finalShapeMap[id] = newShape;
|
|
142
|
+
group.appendChild(newShape);
|
|
143
|
+
}
|
|
144
|
+
else if (prevShape && !newShape && removeDiff) {
|
|
145
|
+
// remove prevShapeMap - newShapeMap
|
|
146
|
+
delete finalShapeMap[id];
|
|
147
|
+
prevShape.remove();
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
return finalShapeMap;
|
|
151
|
+
};
|
|
152
|
+
exports.updateShapes3D = updateShapes3D;
|
|
153
|
+
//# sourceMappingURL=shape3d.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shape3d.js","sourceRoot":"src/","sources":["util/shape3d.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,mDAQ2B;AAS3B,mCAIiB;AAEjB,MAAM,cAAc,GAAG;IACrB,MAAM,EAAE,4BAAc;IACtB,KAAK,EAAE,0BAAY;IACnB,KAAK,EAAE,2BAAa;CACrB,CAAC;AAEF,MAAM,aAAa,GAAG,EAAE,CAAC;AAElB,MAAM,aAAa,GAAG,CAC3B,IAAgC,EAChC,KAAkB,EAClB,EAAU,EACV,MAAW,EACX,EAAE;IACF,+BAA+B;IAC/B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE;QACzB,OAAO,IAAA,mBAAW,EAAC,IAAkB,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;KACnD;IAED,8CAA8C;IAC9C,MAAM,KAA6C,KAAY,EAAzD,EAAE,YAAY,GAAG,OAAO,OAAiC,EAA5B,WAAW,cAAxC,gBAA0C,CAAe,CAAC;IAChE,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE;QACzB,MAAM,CAAC,aAAa,GAAG,EAAE,CAAC;KAC3B;IAED,qDAAqD;IACrD,IAAI,cAAc,GAAG,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAChD,IAAI,CAAC,cAAc,EAAE;QACnB,cAAc,GAAG,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,CACpE,MAAM,EACN;YACE,MAAM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;aAAM,IAAI,SAAS,IAAI,CAAC,QAAQ,IAAI,UAAU,EAAE;YAC/C,oCAAoC;YACpC,OAAO,aAAa,CAAC,EAAE,CAAC,CAAC;YACzB,SAAS,CAAC,MAAM,EAAE,CAAC;SACpB;IACH,CAAC,CAAC,CAAC;IACH,OAAO,aAA6B,CAAC;AACvC,CAAC,CAAC;AApCW,QAAA,cAAc,kBAoCzB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AABB } from '@antv/g';
|
|
2
|
+
import { Point } from '../types/common';
|
|
3
|
+
/**
|
|
4
|
+
* Get the proper wordWrapWidth for a labelShape according the the 'maxWidth' of keyShape.
|
|
5
|
+
* @param keyShapeBox
|
|
6
|
+
* @param maxWidth
|
|
7
|
+
* @param zoom
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
export declare const getWordWrapWidthByBox: (keyShapeBox: AABB, maxWidth: string | number, zoom?: number) => number;
|
|
11
|
+
/**
|
|
12
|
+
* Get the proper wordWrapWidth for a labelShape according the the distance between two end points and 'maxWidth'.
|
|
13
|
+
* @param points
|
|
14
|
+
* @param maxWidth
|
|
15
|
+
* @param zoom
|
|
16
|
+
* @returns
|
|
17
|
+
*/
|
|
18
|
+
export declare const getWordWrapWidthByEnds: (points: Point[], maxWidth: string | number, zoom?: number) => number;
|
package/lib/util/text.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getWordWrapWidthByEnds = exports.getWordWrapWidthByBox = void 0;
|
|
4
|
+
const layout_1 = require("@antv/layout");
|
|
5
|
+
/**
|
|
6
|
+
* Get the proper wordWrapWidth for a labelShape according the the 'maxWidth' of keyShape.
|
|
7
|
+
* @param keyShapeBox
|
|
8
|
+
* @param maxWidth
|
|
9
|
+
* @param zoom
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
const getWordWrapWidthByBox = (keyShapeBox, maxWidth, zoom = 1) => {
|
|
13
|
+
const keyShapeWidth = (keyShapeBox.max[0] - keyShapeBox.min[0]) * zoom;
|
|
14
|
+
return getWordWrapWidthWithBase(keyShapeWidth, maxWidth);
|
|
15
|
+
};
|
|
16
|
+
exports.getWordWrapWidthByBox = getWordWrapWidthByBox;
|
|
17
|
+
/**
|
|
18
|
+
* Get the proper wordWrapWidth for a labelShape according the the distance between two end points and 'maxWidth'.
|
|
19
|
+
* @param points
|
|
20
|
+
* @param maxWidth
|
|
21
|
+
* @param zoom
|
|
22
|
+
* @returns
|
|
23
|
+
*/
|
|
24
|
+
const getWordWrapWidthByEnds = (points, maxWidth, zoom = 1) => {
|
|
25
|
+
const dist = (0, layout_1.getEuclideanDistance)(points[0], points[1]) * zoom;
|
|
26
|
+
return getWordWrapWidthWithBase(dist, maxWidth);
|
|
27
|
+
};
|
|
28
|
+
exports.getWordWrapWidthByEnds = getWordWrapWidthByEnds;
|
|
29
|
+
const getWordWrapWidthWithBase = (length, maxWidth) => {
|
|
30
|
+
let wordWrapWidth = 2 * length;
|
|
31
|
+
if (typeof maxWidth === 'string') {
|
|
32
|
+
wordWrapWidth = (length * Number(maxWidth.replace('%', ''))) / 100;
|
|
33
|
+
}
|
|
34
|
+
else if (typeof maxWidth === 'number') {
|
|
35
|
+
wordWrapWidth = maxWidth;
|
|
36
|
+
}
|
|
37
|
+
if (isNaN(wordWrapWidth))
|
|
38
|
+
wordWrapWidth = 2 * length;
|
|
39
|
+
return wordWrapWidth;
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.js","sourceRoot":"src/","sources":["util/text.ts"],"names":[],"mappings":";;;AACA,yCAAoD;AAGpD;;;;;;GAMG;AACI,MAAM,qBAAqB,GAAG,CACnC,WAAiB,EACjB,QAAyB,EACzB,IAAI,GAAG,CAAC,EACR,EAAE;IACF,MAAM,aAAa,GAAG,CAAC,WAAW,CA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,KAAqB,CAAC,SAAS,CAAC,CAAC;AADhE,QAAA,QAAQ,YACwD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { LodStrategy, lodStrategyObj } from '../types/item';
|
|
2
|
+
/**
|
|
3
|
+
* Format lodStrategy to the pattern that ratio 1 (primary level) at level 0, and higher the ratio, higher the level.
|
|
4
|
+
* @param lodStrategy
|
|
5
|
+
* @returns
|
|
6
|
+
*/
|
|
7
|
+
export declare const formatLodStrategy: (lodStrategy: LodStrategy) => lodStrategyObj;
|
|
8
|
+
/**
|
|
9
|
+
* Get zoom level idx in levels array.
|
|
10
|
+
* @param levels
|
|
11
|
+
* @param zoom
|
|
12
|
+
* @returns
|
|
13
|
+
*/
|
|
14
|
+
export declare const getZoomLevel: (levels: {
|
|
15
|
+
[idx: string]: [number, number];
|
|
16
|
+
[idx: number]: [number, number];
|
|
17
|
+
}, zoom: number) => number;
|
package/lib/util/zoom.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getZoomLevel = exports.formatLodStrategy = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Format lodStrategy to the pattern that ratio 1 (primary level) at level 0, and higher the ratio, higher the level.
|
|
6
|
+
* @param lodStrategy
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
9
|
+
const formatLodStrategy = (lodStrategy) => {
|
|
10
|
+
const { levels, animateCfg } = lodStrategy || {};
|
|
11
|
+
if (!levels)
|
|
12
|
+
return undefined;
|
|
13
|
+
const primaryLevel = levels.find((level) => level.primary);
|
|
14
|
+
const primaryIndex = levels.indexOf(primaryLevel);
|
|
15
|
+
const formattedLevels = {};
|
|
16
|
+
levels.forEach((level, i) => {
|
|
17
|
+
formattedLevels[i - primaryIndex] = level.zoomRange;
|
|
18
|
+
});
|
|
19
|
+
return {
|
|
20
|
+
animateCfg,
|
|
21
|
+
levels: formattedLevels,
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
exports.formatLodStrategy = formatLodStrategy;
|
|
25
|
+
/**
|
|
26
|
+
* Get zoom level idx in levels array.
|
|
27
|
+
* @param levels
|
|
28
|
+
* @param zoom
|
|
29
|
+
* @returns
|
|
30
|
+
*/
|
|
31
|
+
const getZoomLevel = (levels, zoom) => {
|
|
32
|
+
let level = 0;
|
|
33
|
+
Object.keys(levels).forEach((idx) => {
|
|
34
|
+
const zoomRange = levels[idx];
|
|
35
|
+
if (zoom >= zoomRange[0] && zoom < zoomRange[1])
|
|
36
|
+
level = Number(idx);
|
|
37
|
+
});
|
|
38
|
+
return level;
|
|
39
|
+
};
|
|
40
|
+
exports.getZoomLevel = getZoomLevel;
|
|
41
|
+
//# sourceMappingURL=zoom.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zoom.js","sourceRoot":"src/","sources":["util/zoom.ts"],"names":[],"mappings":";;;AAEA;;;;GAIG;AACI,MAAM,iBAAiB,GAAG,CAAC,WAAwB,EAAkB,EAAE;IAC5E,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,WAAW,IAAI,EAAE,CAAC;IACjD,IAAI,CAAC,MAAM;QAAE,OAAO,SAAS,CAAC;IAC9B,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC3D,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IAClD,MAAM,eAAe,GAAG,EAAE,CAAC;IAC3B,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;QAC1B,eAAe,CAAC,CAAC,GAAG,YAAY,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC;IACtD,CAAC,CAAC,CAAC;IACH,OAAO;QACL,UAAU;QACV,MAAM,EAAE,eAAe;KACxB,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,iBAAiB,qBAa5B;AAEF;;;;;GAKG;AACI,MAAM,YAAY,GAAG,CAC1B,MAAoD,EACpD,IAAY,EACZ,EAAE;IACF,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QAClC,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QAC9B,IAAI,IAAI,IAAI,SAAS,CAAC,CAAC,CAAC,IAAI,IAAI,GAAG,SAAS,CAAC,CAAC,CAAC;YAAE,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;IACH,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAVW,QAAA,YAAY,gBAUvB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/g6",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0-alpha.1",
|
|
4
4
|
"description": "A Graph Visualization Framework in JavaScript",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"antv",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"graph visualization",
|
|
12
12
|
"relational data"
|
|
13
13
|
],
|
|
14
|
-
"homepage": "https://g6.antv.antgroup.com",
|
|
14
|
+
"homepage": "https://g6.antv.antgroup.com/",
|
|
15
15
|
"bugs": {
|
|
16
16
|
"url": "https://github.com/antvis/g6/issues"
|
|
17
17
|
},
|
|
@@ -21,73 +21,105 @@
|
|
|
21
21
|
},
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"author": "https://github.com/orgs/antvis/people",
|
|
24
|
+
"main": "lib/index.js",
|
|
25
|
+
"module": "esm/index.js",
|
|
26
|
+
"types": "lib/index.d.ts",
|
|
24
27
|
"files": [
|
|
25
|
-
"
|
|
26
|
-
"
|
|
28
|
+
"src",
|
|
29
|
+
"esm",
|
|
27
30
|
"lib",
|
|
28
|
-
"dist"
|
|
29
|
-
"LICENSE",
|
|
30
|
-
"README.md"
|
|
31
|
+
"dist"
|
|
31
32
|
],
|
|
32
|
-
"main": "lib/index.js",
|
|
33
|
-
"module": "es/index.js",
|
|
34
|
-
"unpkg": "dist/g6.min.js",
|
|
35
|
-
"types": "lib/index.d.ts",
|
|
36
33
|
"scripts": {
|
|
34
|
+
"dev": "vite",
|
|
37
35
|
"start": "father build --watch",
|
|
38
|
-
"build": "
|
|
39
|
-
"build:
|
|
40
|
-
"
|
|
41
|
-
"
|
|
36
|
+
"build:umd": "rimraf ./dist && rollup -c && npm run size",
|
|
37
|
+
"build:cjs": "rimraf ./lib && tsc --module commonjs --outDir lib",
|
|
38
|
+
"build:esm": "rimraf ./esm && tsc --module ESNext --outDir esm",
|
|
39
|
+
"build": "run-p build:*",
|
|
40
|
+
"bundle-vis": "cross-env BUNDLE_VIS=1 run-p build:umd",
|
|
41
|
+
"prepublishOnly": "npm run ci",
|
|
42
|
+
"ci": "run-s lint build",
|
|
43
|
+
"clean": "rimraf es lib",
|
|
42
44
|
"coverage": "jest --coverage",
|
|
43
|
-
"demos": "start-storybook -p 8080 -c .storybook",
|
|
44
45
|
"doc": "rimraf apis && typedoc",
|
|
45
|
-
"lint": "eslint --
|
|
46
|
-
"lint:src": "eslint --ext .ts --format=pretty \"./src\"",
|
|
47
|
-
"prettier": "prettier -c --write \"**/*\"",
|
|
48
|
-
"test": "jest --passWithNoTests",
|
|
49
|
-
"test-live": "DEBUG_MODE=1 jest --watch ./tests/unit/graph/graph-watermarker-spec.ts",
|
|
46
|
+
"lint": "eslint ./src --quiet && prettier ./src --check",
|
|
50
47
|
"lint-staged:js": "eslint --ext .js,.jsx,.ts,.tsx",
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"
|
|
56
|
-
"pre-commit": "lint-staged"
|
|
57
|
-
}
|
|
48
|
+
"fix": "eslint ./src ./tests --fix && prettier ./src ./tests --write ",
|
|
49
|
+
"test": "jest",
|
|
50
|
+
"size": "limit-size",
|
|
51
|
+
"test-live": "DEBUG_MODE=1 jest --watch ./tests/unit/show-animate-spec.ts",
|
|
52
|
+
"test-behavior": "DEBUG_MODE=1 jest --watch ./tests/unit/item-3d-spec.ts"
|
|
58
53
|
},
|
|
59
54
|
"lint-staged": {
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"prettier --write"
|
|
63
|
-
|
|
64
|
-
"**/*.{less,md,json}": [
|
|
65
|
-
"prettier --write"
|
|
55
|
+
"*.{ts,tsx}": [
|
|
56
|
+
"eslint --fix",
|
|
57
|
+
"prettier --write",
|
|
58
|
+
"git add"
|
|
66
59
|
]
|
|
67
60
|
},
|
|
68
61
|
"dependencies": {
|
|
69
|
-
"@
|
|
62
|
+
"@ant-design/colors": "^7.0.0",
|
|
63
|
+
"@antv/algorithm": "^0.1.25",
|
|
64
|
+
"@antv/dom-util": "^2.0.4",
|
|
65
|
+
"@antv/g": "^5.15.7",
|
|
66
|
+
"@antv/g-canvas": "^1.9.28",
|
|
67
|
+
"@antv/g-plugin-3d": "^1.7.45",
|
|
68
|
+
"@antv/g-plugin-control": "^1.7.43",
|
|
69
|
+
"@antv/g-svg": "^1.8.36",
|
|
70
|
+
"@antv/g-webgl": "^1.7.44",
|
|
71
|
+
"@antv/g6": "^4.8.13",
|
|
72
|
+
"@antv/graphlib": "^2.0.0",
|
|
73
|
+
"@antv/gui": "^0.5.0-alpha.16",
|
|
74
|
+
"@antv/layout": "^1.2.0",
|
|
75
|
+
"@antv/layout-gpu": "^1.0.0",
|
|
76
|
+
"@antv/layout-wasm": "1.3.1",
|
|
77
|
+
"@antv/matrix-util": "^3.0.4",
|
|
78
|
+
"@antv/util": "~2.0.5",
|
|
79
|
+
"color": "^4.2.3",
|
|
80
|
+
"tslib": "^2.5.0",
|
|
81
|
+
"typedoc-plugin-markdown": "^3.14.0"
|
|
70
82
|
},
|
|
71
83
|
"devDependencies": {
|
|
72
|
-
"@
|
|
73
|
-
"@babel/plugin-proposal-class-properties": "^7.1.0",
|
|
74
|
-
"@turf/turf": "^5.1.6",
|
|
75
|
-
"@types/jest": "^25.2.1",
|
|
84
|
+
"@types/jest": "^29.5.1",
|
|
76
85
|
"@types/node": "13.11.1",
|
|
77
|
-
"@typescript-eslint/eslint-plugin": "^4.
|
|
86
|
+
"@typescript-eslint/eslint-plugin": "^4.18.0",
|
|
87
|
+
"@typescript-eslint/parser": "^4.18.0",
|
|
78
88
|
"@umijs/fabric": "^2.0.0",
|
|
89
|
+
"awesome-typescript-loader": "^5.2.1",
|
|
79
90
|
"babel-loader": "^8.0.6",
|
|
80
|
-
"eslint": "^7.
|
|
81
|
-
"
|
|
91
|
+
"eslint": "^7.22.0",
|
|
92
|
+
"eslint-plugin-import": "^2.22.1",
|
|
82
93
|
"father": "^2.29.1",
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
94
|
+
"jest": "^26.0.1",
|
|
95
|
+
"jest-electron": "^0.1.7",
|
|
96
|
+
"jest-extended": "^0.11.2",
|
|
97
|
+
"limit-size": "^0.1.4",
|
|
98
|
+
"lint-staged": "^10.5.4",
|
|
99
|
+
"npm-run-all": "^4.1.5",
|
|
100
|
+
"prettier": "^2.2.1",
|
|
87
101
|
"rimraf": "^3.0.0",
|
|
88
|
-
"
|
|
102
|
+
"rollup": "^2.39.0",
|
|
103
|
+
"rollup-plugin-node-resolve": "^5.2.0",
|
|
104
|
+
"rollup-plugin-polyfill-node": "^0.8.0",
|
|
105
|
+
"rollup-plugin-typescript": "^1.0.1",
|
|
106
|
+
"rollup-plugin-uglify": "^6.0.4",
|
|
107
|
+
"rollup-plugin-visualizer": "^5.6.0",
|
|
108
|
+
"stats.js": "^0.17.0",
|
|
109
|
+
"ts-jest": "^24.1.0",
|
|
110
|
+
"typedoc": "^0.23.24",
|
|
89
111
|
"typescript": "^4.6.3",
|
|
90
|
-
"
|
|
91
|
-
|
|
92
|
-
|
|
112
|
+
"vite": "^4.2.2"
|
|
113
|
+
},
|
|
114
|
+
"limit-size": [
|
|
115
|
+
{
|
|
116
|
+
"path": "dist/g6.min.js",
|
|
117
|
+
"limit": "750 Kb",
|
|
118
|
+
"gzip": true
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"path": "dist/g6.min.js",
|
|
122
|
+
"limit": "2 Mb"
|
|
123
|
+
}
|
|
124
|
+
]
|
|
93
125
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './shape';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export const RESERVED_SHAPE_IDS = [
|
|
2
|
+
'keyShape',
|
|
3
|
+
'labelShape',
|
|
4
|
+
'labelBackgroundShape',
|
|
5
|
+
'iconShape',
|
|
6
|
+
'haloShape',
|
|
7
|
+
'anchorShapes',
|
|
8
|
+
'badgeShapes',
|
|
9
|
+
];
|
|
10
|
+
export const OTHER_SHAPES_FIELD_NAME = 'otherShapes';
|
|
11
|
+
|
|
12
|
+
export const DEFAULT_LABEL_BG_PADDING = [4, 4, 4, 4];
|
|
13
|
+
/** Default shape style to avoid shape value missing */
|
|
14
|
+
export const DEFAULT_SHAPE_STYLE = {
|
|
15
|
+
opacity: 1,
|
|
16
|
+
fillOpacity: 1,
|
|
17
|
+
shadowColor: undefined,
|
|
18
|
+
shadowBlur: 0,
|
|
19
|
+
lineDash: undefined,
|
|
20
|
+
zIndex: 0,
|
|
21
|
+
};
|
|
22
|
+
/** Default text style to avoid shape value missing */
|
|
23
|
+
export const DEFAULT_TEXT_STYLE = {
|
|
24
|
+
...DEFAULT_SHAPE_STYLE,
|
|
25
|
+
fontSize: 12,
|
|
26
|
+
fontFamily: 'sans-serif',
|
|
27
|
+
fontWeight: 'normal',
|
|
28
|
+
fontVariant: 'normal',
|
|
29
|
+
fontStyle: 'normal',
|
|
30
|
+
// textBaseline: 'middle',
|
|
31
|
+
// textAlign: 'center',
|
|
32
|
+
lineWidth: 0,
|
|
33
|
+
};
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import EmptyGraph from './runtime/graph';
|
|
2
|
+
import { stdLib } from './stdlib';
|
|
3
|
+
import { extend } from './util/extend';
|
|
4
|
+
export * from './types';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Extend the graph class with std lib
|
|
8
|
+
*/
|
|
9
|
+
const Graph = extend(EmptyGraph<{}, {}>, stdLib);
|
|
10
|
+
|
|
11
|
+
export { Graph, stdLib };
|
|
12
|
+
|
|
13
|
+
export default { Graph, stdLib };
|