dcim-topology2d 2.2.3 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. package/activity-diagram/src/final/final.d.ts +1 -1
  2. package/activity-diagram/src/final/final.rect.d.ts +1 -1
  3. package/activity-diagram/src/final/final.rect.js +1 -1
  4. package/activity-diagram/src/fork/fork.anchor.d.ts +1 -1
  5. package/activity-diagram/src/fork/fork.anchor.js +1 -1
  6. package/activity-diagram/src/fork/fork.d.ts +1 -1
  7. package/activity-diagram/src/fork/fork.rect.d.ts +1 -1
  8. package/activity-diagram/src/fork/fork.rect.js +1 -1
  9. package/activity-diagram/src/register.js +1 -1
  10. package/activity-diagram/src/swimlaneH/swimlaneH.d.ts +1 -1
  11. package/activity-diagram/src/swimlaneH/swimlaneH.rect.d.ts +1 -1
  12. package/activity-diagram/src/swimlaneH/swimlaneH.rect.js +1 -1
  13. package/activity-diagram/src/swimlaneV/swimlaneV.d.ts +1 -1
  14. package/activity-diagram/src/swimlaneV/swimlaneV.rect.d.ts +1 -1
  15. package/activity-diagram/src/swimlaneV/swimlaneV.rect.js +1 -1
  16. package/chart-diagram/index.d.ts +1 -3
  17. package/chart-diagram/index.js +1 -2
  18. package/chart-diagram/src/echarts/index.d.ts +2 -1
  19. package/chart-diagram/src/echarts/index.js +78 -86
  20. package/chart-diagram/src/register.js +8 -9
  21. package/class-diagram/src/class/class.d.ts +1 -1
  22. package/class-diagram/src/class/class.rect.d.ts +1 -1
  23. package/class-diagram/src/class/class.rect.js +1 -1
  24. package/class-diagram/src/register.js +1 -1
  25. package/core/index.d.ts +0 -2
  26. package/core/index.js +18 -2
  27. package/core/src/activeLayer.d.ts +10 -2
  28. package/core/src/activeLayer.js +62 -57
  29. package/core/src/animateLayer.d.ts +7 -3
  30. package/core/src/animateLayer.js +12 -10
  31. package/core/src/calling.d.ts +4 -1
  32. package/core/src/calling.js +68 -69
  33. package/core/src/canvas.d.ts +6 -1
  34. package/core/src/canvas.js +21 -22
  35. package/core/src/common.d.ts +7 -7
  36. package/core/src/common.js +698 -397
  37. package/core/src/core.d.ts +4 -5
  38. package/core/src/core.js +385 -536
  39. package/core/src/divLayer.d.ts +36 -2
  40. package/core/src/divLayer.js +305 -33
  41. package/core/src/healps/changeData.d.ts +2 -1
  42. package/core/src/healps/changeData.js +100 -89
  43. package/core/src/hoverLayer.d.ts +9 -2
  44. package/core/src/hoverLayer.js +34 -31
  45. package/core/src/middles/default.d.ts +3 -1
  46. package/core/src/middles/default.js +51 -65
  47. package/core/src/middles/index.d.ts +2 -1
  48. package/core/src/middles/index.js +2 -4
  49. package/core/src/middles/nodes/arbitrarygraph.js +9 -11
  50. package/core/src/middles/nodes/pentagon.rect.js +1 -1
  51. package/core/src/middles/nodes/rectangle.js +15 -54
  52. package/core/src/middles/nodes/rectangle.rect.js +1 -1
  53. package/core/src/models/data.d.ts +26 -0
  54. package/core/src/models/data.js +77 -0
  55. package/core/src/models/data.js.map +1 -0
  56. package/core/src/models/index.d.ts +1 -0
  57. package/core/src/models/index.js +1 -0
  58. package/core/src/models/line.js +7 -7
  59. package/core/src/models/node.d.ts +0 -10
  60. package/core/src/models/node.js +101 -155
  61. package/core/src/models/pen.js +68 -37
  62. package/core/src/models/rect.js +2 -2
  63. package/core/src/mqtt.d.ts +14 -0
  64. package/core/src/mqtt.js +82 -0
  65. package/core/src/mqtt.js.map +1 -0
  66. package/core/src/offscreen.d.ts +4 -1
  67. package/core/src/offscreen.js +24 -26
  68. package/core/src/options.d.ts +1 -3
  69. package/core/src/options.js +0 -2
  70. package/core/src/poll.js +39 -0
  71. package/core/src/preview.d.ts +13 -2
  72. package/core/src/preview.js +54 -181
  73. package/core/src/renderLayer.d.ts +9 -11
  74. package/core/src/renderLayer.js +61 -60
  75. package/core/src/socket.d.ts +10 -0
  76. package/core/src/socket.js +51 -0
  77. package/core/src/socket.js.map +1 -0
  78. package/core/src/utils/canvas.js +1 -1
  79. package/core/src/utils/construction.d.ts +3 -36
  80. package/core/src/utils/construction.js +1 -29
  81. package/core/src/utils/conversion.d.ts +0 -15
  82. package/core/src/utils/conversion.js +0 -319
  83. package/core/src/utils/dom.d.ts +8 -0
  84. package/core/src/utils/dom.js +67 -0
  85. package/core/src/utils/dom.js.map +1 -0
  86. package/core/src/utils/index.d.ts +1 -2
  87. package/core/src/utils/index.js +1 -2
  88. package/core/src/utils/onmousevent.d.ts +0 -3
  89. package/core/src/utils/onmousevent.js +10 -42
  90. package/flow-diagram/src/comment/comment.anchor.d.ts +1 -1
  91. package/flow-diagram/src/comment/comment.anchor.js +1 -1
  92. package/flow-diagram/src/comment/comment.d.ts +1 -1
  93. package/flow-diagram/src/data/data.anchor.d.ts +1 -1
  94. package/flow-diagram/src/data/data.anchor.js +1 -1
  95. package/flow-diagram/src/data/data.d.ts +1 -1
  96. package/flow-diagram/src/data/data.rect.d.ts +1 -1
  97. package/flow-diagram/src/data/data.rect.js +1 -1
  98. package/flow-diagram/src/db/db.d.ts +1 -1
  99. package/flow-diagram/src/db/db.rect.d.ts +1 -1
  100. package/flow-diagram/src/db/db.rect.js +1 -1
  101. package/flow-diagram/src/display/display.anchor.d.ts +1 -1
  102. package/flow-diagram/src/display/display.anchor.js +1 -1
  103. package/flow-diagram/src/display/display.d.ts +1 -1
  104. package/flow-diagram/src/display/display.rect.d.ts +1 -1
  105. package/flow-diagram/src/display/display.rect.js +1 -1
  106. package/flow-diagram/src/document/document.anchor.d.ts +1 -1
  107. package/flow-diagram/src/document/document.anchor.js +1 -1
  108. package/flow-diagram/src/document/document.d.ts +1 -1
  109. package/flow-diagram/src/document/document.rect.d.ts +1 -1
  110. package/flow-diagram/src/document/document.rect.js +1 -1
  111. package/flow-diagram/src/externStorage/externStorage.anchor.d.ts +1 -1
  112. package/flow-diagram/src/externStorage/externStorage.anchor.js +1 -1
  113. package/flow-diagram/src/externStorage/externStorage.d.ts +1 -1
  114. package/flow-diagram/src/externStorage/externStorage.rect.d.ts +1 -1
  115. package/flow-diagram/src/externStorage/externStorage.rect.js +1 -1
  116. package/flow-diagram/src/internalStorage/internalStorage.d.ts +1 -1
  117. package/flow-diagram/src/internalStorage/internalStorage.rect.d.ts +1 -1
  118. package/flow-diagram/src/internalStorage/internalStorage.rect.js +1 -1
  119. package/flow-diagram/src/manually/manually.anchor.d.ts +1 -1
  120. package/flow-diagram/src/manually/manually.anchor.js +1 -1
  121. package/flow-diagram/src/manually/manually.d.ts +1 -1
  122. package/flow-diagram/src/manually/manually.rect.d.ts +1 -1
  123. package/flow-diagram/src/manually/manually.rect.js +1 -1
  124. package/flow-diagram/src/parallel/parallel.anchor.d.ts +1 -1
  125. package/flow-diagram/src/parallel/parallel.anchor.js +1 -1
  126. package/flow-diagram/src/parallel/parallel.d.ts +1 -1
  127. package/flow-diagram/src/queue/queue.d.ts +1 -1
  128. package/flow-diagram/src/queue/queue.rect.d.ts +1 -1
  129. package/flow-diagram/src/queue/queue.rect.js +1 -1
  130. package/flow-diagram/src/register.js +1 -1
  131. package/flow-diagram/src/subprocess/subprocess.d.ts +1 -1
  132. package/flow-diagram/src/subprocess/subprocess.rect.d.ts +1 -1
  133. package/flow-diagram/src/subprocess/subprocess.rect.js +1 -1
  134. package/layout/src/align.d.ts +1 -1
  135. package/layout/src/align.js +1 -1
  136. package/layout/src/layout.d.ts +1 -1
  137. package/layout/src/layout.js +1 -1
  138. package/myShape-diagram/{index.js → myShape.js} +1 -4
  139. package/package.json +1 -1
  140. package/sequence-diagram/src/focus/focus.anchor.d.ts +1 -1
  141. package/sequence-diagram/src/focus/focus.anchor.js +1 -1
  142. package/sequence-diagram/src/focus/focus.d.ts +1 -1
  143. package/sequence-diagram/src/focus/focus.rect.d.ts +1 -1
  144. package/sequence-diagram/src/focus/focus.rect.js +1 -1
  145. package/sequence-diagram/src/lifeline/lifeline.anchor.d.ts +1 -1
  146. package/sequence-diagram/src/lifeline/lifeline.anchor.js +1 -1
  147. package/sequence-diagram/src/lifeline/lifeline.d.ts +1 -1
  148. package/sequence-diagram/src/lifeline/lifeline.rect.d.ts +1 -1
  149. package/sequence-diagram/src/lifeline/lifeline.rect.js +1 -1
  150. package/sequence-diagram/src/register.js +1 -1
  151. package/chart-diagram/src/utils/changeOptions.d.ts +0 -8
  152. package/chart-diagram/src/utils/changeOptions.js +0 -273
  153. package/chart-diagram/src/utils/conversion.d.ts +0 -19
  154. package/chart-diagram/src/utils/conversion.js +0 -601
  155. package/chart-diagram/src/utils/drawGraphic.d.ts +0 -3
  156. package/chart-diagram/src/utils/drawGraphic.js +0 -97
  157. package/chart-diagram/src/utils/formatter.d.ts +0 -1
  158. package/chart-diagram/src/utils/formatter.js +0 -206
  159. package/chart-diagram/src/utils/index.d.ts +0 -5
  160. package/chart-diagram/src/utils/index.js +0 -5
  161. package/chart-diagram/src/utils/render.d.ts +0 -8
  162. package/chart-diagram/src/utils/render.js +0 -223
  163. package/chart-diagram/src/utils/surfaceParametricConversion.d.ts +0 -3
  164. package/chart-diagram/src/utils/surfaceParametricConversion.js +0 -252
  165. package/core/src/element/common.d.ts +0 -6
  166. package/core/src/element/common.js +0 -62
  167. package/core/src/element/datePicker.d.ts +0 -3
  168. package/core/src/element/datePicker.js +0 -44
  169. package/core/src/element/iframe.d.ts +0 -3
  170. package/core/src/element/iframe.js +0 -12
  171. package/core/src/element/index.d.ts +0 -5
  172. package/core/src/element/index.js +0 -6
  173. package/core/src/element/select.d.ts +0 -11
  174. package/core/src/element/select.js +0 -273
  175. package/core/src/element/tab.d.ts +0 -1
  176. package/core/src/element/tab.js +0 -20
  177. package/core/src/element/time.d.ts +0 -3
  178. package/core/src/element/time.js +0 -44
  179. package/core/src/middles/arrows/index.d.ts +0 -4
  180. package/core/src/middles/arrows/index.js +0 -5
  181. package/core/src/middles/lines/index.d.ts +0 -4
  182. package/core/src/middles/lines/index.js +0 -5
  183. package/core/src/middles/nodes/formDatePicker.d.ts +0 -2
  184. package/core/src/middles/nodes/formDatePicker.js +0 -108
  185. package/core/src/middles/nodes/formoverflow.js +0 -62
  186. package/core/src/middles/nodes/formselect.d.ts +0 -2
  187. package/core/src/middles/nodes/formselect.js +0 -111
  188. package/core/src/middles/nodes/iframe.d.ts +0 -2
  189. package/core/src/middles/nodes/iframe.js +0 -29
  190. package/core/src/middles/nodes/index.d.ts +0 -52
  191. package/core/src/middles/nodes/index.js +0 -54
  192. package/core/src/middles/nodes/progress.d.ts +0 -2
  193. package/core/src/middles/nodes/progress.js +0 -63
  194. package/core/src/middles/nodes/progress.js.map +0 -1
  195. package/core/src/middles/nodes/switchs.d.ts +0 -2
  196. package/core/src/middles/nodes/switchs.js +0 -46
  197. package/core/src/middles/nodes/time.d.ts +0 -2
  198. package/core/src/middles/nodes/time.js +0 -98
  199. package/core/src/store/common.d.ts +0 -9
  200. package/core/src/store/common.js +0 -5
  201. package/core/src/store/data.d.ts +0 -205
  202. package/core/src/store/data.js +0 -198
  203. package/core/src/store/index.d.ts +0 -2
  204. package/core/src/store/index.js +0 -2
  205. package/core/src/utils/assignment.d.ts +0 -7
  206. package/core/src/utils/assignment.js +0 -229
  207. package/core/src/utils/params.d.ts +0 -3
  208. package/core/src/utils/params.js +0 -136
  209. package/static/echartsDefaultData.js +0 -178
  210. package/static/element.js +0 -14
  211. package/static/form.js +0 -11
  212. package/static/index.js +0 -3
  213. package/store/actions.js +0 -2
  214. package/store/clear.js +0 -14
  215. package/store/default.js +0 -22
  216. package/store/index.js +0 -3
  217. package/style/common.css +0 -15
  218. package/style/datePicker.css +0 -44
  219. package/style/editor.css +0 -16
  220. package/style/index.css +0 -5
  221. package/style/select.css +0 -143
  222. /package/myShape-diagram/{index.d.ts → myShape.ts} +0 -0
@@ -1,29 +0,0 @@
1
- import {rectangle} from './rectangle';
2
- import {s8} from "../../utils";
3
- import {createIframeElement} from "../../element";
4
- import {commonStore} from "../../store";
5
-
6
- export function iframePrimeval(ctx, node) {
7
- //console.log('iframePrimeval############', node)
8
- // 绘制一个底图,类似于占位符。
9
- rectangle(ctx, node);
10
- if (!commonStore[node.TID].iframeDataPool[node.id]) {
11
- node.elementId = s8();
12
- commonStore[node.TID].iframeDataPool[node.id] = {
13
- node: {
14
- id: node.id,
15
- src: node.iframe
16
- }
17
- };
18
- const iframe = createIframeElement(node);
19
- commonStore[node.TID].iframeDataPool[node.id].iframe = iframe;
20
- const parentEle = window.location.pathname.includes('workspace') ? document.getElementById('topology-canvas') : document.body;
21
- parentEle.appendChild(iframe);
22
- // 添加当前节点到div层
23
- node.addToDiv();
24
- }else {
25
- const iframeNode = commonStore[node.TID].iframeDataPool[node.id];
26
- if(iframeNode.node.src === node.iframe) return;
27
- iframeNode.iframe.src = node.iframe;
28
- }
29
- }
@@ -1,52 +0,0 @@
1
- export * from './arbitrarygraph';
2
- export * from './arbitrarygraph.anchor';
3
- export * from './arrow';
4
- export * from './arrow.rect';
5
- export * from './arrow.anchor';
6
- export * from './circle';
7
- export * from './circle.rect';
8
- export * from './circle.anchor';
9
- export * from './cloud';
10
- export * from './cloud.rect';
11
- export * from './cloud.anchor';
12
- export * from './cube';
13
- export * from './cube.rect';
14
- export * from './cube.anchor';
15
- export * from './cube.model';
16
- export * from './diamond';
17
- export * from './diamond.rect';
18
- export * from './file';
19
- export * from './formtable';
20
- export * from './formselect';
21
- export * from './hexagon';
22
- export * from './hexagon.anchor';
23
- export * from './hexagon.rect';
24
- export * from './image.rect';
25
- export * from './image.anchor';
26
- export * from './iframe';
27
- export * from './line';
28
- export * from './line.anchor';
29
- export * from './line.rect';
30
- export * from './message';
31
- export * from './message.anchor';
32
- export * from './message.rect';
33
- export * from './pentagon';
34
- export * from './pentagon.anchor';
35
- export * from './pentagon.rect';
36
- export * from './pentagram';
37
- export * from './pentagram.anchor';
38
- export * from './pentagram.rect';
39
- export * from './people';
40
- export * from './people.rect';
41
- export * from './rectangle';
42
- export * from './rectangle.rect';
43
- export * from './tablePagination';
44
- export * from './text';
45
- export * from './triangle';
46
- export * from './triangle.anchor';
47
- export * from './triangle.rect';
48
- export * from './formoverflow';
49
- export * from './time';
50
- export * from './formDatePicker';
51
- export * from './switchs';
52
- export * from './progress';
@@ -1,54 +0,0 @@
1
- export * from './arbitrarygraph';
2
- export * from './arbitrarygraph.anchor';
3
- export * from './arrow';
4
- export * from './arrow.rect';
5
- export * from './arrow.anchor';
6
- export * from './circle';
7
- export * from './circle.rect';
8
- export * from './circle.anchor';
9
- export * from './cloud';
10
- export * from './cloud.rect';
11
- export * from './cloud.anchor';
12
- export * from './cube';
13
- export * from './cube.rect';
14
- export * from './cube.anchor';
15
- export * from './cube.model';
16
- export * from './diamond';
17
- export * from './diamond.rect';
18
- export * from './file';
19
- export * from './formtable';
20
- export * from './formselect';
21
- export * from './hexagon';
22
- export * from './hexagon.anchor';
23
- export * from './hexagon.rect';
24
- export * from './image.rect';
25
- export * from './image.anchor';
26
- export * from './iframe';
27
- export * from './line';
28
- export * from './line.anchor';
29
- export * from './line.rect';
30
- export * from './message';
31
- export * from './message.anchor';
32
- export * from './message.rect';
33
- export * from './pentagon';
34
- export * from './pentagon.anchor';
35
- export * from './pentagon.rect';
36
- export * from './pentagram';
37
- export * from './pentagram.anchor';
38
- export * from './pentagram.rect';
39
- export * from './people';
40
- export * from './people.rect';
41
- export * from './rectangle';
42
- export * from './rectangle.rect';
43
- export * from './tablePagination';
44
- export * from './text';
45
- export * from './triangle';
46
- export * from './triangle.anchor';
47
- export * from './triangle.rect';
48
- export * from './formoverflow';
49
- export * from './time';
50
- export * from './formDatePicker';
51
- export * from './switchs';
52
- export * from './progress';
53
-
54
- //# sourceMappingURL=index.js.map
@@ -1,2 +0,0 @@
1
- import { Node } from "../../models";
2
- export default function progress(ctx: CanvasRenderingContext2D, node: Node): void;
@@ -1,63 +0,0 @@
1
- export function progress(ctx, node) {
2
-
3
- var wr = node.borderRadius;
4
- var hr = node.borderRadius;
5
- if (node.borderRadius < 1) {
6
- wr = node.rect.width * node.borderRadius;
7
- hr = node.rect.height * node.borderRadius;
8
- }
9
- var r = wr < hr ? wr : hr;
10
- if (node.rect.width < 2 * r) {
11
- r = node.rect.width / 2;
12
- }
13
- if (node.rect.height < 2 * r) {
14
- r = node.rect.height / 2;
15
- }
16
- //进度条背景
17
- ctx.beginPath();
18
- ctx.moveTo(node.rect.x + r, node.rect.y);
19
- ctx.arcTo(node.rect.x + node.rect.width, node.rect.y, node.rect.x + node.rect.width, node.rect.y + node.rect.height, r);
20
- ctx.arcTo(node.rect.x + node.rect.width, node.rect.y + node.rect.height, node.rect.x, node.rect.y + node.rect.height, r);
21
- ctx.arcTo(node.rect.x, node.rect.y + node.rect.height, node.rect.x, node.rect.y, r);
22
- ctx.arcTo(node.rect.x, node.rect.y, node.rect.x + node.rect.width, node.rect.y, r);
23
- ctx.closePath();
24
- ctx.fillStyle = node.fillStyle;
25
- node.fillStyle && ctx.fill();
26
- ctx.stroke();
27
- ctx.restore();
28
- //绘制进度条
29
- let maxValue = node.maxValue || 100;
30
- let percent = node.value / maxValue > 1 ? 1 : node.value / maxValue;
31
- let gradient = ctx.createLinearGradient(node.rect.x, node.rect.y, node.rect.x + node.rect.width * percent, node.rect.y);
32
- gradient.addColorStop(0, node.strokeStyle || 'red'); // 开始色
33
- gradient.addColorStop(1, node.visitStrokeStyle || 'blue'); // 结束色
34
-
35
- ctx.beginPath();
36
- ctx.moveTo(node.rect.x + r, node.rect.y);
37
- ctx.arcTo(node.rect.x + node.rect.width * percent, node.rect.y, node.rect.x + node.rect.width * percent, node.rect.y + node.rect.height, r);
38
- ctx.arcTo(node.rect.x + node.rect.width * percent, node.rect.y + node.rect.height, node.rect.x, node.rect.y + node.rect.height, r);
39
- ctx.arcTo(node.rect.x, node.rect.y + node.rect.height, node.rect.x, node.rect.y, r);
40
- ctx.arcTo(node.rect.x, node.rect.y, node.rect.x + node.rect.width * percent, node.rect.y, r);
41
- ctx.closePath();
42
- ctx.fillStyle = gradient;
43
- node.strokeStyle && ctx.fill();
44
-
45
- //绘制数值
46
- ctx.font = '' + node.font.fontSize + "px " + node.font.fontFamily;
47
- ctx.textBaseline = 'middle';
48
- //计算文字的长度 如果超出了100% 那么从右侧开始写 防止溢出 样式错乱
49
- ctx.fillStyle = node.font.color;
50
- //保留小数位数
51
- let text = parseFloat((percent * 100).toFixed(node.retationDecimalPlaces || 0)) + (node.isShowPercent ? '%' : '');
52
- let tWidth = ctx.measureText(text).width;
53
- if ((tWidth + node.rect.width * percent + 5) > node.rect.width) { //如果溢出
54
- ctx.fillText(text, node.rect.x + node.rect.width - tWidth - 5, node.rect.y + node.rect.height / 2);
55
-
56
- } else {
57
- ctx.fillText(text, node.rect.x + node.rect.width * percent + 5, node.rect.y + node.rect.height / 2);
58
- }
59
-
60
-
61
- ctx.fillStyle = "#fff"
62
- }
63
- //# sourceMappingURL=progress.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"progress.js","sourceRoot":"","sources":["progress.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,GAA6B,EAAE,IAAU;IACtE,IAAI,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC;IAC3B,IAAI,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC;IAC3B,IAAI,IAAI,CAAC,YAAY,GAAG,CAAC,EAAE;QACvB,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC;QACzC,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC;KAC7C;IACD,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1B,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,GAAG,CAAC,EAAE;QACzB,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;KAC3B;IACD,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,EAAE;QAC1B,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;KAC5B;IACD,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACzC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IACxH,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IACzH,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACpF,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACnF,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9C,GAAG,CAAC,MAAM,EAAE,CAAC;AACjB,CAAC"}
@@ -1,2 +0,0 @@
1
- import { Node } from 'dcim-topology2d/core/src/models';
2
- export declare function switchs(ctx: CanvasRenderingContext2D, node: Node): void;
@@ -1,46 +0,0 @@
1
- export function switchs(ctx, node) {
2
-
3
- let x = node.rect.x;
4
- let y = node.rect.y;
5
- let width = node.rect.width;
6
- let height = node.rect.height;
7
- // 绘制圆角
8
- var wr = node.borderRadius;
9
- var hr = node.borderRadius;
10
- if (node.borderRadius < 1) {
11
- wr = node.rect.width * node.borderRadius;
12
- hr = node.rect.height * node.borderRadius;
13
- }
14
- var r = wr < hr ? wr : hr;
15
- if (node.rect.width < 2 * r) {
16
- r = node.rect.width / 2;
17
- }
18
- if (node.rect.height < 2 * r) {
19
- r = node.rect.height / 2;
20
- }
21
- //绘制椭圆
22
- ctx.fillStyle = node.fillStyle;
23
- ctx.beginPath();
24
- ctx.moveTo(x + r, y);
25
- ctx.lineTo(x + width - r, y);
26
- ctx.quadraticCurveTo(x + width, y, x + width, y + r);
27
- ctx.lineTo(x + width, y + height - r);
28
- ctx.quadraticCurveTo(x + width, y + height, x + width - r, y + height);
29
- ctx.lineTo(x + r, y + height);
30
- ctx.quadraticCurveTo(x, y + height, x, y + height - r);
31
- ctx.lineTo(x, y + r);
32
- ctx.quadraticCurveTo(x, y, x + r, y);
33
- ctx.lineTo(x + width - r, y);
34
- ctx.closePath();
35
- node.fillStyle && ctx.fill();
36
- ctx.stroke();
37
-
38
- //绘制左侧 小圆 默认在右侧 isOpen:true
39
- ctx.beginPath();
40
- let cx = node.isOpen ? x + width - height * 0.5 : x + height * 0.5;
41
- ctx.ellipse(cx, y + height * 0.5, height / 2 * 0.8, height / 2 * 0.8, 0, 0, Math.PI * 2);
42
- ctx.fillStyle = '#ffffff';
43
- ctx.closePath();
44
- ctx.fill();
45
- ctx.stroke();
46
- }
@@ -1,2 +0,0 @@
1
- import { Node } from '../../models';
2
- export declare function time(ctx: CanvasRenderingContext2D, node: Node): void;
@@ -1,98 +0,0 @@
1
- export function time(ctx, node) {
2
- var wr = node.borderRadius;
3
- var hr = node.borderRadius;
4
- if (node.borderRadius < 1) {
5
- wr = node.rect.width * node.borderRadius;
6
- hr = node.rect.height * node.borderRadius;
7
- }
8
- var r = wr < hr ? wr : hr;
9
- if (node.rect.width < 2 * r) {
10
- r = node.rect.width / 2;
11
- }
12
- if (node.rect.height < 2 * r) {
13
- r = node.rect.height / 2;
14
- }
15
-
16
- // 背景
17
- let x = node.rect.x;
18
- let y = node.rect.y;
19
- let width = node.rect.width * 0.29;
20
- let height = node.rect.height;
21
- let gap = node.rect.width * 0.065;
22
- let {h, m, s} = node.time;
23
-
24
- //绘制时
25
- drawText(ctx, r, x, y, width, height, h, node, gap)
26
-
27
- //绘制分
28
- drawText(ctx, r, x+width+gap, y, width, height, m, node, gap)
29
-
30
- //绘制秒
31
- drawText(ctx, r, x+(width*2 + gap*2), y, width, height, s, node)
32
-
33
- //恢复填充色
34
- ctx.fillStyle = "#ffffff";
35
-
36
-
37
- }
38
-
39
- function drawText(ctx, r, x, y, width, height, hText, node, gap) {
40
-
41
- //文字
42
- let textfillStyle = node.font.color || "#ffffff";
43
- let textBackground = node.font.background || '#ffffff1a';
44
- ctx.font = '' + node.font.fontSize +"px " + node.font.fontFamily;
45
- ctx.textBaseline = 'middle';
46
- ctx.textAlign = 'center';
47
-
48
- const centerX = width / 2;
49
- const centerY = height / 2;
50
- //绘制上半部分
51
- ctx.save();
52
- ctx.beginPath();
53
- ctx.fillStyle = textBackground;
54
- ctx.beginPath();
55
- ctx.moveTo(x + r, y);
56
- ctx.lineTo(x + width -r, y);
57
- ctx.quadraticCurveTo(x + width, y, x+width, y+r);
58
- ctx.lineTo(x+width, y + height/2 - 1);
59
- ctx.lineTo(x, y + height/2 - 1);
60
- ctx.lineTo(x, y+r);
61
- ctx.quadraticCurveTo(x, y, x+r, y);
62
- ctx.fill();
63
- ctx.clip();
64
-
65
- ctx.fillStyle = textfillStyle;
66
- ctx.fillText(hText, x+centerX, y+centerY);
67
- ctx.restore();
68
- //绘制下半部分
69
- ctx.save();
70
- ctx.beginPath();
71
- ctx.fillStyle = textBackground;
72
- ctx.moveTo(x, y+height/2+1);
73
- ctx.lineTo(x+width, y+height/2+1);
74
- ctx.lineTo(x+width, y+height-r);
75
- ctx.quadraticCurveTo(x+width, y+height, x+width-r, y+height);
76
- ctx.lineTo(x+r, y+height);
77
- ctx.quadraticCurveTo(x, y+height, x, y+height-r);
78
- ctx.lineTo(x, y+height/2+2);
79
- ctx.fill();
80
- ctx.clip();
81
-
82
- ctx.fillStyle = textfillStyle;
83
- ctx.fillText(hText, x+centerX, y+centerY);
84
- ctx.restore();
85
-
86
- //绘制冒号
87
- if(!gap) return
88
-
89
- ctx.fillStyle = textfillStyle;
90
- ctx.textBaseline = 'middle';
91
- ctx.textAlign = 'center';
92
- let metricss = ctx.measureText(":");
93
- const fontHeights = metricss.actualBoundingBoxAscent + metricss.actualBoundingBoxDescent;
94
- const centerYY = y + (height / 2) + (metricss.actualBoundingBoxAscent - fontHeights / 2);
95
- ctx.fillText(":", x+width+(gap/2), centerYY);
96
- ctx.restore();
97
-
98
- }
@@ -1,9 +0,0 @@
1
- import { Pen } from '../models';
2
- // @ts-ignore
3
- export const commonStore: {
4
- canvasDraws: {
5
- [key: string]: (ctx: CanvasRenderingContext2D, pen: Pen) => void;
6
- };
7
- anchors: { [key: string]: (pen: Pen) => void };
8
- htmlElements: { [key: string]: HTMLDivElement }; // html元素
9
- };
@@ -1,5 +0,0 @@
1
- export var commonStore = {
2
- canvasDraws: {},
3
- anchors: {},
4
- htmlElements: {}
5
- };
@@ -1,205 +0,0 @@
1
- // @ts-ignore
2
- import { default as mitt, Emitter } from 'mitt';
3
- import { Pen, Lock } from '../models';
4
- import {Options, DefalutOptions} from '../options';
5
- import {s8} from '../utils';
6
- import { commonStore } from './common'
7
- // 2D可视化的data数据
8
- export interface visualization2DData {
9
- pens: Pen[];
10
- lineName: string;
11
- fromArrowType: string;
12
- toArrowType: string;
13
- scale: number;
14
- pageZoom: number,
15
- pageType: number,
16
- locked: Lock;
17
- bkImage: string;
18
- bkColor: string;
19
- grid?: boolean;
20
- websocket?: string;
21
- mqttUrl?: string;
22
- tabsContentOptions?: {},
23
- mqttOptions?: {
24
- clientId?: string;
25
- username?: string;
26
- password?: string;
27
- };
28
- mqttTopics?: string;
29
- manualCps?: boolean;
30
- dataConstruct?: any;
31
- bindDataTooltipVisible?: boolean;
32
- data?: any;
33
- bkImageRect?: any;
34
- }
35
- export interface paramsData {
36
- doorIds?: [],
37
- tagIds?: [],
38
- kpiAddrs?: [],
39
- tagEcharts?: [],
40
- assetIds?: [],
41
- areaIds?: [],
42
- varVaule?: [],
43
- branchValue?: [],
44
- echartData?: [],
45
- dataConfig?: {},
46
- echartAssemblyData?: [],
47
- routingkey?: string,
48
- pathRewrite?: string
49
- }
50
- // 2D可视化使用到的数据仓库
51
- export interface visualization2DStore {
52
- id: string;
53
- data: visualization2DData;
54
- mqttData?: null; // mqtt实时数据
55
- initConfNode: {}; // 初始化元件节点数据
56
- mqttParams: paramsData; // mqtt参数
57
- pens: { [key: string]: Pen };
58
- options: Options;
59
- cacheDatas?: {
60
- data: visualization2DData;
61
- }[];
62
- // @ts-ignore
63
- tabsPageMasterData: Map<string, any>;
64
- elementInteractivePoor: {}; // element 交互过渡数据
65
- pickerDataPool: {}; // datePicker 交互数据池
66
- echartsDataPool: {}; // echarts Dom节点数据
67
- echartsOptionsPool: {}; // echarts options节点数据
68
- echartsRealDataPool: {}; // echarts 实时数据
69
- switchTabDataPool: {}; // tabs
70
- tableDataPool: {}; // form table
71
- selectDataPool: {}; // form select
72
- selectRealDataPool: {}; // form select
73
- selectTabDataPool: {}; // form select
74
- iframeDataPool: {}; // iframe
75
- formoverDataPool: {}; // 滚动组件 Dom节点数据
76
- formoverCanvasDataPool: {}; // 滚动组件 画布节点数据
77
- emitter: Emitter;
78
- dpiRatio?: number;
79
- lastScale?: number; //记录上次模版的scale
80
- monitorAlarm?:boolean; // 全局报警标记,代表正在访问的这个topology文件中是否有告警发生
81
- parentElem: HTMLElement
82
- }
83
- // @ts-ignore
84
- export const createStore = () => {
85
- // @ts-ignore
86
- // @ts-ignore
87
- return {
88
- id: '',
89
- data: {
90
- pens: [],
91
- lineName: 'curve',
92
- fromArrowType: '',
93
- toArrowType: 'triangleSolid',
94
- scale: 1,
95
- pageZoom: 1,
96
- pageType: 0,
97
- tabsContentOptions: {},
98
- locked: Lock.None,
99
- bkImageRect: null,
100
- mqttOptions: {
101
- clientId: s8()
102
- },
103
- dataConstruct: {},
104
- bindDataTooltipVisible: true
105
- },
106
- mqttData: null,
107
- initConfNode: {},
108
- mqttParams: {
109
- doorIds: [],
110
- tagIds: [],
111
- kpiAddrs: [],
112
- tagEcharts: [],
113
- assetIds: [],
114
- areaIds: [],
115
- varVaule: [],
116
- branchValue: [],
117
- echartData: [],
118
- dataConfig: {},
119
- echartAssemblyData: [],
120
- routingkey: '',
121
- pathRewrite: ''
122
- },
123
- pens: {},
124
- options: { ...DefalutOptions },
125
- elementInteractivePoor: {}, // element 交互过渡数据
126
- pickerDataPool: {}, // datePicker 交互数据池
127
- echartsDataPool: {}, // echarts Dom节点数据
128
- echartsOptionsPool: {}, // echarts options节点数据
129
- echartsRealDataPool: {}, // echarts 实时数据
130
- switchTabDataPool: {}, // tabs
131
- tableDataPool: {}, // form table
132
- selectDataPool: {}, // form select
133
- selectRealDataPool: {}, // form select
134
- selectTabDataPool: {}, // form select
135
- iframeDataPool: {}, // iframe
136
- formoverDataPool: {}, // 滚动组件 Dom节点数据
137
- formoverCanvasDataPool: {}, // 滚动组件 画布节点数据
138
- emitter: mitt(),
139
- cacheDatas: [],
140
- dpiRatio: 1,
141
- lastScale: 1,
142
- monitorAlarm: false,
143
- parentElem: null
144
- } as visualization2DStore;
145
- };
146
- // @ts-ignore
147
- export const useStore = (id = 'default'): visualization2DStore => {
148
- if (!commonStore[id]) {
149
- // @ts-ignore
150
- commonStore[id] = createStore();
151
- commonStore[id].id = id;
152
- }
153
- return commonStore[id];
154
- };
155
- export declare function clearElementDataPool(data: {}): void;
156
- // @ts-ignore
157
- export const clearStore = (store: visualization2DStore, del: string) => {
158
- store.data = {
159
- bkColor: '',
160
- bkImage: '',
161
- data: undefined,
162
- grid: false,
163
- manualCps: false,
164
- mqttTopics: '',
165
- mqttUrl: '',
166
- websocket: '',
167
- pens: [],
168
- lineName: 'curve',
169
- fromArrowType: '',
170
- toArrowType: 'triangleSolid',
171
- scale: 1,
172
- pageZoom: 1,
173
- pageType: 0,
174
- locked: Lock.None,
175
- bkImageRect: null,
176
- mqttOptions: {
177
- clientId: s8()
178
- },
179
- dataConstruct: {},
180
- bindDataTooltipVisible: true
181
- };
182
- store.mqttData = null;
183
- store.initConfNode = {};
184
- store.mqttParams = {
185
- doorIds: [],
186
- tagIds: [],
187
- kpiAddrs: [],
188
- tagEcharts: [],
189
- assetIds: [],
190
- areaIds: [],
191
- varVaule: [],
192
- branchValue: [],
193
- echartData: [],
194
- echartAssemblyData: [],
195
- routingkey: '',
196
- pathRewrite: ''
197
- };
198
- store.lastScale = store.data.scale;
199
- store.pens = {};
200
- store.options = {};
201
- store.cacheDatas = [];
202
- store.dpiRatio = 1;
203
- store.lastScale = 1;
204
- store.monitorAlarm = false;
205
- };