dcim-topology2d 2.0.7 → 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 (204) 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 +104 -106
  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 +0 -2
  27. package/core/src/activeLayer.d.ts +10 -2
  28. package/core/src/activeLayer.js +47 -42
  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 +41 -43
  33. package/core/src/canvas.d.ts +6 -1
  34. package/core/src/canvas.js +18 -18
  35. package/core/src/common.d.ts +7 -6
  36. package/core/src/common.js +672 -333
  37. package/core/src/core.d.ts +4 -3
  38. package/core/src/core.js +367 -466
  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 +66 -32
  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 -53
  47. package/core/src/middles/index.js +2 -3
  48. package/core/src/middles/nodes/arbitrarygraph.js +9 -11
  49. package/core/src/middles/nodes/pentagon.rect.js +1 -1
  50. package/core/src/middles/nodes/rectangle.rect.js +1 -1
  51. package/core/src/models/data.d.ts +26 -0
  52. package/core/src/models/data.js +77 -0
  53. package/core/src/models/data.js.map +1 -0
  54. package/core/src/models/index.d.ts +1 -0
  55. package/core/src/models/index.js +1 -0
  56. package/core/src/models/node.d.ts +0 -10
  57. package/core/src/models/node.js +32 -54
  58. package/core/src/models/pen.js +59 -19
  59. package/core/src/models/rect.js +2 -2
  60. package/core/src/mqtt.d.ts +14 -0
  61. package/core/src/mqtt.js +82 -0
  62. package/core/src/mqtt.js.map +1 -0
  63. package/core/src/offscreen.d.ts +4 -1
  64. package/core/src/offscreen.js +8 -10
  65. package/core/src/options.d.ts +1 -3
  66. package/core/src/options.js +0 -2
  67. package/core/src/poll.js +39 -0
  68. package/core/src/preview.d.ts +13 -1
  69. package/core/src/preview.js +43 -111
  70. package/core/src/renderLayer.d.ts +9 -11
  71. package/core/src/renderLayer.js +60 -48
  72. package/core/src/socket.d.ts +10 -0
  73. package/core/src/socket.js +51 -0
  74. package/core/src/socket.js.map +1 -0
  75. package/core/src/utils/canvas.js +1 -1
  76. package/core/src/utils/construction.d.ts +3 -12
  77. package/core/src/utils/construction.js +1 -8
  78. package/core/src/utils/conversion.d.ts +0 -11
  79. package/core/src/utils/conversion.js +0 -167
  80. package/core/src/utils/dom.d.ts +8 -0
  81. package/core/src/utils/dom.js +67 -0
  82. package/core/src/utils/dom.js.map +1 -0
  83. package/core/src/utils/index.d.ts +1 -2
  84. package/core/src/utils/index.js +1 -2
  85. package/core/src/utils/math.d.ts +0 -1
  86. package/core/src/utils/math.js +0 -3
  87. package/core/src/utils/onmousevent.d.ts +0 -3
  88. package/core/src/utils/onmousevent.js +8 -37
  89. package/flow-diagram/src/comment/comment.anchor.d.ts +1 -1
  90. package/flow-diagram/src/comment/comment.anchor.js +1 -1
  91. package/flow-diagram/src/comment/comment.d.ts +1 -1
  92. package/flow-diagram/src/data/data.anchor.d.ts +1 -1
  93. package/flow-diagram/src/data/data.anchor.js +1 -1
  94. package/flow-diagram/src/data/data.d.ts +1 -1
  95. package/flow-diagram/src/data/data.rect.d.ts +1 -1
  96. package/flow-diagram/src/data/data.rect.js +1 -1
  97. package/flow-diagram/src/db/db.d.ts +1 -1
  98. package/flow-diagram/src/db/db.rect.d.ts +1 -1
  99. package/flow-diagram/src/db/db.rect.js +1 -1
  100. package/flow-diagram/src/display/display.anchor.d.ts +1 -1
  101. package/flow-diagram/src/display/display.anchor.js +1 -1
  102. package/flow-diagram/src/display/display.d.ts +1 -1
  103. package/flow-diagram/src/display/display.rect.d.ts +1 -1
  104. package/flow-diagram/src/display/display.rect.js +1 -1
  105. package/flow-diagram/src/document/document.anchor.d.ts +1 -1
  106. package/flow-diagram/src/document/document.anchor.js +1 -1
  107. package/flow-diagram/src/document/document.d.ts +1 -1
  108. package/flow-diagram/src/document/document.rect.d.ts +1 -1
  109. package/flow-diagram/src/document/document.rect.js +1 -1
  110. package/flow-diagram/src/externStorage/externStorage.anchor.d.ts +1 -1
  111. package/flow-diagram/src/externStorage/externStorage.anchor.js +1 -1
  112. package/flow-diagram/src/externStorage/externStorage.d.ts +1 -1
  113. package/flow-diagram/src/externStorage/externStorage.rect.d.ts +1 -1
  114. package/flow-diagram/src/externStorage/externStorage.rect.js +1 -1
  115. package/flow-diagram/src/internalStorage/internalStorage.d.ts +1 -1
  116. package/flow-diagram/src/internalStorage/internalStorage.rect.d.ts +1 -1
  117. package/flow-diagram/src/internalStorage/internalStorage.rect.js +1 -1
  118. package/flow-diagram/src/manually/manually.anchor.d.ts +1 -1
  119. package/flow-diagram/src/manually/manually.anchor.js +1 -1
  120. package/flow-diagram/src/manually/manually.d.ts +1 -1
  121. package/flow-diagram/src/manually/manually.rect.d.ts +1 -1
  122. package/flow-diagram/src/manually/manually.rect.js +1 -1
  123. package/flow-diagram/src/parallel/parallel.anchor.d.ts +1 -1
  124. package/flow-diagram/src/parallel/parallel.anchor.js +1 -1
  125. package/flow-diagram/src/parallel/parallel.d.ts +1 -1
  126. package/flow-diagram/src/queue/queue.d.ts +1 -1
  127. package/flow-diagram/src/queue/queue.rect.d.ts +1 -1
  128. package/flow-diagram/src/queue/queue.rect.js +1 -1
  129. package/flow-diagram/src/register.js +1 -1
  130. package/flow-diagram/src/subprocess/subprocess.d.ts +1 -1
  131. package/flow-diagram/src/subprocess/subprocess.rect.d.ts +1 -1
  132. package/flow-diagram/src/subprocess/subprocess.rect.js +1 -1
  133. package/layout/src/align.d.ts +1 -1
  134. package/layout/src/align.js +1 -1
  135. package/layout/src/layout.d.ts +1 -1
  136. package/layout/src/layout.js +1 -1
  137. package/myShape-diagram/{index.js → myShape.js} +1 -4
  138. package/package.json +1 -1
  139. package/sequence-diagram/src/focus/focus.anchor.d.ts +1 -1
  140. package/sequence-diagram/src/focus/focus.anchor.js +1 -1
  141. package/sequence-diagram/src/focus/focus.d.ts +1 -1
  142. package/sequence-diagram/src/focus/focus.rect.d.ts +1 -1
  143. package/sequence-diagram/src/focus/focus.rect.js +1 -1
  144. package/sequence-diagram/src/lifeline/lifeline.anchor.d.ts +1 -1
  145. package/sequence-diagram/src/lifeline/lifeline.anchor.js +1 -1
  146. package/sequence-diagram/src/lifeline/lifeline.d.ts +1 -1
  147. package/sequence-diagram/src/lifeline/lifeline.rect.d.ts +1 -1
  148. package/sequence-diagram/src/lifeline/lifeline.rect.js +1 -1
  149. package/sequence-diagram/src/register.js +1 -1
  150. package/chart-diagram/src/utils/changeOptions.d.ts +0 -7
  151. package/chart-diagram/src/utils/changeOptions.js +0 -253
  152. package/chart-diagram/src/utils/conversion.d.ts +0 -18
  153. package/chart-diagram/src/utils/conversion.js +0 -399
  154. package/chart-diagram/src/utils/drawGraphic.d.ts +0 -3
  155. package/chart-diagram/src/utils/drawGraphic.js +0 -97
  156. package/chart-diagram/src/utils/formatter.d.ts +0 -1
  157. package/chart-diagram/src/utils/formatter.js +0 -129
  158. package/chart-diagram/src/utils/index.d.ts +0 -4
  159. package/chart-diagram/src/utils/index.js +0 -4
  160. package/chart-diagram/src/utils/render.d.ts +0 -8
  161. package/chart-diagram/src/utils/render.js +0 -199
  162. package/core/src/element/common.d.ts +0 -5
  163. package/core/src/element/common.js +0 -54
  164. package/core/src/element/iframe.d.ts +0 -3
  165. package/core/src/element/iframe.js +0 -12
  166. package/core/src/element/index.d.ts +0 -4
  167. package/core/src/element/index.js +0 -4
  168. package/core/src/element/select.d.ts +0 -11
  169. package/core/src/element/select.js +0 -263
  170. package/core/src/element/tab.d.ts +0 -1
  171. package/core/src/element/tab.js +0 -23
  172. package/core/src/middles/arrows/index.d.ts +0 -4
  173. package/core/src/middles/arrows/index.js +0 -5
  174. package/core/src/middles/lines/index.d.ts +0 -4
  175. package/core/src/middles/lines/index.js +0 -5
  176. package/core/src/middles/nodes/formoverflow.js +0 -61
  177. package/core/src/middles/nodes/formselect.d.ts +0 -2
  178. package/core/src/middles/nodes/formselect.js +0 -95
  179. package/core/src/middles/nodes/iframe.d.ts +0 -2
  180. package/core/src/middles/nodes/iframe.js +0 -29
  181. package/core/src/middles/nodes/index.d.ts +0 -48
  182. package/core/src/middles/nodes/index.js +0 -49
  183. package/core/src/store/common.d.ts +0 -9
  184. package/core/src/store/common.js +0 -5
  185. package/core/src/store/data.d.ts +0 -186
  186. package/core/src/store/data.js +0 -178
  187. package/core/src/store/index.d.ts +0 -2
  188. package/core/src/store/index.js +0 -2
  189. package/core/src/utils/assignment.d.ts +0 -6
  190. package/core/src/utils/assignment.js +0 -168
  191. package/core/src/utils/params.d.ts +0 -2
  192. package/core/src/utils/params.js +0 -60
  193. package/static/echartsDefaultData.js +0 -167
  194. package/static/element.js +0 -14
  195. package/static/form.js +0 -11
  196. package/static/index.js +0 -3
  197. package/store/actions.js +0 -1
  198. package/store/clear.js +0 -10
  199. package/store/index.js +0 -2
  200. package/style/common.css +0 -18
  201. package/style/editor.css +0 -13
  202. package/style/index.css +0 -4
  203. package/style/select.css +0 -143
  204. /package/myShape-diagram/{index.ts → myShape.ts} +0 -0
@@ -1,8 +1,8 @@
1
1
  var __extends = (this && this.__extends) || (function () {
2
2
  var extendStatics = function (d, b) {
3
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]; };
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
6
  return extendStatics(d, b);
7
7
  };
8
8
  return function (d, b) {
@@ -11,17 +11,22 @@ var __extends = (this && this.__extends) || (function () {
11
11
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
12
  };
13
13
  })();
14
- import { Point, Node, PenType, Lock } from './models';
14
+ import { Point } from './models/point';
15
+ import { Node } from './models/node';
16
+ import { PenType } from './models/pen';
15
17
  import { Store } from 'le5le-store';
18
+ import { Lock } from './models/status';
16
19
  import { Layer } from './layer';
17
- import { commonStore } from './store'
18
20
  var HoverLayer = /** @class */ (function (_super) {
19
21
  __extends(HoverLayer, _super);
20
- function HoverLayer(TID) {
22
+ function HoverLayer(options, TID) {
23
+ if (options === void 0) { options = {}; }
21
24
  var _this = _super.call(this, TID) || this;
25
+ _this.options = options;
22
26
  _this.hoverAnchorIndex = -1;
23
27
  _this.dockLineX = 0;
24
28
  _this.dockLineY = 0;
29
+ _this.data = Store.get(_this.generateStoreKey('topology-data'));
25
30
  Store.set(_this.generateStoreKey('LT:HoverLayer'), _this);
26
31
  return _this;
27
32
  }
@@ -65,16 +70,14 @@ var HoverLayer = /** @class */ (function (_super) {
65
70
  };
66
71
  HoverLayer.prototype.render = function (ctx) {
67
72
  var _this = this;
68
- if(!commonStore || !commonStore[_this.TID]) return;
69
- var globalStore = commonStore[_this.TID];
70
- if (globalStore.data.locked === Lock.NoEvent) {
73
+ if (this.data.locked === Lock.NoEvent) {
71
74
  return;
72
75
  }
73
- ctx.fillStyle = globalStore.options.hoverColor;
76
+ ctx.fillStyle = this.options.hoverColor;
74
77
  ctx.save();
75
78
  // anchors
76
- if (globalStore.options.alwaysAnchor) {
77
- globalStore.data.pens.forEach(function (pen) {
79
+ if (this.options.alwaysAnchor) {
80
+ this.data.pens.forEach(function (pen) {
78
81
  if (pen.type === PenType.Line) {
79
82
  return;
80
83
  }
@@ -87,23 +90,23 @@ var HoverLayer = /** @class */ (function (_super) {
87
90
  continue;
88
91
  }
89
92
  ctx.beginPath();
90
- ctx.arc(anchor.x, anchor.y, anchor.radius || globalStore.options.anchorRadius, 0, Math.PI * 2);
91
- ctx.strokeStyle = anchor.strokeStyle || globalStore.options.hoverColor;
92
- ctx.fillStyle = anchor.fillStyle || globalStore.options.anchorFillStyle;
93
+ ctx.arc(anchor.x, anchor.y, anchor.radius || _this.options.anchorRadius, 0, Math.PI * 2);
94
+ ctx.strokeStyle = anchor.strokeStyle || _this.options.hoverColor;
95
+ ctx.fillStyle = anchor.fillStyle || _this.options.anchorFillStyle;
93
96
  ctx.fill();
94
97
  ctx.stroke();
95
98
  }
96
99
  });
97
100
  }
98
101
  ctx.restore();
99
- if (this.node && !globalStore.data.locked) {
102
+ if (this.node && !this.data.locked) {
100
103
  if (!this.node.getTID()) {
101
104
  this.node.setTID(this.TID);
102
105
  }
103
106
  this.root = this.getRoot(this.node) || this.node;
104
107
  if (this.root) {
105
108
  ctx.save();
106
- ctx.strokeStyle = globalStore.options.dragColor;
109
+ ctx.strokeStyle = this.options.dragColor;
107
110
  ctx.globalAlpha = 0.2;
108
111
  if (this.root.rotate) {
109
112
  ctx.translate(this.root.rect.center.x, this.root.rect.center.y);
@@ -114,20 +117,20 @@ var HoverLayer = /** @class */ (function (_super) {
114
117
  ctx.strokeRect(this.root.rect.x, this.root.rect.y, this.root.rect.width, this.root.rect.height);
115
118
  ctx.restore();
116
119
  }
117
- if (!globalStore.options.hideAnchor) {
120
+ if (!this.options.hideAnchor) {
118
121
  for (var i = 0; i < this.node.rotatedAnchors.length; ++i) {
119
122
  if (this.node.locked ||
120
- this.node.hideAnchor ||
121
- (this.node.rotatedAnchors[i].hidden && this.hoverAnchorIndex !== i)) {
123
+ this.node.hideAnchor ||
124
+ (this.node.rotatedAnchors[i].hidden && this.hoverAnchorIndex !== i)) {
122
125
  continue;
123
126
  }
124
127
  ctx.beginPath();
125
- ctx.arc(this.node.rotatedAnchors[i].x, this.node.rotatedAnchors[i].y, this.node.rotatedAnchors[i].radius || globalStore.options.anchorRadius, 0, Math.PI * 2);
128
+ ctx.arc(this.node.rotatedAnchors[i].x, this.node.rotatedAnchors[i].y, this.node.rotatedAnchors[i].radius || this.options.anchorRadius, 0, Math.PI * 2);
126
129
  ctx.strokeStyle =
127
- this.node.rotatedAnchors[i].strokeStyle || globalStore.options.hoverColor;
130
+ this.node.rotatedAnchors[i].strokeStyle || this.options.hoverColor;
128
131
  ctx.fillStyle =
129
- this.node.rotatedAnchors[i].fillStyle ||
130
- globalStore.options.anchorFillStyle;
132
+ this.node.rotatedAnchors[i].fillStyle ||
133
+ this.options.anchorFillStyle;
131
134
  ctx.fill();
132
135
  ctx.stroke();
133
136
  }
@@ -136,9 +139,9 @@ var HoverLayer = /** @class */ (function (_super) {
136
139
  if (this.dockAnchor) {
137
140
  ctx.save();
138
141
  ctx.beginPath();
139
- ctx.arc(this.dockAnchor.x, this.dockAnchor.y, this.dockAnchor.radius || globalStore.options.anchorRadius, 0, Math.PI * 2);
140
- ctx.strokeStyle = globalStore.options.dockStrokeStyle;
141
- ctx.fillStyle = globalStore.options.dockFillStyle;
142
+ ctx.arc(this.dockAnchor.x, this.dockAnchor.y, this.dockAnchor.radius || this.options.anchorRadius, 0, Math.PI * 2);
143
+ ctx.strokeStyle = this.options.dockStrokeStyle;
144
+ ctx.fillStyle = this.options.dockFillStyle;
142
145
  ctx.fill();
143
146
  ctx.stroke();
144
147
  ctx.restore();
@@ -148,7 +151,7 @@ var HoverLayer = /** @class */ (function (_super) {
148
151
  ctx.arc(this.hoverLineCP.x, this.hoverLineCP.y, 5, 0, Math.PI * 2);
149
152
  ctx.fill();
150
153
  }
151
- ctx.strokeStyle = globalStore.options.hoverColor + '80';
154
+ ctx.strokeStyle = this.options.hoverColor + '80';
152
155
  ctx.lineWidth = 1;
153
156
  if (this.dockLineX > 0) {
154
157
  var size = Store.get(this.generateStoreKey('LT:size'));
@@ -166,8 +169,8 @@ var HoverLayer = /** @class */ (function (_super) {
166
169
  }
167
170
  // Select nodes by drag.
168
171
  if (this.dragRect) {
169
- ctx.fillStyle = globalStore.options.dragColor + '30';
170
- ctx.strokeStyle = globalStore.options.dragColor;
172
+ ctx.fillStyle = this.options.dragColor + '30';
173
+ ctx.strokeStyle = this.options.dragColor;
171
174
  ctx.beginPath();
172
175
  ctx.strokeRect(this.dragRect.x, this.dragRect.y, this.dragRect.width, this.dragRect.height);
173
176
  ctx.fillRect(this.dragRect.x, this.dragRect.y, this.dragRect.width, this.dragRect.height);
@@ -177,7 +180,7 @@ var HoverLayer = /** @class */ (function (_super) {
177
180
  if (!node.parentId) {
178
181
  return null;
179
182
  }
180
- for (var _i = 0, _a = commonStore[this.TID].data.pens; _i < _a.length; _i++) {
183
+ for (var _i = 0, _a = this.data.pens; _i < _a.length; _i++) {
181
184
  var item = _a[_i];
182
185
  if (item instanceof Node && item.id === node.parentId) {
183
186
  var n = this.getRoot(item);
@@ -193,4 +196,4 @@ var HoverLayer = /** @class */ (function (_super) {
193
196
  return HoverLayer;
194
197
  }(Layer));
195
198
  export { HoverLayer };
196
- //# sourceMappingURL=hoverLayer.js.map
199
+ //# sourceMappingURL=hoverLayer.js.map
@@ -1,4 +1,6 @@
1
- import { Point, Node, Line } from '../models';
1
+ import { Point } from '../models';
2
+ import { Node } from '../models';
3
+ import { Line } from '../models';
2
4
  export declare const drawNodeFns: any;
3
5
  export declare const iconRectFns: any;
4
6
  export declare const textRectFns: any;
@@ -1,52 +1,54 @@
1
- import {
2
- arrowAnchors,
3
- leftArrow, leftArrowIconRect, leftArrowTextRect,
4
- rightArrow, rightArrowIconRect, rightArrowTextRect,
5
- twowayArrow, twowayArrowIconRect, twowayArrowTextRect,
6
- rectangle, rectangleIconRect, rectangleTextRect,
7
- diamond, diamondIconRect, diamondTextRect,
8
- text, file, formtable, tablePagination, iframePrimeval,formSelect,
9
- line as nodeLine, lineAnchors, lineIconRect, lineTextRect,
10
- circle, circleIconRect, circleTextRect, circleAnchors,
11
- triangle, triangleIconRect, triangleTextRect, triangleAnchors,
12
- pentagon, pentagonIconRect, pentagonTextRect, pentagonAnchors,
13
- hexagon, hexagonAnchors, hexagonIconRect, hexagonTextRect,
14
- pentagram, pentagramAnchors, pentagramIconRect, pentagramTextRect,
15
- cloud, cloudAnchors, cloudIconRect, cloudTextRect,
16
- message, messageIconRect, messageTextRect, messageAnchors,
17
- imageIconRect, imageTextRect,
18
- cube, cubeAnchors, cubeIconRect, cubeTextRect,
19
- people, peopleIconRect, peopleTextRect,
20
- arbitraryGraph, arbitraryGraphAnchors,
21
- } from './nodes';
22
- import {
23
- line,
24
- lineControlPoints,
25
- calcLineControlPoints,
26
- polyline,
27
- polylineControlPoints,
28
- pointInPolyline,
29
- calcPolylineControlPoints,
30
- dockPolylineControlPoint,
31
- curve,
32
- curveControlPoints,
33
- pointInCurve,
34
- calcCurveControlPoints,
35
- mind,
36
- calcMindControlPoints,
37
- mindControlPoints,
38
- pointInMind
39
- } from './lines';
40
- import {
41
- triangleSolid,
42
- triangle as arrowTriangle,
43
- diamondSolid,
44
- diamond as arrowDiamond,
45
- circleSolid, circle as arrowCircle,
46
- lineUp,
47
- lineDown,
48
- line as arrowLine
49
- } from './arrows';
1
+ import { rectangle } from './nodes/rectangle';
2
+ import { circle } from './nodes/circle';
3
+ import { triangle } from './nodes/triangle';
4
+ import { diamond } from './nodes/diamond';
5
+ import { leftArrow, rightArrow, twowayArrow } from './nodes/arrow';
6
+ import { text } from './nodes/text';
7
+ import { line as nodeLine } from './nodes/line';
8
+ import { triangleAnchors } from './nodes/triangle.anchor';
9
+ import { arrowAnchors } from './nodes/arrow.anchor';
10
+ import { lineAnchors } from './nodes/line.anchor';
11
+ import { circleIconRect, circleTextRect } from './nodes/circle.rect';
12
+ import { triangleIconRect, triangleTextRect } from './nodes/triangle.rect';
13
+ import { diamondIconRect, diamondTextRect } from './nodes/diamond.rect';
14
+ import { twowayArrowIconRect, twowayArrowTextRect, leftArrowIconRect, leftArrowTextRect, rightArrowIconRect, rightArrowTextRect } from './nodes/arrow.rect';
15
+ import { lineIconRect, lineTextRect } from './nodes/line.rect';
16
+ import { line, lineControlPoints, calcLineControlPoints } from './lines/line';
17
+ import { polyline, polylineControlPoints, pointInPolyline, calcPolylineControlPoints, dockPolylineControlPoint } from './lines/polyline';
18
+ import { curve, curveControlPoints, pointInCurve, calcCurveControlPoints } from './lines/curve';
19
+ import { mind, calcMindControlPoints, mindControlPoints, pointInMind } from './lines/mind';
20
+ import { triangleSolid, triangle as arrowTriangle } from './arrows/triangle';
21
+ import { diamondSolid, diamond as arrowDiamond } from './arrows/diamond';
22
+ import { circleSolid, circle as arrowCircle } from './arrows/circle';
23
+ import { circleAnchors } from './nodes/circle.anchor';
24
+ import { lineUp, lineDown, line as arrowLine } from './arrows/line';
25
+ import { pentagon } from './nodes/pentagon';
26
+ import { pentagonIconRect, pentagonTextRect } from './nodes/pentagon.rect';
27
+ import { pentagonAnchors } from './nodes/pentagon.anchor';
28
+ import { hexagon } from './nodes/hexagon';
29
+ import { hexagonAnchors } from './nodes/hexagon.anchor';
30
+ import { hexagonIconRect, hexagonTextRect } from './nodes/hexagon.rect';
31
+ import { pentagram } from './nodes/pentagram';
32
+ import { pentagramAnchors } from './nodes/pentagram.anchor';
33
+ import { pentagramIconRect, pentagramTextRect } from './nodes/pentagram.rect';
34
+ import { cloud } from './nodes/cloud';
35
+ import { cloudAnchors } from './nodes/cloud.anchor';
36
+ import { cloudIconRect, cloudTextRect } from './nodes/cloud.rect';
37
+ import { message } from './nodes/message';
38
+ import { messageIconRect, messageTextRect } from './nodes/message.rect';
39
+ import { messageAnchors } from './nodes/message.anchor';
40
+ import { file } from './nodes/file';
41
+ import { imageIconRect, imageTextRect } from './nodes/image.rect';
42
+ import { cube } from './nodes/cube';
43
+ import { cubeAnchors } from './nodes/cube.anchor';
44
+ import { cubeIconRect, cubeTextRect } from './nodes/cube.rect';
45
+ import { people } from './nodes/people';
46
+ import { peopleIconRect, peopleTextRect } from './nodes/people.rect';
47
+ import { rectangleIconRect, rectangleTextRect } from './nodes/rectangle.rect';
48
+ import { arbitraryGraph } from './nodes/arbitrarygraph';
49
+ import { arbitraryGraphAnchors } from './nodes/arbitrarygraph.anchor';
50
+ import { formtable } from './nodes/formtable';
51
+ import { tablePagination } from './nodes/tablePagination';
50
52
  // Functions of drawing a node.
51
53
  export var drawNodeFns = {};
52
54
  // Calc the occupy rect of icon.
@@ -62,10 +64,6 @@ export var drawArrowFns = {};
62
64
  function init() {
63
65
  console.log('Init middles.');
64
66
  // ********Default nodes.*******
65
- // select
66
- drawNodeFns.select = formSelect;
67
- // iframe
68
- drawNodeFns.iframe = iframePrimeval;
69
67
  // tablePagination
70
68
  drawNodeFns.tablePagination = tablePagination;
71
69
  // formtable
@@ -1,5 +1,4 @@
1
1
  export * from './default';
2
- export * from './nodes';
3
- export * from './lines';
4
- export * from './arrows';
2
+ export * from './nodes/rectangle';
3
+ export * from './nodes/text';
5
4
  //# sourceMappingURL=index.js.map
@@ -1,19 +1,17 @@
1
1
  export function arbitraryGraph(ctx, node) {
2
2
 
3
- ctx.beginPath();
3
+ ctx.beginPath();
4
4
 
5
- ctx.lineWidth = 1;
5
+ ctx.lineWidth = 1;
6
6
 
7
- ctx.moveTo(node.rect.circles[0].x, node.rect.circles[0].y);
7
+ for(let i=0,len=node.rect.circles.length; i<len; i++) {
8
8
 
9
- for(let i=1,len=node.rect.circles.length; i<len; i++) {
9
+ ctx.lineTo(node.rect.circles[i].x, node.rect.circles[i].y)
10
+ }
10
11
 
11
- ctx.lineTo(node.rect.circles[i].x, node.rect.circles[i].y);
12
- }
12
+ ctx.closePath();
13
13
 
14
- ctx.closePath();
15
-
16
- (node.fillStyle || node.bkType) && ctx.fill();
17
-
18
- ctx.stroke();
14
+ (node.fillStyle || node.bkType) && ctx.fill();
15
+
16
+ ctx.stroke();
19
17
  }
@@ -1,4 +1,4 @@
1
- import { Rect } from '../../models';
1
+ import { Rect } from '../../models/rect';
2
2
  export function pentagonIconRect(node) {
3
3
  var w = node.rect.width / 2;
4
4
  var h = node.rect.height / 2;
@@ -1,4 +1,4 @@
1
- import { Rect } from '../../models';
1
+ import { Rect } from '../../models/rect';
2
2
  export function rectangleIconRect(node) {
3
3
  node.iconRect = new Rect(node.rect.x + node.paddingLeftNum, node.rect.y + node.paddingTopNum, node.rect.height - node.paddingTopNum - node.paddingBottomNum, node.rect.height - node.paddingTopNum - node.paddingBottomNum);
4
4
  node.fullIconRect = new Rect(node.rect.x + node.paddingLeftNum, node.rect.y + node.paddingTopNum, node.rect.width - node.paddingLeftNum - node.paddingRightNum, node.rect.height - node.paddingTopNum - node.paddingBottomNum);
@@ -0,0 +1,26 @@
1
+ import { Pen } from './pen';
2
+ import { Lock } from './status';
3
+ export declare class TopologyData {
4
+ pens: Pen[];
5
+ lineName: string;
6
+ fromArrowType: string;
7
+ toArrowType: string;
8
+ scale: number;
9
+ locked: Lock;
10
+ bkImage: string;
11
+ bkColor: string;
12
+ grid?: boolean;
13
+ websocket?: string;
14
+ mqttUrl?: string;
15
+ mqttOptions?: {
16
+ clientId?: string;
17
+ username?: string;
18
+ password?: string;
19
+ };
20
+ mqttTopics?: string;
21
+ manualCps?: boolean;
22
+ dataConstruct?: any;
23
+ data?: any;
24
+ bkImageRect?: any;
25
+ constructor(json?: any);
26
+ }
@@ -0,0 +1,77 @@
1
+ import { Node } from './node';
2
+ import { Line } from './line';
3
+ import { Lock } from './status';
4
+ import { s8 } from '../utils';
5
+ var TopologyData = /** @class */ (function () {
6
+ function TopologyData(json) {
7
+ this.pens = [];
8
+ this.lineName = 'curve';
9
+ this.fromArrowType = '';
10
+ this.toArrowType = 'triangleSolid';
11
+ this.scale = 1;
12
+ this.locked = Lock.None;
13
+ this.bkImageRect = null;
14
+ this.mqttOptions = {
15
+ clientId: s8()
16
+ };
17
+ this.dataConstruct = {};
18
+ if (json) {
19
+ this.pens = [];
20
+ json.dataConstruct = {};
21
+ for (var _i = 0, _a = json.pens; _i < _a.length; _i++) {
22
+ var item = _a[_i];
23
+ if (item.from) {
24
+ this.pens.push(new Line(item));
25
+ }
26
+ else {
27
+ if(item.name === 'formTable') {
28
+ json.dataConstruct[item.id] = {
29
+ id: item.id,
30
+ name: 'table'
31
+ }
32
+ }
33
+ this.pens.push(new Node(item));
34
+ }
35
+ }
36
+ this.lineName = json.lineName || 'curve';
37
+ this.fromArrowType = json.fromArrowType || '';
38
+ this.toArrowType = json.toArrowType || 'triangleSolid';
39
+ this.scale = json.scale || 1;
40
+ this.locked = json.locked || Lock.None;
41
+ this.bkImage = json.bkImage;
42
+ this.bkColor = json.bkColor;
43
+ this.grid = json.grid;
44
+ this.manualCps = json.manualCps;
45
+ this.websocket = json.websocket;
46
+ this.mqttUrl = json.mqttUrl;
47
+ this.bkImageRect = json.bkImageRect;
48
+ if (json.mqttOptions) {
49
+ var opts = '';
50
+ if (typeof json.mqttOptions === 'object') {
51
+ opts = JSON.stringify(json.mqttOptions);
52
+ }
53
+ else {
54
+ opts = json.mqttOptions + '';
55
+ }
56
+ this.mqttOptions = JSON.parse(opts);
57
+ }
58
+ else {
59
+ this.mqttOptions = { clientId: s8() };
60
+ }
61
+ this.dataConstruct = json.dataConstruct ? json.dataConstruct : {};
62
+ this.mqttTopics = json.mqttTopics;
63
+ if (typeof json.data === 'object') {
64
+ this.data = JSON.parse(JSON.stringify(json.data));
65
+ }
66
+ else {
67
+ this.data = json.data || '';
68
+ }
69
+ }
70
+ if (!this.mqttOptions) {
71
+ this.mqttOptions = { clientId: s8() };
72
+ }
73
+ }
74
+ return TopologyData;
75
+ }());
76
+ export { TopologyData };
77
+ //# sourceMappingURL=data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data.js","sourceRoot":"","sources":["../../../../packages/core/src/models/data.ts"],"names":[],"mappings":"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"}
@@ -1,3 +1,4 @@
1
+ export * from './data';
1
2
  export * from './pen';
2
3
  export * from './node';
3
4
  export * from './line';
@@ -1,3 +1,4 @@
1
+ export * from './data';
1
2
  export * from './pen';
2
3
  export * from './node';
3
4
  export * from './line';
@@ -7,12 +7,6 @@ export declare const images: {
7
7
  cnt: number;
8
8
  };
9
9
  };
10
- export declare const defaultImages: {
11
- [key: string]: {
12
- img: string;
13
- status: number;
14
- };
15
- };
16
10
  export declare class Node extends Pen {
17
11
  is3D: boolean;
18
12
  z: number;
@@ -58,10 +52,6 @@ export declare class Node extends Pen {
58
52
  linear: boolean;
59
53
  state: Node;
60
54
  }[];
61
- formData: {
62
- bindBlockId: string;
63
- theme: number;
64
- };
65
55
  animateAlone: boolean;
66
56
  gif: boolean;
67
57
  video: string;