aldehyde 0.2.475 → 0.2.477

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.
Files changed (280) hide show
  1. package/lib/controls/entry-control.js +1 -1
  2. package/lib/controls/entry-control.js.map +1 -1
  3. package/lib/controls/view-control.js +1 -1
  4. package/lib/controls/view-control.js.map +1 -1
  5. package/lib/draw-canvas-edit/components/asset-bar/index.d.ts.map +1 -0
  6. package/lib/{draw-canvas/edit → draw-canvas-edit}/components/asset-bar/index.js +1 -1
  7. package/lib/draw-canvas-edit/components/asset-bar/index.js.map +1 -0
  8. package/lib/draw-canvas-edit/components/main-header/index.d.ts.map +1 -0
  9. package/lib/{draw-canvas/edit → draw-canvas-edit}/components/main-header/index.js +2 -2
  10. package/lib/draw-canvas-edit/components/main-header/index.js.map +1 -0
  11. package/lib/draw-canvas-edit/components/render/draws/bg-draw.d.ts +25 -0
  12. package/lib/draw-canvas-edit/components/render/draws/bg-draw.d.ts.map +1 -0
  13. package/lib/draw-canvas-edit/components/render/draws/bg-draw.js +133 -0
  14. package/lib/draw-canvas-edit/components/render/draws/bg-draw.js.map +1 -0
  15. package/lib/draw-canvas-edit/components/render/draws/contextmenu-draw.d.ts +25 -0
  16. package/lib/draw-canvas-edit/components/render/draws/contextmenu-draw.d.ts.map +1 -0
  17. package/lib/draw-canvas-edit/components/render/draws/contextmenu-draw.js +291 -0
  18. package/lib/draw-canvas-edit/components/render/draws/contextmenu-draw.js.map +1 -0
  19. package/lib/draw-canvas-edit/components/render/draws/graph-draw.d.ts +29 -0
  20. package/lib/draw-canvas-edit/components/render/draws/graph-draw.d.ts.map +1 -0
  21. package/lib/draw-canvas-edit/components/render/draws/graph-draw.js +180 -0
  22. package/lib/draw-canvas-edit/components/render/draws/graph-draw.js.map +1 -0
  23. package/lib/draw-canvas-edit/components/render/draws/index.d.ts +8 -0
  24. package/lib/draw-canvas-edit/components/render/draws/index.d.ts.map +1 -0
  25. package/lib/draw-canvas-edit/components/render/draws/index.js +8 -0
  26. package/lib/draw-canvas-edit/components/render/draws/index.js.map +1 -0
  27. package/lib/draw-canvas-edit/components/render/draws/link-draw.d.ts +41 -0
  28. package/lib/draw-canvas-edit/components/render/draws/link-draw.d.ts.map +1 -0
  29. package/lib/draw-canvas-edit/components/render/draws/link-draw.js +1374 -0
  30. package/lib/draw-canvas-edit/components/render/draws/link-draw.js.map +1 -0
  31. package/lib/draw-canvas-edit/components/render/draws/preview-draw.d.ts +14 -0
  32. package/lib/draw-canvas-edit/components/render/draws/preview-draw.d.ts.map +1 -0
  33. package/lib/draw-canvas-edit/components/render/draws/preview-draw.js +243 -0
  34. package/lib/draw-canvas-edit/components/render/draws/preview-draw.js.map +1 -0
  35. package/lib/draw-canvas-edit/components/render/draws/ref-line-draw.d.ts +17 -0
  36. package/lib/draw-canvas-edit/components/render/draws/ref-line-draw.d.ts.map +1 -0
  37. package/lib/draw-canvas-edit/components/render/draws/ref-line-draw.js +57 -0
  38. package/lib/draw-canvas-edit/components/render/draws/ref-line-draw.js.map +1 -0
  39. package/lib/draw-canvas-edit/components/render/draws/ruler-draw.d.ts +11 -0
  40. package/lib/draw-canvas-edit/components/render/draws/ruler-draw.d.ts.map +1 -0
  41. package/lib/draw-canvas-edit/components/render/draws/ruler-draw.js +149 -0
  42. package/lib/draw-canvas-edit/components/render/draws/ruler-draw.js.map +1 -0
  43. package/lib/draw-canvas-edit/components/render/graphs/base-graph.d.ts +112 -0
  44. package/lib/draw-canvas-edit/components/render/graphs/base-graph.d.ts.map +1 -0
  45. package/lib/draw-canvas-edit/components/render/graphs/base-graph.js +199 -0
  46. package/lib/draw-canvas-edit/components/render/graphs/base-graph.js.map +1 -0
  47. package/lib/draw-canvas-edit/components/render/graphs/bezier.d.ts +80 -0
  48. package/lib/draw-canvas-edit/components/render/graphs/bezier.d.ts.map +1 -0
  49. package/lib/draw-canvas-edit/components/render/graphs/bezier.js +485 -0
  50. package/lib/draw-canvas-edit/components/render/graphs/bezier.js.map +1 -0
  51. package/lib/draw-canvas-edit/components/render/graphs/circle.d.ts +48 -0
  52. package/lib/draw-canvas-edit/components/render/graphs/circle.d.ts.map +1 -0
  53. package/lib/draw-canvas-edit/components/render/graphs/circle.js +735 -0
  54. package/lib/draw-canvas-edit/components/render/graphs/circle.js.map +1 -0
  55. package/lib/draw-canvas-edit/components/render/graphs/curve.d.ts +80 -0
  56. package/lib/draw-canvas-edit/components/render/graphs/curve.d.ts.map +1 -0
  57. package/lib/draw-canvas-edit/components/render/graphs/curve.js +451 -0
  58. package/lib/draw-canvas-edit/components/render/graphs/curve.js.map +1 -0
  59. package/lib/draw-canvas-edit/components/render/graphs/index.d.ts +7 -0
  60. package/lib/draw-canvas-edit/components/render/graphs/index.d.ts.map +1 -0
  61. package/lib/draw-canvas-edit/components/render/graphs/index.js +7 -0
  62. package/lib/draw-canvas-edit/components/render/graphs/index.js.map +1 -0
  63. package/lib/draw-canvas-edit/components/render/graphs/line.d.ts +80 -0
  64. package/lib/draw-canvas-edit/components/render/graphs/line.d.ts.map +1 -0
  65. package/lib/draw-canvas-edit/components/render/graphs/line.js +444 -0
  66. package/lib/draw-canvas-edit/components/render/graphs/line.js.map +1 -0
  67. package/lib/draw-canvas-edit/components/render/graphs/rect.d.ts +48 -0
  68. package/lib/draw-canvas-edit/components/render/graphs/rect.d.ts.map +1 -0
  69. package/lib/draw-canvas-edit/components/render/graphs/rect.js +716 -0
  70. package/lib/draw-canvas-edit/components/render/graphs/rect.js.map +1 -0
  71. package/lib/draw-canvas-edit/components/render/handlers/drag-handlers.d.ts +24 -0
  72. package/lib/draw-canvas-edit/components/render/handlers/drag-handlers.d.ts.map +1 -0
  73. package/lib/draw-canvas-edit/components/render/handlers/drag-handlers.js +65 -0
  74. package/lib/draw-canvas-edit/components/render/handlers/drag-handlers.js.map +1 -0
  75. package/lib/draw-canvas-edit/components/render/handlers/drag-outside-handlers.d.ts +14 -0
  76. package/lib/draw-canvas-edit/components/render/handlers/drag-outside-handlers.d.ts.map +1 -0
  77. package/lib/draw-canvas-edit/components/render/handlers/drag-outside-handlers.js +144 -0
  78. package/lib/draw-canvas-edit/components/render/handlers/drag-outside-handlers.js.map +1 -0
  79. package/lib/draw-canvas-edit/components/render/handlers/graph-handlers.d.ts +27 -0
  80. package/lib/draw-canvas-edit/components/render/handlers/graph-handlers.d.ts.map +1 -0
  81. package/lib/draw-canvas-edit/components/render/handlers/graph-handlers.js +95 -0
  82. package/lib/draw-canvas-edit/components/render/handlers/graph-handlers.js.map +1 -0
  83. package/lib/draw-canvas-edit/components/render/handlers/index.d.ts +10 -0
  84. package/lib/draw-canvas-edit/components/render/handlers/index.d.ts.map +1 -0
  85. package/lib/draw-canvas-edit/components/render/handlers/index.js +10 -0
  86. package/lib/draw-canvas-edit/components/render/handlers/index.js.map +1 -0
  87. package/lib/draw-canvas-edit/components/render/handlers/key-move-handlers.d.ts +17 -0
  88. package/lib/draw-canvas-edit/components/render/handlers/key-move-handlers.d.ts.map +1 -0
  89. package/lib/draw-canvas-edit/components/render/handlers/key-move-handlers.js +49 -0
  90. package/lib/draw-canvas-edit/components/render/handlers/key-move-handlers.js.map +1 -0
  91. package/lib/draw-canvas-edit/components/render/handlers/link-handlers.d.ts +13 -0
  92. package/lib/draw-canvas-edit/components/render/handlers/link-handlers.d.ts.map +1 -0
  93. package/lib/draw-canvas-edit/components/render/handlers/link-handlers.js +40 -0
  94. package/lib/draw-canvas-edit/components/render/handlers/link-handlers.js.map +1 -0
  95. package/lib/draw-canvas-edit/components/render/handlers/selection-handlers.d.ts +61 -0
  96. package/lib/draw-canvas-edit/components/render/handlers/selection-handlers.d.ts.map +1 -0
  97. package/lib/draw-canvas-edit/components/render/handlers/selection-handlers.js +394 -0
  98. package/lib/draw-canvas-edit/components/render/handlers/selection-handlers.js.map +1 -0
  99. package/lib/draw-canvas-edit/components/render/handlers/shutcut-handlers.d.ts +12 -0
  100. package/lib/draw-canvas-edit/components/render/handlers/shutcut-handlers.d.ts.map +1 -0
  101. package/lib/draw-canvas-edit/components/render/handlers/shutcut-handlers.js +48 -0
  102. package/lib/draw-canvas-edit/components/render/handlers/shutcut-handlers.js.map +1 -0
  103. package/lib/draw-canvas-edit/components/render/handlers/text-handlers.d.ts +23 -0
  104. package/lib/draw-canvas-edit/components/render/handlers/text-handlers.d.ts.map +1 -0
  105. package/lib/draw-canvas-edit/components/render/handlers/text-handlers.js +80 -0
  106. package/lib/draw-canvas-edit/components/render/handlers/text-handlers.js.map +1 -0
  107. package/lib/draw-canvas-edit/components/render/handlers/zoom-handlers.d.ts +16 -0
  108. package/lib/draw-canvas-edit/components/render/handlers/zoom-handlers.d.ts.map +1 -0
  109. package/lib/draw-canvas-edit/components/render/handlers/zoom-handlers.js +53 -0
  110. package/lib/draw-canvas-edit/components/render/handlers/zoom-handlers.js.map +1 -0
  111. package/lib/{draw-canvas/edit → draw-canvas-edit}/components/render/index.d.ts +7 -1
  112. package/lib/draw-canvas-edit/components/render/index.d.ts.map +1 -0
  113. package/lib/{draw-canvas/edit → draw-canvas-edit}/components/render/index.js +22 -0
  114. package/lib/draw-canvas-edit/components/render/index.js.map +1 -0
  115. package/lib/draw-canvas-edit/components/render/tools/align-tool.d.ts +18 -0
  116. package/lib/draw-canvas-edit/components/render/tools/align-tool.d.ts.map +1 -0
  117. package/lib/draw-canvas-edit/components/render/tools/align-tool.js +82 -0
  118. package/lib/draw-canvas-edit/components/render/tools/align-tool.js.map +1 -0
  119. package/lib/draw-canvas-edit/components/render/tools/asset-tool.d.ts +11 -0
  120. package/lib/draw-canvas-edit/components/render/tools/asset-tool.d.ts.map +1 -0
  121. package/lib/draw-canvas-edit/components/render/tools/asset-tool.js +150 -0
  122. package/lib/draw-canvas-edit/components/render/tools/asset-tool.js.map +1 -0
  123. package/lib/draw-canvas-edit/components/render/tools/attract-tool.d.ts +35 -0
  124. package/lib/draw-canvas-edit/components/render/tools/attract-tool.d.ts.map +1 -0
  125. package/lib/draw-canvas-edit/components/render/tools/attract-tool.js +417 -0
  126. package/lib/draw-canvas-edit/components/render/tools/attract-tool.js.map +1 -0
  127. package/lib/draw-canvas-edit/components/render/tools/copy-tool.d.ts +19 -0
  128. package/lib/draw-canvas-edit/components/render/tools/copy-tool.d.ts.map +1 -0
  129. package/lib/draw-canvas-edit/components/render/tools/copy-tool.js +235 -0
  130. package/lib/draw-canvas-edit/components/render/tools/copy-tool.js.map +1 -0
  131. package/lib/draw-canvas-edit/components/render/tools/import-export-tool.d.ts +42 -0
  132. package/lib/draw-canvas-edit/components/render/tools/import-export-tool.d.ts.map +1 -0
  133. package/lib/draw-canvas-edit/components/render/tools/import-export-tool.js +557 -0
  134. package/lib/draw-canvas-edit/components/render/tools/import-export-tool.js.map +1 -0
  135. package/lib/draw-canvas-edit/components/render/tools/index.d.ts +10 -0
  136. package/lib/draw-canvas-edit/components/render/tools/index.d.ts.map +1 -0
  137. package/lib/draw-canvas-edit/components/render/tools/index.js +10 -0
  138. package/lib/draw-canvas-edit/components/render/tools/index.js.map +1 -0
  139. package/lib/draw-canvas-edit/components/render/tools/link-tool.d.ts +14 -0
  140. package/lib/draw-canvas-edit/components/render/tools/link-tool.d.ts.map +1 -0
  141. package/lib/draw-canvas-edit/components/render/tools/link-tool.js +200 -0
  142. package/lib/draw-canvas-edit/components/render/tools/link-tool.js.map +1 -0
  143. package/lib/draw-canvas-edit/components/render/tools/position-tool.d.ts +10 -0
  144. package/lib/draw-canvas-edit/components/render/tools/position-tool.d.ts.map +1 -0
  145. package/lib/draw-canvas-edit/components/render/tools/position-tool.js +181 -0
  146. package/lib/draw-canvas-edit/components/render/tools/position-tool.js.map +1 -0
  147. package/lib/draw-canvas-edit/components/render/tools/selection-tool.d.ts +12 -0
  148. package/lib/draw-canvas-edit/components/render/tools/selection-tool.d.ts.map +1 -0
  149. package/lib/draw-canvas-edit/components/render/tools/selection-tool.js +114 -0
  150. package/lib/draw-canvas-edit/components/render/tools/selection-tool.js.map +1 -0
  151. package/lib/draw-canvas-edit/components/render/tools/z-index-tool.d.ts +17 -0
  152. package/lib/draw-canvas-edit/components/render/tools/z-index-tool.d.ts.map +1 -0
  153. package/lib/draw-canvas-edit/components/render/tools/z-index-tool.js +201 -0
  154. package/lib/draw-canvas-edit/components/render/tools/z-index-tool.js.map +1 -0
  155. package/lib/draw-canvas-edit/components/render/types.d.ts.map +1 -0
  156. package/lib/draw-canvas-edit/components/render/types.js.map +1 -0
  157. package/lib/draw-canvas-edit/components/render/utils/a-star.d.ts +13 -0
  158. package/lib/draw-canvas-edit/components/render/utils/a-star.d.ts.map +1 -0
  159. package/lib/draw-canvas-edit/components/render/utils/a-star.js +101 -0
  160. package/lib/draw-canvas-edit/components/render/utils/a-star.js.map +1 -0
  161. package/lib/draw-canvas-edit/components/render/utils/bezier-scene-func.d.ts +3 -0
  162. package/lib/draw-canvas-edit/components/render/utils/bezier-scene-func.d.ts.map +1 -0
  163. package/lib/draw-canvas-edit/components/render/utils/bezier-scene-func.js +69 -0
  164. package/lib/draw-canvas-edit/components/render/utils/bezier-scene-func.js.map +1 -0
  165. package/lib/draw-canvas-edit/components/setting-form/imag-upload.d.ts.map +1 -0
  166. package/lib/{draw-canvas/edit → draw-canvas-edit}/components/setting-form/imag-upload.js +2 -2
  167. package/lib/draw-canvas-edit/components/setting-form/imag-upload.js.map +1 -0
  168. package/lib/draw-canvas-edit/components/setting-form/index.d.ts.map +1 -0
  169. package/lib/{draw-canvas/edit → draw-canvas-edit}/components/setting-form/index.js +7 -8
  170. package/lib/draw-canvas-edit/components/setting-form/index.js.map +1 -0
  171. package/lib/draw-canvas-edit/constant.d.ts.map +1 -0
  172. package/lib/draw-canvas-edit/constant.js.map +1 -0
  173. package/lib/draw-canvas-edit/index.d.ts.map +1 -0
  174. package/lib/{draw-canvas/edit → draw-canvas-edit}/index.js +1 -1
  175. package/lib/draw-canvas-edit/index.js.map +1 -0
  176. package/lib/draw-canvas-view/index.d.ts.map +1 -0
  177. package/lib/{draw-canvas/view → draw-canvas-view}/index.js +1 -1
  178. package/lib/draw-canvas-view/index.js.map +1 -0
  179. package/lib/{draw-canvas/view → draw-canvas-view}/view.d.ts +4 -1
  180. package/lib/draw-canvas-view/view.d.ts.map +1 -0
  181. package/lib/draw-canvas-view/view.js +208 -0
  182. package/lib/draw-canvas-view/view.js.map +1 -0
  183. package/lib/lowcode-components/base-image/index.js +1 -1
  184. package/lib/lowcode-components/base-image/index.js.map +1 -1
  185. package/lib/routable/ltmpl-route.js +2 -2
  186. package/lib/tmpl/control-type-supportor.js +1 -1
  187. package/lib/tmpl/control-type-supportor.js.map +1 -1
  188. package/package.json +1 -1
  189. package/src/aldehyde/controls/entry-control.tsx +1 -1
  190. package/src/aldehyde/controls/view-control.tsx +1 -1
  191. package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/asset-bar/index.tsx +1 -1
  192. package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/main-header/index.tsx +2 -2
  193. package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/draws/bg-draw.ts +0 -2
  194. package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/draws/contextmenu-draw.ts +0 -2
  195. package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/draws/graph-draw.ts +0 -2
  196. package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/draws/link-draw.ts +0 -2
  197. package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/draws/preview-draw.ts +0 -2
  198. package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/draws/ref-line-draw.ts +0 -2
  199. package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/draws/ruler-draw.ts +0 -2
  200. package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/handlers/drag-handlers.ts +0 -2
  201. package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/handlers/drag-outside-handlers.ts +0 -2
  202. package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/handlers/graph-handlers.ts +0 -2
  203. package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/handlers/key-move-handlers.ts +0 -2
  204. package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/handlers/link-handlers.ts +0 -2
  205. package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/handlers/selection-handlers.ts +0 -2
  206. package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/handlers/shutcut-handlers.ts +0 -2
  207. package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/handlers/text-handlers.ts +0 -2
  208. package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/handlers/zoom-handlers.ts +0 -2
  209. package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/index.ts +24 -0
  210. package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/tools/align-tool.ts +0 -2
  211. package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/tools/asset-tool.ts +0 -2
  212. package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/tools/attract-tool.ts +0 -2
  213. package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/tools/copy-tool.ts +0 -2
  214. package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/tools/import-export-tool.ts +0 -2
  215. package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/tools/link-tool.ts +0 -2
  216. package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/tools/position-tool.ts +0 -2
  217. package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/tools/selection-tool.ts +0 -2
  218. package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/tools/z-index-tool.ts +0 -2
  219. package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/setting-form/imag-upload.tsx +2 -2
  220. package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/setting-form/index.tsx +8 -9
  221. package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/index.tsx +1 -1
  222. package/src/aldehyde/{draw-canvas/view → draw-canvas-view}/index.tsx +1 -1
  223. package/src/aldehyde/draw-canvas-view/view.tsx +212 -0
  224. package/src/aldehyde/lowcode-components/base-image/index.tsx +1 -1
  225. package/src/aldehyde/routable/ltmpl-route.tsx +2 -2
  226. package/src/aldehyde/tmpl/control-type-supportor.tsx +1 -1
  227. package/lib/draw-canvas/edit/components/asset-bar/index.d.ts.map +0 -1
  228. package/lib/draw-canvas/edit/components/asset-bar/index.js.map +0 -1
  229. package/lib/draw-canvas/edit/components/main-header/index.d.ts.map +0 -1
  230. package/lib/draw-canvas/edit/components/main-header/index.js.map +0 -1
  231. package/lib/draw-canvas/edit/components/render/index.d.ts.map +0 -1
  232. package/lib/draw-canvas/edit/components/render/index.js.map +0 -1
  233. package/lib/draw-canvas/edit/components/render/types.d.ts.map +0 -1
  234. package/lib/draw-canvas/edit/components/render/types.js.map +0 -1
  235. package/lib/draw-canvas/edit/components/setting-form/imag-upload.d.ts.map +0 -1
  236. package/lib/draw-canvas/edit/components/setting-form/imag-upload.js.map +0 -1
  237. package/lib/draw-canvas/edit/components/setting-form/index.d.ts.map +0 -1
  238. package/lib/draw-canvas/edit/components/setting-form/index.js.map +0 -1
  239. package/lib/draw-canvas/edit/constant.d.ts.map +0 -1
  240. package/lib/draw-canvas/edit/constant.js.map +0 -1
  241. package/lib/draw-canvas/edit/index.d.ts.map +0 -1
  242. package/lib/draw-canvas/edit/index.js.map +0 -1
  243. package/lib/draw-canvas/view/index.d.ts.map +0 -1
  244. package/lib/draw-canvas/view/index.js.map +0 -1
  245. package/lib/draw-canvas/view/view.d.ts.map +0 -1
  246. package/lib/draw-canvas/view/view.js +0 -104
  247. package/lib/draw-canvas/view/view.js.map +0 -1
  248. package/src/aldehyde/draw-canvas/view/view.tsx +0 -114
  249. /package/lib/{draw-canvas/edit → draw-canvas-edit}/components/asset-bar/index.d.ts +0 -0
  250. /package/lib/{draw-canvas/edit → draw-canvas-edit}/components/asset-bar/index.less +0 -0
  251. /package/lib/{draw-canvas/edit → draw-canvas-edit}/components/main-header/index.d.ts +0 -0
  252. /package/lib/{draw-canvas/edit → draw-canvas-edit}/components/main-header/index.less +0 -0
  253. /package/lib/{draw-canvas/edit → draw-canvas-edit}/components/render/types.d.ts +0 -0
  254. /package/lib/{draw-canvas/edit → draw-canvas-edit}/components/render/types.js +0 -0
  255. /package/lib/{draw-canvas/edit → draw-canvas-edit}/components/setting-form/imag-upload.d.ts +0 -0
  256. /package/lib/{draw-canvas/edit → draw-canvas-edit}/components/setting-form/index.d.ts +0 -0
  257. /package/lib/{draw-canvas/edit → draw-canvas-edit}/constant.d.ts +0 -0
  258. /package/lib/{draw-canvas/edit → draw-canvas-edit}/constant.js +0 -0
  259. /package/lib/{draw-canvas/edit → draw-canvas-edit}/index.d.ts +0 -0
  260. /package/lib/{draw-canvas/edit → draw-canvas-edit}/index.less +0 -0
  261. /package/lib/{draw-canvas/view → draw-canvas-view}/index.d.ts +0 -0
  262. /package/lib/{draw-canvas/view → draw-canvas-view}/index.less +0 -0
  263. /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/asset-bar/index.less +0 -0
  264. /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/main-header/index.less +0 -0
  265. /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/draws/index.ts +0 -0
  266. /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/graphs/base-graph.ts +0 -0
  267. /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/graphs/bezier.ts +0 -0
  268. /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/graphs/circle.ts +0 -0
  269. /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/graphs/curve.ts +0 -0
  270. /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/graphs/index.ts +0 -0
  271. /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/graphs/line.ts +0 -0
  272. /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/graphs/rect.ts +0 -0
  273. /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/handlers/index.ts +0 -0
  274. /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/tools/index.ts +0 -0
  275. /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/types.ts +0 -0
  276. /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/utils/a-star.ts +0 -0
  277. /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/utils/bezier-scene-func.ts +0 -0
  278. /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/constant.ts +0 -0
  279. /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/index.less +0 -0
  280. /package/src/aldehyde/{draw-canvas/view → draw-canvas-view}/index.less +0 -0
@@ -0,0 +1,735 @@
1
+ import Konva from 'konva';
2
+ import { GraphDraw, LinkDraw, PreviewDraw } from '../draws';
3
+ import { BaseGraph } from './base-graph';
4
+ /**
5
+ * 图形 圆/椭圆
6
+ */
7
+ export class Circle extends BaseGraph {
8
+ // 实现:更新 图形 的 调整点 的 锚点位置
9
+ static updateAnchorShadows(graph, anchorShadows) {
10
+ const { width, height } = graph.size();
11
+ for (const shadow of anchorShadows) {
12
+ switch (shadow.attrs.adjustType) {
13
+ case 'top':
14
+ shadow.position({ x: width / 2, y: 0 });
15
+ break;
16
+ case 'bottom':
17
+ shadow.position({ x: width / 2, y: height });
18
+ break;
19
+ case 'left':
20
+ shadow.position({ x: 0, y: height / 2 });
21
+ break;
22
+ case 'right':
23
+ shadow.position({ x: width, y: height / 2 });
24
+ break;
25
+ case 'top-left':
26
+ shadow.position({ x: 0, y: 0 });
27
+ break;
28
+ case 'top-right':
29
+ shadow.position({ x: width, y: 0 });
30
+ break;
31
+ case 'bottom-left':
32
+ shadow.position({ x: 0, y: height });
33
+ break;
34
+ case 'bottom-right':
35
+ shadow.position({ x: width, y: height });
36
+ break;
37
+ }
38
+ }
39
+ }
40
+ // 实现:更新 图形 的 连接点 的 锚点位置
41
+ static updateLinkAnchorShadows(graph, linkAnchorShadows) {
42
+ const { width, height } = graph.size();
43
+ for (const shadow of linkAnchorShadows) {
44
+ switch (shadow.attrs.alias) {
45
+ case 'top':
46
+ shadow.position({ x: width / 2, y: 0 });
47
+ break;
48
+ case 'bottom':
49
+ shadow.position({ x: width / 2, y: height });
50
+ break;
51
+ case 'left':
52
+ shadow.position({ x: 0, y: height / 2 });
53
+ break;
54
+ case 'right':
55
+ shadow.position({ x: width, y: height / 2 });
56
+ break;
57
+ case 'center':
58
+ shadow.position({ x: width / 2, y: height / 2 });
59
+ break;
60
+ }
61
+ }
62
+ }
63
+ // 实现:生成 调整点
64
+ static createAnchorShapes(render, graph, anchorAndShadows,
65
+ // eslint-disable-next-line
66
+ adjustAnchor) {
67
+ var _a;
68
+ const stageState = render.getStageState();
69
+ for (const anchorAndShadow of anchorAndShadows) {
70
+ const { anchor, anchorShadow } = anchorAndShadow;
71
+ const x = render.toStageValue(anchorShadow.getAbsolutePosition().x - stageState.x), y = render.toStageValue(anchorShadow.getAbsolutePosition().y - stageState.y);
72
+ const offset = render.toStageValue(render.pointSize + 5);
73
+ const anchorShape = new Konva.Line({
74
+ name: 'anchor',
75
+ anchor: anchor,
76
+ stroke: `rgba(0,0,255,0.4)`,
77
+ strokeWidth: render.toStageValue(2),
78
+ hitStrokeWidth: render.toStageValue(3),
79
+ x,
80
+ y,
81
+ points: (_a = {
82
+ 'top-left': [[-offset, offset / 2], [-offset, -offset], [offset / 2, -offset]].flat(),
83
+ top: [[-offset, -offset], [offset, -offset]].flat(),
84
+ 'top-right': [[-offset / 2, -offset], [offset, -offset], [offset, offset / 2]].flat(),
85
+ right: [[offset, -offset], [offset, offset]].flat(),
86
+ 'bottom-right': [[-offset / 2, offset], [offset, offset], [offset, -offset / 2]].flat(),
87
+ bottom: [[-offset, offset], [offset, offset]].flat(),
88
+ 'bottom-left': [[-offset, -offset / 2], [-offset, offset], [offset / 2, offset]].flat(),
89
+ left: [[-offset, -offset], [-offset, offset]].flat()
90
+ }[anchor.adjustType]) !== null && _a !== void 0 ? _a : [],
91
+ rotation: graph.getAbsoluteRotation(), // 旋转角度
92
+ visible: graph.attrs.adjusting || graph.attrs.hover === true
93
+ });
94
+ anchorShape.on('mouseenter', () => {
95
+ document.body.style.cursor = 'move';
96
+ graph.setAttr('hover', true);
97
+ graph.setAttr('hoverAnchor', true);
98
+ });
99
+ anchorShape.on('mouseleave', () => {
100
+ document.body.style.cursor = anchorShape.attrs.adjusting ? 'move' : 'default';
101
+ graph.setAttr('hover', false);
102
+ graph.setAttr('hoverAnchor', false);
103
+ // 进入其他元素区域时离开需要靠它 redraw
104
+ render.redraw([GraphDraw.name]);
105
+ });
106
+ anchorAndShadow.shape = anchorShape;
107
+ }
108
+ return { anchorAndShadows };
109
+ }
110
+ // 实现:调整 图形
111
+ static adjust(render, graph, graphSnap, adjustShape, anchorAndShadows, startPoint, endPoint, hoverRect) {
112
+ var _a, _b, _c, _d, _e;
113
+ // 目标 圆/椭圆
114
+ const circle = graph.findOne('.graph');
115
+ // 镜像
116
+ const circleSnap = graphSnap.findOne('.graph');
117
+ // 调整点 锚点
118
+ const anchors = ((_a = graph.find('.anchor')) !== null && _a !== void 0 ? _a : []);
119
+ // 镜像
120
+ const anchorsSnap = ((_b = graphSnap.find('.anchor')) !== null && _b !== void 0 ? _b : []);
121
+ // 连接点 锚点
122
+ const linkAnchors = ((_c = graph.find('.link-anchor')) !== null && _c !== void 0 ? _c : []);
123
+ if (circle && circleSnap) {
124
+ const [graphRotation, adjustType, ex, ey] = [
125
+ Math.round(graph.rotation()),
126
+ (_d = adjustShape.attrs.anchor) === null || _d === void 0 ? void 0 : _d.adjustType,
127
+ endPoint.x,
128
+ endPoint.y
129
+ ];
130
+ let anchorShadow, anchorShadowAcross;
131
+ switch (adjustType) {
132
+ case 'top':
133
+ anchorShadow = anchorsSnap.find((o) => o.attrs.adjustType === 'top');
134
+ anchorShadowAcross = anchorsSnap.find((o) => o.attrs.adjustType === 'bottom');
135
+ break;
136
+ case 'bottom':
137
+ anchorShadow = anchorsSnap.find((o) => o.attrs.adjustType === 'bottom');
138
+ anchorShadowAcross = anchorsSnap.find((o) => o.attrs.adjustType === 'top');
139
+ break;
140
+ case 'left':
141
+ anchorShadow = anchorsSnap.find((o) => o.attrs.adjustType === 'left');
142
+ anchorShadowAcross = anchorsSnap.find((o) => o.attrs.adjustType === 'right');
143
+ break;
144
+ case 'right':
145
+ anchorShadow = anchorsSnap.find((o) => o.attrs.adjustType === 'right');
146
+ anchorShadowAcross = anchorsSnap.find((o) => o.attrs.adjustType === 'left');
147
+ break;
148
+ case 'top-left':
149
+ anchorShadow = anchorsSnap.find((o) => o.attrs.adjustType === 'top-left');
150
+ anchorShadowAcross = anchorsSnap.find((o) => o.attrs.adjustType === 'bottom-right');
151
+ break;
152
+ case 'top-right':
153
+ anchorShadow = anchorsSnap.find((o) => o.attrs.adjustType === 'top-right');
154
+ anchorShadowAcross = anchorsSnap.find((o) => o.attrs.adjustType === 'bottom-left');
155
+ break;
156
+ case 'bottom-left':
157
+ anchorShadow = anchorsSnap.find((o) => o.attrs.adjustType === 'bottom-left');
158
+ anchorShadowAcross = anchorsSnap.find((o) => o.attrs.adjustType === 'top-right');
159
+ break;
160
+ case 'bottom-right':
161
+ anchorShadow = anchorsSnap.find((o) => o.attrs.adjustType === 'bottom-right');
162
+ anchorShadowAcross = anchorsSnap.find((o) => o.attrs.adjustType === 'top-left');
163
+ break;
164
+ }
165
+ if (anchorShadow && anchorShadowAcross) {
166
+ const { x: sx, y: sy } = anchorShadow.getAbsolutePosition();
167
+ const { x: ax, y: ay } = anchorShadowAcross.getAbsolutePosition();
168
+ {
169
+ const d1 = Math.sqrt(Math.pow(sx - ax, 2) + Math.pow(sy - ay, 2));
170
+ const d2 = Math.sqrt(Math.pow(ex - ax, 2) + Math.pow(ey - ay, 2));
171
+ const r1 = d2 / d1;
172
+ let zeroWidth = 1, zeroHeight = 1;
173
+ switch (adjustType) {
174
+ case 'top':
175
+ if (graphRotation >= 45 && graphRotation < 135) {
176
+ zeroHeight = ex <= ax ? 0 : 1;
177
+ }
178
+ else if (graphRotation >= -135 && graphRotation < -45) {
179
+ zeroHeight = ex >= ax ? 0 : 1;
180
+ }
181
+ else if (graphRotation >= -45 && graphRotation < 45) {
182
+ zeroHeight = ey >= ay ? 0 : 1;
183
+ }
184
+ else {
185
+ zeroHeight = ey <= ay ? 0 : 1;
186
+ }
187
+ break;
188
+ case 'bottom':
189
+ if (graphRotation >= 45 && graphRotation < 135) {
190
+ zeroHeight = ex <= ax ? 1 : 0;
191
+ }
192
+ else if (graphRotation >= -135 && graphRotation < -45) {
193
+ zeroHeight = ex >= ax ? 1 : 0;
194
+ }
195
+ else if (graphRotation >= -45 && graphRotation < 45) {
196
+ zeroHeight = ey >= ay ? 1 : 0;
197
+ }
198
+ else {
199
+ zeroHeight = ey <= ay ? 1 : 0;
200
+ }
201
+ break;
202
+ case 'left':
203
+ if (graphRotation >= 45 && graphRotation < 135) {
204
+ zeroWidth = ey >= ay ? 0 : 1;
205
+ }
206
+ else if (graphRotation >= -135 && graphRotation < -45) {
207
+ zeroWidth = ex <= ax ? 0 : 1;
208
+ }
209
+ else if (graphRotation >= -45 && graphRotation < 45) {
210
+ zeroWidth = ex >= ax ? 0 : 1;
211
+ }
212
+ else {
213
+ zeroWidth = ey <= ay ? 0 : 1;
214
+ }
215
+ break;
216
+ case 'right':
217
+ if (graphRotation >= 45 && graphRotation < 135) {
218
+ zeroWidth = ey >= ay ? 1 : 0;
219
+ }
220
+ else if (graphRotation >= -135 && graphRotation < -45) {
221
+ zeroWidth = ex <= ax ? 1 : 0;
222
+ }
223
+ else if (graphRotation >= -45 && graphRotation < 45) {
224
+ zeroWidth = ex >= ax ? 1 : 0;
225
+ }
226
+ else {
227
+ zeroWidth = ey <= ay ? 1 : 0;
228
+ }
229
+ break;
230
+ case 'top-left':
231
+ if (graphRotation > -45 && graphRotation < 45) {
232
+ if (ex >= ax && ey >= ay) {
233
+ zeroWidth = 0;
234
+ zeroHeight = 0;
235
+ }
236
+ else {
237
+ zeroWidth = 1;
238
+ zeroHeight = 1;
239
+ }
240
+ }
241
+ else if (graphRotation === 45) {
242
+ if (ey >= ay) {
243
+ zeroWidth = 0;
244
+ zeroHeight = 0;
245
+ }
246
+ else {
247
+ zeroWidth = 1;
248
+ zeroHeight = 1;
249
+ }
250
+ }
251
+ else if (graphRotation > 45 && graphRotation < 135) {
252
+ if (ex <= ax && ey >= ay) {
253
+ zeroWidth = 0;
254
+ zeroHeight = 0;
255
+ }
256
+ else {
257
+ zeroWidth = 1;
258
+ zeroHeight = 1;
259
+ }
260
+ }
261
+ else if (graphRotation === 135) {
262
+ if (ex <= ax) {
263
+ zeroWidth = 0;
264
+ zeroHeight = 0;
265
+ }
266
+ else {
267
+ zeroWidth = 1;
268
+ zeroHeight = 1;
269
+ }
270
+ }
271
+ else if ((graphRotation > 135 && graphRotation <= 180) || (graphRotation >= -180 && graphRotation < -135)) {
272
+ if (ex <= ax && ey <= ay) {
273
+ zeroWidth = 0;
274
+ zeroHeight = 0;
275
+ }
276
+ else {
277
+ zeroWidth = 1;
278
+ zeroHeight = 1;
279
+ }
280
+ }
281
+ else if (graphRotation === -135) {
282
+ if (ey <= ay) {
283
+ zeroWidth = 0;
284
+ zeroHeight = 0;
285
+ }
286
+ else {
287
+ zeroWidth = 1;
288
+ zeroHeight = 1;
289
+ }
290
+ }
291
+ else if (graphRotation > -135 && graphRotation < -45) {
292
+ if (ex >= ax && ey <= ay) {
293
+ zeroWidth = 0;
294
+ zeroHeight = 0;
295
+ }
296
+ else {
297
+ zeroWidth = 1;
298
+ zeroHeight = 1;
299
+ }
300
+ }
301
+ else if (graphRotation === -45) {
302
+ if (ex >= ax) {
303
+ zeroWidth = 0;
304
+ zeroHeight = 0;
305
+ }
306
+ else {
307
+ zeroWidth = 1;
308
+ zeroHeight = 1;
309
+ }
310
+ }
311
+ break;
312
+ case 'top-right':
313
+ if (graphRotation > -45 && graphRotation < 45) {
314
+ if (ex <= ax && ey >= ay) {
315
+ zeroWidth = 0;
316
+ zeroHeight = 0;
317
+ }
318
+ else {
319
+ zeroWidth = 1;
320
+ zeroHeight = 1;
321
+ }
322
+ }
323
+ else if (graphRotation === 45) {
324
+ if (ex <= ax) {
325
+ zeroWidth = 0;
326
+ zeroHeight = 0;
327
+ }
328
+ else {
329
+ zeroWidth = 1;
330
+ zeroHeight = 1;
331
+ }
332
+ }
333
+ else if (graphRotation > 45 && graphRotation < 135) {
334
+ if (ex <= ax && ey <= ay) {
335
+ zeroWidth = 0;
336
+ zeroHeight = 0;
337
+ }
338
+ else {
339
+ zeroWidth = 1;
340
+ zeroHeight = 1;
341
+ }
342
+ }
343
+ else if (graphRotation === 135) {
344
+ if (ey <= ay) {
345
+ zeroWidth = 0;
346
+ zeroHeight = 0;
347
+ }
348
+ else {
349
+ zeroWidth = 1;
350
+ zeroHeight = 1;
351
+ }
352
+ }
353
+ else if ((graphRotation > 135 && graphRotation <= 180) || (graphRotation >= -180 && graphRotation < -135)) {
354
+ if (ex >= ax && ey <= ay) {
355
+ zeroWidth = 0;
356
+ zeroHeight = 0;
357
+ }
358
+ else {
359
+ zeroWidth = 1;
360
+ zeroHeight = 1;
361
+ }
362
+ }
363
+ else if (graphRotation === -135) {
364
+ if (ex >= ax) {
365
+ zeroWidth = 0;
366
+ zeroHeight = 0;
367
+ }
368
+ else {
369
+ zeroWidth = 1;
370
+ zeroHeight = 1;
371
+ }
372
+ }
373
+ else if (graphRotation > -135 && graphRotation < -45) {
374
+ if (ex >= ax && ey >= ay) {
375
+ zeroWidth = 0;
376
+ zeroHeight = 0;
377
+ }
378
+ else {
379
+ zeroWidth = 1;
380
+ zeroHeight = 1;
381
+ }
382
+ }
383
+ else if (graphRotation === -45) {
384
+ if (ey >= ay) {
385
+ zeroWidth = 0;
386
+ zeroHeight = 0;
387
+ }
388
+ else {
389
+ zeroWidth = 1;
390
+ zeroHeight = 1;
391
+ }
392
+ }
393
+ break;
394
+ case 'bottom-left':
395
+ if (graphRotation > -45 && graphRotation < 45) {
396
+ if (ex >= ax && ey <= ay) {
397
+ zeroWidth = 0;
398
+ zeroHeight = 0;
399
+ }
400
+ else {
401
+ zeroWidth = 1;
402
+ zeroHeight = 1;
403
+ }
404
+ }
405
+ else if (graphRotation === 45) {
406
+ if (ex >= ax) {
407
+ zeroWidth = 0;
408
+ zeroHeight = 0;
409
+ }
410
+ else {
411
+ zeroWidth = 1;
412
+ zeroHeight = 1;
413
+ }
414
+ }
415
+ else if (graphRotation > 45 && graphRotation < 135) {
416
+ if (ex >= ax && ey >= ay) {
417
+ zeroWidth = 0;
418
+ zeroHeight = 0;
419
+ }
420
+ else {
421
+ zeroWidth = 1;
422
+ zeroHeight = 1;
423
+ }
424
+ }
425
+ else if (graphRotation === 135) {
426
+ if (ey >= ay) {
427
+ zeroWidth = 0;
428
+ zeroHeight = 0;
429
+ }
430
+ else {
431
+ zeroWidth = 1;
432
+ zeroHeight = 1;
433
+ }
434
+ }
435
+ else if ((graphRotation > 135 && graphRotation <= 180) || (graphRotation >= -180 && graphRotation < -135)) {
436
+ if (ex <= ax && ey >= ay) {
437
+ zeroWidth = 0;
438
+ zeroHeight = 0;
439
+ }
440
+ else {
441
+ zeroWidth = 1;
442
+ zeroHeight = 1;
443
+ }
444
+ }
445
+ else if (graphRotation === -135) {
446
+ if (ex <= ax) {
447
+ zeroWidth = 0;
448
+ zeroHeight = 0;
449
+ }
450
+ else {
451
+ zeroWidth = 1;
452
+ zeroHeight = 1;
453
+ }
454
+ }
455
+ else if (graphRotation > -135 && graphRotation < -45) {
456
+ if (ex <= ax && ey <= ay) {
457
+ zeroWidth = 0;
458
+ zeroHeight = 0;
459
+ }
460
+ else {
461
+ zeroWidth = 1;
462
+ zeroHeight = 1;
463
+ }
464
+ }
465
+ else if (graphRotation === -45) {
466
+ if (ey <= ay) {
467
+ zeroWidth = 0;
468
+ zeroHeight = 0;
469
+ }
470
+ else {
471
+ zeroWidth = 1;
472
+ zeroHeight = 1;
473
+ }
474
+ }
475
+ break;
476
+ case 'bottom-right':
477
+ if (graphRotation > -45 && graphRotation < 45) {
478
+ if (ex <= ax && ey <= ay) {
479
+ zeroWidth = 0;
480
+ zeroHeight = 0;
481
+ }
482
+ else {
483
+ zeroWidth = 1;
484
+ zeroHeight = 1;
485
+ }
486
+ }
487
+ else if (graphRotation === 45) {
488
+ if (ey <= ay) {
489
+ zeroWidth = 0;
490
+ zeroHeight = 0;
491
+ }
492
+ else {
493
+ zeroWidth = 1;
494
+ zeroHeight = 1;
495
+ }
496
+ }
497
+ else if (graphRotation > 45 && graphRotation < 135) {
498
+ if (ex >= ax && ey <= ay) {
499
+ zeroWidth = 0;
500
+ zeroHeight = 0;
501
+ }
502
+ else {
503
+ zeroWidth = 1;
504
+ zeroHeight = 1;
505
+ }
506
+ }
507
+ else if (graphRotation === 135) {
508
+ if (ex >= ax) {
509
+ zeroWidth = 0;
510
+ zeroHeight = 0;
511
+ }
512
+ else {
513
+ zeroWidth = 1;
514
+ zeroHeight = 1;
515
+ }
516
+ }
517
+ else if ((graphRotation > 135 && graphRotation <= 180) || (graphRotation >= -180 && graphRotation < -135)) {
518
+ if (ex >= ax && ey >= ay) {
519
+ zeroWidth = 0;
520
+ zeroHeight = 0;
521
+ }
522
+ else {
523
+ zeroWidth = 1;
524
+ zeroHeight = 1;
525
+ }
526
+ }
527
+ else if (graphRotation === -135) {
528
+ if (ey >= ay) {
529
+ zeroWidth = 0;
530
+ zeroHeight = 0;
531
+ }
532
+ else {
533
+ zeroWidth = 1;
534
+ zeroHeight = 1;
535
+ }
536
+ }
537
+ else if (graphRotation > -135 && graphRotation < -45) {
538
+ if (ex <= ax && ey >= ay) {
539
+ zeroWidth = 0;
540
+ zeroHeight = 0;
541
+ }
542
+ else {
543
+ zeroWidth = 1;
544
+ zeroHeight = 1;
545
+ }
546
+ }
547
+ else if (graphRotation === -45) {
548
+ if (ex <= ax) {
549
+ zeroWidth = 0;
550
+ zeroHeight = 0;
551
+ }
552
+ else {
553
+ zeroWidth = 1;
554
+ zeroHeight = 1;
555
+ }
556
+ }
557
+ break;
558
+ }
559
+ if (/-?(left|right)$/.test(adjustType)) {
560
+ graph.width(Math.max(2, graphSnap.width() * r1 * zeroWidth));
561
+ }
562
+ if (/^(top|bottom)-?/.test(adjustType)) {
563
+ graph.height(Math.max(2, graphSnap.height() * r1 * zeroHeight));
564
+ }
565
+ }
566
+ {
567
+ const [graphWidth, graphHeight] = [graph.width() * graph.scaleX(), graph.height() * graph.scaleY()];
568
+ const cos = Math.cos((graphRotation * Math.PI) / 180);
569
+ const sin = Math.sin((graphRotation * Math.PI) / 180);
570
+ const tan = Math.tan((graphRotation * Math.PI) / 180);
571
+ switch (adjustType) {
572
+ case 'top':
573
+ graph.x(ax - (graphWidth / 2 - graphHeight * tan) * cos);
574
+ if (graphRotation !== 90 && graphRotation !== -90) {
575
+ graph.y(ay - (graphHeight / cos + (graphWidth / 2 - graphHeight * tan) * sin));
576
+ }
577
+ break;
578
+ case 'bottom': // 无需处理
579
+ break;
580
+ case 'left':
581
+ if ([90, -90].includes(graphRotation)) {
582
+ graph.y(ay - graphWidth);
583
+ }
584
+ else if (Math.abs(graphRotation) === 180) {
585
+ graph.x(ax + graphWidth);
586
+ }
587
+ else {
588
+ const v1 = graphHeight / 2 / cos;
589
+ const v2 = v1 * sin;
590
+ const v3 = graphWidth - v2;
591
+ const v4 = v3 * sin;
592
+ graph.x(ax - v3 * cos);
593
+ graph.y(ay - (v1 + v4));
594
+ }
595
+ break;
596
+ case 'right': // 无需处理
597
+ break;
598
+ case 'top-left':
599
+ graph.x(ax - (graphWidth - graphHeight * tan) * cos);
600
+ graph.y(ay - (graphWidth * sin + graphHeight * cos));
601
+ break;
602
+ case 'top-right':
603
+ graph.x(ax + graphHeight * sin);
604
+ graph.y(ay - graphHeight * cos);
605
+ break;
606
+ case 'bottom-left':
607
+ graph.x(ax - graphWidth * cos);
608
+ graph.y(ay - graphWidth * sin);
609
+ break;
610
+ case 'bottom-right': // 无需处理
611
+ break;
612
+ }
613
+ }
614
+ }
615
+ const [graphWidth, graphHeight] = [graph.width(), graph.height()];
616
+ // 更新 圆/椭圆 大小
617
+ circle.x(graphWidth / 2);
618
+ circle.radiusX(graphWidth / 2);
619
+ circle.y(graphHeight / 2);
620
+ circle.radiusY(graphHeight / 2);
621
+ // 更新 调整点 的 锚点 位置
622
+ Circle.updateAnchorShadows(graph, anchors);
623
+ // 更新 图形 的 连接点 的 锚点位置
624
+ Circle.updateLinkAnchorShadows(graph, linkAnchors);
625
+ const stageState = render.getStageState();
626
+ // 更新 调整点 位置
627
+ for (const anchor of anchors) {
628
+ for (const { shape } of anchorAndShadows) {
629
+ if (shape) {
630
+ if (((_e = shape.attrs.anchor) === null || _e === void 0 ? void 0 : _e.adjustType) === anchor.attrs.adjustType) {
631
+ const anchorShadow = graph.find(`.anchor`).find((o) => o.attrs.adjustType === anchor.attrs.adjustType);
632
+ if (anchorShadow) {
633
+ shape.position({
634
+ x: render.toStageValue(anchorShadow.getAbsolutePosition().x - stageState.x),
635
+ y: render.toStageValue(anchorShadow.getAbsolutePosition().y - stageState.y)
636
+ });
637
+ shape.rotation(graph.getAbsoluteRotation());
638
+ }
639
+ }
640
+ }
641
+ }
642
+ }
643
+ render.redraw([GraphDraw.name, LinkDraw.name, PreviewDraw.name]); // 重绘
644
+ }
645
+ BaseGraph.adjust(render, graph, graphSnap, adjustShape, anchorAndShadows, startPoint, endPoint, hoverRect);
646
+ }
647
+ /**
648
+ * 提供给 GraphDraw draw 使用
649
+ */
650
+ static draw(graph, render, adjustAnchor) {
651
+ const { anchorAndShadows } = super.draw(graph, render, adjustAnchor);
652
+ return Circle.createAnchorShapes(render, graph, anchorAndShadows, adjustAnchor);
653
+ }
654
+ constructor(render, dropPoint) {
655
+ super(render, dropPoint, {
656
+ type: "Circle",
657
+ anchors: [
658
+ { adjustType: 'top' },
659
+ { adjustType: 'bottom' },
660
+ { adjustType: 'left' },
661
+ { adjustType: 'right' },
662
+ { adjustType: 'top-left' },
663
+ { adjustType: 'top-right' },
664
+ { adjustType: 'bottom-left' },
665
+ { adjustType: 'bottom-right' }
666
+ ].map((o) => ({ adjustType: o.adjustType })),
667
+ linkAnchors: [
668
+ { x: 0, y: 0, alias: 'top', direction: 'top' },
669
+ { x: 0, y: 0, alias: 'bottom', direction: 'bottom' },
670
+ { x: 0, y: 0, alias: 'left', direction: 'left' },
671
+ { x: 0, y: 0, alias: 'right', direction: 'right' },
672
+ { x: 0, y: 0, alias: 'center' }
673
+ ]
674
+ });
675
+ this.circle = new Konva.Ellipse({
676
+ name: 'graph',
677
+ x: 0,
678
+ y: 0,
679
+ radiusX: 0,
680
+ radiusY: 0,
681
+ stroke: this.render.getPageSettings().stroke,
682
+ strokeWidth: this.render.getPageSettings().strokeWidth
683
+ });
684
+ this.group.add(this.circle);
685
+ this.group.position(this.dropPoint); // 鼠标按下位置 作为起点
686
+ }
687
+ // 实现:拖动进行时
688
+ drawMove(point) {
689
+ // 鼠标拖动偏移量
690
+ let offsetX = point.x - this.dropPoint.x, offsetY = point.y - this.dropPoint.y;
691
+ if (offsetX < 1)
692
+ offsetX = 1;
693
+ if (offsetY < 1)
694
+ offsetY = 1;
695
+ // 半径
696
+ const radiusX = offsetX / 2, radiusY = offsetY / 2;
697
+ // 圆/椭圆 位置大小
698
+ this.circle.x(radiusX);
699
+ this.circle.y(radiusY);
700
+ this.circle.radiusX(radiusX);
701
+ this.circle.radiusY(radiusY);
702
+ this.group.size({ width: offsetX, height: offsetY });
703
+ Circle.updateAnchorShadows(this.group, this.anchorShadows);
704
+ Circle.updateLinkAnchorShadows(this.group, this.linkAnchorShadows);
705
+ this.render.redraw([GraphDraw.name, LinkDraw.name, PreviewDraw.name]);
706
+ }
707
+ // 实现:拖动结束
708
+ drawEnd() {
709
+ if (this.circle.radiusX() <= 1 && this.circle.radiusY() <= 1) {
710
+ const width = Circle.size, height = width;
711
+ const radiusX = Circle.size / 2, radiusY = radiusX;
712
+ this.circle.x(radiusX);
713
+ this.circle.y(radiusY);
714
+ this.circle.radiusX(radiusX - this.circle.strokeWidth());
715
+ this.circle.radiusY(radiusY - this.circle.strokeWidth());
716
+ this.group.size({ width, height });
717
+ // 更新 图形 的 调整点 的 锚点位置
718
+ Circle.updateAnchorShadows(this.group, this.anchorShadows);
719
+ // 更新 图形 的 连接点 的 锚点位置
720
+ Circle.updateLinkAnchorShadows(this.group, this.linkAnchorShadows);
721
+ // 对齐线清除
722
+ this.render.attractTool.alignLinesClear();
723
+ // 更新历史
724
+ this.render.updateHistory();
725
+ // 重绘
726
+ this.render.redraw([GraphDraw.name, LinkDraw.name, PreviewDraw.name]);
727
+ }
728
+ super.drawEnd();
729
+ }
730
+ }
731
+ /**
732
+ * 默认图形大小
733
+ */
734
+ Circle.size = 100;
735
+ //# sourceMappingURL=circle.js.map