@antv/g6 4.8.14-beta.0 → 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,198 @@
|
|
|
1
|
+
import { DisplayObject, Group } from '@antv/g';
|
|
2
|
+
import {
|
|
3
|
+
ProceduralGeometry,
|
|
4
|
+
SphereGeometry,
|
|
5
|
+
CubeGeometry,
|
|
6
|
+
Mesh,
|
|
7
|
+
MeshBasicMaterial,
|
|
8
|
+
MeshPhongMaterial,
|
|
9
|
+
PlaneGeometry,
|
|
10
|
+
} from '@antv/g-plugin-3d';
|
|
11
|
+
import { EdgeShapeMap } from '../types/edge';
|
|
12
|
+
import { NodeShapeMap } from '../types/node';
|
|
13
|
+
import {
|
|
14
|
+
GShapeStyle,
|
|
15
|
+
SHAPE_TYPE,
|
|
16
|
+
SHAPE_TYPE_3D,
|
|
17
|
+
ShapeStyle,
|
|
18
|
+
} from '../types/item';
|
|
19
|
+
import {
|
|
20
|
+
LOCAL_BOUNDS_DIRTY_FLAG_KEY,
|
|
21
|
+
createShape,
|
|
22
|
+
isStyleAffectBBox,
|
|
23
|
+
} from './shape';
|
|
24
|
+
|
|
25
|
+
const GeometryTagMap = {
|
|
26
|
+
sphere: SphereGeometry,
|
|
27
|
+
cubic: CubeGeometry,
|
|
28
|
+
plane: PlaneGeometry,
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const GEOMETRY_SIZE = 10;
|
|
32
|
+
|
|
33
|
+
export const createShape3D = (
|
|
34
|
+
type: SHAPE_TYPE_3D | SHAPE_TYPE,
|
|
35
|
+
style: GShapeStyle,
|
|
36
|
+
id: string,
|
|
37
|
+
device: any,
|
|
38
|
+
) => {
|
|
39
|
+
// It is not a 3d Shape but 2d.
|
|
40
|
+
if (!GeometryTagMap[type]) {
|
|
41
|
+
return createShape(type as SHAPE_TYPE, style, id);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// materialType: 'phong' | 'basic', TODO: type
|
|
45
|
+
const { materialType = 'phong', ...otherStyles } = style as any;
|
|
46
|
+
if (!device.GeometryCache) {
|
|
47
|
+
device.GeometryCache = {};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Share the same geometry & material between meshes.
|
|
51
|
+
let cachedGeometry = device.GeometryCache[type];
|
|
52
|
+
if (!cachedGeometry) {
|
|
53
|
+
cachedGeometry = device.GeometryCache[type] = new GeometryTagMap[type](
|
|
54
|
+
device,
|
|
55
|
+
{
|
|
56
|
+
radius: GEOMETRY_SIZE,
|
|
57
|
+
latitudeBands: 32,
|
|
58
|
+
longitudeBands: 32,
|
|
59
|
+
},
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (!device.MaterialCache) {
|
|
64
|
+
device.MaterialCache = {};
|
|
65
|
+
}
|
|
66
|
+
if (!device.MaterialCache[materialType as string]) {
|
|
67
|
+
switch (materialType) {
|
|
68
|
+
case 'basic':
|
|
69
|
+
device.MaterialCache[materialType as string] = new MeshBasicMaterial(
|
|
70
|
+
device,
|
|
71
|
+
);
|
|
72
|
+
break;
|
|
73
|
+
case 'phong':
|
|
74
|
+
default: {
|
|
75
|
+
const materialProps = {
|
|
76
|
+
shininess: 30,
|
|
77
|
+
};
|
|
78
|
+
device.MaterialCache[materialType as string] = new MeshPhongMaterial(
|
|
79
|
+
device,
|
|
80
|
+
materialProps,
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const shape = new Mesh({
|
|
87
|
+
style: {
|
|
88
|
+
...otherStyles,
|
|
89
|
+
geometry: cachedGeometry,
|
|
90
|
+
material: device.MaterialCache[materialType as string],
|
|
91
|
+
},
|
|
92
|
+
id,
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
// set origin for shape
|
|
96
|
+
shape.setOrigin(0, 0, 0);
|
|
97
|
+
|
|
98
|
+
// Scale the shape to the correct size.
|
|
99
|
+
switch (type) {
|
|
100
|
+
case 'cube':
|
|
101
|
+
shape.scale([
|
|
102
|
+
style.width / GEOMETRY_SIZE,
|
|
103
|
+
style.height / GEOMETRY_SIZE,
|
|
104
|
+
style.depth / GEOMETRY_SIZE,
|
|
105
|
+
]);
|
|
106
|
+
break;
|
|
107
|
+
case 'plane':
|
|
108
|
+
shape.scale([style.width / GEOMETRY_SIZE, style.depth / GEOMETRY_SIZE]);
|
|
109
|
+
break;
|
|
110
|
+
case 'sphere':
|
|
111
|
+
default: {
|
|
112
|
+
const scaling =
|
|
113
|
+
(((style as any).r || style.radius) as number) / GEOMETRY_SIZE;
|
|
114
|
+
shape.scale(scaling);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return shape;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export const upsertShape3D = (
|
|
122
|
+
type: SHAPE_TYPE_3D | SHAPE_TYPE,
|
|
123
|
+
id: string,
|
|
124
|
+
style: GShapeStyle,
|
|
125
|
+
shapeMap: { [shapeId: string]: DisplayObject },
|
|
126
|
+
device: any,
|
|
127
|
+
): DisplayObject => {
|
|
128
|
+
let shape = shapeMap[id];
|
|
129
|
+
if (!shape) {
|
|
130
|
+
shape = createShape3D(type, style, id, device);
|
|
131
|
+
shape.setAttribute(LOCAL_BOUNDS_DIRTY_FLAG_KEY, true);
|
|
132
|
+
} else if (shape.nodeName !== type) {
|
|
133
|
+
shape.remove();
|
|
134
|
+
shape = createShape3D(type, style, id, device);
|
|
135
|
+
shape.setAttribute(LOCAL_BOUNDS_DIRTY_FLAG_KEY, true);
|
|
136
|
+
} else {
|
|
137
|
+
const updateStyles = {};
|
|
138
|
+
const oldStyles = shape.attributes;
|
|
139
|
+
Object.keys(style).forEach((key) => {
|
|
140
|
+
if (oldStyles[key] !== style[key]) {
|
|
141
|
+
updateStyles[key] = style[key];
|
|
142
|
+
shape.style[key] = style[key];
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
if (isStyleAffectBBox(type, updateStyles)) {
|
|
146
|
+
shape.setAttribute(LOCAL_BOUNDS_DIRTY_FLAG_KEY, true);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
shapeMap[id] = shape;
|
|
150
|
+
return shape;
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Update shapes in the intersaction of prevShapeMap and newShapeMap;
|
|
155
|
+
* Remove shapes in the prevShapeMap - newShapeMap (if removeDiff is true);
|
|
156
|
+
* Add shapes in the newShapeMap - prevShapeMap;
|
|
157
|
+
* @param prevShapeMap previous shape map
|
|
158
|
+
* @param newShapeMap new shape map
|
|
159
|
+
* @param group container group
|
|
160
|
+
* @returns merged shape map
|
|
161
|
+
*/
|
|
162
|
+
export const updateShapes3D = (
|
|
163
|
+
prevShapeMap: { [id: string]: DisplayObject },
|
|
164
|
+
newShapeMap: { [id: string]: DisplayObject },
|
|
165
|
+
group: Group,
|
|
166
|
+
removeDiff = true,
|
|
167
|
+
shouldUpdate: (id: string) => boolean = () => true,
|
|
168
|
+
): NodeShapeMap | EdgeShapeMap => {
|
|
169
|
+
const tolalMap = {
|
|
170
|
+
...prevShapeMap,
|
|
171
|
+
...newShapeMap,
|
|
172
|
+
};
|
|
173
|
+
const finalShapeMap = {
|
|
174
|
+
...prevShapeMap,
|
|
175
|
+
};
|
|
176
|
+
Object.keys(tolalMap).forEach((id) => {
|
|
177
|
+
const prevShape = prevShapeMap[id];
|
|
178
|
+
const newShape = newShapeMap[id];
|
|
179
|
+
if (newShape && !shouldUpdate(id)) return;
|
|
180
|
+
if (prevShape && newShape) {
|
|
181
|
+
// update intersaction
|
|
182
|
+
finalShapeMap[id] = newShape;
|
|
183
|
+
if (prevShape !== newShape) {
|
|
184
|
+
prevShape.remove();
|
|
185
|
+
}
|
|
186
|
+
group.appendChild(newShape);
|
|
187
|
+
} else if (!prevShape && newShape) {
|
|
188
|
+
// add newShapeMap - prevShapeMap
|
|
189
|
+
finalShapeMap[id] = newShape;
|
|
190
|
+
group.appendChild(newShape);
|
|
191
|
+
} else if (prevShape && !newShape && removeDiff) {
|
|
192
|
+
// remove prevShapeMap - newShapeMap
|
|
193
|
+
delete finalShapeMap[id];
|
|
194
|
+
prevShape.remove();
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
return finalShapeMap as NodeShapeMap;
|
|
198
|
+
};
|
package/src/util/text.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { AABB } from '@antv/g';
|
|
2
|
+
import { getEuclideanDistance } from '@antv/layout';
|
|
3
|
+
import { Point } from '../types/common';
|
|
4
|
+
|
|
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
|
+
export const getWordWrapWidthByBox = (
|
|
13
|
+
keyShapeBox: AABB,
|
|
14
|
+
maxWidth: string | number,
|
|
15
|
+
zoom = 1,
|
|
16
|
+
) => {
|
|
17
|
+
const keyShapeWidth = (keyShapeBox.max[0] - keyShapeBox.min[0]) * zoom;
|
|
18
|
+
return getWordWrapWidthWithBase(keyShapeWidth, maxWidth);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Get the proper wordWrapWidth for a labelShape according the the distance between two end points and 'maxWidth'.
|
|
23
|
+
* @param points
|
|
24
|
+
* @param maxWidth
|
|
25
|
+
* @param zoom
|
|
26
|
+
* @returns
|
|
27
|
+
*/
|
|
28
|
+
export const getWordWrapWidthByEnds = (
|
|
29
|
+
points: Point[],
|
|
30
|
+
maxWidth: string | number,
|
|
31
|
+
zoom = 1,
|
|
32
|
+
) => {
|
|
33
|
+
const dist = getEuclideanDistance(points[0], points[1]) * zoom;
|
|
34
|
+
return getWordWrapWidthWithBase(dist, maxWidth);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const getWordWrapWidthWithBase = (
|
|
38
|
+
length: number,
|
|
39
|
+
maxWidth: string | number,
|
|
40
|
+
) => {
|
|
41
|
+
let wordWrapWidth = 2 * length;
|
|
42
|
+
if (typeof maxWidth === 'string') {
|
|
43
|
+
wordWrapWidth = (length * Number(maxWidth.replace('%', ''))) / 100;
|
|
44
|
+
} else if (typeof maxWidth === 'number') {
|
|
45
|
+
wordWrapWidth = maxWidth;
|
|
46
|
+
}
|
|
47
|
+
if (isNaN(wordWrapWidth)) wordWrapWidth = 2 * length;
|
|
48
|
+
return wordWrapWidth;
|
|
49
|
+
};
|
package/src/util/type.ts
ADDED
package/src/util/zoom.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { LodStrategy, lodStrategyObj } from '../types/item';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Format lodStrategy to the pattern that ratio 1 (primary level) at level 0, and higher the ratio, higher the level.
|
|
5
|
+
* @param lodStrategy
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export const formatLodStrategy = (lodStrategy: LodStrategy): lodStrategyObj => {
|
|
9
|
+
const { levels, animateCfg } = lodStrategy || {};
|
|
10
|
+
if (!levels) return undefined;
|
|
11
|
+
const primaryLevel = levels.find((level) => level.primary);
|
|
12
|
+
const primaryIndex = levels.indexOf(primaryLevel);
|
|
13
|
+
const formattedLevels = {};
|
|
14
|
+
levels.forEach((level, i) => {
|
|
15
|
+
formattedLevels[i - primaryIndex] = level.zoomRange;
|
|
16
|
+
});
|
|
17
|
+
return {
|
|
18
|
+
animateCfg,
|
|
19
|
+
levels: formattedLevels,
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Get zoom level idx in levels array.
|
|
25
|
+
* @param levels
|
|
26
|
+
* @param zoom
|
|
27
|
+
* @returns
|
|
28
|
+
*/
|
|
29
|
+
export const getZoomLevel = (
|
|
30
|
+
levels: { [idx: number | string]: [number, number] },
|
|
31
|
+
zoom: number,
|
|
32
|
+
) => {
|
|
33
|
+
let level = 0;
|
|
34
|
+
Object.keys(levels).forEach((idx) => {
|
|
35
|
+
const zoomRange = levels[idx];
|
|
36
|
+
if (zoom >= zoomRange[0] && zoom < zoomRange[1]) level = Number(idx);
|
|
37
|
+
});
|
|
38
|
+
return level;
|
|
39
|
+
};
|
package/README.en-US.md
DELETED
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
# G6: A Graph Visualization Framework in TypeScript
|
|
2
|
-
|
|
3
|
-

|
|
4
|
-
|
|
5
|
-
[](https://travis-ci.org/antvis/g6) [](https://codecov.io/gh/antvis/G6)   [](https://www.npmjs.com/package/@antv/g6) [](https://npmjs.org/package/@antv/g6) [](http://isitmaintained.com/project/antvis/g6 'Percentage of issues still open')
|
|
6
|
-
|
|
7
|
-
[中文 README](README.md)
|
|
8
|
-
|
|
9
|
-
## What is G6
|
|
10
|
-
|
|
11
|
-
[G6](https://github.com/antvis/g6) is a graph visualization engine, which provides a set of basic mechanisms, including rendering, layout, analysis, interaction, animation, and other auxiliary tools. G6 aims to simplify the relationships, and help people to obtain the insight of relational data.
|
|
12
|
-
|
|
13
|
-
<img src='https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*zTjwQaXokeQAAAAAAAAAAABkARQnAQ' width=550 alt='' />
|
|
14
|
-
|
|
15
|
-
Developers are able to build graph visualization **analysis** applications or graph visualization **modeling** applications easily.
|
|
16
|
-
|
|
17
|
-
<img src='https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*zau8QJcVpDQAAAAAAAAAAABkARQnAQ' height=200 alt='' /><img src='https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*RIlETY_S6IoAAAAAAAAAAABkARQnAQ' height=200 alt='' />
|
|
18
|
-
|
|
19
|
-
<img src='https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*cDzXR4jIWr8AAAAAAAAAAABkARQnAQ' height=150 alt='' /><img src='https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*DifbSahOblAAAAAAAAAAAABkARQnAQ' height=150 alt='' /><img src='https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*HTasSJGC4koAAAAAAAAAAABkARQnAQ' height=150 alt='' />
|
|
20
|
-
|
|
21
|
-
> Powerful Animation and Interactions
|
|
22
|
-
|
|
23
|
-
<img src="https://user-images.githubusercontent.com/6113694/44995293-02858600-afd5-11e8-840c-349e4730d63d.gif" height=150 alt='' /><img src="https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*I9OdTbXJIi0AAAAAAAAAAABkARQnAQ" height=150 alt='' /><img src="https://user-images.githubusercontent.com/6113694/44995332-2ba61680-afd5-11e8-8cab-db0e9d08ceb7.gif" height=150 alt='' />
|
|
24
|
-
|
|
25
|
-
<img src="https://gw.alipayobjects.com/zos/rmsportal/HQxYguinFOMIXrGQOABY.gif" height=150 alt='' /><img src="https://gw.alipayobjects.com/zos/rmsportal/nAugyFgrbrUWPmDIDiQm.gif" height=150 alt='' /><img src="https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*xoufSYcjK2AAAAAAAAAAAABkARQnAQ" height=150 alt='' />
|
|
26
|
-
|
|
27
|
-
> Powerful Layouts
|
|
28
|
-
|
|
29
|
-
## Features
|
|
30
|
-
|
|
31
|
-
- Abundant Built-in Items: Nodes and edges with free configurations;
|
|
32
|
-
- Steerable Interactions: More than 10 basic interaction behaviors ;
|
|
33
|
-
- Powerful Layout: More than 10 layout algorithms;
|
|
34
|
-
- Convenient Components: Outstanding ability and performance;
|
|
35
|
-
- Friendly User Experience: Complete documents for different levels of user requirements. TypeScript supported.
|
|
36
|
-
|
|
37
|
-
G6 concentrates on the principle of 'good by default'. In addition, the custom mechanism of the item, interation behavior, and layout satisfies the customazation requirements.
|
|
38
|
-
|
|
39
|
-
<img src='https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*Y0c6S7cxjVkAAAAAAAAAAABkARQnAQ' width=800 height=200 alt='' />
|
|
40
|
-
|
|
41
|
-
> Abundant Built-in Items
|
|
42
|
-
|
|
43
|
-
## Installation
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
$ npm install @antv/g6
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
## Usage
|
|
50
|
-
|
|
51
|
-
<img src="https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*khbvSrptr0kAAAAAAAAAAABkARQnAQ" width=437 height=148 alt='' />
|
|
52
|
-
|
|
53
|
-
```js
|
|
54
|
-
import G6 from '@antv/g6';
|
|
55
|
-
|
|
56
|
-
const data = {
|
|
57
|
-
nodes: [
|
|
58
|
-
{
|
|
59
|
-
id: 'node1',
|
|
60
|
-
label: 'Circle1',
|
|
61
|
-
x: 150,
|
|
62
|
-
y: 150,
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
id: 'node2',
|
|
66
|
-
label: 'Circle2',
|
|
67
|
-
x: 400,
|
|
68
|
-
y: 150,
|
|
69
|
-
},
|
|
70
|
-
],
|
|
71
|
-
edges: [
|
|
72
|
-
{
|
|
73
|
-
source: 'node1',
|
|
74
|
-
target: 'node2',
|
|
75
|
-
},
|
|
76
|
-
],
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
const graph = new G6.Graph({
|
|
80
|
-
container: 'container',
|
|
81
|
-
width: 500,
|
|
82
|
-
height: 500,
|
|
83
|
-
defaultNode: {
|
|
84
|
-
type: 'circle',
|
|
85
|
-
size: [100],
|
|
86
|
-
color: '#5B8FF9',
|
|
87
|
-
style: {
|
|
88
|
-
fill: '#9EC9FF',
|
|
89
|
-
lineWidth: 3,
|
|
90
|
-
},
|
|
91
|
-
labelCfg: {
|
|
92
|
-
style: {
|
|
93
|
-
fill: '#fff',
|
|
94
|
-
fontSize: 20,
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
defaultEdge: {
|
|
99
|
-
style: {
|
|
100
|
-
stroke: '#e2e2e2',
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
graph.data(data);
|
|
106
|
-
graph.render();
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
[](https://codesandbox.io/s/compassionate-lalande-5lxm7?fontsize=14&hidenavigation=1&theme=dark)
|
|
110
|
-
|
|
111
|
-
For more information of the usage, please refer to [Getting Started](https://g6.antv.antgroup.com/en/manual/getting-started).
|
|
112
|
-
|
|
113
|
-
## Development
|
|
114
|
-
|
|
115
|
-
```bash
|
|
116
|
-
$ npm install
|
|
117
|
-
|
|
118
|
-
# lerna bootstrap for multiple packages
|
|
119
|
-
$ npm run bootstrap
|
|
120
|
-
|
|
121
|
-
# build the packages
|
|
122
|
-
$ npm run build:all
|
|
123
|
-
|
|
124
|
-
# if you wanna watch one of the packages, e.g. packages/core
|
|
125
|
-
$ cd ./packages/core
|
|
126
|
-
$ npm run watch
|
|
127
|
-
|
|
128
|
-
# run test case
|
|
129
|
-
$ npm test
|
|
130
|
-
|
|
131
|
-
# run test case in watch mode
|
|
132
|
-
npm test -- --watch ./tests/unit/algorithm/find-path-spec
|
|
133
|
-
DEBUG_MODE=1 npm test -- --watch ./tests/unit/algorithm/find-path-spec
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
## Documents
|
|
137
|
-
|
|
138
|
-
- <a href='https://g6.antv.antgroup.com/en/manual/tutorial/preface' target='_blank'>Tutorial</a>
|
|
139
|
-
- <a href='https://g6.antv.antgroup.com/en/manual/middle/overview' target='_blank'>Middle Guides</a>
|
|
140
|
-
- <a href='https://g6.antv.antgroup.com/en/manual/advanced/coordinate-system' target='_blank'>Further Reading</a>
|
|
141
|
-
- <a href='https://g6.antv.antgroup.com/en/api/Graph' target='_blank'>API Reference</a>
|
|
142
|
-
|
|
143
|
-
## React project integration
|
|
144
|
-
|
|
145
|
-
For React project integration, we have an independent product recommendation: [Graphin](https://graphin.antv.vision), which is a toolkit based on G6 and React, that focuses on relational visual analysis. It's simple, efficient, out of the box.
|
|
146
|
-
|
|
147
|
-
At present, Graphin has good practices in business graph analysis projects. For details, see [《Who uses Graphin》](https://github.com/antvis/Graphin/issues/212)
|
|
148
|
-
|
|
149
|
-
## G6 Communication Group
|
|
150
|
-
|
|
151
|
-
Welcome to join the **G6 Communication Group** or **G6 Communication Group-2** (DingTalk groups). We also welcome the github issues.
|
|
152
|
-
|
|
153
|
-
<p>
|
|
154
|
-
<a href="https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*-RO_R7SCvroAAAAAAAAAAAAAARQnAQ" >
|
|
155
|
-
<img src='https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*-RO_R7SCvroAAAAAAAAAAAAAARQnAQ' style='width:250px;display:inline-block;vertical-align:top;' alt='' />
|
|
156
|
-
</a>
|
|
157
|
-
<a href="https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*hzfaSrAj0jkAAAAAAAAAAABkARQnAQ" >
|
|
158
|
-
<img src='https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*hzfaSrAj0jkAAAAAAAAAAABkARQnAQ' style='width:250px;display:inline-block;vertical-align:top;' alt='' />
|
|
159
|
-
</a>
|
|
160
|
-
<a href="https://graphin.antv.vision/" >
|
|
161
|
-
<img src='https://camo.githubusercontent.com/5e6624abcdde991f9fd89fce4933ad133a48d8fb603d1852c670da329df73ef7/68747470733a2f2f67772e616c697061796f626a656374732e636f6d2f6d646e2f726d735f3430326331612f616674732f696d672f412a2d717a6f54704c672d3163414141414141414141414141414152516e4151' style='width:250px;display:inline-block;vertical-align: top;' alt='' />
|
|
162
|
-
</a>
|
|
163
|
-
</p>
|
|
164
|
-
## How to Contribute
|
|
165
|
-
|
|
166
|
-
Please let us know what you are you going to help. Do check out [issues](https://github.com/antvis/g6/issues) for bug reports or suggestions first.
|
|
167
|
-
|
|
168
|
-
## License
|
|
169
|
-
|
|
170
|
-
[MIT license](./LICENSE).
|
package/README.md
DELETED
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
# G6:图分析引擎
|
|
2
|
-
|
|
3
|
-

|
|
4
|
-
|
|
5
|
-
[](https://travis-ci.org/antvis/g6) [](https://codecov.io/gh/antvis/G6)   [](https://www.npmjs.com/package/@antv/g6) [](https://npmjs.org/package/@antv/g6) [](http://isitmaintained.com/project/antvis/g6 'Percentage of issues still open')
|
|
6
|
-
|
|
7
|
-
[English README](README.en-US.md)
|
|
8
|
-
|
|
9
|
-
## 什么是 G6
|
|
10
|
-
|
|
11
|
-
[G6](https://github.com/antvis/g6) 是一个图可视化引擎。它提供了图的绘制、布局、分析、交互、动画等图可视化的基础能力。旨在让关系变得透明,简单。让用户获得关系数据的 Insight。
|
|
12
|
-
|
|
13
|
-
<img src='https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*zTjwQaXokeQAAAAAAAAAAABkARQnAQ' width=550 alt='' />
|
|
14
|
-
|
|
15
|
-
基于 G6,用户可以快速搭建自己的 **图分析** 或 **图编辑** 应用。
|
|
16
|
-
|
|
17
|
-
<img src='https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*zau8QJcVpDQAAAAAAAAAAABkARQnAQ' height=200 alt='' /><img src='https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*RIlETY_S6IoAAAAAAAAAAABkARQnAQ' height=200 alt='' />
|
|
18
|
-
|
|
19
|
-
<img src='https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*cDzXR4jIWr8AAAAAAAAAAABkARQnAQ' height=150 alt='' /><img src='https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*DifbSahOblAAAAAAAAAAAABkARQnAQ' height=150 /><img src='https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*HTasSJGC4koAAAAAAAAAAABkARQnAQ' height=150 alt='' />
|
|
20
|
-
|
|
21
|
-
> 强大的动画及交互
|
|
22
|
-
|
|
23
|
-
<img src="https://user-images.githubusercontent.com/6113694/44995293-02858600-afd5-11e8-840c-349e4730d63d.gif" height=150 alt='' /><img src="https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*I9OdTbXJIi0AAAAAAAAAAABkARQnAQ" height=150 alt='' /><img src="https://user-images.githubusercontent.com/6113694/44995332-2ba61680-afd5-11e8-8cab-db0e9d08ceb7.gif" height=150 alt='' />
|
|
24
|
-
|
|
25
|
-
<img src="https://gw.alipayobjects.com/zos/rmsportal/HQxYguinFOMIXrGQOABY.gif" height=150><img src="https://gw.alipayobjects.com/zos/rmsportal/nAugyFgrbrUWPmDIDiQm.gif" height=150 alt='' /><img src="https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*xoufSYcjK2AAAAAAAAAAAABkARQnAQ" height=150 alt='' />
|
|
26
|
-
|
|
27
|
-
> 强大的布局
|
|
28
|
-
|
|
29
|
-
## G6 的特性
|
|
30
|
-
|
|
31
|
-
G6 作为一款专业的图可视化引擎,具有以下特性:
|
|
32
|
-
|
|
33
|
-
- 丰富的元素:内置丰富的节点与边元素,自由配置,支持自定义;
|
|
34
|
-
- 可控的交互:内置 10+ 交互行为,支持自定义交互;
|
|
35
|
-
- 强大的布局:内置了 10+ 常用的图布局,支持自定义布局;
|
|
36
|
-
- 便捷的组件:优化内置组件功能及性能;
|
|
37
|
-
- 友好的体验:根据用户需求分层梳理文档,支持 TypeScript 类型推断。
|
|
38
|
-
|
|
39
|
-
除了默认好用、配置自由的内置功能,元素、交互、布局均具有高可扩展的自定义机制。
|
|
40
|
-
|
|
41
|
-
<img src='https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*Y0c6S7cxjVkAAAAAAAAAAABkARQnAQ' width=800 height=200 alt='' />
|
|
42
|
-
|
|
43
|
-
> 丰富的图元素
|
|
44
|
-
|
|
45
|
-
## 安装
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
$ npm install @antv/g6
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
## 使用
|
|
52
|
-
|
|
53
|
-
<img src="https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*khbvSrptr0kAAAAAAAAAAABkARQnAQ" width=437 height=148 alt='' />
|
|
54
|
-
|
|
55
|
-
```js
|
|
56
|
-
import G6 from '@antv/g6';
|
|
57
|
-
|
|
58
|
-
const data = {
|
|
59
|
-
nodes: [
|
|
60
|
-
{
|
|
61
|
-
id: 'node1',
|
|
62
|
-
label: 'Circle1',
|
|
63
|
-
x: 150,
|
|
64
|
-
y: 150,
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
id: 'node2',
|
|
68
|
-
label: 'Circle2',
|
|
69
|
-
x: 400,
|
|
70
|
-
y: 150,
|
|
71
|
-
},
|
|
72
|
-
],
|
|
73
|
-
edges: [
|
|
74
|
-
{
|
|
75
|
-
source: 'node1',
|
|
76
|
-
target: 'node2',
|
|
77
|
-
},
|
|
78
|
-
],
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
const graph = new G6.Graph({
|
|
82
|
-
container: 'container',
|
|
83
|
-
width: 500,
|
|
84
|
-
height: 500,
|
|
85
|
-
defaultNode: {
|
|
86
|
-
type: 'circle',
|
|
87
|
-
size: [100],
|
|
88
|
-
color: '#5B8FF9',
|
|
89
|
-
style: {
|
|
90
|
-
fill: '#9EC9FF',
|
|
91
|
-
lineWidth: 3,
|
|
92
|
-
},
|
|
93
|
-
labelCfg: {
|
|
94
|
-
style: {
|
|
95
|
-
fill: '#fff',
|
|
96
|
-
fontSize: 20,
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
defaultEdge: {
|
|
101
|
-
style: {
|
|
102
|
-
stroke: '#e2e2e2',
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
graph.data(data);
|
|
108
|
-
graph.render();
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
[](https://codesandbox.io/s/compassionate-lalande-5lxm7?fontsize=14&hidenavigation=1&theme=dark)
|
|
112
|
-
|
|
113
|
-
更多关于 G6 使用的问题,请参考[快速上手](https://g6.antv.antgroup.com/manual/getting-started)。
|
|
114
|
-
|
|
115
|
-
## 开发
|
|
116
|
-
|
|
117
|
-
```bash
|
|
118
|
-
$ npm install
|
|
119
|
-
|
|
120
|
-
# lerna bootstrap for multiple packages
|
|
121
|
-
$ npm run bootstrap
|
|
122
|
-
|
|
123
|
-
# build the packages
|
|
124
|
-
$ npm run build:all
|
|
125
|
-
|
|
126
|
-
# if you wanna watch one of the packages, e.g. packages/core
|
|
127
|
-
$ cd ./packages/core
|
|
128
|
-
$ npm run watch
|
|
129
|
-
|
|
130
|
-
# run test case
|
|
131
|
-
$ npm test
|
|
132
|
-
|
|
133
|
-
# run test case in watch mode
|
|
134
|
-
npm test -- --watch ./tests/unit/algorithm/find-path-spec
|
|
135
|
-
DEBUG_MODE=1 npm test -- --watch ./tests/unit/algorithm/find-path-spec
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
## 文档
|
|
139
|
-
|
|
140
|
-
- <a href='https://g6.antv.antgroup.com/manual/tutorial/preface' target='_blank'>入门教程</a>
|
|
141
|
-
- <a href='https://g6.antv.antgroup.com/manual/middle/overview' target='_blank'>核心概念</a>
|
|
142
|
-
- <a href='https://g6.antv.antgroup.com/manual/advanced/coordinate-system' target='_blank'>扩展阅读</a>
|
|
143
|
-
- <a href='https://g6.antv.antgroup.com/api/graph' target='_blank'>API</a>
|
|
144
|
-
|
|
145
|
-
## React 项目集成
|
|
146
|
-
|
|
147
|
-
针对 React 项目集成,我们有一款单独的产品推荐:[Graphin](https://graphin.antv.vision),它是基于 G6 封装的 React 组件库,专注在关系分析领域,简单高效,开箱即用。
|
|
148
|
-
|
|
149
|
-
目前 Graphin 在商业图分析项目中均有良好的实践,具体查看[《谁在使用 Graphin》](https://github.com/antvis/Graphin/issues/212)
|
|
150
|
-
|
|
151
|
-
## G6 图可视化交流群
|
|
152
|
-
|
|
153
|
-
欢迎各界 G6 使用者、图可视化爱好者加入 **G6 图可视化交流群** 及 **G6 图可视化交流二群**(钉钉群,使用钉钉扫一扫加入)讨论与交流。Graphin 的使用者,爱好者请加入 **Graphin's Group Chat**
|
|
154
|
-
|
|
155
|
-
> **G6 图可视化交流群** 已满员,该群会不定期移除不活跃的成员。
|
|
156
|
-
|
|
157
|
-
> 由于维护精力有限,**G6 图可视化交流群** 仅供社区同学相互交流,不进行答疑。欢迎对 G6 感兴趣的同学加入到答疑中来,非常感谢!
|
|
158
|
-
|
|
159
|
-
<p >
|
|
160
|
-
<a href="https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*-RO_R7SCvroAAAAAAAAAAAAAARQnAQ" >
|
|
161
|
-
<img src='https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*-RO_R7SCvroAAAAAAAAAAAAAARQnAQ' style='width:250px;display:inline-block;vertical-align:top;' alt='' />
|
|
162
|
-
</a>
|
|
163
|
-
<a href="https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*hzfaSrAj0jkAAAAAAAAAAABkARQnAQ" >
|
|
164
|
-
<img src='https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*hzfaSrAj0jkAAAAAAAAAAABkARQnAQ' style='width:250px;display:inline-block;vertical-align:top;' alt='' />
|
|
165
|
-
</a>
|
|
166
|
-
<a href="https://graphin.antv.vision/" >
|
|
167
|
-
<img src='https://camo.githubusercontent.com/5e6624abcdde991f9fd89fce4933ad133a48d8fb603d1852c670da329df73ef7/68747470733a2f2f67772e616c697061796f626a656374732e636f6d2f6d646e2f726d735f3430326331612f616674732f696d672f412a2d717a6f54704c672d3163414141414141414141414141414152516e4151' style='width:250px;display:inline-block;vertical-align: top;' alt='' />
|
|
168
|
-
</a>
|
|
169
|
-
</p>
|
|
170
|
-
|
|
171
|
-
## 如何贡献
|
|
172
|
-
|
|
173
|
-
请让我们知道您要解决或贡献什么,所以在贡献之前请先提交 [issues](https://github.com/antvis/g6/issues) 描述 bug 或建议。
|
|
174
|
-
|
|
175
|
-
## License
|
|
176
|
-
|
|
177
|
-
[MIT license](./LICENSE).
|