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.
- package/activity-diagram/src/final/final.d.ts +1 -1
- package/activity-diagram/src/final/final.rect.d.ts +1 -1
- package/activity-diagram/src/final/final.rect.js +1 -1
- package/activity-diagram/src/fork/fork.anchor.d.ts +1 -1
- package/activity-diagram/src/fork/fork.anchor.js +1 -1
- package/activity-diagram/src/fork/fork.d.ts +1 -1
- package/activity-diagram/src/fork/fork.rect.d.ts +1 -1
- package/activity-diagram/src/fork/fork.rect.js +1 -1
- package/activity-diagram/src/register.js +1 -1
- package/activity-diagram/src/swimlaneH/swimlaneH.d.ts +1 -1
- package/activity-diagram/src/swimlaneH/swimlaneH.rect.d.ts +1 -1
- package/activity-diagram/src/swimlaneH/swimlaneH.rect.js +1 -1
- package/activity-diagram/src/swimlaneV/swimlaneV.d.ts +1 -1
- package/activity-diagram/src/swimlaneV/swimlaneV.rect.d.ts +1 -1
- package/activity-diagram/src/swimlaneV/swimlaneV.rect.js +1 -1
- package/chart-diagram/index.d.ts +1 -3
- package/chart-diagram/index.js +1 -2
- package/chart-diagram/src/echarts/index.d.ts +2 -1
- package/chart-diagram/src/echarts/index.js +78 -86
- package/chart-diagram/src/register.js +8 -9
- package/class-diagram/src/class/class.d.ts +1 -1
- package/class-diagram/src/class/class.rect.d.ts +1 -1
- package/class-diagram/src/class/class.rect.js +1 -1
- package/class-diagram/src/register.js +1 -1
- package/core/index.d.ts +0 -2
- package/core/index.js +18 -2
- package/core/src/activeLayer.d.ts +10 -2
- package/core/src/activeLayer.js +62 -57
- package/core/src/animateLayer.d.ts +7 -3
- package/core/src/animateLayer.js +12 -10
- package/core/src/calling.d.ts +4 -1
- package/core/src/calling.js +68 -69
- package/core/src/canvas.d.ts +6 -1
- package/core/src/canvas.js +21 -22
- package/core/src/common.d.ts +7 -7
- package/core/src/common.js +698 -397
- package/core/src/core.d.ts +4 -5
- package/core/src/core.js +385 -536
- package/core/src/divLayer.d.ts +36 -2
- package/core/src/divLayer.js +305 -33
- package/core/src/healps/changeData.d.ts +2 -1
- package/core/src/healps/changeData.js +100 -89
- package/core/src/hoverLayer.d.ts +9 -2
- package/core/src/hoverLayer.js +34 -31
- package/core/src/middles/default.d.ts +3 -1
- package/core/src/middles/default.js +51 -65
- package/core/src/middles/index.d.ts +2 -1
- package/core/src/middles/index.js +2 -4
- package/core/src/middles/nodes/arbitrarygraph.js +9 -11
- package/core/src/middles/nodes/pentagon.rect.js +1 -1
- package/core/src/middles/nodes/rectangle.js +15 -54
- package/core/src/middles/nodes/rectangle.rect.js +1 -1
- package/core/src/models/data.d.ts +26 -0
- package/core/src/models/data.js +77 -0
- package/core/src/models/data.js.map +1 -0
- package/core/src/models/index.d.ts +1 -0
- package/core/src/models/index.js +1 -0
- package/core/src/models/line.js +7 -7
- package/core/src/models/node.d.ts +0 -10
- package/core/src/models/node.js +101 -155
- package/core/src/models/pen.js +68 -37
- package/core/src/models/rect.js +2 -2
- package/core/src/mqtt.d.ts +14 -0
- package/core/src/mqtt.js +82 -0
- package/core/src/mqtt.js.map +1 -0
- package/core/src/offscreen.d.ts +4 -1
- package/core/src/offscreen.js +24 -26
- package/core/src/options.d.ts +1 -3
- package/core/src/options.js +0 -2
- package/core/src/poll.js +39 -0
- package/core/src/preview.d.ts +13 -2
- package/core/src/preview.js +54 -181
- package/core/src/renderLayer.d.ts +9 -11
- package/core/src/renderLayer.js +61 -60
- package/core/src/socket.d.ts +10 -0
- package/core/src/socket.js +51 -0
- package/core/src/socket.js.map +1 -0
- package/core/src/utils/canvas.js +1 -1
- package/core/src/utils/construction.d.ts +3 -36
- package/core/src/utils/construction.js +1 -29
- package/core/src/utils/conversion.d.ts +0 -15
- package/core/src/utils/conversion.js +0 -319
- package/core/src/utils/dom.d.ts +8 -0
- package/core/src/utils/dom.js +67 -0
- package/core/src/utils/dom.js.map +1 -0
- package/core/src/utils/index.d.ts +1 -2
- package/core/src/utils/index.js +1 -2
- package/core/src/utils/onmousevent.d.ts +0 -3
- package/core/src/utils/onmousevent.js +10 -42
- package/flow-diagram/src/comment/comment.anchor.d.ts +1 -1
- package/flow-diagram/src/comment/comment.anchor.js +1 -1
- package/flow-diagram/src/comment/comment.d.ts +1 -1
- package/flow-diagram/src/data/data.anchor.d.ts +1 -1
- package/flow-diagram/src/data/data.anchor.js +1 -1
- package/flow-diagram/src/data/data.d.ts +1 -1
- package/flow-diagram/src/data/data.rect.d.ts +1 -1
- package/flow-diagram/src/data/data.rect.js +1 -1
- package/flow-diagram/src/db/db.d.ts +1 -1
- package/flow-diagram/src/db/db.rect.d.ts +1 -1
- package/flow-diagram/src/db/db.rect.js +1 -1
- package/flow-diagram/src/display/display.anchor.d.ts +1 -1
- package/flow-diagram/src/display/display.anchor.js +1 -1
- package/flow-diagram/src/display/display.d.ts +1 -1
- package/flow-diagram/src/display/display.rect.d.ts +1 -1
- package/flow-diagram/src/display/display.rect.js +1 -1
- package/flow-diagram/src/document/document.anchor.d.ts +1 -1
- package/flow-diagram/src/document/document.anchor.js +1 -1
- package/flow-diagram/src/document/document.d.ts +1 -1
- package/flow-diagram/src/document/document.rect.d.ts +1 -1
- package/flow-diagram/src/document/document.rect.js +1 -1
- package/flow-diagram/src/externStorage/externStorage.anchor.d.ts +1 -1
- package/flow-diagram/src/externStorage/externStorage.anchor.js +1 -1
- package/flow-diagram/src/externStorage/externStorage.d.ts +1 -1
- package/flow-diagram/src/externStorage/externStorage.rect.d.ts +1 -1
- package/flow-diagram/src/externStorage/externStorage.rect.js +1 -1
- package/flow-diagram/src/internalStorage/internalStorage.d.ts +1 -1
- package/flow-diagram/src/internalStorage/internalStorage.rect.d.ts +1 -1
- package/flow-diagram/src/internalStorage/internalStorage.rect.js +1 -1
- package/flow-diagram/src/manually/manually.anchor.d.ts +1 -1
- package/flow-diagram/src/manually/manually.anchor.js +1 -1
- package/flow-diagram/src/manually/manually.d.ts +1 -1
- package/flow-diagram/src/manually/manually.rect.d.ts +1 -1
- package/flow-diagram/src/manually/manually.rect.js +1 -1
- package/flow-diagram/src/parallel/parallel.anchor.d.ts +1 -1
- package/flow-diagram/src/parallel/parallel.anchor.js +1 -1
- package/flow-diagram/src/parallel/parallel.d.ts +1 -1
- package/flow-diagram/src/queue/queue.d.ts +1 -1
- package/flow-diagram/src/queue/queue.rect.d.ts +1 -1
- package/flow-diagram/src/queue/queue.rect.js +1 -1
- package/flow-diagram/src/register.js +1 -1
- package/flow-diagram/src/subprocess/subprocess.d.ts +1 -1
- package/flow-diagram/src/subprocess/subprocess.rect.d.ts +1 -1
- package/flow-diagram/src/subprocess/subprocess.rect.js +1 -1
- package/layout/src/align.d.ts +1 -1
- package/layout/src/align.js +1 -1
- package/layout/src/layout.d.ts +1 -1
- package/layout/src/layout.js +1 -1
- package/myShape-diagram/{index.js → myShape.js} +1 -4
- package/package.json +1 -1
- package/sequence-diagram/src/focus/focus.anchor.d.ts +1 -1
- package/sequence-diagram/src/focus/focus.anchor.js +1 -1
- package/sequence-diagram/src/focus/focus.d.ts +1 -1
- package/sequence-diagram/src/focus/focus.rect.d.ts +1 -1
- package/sequence-diagram/src/focus/focus.rect.js +1 -1
- package/sequence-diagram/src/lifeline/lifeline.anchor.d.ts +1 -1
- package/sequence-diagram/src/lifeline/lifeline.anchor.js +1 -1
- package/sequence-diagram/src/lifeline/lifeline.d.ts +1 -1
- package/sequence-diagram/src/lifeline/lifeline.rect.d.ts +1 -1
- package/sequence-diagram/src/lifeline/lifeline.rect.js +1 -1
- package/sequence-diagram/src/register.js +1 -1
- package/chart-diagram/src/utils/changeOptions.d.ts +0 -8
- package/chart-diagram/src/utils/changeOptions.js +0 -273
- package/chart-diagram/src/utils/conversion.d.ts +0 -19
- package/chart-diagram/src/utils/conversion.js +0 -601
- package/chart-diagram/src/utils/drawGraphic.d.ts +0 -3
- package/chart-diagram/src/utils/drawGraphic.js +0 -97
- package/chart-diagram/src/utils/formatter.d.ts +0 -1
- package/chart-diagram/src/utils/formatter.js +0 -206
- package/chart-diagram/src/utils/index.d.ts +0 -5
- package/chart-diagram/src/utils/index.js +0 -5
- package/chart-diagram/src/utils/render.d.ts +0 -8
- package/chart-diagram/src/utils/render.js +0 -223
- package/chart-diagram/src/utils/surfaceParametricConversion.d.ts +0 -3
- package/chart-diagram/src/utils/surfaceParametricConversion.js +0 -252
- package/core/src/element/common.d.ts +0 -6
- package/core/src/element/common.js +0 -62
- package/core/src/element/datePicker.d.ts +0 -3
- package/core/src/element/datePicker.js +0 -44
- package/core/src/element/iframe.d.ts +0 -3
- package/core/src/element/iframe.js +0 -12
- package/core/src/element/index.d.ts +0 -5
- package/core/src/element/index.js +0 -6
- package/core/src/element/select.d.ts +0 -11
- package/core/src/element/select.js +0 -273
- package/core/src/element/tab.d.ts +0 -1
- package/core/src/element/tab.js +0 -20
- package/core/src/element/time.d.ts +0 -3
- package/core/src/element/time.js +0 -44
- package/core/src/middles/arrows/index.d.ts +0 -4
- package/core/src/middles/arrows/index.js +0 -5
- package/core/src/middles/lines/index.d.ts +0 -4
- package/core/src/middles/lines/index.js +0 -5
- package/core/src/middles/nodes/formDatePicker.d.ts +0 -2
- package/core/src/middles/nodes/formDatePicker.js +0 -108
- package/core/src/middles/nodes/formoverflow.js +0 -62
- package/core/src/middles/nodes/formselect.d.ts +0 -2
- package/core/src/middles/nodes/formselect.js +0 -111
- package/core/src/middles/nodes/iframe.d.ts +0 -2
- package/core/src/middles/nodes/iframe.js +0 -29
- package/core/src/middles/nodes/index.d.ts +0 -52
- package/core/src/middles/nodes/index.js +0 -54
- package/core/src/middles/nodes/progress.d.ts +0 -2
- package/core/src/middles/nodes/progress.js +0 -63
- package/core/src/middles/nodes/progress.js.map +0 -1
- package/core/src/middles/nodes/switchs.d.ts +0 -2
- package/core/src/middles/nodes/switchs.js +0 -46
- package/core/src/middles/nodes/time.d.ts +0 -2
- package/core/src/middles/nodes/time.js +0 -98
- package/core/src/store/common.d.ts +0 -9
- package/core/src/store/common.js +0 -5
- package/core/src/store/data.d.ts +0 -205
- package/core/src/store/data.js +0 -198
- package/core/src/store/index.d.ts +0 -2
- package/core/src/store/index.js +0 -2
- package/core/src/utils/assignment.d.ts +0 -7
- package/core/src/utils/assignment.js +0 -229
- package/core/src/utils/params.d.ts +0 -3
- package/core/src/utils/params.js +0 -136
- package/static/echartsDefaultData.js +0 -178
- package/static/element.js +0 -14
- package/static/form.js +0 -11
- package/static/index.js +0 -3
- package/store/actions.js +0 -2
- package/store/clear.js +0 -14
- package/store/default.js +0 -22
- package/store/index.js +0 -3
- package/style/common.css +0 -15
- package/style/datePicker.css +0 -44
- package/style/editor.css +0 -16
- package/style/index.css +0 -5
- package/style/select.css +0 -143
- /package/myShape-diagram/{index.d.ts → myShape.ts} +0 -0
package/core/src/activeLayer.js
CHANGED
|
@@ -12,16 +12,22 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
12
12
|
};
|
|
13
13
|
})();
|
|
14
14
|
import { Store } from 'le5le-store';
|
|
15
|
-
import { PenType
|
|
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';
|
|
16
21
|
import { drawLineFns } from './middles';
|
|
17
22
|
import { getBezierPoint } from './middles/lines/curve';
|
|
18
23
|
import { Layer } from './layer';
|
|
19
24
|
import { flatNodes } from './utils';
|
|
20
|
-
import { commonStore } from './store'
|
|
21
25
|
var ActiveLayer = /** @class */ (function (_super) {
|
|
22
26
|
__extends(ActiveLayer, _super);
|
|
23
|
-
function ActiveLayer(TID) {
|
|
27
|
+
function ActiveLayer(options, TID) {
|
|
28
|
+
if (options === void 0) { options = {}; }
|
|
24
29
|
var _this = _super.call(this, TID) || this;
|
|
30
|
+
_this.options = options;
|
|
25
31
|
_this.rotateCPs = [];
|
|
26
32
|
_this.sizeCPs = [];
|
|
27
33
|
_this.pens = [];
|
|
@@ -36,11 +42,11 @@ var ActiveLayer = /** @class */ (function (_super) {
|
|
|
36
42
|
// nodes移动时,停靠点的参考位置
|
|
37
43
|
_this.dockWatchers = [];
|
|
38
44
|
_this.rotating = false;
|
|
45
|
+
_this.data = Store.get(_this.generateStoreKey('topology-data'));
|
|
39
46
|
Store.set(_this.generateStoreKey('LT:ActiveLayer'), _this);
|
|
40
47
|
return _this;
|
|
41
48
|
}
|
|
42
49
|
ActiveLayer.prototype.calcControlPoints = function () {
|
|
43
|
-
var globalStore = commonStore[this.TID];
|
|
44
50
|
if (this.pens.length === 1 && this.pens[0] instanceof Node) {
|
|
45
51
|
this.rect = this.pens[0].rect;
|
|
46
52
|
this.sizeCPs = this.pens[0].rect.toPoints();
|
|
@@ -68,7 +74,7 @@ var ActiveLayer = /** @class */ (function (_super) {
|
|
|
68
74
|
}
|
|
69
75
|
}
|
|
70
76
|
}
|
|
71
|
-
if (
|
|
77
|
+
if (this.options.hideRotateCP || this.pens[0].hideRotateCP) {
|
|
72
78
|
this.rotateCPs = [new Point(-1000, -1000), new Point(-1000, -1000)];
|
|
73
79
|
}
|
|
74
80
|
return;
|
|
@@ -96,10 +102,9 @@ var ActiveLayer = /** @class */ (function (_super) {
|
|
|
96
102
|
this.rect = new Rect(x1, y1, x2 - x1, y2 - y1);
|
|
97
103
|
this.sizeCPs = [new Point(x1, y1), new Point(x2, y1), new Point(x2, y2), new Point(x1, y2)];
|
|
98
104
|
this.rotateCPs = [new Point(x1 + (x2 - x1) / 2, y1 - 35), new Point(x1 + (x2 - x1) / 2, y1)];
|
|
99
|
-
if (
|
|
105
|
+
if (this.options.hideRotateCP) {
|
|
100
106
|
this.rotateCPs = [new Point(-1000, -1000), new Point(-1000, -1000)];
|
|
101
107
|
}
|
|
102
|
-
globalStore = null;
|
|
103
108
|
};
|
|
104
109
|
ActiveLayer.prototype.locked = function () {
|
|
105
110
|
for (var _i = 0, _a = this.pens; _i < _a.length; _i++) {
|
|
@@ -187,10 +192,10 @@ var ActiveLayer = /** @class */ (function (_super) {
|
|
|
187
192
|
}
|
|
188
193
|
var offsetX = p2.x - p1.x;
|
|
189
194
|
var offsetY = p2.y - p1.y;
|
|
190
|
-
if (
|
|
195
|
+
if (this.options.onlySizeX) {
|
|
191
196
|
offsetY = 0;
|
|
192
197
|
}
|
|
193
|
-
if (
|
|
198
|
+
if (this.options.onlySizeY) {
|
|
194
199
|
offsetX = 0;
|
|
195
200
|
}
|
|
196
201
|
var lines = [];
|
|
@@ -219,16 +224,16 @@ var ActiveLayer = /** @class */ (function (_super) {
|
|
|
219
224
|
default:
|
|
220
225
|
if (!item.onlySizeX) {
|
|
221
226
|
|
|
222
|
-
var sizeX = (this.nodeRects[i].width + offsetX)
|
|
227
|
+
var sizeX = (this.nodeRects[i].width + offsetX)/item.rect.width;
|
|
223
228
|
|
|
224
229
|
var nodeRectsCircles = this.nodeRects[i].circles;
|
|
225
230
|
|
|
226
|
-
item.rect.width =
|
|
231
|
+
item.rect.width = this.nodeRects[i].width + offsetX;
|
|
227
232
|
|
|
228
233
|
}
|
|
229
234
|
if (!item.onlySizeY) {
|
|
230
235
|
|
|
231
|
-
var sizeY = (this.nodeRects[i].height + offsetY)
|
|
236
|
+
var sizeY = (this.nodeRects[i].height + offsetY)/item.rect.height;
|
|
232
237
|
|
|
233
238
|
item.rect.height = this.nodeRects[i].height + offsetY;
|
|
234
239
|
|
|
@@ -278,7 +283,6 @@ var ActiveLayer = /** @class */ (function (_super) {
|
|
|
278
283
|
if (this.nodeRects.length !== this.pens.length) {
|
|
279
284
|
return;
|
|
280
285
|
}
|
|
281
|
-
var globalStore = commonStore[this.TID];
|
|
282
286
|
var i = 0;
|
|
283
287
|
for (var _i = 0, _a = this.pens; _i < _a.length; _i++) {
|
|
284
288
|
var item = _a[_i];
|
|
@@ -297,7 +301,7 @@ var ActiveLayer = /** @class */ (function (_super) {
|
|
|
297
301
|
item.calcChildrenRect();
|
|
298
302
|
if (item.parentId && !item.locked) {
|
|
299
303
|
var parent_1 = void 0;
|
|
300
|
-
for (var _c = 0, _d =
|
|
304
|
+
for (var _c = 0, _d = this.data.pens; _c < _d.length; _c++) {
|
|
301
305
|
var n = _d[_c];
|
|
302
306
|
if (n.id === item.parentId) {
|
|
303
307
|
parent_1 = n;
|
|
@@ -306,12 +310,18 @@ var ActiveLayer = /** @class */ (function (_super) {
|
|
|
306
310
|
}
|
|
307
311
|
}
|
|
308
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
|
+
}
|
|
309
319
|
}
|
|
310
320
|
if (item instanceof Line && item.from) {
|
|
311
321
|
var offsetX_1 = this.nodeRects[i].x + x - item.from.x;
|
|
312
322
|
var offsetY_1 = this.nodeRects[i].y + y - item.from.y;
|
|
313
323
|
if (item.parentId) {
|
|
314
|
-
var items = find(item.parentId,
|
|
324
|
+
var items = find(item.parentId, this.data.pens);
|
|
315
325
|
items.forEach(function (l) {
|
|
316
326
|
l.translate(offsetX_1, offsetY_1);
|
|
317
327
|
});
|
|
@@ -328,7 +338,7 @@ var ActiveLayer = /** @class */ (function (_super) {
|
|
|
328
338
|
ActiveLayer.prototype.getLinesOfNode = function (node) {
|
|
329
339
|
var result = [];
|
|
330
340
|
var nodesLines = flatNodes([node]);
|
|
331
|
-
for (var _i = 0, _a =
|
|
341
|
+
for (var _i = 0, _a = this.data.pens; _i < _a.length; _i++) {
|
|
332
342
|
var pen = _a[_i];
|
|
333
343
|
if (!(pen instanceof Line)) {
|
|
334
344
|
continue;
|
|
@@ -355,10 +365,9 @@ var ActiveLayer = /** @class */ (function (_super) {
|
|
|
355
365
|
if (!pens) {
|
|
356
366
|
pens = this.pens;
|
|
357
367
|
}
|
|
358
|
-
var globalStore = commonStore[this.TID];
|
|
359
368
|
var nodesLines = flatNodes(pens);
|
|
360
369
|
var lines = [];
|
|
361
|
-
nodesLines.lines.push.apply(nodesLines.lines,
|
|
370
|
+
nodesLines.lines.push.apply(nodesLines.lines, this.data.pens.filter(function (pen) { return pen.type; }));
|
|
362
371
|
for (var _i = 0, _a = nodesLines.lines; _i < _a.length; _i++) {
|
|
363
372
|
var line = _a[_i];
|
|
364
373
|
for (var _b = 0, _c = nodesLines.nodes; _b < _c.length; _b++) {
|
|
@@ -374,7 +383,7 @@ var ActiveLayer = /** @class */ (function (_super) {
|
|
|
374
383
|
line.to.y = item.rotatedAnchors[line.to.anchorIndex].y;
|
|
375
384
|
++cnt;
|
|
376
385
|
}
|
|
377
|
-
if (cnt && !
|
|
386
|
+
if (cnt && !this.data.manualCps) {
|
|
378
387
|
line.calcControlPoints();
|
|
379
388
|
}
|
|
380
389
|
line.textRect = null;
|
|
@@ -383,7 +392,6 @@ var ActiveLayer = /** @class */ (function (_super) {
|
|
|
383
392
|
}
|
|
384
393
|
}
|
|
385
394
|
Store.set(this.generateStoreKey('LT:updateLines'), lines);
|
|
386
|
-
globalStore = null;
|
|
387
395
|
};
|
|
388
396
|
ActiveLayer.prototype.offsetRotate = function (angle) {
|
|
389
397
|
this.rotating = true;
|
|
@@ -484,9 +492,7 @@ var ActiveLayer = /** @class */ (function (_super) {
|
|
|
484
492
|
};
|
|
485
493
|
ActiveLayer.prototype.render = function (ctx) {
|
|
486
494
|
var _this = this;
|
|
487
|
-
if (
|
|
488
|
-
var globalStore = commonStore[_this.TID];
|
|
489
|
-
if (globalStore.data.locked > Lock.Readonly) {
|
|
495
|
+
if (this.data.locked > Lock.Readonly) {
|
|
490
496
|
return;
|
|
491
497
|
}
|
|
492
498
|
|
|
@@ -502,7 +508,7 @@ var ActiveLayer = /** @class */ (function (_super) {
|
|
|
502
508
|
this.calcControlPoints();
|
|
503
509
|
}
|
|
504
510
|
ctx.save();
|
|
505
|
-
ctx.strokeStyle =
|
|
511
|
+
ctx.strokeStyle = this.options.activeColor;
|
|
506
512
|
ctx.fillStyle = '#fff';
|
|
507
513
|
ctx.lineWidth = 1;
|
|
508
514
|
var TID = this.TID;
|
|
@@ -512,17 +518,17 @@ var ActiveLayer = /** @class */ (function (_super) {
|
|
|
512
518
|
var tmp = new Node(item, true);
|
|
513
519
|
tmp.setTID(TID);
|
|
514
520
|
tmp.data = null;
|
|
515
|
-
tmp.fillStyle =
|
|
521
|
+
tmp.fillStyle = null;
|
|
516
522
|
tmp.bkType = 0;
|
|
517
523
|
tmp.icon = '';
|
|
518
524
|
tmp.image = '';
|
|
519
|
-
tmp.text =
|
|
520
|
-
if
|
|
525
|
+
tmp.text = '';
|
|
526
|
+
if(window.location.pathname.includes('workspace')){
|
|
521
527
|
if (tmp.strokeStyle !== 'transparent') {
|
|
522
528
|
tmp.strokeStyle = '#ffffff';
|
|
523
529
|
tmp.lineWidth += 2;
|
|
524
530
|
tmp.render(ctx);
|
|
525
|
-
tmp.strokeStyle =
|
|
531
|
+
tmp.strokeStyle = this.options.activeColor;
|
|
526
532
|
tmp.lineWidth -= 2;
|
|
527
533
|
}
|
|
528
534
|
}
|
|
@@ -537,11 +543,11 @@ var ActiveLayer = /** @class */ (function (_super) {
|
|
|
537
543
|
bk.strokeStyle = '#ffffff';
|
|
538
544
|
bk.render(ctx);
|
|
539
545
|
}
|
|
540
|
-
tmp.strokeStyle =
|
|
541
|
-
tmp.fromArrowColor =
|
|
542
|
-
tmp.toArrowColor =
|
|
546
|
+
tmp.strokeStyle = this.options.activeColor;
|
|
547
|
+
tmp.fromArrowColor = this.options.activeColor;
|
|
548
|
+
tmp.toArrowColor = this.options.activeColor;
|
|
543
549
|
tmp.render(ctx);
|
|
544
|
-
if (!
|
|
550
|
+
if (!this.data.locked && !item.locked) {
|
|
545
551
|
drawLineFns[item.name].drawControlPointsFn(ctx, item);
|
|
546
552
|
}
|
|
547
553
|
}
|
|
@@ -567,7 +573,7 @@ var ActiveLayer = /** @class */ (function (_super) {
|
|
|
567
573
|
ctx.closePath();
|
|
568
574
|
ctx.stroke();
|
|
569
575
|
ctx.restore();
|
|
570
|
-
if (
|
|
576
|
+
if (this.data.locked || this.locked()) {
|
|
571
577
|
ctx.restore();
|
|
572
578
|
return;
|
|
573
579
|
}
|
|
@@ -583,7 +589,7 @@ var ActiveLayer = /** @class */ (function (_super) {
|
|
|
583
589
|
ctx.fill();
|
|
584
590
|
ctx.stroke();
|
|
585
591
|
// Draw size control points.绘制拖拽框四角的点
|
|
586
|
-
if (!
|
|
592
|
+
if (!this.options.hideSizeCP && (this.pens.length > 1 || !this.pens[0].hideSizeCP)) {
|
|
587
593
|
ctx.lineWidth = 1;
|
|
588
594
|
for (var _b = 0, _c = this.sizeCPs; _b < _c.length; _b++) {
|
|
589
595
|
var item = _c[_b];
|
|
@@ -600,7 +606,6 @@ var ActiveLayer = /** @class */ (function (_super) {
|
|
|
600
606
|
}
|
|
601
607
|
}
|
|
602
608
|
ctx.restore();
|
|
603
|
-
globalStore = null;
|
|
604
609
|
};
|
|
605
610
|
ActiveLayer.prototype.getDockWatchers = function () {
|
|
606
611
|
if (this.pens.length === 1) {
|
|
@@ -614,61 +619,61 @@ var ActiveLayer = /** @class */ (function (_super) {
|
|
|
614
619
|
this.dockWatchers = this.rect.toPoints();
|
|
615
620
|
this.dockWatchers.unshift(this.rect.center);
|
|
616
621
|
};
|
|
617
|
-
ActiveLayer.prototype.handleArbitrayGraphSize = function (type,
|
|
618
|
-
if
|
|
622
|
+
ActiveLayer.prototype.handleArbitrayGraphSize = function (type,item, offsetX, offsetY, l, sizeX, sizeY, nodeRectsCircles) {
|
|
623
|
+
if(item.name !== 'arbitraryGraph') return
|
|
619
624
|
|
|
620
|
-
|
|
625
|
+
switch (type) {
|
|
621
626
|
|
|
622
627
|
case 0:
|
|
623
628
|
|
|
624
|
-
for
|
|
629
|
+
for(let c=0, length = item.rect.circles.length; c<length; c++ ) {
|
|
625
630
|
|
|
626
|
-
item.rect.circles[c].x
|
|
631
|
+
item.rect.circles[c].x=item.rect.circles[c].x*sizeX+item.rect.ex*(1-sizeX);
|
|
627
632
|
|
|
628
|
-
item.rect.circles[c].y
|
|
633
|
+
item.rect.circles[c].y=item.rect.circles[c].y*sizeY+item.rect.ey*(1-sizeY);
|
|
629
634
|
|
|
630
635
|
}
|
|
631
636
|
|
|
632
|
-
|
|
637
|
+
break;
|
|
633
638
|
|
|
634
639
|
case 1:
|
|
635
640
|
|
|
636
|
-
for
|
|
641
|
+
for(let c=0, length = item.rect.circles.length; c<length; c++ ) {
|
|
637
642
|
|
|
638
|
-
item.rect.circles[c].x
|
|
643
|
+
item.rect.circles[c].x=item.rect.circles[c].x*sizeX+item.rect.x*(1-sizeX);
|
|
639
644
|
|
|
640
|
-
item.rect.circles[c].y
|
|
645
|
+
item.rect.circles[c].y=item.rect.circles[c].y*sizeY+item.rect.ey*(1-sizeY);
|
|
641
646
|
|
|
642
647
|
}
|
|
643
648
|
|
|
644
|
-
|
|
649
|
+
break;
|
|
645
650
|
|
|
646
651
|
case 2:
|
|
647
652
|
|
|
648
|
-
|
|
653
|
+
for(let c=0, length = item.rect.circles.length; c<length; c++ ) {
|
|
649
654
|
|
|
650
|
-
|
|
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);
|
|
651
658
|
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
}
|
|
659
|
+
}
|
|
655
660
|
|
|
656
|
-
|
|
661
|
+
break;
|
|
657
662
|
|
|
658
663
|
case 3:
|
|
659
664
|
|
|
660
|
-
for
|
|
665
|
+
for(let c=0, length = item.rect.circles.length; c<length; c++ ) {
|
|
661
666
|
|
|
662
|
-
item.rect.circles[c].x
|
|
667
|
+
item.rect.circles[c].x=item.rect.circles[c].x*sizeX+item.rect.ex*(1-sizeX);
|
|
663
668
|
|
|
664
|
-
item.rect.circles[c].y
|
|
669
|
+
item.rect.circles[c].y=item.rect.circles[c].y*sizeY+item.rect.y*(1-sizeY);
|
|
665
670
|
|
|
666
671
|
}
|
|
667
672
|
|
|
668
|
-
|
|
673
|
+
break
|
|
669
674
|
}
|
|
670
675
|
};
|
|
671
676
|
return ActiveLayer;
|
|
672
677
|
}(Layer));
|
|
673
678
|
export { ActiveLayer };
|
|
674
|
-
//# sourceMappingURL=activeLayer.js.map
|
|
679
|
+
//# sourceMappingURL=activeLayer.js.map
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import { Pen
|
|
1
|
+
import { Pen } from './models/pen';
|
|
2
|
+
import { Line } from './models/line';
|
|
3
|
+
import { TopologyData } from './models/data';
|
|
4
|
+
import { Options } from './options';
|
|
2
5
|
import { Layer } from './layer';
|
|
3
6
|
export declare class AnimateLayer extends Layer {
|
|
4
|
-
|
|
7
|
+
options: Options;
|
|
8
|
+
protected data: TopologyData;
|
|
5
9
|
pens: Map<any, any>;
|
|
6
10
|
private timer;
|
|
7
11
|
private lastNow;
|
|
8
12
|
private subscribeUpdate;
|
|
9
13
|
private subscribePlay;
|
|
10
|
-
constructor(TID: String);
|
|
14
|
+
constructor(options: Options, TID: String);
|
|
11
15
|
getAnimateLine(item: Pen): Line;
|
|
12
16
|
findLine(pen: Pen): Pen;
|
|
13
17
|
readyPlay(tag?: string, auto?: boolean, pens?: Pen[]): void;
|
package/core/src/animateLayer.js
CHANGED
|
@@ -12,19 +12,23 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
12
12
|
};
|
|
13
13
|
})();
|
|
14
14
|
import { Store } from 'le5le-store';
|
|
15
|
-
import { PenType
|
|
15
|
+
import { PenType } from './models/pen';
|
|
16
|
+
import { Node } from './models/node';
|
|
17
|
+
import { Line } from './models/line';
|
|
16
18
|
import { Layer } from './layer';
|
|
17
19
|
import { s8 } from './utils';
|
|
18
|
-
import { commonStore } from './store'
|
|
19
20
|
var AnimateLayer = /** @class */ (function (_super) {
|
|
20
21
|
__extends(AnimateLayer, _super);
|
|
21
|
-
function AnimateLayer(TID) {
|
|
22
|
+
function AnimateLayer(options, TID) {
|
|
23
|
+
if (options === void 0) { options = {}; }
|
|
22
24
|
var _this = _super.call(this, TID) || this;
|
|
25
|
+
_this.options = options;
|
|
23
26
|
_this.pens = new Map();
|
|
24
27
|
_this.lastNow = 0;
|
|
28
|
+
_this.data = Store.get(_this.generateStoreKey('topology-data'));
|
|
25
29
|
Store.set(_this.generateStoreKey('LT:AnimateLayer'), _this);
|
|
26
|
-
if (!
|
|
27
|
-
|
|
30
|
+
if (!_this.options.animateColor) {
|
|
31
|
+
_this.options.animateColor = '#ff6600';
|
|
28
32
|
}
|
|
29
33
|
_this.subscribeUpdate = Store.subscribe(_this.generateStoreKey('LT:updateLines'), function (lines) {
|
|
30
34
|
_this.updateLines(lines);
|
|
@@ -51,7 +55,7 @@ var AnimateLayer = /** @class */ (function (_super) {
|
|
|
51
55
|
l.animateStart = item.animateStart;
|
|
52
56
|
l.lineCap = 'round';
|
|
53
57
|
l.fillStyle = '#fff';
|
|
54
|
-
l.strokeStyle = l.animateColor ||
|
|
58
|
+
l.strokeStyle = l.animateColor || this.options.animateColor;
|
|
55
59
|
l.length = l.getLen();
|
|
56
60
|
if (!l.fromArrowColor) {
|
|
57
61
|
l.fromArrowColor = l.strokeStyle || '#222';
|
|
@@ -62,7 +66,7 @@ var AnimateLayer = /** @class */ (function (_super) {
|
|
|
62
66
|
return l;
|
|
63
67
|
};
|
|
64
68
|
AnimateLayer.prototype.findLine = function (pen) {
|
|
65
|
-
for (var _i = 0, _a =
|
|
69
|
+
for (var _i = 0, _a = this.data.pens; _i < _a.length; _i++) {
|
|
66
70
|
var item = _a[_i];
|
|
67
71
|
if (item.id === pen.data) {
|
|
68
72
|
return item;
|
|
@@ -71,13 +75,11 @@ var AnimateLayer = /** @class */ (function (_super) {
|
|
|
71
75
|
};
|
|
72
76
|
AnimateLayer.prototype.readyPlay = function (tag, auto, pens) {
|
|
73
77
|
var _this = this;
|
|
74
|
-
if(!commonStore || !commonStore[_this.TID]) return;
|
|
75
78
|
var readyPens = new Map();
|
|
76
79
|
if (!pens) {
|
|
77
|
-
pens =
|
|
80
|
+
pens = this.data.pens;
|
|
78
81
|
}
|
|
79
82
|
pens.forEach(function (pen) {
|
|
80
|
-
if(!(pen instanceof Node)) pen = new Node(pen);
|
|
81
83
|
pen.setTID(_this.TID);
|
|
82
84
|
if (!pen.visible || readyPens.get(pen.id)) {
|
|
83
85
|
return;
|
package/core/src/calling.d.ts
CHANGED
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
import {Options, Padding} from './options';
|
|
3
3
|
import { Offscreen } from './offscreen';
|
|
4
4
|
import { RenderLayer } from './renderLayer';
|
|
5
|
-
import { Pen, Point, Rect } from './models';
|
|
5
|
+
import { Pen, Node, Point, TopologyData, Rect } from './models';
|
|
6
6
|
export declare class Calling {
|
|
7
7
|
id: String;
|
|
8
|
+
data: TopologyData;
|
|
9
|
+
options: Options;
|
|
10
|
+
parentElem: HTMLElement;
|
|
8
11
|
canvas: RenderLayer;
|
|
9
12
|
offscreen: Offscreen;
|
|
10
13
|
private subcribeImage;
|