@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,147 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { SphereGeometry, CubeGeometry, Mesh, MeshBasicMaterial, MeshPhongMaterial, PlaneGeometry, } from '@antv/g-plugin-3d';
|
|
13
|
+
import { LOCAL_BOUNDS_DIRTY_FLAG_KEY, createShape, isStyleAffectBBox, } from './shape';
|
|
14
|
+
const GeometryTagMap = {
|
|
15
|
+
sphere: SphereGeometry,
|
|
16
|
+
cubic: CubeGeometry,
|
|
17
|
+
plane: PlaneGeometry,
|
|
18
|
+
};
|
|
19
|
+
const GEOMETRY_SIZE = 10;
|
|
20
|
+
export const createShape3D = (type, style, id, device) => {
|
|
21
|
+
// It is not a 3d Shape but 2d.
|
|
22
|
+
if (!GeometryTagMap[type]) {
|
|
23
|
+
return createShape(type, style, id);
|
|
24
|
+
}
|
|
25
|
+
// materialType: 'phong' | 'basic', TODO: type
|
|
26
|
+
const _a = style, { materialType = 'phong' } = _a, otherStyles = __rest(_a, ["materialType"]);
|
|
27
|
+
if (!device.GeometryCache) {
|
|
28
|
+
device.GeometryCache = {};
|
|
29
|
+
}
|
|
30
|
+
// Share the same geometry & material between meshes.
|
|
31
|
+
let cachedGeometry = device.GeometryCache[type];
|
|
32
|
+
if (!cachedGeometry) {
|
|
33
|
+
cachedGeometry = device.GeometryCache[type] = new GeometryTagMap[type](device, {
|
|
34
|
+
radius: GEOMETRY_SIZE,
|
|
35
|
+
latitudeBands: 32,
|
|
36
|
+
longitudeBands: 32,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
if (!device.MaterialCache) {
|
|
40
|
+
device.MaterialCache = {};
|
|
41
|
+
}
|
|
42
|
+
if (!device.MaterialCache[materialType]) {
|
|
43
|
+
switch (materialType) {
|
|
44
|
+
case 'basic':
|
|
45
|
+
device.MaterialCache[materialType] = new MeshBasicMaterial(device);
|
|
46
|
+
break;
|
|
47
|
+
case 'phong':
|
|
48
|
+
default: {
|
|
49
|
+
const materialProps = {
|
|
50
|
+
shininess: 30,
|
|
51
|
+
};
|
|
52
|
+
device.MaterialCache[materialType] = new MeshPhongMaterial(device, materialProps);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
const shape = new Mesh({
|
|
57
|
+
style: Object.assign(Object.assign({}, otherStyles), { geometry: cachedGeometry, material: device.MaterialCache[materialType] }),
|
|
58
|
+
id,
|
|
59
|
+
});
|
|
60
|
+
// set origin for shape
|
|
61
|
+
shape.setOrigin(0, 0, 0);
|
|
62
|
+
// Scale the shape to the correct size.
|
|
63
|
+
switch (type) {
|
|
64
|
+
case 'cube':
|
|
65
|
+
shape.scale([
|
|
66
|
+
style.width / GEOMETRY_SIZE,
|
|
67
|
+
style.height / GEOMETRY_SIZE,
|
|
68
|
+
style.depth / GEOMETRY_SIZE,
|
|
69
|
+
]);
|
|
70
|
+
break;
|
|
71
|
+
case 'plane':
|
|
72
|
+
shape.scale([style.width / GEOMETRY_SIZE, style.depth / GEOMETRY_SIZE]);
|
|
73
|
+
break;
|
|
74
|
+
case 'sphere':
|
|
75
|
+
default: {
|
|
76
|
+
const scaling = (style.r || style.radius) / GEOMETRY_SIZE;
|
|
77
|
+
shape.scale(scaling);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return shape;
|
|
81
|
+
};
|
|
82
|
+
export const upsertShape3D = (type, id, style, shapeMap, device) => {
|
|
83
|
+
let shape = shapeMap[id];
|
|
84
|
+
if (!shape) {
|
|
85
|
+
shape = createShape3D(type, style, id, device);
|
|
86
|
+
shape.setAttribute(LOCAL_BOUNDS_DIRTY_FLAG_KEY, true);
|
|
87
|
+
}
|
|
88
|
+
else if (shape.nodeName !== type) {
|
|
89
|
+
shape.remove();
|
|
90
|
+
shape = createShape3D(type, style, id, device);
|
|
91
|
+
shape.setAttribute(LOCAL_BOUNDS_DIRTY_FLAG_KEY, true);
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
const updateStyles = {};
|
|
95
|
+
const oldStyles = shape.attributes;
|
|
96
|
+
Object.keys(style).forEach((key) => {
|
|
97
|
+
if (oldStyles[key] !== style[key]) {
|
|
98
|
+
updateStyles[key] = style[key];
|
|
99
|
+
shape.style[key] = style[key];
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
if (isStyleAffectBBox(type, updateStyles)) {
|
|
103
|
+
shape.setAttribute(LOCAL_BOUNDS_DIRTY_FLAG_KEY, true);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
shapeMap[id] = shape;
|
|
107
|
+
return shape;
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* Update shapes in the intersaction of prevShapeMap and newShapeMap;
|
|
111
|
+
* Remove shapes in the prevShapeMap - newShapeMap (if removeDiff is true);
|
|
112
|
+
* Add shapes in the newShapeMap - prevShapeMap;
|
|
113
|
+
* @param prevShapeMap previous shape map
|
|
114
|
+
* @param newShapeMap new shape map
|
|
115
|
+
* @param group container group
|
|
116
|
+
* @returns merged shape map
|
|
117
|
+
*/
|
|
118
|
+
export const updateShapes3D = (prevShapeMap, newShapeMap, group, removeDiff = true, shouldUpdate = () => true) => {
|
|
119
|
+
const tolalMap = Object.assign(Object.assign({}, prevShapeMap), newShapeMap);
|
|
120
|
+
const finalShapeMap = Object.assign({}, prevShapeMap);
|
|
121
|
+
Object.keys(tolalMap).forEach((id) => {
|
|
122
|
+
const prevShape = prevShapeMap[id];
|
|
123
|
+
const newShape = newShapeMap[id];
|
|
124
|
+
if (newShape && !shouldUpdate(id))
|
|
125
|
+
return;
|
|
126
|
+
if (prevShape && newShape) {
|
|
127
|
+
// update intersaction
|
|
128
|
+
finalShapeMap[id] = newShape;
|
|
129
|
+
if (prevShape !== newShape) {
|
|
130
|
+
prevShape.remove();
|
|
131
|
+
}
|
|
132
|
+
group.appendChild(newShape);
|
|
133
|
+
}
|
|
134
|
+
else if (!prevShape && newShape) {
|
|
135
|
+
// add newShapeMap - prevShapeMap
|
|
136
|
+
finalShapeMap[id] = newShape;
|
|
137
|
+
group.appendChild(newShape);
|
|
138
|
+
}
|
|
139
|
+
else if (prevShape && !newShape && removeDiff) {
|
|
140
|
+
// remove prevShapeMap - newShapeMap
|
|
141
|
+
delete finalShapeMap[id];
|
|
142
|
+
prevShape.remove();
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
return finalShapeMap;
|
|
146
|
+
};
|
|
147
|
+
//#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AC;SACpB;IACH,CAAC,CAAC,CAAC;IACH,OAAO,aAA6B,CAAC;AACvC,CAAC,CAAC"}
|
|
@@ -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/esm/util/text.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { getEuclideanDistance } from '@antv/layout';
|
|
2
|
+
/**
|
|
3
|
+
* Get the proper wordWrapWidth for a labelShape according the the 'maxWidth' of keyShape.
|
|
4
|
+
* @param keyShapeBox
|
|
5
|
+
* @param maxWidth
|
|
6
|
+
* @param zoom
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
9
|
+
export const getWordWrapWidthByBox = (keyShapeBox, maxWidth, zoom = 1) => {
|
|
10
|
+
const keyShapeWidth = (keyShapeBox.max[0] - keyShapeBox.min[0]) * zoom;
|
|
11
|
+
return getWordWrapWidthWithBase(keyShapeWidth, maxWidth);
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Get the proper wordWrapWidth for a labelShape according the the distance between two end points and 'maxWidth'.
|
|
15
|
+
* @param points
|
|
16
|
+
* @param maxWidth
|
|
17
|
+
* @param zoom
|
|
18
|
+
* @returns
|
|
19
|
+
*/
|
|
20
|
+
export const getWordWrapWidthByEnds = (points, maxWidth, zoom = 1) => {
|
|
21
|
+
const dist = getEuclideanDistance(points[0], points[1]) * zoom;
|
|
22
|
+
return getWordWrapWidthWithBase(dist, maxWidth);
|
|
23
|
+
};
|
|
24
|
+
const getWordWrapWidthWithBase = (length, maxWidth) => {
|
|
25
|
+
let wordWrapWidth = 2 * length;
|
|
26
|
+
if (typeof maxWidth === 'string') {
|
|
27
|
+
wordWrapWidth = (length * Number(maxWidth.replace('%', ''))) / 100;
|
|
28
|
+
}
|
|
29
|
+
else if (typeof maxWidth === 'number') {
|
|
30
|
+
wordWrapWidth = maxWidth;
|
|
31
|
+
}
|
|
32
|
+
if (isNaN(wordWrapWidth))
|
|
33
|
+
wordWrapWidth = 2 * length;
|
|
34
|
+
return wordWrapWidth;
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.js","sourceRoot":"src/","sources":["util/text.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAGpD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,WAAiB,EACjB,QAAyB,EACzB,IAAI,GAAG,CAAC,EACR,EAAE;IACF,MAAM,aAAa,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IACvE,OAAO,wBAAwB,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;AAC3D,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,MAAe,EACf,QAAyB,EACzB,IAAI,GAAG,CAAC,EACR,EAAE;IACF,MAAM,IAAI,GAAG,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAC/D,OAAO,wBAAwB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAClD,CAAC,CAAC;AAEF,MAAM,wBAAwB,GAAG,CAC/B,MAAc,EACd,QAAyB,EACzB,EAAE;IACF,IAAI,aAAa,GAAG,CAAC,GAAG,MAAM,CAAC;IAC/B,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;QAChC,aAAa,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;KACpE;SAAM,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;QACvC,aAAa,GAAG,QAAQ,CAAC;KAC1B;IACD,IAAI,KAAK,CAAC,aAAa,CAAC;QAAE,aAAa,GAAG,CAAC,GAAG,MAAM,CAAC;IACrD,OAAO,aAAa,CAAC;AACvB,CAAC,CAAC"}
|
package/esm/util/type.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.js","sourceRoot":"src/","sources":["util/type.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAK,EAAwB,EAAE,CACtD,OAAO,CAAE,KAAqB,CAAC,MAAM,IAAK,KAAqB,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -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/esm/util/zoom.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format lodStrategy to the pattern that ratio 1 (primary level) at level 0, and higher the ratio, higher the level.
|
|
3
|
+
* @param lodStrategy
|
|
4
|
+
* @returns
|
|
5
|
+
*/
|
|
6
|
+
export const formatLodStrategy = (lodStrategy) => {
|
|
7
|
+
const { levels, animateCfg } = lodStrategy || {};
|
|
8
|
+
if (!levels)
|
|
9
|
+
return undefined;
|
|
10
|
+
const primaryLevel = levels.find((level) => level.primary);
|
|
11
|
+
const primaryIndex = levels.indexOf(primaryLevel);
|
|
12
|
+
const formattedLevels = {};
|
|
13
|
+
levels.forEach((level, i) => {
|
|
14
|
+
formattedLevels[i - primaryIndex] = level.zoomRange;
|
|
15
|
+
});
|
|
16
|
+
return {
|
|
17
|
+
animateCfg,
|
|
18
|
+
levels: formattedLevels,
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Get zoom level idx in levels array.
|
|
23
|
+
* @param levels
|
|
24
|
+
* @param zoom
|
|
25
|
+
* @returns
|
|
26
|
+
*/
|
|
27
|
+
export const getZoomLevel = (levels, zoom) => {
|
|
28
|
+
let level = 0;
|
|
29
|
+
Object.keys(levels).forEach((idx) => {
|
|
30
|
+
const zoomRange = levels[idx];
|
|
31
|
+
if (zoom >= zoomRange[0] && zoom < zoomRange[1])
|
|
32
|
+
level = Number(idx);
|
|
33
|
+
});
|
|
34
|
+
return level;
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=zoom.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zoom.js","sourceRoot":"src/","sources":["util/zoom.ts"],"names":[],"mappings":"AAEA;;;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createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./shape"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["constant/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare const RESERVED_SHAPE_IDS: string[];
|
|
2
|
+
export declare const OTHER_SHAPES_FIELD_NAME = "otherShapes";
|
|
3
|
+
export declare const DEFAULT_LABEL_BG_PADDING: number[];
|
|
4
|
+
/** Default shape style to avoid shape value missing */
|
|
5
|
+
export declare const DEFAULT_SHAPE_STYLE: {
|
|
6
|
+
opacity: number;
|
|
7
|
+
fillOpacity: number;
|
|
8
|
+
shadowColor: any;
|
|
9
|
+
shadowBlur: number;
|
|
10
|
+
lineDash: any;
|
|
11
|
+
zIndex: number;
|
|
12
|
+
};
|
|
13
|
+
/** Default text style to avoid shape value missing */
|
|
14
|
+
export declare const DEFAULT_TEXT_STYLE: {
|
|
15
|
+
fontSize: number;
|
|
16
|
+
fontFamily: string;
|
|
17
|
+
fontWeight: string;
|
|
18
|
+
fontVariant: string;
|
|
19
|
+
fontStyle: string;
|
|
20
|
+
lineWidth: number;
|
|
21
|
+
opacity: number;
|
|
22
|
+
fillOpacity: number;
|
|
23
|
+
shadowColor: any;
|
|
24
|
+
shadowBlur: number;
|
|
25
|
+
lineDash: any;
|
|
26
|
+
zIndex: number;
|
|
27
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_TEXT_STYLE = exports.DEFAULT_SHAPE_STYLE = exports.DEFAULT_LABEL_BG_PADDING = exports.OTHER_SHAPES_FIELD_NAME = exports.RESERVED_SHAPE_IDS = void 0;
|
|
4
|
+
exports.RESERVED_SHAPE_IDS = [
|
|
5
|
+
'keyShape',
|
|
6
|
+
'labelShape',
|
|
7
|
+
'labelBackgroundShape',
|
|
8
|
+
'iconShape',
|
|
9
|
+
'haloShape',
|
|
10
|
+
'anchorShapes',
|
|
11
|
+
'badgeShapes',
|
|
12
|
+
];
|
|
13
|
+
exports.OTHER_SHAPES_FIELD_NAME = 'otherShapes';
|
|
14
|
+
exports.DEFAULT_LABEL_BG_PADDING = [4, 4, 4, 4];
|
|
15
|
+
/** Default shape style to avoid shape value missing */
|
|
16
|
+
exports.DEFAULT_SHAPE_STYLE = {
|
|
17
|
+
opacity: 1,
|
|
18
|
+
fillOpacity: 1,
|
|
19
|
+
shadowColor: undefined,
|
|
20
|
+
shadowBlur: 0,
|
|
21
|
+
lineDash: undefined,
|
|
22
|
+
zIndex: 0,
|
|
23
|
+
};
|
|
24
|
+
/** Default text style to avoid shape value missing */
|
|
25
|
+
exports.DEFAULT_TEXT_STYLE = Object.assign(Object.assign({}, exports.DEFAULT_SHAPE_STYLE), { fontSize: 12, fontFamily: 'sans-serif', fontWeight: 'normal', fontVariant: 'normal', fontStyle: 'normal',
|
|
26
|
+
// textBaseline: 'middle',
|
|
27
|
+
// textAlign: 'center',
|
|
28
|
+
lineWidth: 0 });
|
|
29
|
+
//# sourceMappingURL=shape.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shape.js","sourceRoot":"src/","sources":["constant/shape.ts"],"names":[],"mappings":";;;AAAa,QAAA,kBAAkB,GAAG;IAChC,UAAU;IACV,YAAY;IACZ,sBAAsB;IACtB,WAAW;IACX,WAAW;IACX,cAAc;IACd,aAAa;CACd,CAAC;AACW,QAAA,uBAAuB,GAAG,aAAa,CAAC;AAExC,QAAA,wBAAwB,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACrD,uDAAuD;AAC1C,QAAA,mBAAmB,GAAG;IACjC,OAAO,EAAE,CAAC;IACV,WAAW,EAAE,CAAC;IACd,WAAW,EAAE,SAAS;IACtB,UAAU,EAAE,CAAC;IACb,QAAQ,EAAE,SAAS;IACnB,MAAM,EAAE,CAAC;CACV,CAAC;AACF,sDAAsD;AACzC,QAAA,kBAAkB,mCAC1B,2BAAmB,KACtB,QAAQ,EAAE,EAAE,EACZ,UAAU,EAAE,YAAY,EACxB,UAAU,EAAE,QAAQ,EACpB,WAAW,EAAE,QAAQ,EACrB,SAAS,EAAE,QAAQ;IACnB,0BAA0B;IAC1B,uBAAuB;IACvB,SAAS,EAAE,CAAC,IACZ"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,124 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
1
|
+
import EmptyGraph from './runtime/graph';
|
|
2
|
+
import { stdLib } from './stdlib';
|
|
3
|
+
export * from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Extend the graph class with std lib
|
|
6
|
+
*/
|
|
7
|
+
declare const Graph: {
|
|
8
|
+
new (spec: import("./types").Specification<{
|
|
9
|
+
'activate-relations': typeof import("./stdlib/behavior/activate-relations").default;
|
|
10
|
+
'drag-canvas': typeof import("./stdlib/behavior/drag-canvas").default;
|
|
11
|
+
'hover-activate': typeof import("./stdlib/behavior/hover-activate").HoverActivate;
|
|
12
|
+
'zoom-canvas': typeof import("./stdlib/behavior/zoom-canvas").default;
|
|
13
|
+
'drag-node': typeof import("./stdlib/behavior/drag-node").default;
|
|
14
|
+
'click-select': typeof import("./stdlib/behavior/click-select").default;
|
|
15
|
+
'brush-select': typeof import("./stdlib/behavior/brush-select").default;
|
|
16
|
+
'lasso-select': typeof import("./stdlib/behavior/lasso-select").default;
|
|
17
|
+
'zoom-canvas-3d': typeof import("./stdlib/behavior/zoom-canvas-3d").default;
|
|
18
|
+
'rotate-canvas-3d': typeof import("./stdlib/behavior/rotate-canvas-3d").default;
|
|
19
|
+
'track-canvas-3d': typeof import("./stdlib/behavior/track-canvas-3d").default;
|
|
20
|
+
'orbit-canvas-3d': typeof import("./stdlib/behavior/orbit-canvas-3d").default;
|
|
21
|
+
}, {
|
|
22
|
+
spec: typeof import("./stdlib/themeSolver/spec").default;
|
|
23
|
+
subject: typeof import("./stdlib/themeSolver/subject").default;
|
|
24
|
+
}>): EmptyGraph<{
|
|
25
|
+
'activate-relations': typeof import("./stdlib/behavior/activate-relations").default;
|
|
26
|
+
'drag-canvas': typeof import("./stdlib/behavior/drag-canvas").default;
|
|
27
|
+
'hover-activate': typeof import("./stdlib/behavior/hover-activate").HoverActivate;
|
|
28
|
+
'zoom-canvas': typeof import("./stdlib/behavior/zoom-canvas").default;
|
|
29
|
+
'drag-node': typeof import("./stdlib/behavior/drag-node").default;
|
|
30
|
+
'click-select': typeof import("./stdlib/behavior/click-select").default;
|
|
31
|
+
'brush-select': typeof import("./stdlib/behavior/brush-select").default;
|
|
32
|
+
'lasso-select': typeof import("./stdlib/behavior/lasso-select").default;
|
|
33
|
+
'zoom-canvas-3d': typeof import("./stdlib/behavior/zoom-canvas-3d").default;
|
|
34
|
+
'rotate-canvas-3d': typeof import("./stdlib/behavior/rotate-canvas-3d").default;
|
|
35
|
+
'track-canvas-3d': typeof import("./stdlib/behavior/track-canvas-3d").default;
|
|
36
|
+
'orbit-canvas-3d': typeof import("./stdlib/behavior/orbit-canvas-3d").default;
|
|
37
|
+
}, {
|
|
38
|
+
spec: typeof import("./stdlib/themeSolver/spec").default;
|
|
39
|
+
subject: typeof import("./stdlib/themeSolver/subject").default;
|
|
40
|
+
}>;
|
|
41
|
+
};
|
|
42
|
+
export { Graph, stdLib };
|
|
43
|
+
declare const _default: {
|
|
44
|
+
Graph: {
|
|
45
|
+
new (spec: import("./types").Specification<{
|
|
46
|
+
'activate-relations': typeof import("./stdlib/behavior/activate-relations").default;
|
|
47
|
+
'drag-canvas': typeof import("./stdlib/behavior/drag-canvas").default;
|
|
48
|
+
'hover-activate': typeof import("./stdlib/behavior/hover-activate").HoverActivate;
|
|
49
|
+
'zoom-canvas': typeof import("./stdlib/behavior/zoom-canvas").default;
|
|
50
|
+
'drag-node': typeof import("./stdlib/behavior/drag-node").default;
|
|
51
|
+
'click-select': typeof import("./stdlib/behavior/click-select").default;
|
|
52
|
+
'brush-select': typeof import("./stdlib/behavior/brush-select").default;
|
|
53
|
+
'lasso-select': typeof import("./stdlib/behavior/lasso-select").default;
|
|
54
|
+
'zoom-canvas-3d': typeof import("./stdlib/behavior/zoom-canvas-3d").default;
|
|
55
|
+
'rotate-canvas-3d': typeof import("./stdlib/behavior/rotate-canvas-3d").default;
|
|
56
|
+
'track-canvas-3d': typeof import("./stdlib/behavior/track-canvas-3d").default;
|
|
57
|
+
'orbit-canvas-3d': typeof import("./stdlib/behavior/orbit-canvas-3d").default;
|
|
58
|
+
}, {
|
|
59
|
+
spec: typeof import("./stdlib/themeSolver/spec").default;
|
|
60
|
+
subject: typeof import("./stdlib/themeSolver/subject").default;
|
|
61
|
+
}>): EmptyGraph<{
|
|
62
|
+
'activate-relations': typeof import("./stdlib/behavior/activate-relations").default;
|
|
63
|
+
'drag-canvas': typeof import("./stdlib/behavior/drag-canvas").default;
|
|
64
|
+
'hover-activate': typeof import("./stdlib/behavior/hover-activate").HoverActivate;
|
|
65
|
+
'zoom-canvas': typeof import("./stdlib/behavior/zoom-canvas").default;
|
|
66
|
+
'drag-node': typeof import("./stdlib/behavior/drag-node").default;
|
|
67
|
+
'click-select': typeof import("./stdlib/behavior/click-select").default;
|
|
68
|
+
'brush-select': typeof import("./stdlib/behavior/brush-select").default;
|
|
69
|
+
'lasso-select': typeof import("./stdlib/behavior/lasso-select").default;
|
|
70
|
+
'zoom-canvas-3d': typeof import("./stdlib/behavior/zoom-canvas-3d").default;
|
|
71
|
+
'rotate-canvas-3d': typeof import("./stdlib/behavior/rotate-canvas-3d").default;
|
|
72
|
+
'track-canvas-3d': typeof import("./stdlib/behavior/track-canvas-3d").default;
|
|
73
|
+
'orbit-canvas-3d': typeof import("./stdlib/behavior/orbit-canvas-3d").default;
|
|
74
|
+
}, {
|
|
75
|
+
spec: typeof import("./stdlib/themeSolver/spec").default;
|
|
76
|
+
subject: typeof import("./stdlib/themeSolver/subject").default;
|
|
77
|
+
}>;
|
|
78
|
+
};
|
|
79
|
+
stdLib: {
|
|
80
|
+
transforms: {
|
|
81
|
+
comboFromNode: (data: import("./types").GraphData) => {
|
|
82
|
+
nodes: import("./types").NodeUserModel[];
|
|
83
|
+
edges: import("./types").EdgeUserModel[];
|
|
84
|
+
combos: any[];
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
themes: {
|
|
88
|
+
light: import("./types/theme").ThemeSpecification;
|
|
89
|
+
dark: import("./types/theme").ThemeSpecification;
|
|
90
|
+
};
|
|
91
|
+
themeSolvers: {
|
|
92
|
+
spec: typeof import("./stdlib/themeSolver/spec").default;
|
|
93
|
+
subject: typeof import("./stdlib/themeSolver/subject").default;
|
|
94
|
+
};
|
|
95
|
+
layouts: Record<string, import("@antv/layout").LayoutConstructor<any>>;
|
|
96
|
+
behaviors: {
|
|
97
|
+
'activate-relations': typeof import("./stdlib/behavior/activate-relations").default;
|
|
98
|
+
'drag-canvas': typeof import("./stdlib/behavior/drag-canvas").default;
|
|
99
|
+
'hover-activate': typeof import("./stdlib/behavior/hover-activate").HoverActivate;
|
|
100
|
+
'zoom-canvas': typeof import("./stdlib/behavior/zoom-canvas").default;
|
|
101
|
+
'drag-node': typeof import("./stdlib/behavior/drag-node").default;
|
|
102
|
+
'click-select': typeof import("./stdlib/behavior/click-select").default;
|
|
103
|
+
'brush-select': typeof import("./stdlib/behavior/brush-select").default;
|
|
104
|
+
'lasso-select': typeof import("./stdlib/behavior/lasso-select").default;
|
|
105
|
+
'zoom-canvas-3d': typeof import("./stdlib/behavior/zoom-canvas-3d").default;
|
|
106
|
+
'rotate-canvas-3d': typeof import("./stdlib/behavior/rotate-canvas-3d").default;
|
|
107
|
+
'track-canvas-3d': typeof import("./stdlib/behavior/track-canvas-3d").default;
|
|
108
|
+
'orbit-canvas-3d': typeof import("./stdlib/behavior/orbit-canvas-3d").default;
|
|
109
|
+
};
|
|
110
|
+
plugins: {
|
|
111
|
+
minimap: typeof import("./stdlib/plugin/minimap").default;
|
|
112
|
+
legend: typeof import("./stdlib/plugin/legend").default;
|
|
113
|
+
};
|
|
114
|
+
nodes: {
|
|
115
|
+
'circle-node': typeof import("./stdlib/item/node").CircleNode;
|
|
116
|
+
'sphere-node': typeof import("./stdlib/item/node").SphereNode;
|
|
117
|
+
};
|
|
118
|
+
edges: {
|
|
119
|
+
'line-edge': typeof import("./stdlib/item/edge").LineEdge;
|
|
120
|
+
};
|
|
121
|
+
combos: {};
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
export default _default;
|
package/lib/index.js
CHANGED
|
@@ -1,29 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Object.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var _exportNames = {
|
|
8
|
-
version: true
|
|
9
|
-
};
|
|
10
|
-
exports.version = exports.default = void 0;
|
|
11
|
-
var _g6Pc = _interopRequireWildcard(require("@antv/g6-pc"));
|
|
12
|
-
Object.keys(_g6Pc).forEach(function (key) {
|
|
13
|
-
if (key === "default" || key === "__esModule") return;
|
|
14
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
15
|
-
if (key in exports && exports[key] === _g6Pc[key]) return;
|
|
16
|
-
Object.defineProperty(exports, key, {
|
|
17
|
-
enumerable: true,
|
|
18
|
-
get: function get() {
|
|
19
|
-
return _g6Pc[key];
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
20
7
|
}
|
|
21
|
-
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.stdLib = exports.Graph = void 0;
|
|
21
|
+
const graph_1 = __importDefault(require("./runtime/graph"));
|
|
22
|
+
const stdlib_1 = require("./stdlib");
|
|
23
|
+
Object.defineProperty(exports, "stdLib", { enumerable: true, get: function () { return stdlib_1.stdLib; } });
|
|
24
|
+
const extend_1 = require("./util/extend");
|
|
25
|
+
__exportStar(require("./types"), exports);
|
|
26
|
+
/**
|
|
27
|
+
* Extend the graph class with std lib
|
|
28
|
+
*/
|
|
29
|
+
const Graph = (0, extend_1.extend)((graph_1.default), stdlib_1.stdLib);
|
|
30
|
+
exports.Graph = Graph;
|
|
31
|
+
exports.default = { Graph, stdLib: stdlib_1.stdLib };
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,4DAAyC;AACzC,qCAAkC;AASlB,uFATP,eAAM,OASO;AARtB,0CAAuC;AACvC,0CAAwB;AAExB;;GAEG;AACH,MAAM,KAAK,GAAG,IAAA,eAAM,EAAC,CAAA,eAAkB,CAAA,EAAE,eAAM,CAAC,CAAC;AAExC,sBAAK;AAEd,kBAAe,EAAE,KAAK,EAAE,MAAM,EAAN,eAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const item_1 = __importDefault(require("./item"));
|
|
7
|
+
class Combo extends item_1.default {
|
|
8
|
+
}
|
|
9
|
+
exports.default = Combo;
|
|
10
|
+
//# sourceMappingURL=combo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combo.js","sourceRoot":"src/","sources":["item/combo.ts"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAE1B,MAAqB,KAAM,SAAQ,cAAI;CAEtC;AAFD,wBAEC"}
|