dcim-topology2d 3.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (512) hide show
  1. package/activity-diagram/index.d.ts +5 -0
  2. package/activity-diagram/index.js +6 -0
  3. package/activity-diagram/index.js.map +1 -0
  4. package/activity-diagram/src/final/final.d.ts +2 -0
  5. package/activity-diagram/src/final/final.js +10 -0
  6. package/activity-diagram/src/final/final.js.map +1 -0
  7. package/activity-diagram/src/final/final.rect.d.ts +3 -0
  8. package/activity-diagram/src/final/final.rect.js +11 -0
  9. package/activity-diagram/src/final/final.rect.js.map +1 -0
  10. package/activity-diagram/src/final/index.d.ts +2 -0
  11. package/activity-diagram/src/final/index.js +3 -0
  12. package/activity-diagram/src/final/index.js.map +1 -0
  13. package/activity-diagram/src/fork/fork.anchor.d.ts +3 -0
  14. package/activity-diagram/src/fork/fork.anchor.js +28 -0
  15. package/activity-diagram/src/fork/fork.anchor.js.map +1 -0
  16. package/activity-diagram/src/fork/fork.d.ts +2 -0
  17. package/activity-diagram/src/fork/fork.js +25 -0
  18. package/activity-diagram/src/fork/fork.js.map +1 -0
  19. package/activity-diagram/src/fork/fork.rect.d.ts +3 -0
  20. package/activity-diagram/src/fork/fork.rect.js +9 -0
  21. package/activity-diagram/src/fork/fork.rect.js.map +1 -0
  22. package/activity-diagram/src/fork/index.d.ts +3 -0
  23. package/activity-diagram/src/fork/index.js +4 -0
  24. package/activity-diagram/src/fork/index.js.map +1 -0
  25. package/activity-diagram/src/register.d.ts +1 -0
  26. package/activity-diagram/src/register.js +13 -0
  27. package/activity-diagram/src/register.js.map +1 -0
  28. package/activity-diagram/src/swimlaneH/index.d.ts +2 -0
  29. package/activity-diagram/src/swimlaneH/index.js +3 -0
  30. package/activity-diagram/src/swimlaneH/index.js.map +1 -0
  31. package/activity-diagram/src/swimlaneH/swimlaneH.d.ts +2 -0
  32. package/activity-diagram/src/swimlaneH/swimlaneH.js +27 -0
  33. package/activity-diagram/src/swimlaneH/swimlaneH.js.map +1 -0
  34. package/activity-diagram/src/swimlaneH/swimlaneH.rect.d.ts +3 -0
  35. package/activity-diagram/src/swimlaneH/swimlaneH.rect.js +9 -0
  36. package/activity-diagram/src/swimlaneH/swimlaneH.rect.js.map +1 -0
  37. package/activity-diagram/src/swimlaneV/index.d.ts +2 -0
  38. package/activity-diagram/src/swimlaneV/index.js +3 -0
  39. package/activity-diagram/src/swimlaneV/index.js.map +1 -0
  40. package/activity-diagram/src/swimlaneV/swimlaneV.d.ts +2 -0
  41. package/activity-diagram/src/swimlaneV/swimlaneV.js +27 -0
  42. package/activity-diagram/src/swimlaneV/swimlaneV.js.map +1 -0
  43. package/activity-diagram/src/swimlaneV/swimlaneV.rect.d.ts +3 -0
  44. package/activity-diagram/src/swimlaneV/swimlaneV.rect.js +9 -0
  45. package/activity-diagram/src/swimlaneV/swimlaneV.rect.js.map +1 -0
  46. package/chart-diagram/index.d.ts +3 -0
  47. package/chart-diagram/index.js +4 -0
  48. package/chart-diagram/index.js.map +1 -0
  49. package/chart-diagram/src/echarts/echarts.min.js +22 -0
  50. package/chart-diagram/src/echarts/index.d.ts +4 -0
  51. package/chart-diagram/src/echarts/index.js +104 -0
  52. package/chart-diagram/src/echarts/index.js.map +1 -0
  53. package/chart-diagram/src/register.d.ts +1 -0
  54. package/chart-diagram/src/register.js +12 -0
  55. package/chart-diagram/src/register.js.map +1 -0
  56. package/class-diagram/index.d.ts +2 -0
  57. package/class-diagram/index.js +3 -0
  58. package/class-diagram/index.js.map +1 -0
  59. package/class-diagram/src/class/class.d.ts +3 -0
  60. package/class-diagram/src/class/class.js +56 -0
  61. package/class-diagram/src/class/class.js.map +1 -0
  62. package/class-diagram/src/class/class.rect.d.ts +5 -0
  63. package/class-diagram/src/class/class.rect.js +16 -0
  64. package/class-diagram/src/class/class.rect.js.map +1 -0
  65. package/class-diagram/src/class/index.d.ts +2 -0
  66. package/class-diagram/src/class/index.js +3 -0
  67. package/class-diagram/src/class/index.js.map +1 -0
  68. package/class-diagram/src/register.d.ts +1 -0
  69. package/class-diagram/src/register.js +7 -0
  70. package/class-diagram/src/register.js.map +1 -0
  71. package/core/index.d.ts +8 -0
  72. package/core/index.js +26 -0
  73. package/core/index.js.map +1 -0
  74. package/core/src/activeLayer.d.ts +55 -0
  75. package/core/src/activeLayer.js +679 -0
  76. package/core/src/activeLayer.js.map +1 -0
  77. package/core/src/animateLayer.d.ts +23 -0
  78. package/core/src/animateLayer.js +227 -0
  79. package/core/src/animateLayer.js.map +1 -0
  80. package/core/src/calling.d.ts +37 -0
  81. package/core/src/calling.js +253 -0
  82. package/core/src/canvas.d.ts +19 -0
  83. package/core/src/canvas.js +81 -0
  84. package/core/src/canvas.js.map +1 -0
  85. package/core/src/common.d.ts +102 -0
  86. package/core/src/common.js +1254 -0
  87. package/core/src/core.d.ts +104 -0
  88. package/core/src/core.js +2281 -0
  89. package/core/src/core.js.map +1 -0
  90. package/core/src/divLayer.d.ts +61 -0
  91. package/core/src/divLayer.js +485 -0
  92. package/core/src/divLayer.js.map +1 -0
  93. package/core/src/healps/changeData.d.ts +8 -0
  94. package/core/src/healps/changeData.js +205 -0
  95. package/core/src/healps/index.d.ts +1 -0
  96. package/core/src/healps/index.js +1 -0
  97. package/core/src/hoverLayer.d.ts +32 -0
  98. package/core/src/hoverLayer.js +199 -0
  99. package/core/src/hoverLayer.js.map +1 -0
  100. package/core/src/layer.d.ts +5 -0
  101. package/core/src/layer.js +11 -0
  102. package/core/src/layer.js.map +1 -0
  103. package/core/src/middles/arrows/circle.d.ts +3 -0
  104. package/core/src/middles/arrows/circle.js +20 -0
  105. package/core/src/middles/arrows/circle.js.map +1 -0
  106. package/core/src/middles/arrows/diamond.d.ts +3 -0
  107. package/core/src/middles/arrows/diamond.js +28 -0
  108. package/core/src/middles/arrows/diamond.js.map +1 -0
  109. package/core/src/middles/arrows/line.d.ts +4 -0
  110. package/core/src/middles/arrows/line.js +42 -0
  111. package/core/src/middles/arrows/line.js.map +1 -0
  112. package/core/src/middles/arrows/triangle.d.ts +3 -0
  113. package/core/src/middles/arrows/triangle.js +25 -0
  114. package/core/src/middles/arrows/triangle.js.map +1 -0
  115. package/core/src/middles/default.anchor.d.ts +2 -0
  116. package/core/src/middles/default.anchor.js +9 -0
  117. package/core/src/middles/default.anchor.js.map +1 -0
  118. package/core/src/middles/default.d.ts +12 -0
  119. package/core/src/middles/default.js +257 -0
  120. package/core/src/middles/default.js.map +1 -0
  121. package/core/src/middles/default.rect.d.ts +3 -0
  122. package/core/src/middles/default.rect.js +19 -0
  123. package/core/src/middles/default.rect.js.map +1 -0
  124. package/core/src/middles/index.d.ts +3 -0
  125. package/core/src/middles/index.js +4 -0
  126. package/core/src/middles/index.js.map +1 -0
  127. package/core/src/middles/lines/curve.d.ts +10 -0
  128. package/core/src/middles/lines/curve.js +127 -0
  129. package/core/src/middles/lines/curve.js.map +1 -0
  130. package/core/src/middles/lines/line.d.ts +4 -0
  131. package/core/src/middles/lines/line.js +11 -0
  132. package/core/src/middles/lines/line.js.map +1 -0
  133. package/core/src/middles/lines/mind.d.ts +6 -0
  134. package/core/src/middles/lines/mind.js +90 -0
  135. package/core/src/middles/lines/mind.js.map +1 -0
  136. package/core/src/middles/lines/polyline.d.ts +7 -0
  137. package/core/src/middles/lines/polyline.js +309 -0
  138. package/core/src/middles/lines/polyline.js.map +1 -0
  139. package/core/src/middles/nodes/arbitrarygraph.anchor.d.ts +2 -0
  140. package/core/src/middles/nodes/arbitrarygraph.anchor.js +18 -0
  141. package/core/src/middles/nodes/arbitrarygraph.d.ts +2 -0
  142. package/core/src/middles/nodes/arbitrarygraph.js +17 -0
  143. package/core/src/middles/nodes/arrow.anchor.d.ts +2 -0
  144. package/core/src/middles/nodes/arrow.anchor.js +7 -0
  145. package/core/src/middles/nodes/arrow.anchor.js.map +1 -0
  146. package/core/src/middles/nodes/arrow.d.ts +4 -0
  147. package/core/src/middles/nodes/arrow.js +44 -0
  148. package/core/src/middles/nodes/arrow.js.map +1 -0
  149. package/core/src/middles/nodes/arrow.rect.d.ts +7 -0
  150. package/core/src/middles/nodes/arrow.rect.js +23 -0
  151. package/core/src/middles/nodes/arrow.rect.js.map +1 -0
  152. package/core/src/middles/nodes/circle.anchor.d.ts +2 -0
  153. package/core/src/middles/nodes/circle.anchor.js +18 -0
  154. package/core/src/middles/nodes/circle.anchor.js.map +1 -0
  155. package/core/src/middles/nodes/circle.d.ts +2 -0
  156. package/core/src/middles/nodes/circle.js +7 -0
  157. package/core/src/middles/nodes/circle.js.map +1 -0
  158. package/core/src/middles/nodes/circle.rect.d.ts +3 -0
  159. package/core/src/middles/nodes/circle.rect.js +27 -0
  160. package/core/src/middles/nodes/circle.rect.js.map +1 -0
  161. package/core/src/middles/nodes/cloud.anchor.d.ts +2 -0
  162. package/core/src/middles/nodes/cloud.anchor.js +9 -0
  163. package/core/src/middles/nodes/cloud.anchor.js.map +1 -0
  164. package/core/src/middles/nodes/cloud.d.ts +2 -0
  165. package/core/src/middles/nodes/cloud.js +11 -0
  166. package/core/src/middles/nodes/cloud.js.map +1 -0
  167. package/core/src/middles/nodes/cloud.rect.d.ts +3 -0
  168. package/core/src/middles/nodes/cloud.rect.js +9 -0
  169. package/core/src/middles/nodes/cloud.rect.js.map +1 -0
  170. package/core/src/middles/nodes/cube.anchor.d.ts +2 -0
  171. package/core/src/middles/nodes/cube.anchor.js +10 -0
  172. package/core/src/middles/nodes/cube.anchor.js.map +1 -0
  173. package/core/src/middles/nodes/cube.d.ts +2 -0
  174. package/core/src/middles/nodes/cube.js +5 -0
  175. package/core/src/middles/nodes/cube.js.map +1 -0
  176. package/core/src/middles/nodes/cube.model.d.ts +14 -0
  177. package/core/src/middles/nodes/cube.model.js +64 -0
  178. package/core/src/middles/nodes/cube.model.js.map +1 -0
  179. package/core/src/middles/nodes/cube.rect.d.ts +3 -0
  180. package/core/src/middles/nodes/cube.rect.js +11 -0
  181. package/core/src/middles/nodes/cube.rect.js.map +1 -0
  182. package/core/src/middles/nodes/diamond.d.ts +2 -0
  183. package/core/src/middles/nodes/diamond.js +11 -0
  184. package/core/src/middles/nodes/diamond.js.map +1 -0
  185. package/core/src/middles/nodes/diamond.rect.d.ts +3 -0
  186. package/core/src/middles/nodes/diamond.rect.js +27 -0
  187. package/core/src/middles/nodes/diamond.rect.js.map +1 -0
  188. package/core/src/middles/nodes/file.d.ts +2 -0
  189. package/core/src/middles/nodes/file.js +16 -0
  190. package/core/src/middles/nodes/file.js.map +1 -0
  191. package/core/src/middles/nodes/formtable.d.ts +2 -0
  192. package/core/src/middles/nodes/formtable.js +100 -0
  193. package/core/src/middles/nodes/hexagon.anchor.d.ts +2 -0
  194. package/core/src/middles/nodes/hexagon.anchor.js +21 -0
  195. package/core/src/middles/nodes/hexagon.anchor.js.map +1 -0
  196. package/core/src/middles/nodes/hexagon.d.ts +2 -0
  197. package/core/src/middles/nodes/hexagon.js +14 -0
  198. package/core/src/middles/nodes/hexagon.js.map +1 -0
  199. package/core/src/middles/nodes/hexagon.rect.d.ts +3 -0
  200. package/core/src/middles/nodes/hexagon.rect.js +14 -0
  201. package/core/src/middles/nodes/hexagon.rect.js.map +1 -0
  202. package/core/src/middles/nodes/image.anchor.d.ts +2 -0
  203. package/core/src/middles/nodes/image.anchor.js +12 -0
  204. package/core/src/middles/nodes/image.anchor.js.map +1 -0
  205. package/core/src/middles/nodes/image.rect.d.ts +3 -0
  206. package/core/src/middles/nodes/image.rect.js +65 -0
  207. package/core/src/middles/nodes/image.rect.js.map +1 -0
  208. package/core/src/middles/nodes/line.anchor.d.ts +2 -0
  209. package/core/src/middles/nodes/line.anchor.js +13 -0
  210. package/core/src/middles/nodes/line.anchor.js.map +1 -0
  211. package/core/src/middles/nodes/line.d.ts +2 -0
  212. package/core/src/middles/nodes/line.js +9 -0
  213. package/core/src/middles/nodes/line.js.map +1 -0
  214. package/core/src/middles/nodes/line.rect.d.ts +3 -0
  215. package/core/src/middles/nodes/line.rect.js +9 -0
  216. package/core/src/middles/nodes/line.rect.js.map +1 -0
  217. package/core/src/middles/nodes/message.anchor.d.ts +2 -0
  218. package/core/src/middles/nodes/message.anchor.js +9 -0
  219. package/core/src/middles/nodes/message.anchor.js.map +1 -0
  220. package/core/src/middles/nodes/message.d.ts +2 -0
  221. package/core/src/middles/nodes/message.js +14 -0
  222. package/core/src/middles/nodes/message.js.map +1 -0
  223. package/core/src/middles/nodes/message.rect.d.ts +3 -0
  224. package/core/src/middles/nodes/message.rect.js +10 -0
  225. package/core/src/middles/nodes/message.rect.js.map +1 -0
  226. package/core/src/middles/nodes/pentagon.anchor.d.ts +2 -0
  227. package/core/src/middles/nodes/pentagon.anchor.js +10 -0
  228. package/core/src/middles/nodes/pentagon.anchor.js.map +1 -0
  229. package/core/src/middles/nodes/pentagon.d.ts +2 -0
  230. package/core/src/middles/nodes/pentagon.js +12 -0
  231. package/core/src/middles/nodes/pentagon.js.map +1 -0
  232. package/core/src/middles/nodes/pentagon.rect.d.ts +3 -0
  233. package/core/src/middles/nodes/pentagon.rect.js +23 -0
  234. package/core/src/middles/nodes/pentagon.rect.js.map +1 -0
  235. package/core/src/middles/nodes/pentagram.anchor.d.ts +2 -0
  236. package/core/src/middles/nodes/pentagram.anchor.js +10 -0
  237. package/core/src/middles/nodes/pentagram.anchor.js.map +1 -0
  238. package/core/src/middles/nodes/pentagram.d.ts +2 -0
  239. package/core/src/middles/nodes/pentagram.js +11 -0
  240. package/core/src/middles/nodes/pentagram.js.map +1 -0
  241. package/core/src/middles/nodes/pentagram.rect.d.ts +3 -0
  242. package/core/src/middles/nodes/pentagram.rect.js +11 -0
  243. package/core/src/middles/nodes/pentagram.rect.js.map +1 -0
  244. package/core/src/middles/nodes/people.d.ts +2 -0
  245. package/core/src/middles/nodes/people.js +17 -0
  246. package/core/src/middles/nodes/people.js.map +1 -0
  247. package/core/src/middles/nodes/people.rect.d.ts +3 -0
  248. package/core/src/middles/nodes/people.rect.js +9 -0
  249. package/core/src/middles/nodes/people.rect.js.map +1 -0
  250. package/core/src/middles/nodes/rectangle.d.ts +2 -0
  251. package/core/src/middles/nodes/rectangle.js +25 -0
  252. package/core/src/middles/nodes/rectangle.js.map +1 -0
  253. package/core/src/middles/nodes/rectangle.rect.d.ts +3 -0
  254. package/core/src/middles/nodes/rectangle.rect.js +11 -0
  255. package/core/src/middles/nodes/rectangle.rect.js.map +1 -0
  256. package/core/src/middles/nodes/tablePagination.d.ts +2 -0
  257. package/core/src/middles/nodes/tablePagination.js +106 -0
  258. package/core/src/middles/nodes/text.d.ts +8 -0
  259. package/core/src/middles/nodes/text.js +295 -0
  260. package/core/src/middles/nodes/text.js.map +1 -0
  261. package/core/src/middles/nodes/triangle.anchor.d.ts +2 -0
  262. package/core/src/middles/nodes/triangle.anchor.js +9 -0
  263. package/core/src/middles/nodes/triangle.anchor.js.map +1 -0
  264. package/core/src/middles/nodes/triangle.d.ts +2 -0
  265. package/core/src/middles/nodes/triangle.js +10 -0
  266. package/core/src/middles/nodes/triangle.js.map +1 -0
  267. package/core/src/middles/nodes/triangle.rect.d.ts +3 -0
  268. package/core/src/middles/nodes/triangle.rect.js +23 -0
  269. package/core/src/middles/nodes/triangle.rect.js.map +1 -0
  270. package/core/src/models/data.d.ts +26 -0
  271. package/core/src/models/data.js +77 -0
  272. package/core/src/models/data.js.map +1 -0
  273. package/core/src/models/direction.d.ts +7 -0
  274. package/core/src/models/direction.js +9 -0
  275. package/core/src/models/direction.js.map +1 -0
  276. package/core/src/models/event.d.ts +13 -0
  277. package/core/src/models/event.js +16 -0
  278. package/core/src/models/event.js.map +1 -0
  279. package/core/src/models/index.d.ts +9 -0
  280. package/core/src/models/index.js +10 -0
  281. package/core/src/models/index.js.map +1 -0
  282. package/core/src/models/line.d.ts +53 -0
  283. package/core/src/models/line.js +442 -0
  284. package/core/src/models/line.js.map +1 -0
  285. package/core/src/models/node.d.ts +95 -0
  286. package/core/src/models/node.js +944 -0
  287. package/core/src/models/node.js.map +1 -0
  288. package/core/src/models/pen.d.ts +122 -0
  289. package/core/src/models/pen.js +362 -0
  290. package/core/src/models/pen.js.map +1 -0
  291. package/core/src/models/point.d.ts +25 -0
  292. package/core/src/models/point.js +59 -0
  293. package/core/src/models/point.js.map +1 -0
  294. package/core/src/models/rect.d.ts +22 -0
  295. package/core/src/models/rect.js +93 -0
  296. package/core/src/models/rect.js.map +1 -0
  297. package/core/src/models/status.d.ts +10 -0
  298. package/core/src/models/status.js +13 -0
  299. package/core/src/models/status.js.map +1 -0
  300. package/core/src/mqtt.d.ts +14 -0
  301. package/core/src/mqtt.js +82 -0
  302. package/core/src/mqtt.js.map +1 -0
  303. package/core/src/mqtt.min.d.ts +2 -0
  304. package/core/src/mqtt.min.js +2447 -0
  305. package/core/src/mqtt.min.js.map +1 -0
  306. package/core/src/offscreen.d.ts +16 -0
  307. package/core/src/offscreen.js +70 -0
  308. package/core/src/offscreen.js.map +1 -0
  309. package/core/src/options.d.ts +66 -0
  310. package/core/src/options.js +42 -0
  311. package/core/src/options.js.map +1 -0
  312. package/core/src/poll.js +39 -0
  313. package/core/src/preview.d.ts +29 -0
  314. package/core/src/preview.js +247 -0
  315. package/core/src/renderLayer.d.ts +36 -0
  316. package/core/src/renderLayer.js +187 -0
  317. package/core/src/renderLayer.js.map +1 -0
  318. package/core/src/socket.d.ts +10 -0
  319. package/core/src/socket.js +51 -0
  320. package/core/src/socket.js.map +1 -0
  321. package/core/src/utils/browser.d.ts +1 -0
  322. package/core/src/utils/browser.js +4 -0
  323. package/core/src/utils/browser.js.map +1 -0
  324. package/core/src/utils/canvas.d.ts +13 -0
  325. package/core/src/utils/canvas.js +84 -0
  326. package/core/src/utils/canvas.js.map +1 -0
  327. package/core/src/utils/construction.d.ts +41 -0
  328. package/core/src/utils/construction.js +36 -0
  329. package/core/src/utils/conversion.d.ts +0 -0
  330. package/core/src/utils/conversion.js +0 -0
  331. package/core/src/utils/dom.d.ts +8 -0
  332. package/core/src/utils/dom.js +67 -0
  333. package/core/src/utils/dom.js.map +1 -0
  334. package/core/src/utils/index.d.ts +9 -0
  335. package/core/src/utils/index.js +10 -0
  336. package/core/src/utils/index.js.map +1 -0
  337. package/core/src/utils/math.d.ts +3 -0
  338. package/core/src/utils/math.js +118 -0
  339. package/core/src/utils/math.js.map +1 -0
  340. package/core/src/utils/onmousevent.d.ts +5 -0
  341. package/core/src/utils/onmousevent.js +57 -0
  342. package/core/src/utils/padding.d.ts +7 -0
  343. package/core/src/utils/padding.js +47 -0
  344. package/core/src/utils/padding.js.map +1 -0
  345. package/core/src/utils/rect.d.ts +7 -0
  346. package/core/src/utils/rect.js +72 -0
  347. package/core/src/utils/rect.js.map +1 -0
  348. package/core/src/utils/uuid.d.ts +4 -0
  349. package/core/src/utils/uuid.js +13 -0
  350. package/core/src/utils/uuid.js.map +1 -0
  351. package/flow-diagram/index.d.ts +12 -0
  352. package/flow-diagram/index.js +13 -0
  353. package/flow-diagram/index.js.map +1 -0
  354. package/flow-diagram/src/comment/comment.anchor.d.ts +2 -0
  355. package/flow-diagram/src/comment/comment.anchor.js +5 -0
  356. package/flow-diagram/src/comment/comment.anchor.js.map +1 -0
  357. package/flow-diagram/src/comment/comment.d.ts +2 -0
  358. package/flow-diagram/src/comment/comment.js +10 -0
  359. package/flow-diagram/src/comment/comment.js.map +1 -0
  360. package/flow-diagram/src/comment/index.d.ts +2 -0
  361. package/flow-diagram/src/comment/index.js +3 -0
  362. package/flow-diagram/src/comment/index.js.map +1 -0
  363. package/flow-diagram/src/data/data.anchor.d.ts +2 -0
  364. package/flow-diagram/src/data/data.anchor.js +8 -0
  365. package/flow-diagram/src/data/data.anchor.js.map +1 -0
  366. package/flow-diagram/src/data/data.d.ts +2 -0
  367. package/flow-diagram/src/data/data.js +12 -0
  368. package/flow-diagram/src/data/data.js.map +1 -0
  369. package/flow-diagram/src/data/data.rect.d.ts +3 -0
  370. package/flow-diagram/src/data/data.rect.js +9 -0
  371. package/flow-diagram/src/data/data.rect.js.map +1 -0
  372. package/flow-diagram/src/data/index.d.ts +3 -0
  373. package/flow-diagram/src/data/index.js +4 -0
  374. package/flow-diagram/src/data/index.js.map +1 -0
  375. package/flow-diagram/src/db/db.d.ts +2 -0
  376. package/flow-diagram/src/db/db.js +14 -0
  377. package/flow-diagram/src/db/db.js.map +1 -0
  378. package/flow-diagram/src/db/db.rect.d.ts +4 -0
  379. package/flow-diagram/src/db/db.rect.js +9 -0
  380. package/flow-diagram/src/db/db.rect.js.map +1 -0
  381. package/flow-diagram/src/db/index.d.ts +2 -0
  382. package/flow-diagram/src/db/index.js +3 -0
  383. package/flow-diagram/src/db/index.js.map +1 -0
  384. package/flow-diagram/src/display/display.anchor.d.ts +2 -0
  385. package/flow-diagram/src/display/display.anchor.js +8 -0
  386. package/flow-diagram/src/display/display.anchor.js.map +1 -0
  387. package/flow-diagram/src/display/display.d.ts +2 -0
  388. package/flow-diagram/src/display/display.js +13 -0
  389. package/flow-diagram/src/display/display.js.map +1 -0
  390. package/flow-diagram/src/display/display.rect.d.ts +3 -0
  391. package/flow-diagram/src/display/display.rect.js +9 -0
  392. package/flow-diagram/src/display/display.rect.js.map +1 -0
  393. package/flow-diagram/src/display/index.d.ts +3 -0
  394. package/flow-diagram/src/display/index.js +4 -0
  395. package/flow-diagram/src/display/index.js.map +1 -0
  396. package/flow-diagram/src/document/document.anchor.d.ts +2 -0
  397. package/flow-diagram/src/document/document.anchor.js +8 -0
  398. package/flow-diagram/src/document/document.anchor.js.map +1 -0
  399. package/flow-diagram/src/document/document.d.ts +2 -0
  400. package/flow-diagram/src/document/document.js +15 -0
  401. package/flow-diagram/src/document/document.js.map +1 -0
  402. package/flow-diagram/src/document/document.rect.d.ts +3 -0
  403. package/flow-diagram/src/document/document.rect.js +9 -0
  404. package/flow-diagram/src/document/document.rect.js.map +1 -0
  405. package/flow-diagram/src/document/index.d.ts +3 -0
  406. package/flow-diagram/src/document/index.js +4 -0
  407. package/flow-diagram/src/document/index.js.map +1 -0
  408. package/flow-diagram/src/externStorage/externStorage.anchor.d.ts +2 -0
  409. package/flow-diagram/src/externStorage/externStorage.anchor.js +8 -0
  410. package/flow-diagram/src/externStorage/externStorage.anchor.js.map +1 -0
  411. package/flow-diagram/src/externStorage/externStorage.d.ts +2 -0
  412. package/flow-diagram/src/externStorage/externStorage.js +12 -0
  413. package/flow-diagram/src/externStorage/externStorage.js.map +1 -0
  414. package/flow-diagram/src/externStorage/externStorage.rect.d.ts +3 -0
  415. package/flow-diagram/src/externStorage/externStorage.rect.js +9 -0
  416. package/flow-diagram/src/externStorage/externStorage.rect.js.map +1 -0
  417. package/flow-diagram/src/externStorage/index.d.ts +3 -0
  418. package/flow-diagram/src/externStorage/index.js +4 -0
  419. package/flow-diagram/src/externStorage/index.js.map +1 -0
  420. package/flow-diagram/src/internalStorage/index.d.ts +2 -0
  421. package/flow-diagram/src/internalStorage/index.js +3 -0
  422. package/flow-diagram/src/internalStorage/index.js.map +1 -0
  423. package/flow-diagram/src/internalStorage/internalStorage.d.ts +2 -0
  424. package/flow-diagram/src/internalStorage/internalStorage.js +16 -0
  425. package/flow-diagram/src/internalStorage/internalStorage.js.map +1 -0
  426. package/flow-diagram/src/internalStorage/internalStorage.rect.d.ts +3 -0
  427. package/flow-diagram/src/internalStorage/internalStorage.rect.js +10 -0
  428. package/flow-diagram/src/internalStorage/internalStorage.rect.js.map +1 -0
  429. package/flow-diagram/src/manually/index.d.ts +3 -0
  430. package/flow-diagram/src/manually/index.js +4 -0
  431. package/flow-diagram/src/manually/index.js.map +1 -0
  432. package/flow-diagram/src/manually/manually.anchor.d.ts +2 -0
  433. package/flow-diagram/src/manually/manually.anchor.js +8 -0
  434. package/flow-diagram/src/manually/manually.anchor.js.map +1 -0
  435. package/flow-diagram/src/manually/manually.d.ts +2 -0
  436. package/flow-diagram/src/manually/manually.js +12 -0
  437. package/flow-diagram/src/manually/manually.js.map +1 -0
  438. package/flow-diagram/src/manually/manually.rect.d.ts +3 -0
  439. package/flow-diagram/src/manually/manually.rect.js +9 -0
  440. package/flow-diagram/src/manually/manually.rect.js.map +1 -0
  441. package/flow-diagram/src/parallel/index.d.ts +2 -0
  442. package/flow-diagram/src/parallel/index.js +3 -0
  443. package/flow-diagram/src/parallel/index.js.map +1 -0
  444. package/flow-diagram/src/parallel/parallel.anchor.d.ts +2 -0
  445. package/flow-diagram/src/parallel/parallel.anchor.js +6 -0
  446. package/flow-diagram/src/parallel/parallel.anchor.js.map +1 -0
  447. package/flow-diagram/src/parallel/parallel.d.ts +2 -0
  448. package/flow-diagram/src/parallel/parallel.js +9 -0
  449. package/flow-diagram/src/parallel/parallel.js.map +1 -0
  450. package/flow-diagram/src/queue/index.d.ts +2 -0
  451. package/flow-diagram/src/queue/index.js +3 -0
  452. package/flow-diagram/src/queue/index.js.map +1 -0
  453. package/flow-diagram/src/queue/queue.d.ts +2 -0
  454. package/flow-diagram/src/queue/queue.js +9 -0
  455. package/flow-diagram/src/queue/queue.js.map +1 -0
  456. package/flow-diagram/src/queue/queue.rect.d.ts +3 -0
  457. package/flow-diagram/src/queue/queue.rect.js +11 -0
  458. package/flow-diagram/src/queue/queue.rect.js.map +1 -0
  459. package/flow-diagram/src/register.d.ts +1 -0
  460. package/flow-diagram/src/register.js +26 -0
  461. package/flow-diagram/src/register.js.map +1 -0
  462. package/flow-diagram/src/subprocess/index.d.ts +2 -0
  463. package/flow-diagram/src/subprocess/index.js +3 -0
  464. package/flow-diagram/src/subprocess/index.js.map +1 -0
  465. package/flow-diagram/src/subprocess/subprocess.d.ts +2 -0
  466. package/flow-diagram/src/subprocess/subprocess.js +16 -0
  467. package/flow-diagram/src/subprocess/subprocess.js.map +1 -0
  468. package/flow-diagram/src/subprocess/subprocess.rect.d.ts +3 -0
  469. package/flow-diagram/src/subprocess/subprocess.rect.js +9 -0
  470. package/flow-diagram/src/subprocess/subprocess.rect.js.map +1 -0
  471. package/layout/index.d.ts +2 -0
  472. package/layout/index.js +3 -0
  473. package/layout/index.js.map +1 -0
  474. package/layout/src/align.d.ts +3 -0
  475. package/layout/src/align.js +67 -0
  476. package/layout/src/align.js.map +1 -0
  477. package/layout/src/layout.d.ts +9 -0
  478. package/layout/src/layout.js +50 -0
  479. package/layout/src/layout.js.map +1 -0
  480. package/myShape-diagram/myShape.js +196 -0
  481. package/myShape-diagram/myShape.ts +1 -0
  482. package/package.json +15 -0
  483. package/sequence-diagram/index.d.ts +3 -0
  484. package/sequence-diagram/index.js +4 -0
  485. package/sequence-diagram/index.js.map +1 -0
  486. package/sequence-diagram/src/focus/focus.anchor.d.ts +2 -0
  487. package/sequence-diagram/src/focus/focus.anchor.js +15 -0
  488. package/sequence-diagram/src/focus/focus.anchor.js.map +1 -0
  489. package/sequence-diagram/src/focus/focus.d.ts +2 -0
  490. package/sequence-diagram/src/focus/focus.js +13 -0
  491. package/sequence-diagram/src/focus/focus.js.map +1 -0
  492. package/sequence-diagram/src/focus/focus.rect.d.ts +3 -0
  493. package/sequence-diagram/src/focus/focus.rect.js +9 -0
  494. package/sequence-diagram/src/focus/focus.rect.js.map +1 -0
  495. package/sequence-diagram/src/focus/index.d.ts +3 -0
  496. package/sequence-diagram/src/focus/index.js +4 -0
  497. package/sequence-diagram/src/focus/index.js.map +1 -0
  498. package/sequence-diagram/src/lifeline/index.d.ts +3 -0
  499. package/sequence-diagram/src/lifeline/index.js +4 -0
  500. package/sequence-diagram/src/lifeline/index.js.map +1 -0
  501. package/sequence-diagram/src/lifeline/lifeline.anchor.d.ts +2 -0
  502. package/sequence-diagram/src/lifeline/lifeline.anchor.js +9 -0
  503. package/sequence-diagram/src/lifeline/lifeline.anchor.js.map +1 -0
  504. package/sequence-diagram/src/lifeline/lifeline.d.ts +2 -0
  505. package/sequence-diagram/src/lifeline/lifeline.js +35 -0
  506. package/sequence-diagram/src/lifeline/lifeline.js.map +1 -0
  507. package/sequence-diagram/src/lifeline/lifeline.rect.d.ts +3 -0
  508. package/sequence-diagram/src/lifeline/lifeline.rect.js +9 -0
  509. package/sequence-diagram/src/lifeline/lifeline.rect.js.map +1 -0
  510. package/sequence-diagram/src/register.d.ts +1 -0
  511. package/sequence-diagram/src/register.js +8 -0
  512. package/sequence-diagram/src/register.js.map +1 -0
@@ -0,0 +1,679 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ extendStatics(d, b);
10
+ function __() { this.constructor = d; }
11
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
+ };
13
+ })();
14
+ import { Store } from 'le5le-store';
15
+ import { PenType } from './models/pen';
16
+ import { Node } from './models/node';
17
+ import { Line } from './models/line';
18
+ import { Rect } from './models/rect';
19
+ import { Point } from './models/point';
20
+ import { Lock } from './models/status';
21
+ import { drawLineFns } from './middles';
22
+ import { getBezierPoint } from './middles/lines/curve';
23
+ import { Layer } from './layer';
24
+ import { flatNodes } from './utils';
25
+ var ActiveLayer = /** @class */ (function (_super) {
26
+ __extends(ActiveLayer, _super);
27
+ function ActiveLayer(options, TID) {
28
+ if (options === void 0) { options = {}; }
29
+ var _this = _super.call(this, TID) || this;
30
+ _this.options = options;
31
+ _this.rotateCPs = [];
32
+ _this.sizeCPs = [];
33
+ _this.pens = [];
34
+ // nodes: Node[] = [];
35
+ // lines: Line[] = [];
36
+ _this.rotate = 0;
37
+ // 备份初始位置,方便移动事件处理
38
+ _this.initialSizeCPs = [];
39
+ _this.nodeRects = [];
40
+ _this.childrenRects = {};
41
+ _this.childrenRotate = {};
42
+ // nodes移动时,停靠点的参考位置
43
+ _this.dockWatchers = [];
44
+ _this.rotating = false;
45
+ _this.data = Store.get(_this.generateStoreKey('topology-data'));
46
+ Store.set(_this.generateStoreKey('LT:ActiveLayer'), _this);
47
+ return _this;
48
+ }
49
+ ActiveLayer.prototype.calcControlPoints = function () {
50
+ if (this.pens.length === 1 && this.pens[0] instanceof Node) {
51
+ this.rect = this.pens[0].rect;
52
+ this.sizeCPs = this.pens[0].rect.toPoints();
53
+ this.rotateCPs = [
54
+ new Point(this.pens[0].rect.x + this.pens[0].rect.width / 2, this.pens[0].rect.y - 35),
55
+ new Point(this.pens[0].rect.x + this.pens[0].rect.width / 2, this.pens[0].rect.y),
56
+ ];
57
+ if (this.rotate || this.pens[0].rotate) {
58
+ for (var _i = 0, _a = this.sizeCPs; _i < _a.length; _i++) {
59
+ var pt = _a[_i];
60
+ if (this.pens[0].rotate) {
61
+ pt.rotate(this.pens[0].rotate, this.pens[0].rect.center);
62
+ }
63
+ if (this.rotate) {
64
+ pt.rotate(this.rotate, this.rect.center);
65
+ }
66
+ }
67
+ for (var _b = 0, _c = this.rotateCPs; _b < _c.length; _b++) {
68
+ var pt = _c[_b];
69
+ if (this.pens[0].rotate) {
70
+ pt.rotate(this.pens[0].rotate, this.pens[0].rect.center);
71
+ }
72
+ if (this.rotate) {
73
+ pt.rotate(this.rotate, this.rect.center);
74
+ }
75
+ }
76
+ }
77
+ if (this.options.hideRotateCP || this.pens[0].hideRotateCP) {
78
+ this.rotateCPs = [new Point(-1000, -1000), new Point(-1000, -1000)];
79
+ }
80
+ return;
81
+ }
82
+ var x1 = 99999;
83
+ var y1 = 99999;
84
+ var x2 = -99999;
85
+ var y2 = -99999;
86
+ var pts = this.getPoints();
87
+ for (var _d = 0, pts_1 = pts; _d < pts_1.length; _d++) {
88
+ var item = pts_1[_d];
89
+ if (x1 > item.x) {
90
+ x1 = item.x;
91
+ }
92
+ if (y1 > item.y) {
93
+ y1 = item.y;
94
+ }
95
+ if (x2 < item.x) {
96
+ x2 = item.x;
97
+ }
98
+ if (y2 < item.y) {
99
+ y2 = item.y;
100
+ }
101
+ }
102
+ this.rect = new Rect(x1, y1, x2 - x1, y2 - y1);
103
+ this.sizeCPs = [new Point(x1, y1), new Point(x2, y1), new Point(x2, y2), new Point(x1, y2)];
104
+ this.rotateCPs = [new Point(x1 + (x2 - x1) / 2, y1 - 35), new Point(x1 + (x2 - x1) / 2, y1)];
105
+ if (this.options.hideRotateCP) {
106
+ this.rotateCPs = [new Point(-1000, -1000), new Point(-1000, -1000)];
107
+ }
108
+ };
109
+ ActiveLayer.prototype.locked = function () {
110
+ for (var _i = 0, _a = this.pens; _i < _a.length; _i++) {
111
+ var item = _a[_i];
112
+ if (!item.locked) {
113
+ return false;
114
+ }
115
+ }
116
+ return true;
117
+ };
118
+ ActiveLayer.prototype.getPoints = function () {
119
+ var points = [];
120
+ for (var _i = 0, _a = this.pens; _i < _a.length; _i++) {
121
+ var item = _a[_i];
122
+ if (item.type === PenType.Node) {
123
+ var pts = item.rect.toPoints();
124
+ if (item.rotate) {
125
+ for (var _b = 0, pts_2 = pts; _b < pts_2.length; _b++) {
126
+ var pt = pts_2[_b];
127
+ pt.rotate(item.rotate, item.rect.center);
128
+ }
129
+ }
130
+ points.push.apply(points, pts);
131
+ }
132
+ else if (item instanceof Line) {
133
+ points.push(item.from);
134
+ points.push(item.to);
135
+ if (item.name === 'curve') {
136
+ for (var i = 0.01; i < 1; i += 0.02) {
137
+ points.push(getBezierPoint(i, item.from, item.controlPoints[0], item.controlPoints[1], item.to));
138
+ }
139
+ }
140
+ }
141
+ }
142
+ return points;
143
+ };
144
+ ActiveLayer.prototype.clear = function () {
145
+ this.pens = [];
146
+ this.sizeCPs = [];
147
+ this.rotateCPs = [];
148
+ Store.set(this.generateStoreKey('LT:activeNode'), null);
149
+ };
150
+ // 即将缩放选中的nodes,备份nodes最初大小,方便缩放比例计算
151
+ ActiveLayer.prototype.saveNodeRects = function () {
152
+ this.nodeRects = [];
153
+ this.childrenRects = {};
154
+ for (var _i = 0, _a = this.pens; _i < _a.length; _i++) {
155
+ var item = _a[_i];
156
+ // this.nodeRects.push(new Rect(item.rect.x, item.rect.y, item.rect.width, item.rect.height, item.rect.circles));
157
+ if (item.type && item.from) {
158
+ this.nodeRects.push(new Rect(item.from.x, item.from.y, item.rect.width, item.rect.height));
159
+ }
160
+ else {
161
+ this.nodeRects.push(new Rect(item.rect.x, item.rect.y, item.rect.width, item.rect.height));
162
+ }
163
+ this.saveChildrenRects(item);
164
+ }
165
+ this.initialSizeCPs = [];
166
+ for (var _b = 0, _c = this.sizeCPs; _b < _c.length; _b++) {
167
+ var item = _c[_b];
168
+ this.initialSizeCPs.push(item.clone());
169
+ }
170
+ this.getDockWatchers();
171
+ };
172
+ ActiveLayer.prototype.saveChildrenRects = function (node) {
173
+ if (!(node instanceof Node) || !node.children) {
174
+ return;
175
+ }
176
+ for (var _i = 0, _a = node.children; _i < _a.length; _i++) {
177
+ var item = _a[_i];
178
+ this.childrenRects[item.id] = new Rect(item.rect.x, item.rect.y, item.rect.width, item.rect.height);
179
+ this.childrenRotate[item.id] = item.rotate;
180
+ this.saveChildrenRects(item);
181
+ }
182
+ };
183
+ // pt1 - the point of mouse down.
184
+ // pt2 - the point of mouse move.
185
+ ActiveLayer.prototype.resize = function (type, pt1, pt2) {
186
+ var p1 = new Point(pt1.x, pt1.y);
187
+ var p2 = new Point(pt2.x, pt2.y);
188
+ if (this.pens.length === 1 && this.pens[0].rotate % 360) {
189
+
190
+ p1.rotate(-this.pens[0].rotate, this.nodeRects[0].center);
191
+ p2.rotate(-this.pens[0].rotate, this.nodeRects[0].center);
192
+ }
193
+ var offsetX = p2.x - p1.x;
194
+ var offsetY = p2.y - p1.y;
195
+ if (this.options.onlySizeX) {
196
+ offsetY = 0;
197
+ }
198
+ if (this.options.onlySizeY) {
199
+ offsetX = 0;
200
+ }
201
+ var lines = [];
202
+ switch (type) {
203
+ case 0:
204
+ offsetX = -offsetX;
205
+ offsetY = -offsetY;
206
+ break;
207
+ case 1:
208
+ offsetY = -offsetY;
209
+ break;
210
+ case 3:
211
+ offsetX = -offsetX;
212
+ break;
213
+ }
214
+ var i = 0;
215
+ for (var _i = 0, _a = this.pens; _i < _a.length; _i++) {
216
+ var item = _a[_i];
217
+ if (item.locked) {
218
+ continue;
219
+ }
220
+
221
+ switch (item.type) {
222
+ case PenType.Line:
223
+ break;
224
+ default:
225
+ if (!item.onlySizeX) {
226
+
227
+ var sizeX = (this.nodeRects[i].width + offsetX)/item.rect.width;
228
+
229
+ var nodeRectsCircles = this.nodeRects[i].circles;
230
+
231
+ item.rect.width = this.nodeRects[i].width + offsetX;
232
+
233
+ }
234
+ if (!item.onlySizeY) {
235
+
236
+ var sizeY = (this.nodeRects[i].height + offsetY)/item.rect.height;
237
+
238
+ item.rect.height = this.nodeRects[i].height + offsetY;
239
+
240
+
241
+ }
242
+ if (item.rect.width < 10) {
243
+
244
+ item.rect.width = 10;
245
+
246
+ }
247
+ if (item.rect.height < 10) {
248
+
249
+ item.rect.height = 10
250
+ }
251
+
252
+ this.handleArbitrayGraphSize(type, item, offsetX, offsetY, i, sizeX, sizeY, nodeRectsCircles);
253
+
254
+ switch (type) {
255
+ case 0:
256
+ item.rect.x = item.rect.ex - item.rect.width;
257
+ item.rect.y = item.rect.ey - item.rect.height;
258
+ break;
259
+ case 1:
260
+ item.rect.ex = item.rect.x + item.rect.width;
261
+ item.rect.y = item.rect.ey - item.rect.height;
262
+ break;
263
+ case 2:
264
+ item.rect.ex = item.rect.x + item.rect.width;
265
+ item.rect.ey = item.rect.y + item.rect.height;
266
+ break;
267
+ case 3:
268
+ item.rect.x = item.rect.ex - item.rect.width;
269
+ item.rect.ey = item.rect.y + item.rect.height;
270
+ break;
271
+ }
272
+ item.scalePoints();
273
+ item.rect.calcCenter();
274
+ item.init();
275
+ item.calcChildrenRect();
276
+ break;
277
+ }
278
+ ++i;
279
+ }
280
+ this.updateLines();
281
+ };
282
+ ActiveLayer.prototype.move = function (x, y) {
283
+ if (this.nodeRects.length !== this.pens.length) {
284
+ return;
285
+ }
286
+ var i = 0;
287
+ for (var _i = 0, _a = this.pens; _i < _a.length; _i++) {
288
+ var item = _a[_i];
289
+ if (item.locked) {
290
+ continue;
291
+ }
292
+ if (item instanceof Node) {
293
+ var offsetX = this.nodeRects[i].x + x - item.rect.x;
294
+ var offsetY = this.nodeRects[i].y + y - item.rect.y;
295
+ item.translate(offsetX, offsetY);
296
+ var lines = this.getLinesOfNode(item);
297
+ for (var _b = 0, lines_1 = lines; _b < lines_1.length; _b++) {
298
+ var line = lines_1[_b];
299
+ line.translate(offsetX, offsetY);
300
+ }
301
+ item.calcChildrenRect();
302
+ if (item.parentId && !item.locked) {
303
+ var parent_1 = void 0;
304
+ for (var _c = 0, _d = this.data.pens; _c < _d.length; _c++) {
305
+ var n = _d[_c];
306
+ if (n.id === item.parentId) {
307
+ parent_1 = n;
308
+ item.calcRectInParent(parent_1);
309
+ break;
310
+ }
311
+ }
312
+ }
313
+ if(item.name == 'arbitraryGraph') {
314
+ for(let i = 0, circles = item.rect.circles; i<circles.length; i++) {
315
+ circles[i].x = circles[i].x + offsetX;
316
+ circles[i].y = circles[i].y + offsetY;
317
+ }
318
+ }
319
+ }
320
+ if (item instanceof Line && item.from) {
321
+ var offsetX_1 = this.nodeRects[i].x + x - item.from.x;
322
+ var offsetY_1 = this.nodeRects[i].y + y - item.from.y;
323
+ if (item.parentId) {
324
+ var items = find(item.parentId, this.data.pens);
325
+ items.forEach(function (l) {
326
+ l.translate(offsetX_1, offsetY_1);
327
+ });
328
+ }
329
+ else {
330
+ item.translate(offsetX_1, offsetY_1);
331
+ }
332
+ }
333
+ ++i;
334
+ }
335
+ this.updateLines();
336
+ this.topology.dispatch('move', this.pens);
337
+ };
338
+ ActiveLayer.prototype.getLinesOfNode = function (node) {
339
+ var result = [];
340
+ var nodesLines = flatNodes([node]);
341
+ for (var _i = 0, _a = this.data.pens; _i < _a.length; _i++) {
342
+ var pen = _a[_i];
343
+ if (!(pen instanceof Line)) {
344
+ continue;
345
+ }
346
+ var line = pen;
347
+ var fromIn = false;
348
+ var toIn = false;
349
+ for (var _b = 0, _c = nodesLines.nodes; _b < _c.length; _b++) {
350
+ var item = _c[_b];
351
+ if (line.from.id === item.id) {
352
+ fromIn = true;
353
+ }
354
+ if (line.to.id === item.id) {
355
+ toIn = true;
356
+ }
357
+ }
358
+ if (fromIn && toIn) {
359
+ result.push(line);
360
+ }
361
+ }
362
+ return result;
363
+ };
364
+ ActiveLayer.prototype.updateLines = function (pens) {
365
+ if (!pens) {
366
+ pens = this.pens;
367
+ }
368
+ var nodesLines = flatNodes(pens);
369
+ var lines = [];
370
+ nodesLines.lines.push.apply(nodesLines.lines, this.data.pens.filter(function (pen) { return pen.type; }));
371
+ for (var _i = 0, _a = nodesLines.lines; _i < _a.length; _i++) {
372
+ var line = _a[_i];
373
+ for (var _b = 0, _c = nodesLines.nodes; _b < _c.length; _b++) {
374
+ var item = _c[_b];
375
+ var cnt = 0;
376
+ if (line.from.id === item.id) {
377
+ line.from.x = item.rotatedAnchors[line.from.anchorIndex].x;
378
+ line.from.y = item.rotatedAnchors[line.from.anchorIndex].y;
379
+ ++cnt;
380
+ }
381
+ if (line.to.id === item.id) {
382
+ line.to.x = item.rotatedAnchors[line.to.anchorIndex].x;
383
+ line.to.y = item.rotatedAnchors[line.to.anchorIndex].y;
384
+ ++cnt;
385
+ }
386
+ if (cnt && !this.data.manualCps) {
387
+ line.calcControlPoints();
388
+ }
389
+ line.textRect = null;
390
+ Store.set(this.generateStoreKey('pts-') + line.id, null);
391
+ lines.push(line);
392
+ }
393
+ }
394
+ Store.set(this.generateStoreKey('LT:updateLines'), lines);
395
+ };
396
+ ActiveLayer.prototype.offsetRotate = function (angle) {
397
+ this.rotating = true;
398
+ var i = 0;
399
+ for (var _i = 0, _a = this.pens; _i < _a.length; _i++) {
400
+ var item = _a[_i];
401
+ if (!(item instanceof Node)) {
402
+ continue;
403
+ }
404
+ var center = this.nodeRects[i].center.clone();
405
+ if (this.pens.length > 1) {
406
+ center.rotate(angle, this.rect.center);
407
+ }
408
+ item.rect.x = center.x - item.rect.width / 2;
409
+ item.rect.y = center.y - item.rect.height / 2;
410
+ item.rect.ex = item.rect.x + item.rect.width;
411
+ item.rect.ey = item.rect.y + item.rect.height;
412
+ item.rect.calcCenter();
413
+ item.init();
414
+ item.offsetRotate = angle;
415
+ item.calcRotateAnchors(item.rotate + item.offsetRotate);
416
+ this.rotateChildren(item);
417
+ ++i;
418
+ }
419
+ this.rotate = angle;
420
+ this.topology.dispatch('rotated', this.pens);
421
+ };
422
+ ActiveLayer.prototype.rotateChildren = function (node) {
423
+ if (node.type !== PenType.Node || !node.children) {
424
+ return;
425
+ }
426
+ for (var _i = 0, _a = node.children; _i < _a.length; _i++) {
427
+ var item = _a[_i];
428
+ if (item.type !== PenType.Node) {
429
+ continue;
430
+ }
431
+ var oldCenter = this.childrenRects[item.id].center.clone();
432
+ var newCenter = this.childrenRects[item.id].center.clone().rotate(this.rotate, this.rect.center);
433
+ var rect = this.childrenRects[item.id].clone();
434
+ rect.translate(newCenter.x - oldCenter.x, newCenter.y - oldCenter.y);
435
+ item.rect = rect;
436
+ item.rotate = this.childrenRotate[item.id] + this.rotate;
437
+ item.init();
438
+ this.rotateChildren(item);
439
+ }
440
+ };
441
+ ActiveLayer.prototype.updateRotate = function () {
442
+ for (var _i = 0, _a = this.pens; _i < _a.length; _i++) {
443
+ var item = _a[_i];
444
+ item.rotate += item.offsetRotate;
445
+ if (item.type === PenType.Node && item.rectInParent) {
446
+ item.rectInParent.rotate += item.offsetRotate;
447
+ }
448
+ item.offsetRotate = 0;
449
+ }
450
+ this.rotate = 0;
451
+ this.rotating = false;
452
+ };
453
+ ActiveLayer.prototype.add = function (pen) {
454
+ if (this.has(pen)) {
455
+ return;
456
+ }
457
+ this.pens.push(pen);
458
+ if (pen instanceof Node) {
459
+ Store.set(this.generateStoreKey('LT:activeNode'), pen);
460
+ }
461
+ };
462
+ ActiveLayer.prototype.setPens = function (pens) {
463
+ this.pens = pens;
464
+ if (this.pens.length === 1 && this.pens[0] instanceof Node) {
465
+ Store.set(this.generateStoreKey('LT:activeNode'), this.pens[0]);
466
+ }
467
+ };
468
+ ActiveLayer.prototype.has = function (pen) {
469
+ for (var _i = 0, _a = this.pens; _i < _a.length; _i++) {
470
+ var item = _a[_i];
471
+ if (item.id === pen.id) {
472
+ return true;
473
+ }
474
+ }
475
+ };
476
+ ActiveLayer.prototype.hasInAll = function (pen, pens) {
477
+ if (!pens) {
478
+ pens = this.pens;
479
+ }
480
+ for (var _i = 0, pens_1 = pens; _i < pens_1.length; _i++) {
481
+ var item = pens_1[_i];
482
+ if (item.id === pen.id) {
483
+ return true;
484
+ }
485
+ if (item.children) {
486
+ var has = this.hasInAll(pen, item.children);
487
+ if (has) {
488
+ return true;
489
+ }
490
+ }
491
+ }
492
+ };
493
+ ActiveLayer.prototype.render = function (ctx) {
494
+ var _this = this;
495
+ if (this.data.locked > Lock.Readonly) {
496
+ return;
497
+ }
498
+
499
+ if (!this.pens.length) {
500
+ return;
501
+ }
502
+ this.pens.forEach(function (pen) {
503
+ if (!pen.getTID()) {
504
+ pen.setTID(_this.TID);
505
+ }
506
+ });
507
+ if (this.pens.length === 1 || !this.rotating) {
508
+ this.calcControlPoints();
509
+ }
510
+ ctx.save();
511
+ ctx.strokeStyle = this.options.activeColor;
512
+ ctx.fillStyle = '#fff';
513
+ ctx.lineWidth = 1;
514
+ var TID = this.TID;
515
+ for (var _i = 0, _a = this.pens; _i < _a.length; _i++) {
516
+ var item = _a[_i];
517
+ if (item instanceof Node) {
518
+ var tmp = new Node(item, true);
519
+ tmp.setTID(TID);
520
+ tmp.data = null;
521
+ tmp.fillStyle = null;
522
+ tmp.bkType = 0;
523
+ tmp.icon = '';
524
+ tmp.image = '';
525
+ tmp.text = '';
526
+ if(window.location.pathname.includes('workspace')){
527
+ if (tmp.strokeStyle !== 'transparent') {
528
+ tmp.strokeStyle = '#ffffff';
529
+ tmp.lineWidth += 2;
530
+ tmp.render(ctx);
531
+ tmp.strokeStyle = this.options.activeColor;
532
+ tmp.lineWidth -= 2;
533
+ }
534
+ }
535
+ tmp.render(ctx);
536
+ }
537
+ if (item instanceof Line) {
538
+ var tmp = new Line(item);
539
+ tmp.setTID(TID);
540
+ if (tmp.lineWidth < 3) {
541
+ var bk = new Line(item);
542
+ bk.setTID(TID);
543
+ bk.strokeStyle = '#ffffff';
544
+ bk.render(ctx);
545
+ }
546
+ tmp.strokeStyle = this.options.activeColor;
547
+ tmp.fromArrowColor = this.options.activeColor;
548
+ tmp.toArrowColor = this.options.activeColor;
549
+ tmp.render(ctx);
550
+ if (!this.data.locked && !item.locked) {
551
+ drawLineFns[item.name].drawControlPointsFn(ctx, item);
552
+ }
553
+ }
554
+ }
555
+ if (this.pens.length === 1 && this.pens[0].type === PenType.Line) {
556
+ return;
557
+ }
558
+ // This is diffence between single node and more.
559
+ if (this.rotate && this.pens.length > 1) {
560
+ ctx.translate(this.rect.center.x, this.rect.center.y);
561
+ ctx.rotate((this.rotate * Math.PI) / 180);
562
+ ctx.translate(-this.rect.center.x, -this.rect.center.y);
563
+ }
564
+ // Occupied territory.绘制元件外边拖拽边框
565
+ ctx.save();
566
+ ctx.globalAlpha = 0.3;
567
+ ctx.translate(0.5, 0.5);
568
+ ctx.beginPath();
569
+ ctx.moveTo(this.sizeCPs[0].x, this.sizeCPs[0].y);
570
+ ctx.lineTo(this.sizeCPs[1].x, this.sizeCPs[1].y);
571
+ ctx.lineTo(this.sizeCPs[2].x, this.sizeCPs[2].y);
572
+ ctx.lineTo(this.sizeCPs[3].x, this.sizeCPs[3].y);
573
+ ctx.closePath();
574
+ ctx.stroke();
575
+ ctx.restore();
576
+ if (this.data.locked || this.locked()) {
577
+ ctx.restore();
578
+ return;
579
+ }
580
+ //Draw rotate control point.
581
+ // 绘制连接旋转按钮的线
582
+ ctx.beginPath();
583
+ ctx.moveTo(this.rotateCPs[0].x, this.rotateCPs[0].y);
584
+ ctx.lineTo(this.rotateCPs[1].x, this.rotateCPs[1].y);
585
+ ctx.stroke();
586
+ // 绘制旋转圆圈按钮
587
+ ctx.beginPath();
588
+ ctx.arc(this.rotateCPs[0].x, this.rotateCPs[0].y, 5, 0, Math.PI * 2);
589
+ ctx.fill();
590
+ ctx.stroke();
591
+ // Draw size control points.绘制拖拽框四角的点
592
+ if (!this.options.hideSizeCP && (this.pens.length > 1 || !this.pens[0].hideSizeCP)) {
593
+ ctx.lineWidth = 1;
594
+ for (var _b = 0, _c = this.sizeCPs; _b < _c.length; _b++) {
595
+ var item = _c[_b];
596
+ ctx.save();
597
+ ctx.beginPath();
598
+ if (this.pens.length === 1 && (this.pens[0].rotate || this.rotate)) {
599
+ ctx.translate(item.x, item.y);
600
+ ctx.rotate(((this.pens[0].rotate + this.rotate) * Math.PI) / 180);
601
+ ctx.translate(-item.x, -item.y);
602
+ }
603
+ ctx.fillRect(item.x - 4.5, item.y - 4.5, 8, 8);
604
+ ctx.strokeRect(item.x - 5.5, item.y - 5.5, 10, 10);
605
+ ctx.restore();
606
+ }
607
+ }
608
+ ctx.restore();
609
+ };
610
+ ActiveLayer.prototype.getDockWatchers = function () {
611
+ if (this.pens.length === 1) {
612
+ this.dockWatchers = this.nodeRects[0].toPoints();
613
+ this.dockWatchers.unshift(this.nodeRects[0].center);
614
+ return;
615
+ }
616
+ if (!this.rect) {
617
+ return;
618
+ }
619
+ this.dockWatchers = this.rect.toPoints();
620
+ this.dockWatchers.unshift(this.rect.center);
621
+ };
622
+ ActiveLayer.prototype.handleArbitrayGraphSize = function (type,item, offsetX, offsetY, l, sizeX, sizeY, nodeRectsCircles) {
623
+ if(item.name !== 'arbitraryGraph') return
624
+
625
+ switch (type) {
626
+
627
+ case 0:
628
+
629
+ for(let c=0, length = item.rect.circles.length; c<length; c++ ) {
630
+
631
+ item.rect.circles[c].x=item.rect.circles[c].x*sizeX+item.rect.ex*(1-sizeX);
632
+
633
+ item.rect.circles[c].y=item.rect.circles[c].y*sizeY+item.rect.ey*(1-sizeY);
634
+
635
+ }
636
+
637
+ break;
638
+
639
+ case 1:
640
+
641
+ for(let c=0, length = item.rect.circles.length; c<length; c++ ) {
642
+
643
+ item.rect.circles[c].x=item.rect.circles[c].x*sizeX+item.rect.x*(1-sizeX);
644
+
645
+ item.rect.circles[c].y=item.rect.circles[c].y*sizeY+item.rect.ey*(1-sizeY);
646
+
647
+ }
648
+
649
+ break;
650
+
651
+ case 2:
652
+
653
+ for(let c=0, length = item.rect.circles.length; c<length; c++ ) {
654
+
655
+ item.rect.circles[c].x=item.rect.circles[c].x*sizeX+item.rect.x*(1-sizeX);
656
+
657
+ item.rect.circles[c].y=item.rect.circles[c].y*sizeY+item.rect.y*(1-sizeY);
658
+
659
+ }
660
+
661
+ break;
662
+
663
+ case 3:
664
+
665
+ for(let c=0, length = item.rect.circles.length; c<length; c++ ) {
666
+
667
+ item.rect.circles[c].x=item.rect.circles[c].x*sizeX+item.rect.ex*(1-sizeX);
668
+
669
+ item.rect.circles[c].y=item.rect.circles[c].y*sizeY+item.rect.y*(1-sizeY);
670
+
671
+ }
672
+
673
+ break
674
+ }
675
+ };
676
+ return ActiveLayer;
677
+ }(Layer));
678
+ export { ActiveLayer };
679
+ //# sourceMappingURL=activeLayer.js.map