@antv/g6 4.8.14 → 5.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/g6.min.js +19 -3
- package/esm/constant/index.d.ts +1 -0
- package/esm/constant/index.js +2 -0
- package/esm/constant/index.js.map +1 -0
- package/esm/constant/shape.d.ts +27 -0
- package/esm/constant/shape.js +26 -0
- package/esm/constant/shape.js.map +1 -0
- package/esm/index.d.ts +124 -0
- package/esm/index.js +11 -0
- package/esm/index.js.map +1 -0
- package/esm/item/combo.d.ts +4 -0
- package/esm/item/combo.js +4 -0
- package/esm/item/combo.js.map +1 -0
- package/esm/item/edge.d.ts +54 -0
- package/esm/item/edge.js +113 -0
- package/esm/item/edge.js.map +1 -0
- package/esm/item/item.d.ts +189 -0
- package/esm/item/item.js +636 -0
- package/esm/item/item.js.map +1 -0
- package/esm/item/node.d.ts +54 -0
- package/esm/item/node.js +170 -0
- package/esm/item/node.js.map +1 -0
- package/esm/runtime/controller/data.d.ts +65 -0
- package/esm/runtime/controller/data.js +489 -0
- package/esm/runtime/controller/data.js.map +1 -0
- package/esm/runtime/controller/extension.d.ts +9 -0
- package/esm/runtime/controller/extension.js +11 -0
- package/esm/runtime/controller/extension.js.map +1 -0
- package/esm/runtime/controller/index.d.ts +7 -0
- package/esm/runtime/controller/index.js +8 -0
- package/esm/runtime/controller/index.js.map +1 -0
- package/esm/runtime/controller/interaction.d.ts +51 -0
- package/esm/runtime/controller/interaction.js +259 -0
- package/esm/runtime/controller/interaction.js.map +1 -0
- package/esm/runtime/controller/item.d.ts +101 -0
- package/esm/runtime/controller/item.js +537 -0
- package/esm/runtime/controller/item.js.map +1 -0
- package/esm/runtime/controller/layout.d.ts +30 -0
- package/esm/runtime/controller/layout.js +204 -0
- package/esm/runtime/controller/layout.js.map +1 -0
- package/esm/runtime/controller/plugin.d.ts +34 -0
- package/esm/runtime/controller/plugin.js +140 -0
- package/esm/runtime/controller/plugin.js.map +1 -0
- package/esm/runtime/controller/theme.d.ts +29 -0
- package/esm/runtime/controller/theme.js +54 -0
- package/esm/runtime/controller/theme.js.map +1 -0
- package/esm/runtime/controller/viewport.d.ts +11 -0
- package/esm/runtime/controller/viewport.js +102 -0
- package/esm/runtime/controller/viewport.js.map +1 -0
- package/esm/runtime/graph.d.ts +462 -0
- package/esm/runtime/graph.js +1077 -0
- package/esm/runtime/graph.js.map +1 -0
- package/esm/runtime/hooks.d.ts +33 -0
- package/esm/runtime/hooks.js +74 -0
- package/esm/runtime/hooks.js.map +1 -0
- package/esm/stdlib/behavior/activate-relations.d.ts +62 -0
- package/esm/stdlib/behavior/activate-relations.js +81 -0
- package/esm/stdlib/behavior/activate-relations.js.map +1 -0
- package/esm/stdlib/behavior/brush-select.d.ts +110 -0
- package/esm/stdlib/behavior/brush-select.js +268 -0
- package/esm/stdlib/behavior/brush-select.js.map +1 -0
- package/esm/stdlib/behavior/click-select.d.ts +71 -0
- package/esm/stdlib/behavior/click-select.js +143 -0
- package/esm/stdlib/behavior/click-select.js.map +1 -0
- package/esm/stdlib/behavior/drag-canvas.d.ts +82 -0
- package/esm/stdlib/behavior/drag-canvas.js +246 -0
- package/esm/stdlib/behavior/drag-canvas.js.map +1 -0
- package/esm/stdlib/behavior/drag-node.d.ts +80 -0
- package/esm/stdlib/behavior/drag-node.js +250 -0
- package/esm/stdlib/behavior/drag-node.js.map +1 -0
- package/esm/stdlib/behavior/hover-activate.d.ts +41 -0
- package/esm/stdlib/behavior/hover-activate.js +63 -0
- package/esm/stdlib/behavior/hover-activate.js.map +1 -0
- package/esm/stdlib/behavior/lasso-select.d.ts +27 -0
- package/esm/stdlib/behavior/lasso-select.js +79 -0
- package/esm/stdlib/behavior/lasso-select.js.map +1 -0
- package/esm/stdlib/behavior/orbit-canvas-3d.d.ts +37 -0
- package/esm/stdlib/behavior/orbit-canvas-3d.js +62 -0
- package/esm/stdlib/behavior/orbit-canvas-3d.js.map +1 -0
- package/esm/stdlib/behavior/rotate-canvas-3d.d.ts +61 -0
- package/esm/stdlib/behavior/rotate-canvas-3d.js +123 -0
- package/esm/stdlib/behavior/rotate-canvas-3d.js.map +1 -0
- package/esm/stdlib/behavior/track-canvas-3d.d.ts +37 -0
- package/esm/stdlib/behavior/track-canvas-3d.js +62 -0
- package/esm/stdlib/behavior/track-canvas-3d.js.map +1 -0
- package/esm/stdlib/behavior/zoom-canvas-3d.d.ts +51 -0
- package/esm/stdlib/behavior/zoom-canvas-3d.js +74 -0
- package/esm/stdlib/behavior/zoom-canvas-3d.js.map +1 -0
- package/esm/stdlib/behavior/zoom-canvas.d.ts +61 -0
- package/esm/stdlib/behavior/zoom-canvas.js +160 -0
- package/esm/stdlib/behavior/zoom-canvas.js.map +1 -0
- package/esm/stdlib/data/comboFromNode.d.ts +9 -0
- package/esm/stdlib/data/comboFromNode.js +28 -0
- package/esm/stdlib/data/comboFromNode.js.map +1 -0
- package/esm/stdlib/index.d.ts +80 -0
- package/esm/stdlib/index.js +82 -0
- package/esm/stdlib/index.js.map +1 -0
- package/esm/stdlib/item/edge/base.d.ts +111 -0
- package/esm/stdlib/item/edge/base.js +341 -0
- package/esm/stdlib/item/edge/base.js.map +1 -0
- package/esm/stdlib/item/edge/index.d.ts +1 -0
- package/esm/stdlib/item/edge/index.js +2 -0
- package/esm/stdlib/item/edge/index.js.map +1 -0
- package/esm/stdlib/item/edge/line.d.ts +33 -0
- package/esm/stdlib/item/edge/line.js +45 -0
- package/esm/stdlib/item/edge/line.js.map +1 -0
- package/esm/stdlib/item/node/base.d.ts +137 -0
- package/esm/stdlib/item/node/base.js +414 -0
- package/esm/stdlib/item/node/base.js.map +1 -0
- package/esm/stdlib/item/node/base3d.d.ts +72 -0
- package/esm/stdlib/item/node/base3d.js +113 -0
- package/esm/stdlib/item/node/base3d.js.map +1 -0
- package/esm/stdlib/item/node/circle.d.ts +30 -0
- package/esm/stdlib/item/node/circle.js +56 -0
- package/esm/stdlib/item/node/circle.js.map +1 -0
- package/esm/stdlib/item/node/index.d.ts +2 -0
- package/esm/stdlib/item/node/index.js +3 -0
- package/esm/stdlib/item/node/index.js.map +1 -0
- package/esm/stdlib/item/node/sphere.d.ts +33 -0
- package/esm/stdlib/item/node/sphere.js +52 -0
- package/esm/stdlib/item/node/sphere.js.map +1 -0
- package/esm/stdlib/plugin/legend/index.d.ts +121 -0
- package/esm/stdlib/plugin/legend/index.js +587 -0
- package/esm/stdlib/plugin/legend/index.js.map +1 -0
- package/esm/stdlib/plugin/minimap/index.d.ts +106 -0
- package/esm/stdlib/plugin/minimap/index.js +578 -0
- package/esm/stdlib/plugin/minimap/index.js.map +1 -0
- package/esm/stdlib/selector/lasso.d.ts +15 -0
- package/esm/stdlib/selector/lasso.js +61 -0
- package/esm/stdlib/selector/lasso.js.map +1 -0
- package/esm/stdlib/selector/rect.d.ts +16 -0
- package/esm/stdlib/selector/rect.js +54 -0
- package/esm/stdlib/selector/rect.js.map +1 -0
- package/esm/stdlib/theme/dark.d.ts +3 -0
- package/esm/stdlib/theme/dark.js +279 -0
- package/esm/stdlib/theme/dark.js.map +1 -0
- package/esm/stdlib/theme/light.d.ts +3 -0
- package/esm/stdlib/theme/light.js +274 -0
- package/esm/stdlib/theme/light.js.map +1 -0
- package/esm/stdlib/themeSolver/base.d.ts +15 -0
- package/esm/stdlib/themeSolver/base.js +11 -0
- package/esm/stdlib/themeSolver/base.js.map +1 -0
- package/esm/stdlib/themeSolver/spec.d.ts +37 -0
- package/esm/stdlib/themeSolver/spec.js +66 -0
- package/esm/stdlib/themeSolver/spec.js.map +1 -0
- package/esm/stdlib/themeSolver/subject.d.ts +43 -0
- package/esm/stdlib/themeSolver/subject.js +396 -0
- package/esm/stdlib/themeSolver/subject.js.map +1 -0
- package/esm/types/animate.d.ts +59 -0
- package/esm/types/animate.js +2 -0
- package/esm/types/animate.js.map +1 -0
- package/esm/types/behavior.d.ts +45 -0
- package/esm/types/behavior.js +14 -0
- package/esm/types/behavior.js.map +1 -0
- package/esm/types/combo.d.ts +87 -0
- package/esm/types/combo.js +2 -0
- package/esm/types/combo.js.map +1 -0
- package/esm/types/common.d.ts +6 -0
- package/esm/types/common.js +2 -0
- package/esm/types/common.js.map +1 -0
- package/esm/types/data.d.ts +21 -0
- package/esm/types/data.js +2 -0
- package/esm/types/data.js.map +1 -0
- package/esm/types/edge.d.ts +100 -0
- package/esm/types/edge.js +2 -0
- package/esm/types/edge.js.map +1 -0
- package/esm/types/event.d.ts +30 -0
- package/esm/types/event.js +31 -0
- package/esm/types/event.js.map +1 -0
- package/esm/types/graph.d.ts +445 -0
- package/esm/types/graph.js +2 -0
- package/esm/types/graph.js.map +1 -0
- package/esm/types/hook.d.ts +97 -0
- package/esm/types/hook.js +2 -0
- package/esm/types/hook.js.map +1 -0
- package/esm/types/index.d.ts +10 -0
- package/esm/types/index.js +2 -0
- package/esm/types/index.js.map +1 -0
- package/esm/types/item.d.ts +229 -0
- package/esm/types/item.js +16 -0
- package/esm/types/item.js.map +1 -0
- package/esm/types/layout.d.ts +69 -0
- package/esm/types/layout.js +20 -0
- package/esm/types/layout.js.map +1 -0
- package/esm/types/node.d.ts +134 -0
- package/esm/types/node.js +2 -0
- package/esm/types/node.js.map +1 -0
- package/esm/types/plugin.d.ts +40 -0
- package/esm/types/plugin.js +53 -0
- package/esm/types/plugin.js.map +1 -0
- package/esm/types/render.d.ts +1 -0
- package/esm/types/render.js +2 -0
- package/esm/types/render.js.map +1 -0
- package/esm/types/spec.d.ts +65 -0
- package/esm/types/spec.js +2 -0
- package/esm/types/spec.js.map +1 -0
- package/esm/types/stdlib.d.ts +13 -0
- package/esm/types/stdlib.js +2 -0
- package/esm/types/stdlib.js.map +1 -0
- package/esm/types/theme.d.ts +102 -0
- package/esm/types/theme.js +15 -0
- package/esm/types/theme.js.map +1 -0
- package/esm/types/view.d.ts +23 -0
- package/esm/types/view.js +2 -0
- package/esm/types/view.js.map +1 -0
- package/esm/util/animate.d.ts +101 -0
- package/esm/util/animate.js +350 -0
- package/esm/util/animate.js.map +1 -0
- package/esm/util/array.d.ts +20 -0
- package/esm/util/array.js +60 -0
- package/esm/util/array.js.map +1 -0
- package/esm/util/canvas.d.ts +20 -0
- package/esm/util/canvas.js +81 -0
- package/esm/util/canvas.js.map +1 -0
- package/esm/util/event.d.ts +12 -0
- package/esm/util/event.js +26 -0
- package/esm/util/event.js.map +1 -0
- package/esm/util/extend.d.ts +21 -0
- package/esm/util/extend.js +22 -0
- package/esm/util/extend.js.map +1 -0
- package/esm/util/extension.d.ts +10 -0
- package/esm/util/extension.js +24 -0
- package/esm/util/extension.js.map +1 -0
- package/esm/util/index.d.ts +14 -0
- package/esm/util/index.js +5 -0
- package/esm/util/index.js.map +1 -0
- package/esm/util/item.d.ts +14 -0
- package/esm/util/item.js +42 -0
- package/esm/util/item.js.map +1 -0
- package/esm/util/mapper.d.ts +17 -0
- package/esm/util/mapper.js +60 -0
- package/esm/util/mapper.js.map +1 -0
- package/esm/util/math.d.ts +8 -0
- package/esm/util/math.js +9 -0
- package/esm/util/math.js.map +1 -0
- package/esm/util/point.d.ts +61 -0
- package/esm/util/point.js +160 -0
- package/esm/util/point.js.map +1 -0
- package/esm/util/shape.d.ts +105 -0
- package/esm/util/shape.js +504 -0
- package/esm/util/shape.js.map +1 -0
- package/esm/util/shape3d.d.ts +23 -0
- package/esm/util/shape3d.js +147 -0
- package/esm/util/shape3d.js.map +1 -0
- package/esm/util/text.d.ts +18 -0
- package/esm/util/text.js +36 -0
- package/esm/util/text.js.map +1 -0
- package/esm/util/type.d.ts +2 -0
- package/esm/util/type.js +2 -0
- package/esm/util/type.js.map +1 -0
- package/esm/util/zoom.d.ts +17 -0
- package/esm/util/zoom.js +36 -0
- package/esm/util/zoom.js.map +1 -0
- package/lib/constant/index.d.ts +1 -0
- package/lib/constant/index.js +18 -0
- package/lib/constant/index.js.map +1 -0
- package/lib/constant/shape.d.ts +27 -0
- package/lib/constant/shape.js +29 -0
- package/lib/constant/shape.js.map +1 -0
- package/lib/index.d.ts +124 -4
- package/lib/index.js +30 -27
- package/lib/index.js.map +1 -0
- package/lib/item/combo.d.ts +4 -0
- package/lib/item/combo.js +10 -0
- package/lib/item/combo.js.map +1 -0
- package/lib/item/edge.d.ts +54 -0
- package/lib/item/edge.js +119 -0
- package/lib/item/edge.js.map +1 -0
- package/lib/item/item.d.ts +189 -0
- package/lib/item/item.js +639 -0
- package/lib/item/item.js.map +1 -0
- package/lib/item/node.d.ts +54 -0
- package/lib/item/node.js +176 -0
- package/lib/item/node.js.map +1 -0
- package/lib/runtime/controller/data.d.ts +65 -0
- package/lib/runtime/controller/data.js +493 -0
- package/lib/runtime/controller/data.js.map +1 -0
- package/lib/runtime/controller/extension.d.ts +9 -0
- package/lib/runtime/controller/extension.js +15 -0
- package/lib/runtime/controller/extension.js.map +1 -0
- package/lib/runtime/controller/index.d.ts +7 -0
- package/lib/runtime/controller/index.js +24 -0
- package/lib/runtime/controller/index.js.map +1 -0
- package/lib/runtime/controller/interaction.d.ts +51 -0
- package/lib/runtime/controller/interaction.js +263 -0
- package/lib/runtime/controller/interaction.js.map +1 -0
- package/lib/runtime/controller/item.d.ts +101 -0
- package/lib/runtime/controller/item.js +544 -0
- package/lib/runtime/controller/item.js.map +1 -0
- package/lib/runtime/controller/layout.d.ts +30 -0
- package/lib/runtime/controller/layout.js +208 -0
- package/lib/runtime/controller/layout.js.map +1 -0
- package/lib/runtime/controller/plugin.d.ts +34 -0
- package/lib/runtime/controller/plugin.js +147 -0
- package/lib/runtime/controller/plugin.js.map +1 -0
- package/lib/runtime/controller/theme.d.ts +29 -0
- package/lib/runtime/controller/theme.js +61 -0
- package/lib/runtime/controller/theme.js.map +1 -0
- package/lib/runtime/controller/viewport.d.ts +11 -0
- package/lib/runtime/controller/viewport.js +106 -0
- package/lib/runtime/controller/viewport.js.map +1 -0
- package/lib/runtime/graph.d.ts +462 -0
- package/lib/runtime/graph.js +1083 -0
- package/lib/runtime/graph.js.map +1 -0
- package/lib/runtime/hooks.d.ts +33 -0
- package/lib/runtime/hooks.js +77 -0
- package/lib/runtime/hooks.js.map +1 -0
- package/lib/stdlib/behavior/activate-relations.d.ts +62 -0
- package/lib/stdlib/behavior/activate-relations.js +84 -0
- package/lib/stdlib/behavior/activate-relations.js.map +1 -0
- package/lib/stdlib/behavior/brush-select.d.ts +110 -0
- package/lib/stdlib/behavior/brush-select.js +271 -0
- package/lib/stdlib/behavior/brush-select.js.map +1 -0
- package/lib/stdlib/behavior/click-select.d.ts +71 -0
- package/lib/stdlib/behavior/click-select.js +146 -0
- package/lib/stdlib/behavior/click-select.js.map +1 -0
- package/lib/stdlib/behavior/drag-canvas.d.ts +82 -0
- package/lib/stdlib/behavior/drag-canvas.js +249 -0
- package/lib/stdlib/behavior/drag-canvas.js.map +1 -0
- package/lib/stdlib/behavior/drag-node.d.ts +80 -0
- package/lib/stdlib/behavior/drag-node.js +253 -0
- package/lib/stdlib/behavior/drag-node.js.map +1 -0
- package/lib/stdlib/behavior/hover-activate.d.ts +41 -0
- package/lib/stdlib/behavior/hover-activate.js +67 -0
- package/lib/stdlib/behavior/hover-activate.js.map +1 -0
- package/lib/stdlib/behavior/lasso-select.d.ts +27 -0
- package/lib/stdlib/behavior/lasso-select.js +85 -0
- package/lib/stdlib/behavior/lasso-select.js.map +1 -0
- package/lib/stdlib/behavior/orbit-canvas-3d.d.ts +37 -0
- package/lib/stdlib/behavior/orbit-canvas-3d.js +68 -0
- package/lib/stdlib/behavior/orbit-canvas-3d.js.map +1 -0
- package/lib/stdlib/behavior/rotate-canvas-3d.d.ts +61 -0
- package/lib/stdlib/behavior/rotate-canvas-3d.js +126 -0
- package/lib/stdlib/behavior/rotate-canvas-3d.js.map +1 -0
- package/lib/stdlib/behavior/track-canvas-3d.d.ts +37 -0
- package/lib/stdlib/behavior/track-canvas-3d.js +68 -0
- package/lib/stdlib/behavior/track-canvas-3d.js.map +1 -0
- package/lib/stdlib/behavior/zoom-canvas-3d.d.ts +51 -0
- package/lib/stdlib/behavior/zoom-canvas-3d.js +77 -0
- package/lib/stdlib/behavior/zoom-canvas-3d.js.map +1 -0
- package/lib/stdlib/behavior/zoom-canvas.d.ts +61 -0
- package/lib/stdlib/behavior/zoom-canvas.js +163 -0
- package/lib/stdlib/behavior/zoom-canvas.js.map +1 -0
- package/lib/stdlib/data/comboFromNode.d.ts +9 -0
- package/lib/stdlib/data/comboFromNode.js +32 -0
- package/lib/stdlib/data/comboFromNode.js.map +1 -0
- package/lib/stdlib/index.d.ts +80 -0
- package/lib/stdlib/index.js +90 -0
- package/lib/stdlib/index.js.map +1 -0
- package/lib/stdlib/item/edge/base.d.ts +111 -0
- package/lib/stdlib/item/edge/base.js +345 -0
- package/lib/stdlib/item/edge/base.js.map +1 -0
- package/lib/stdlib/item/edge/index.d.ts +1 -0
- package/lib/stdlib/item/edge/index.js +18 -0
- package/lib/stdlib/item/edge/index.js.map +1 -0
- package/lib/stdlib/item/edge/line.d.ts +33 -0
- package/lib/stdlib/item/edge/line.js +49 -0
- package/lib/stdlib/item/edge/line.js.map +1 -0
- package/lib/stdlib/item/node/base.d.ts +137 -0
- package/lib/stdlib/item/node/base.js +418 -0
- package/lib/stdlib/item/node/base.js.map +1 -0
- package/lib/stdlib/item/node/base3d.d.ts +72 -0
- package/lib/stdlib/item/node/base3d.js +117 -0
- package/lib/stdlib/item/node/base3d.js.map +1 -0
- package/lib/stdlib/item/node/circle.d.ts +30 -0
- package/lib/stdlib/item/node/circle.js +60 -0
- package/lib/stdlib/item/node/circle.js.map +1 -0
- package/lib/stdlib/item/node/index.d.ts +2 -0
- package/lib/stdlib/item/node/index.js +19 -0
- package/lib/stdlib/item/node/index.js.map +1 -0
- package/lib/stdlib/item/node/sphere.d.ts +33 -0
- package/lib/stdlib/item/node/sphere.js +56 -0
- package/lib/stdlib/item/node/sphere.js.map +1 -0
- package/lib/stdlib/plugin/legend/index.d.ts +121 -0
- package/lib/stdlib/plugin/legend/index.js +590 -0
- package/lib/stdlib/plugin/legend/index.js.map +1 -0
- package/lib/stdlib/plugin/minimap/index.d.ts +106 -0
- package/lib/stdlib/plugin/minimap/index.js +581 -0
- package/lib/stdlib/plugin/minimap/index.js.map +1 -0
- package/lib/stdlib/selector/lasso.d.ts +15 -0
- package/lib/stdlib/selector/lasso.js +63 -0
- package/lib/stdlib/selector/lasso.js.map +1 -0
- package/lib/stdlib/selector/rect.d.ts +16 -0
- package/lib/stdlib/selector/rect.js +56 -0
- package/lib/stdlib/selector/rect.js.map +1 -0
- package/lib/stdlib/theme/dark.d.ts +3 -0
- package/lib/stdlib/theme/dark.js +281 -0
- package/lib/stdlib/theme/dark.js.map +1 -0
- package/lib/stdlib/theme/light.d.ts +3 -0
- package/lib/stdlib/theme/light.js +276 -0
- package/lib/stdlib/theme/light.js.map +1 -0
- package/lib/stdlib/themeSolver/base.d.ts +15 -0
- package/lib/stdlib/themeSolver/base.js +14 -0
- package/lib/stdlib/themeSolver/base.js.map +1 -0
- package/lib/stdlib/themeSolver/spec.d.ts +37 -0
- package/lib/stdlib/themeSolver/spec.js +72 -0
- package/lib/stdlib/themeSolver/spec.js.map +1 -0
- package/lib/stdlib/themeSolver/subject.d.ts +43 -0
- package/lib/stdlib/themeSolver/subject.js +404 -0
- package/lib/stdlib/themeSolver/subject.js.map +1 -0
- package/lib/types/animate.d.ts +59 -0
- package/lib/types/animate.js +3 -0
- package/lib/types/animate.js.map +1 -0
- package/lib/types/behavior.d.ts +45 -0
- package/lib/types/behavior.js +18 -0
- package/lib/types/behavior.js.map +1 -0
- package/lib/types/combo.d.ts +87 -0
- package/lib/types/combo.js +3 -0
- package/lib/types/combo.js.map +1 -0
- package/lib/types/common.d.ts +6 -0
- package/lib/types/common.js +3 -0
- package/lib/types/common.js.map +1 -0
- package/lib/types/data.d.ts +21 -0
- package/lib/types/data.js +3 -0
- package/lib/types/data.js.map +1 -0
- package/lib/types/edge.d.ts +100 -0
- package/lib/types/edge.js +3 -0
- package/lib/types/edge.js.map +1 -0
- package/lib/types/event.d.ts +30 -0
- package/lib/types/event.js +34 -0
- package/lib/types/event.js.map +1 -0
- package/lib/types/graph.d.ts +445 -0
- package/lib/types/graph.js +3 -0
- package/lib/types/graph.js.map +1 -0
- package/lib/types/hook.d.ts +97 -0
- package/lib/types/hook.js +3 -0
- package/lib/types/hook.js.map +1 -0
- package/lib/types/index.d.ts +10 -0
- package/lib/types/index.js +7 -0
- package/lib/types/index.js.map +1 -0
- package/lib/types/item.d.ts +229 -0
- package/lib/types/item.js +19 -0
- package/lib/types/item.js.map +1 -0
- package/lib/types/layout.d.ts +69 -0
- package/lib/types/layout.js +25 -0
- package/lib/types/layout.js.map +1 -0
- package/lib/types/node.d.ts +134 -0
- package/lib/types/node.js +3 -0
- package/lib/types/node.js.map +1 -0
- package/lib/types/plugin.d.ts +40 -0
- package/lib/types/plugin.js +57 -0
- package/lib/types/plugin.js.map +1 -0
- package/lib/types/render.d.ts +1 -0
- package/lib/types/render.js +3 -0
- package/lib/types/render.js.map +1 -0
- package/lib/types/spec.d.ts +65 -0
- package/lib/types/spec.js +3 -0
- package/lib/types/spec.js.map +1 -0
- package/lib/types/stdlib.d.ts +13 -0
- package/lib/types/stdlib.js +3 -0
- package/lib/types/stdlib.js.map +1 -0
- package/lib/types/theme.d.ts +102 -0
- package/lib/types/theme.js +19 -0
- package/lib/types/theme.js.map +1 -0
- package/lib/types/view.d.ts +23 -0
- package/lib/types/view.js +3 -0
- package/lib/types/view.js.map +1 -0
- package/lib/util/animate.d.ts +101 -0
- package/lib/util/animate.js +358 -0
- package/lib/util/animate.js.map +1 -0
- package/lib/util/array.d.ts +20 -0
- package/lib/util/array.js +68 -0
- package/lib/util/array.js.map +1 -0
- package/lib/util/canvas.d.ts +20 -0
- package/lib/util/canvas.js +86 -0
- package/lib/util/canvas.js.map +1 -0
- package/lib/util/event.d.ts +12 -0
- package/lib/util/event.js +30 -0
- package/lib/util/event.js.map +1 -0
- package/lib/util/extend.d.ts +21 -0
- package/lib/util/extend.js +29 -0
- package/lib/util/extend.js.map +1 -0
- package/lib/util/extension.d.ts +10 -0
- package/lib/util/extension.js +29 -0
- package/lib/util/extension.js.map +1 -0
- package/lib/util/index.d.ts +14 -0
- package/lib/util/index.js +7 -0
- package/lib/util/index.js.map +1 -0
- package/lib/util/item.d.ts +14 -0
- package/lib/util/item.js +47 -0
- package/lib/util/item.js.map +1 -0
- package/lib/util/mapper.d.ts +17 -0
- package/lib/util/mapper.js +63 -0
- package/lib/util/mapper.js.map +1 -0
- package/lib/util/math.d.ts +8 -0
- package/lib/util/math.js +13 -0
- package/lib/util/math.js.map +1 -0
- package/lib/util/point.d.ts +61 -0
- package/lib/util/point.js +169 -0
- package/lib/util/point.js.map +1 -0
- package/lib/util/shape.d.ts +105 -0
- package/lib/util/shape.js +519 -0
- package/lib/util/shape.js.map +1 -0
- package/lib/util/shape3d.d.ts +23 -0
- package/lib/util/shape3d.js +153 -0
- package/lib/util/shape3d.js.map +1 -0
- package/lib/util/text.d.ts +18 -0
- package/lib/util/text.js +41 -0
- package/lib/util/text.js.map +1 -0
- package/lib/util/type.d.ts +2 -0
- package/lib/util/type.js +6 -0
- package/lib/util/type.js.map +1 -0
- package/lib/util/zoom.d.ts +17 -0
- package/lib/util/zoom.js +41 -0
- package/lib/util/zoom.js.map +1 -0
- package/package.json +82 -50
- package/src/constant/index.ts +1 -0
- package/src/constant/shape.ts +33 -0
- package/src/index.ts +13 -0
- package/src/item/combo.ts +5 -0
- package/src/item/edge.ts +177 -0
- package/src/item/item.ts +812 -0
- package/src/item/node.ts +275 -0
- package/src/runtime/controller/data.ts +575 -0
- package/src/runtime/controller/extension.ts +14 -0
- package/src/runtime/controller/index.ts +7 -0
- package/src/runtime/controller/interaction.ts +343 -0
- package/src/runtime/controller/item.ts +780 -0
- package/src/runtime/controller/layout.ts +251 -0
- package/src/runtime/controller/plugin.ts +171 -0
- package/src/runtime/controller/theme.ts +69 -0
- package/src/runtime/controller/viewport.ts +131 -0
- package/src/runtime/graph.ts +1439 -0
- package/src/runtime/hooks.ts +64 -0
- package/src/stdlib/behavior/activate-relations.ts +139 -0
- package/src/stdlib/behavior/brush-select.ts +386 -0
- package/src/stdlib/behavior/click-select.ts +201 -0
- package/src/stdlib/behavior/drag-canvas.ts +333 -0
- package/src/stdlib/behavior/drag-node.ts +402 -0
- package/src/stdlib/behavior/hover-activate.ts +106 -0
- package/src/stdlib/behavior/lasso-select.ts +94 -0
- package/src/stdlib/behavior/orbit-canvas-3d.ts +104 -0
- package/src/stdlib/behavior/rotate-canvas-3d.ts +172 -0
- package/src/stdlib/behavior/track-canvas-3d.ts +104 -0
- package/src/stdlib/behavior/zoom-canvas-3d.ts +127 -0
- package/src/stdlib/behavior/zoom-canvas.ts +244 -0
- package/src/stdlib/data/comboFromNode.ts +28 -0
- package/src/stdlib/index.ts +87 -0
- package/src/stdlib/item/edge/base.ts +571 -0
- package/src/stdlib/item/edge/index.ts +1 -0
- package/src/stdlib/item/edge/line.ts +98 -0
- package/src/stdlib/item/node/base.ts +726 -0
- package/src/stdlib/item/node/base3d.ts +192 -0
- package/src/stdlib/item/node/circle.ts +113 -0
- package/src/stdlib/item/node/index.ts +2 -0
- package/src/stdlib/item/node/sphere.ts +99 -0
- package/src/stdlib/plugin/legend/index.ts +733 -0
- package/src/stdlib/plugin/minimap/index.ts +689 -0
- package/src/stdlib/selector/lasso.ts +75 -0
- package/src/stdlib/selector/rect.ts +78 -0
- package/src/stdlib/theme/dark.ts +340 -0
- package/src/stdlib/theme/light.ts +333 -0
- package/src/stdlib/themeSolver/base.ts +22 -0
- package/src/stdlib/themeSolver/spec.ts +110 -0
- package/src/stdlib/themeSolver/subject.ts +502 -0
- package/src/types/animate.ts +71 -0
- package/src/types/behavior.ts +49 -0
- package/src/types/combo.ts +120 -0
- package/src/types/common.ts +7 -0
- package/src/types/data.ts +35 -0
- package/src/types/edge.ts +119 -0
- package/src/types/event.ts +47 -0
- package/src/types/graph.ts +573 -0
- package/src/types/hook.ts +98 -0
- package/src/types/index.ts +29 -0
- package/src/types/item.ts +324 -0
- package/src/types/layout.ts +138 -0
- package/src/types/node.ts +162 -0
- package/src/types/plugin.ts +77 -0
- package/src/types/render.ts +1 -0
- package/src/types/spec.ts +116 -0
- package/src/types/stdlib.ts +25 -0
- package/src/types/theme.ts +101 -0
- package/src/types/view.ts +31 -0
- package/src/util/animate.ts +430 -0
- package/src/util/array.ts +57 -0
- package/src/util/canvas.ts +95 -0
- package/src/util/event.ts +34 -0
- package/src/util/extend.ts +42 -0
- package/src/util/extension.ts +29 -0
- package/src/util/index.ts +4 -0
- package/src/util/item.ts +70 -0
- package/src/util/mapper.ts +61 -0
- package/src/util/math.ts +9 -0
- package/src/util/point.ts +195 -0
- package/src/util/shape.ts +609 -0
- package/src/util/shape3d.ts +198 -0
- package/src/util/text.ts +49 -0
- package/src/util/type.ts +4 -0
- package/src/util/zoom.ts +39 -0
- package/README.en-US.md +0 -170
- package/README.md +0 -177
- package/dist/g6.min.js.map +0 -1
- package/es/index.d.ts +0 -4
- package/es/index.js +0 -5
package/src/item/item.ts
ADDED
|
@@ -0,0 +1,812 @@
|
|
|
1
|
+
import { Group, DisplayObject, AABB, IAnimation } from '@antv/g';
|
|
2
|
+
import { clone, isFunction, throttle } from '@antv/util';
|
|
3
|
+
import { OTHER_SHAPES_FIELD_NAME, RESERVED_SHAPE_IDS } from '../constant';
|
|
4
|
+
import { EdgeShapeMap } from '../types/edge';
|
|
5
|
+
import {
|
|
6
|
+
DisplayMapper,
|
|
7
|
+
IItem,
|
|
8
|
+
ItemDisplayModel,
|
|
9
|
+
ItemModel,
|
|
10
|
+
ItemModelData,
|
|
11
|
+
ItemShapeStyles,
|
|
12
|
+
ITEM_TYPE,
|
|
13
|
+
State,
|
|
14
|
+
lodStrategyObj,
|
|
15
|
+
} from '../types/item';
|
|
16
|
+
import { NodeShapeMap } from '../types/node';
|
|
17
|
+
import { EdgeStyleSet, NodeStyleSet } from '../types/theme';
|
|
18
|
+
import { isArrayOverlap } from '../util/array';
|
|
19
|
+
import { mergeStyles, updateShapes } from '../util/shape';
|
|
20
|
+
import { isEncode } from '../util/type';
|
|
21
|
+
import { DEFAULT_MAPPER } from '../util/mapper';
|
|
22
|
+
import {
|
|
23
|
+
getShapeAnimateBeginStyles,
|
|
24
|
+
animateShapes,
|
|
25
|
+
GROUP_ANIMATE_STYLES,
|
|
26
|
+
} from '../util/animate';
|
|
27
|
+
import { AnimateTiming, IAnimates } from '../types/animate';
|
|
28
|
+
import { formatLodStrategy } from '../util/zoom';
|
|
29
|
+
|
|
30
|
+
export default abstract class Item implements IItem {
|
|
31
|
+
public destroyed = false;
|
|
32
|
+
/** Inner model. */
|
|
33
|
+
public model: ItemModel;
|
|
34
|
+
/** Display model, user will not touch it. */
|
|
35
|
+
public displayModel: ItemDisplayModel;
|
|
36
|
+
/** The mapper configured at graph with field name 'node' / 'edge' / 'combo'. */
|
|
37
|
+
public mapper: DisplayMapper;
|
|
38
|
+
/** The state sstyle mapper configured at traph with field name 'nodeState' / 'edgeState' / 'comboState'. */
|
|
39
|
+
public stateMapper: {
|
|
40
|
+
[stateName: string]: DisplayMapper;
|
|
41
|
+
};
|
|
42
|
+
/** The graphic group for item drawing. */
|
|
43
|
+
public group: Group;
|
|
44
|
+
/** The keyShape of the item. */
|
|
45
|
+
public keyShape: DisplayObject;
|
|
46
|
+
/** render extension for this item. */
|
|
47
|
+
public renderExt;
|
|
48
|
+
/** Visibility. */
|
|
49
|
+
public visible = true;
|
|
50
|
+
/** The states on the item. */
|
|
51
|
+
public states: {
|
|
52
|
+
name: string;
|
|
53
|
+
value: string | boolean;
|
|
54
|
+
}[] = [];
|
|
55
|
+
/** The map caches the shapes of the item. The key is the shape id, the value is the g shape. */
|
|
56
|
+
public shapeMap: NodeShapeMap | EdgeShapeMap = {
|
|
57
|
+
keyShape: undefined,
|
|
58
|
+
};
|
|
59
|
+
public afterDrawShapeMap = {};
|
|
60
|
+
/** Set to different value in implements. */
|
|
61
|
+
public type: ITEM_TYPE;
|
|
62
|
+
/** The flag of transient item. */
|
|
63
|
+
public transient: Boolean = false;
|
|
64
|
+
public renderExtensions: any; // TODO
|
|
65
|
+
/** Cache the animation instances to stop at next lifecycle. */
|
|
66
|
+
public animations: IAnimation[];
|
|
67
|
+
|
|
68
|
+
public themeStyles: {
|
|
69
|
+
default?: ItemShapeStyles;
|
|
70
|
+
[stateName: string]: ItemShapeStyles;
|
|
71
|
+
};
|
|
72
|
+
/** The zoom strategy to show and hide shapes according to their lod. */
|
|
73
|
+
public lodStrategy: lodStrategyObj;
|
|
74
|
+
/** Last zoom ratio. */
|
|
75
|
+
public zoom: number;
|
|
76
|
+
/** Cache the chaging states which are not consomed by draw */
|
|
77
|
+
public changedStates: string[];
|
|
78
|
+
/** The listener for the animations frames. */
|
|
79
|
+
public onframe: Function;
|
|
80
|
+
|
|
81
|
+
private device: any; // for 3d
|
|
82
|
+
/** Cache the dirty tags for states when data changed, to re-map the state styles when state changed */
|
|
83
|
+
private stateDirtyMap: { [stateName: string]: boolean } = {};
|
|
84
|
+
private cacheStateStyles: { [stateName: string]: ItemShapeStyles } = {};
|
|
85
|
+
private cacheHiddenShape: { [shapeId: string]: boolean } = {};
|
|
86
|
+
|
|
87
|
+
// TODO: props type
|
|
88
|
+
constructor(props) {
|
|
89
|
+
this.device = props.device;
|
|
90
|
+
this.onframe = props.onframe;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** Initiate the item. */
|
|
94
|
+
public init(props) {
|
|
95
|
+
const {
|
|
96
|
+
model,
|
|
97
|
+
containerGroup,
|
|
98
|
+
mapper,
|
|
99
|
+
stateMapper,
|
|
100
|
+
renderExtensions,
|
|
101
|
+
zoom = 1,
|
|
102
|
+
theme = {},
|
|
103
|
+
} = props;
|
|
104
|
+
this.group = new Group();
|
|
105
|
+
this.group.setAttribute('data-item-type', this.type);
|
|
106
|
+
this.group.setAttribute('data-item-id', props.model.id);
|
|
107
|
+
containerGroup.appendChild(this.group);
|
|
108
|
+
this.model = model;
|
|
109
|
+
this.mapper = mapper;
|
|
110
|
+
this.zoom = zoom;
|
|
111
|
+
this.stateMapper = stateMapper;
|
|
112
|
+
this.displayModel = this.getDisplayModelAndChanges(model).model;
|
|
113
|
+
this.renderExtensions = renderExtensions;
|
|
114
|
+
const {
|
|
115
|
+
type = this.type === 'node' ? 'circle-node' : 'line-edge',
|
|
116
|
+
lodStrategy: modelLodStrategy,
|
|
117
|
+
} = this.displayModel.data;
|
|
118
|
+
const RenderExtension = renderExtensions.find((ext) => ext.type === type);
|
|
119
|
+
this.themeStyles = theme.styles;
|
|
120
|
+
const lodStrategy = modelLodStrategy
|
|
121
|
+
? formatLodStrategy(modelLodStrategy)
|
|
122
|
+
: theme.lodStrategy;
|
|
123
|
+
this.renderExt = new RenderExtension({
|
|
124
|
+
themeStyles: this.themeStyles.default,
|
|
125
|
+
lodStrategy,
|
|
126
|
+
device: this.device,
|
|
127
|
+
zoom: this.zoom,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Draws the shapes.
|
|
133
|
+
* @internal
|
|
134
|
+
* */
|
|
135
|
+
public draw(
|
|
136
|
+
displayModel: ItemDisplayModel,
|
|
137
|
+
diffData?: { previous: ItemModelData; current: ItemModelData },
|
|
138
|
+
diffState?: { previous: State[]; current: State[] },
|
|
139
|
+
onfinish: Function = () => {},
|
|
140
|
+
) {
|
|
141
|
+
// call this.renderExt.draw in extend implementations
|
|
142
|
+
this.afterDrawShapeMap =
|
|
143
|
+
this.renderExt.afterDraw?.(displayModel, {
|
|
144
|
+
...this.shapeMap,
|
|
145
|
+
...this.afterDrawShapeMap,
|
|
146
|
+
}) || {};
|
|
147
|
+
this.shapeMap = updateShapes(
|
|
148
|
+
this.shapeMap,
|
|
149
|
+
this.afterDrawShapeMap,
|
|
150
|
+
this.group,
|
|
151
|
+
false,
|
|
152
|
+
(id) => {
|
|
153
|
+
if (RESERVED_SHAPE_IDS.includes(id)) {
|
|
154
|
+
console.warn(
|
|
155
|
+
`Shape with id ${id} is reserved and should be returned in draw function, if the shape with ${id} returned by afterDraw is a new one, it will not be added to the group.`,
|
|
156
|
+
);
|
|
157
|
+
return false;
|
|
158
|
+
}
|
|
159
|
+
return true;
|
|
160
|
+
},
|
|
161
|
+
);
|
|
162
|
+
this.changedStates = [];
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Updates the shapes.
|
|
167
|
+
* @internal
|
|
168
|
+
* */
|
|
169
|
+
public update(
|
|
170
|
+
model: ItemModel,
|
|
171
|
+
diffData?: { previous: ItemModelData; current: ItemModelData },
|
|
172
|
+
isReplace?: boolean,
|
|
173
|
+
itemTheme?: {
|
|
174
|
+
styles: NodeStyleSet | EdgeStyleSet;
|
|
175
|
+
lodStrategy: lodStrategyObj;
|
|
176
|
+
},
|
|
177
|
+
onlyMove?: boolean,
|
|
178
|
+
onfinish?: Function,
|
|
179
|
+
) {
|
|
180
|
+
// 1. merge model into this model
|
|
181
|
+
this.model = model;
|
|
182
|
+
if (itemTheme) {
|
|
183
|
+
this.themeStyles = itemTheme.styles;
|
|
184
|
+
}
|
|
185
|
+
// 2. map new merged model to displayModel, keep prevModel and newModel for 3.
|
|
186
|
+
const { model: displayModel, typeChange } = this.getDisplayModelAndChanges(
|
|
187
|
+
this.model,
|
|
188
|
+
diffData,
|
|
189
|
+
isReplace,
|
|
190
|
+
);
|
|
191
|
+
this.displayModel = displayModel;
|
|
192
|
+
|
|
193
|
+
this.lodStrategy = displayModel.data.lodStrategy
|
|
194
|
+
? formatLodStrategy(displayModel.data.lodStrategy)
|
|
195
|
+
: itemTheme?.lodStrategy || this.lodStrategy;
|
|
196
|
+
|
|
197
|
+
if (onlyMove) {
|
|
198
|
+
this.updatePosition(displayModel, diffData, onfinish);
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
if (typeChange) {
|
|
203
|
+
Object.values(this.shapeMap).forEach((child) => child.destroy());
|
|
204
|
+
this.shapeMap = { keyShape: undefined };
|
|
205
|
+
const { type = this.type === 'node' ? 'circle-node' : 'line-edge' } =
|
|
206
|
+
displayModel.data;
|
|
207
|
+
const RenderExtension = this.renderExtensions.find(
|
|
208
|
+
(ext) => ext.type === type,
|
|
209
|
+
);
|
|
210
|
+
this.renderExt = new RenderExtension({
|
|
211
|
+
themeStyles: this.themeStyles.default,
|
|
212
|
+
lodStrategy: this.lodStrategy,
|
|
213
|
+
device: this.device,
|
|
214
|
+
zoom: this.zoom,
|
|
215
|
+
});
|
|
216
|
+
} else {
|
|
217
|
+
this.renderExt.themeStyles = this.themeStyles.default;
|
|
218
|
+
this.renderExt.lodStrategy = this.lodStrategy;
|
|
219
|
+
}
|
|
220
|
+
// 3. call element update fn from useLib
|
|
221
|
+
if (this.states?.length) {
|
|
222
|
+
this.drawWithStates(this.states, onfinish);
|
|
223
|
+
} else {
|
|
224
|
+
this.draw(this.displayModel, diffData, undefined, onfinish);
|
|
225
|
+
}
|
|
226
|
+
// 4. tag all the states with 'dirty', for state style regenerating when state changed
|
|
227
|
+
this.stateDirtyMap = {};
|
|
228
|
+
this.states.forEach(({ name }) => (this.stateDirtyMap[name] = true));
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Update the group's position, e.g. node, combo.
|
|
233
|
+
* @param displayModel
|
|
234
|
+
* @param diffData
|
|
235
|
+
* @param onfinish
|
|
236
|
+
* @returns
|
|
237
|
+
*/
|
|
238
|
+
public updatePosition(
|
|
239
|
+
displayModel: ItemDisplayModel,
|
|
240
|
+
diffData?: { previous: ItemModelData; current: ItemModelData },
|
|
241
|
+
onfinish?: Function,
|
|
242
|
+
) {}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Maps (mapper will be function, value, or encode format) model to displayModel and find out the shapes to be update for incremental updating.
|
|
246
|
+
* @param model inner model
|
|
247
|
+
* @param diffData changes from graphCore changed event
|
|
248
|
+
* @param isReplace whether replace the whole data or partial update
|
|
249
|
+
* @returns
|
|
250
|
+
*/
|
|
251
|
+
public getDisplayModelAndChanges(
|
|
252
|
+
innerModel: ItemModel,
|
|
253
|
+
diffData?: { previous: ItemModelData; current: ItemModelData },
|
|
254
|
+
isReplace?: boolean,
|
|
255
|
+
): {
|
|
256
|
+
model: ItemDisplayModel;
|
|
257
|
+
typeChange?: boolean;
|
|
258
|
+
} {
|
|
259
|
+
const { mapper, type } = this;
|
|
260
|
+
const defaultMapper = DEFAULT_MAPPER[type];
|
|
261
|
+
|
|
262
|
+
const { data: innerModelData, ...otherFields } = innerModel;
|
|
263
|
+
const { current = innerModelData, previous } = diffData || {};
|
|
264
|
+
|
|
265
|
+
// === no mapper, displayModel = model ===
|
|
266
|
+
if (!mapper) {
|
|
267
|
+
this.displayModel = defaultMapper(innerModel);
|
|
268
|
+
// compare the previous data and current data to find shape changes
|
|
269
|
+
let typeChange = false;
|
|
270
|
+
if (current) {
|
|
271
|
+
typeChange = Boolean(current.type);
|
|
272
|
+
}
|
|
273
|
+
return {
|
|
274
|
+
model: this.displayModel,
|
|
275
|
+
typeChange,
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// === mapper is function, displayModel is mapper(model), cannot diff the displayModel, so all the shapes need to be updated ===
|
|
280
|
+
if (isFunction(mapper))
|
|
281
|
+
return {
|
|
282
|
+
model: {
|
|
283
|
+
...defaultMapper(innerModel),
|
|
284
|
+
...(mapper as Function)(innerModel),
|
|
285
|
+
},
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
// === fields' values in mapper are final value or Encode ===
|
|
289
|
+
const dataChangedFields = isReplace
|
|
290
|
+
? undefined
|
|
291
|
+
: Object.keys(current).concat(Object.keys(otherFields)); // only fields in current data for partial updating
|
|
292
|
+
|
|
293
|
+
let typeChange = false;
|
|
294
|
+
const { data, ...otherProps } = innerModel;
|
|
295
|
+
const displayModelData = defaultMapper(innerModel).data; //clone(data);
|
|
296
|
+
// const defaultMappedModel = defaultMapper(innerModel);
|
|
297
|
+
Object.keys(mapper).forEach((fieldName) => {
|
|
298
|
+
let subMapper = mapper[fieldName];
|
|
299
|
+
const isReservedShapeId = RESERVED_SHAPE_IDS.includes(fieldName);
|
|
300
|
+
const isShapeId =
|
|
301
|
+
RESERVED_SHAPE_IDS.includes(fieldName) ||
|
|
302
|
+
fieldName === OTHER_SHAPES_FIELD_NAME;
|
|
303
|
+
|
|
304
|
+
if ((isShapeId && isEncode(subMapper)) || !isShapeId) {
|
|
305
|
+
// fields not about shape
|
|
306
|
+
if (!displayModelData.hasOwnProperty(fieldName)) {
|
|
307
|
+
const { changed, value: mappedValue } = updateChange({
|
|
308
|
+
innerModel,
|
|
309
|
+
mapper,
|
|
310
|
+
fieldName,
|
|
311
|
+
dataChangedFields,
|
|
312
|
+
});
|
|
313
|
+
if (isShapeId) {
|
|
314
|
+
if (!mappedValue) return;
|
|
315
|
+
subMapper = mappedValue;
|
|
316
|
+
} else {
|
|
317
|
+
displayModelData[fieldName] = mappedValue;
|
|
318
|
+
}
|
|
319
|
+
if (changed && fieldName === 'type') typeChange = true;
|
|
320
|
+
} else if (
|
|
321
|
+
fieldName === 'type' &&
|
|
322
|
+
(!dataChangedFields || dataChangedFields.includes('type'))
|
|
323
|
+
) {
|
|
324
|
+
typeChange = true;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
if (isReservedShapeId) {
|
|
329
|
+
// reserved shapes, fieldName is shapeId
|
|
330
|
+
displayModelData[fieldName] = displayModelData[fieldName] || {};
|
|
331
|
+
updateShapeChange({
|
|
332
|
+
innerModel,
|
|
333
|
+
mapper: subMapper,
|
|
334
|
+
dataChangedFields,
|
|
335
|
+
shapeConfig: displayModelData[fieldName],
|
|
336
|
+
});
|
|
337
|
+
} else if (fieldName === OTHER_SHAPES_FIELD_NAME) {
|
|
338
|
+
// other shapes
|
|
339
|
+
displayModelData[fieldName] = displayModelData[fieldName] || {};
|
|
340
|
+
Object.keys(subMapper).forEach((shapeId) => {
|
|
341
|
+
if (!displayModelData[fieldName]?.hasOwnProperty(shapeId)) {
|
|
342
|
+
displayModelData[fieldName][shapeId] =
|
|
343
|
+
displayModelData[fieldName][shapeId] || {};
|
|
344
|
+
const shappStyle = subMapper[shapeId];
|
|
345
|
+
updateShapeChange({
|
|
346
|
+
innerModel,
|
|
347
|
+
mapper: shappStyle,
|
|
348
|
+
dataChangedFields,
|
|
349
|
+
shapeConfig: displayModelData[fieldName][shapeId],
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
});
|
|
355
|
+
const displayModel = {
|
|
356
|
+
...otherProps,
|
|
357
|
+
data: displayModelData,
|
|
358
|
+
};
|
|
359
|
+
return {
|
|
360
|
+
model: displayModel,
|
|
361
|
+
typeChange,
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
public getID() {
|
|
366
|
+
return this.model.id;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
public getType() {
|
|
370
|
+
return this.type;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/** Show the item. */
|
|
374
|
+
public show(animate = true) {
|
|
375
|
+
// TODO: utilize graphcore's view
|
|
376
|
+
this.stopAnimations();
|
|
377
|
+
|
|
378
|
+
const { animates = {} } = this.displayModel.data;
|
|
379
|
+
if (animate && animates.show?.length) {
|
|
380
|
+
const showAnimateFieldsMap: any = {};
|
|
381
|
+
Object.values(animates.show).forEach((animate) => {
|
|
382
|
+
const { shapeId = 'group' } = animate;
|
|
383
|
+
showAnimateFieldsMap[shapeId] = (
|
|
384
|
+
showAnimateFieldsMap[shapeId] || []
|
|
385
|
+
).concat(animate.fields);
|
|
386
|
+
});
|
|
387
|
+
const targetStyleMap = {};
|
|
388
|
+
Object.keys(this.shapeMap).forEach((id) => {
|
|
389
|
+
const shape = this.shapeMap[id];
|
|
390
|
+
if (!this.cacheHiddenShape[id]) {
|
|
391
|
+
// set the animate fields to initial value
|
|
392
|
+
if (showAnimateFieldsMap[id]) {
|
|
393
|
+
targetStyleMap[id] = targetStyleMap[id] || {};
|
|
394
|
+
const beginStyle = getShapeAnimateBeginStyles(shape);
|
|
395
|
+
showAnimateFieldsMap[id].forEach((field) => {
|
|
396
|
+
if (beginStyle.hasOwnProperty(field)) {
|
|
397
|
+
targetStyleMap[id][field] = shape.style[field];
|
|
398
|
+
shape.style[field] = beginStyle[field];
|
|
399
|
+
}
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
shape.show();
|
|
403
|
+
}
|
|
404
|
+
});
|
|
405
|
+
if (showAnimateFieldsMap.group) {
|
|
406
|
+
showAnimateFieldsMap.group.forEach((field) => {
|
|
407
|
+
const usingField = field === 'size' ? 'transform' : field;
|
|
408
|
+
if (GROUP_ANIMATE_STYLES[0].hasOwnProperty(usingField)) {
|
|
409
|
+
this.group.style[usingField] = GROUP_ANIMATE_STYLES[0][usingField];
|
|
410
|
+
}
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
this.animations = this.runWithAnimates(animates, 'show', targetStyleMap);
|
|
415
|
+
} else {
|
|
416
|
+
Object.keys(this.shapeMap).forEach((id) => {
|
|
417
|
+
const shape = this.shapeMap[id];
|
|
418
|
+
if (!this.cacheHiddenShape[id]) shape.show();
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
this.visible = true;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
/** Hides the item. */
|
|
426
|
+
public hide(animate = true) {
|
|
427
|
+
// TODO: utilize graphcore's view
|
|
428
|
+
this.stopAnimations();
|
|
429
|
+
const func = () => {
|
|
430
|
+
Object.keys(this.shapeMap).forEach((id) => {
|
|
431
|
+
const shape = this.shapeMap[id];
|
|
432
|
+
if (this.visible && !shape.isVisible())
|
|
433
|
+
this.cacheHiddenShape[id] = true;
|
|
434
|
+
shape.hide();
|
|
435
|
+
});
|
|
436
|
+
};
|
|
437
|
+
const { animates = {} } = this.displayModel.data;
|
|
438
|
+
if (animate && animates.hide?.length) {
|
|
439
|
+
this.animations = this.runWithAnimates(animates, 'hide', undefined, func);
|
|
440
|
+
} else {
|
|
441
|
+
// 2. clear group and remove group
|
|
442
|
+
func();
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
this.visible = false;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
/** Returns the visibility of the item. */
|
|
449
|
+
public isVisible() {
|
|
450
|
+
return this.visible;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
/** Puts the item to the front in its graphic group. */
|
|
454
|
+
public toFront() {
|
|
455
|
+
this.group.toFront();
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
/** Puts the item to the back in its graphic group. */
|
|
459
|
+
public toBack() {
|
|
460
|
+
this.group.toBack();
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* The state value for the item, false if the item does not have the state.
|
|
465
|
+
* @param state state name
|
|
466
|
+
* @returns { boolean | string } the state value
|
|
467
|
+
*/
|
|
468
|
+
public hasState(state: string) {
|
|
469
|
+
const findState = this.states.find((item) => item.name === state);
|
|
470
|
+
return findState?.value || false;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
/**
|
|
474
|
+
* Set the state for the item.
|
|
475
|
+
* @param state state name
|
|
476
|
+
* @param value state value
|
|
477
|
+
*/
|
|
478
|
+
public setState(state: string, value: string | boolean) {
|
|
479
|
+
const previousStates = clone(this.states);
|
|
480
|
+
const existState = this.states.find((item) => item.name === state);
|
|
481
|
+
if (value) {
|
|
482
|
+
if (existState) existState.value = value;
|
|
483
|
+
else
|
|
484
|
+
this.states.push({
|
|
485
|
+
name: state,
|
|
486
|
+
value,
|
|
487
|
+
});
|
|
488
|
+
} else {
|
|
489
|
+
const idx = this.states.indexOf(existState);
|
|
490
|
+
this.states.splice(idx, 1);
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
// if the renderExt overwrote the setState, run the custom setState instead of the default
|
|
494
|
+
if (this.renderExt.constructor.prototype.hasOwnProperty('setState')) {
|
|
495
|
+
this.renderExt.setState(state, value, this.shapeMap);
|
|
496
|
+
return;
|
|
497
|
+
}
|
|
498
|
+
this.changedStates = [state];
|
|
499
|
+
this.drawWithStates(previousStates);
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
/**
|
|
503
|
+
* Clear the states for the item.
|
|
504
|
+
* @param states the states to be cleared. All the states will be cleared if the states is not assigned
|
|
505
|
+
*/
|
|
506
|
+
public clearStates(states?: string[]) {
|
|
507
|
+
// if states is not assigned, clear all the states on the item
|
|
508
|
+
const previousStates = clone(this.states);
|
|
509
|
+
const newStates = [];
|
|
510
|
+
let changedStates = [];
|
|
511
|
+
if (states) {
|
|
512
|
+
this.states.filter((state) => {
|
|
513
|
+
if (!states.includes(state.name)) {
|
|
514
|
+
newStates.push(state);
|
|
515
|
+
} else {
|
|
516
|
+
changedStates.push(state);
|
|
517
|
+
}
|
|
518
|
+
});
|
|
519
|
+
} else {
|
|
520
|
+
changedStates = this.states.map(({ name, value }) => ({
|
|
521
|
+
name,
|
|
522
|
+
value: false,
|
|
523
|
+
}));
|
|
524
|
+
}
|
|
525
|
+
this.states = newStates;
|
|
526
|
+
this.changedStates = changedStates.map((state) => state.name);
|
|
527
|
+
// if the renderExt overwrote the setState, run the custom setState instead of the default
|
|
528
|
+
if (this.renderExt.constructor.prototype.hasOwnProperty('setState')) {
|
|
529
|
+
changedStates.forEach(({ name, value }) =>
|
|
530
|
+
this.renderExt.setState(name, value, this.shapeMap),
|
|
531
|
+
);
|
|
532
|
+
return;
|
|
533
|
+
}
|
|
534
|
+
this.drawWithStates(previousStates);
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
/**
|
|
538
|
+
* Get all the states of the item.
|
|
539
|
+
* @retruns states array with has { name: string, value: string | boolean } format item
|
|
540
|
+
*/
|
|
541
|
+
public getStates() {
|
|
542
|
+
return this.states;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
/**
|
|
546
|
+
* Run some thing with animations, e.g. hide, show, destroy.
|
|
547
|
+
* @param animates
|
|
548
|
+
* @param timing
|
|
549
|
+
* @param targetStyleMap
|
|
550
|
+
* @param callback
|
|
551
|
+
* @returns
|
|
552
|
+
*/
|
|
553
|
+
private runWithAnimates(
|
|
554
|
+
animates: IAnimates,
|
|
555
|
+
timing: AnimateTiming,
|
|
556
|
+
targetStyleMap: Object,
|
|
557
|
+
callback: Function = () => {},
|
|
558
|
+
) {
|
|
559
|
+
let targetStyle = {};
|
|
560
|
+
if (!targetStyleMap) {
|
|
561
|
+
Object.keys(this.shapeMap).forEach((shapeId) => {
|
|
562
|
+
targetStyle[shapeId] = getShapeAnimateBeginStyles(
|
|
563
|
+
this.shapeMap[shapeId],
|
|
564
|
+
);
|
|
565
|
+
});
|
|
566
|
+
} else {
|
|
567
|
+
targetStyle = targetStyleMap;
|
|
568
|
+
}
|
|
569
|
+
return animateShapes(
|
|
570
|
+
animates,
|
|
571
|
+
targetStyle, // targetStylesMap
|
|
572
|
+
this.shapeMap, // shapeMap
|
|
573
|
+
this.group,
|
|
574
|
+
timing,
|
|
575
|
+
[],
|
|
576
|
+
() => {},
|
|
577
|
+
callback,
|
|
578
|
+
);
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
/**
|
|
582
|
+
* Re-draw the item with merged state styles.
|
|
583
|
+
* @param previousStates previous states
|
|
584
|
+
* @returns
|
|
585
|
+
*/
|
|
586
|
+
private drawWithStates(previousStates: State[], onfinish?: Function) {
|
|
587
|
+
const { default: _, ...themeStateStyles } = this.themeStyles;
|
|
588
|
+
const { data: displayModelData } = this.displayModel;
|
|
589
|
+
let styles = {}; // merged styles
|
|
590
|
+
this.states.forEach(({ name: stateName, value }) => {
|
|
591
|
+
const stateStyles = this.cacheStateStyles[stateName] || {};
|
|
592
|
+
const mapper = this.stateMapper?.[stateName];
|
|
593
|
+
if (!mapper && !themeStateStyles?.[stateName]) return;
|
|
594
|
+
// re-mapper the state styles for states if they have dirty tags
|
|
595
|
+
if (
|
|
596
|
+
mapper &&
|
|
597
|
+
value &&
|
|
598
|
+
(!this.stateDirtyMap.hasOwnProperty(stateName) ||
|
|
599
|
+
this.stateDirtyMap[stateName])
|
|
600
|
+
) {
|
|
601
|
+
this.stateDirtyMap[stateName] = false;
|
|
602
|
+
Object.keys(mapper).forEach((shapeId) => {
|
|
603
|
+
stateStyles[shapeId] = {
|
|
604
|
+
...(displayModelData[shapeId] as Object),
|
|
605
|
+
};
|
|
606
|
+
if (RESERVED_SHAPE_IDS.includes(shapeId)) {
|
|
607
|
+
// reserved shapes, fieldName is shapeId
|
|
608
|
+
updateShapeChange({
|
|
609
|
+
innerModel: this.model,
|
|
610
|
+
mapper: mapper[shapeId],
|
|
611
|
+
dataChangedFields: undefined,
|
|
612
|
+
shapeConfig: stateStyles[shapeId],
|
|
613
|
+
});
|
|
614
|
+
} else if (shapeId === OTHER_SHAPES_FIELD_NAME && mapper[shapeId]) {
|
|
615
|
+
// other shapes
|
|
616
|
+
Object.keys(mapper[shapeId]).forEach((otherShapeId) => {
|
|
617
|
+
stateStyles[shapeId] = stateStyles[shapeId] || {};
|
|
618
|
+
stateStyles[shapeId][otherShapeId] =
|
|
619
|
+
stateStyles[shapeId][otherShapeId] || {};
|
|
620
|
+
updateShapeChange({
|
|
621
|
+
innerModel: this.model,
|
|
622
|
+
mapper: mapper[shapeId][otherShapeId],
|
|
623
|
+
dataChangedFields: undefined,
|
|
624
|
+
shapeConfig: stateStyles[shapeId][otherShapeId],
|
|
625
|
+
});
|
|
626
|
+
});
|
|
627
|
+
}
|
|
628
|
+
});
|
|
629
|
+
}
|
|
630
|
+
this.cacheStateStyles[stateName] = stateStyles;
|
|
631
|
+
// merge the theme state styles
|
|
632
|
+
const mergedStateStyles = mergeStyles([
|
|
633
|
+
themeStateStyles[stateName],
|
|
634
|
+
stateStyles,
|
|
635
|
+
]);
|
|
636
|
+
|
|
637
|
+
// merge the states' styles into drawing style
|
|
638
|
+
styles = mergeStyles([styles, mergedStateStyles]);
|
|
639
|
+
});
|
|
640
|
+
|
|
641
|
+
// apply the merged styles
|
|
642
|
+
this.draw(
|
|
643
|
+
// displayModel
|
|
644
|
+
{
|
|
645
|
+
...this.displayModel,
|
|
646
|
+
data: mergeStyles([displayModelData, styles]),
|
|
647
|
+
} as ItemDisplayModel,
|
|
648
|
+
// diffData
|
|
649
|
+
undefined,
|
|
650
|
+
// diffState
|
|
651
|
+
{
|
|
652
|
+
previous: previousStates,
|
|
653
|
+
current: this.states,
|
|
654
|
+
},
|
|
655
|
+
onfinish,
|
|
656
|
+
);
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
/**
|
|
660
|
+
* Get the rendering bouding box of the keyShape.
|
|
661
|
+
* @returns keyShape's rendering bounding box
|
|
662
|
+
*/
|
|
663
|
+
public getKeyBBox(): AABB {
|
|
664
|
+
const { keyShape } = this.shapeMap;
|
|
665
|
+
return keyShape?.getRenderBounds() || ({ center: [0, 0, 0] } as AABB);
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
/**
|
|
669
|
+
* Get the local bounding box for the keyShape.
|
|
670
|
+
* */
|
|
671
|
+
public getLocalKeyBBox(): AABB {
|
|
672
|
+
const { keyShape } = this.shapeMap;
|
|
673
|
+
return keyShape?.getLocalBounds() || ({ center: [0, 0, 0] } as AABB);
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
/**
|
|
677
|
+
* Get the rendering bouding box of the whole item.
|
|
678
|
+
* @returns item's rendering bounding box
|
|
679
|
+
*/
|
|
680
|
+
public getBBox(): AABB {
|
|
681
|
+
return this.group.getRenderBounds();
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
/**
|
|
685
|
+
* Stop all the animations on the item.
|
|
686
|
+
*/
|
|
687
|
+
public stopAnimations() {
|
|
688
|
+
this.animations?.forEach((animation) => {
|
|
689
|
+
const timing = animation.effect.getTiming();
|
|
690
|
+
if (animation.playState !== 'running') return;
|
|
691
|
+
animation.currentTime =
|
|
692
|
+
Number(timing.duration) + Number(timing.delay || 0);
|
|
693
|
+
animation.cancel();
|
|
694
|
+
});
|
|
695
|
+
this.animations = [];
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
/**
|
|
699
|
+
* Animations' frame listemer.
|
|
700
|
+
*/
|
|
701
|
+
public animateFrameListener = throttle(
|
|
702
|
+
(e) => {
|
|
703
|
+
this.onframe?.(e);
|
|
704
|
+
},
|
|
705
|
+
16,
|
|
706
|
+
{
|
|
707
|
+
trailing: true,
|
|
708
|
+
leading: true,
|
|
709
|
+
},
|
|
710
|
+
);
|
|
711
|
+
|
|
712
|
+
/**
|
|
713
|
+
* Call render extension's onZoom to response the graph zooming.
|
|
714
|
+
* @param zoom
|
|
715
|
+
*/
|
|
716
|
+
public updateZoom(zoom) {
|
|
717
|
+
this.zoom = zoom;
|
|
718
|
+
this.renderExt.onZoom(this.shapeMap, zoom);
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
/** Destroy the item. */
|
|
722
|
+
public destroy() {
|
|
723
|
+
const func = () => {
|
|
724
|
+
this.group.destroy();
|
|
725
|
+
this.model = null;
|
|
726
|
+
this.displayModel = null;
|
|
727
|
+
this.destroyed = true;
|
|
728
|
+
};
|
|
729
|
+
// 1. stop animations, run buildOut animations
|
|
730
|
+
this.stopAnimations();
|
|
731
|
+
const { animates } = this.displayModel.data;
|
|
732
|
+
if (animates?.buildOut?.length && !this.transient) {
|
|
733
|
+
this.animations = this.runWithAnimates(
|
|
734
|
+
animates,
|
|
735
|
+
'buildOut',
|
|
736
|
+
undefined,
|
|
737
|
+
func,
|
|
738
|
+
);
|
|
739
|
+
} else {
|
|
740
|
+
// 2. clear group and remove group
|
|
741
|
+
func();
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
/**
|
|
747
|
+
* Get the mapped value of a field on innerModel.
|
|
748
|
+
* @param param0: {
|
|
749
|
+
* innerModel, // find unmapped field value from innerModel
|
|
750
|
+
* fieldName, // name of the field to read from innerModel
|
|
751
|
+
* mapper, // mapper object, contains the field's mapper
|
|
752
|
+
* dataChangedFields, // fields' names which are changed in data
|
|
753
|
+
* }
|
|
754
|
+
* @returns { changed: boolean, value: unknown } return whether the mapper affects the value, and the mapped result
|
|
755
|
+
*/
|
|
756
|
+
const updateChange = ({
|
|
757
|
+
innerModel,
|
|
758
|
+
fieldName,
|
|
759
|
+
mapper,
|
|
760
|
+
dataChangedFields,
|
|
761
|
+
}): {
|
|
762
|
+
changed: boolean;
|
|
763
|
+
value?: unknown;
|
|
764
|
+
} => {
|
|
765
|
+
const value = mapper[fieldName] || '';
|
|
766
|
+
if (isEncode(value)) {
|
|
767
|
+
const { fields, formatter } = value;
|
|
768
|
+
// data changed fields and the encode fields are overlapped, display value should be changed
|
|
769
|
+
if (!dataChangedFields || isArrayOverlap(dataChangedFields, fields)) {
|
|
770
|
+
const formatedValue = formatter(innerModel);
|
|
771
|
+
return {
|
|
772
|
+
changed: true,
|
|
773
|
+
value: formatedValue || '',
|
|
774
|
+
};
|
|
775
|
+
}
|
|
776
|
+
return { changed: false };
|
|
777
|
+
} else {
|
|
778
|
+
// not an encode, take the mapper's value as the result directly
|
|
779
|
+
return {
|
|
780
|
+
changed: true,
|
|
781
|
+
value,
|
|
782
|
+
};
|
|
783
|
+
}
|
|
784
|
+
};
|
|
785
|
+
|
|
786
|
+
/**
|
|
787
|
+
* Update a shape's config according to the mapper.
|
|
788
|
+
* @param param0: {
|
|
789
|
+
* innerModel, // find unmapped field value from innerModel
|
|
790
|
+
* mapper, // mapper object, contains the field's mapper
|
|
791
|
+
* shapeId, // id of the shape where the fieldName belong to
|
|
792
|
+
* dataChangedFields, // fields' names which are changed in data
|
|
793
|
+
* shapeConfig, // the shape's config to be updated
|
|
794
|
+
* }
|
|
795
|
+
* @returns { changed: boolean, value: unknown } return whether the mapper affects the value, and the mapped result
|
|
796
|
+
*/
|
|
797
|
+
const updateShapeChange = ({
|
|
798
|
+
innerModel,
|
|
799
|
+
mapper,
|
|
800
|
+
dataChangedFields,
|
|
801
|
+
shapeConfig,
|
|
802
|
+
}) => {
|
|
803
|
+
Object.keys(mapper).forEach((shapeAttrName) => {
|
|
804
|
+
const { value: mappedValue } = updateChange({
|
|
805
|
+
innerModel,
|
|
806
|
+
mapper,
|
|
807
|
+
fieldName: shapeAttrName,
|
|
808
|
+
dataChangedFields,
|
|
809
|
+
});
|
|
810
|
+
shapeConfig[shapeAttrName] = mappedValue;
|
|
811
|
+
});
|
|
812
|
+
};
|