dcim-topology2d 1.1.3 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- package/chart-diagram/index.d.ts +2 -0
- package/chart-diagram/index.js +1 -0
- package/chart-diagram/src/echarts/index.d.ts +0 -1
- package/chart-diagram/src/echarts/index.js +106 -107
- package/chart-diagram/src/register.js +4 -3
- package/chart-diagram/src/utils/changeOptions.d.ts +4 -0
- package/chart-diagram/src/utils/changeOptions.js +163 -0
- package/chart-diagram/src/utils/conversion.d.ts +17 -0
- package/chart-diagram/src/utils/conversion.js +179 -0
- package/chart-diagram/src/utils/drawGraphic.d.ts +3 -0
- package/chart-diagram/src/utils/drawGraphic.js +97 -0
- package/chart-diagram/src/utils/index.d.ts +3 -0
- package/chart-diagram/src/utils/index.js +3 -0
- package/core/src/common.js +27 -30
- package/core/src/core.js +84 -59
- package/core/src/divLayer.d.ts +0 -26
- package/core/src/divLayer.js +22 -276
- package/core/src/healps/changeData.js +45 -22
- package/core/src/middles/arrows/index.d.ts +4 -0
- package/core/src/middles/arrows/index.js +5 -0
- package/core/src/middles/default.d.ts +1 -3
- package/core/src/middles/default.js +51 -51
- package/core/src/middles/index.js +3 -2
- package/core/src/middles/lines/index.d.ts +4 -0
- package/core/src/middles/lines/index.js +5 -0
- package/core/src/middles/nodes/iframe.d.ts +2 -0
- package/core/src/middles/nodes/iframe.js +12 -0
- package/core/src/middles/nodes/index.d.ts +46 -0
- package/core/src/middles/nodes/index.js +47 -0
- package/core/src/middles/nodes/pentagon.rect.js +1 -1
- package/core/src/middles/nodes/rectangle.rect.js +1 -1
- package/core/src/models/node.d.ts +6 -0
- package/core/src/models/node.js +16 -6
- package/core/src/preview.js +14 -0
- package/core/src/store/data.js +2 -0
- package/core/src/utils/dom.d.ts +2 -0
- package/core/src/utils/dom.js +66 -32
- package/package.json +1 -1
- package/static/echartsDefaultData.js +239 -95
- package/static/echartsStore.js +14 -0
- package/static/index.js +2 -1
- package/style/index.css +3 -0
@@ -0,0 +1,97 @@
|
|
1
|
+
// 绘制柱子切面
|
2
|
+
export function drawGraphicShape(appearance) {
|
3
|
+
const offsetX = appearance.offsetX;
|
4
|
+
const offsetY = appearance.offsetY;
|
5
|
+
// 绘制左侧面
|
6
|
+
const CubeLeft = echarts.graphic.extendShape({
|
7
|
+
shape: {
|
8
|
+
x: 0,
|
9
|
+
y: 0,
|
10
|
+
},
|
11
|
+
buildPath: function (ctx, shape) {
|
12
|
+
// 会canvas的应该都能看得懂,shape是从custom传入的
|
13
|
+
const xAxisPoint = shape.xAxisPoint;
|
14
|
+
// console.log(shape);
|
15
|
+
const c0 = [shape.x, shape.y];
|
16
|
+
const c1 = [shape.x - offsetX, shape.y - offsetY];
|
17
|
+
const c2 = [xAxisPoint[0] - offsetX, xAxisPoint[1] - offsetY];
|
18
|
+
const c3 = [xAxisPoint[0], xAxisPoint[1]];
|
19
|
+
ctx.moveTo(c0[0], c0[1]).lineTo(c1[0], c1[1]).lineTo(c2[0], c2[1]).lineTo(c3[0], c3[1]).closePath();
|
20
|
+
},
|
21
|
+
});
|
22
|
+
// 绘制右侧面
|
23
|
+
const CubeRight = echarts.graphic.extendShape({
|
24
|
+
shape: {
|
25
|
+
x: 0,
|
26
|
+
y: 0,
|
27
|
+
},
|
28
|
+
buildPath: function (ctx, shape) {
|
29
|
+
const xAxisPoint = shape.xAxisPoint;
|
30
|
+
const c1 = [shape.x, shape.y];
|
31
|
+
const c2 = [xAxisPoint[0], xAxisPoint[1]];
|
32
|
+
const c3 = [xAxisPoint[0] + offsetX, xAxisPoint[1] - offsetY];
|
33
|
+
const c4 = [shape.x + offsetX, shape.y - offsetY];
|
34
|
+
ctx.moveTo(c1[0], c1[1]).lineTo(c2[0], c2[1]).lineTo(c3[0], c3[1]).lineTo(c4[0], c4[1]).closePath();
|
35
|
+
},
|
36
|
+
});
|
37
|
+
// 绘制顶面
|
38
|
+
const CubeTop = echarts.graphic.extendShape({
|
39
|
+
shape: {
|
40
|
+
x: 0,
|
41
|
+
y: 0,
|
42
|
+
},
|
43
|
+
buildPath: function (ctx, shape) {
|
44
|
+
const c1 = [shape.x, shape.y];
|
45
|
+
const c2 = [shape.x + offsetX, shape.y - offsetY]; //右点
|
46
|
+
const c3 = [shape.x, shape.y - offsetX];
|
47
|
+
const c4 = [shape.x - offsetX, shape.y - offsetY];
|
48
|
+
ctx.moveTo(c1[0], c1[1]).lineTo(c2[0], c2[1]).lineTo(c3[0], c3[1]).lineTo(c4[0], c4[1]).closePath();
|
49
|
+
},
|
50
|
+
});
|
51
|
+
return {
|
52
|
+
CubeLeft,
|
53
|
+
CubeRight,
|
54
|
+
CubeTop
|
55
|
+
}
|
56
|
+
}
|
57
|
+
// 线性渐变
|
58
|
+
export function graphicLinearGradient(nr, nb, nl, nt, colors) {
|
59
|
+
return new echarts.graphic.LinearGradient(nr, nb, nl, nt, colors);
|
60
|
+
}
|
61
|
+
export function setSeriesRenderGroup(appearance, api) {
|
62
|
+
const seriesRenderData = [];
|
63
|
+
const groupTypeData = ['CubeLeft', 'CubeRight', 'CubeTop'];
|
64
|
+
const location = api.coord([api.value(0), api.value(1)]);
|
65
|
+
for (let i = 0; i < groupTypeData.length; i++) {
|
66
|
+
const groupItem = groupTypeData[i];
|
67
|
+
const groupNode = {
|
68
|
+
type: groupItem,
|
69
|
+
shape: {
|
70
|
+
api,
|
71
|
+
xValue: api.value(0),
|
72
|
+
yValue: api.value(1),
|
73
|
+
x: location[0],
|
74
|
+
y: location[1],
|
75
|
+
xAxisPoint: api.coord([api.value(0), 0]),
|
76
|
+
}
|
77
|
+
};
|
78
|
+
if(i === groupTypeData.length - 1){
|
79
|
+
// 顶部切面颜色填充
|
80
|
+
groupNode.style = {
|
81
|
+
fill: appearance.seriesCubeTopColor
|
82
|
+
}
|
83
|
+
}else {
|
84
|
+
// 左右切面颜色填充
|
85
|
+
let fillColor = graphicLinearGradient(0, 0, 0, 1, appearance[`series${groupItem}Gradient`]);
|
86
|
+
const cubeColorLinear = appearance[`series${groupItem}Linear`];
|
87
|
+
if(!cubeColorLinear) {
|
88
|
+
fillColor = appearance[`series${groupItem}Color`];
|
89
|
+
}
|
90
|
+
groupNode.style = {
|
91
|
+
fill: fillColor
|
92
|
+
}
|
93
|
+
}
|
94
|
+
seriesRenderData.push(groupNode);
|
95
|
+
}
|
96
|
+
return seriesRenderData;
|
97
|
+
}
|
package/core/src/common.js
CHANGED
@@ -10,7 +10,7 @@ import { useStore, clearStore } from './store'
|
|
10
10
|
import {POLL} from './poll';
|
11
11
|
import axios from 'axios';
|
12
12
|
import * as mqtt from './mqtt.min';
|
13
|
-
import {
|
13
|
+
import { destroyEcharts } from "../../static";
|
14
14
|
|
15
15
|
var MoveInType;
|
16
16
|
(function (MoveInType) {
|
@@ -52,10 +52,10 @@ var Common = /** @class */ (function () {
|
|
52
52
|
this.store.options.interval = 50;
|
53
53
|
//Store.set(this.generateStoreKey('topology-data'), this.data);
|
54
54
|
var id = this.id;
|
55
|
-
this.animateLayer = new AnimateLayer(id);
|
56
|
-
this.offscreen = new Offscreen(id);
|
55
|
+
this.animateLayer = new AnimateLayer(id);
|
56
|
+
this.offscreen = new Offscreen(id);
|
57
57
|
this.canvas = new RenderLayer(id);
|
58
|
-
this.divLayer = new DivLayer(id);
|
58
|
+
this.divLayer = new DivLayer(id);
|
59
59
|
this.divLayer.canvas.tabIndex = 0;
|
60
60
|
this.divLayer.canvas.ondblclick = this.ondblclick;
|
61
61
|
this.divLayer.canvas.onblur = function () {
|
@@ -185,11 +185,11 @@ var Common = /** @class */ (function () {
|
|
185
185
|
}
|
186
186
|
Object.assign(this.store.data, data);
|
187
187
|
this.store.data.pens = [];
|
188
|
-
this.setBKImageRect();
|
189
188
|
this.openCount = 0
|
190
189
|
// for old data.
|
191
190
|
if (data.nodes) {
|
192
191
|
for (var _i = 0, _a = data.nodes; _i < _a.length; _i++) {
|
192
|
+
_a[_i].TID = this.id;
|
193
193
|
const item = new Node(_a[_i]);
|
194
194
|
this.store.data.pens.push(item);
|
195
195
|
this.store.pens[item.id] = item;
|
@@ -200,6 +200,7 @@ var Common = /** @class */ (function () {
|
|
200
200
|
}
|
201
201
|
}
|
202
202
|
for (var _b = 0, _c = data.lines; _b < _c.length; _b++) {
|
203
|
+
_c[_b].TID = this.id;
|
203
204
|
const item = new Line(_c[_b]);
|
204
205
|
this.store.data.pens.push(item);
|
205
206
|
this.store.pens[item.id] = item;
|
@@ -209,6 +210,7 @@ var Common = /** @class */ (function () {
|
|
209
210
|
if (data.pens) {
|
210
211
|
for (var _d = 0, _e = data.pens; _d < _e.length; _d++) {
|
211
212
|
const item = _e[_d];
|
213
|
+
item.TID = this.id;
|
212
214
|
if (!item.from) {
|
213
215
|
const node = new Node(item);
|
214
216
|
this.store.data.pens.push(node);
|
@@ -233,18 +235,6 @@ var Common = /** @class */ (function () {
|
|
233
235
|
this.store.parentElem.scrollLeft = 0;
|
234
236
|
this.store.parentElem.scrollTop = 0;
|
235
237
|
};
|
236
|
-
Common.prototype.setBKImageRect = function () {
|
237
|
-
if (this.store.data.bkImageRect) {
|
238
|
-
this.store.data.bkImageRect.x = this.store.data.bkImageRect.x ? Number(this.store.data.bkImageRect.x) : 0;
|
239
|
-
this.store.data.bkImageRect.y = this.store.data.bkImageRect.y ? Number(this.store.data.bkImageRect.y) : 0;
|
240
|
-
this.store.data.bkImageRect.width = this.store.data.bkImageRect.width ? Number(this.store.data.bkImageRect.width) : this.canvas.width;
|
241
|
-
this.store.data.bkImageRect.height = this.store.data.bkImageRect.height ? Number(this.store.data.bkImageRect.height) : this.canvas.height;
|
242
|
-
this.store.data.bkImageRect.center = {
|
243
|
-
x: this.store.data.bkImageRect.x + this.store.data.bkImageRect.width / 2,
|
244
|
-
y: this.store.data.bkImageRect.y + this.store.data.bkImageRect.height / 2
|
245
|
-
}
|
246
|
-
}
|
247
|
-
};
|
248
238
|
Common.prototype.setSwitchTabData = function (node, index, type) {
|
249
239
|
if (type) {
|
250
240
|
let topologyChangeData = Store.get('TCD:topologyChangeData');
|
@@ -278,12 +268,12 @@ var Common = /** @class */ (function () {
|
|
278
268
|
};
|
279
269
|
Common.prototype.canvasResize = function (size) {
|
280
270
|
try {
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
271
|
+
this.canvas.resize(size);
|
272
|
+
//this.canvas.bkImgRectResize(size);
|
273
|
+
this.offscreen.resize(size);
|
274
|
+
this.divLayer.resize(size);
|
285
275
|
}catch (err) {
|
286
|
-
|
276
|
+
//console.log('resize-----', err)
|
287
277
|
}
|
288
278
|
};
|
289
279
|
// Render or redraw
|
@@ -887,7 +877,7 @@ var Common = /** @class */ (function () {
|
|
887
877
|
let path = '';
|
888
878
|
let assetData = null;
|
889
879
|
let pathRewrite = this.pathRewrite;
|
890
|
-
let canvasData =
|
880
|
+
let canvasData = this.store.data;
|
891
881
|
let mqttTopics = this.store.data.mqttTopics;
|
892
882
|
let tagParamsData = tagParams;
|
893
883
|
let detailJson = null;
|
@@ -963,6 +953,7 @@ var Common = /** @class */ (function () {
|
|
963
953
|
// console.log('收到消息', syncData)
|
964
954
|
Store.set('mqtt:responseData', syncData);
|
965
955
|
data.pens.map((item) => {
|
956
|
+
item.TID = this.id;
|
966
957
|
if (item.children && item.children.length) {
|
967
958
|
item.children.map((_item) => {
|
968
959
|
item.defaultFillStyle = item.fillStyle;
|
@@ -991,9 +982,12 @@ var Common = /** @class */ (function () {
|
|
991
982
|
}
|
992
983
|
})
|
993
984
|
//console.log('定制函数=====')
|
994
|
-
|
995
|
-
|
996
|
-
|
985
|
+
try {
|
986
|
+
const func = new Function('pen', 'params', dataValue.value)
|
987
|
+
func(_item, JSON.stringify(retData))
|
988
|
+
}catch (e) {
|
989
|
+
console.log(`自定义函数 ${item.id} 出错>>>`, e);
|
990
|
+
}
|
997
991
|
} else {
|
998
992
|
// console.log('默认函数')
|
999
993
|
setConfItemNode(_item, syncData);
|
@@ -1026,10 +1020,12 @@ var Common = /** @class */ (function () {
|
|
1026
1020
|
}
|
1027
1021
|
}
|
1028
1022
|
});
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1023
|
+
try {
|
1024
|
+
const func = new Function('pen', 'params', dataValue.value);
|
1025
|
+
func(item, JSON.stringify(retData));
|
1026
|
+
}catch (e) {
|
1027
|
+
console.log(`自定义函数 ${item.id} 出错>>>`, e);
|
1028
|
+
}
|
1033
1029
|
} else {
|
1034
1030
|
// console.log('默认函数')
|
1035
1031
|
setConfItemNode(item, syncData);
|
@@ -1264,6 +1260,7 @@ var Common = /** @class */ (function () {
|
|
1264
1260
|
this.offscreen.destroy();
|
1265
1261
|
this.offscreen = null;
|
1266
1262
|
this.store.parentElem = null;
|
1263
|
+
destroyEcharts();
|
1267
1264
|
Store.set('form:tableData', null);
|
1268
1265
|
Store.set('TIMEOUT:currentPage', `empty${this.s8()}`);
|
1269
1266
|
Store.set('FORM:tableData', {
|
package/core/src/core.js
CHANGED
@@ -47,6 +47,7 @@ var Topology = (function (_super) {
|
|
47
47
|
close: false, //闭合
|
48
48
|
};
|
49
49
|
_this.onMouseMove = function (e) {
|
50
|
+
_this.store.data.dataResize = 0;
|
50
51
|
if (Store.get('addingArbitraryGraph')) {
|
51
52
|
return
|
52
53
|
}
|
@@ -339,6 +340,7 @@ var Topology = (function (_super) {
|
|
339
340
|
});
|
340
341
|
};
|
341
342
|
_this.onmousedown = function (e) {
|
343
|
+
_this.store.data.dataResize = 0;
|
342
344
|
if (e.button !== 0)
|
343
345
|
return;
|
344
346
|
var canvasPos = _this.divLayer.canvas.getBoundingClientRect();
|
@@ -691,20 +693,7 @@ var Topology = (function (_super) {
|
|
691
693
|
isDragging: false, //是否在抓取
|
692
694
|
close: false, //闭合
|
693
695
|
};
|
694
|
-
|
695
|
-
// 温湿度元件
|
696
|
-
let activeTempNodes = []
|
697
|
-
_this.dropNodes([obj.children[0]], event.offsetX - 23.5, event.offsetY)
|
698
|
-
activeTempNodes.push(_this.activeLayer.pens[0])
|
699
|
-
_this.dropNodes([obj.children[1]], event.offsetX + 11.5, event.offsetY - 8.5)
|
700
|
-
activeTempNodes.push(_this.activeLayer.pens[0])
|
701
|
-
_this.dropNodes([obj.children[2]], event.offsetX + 11.5, event.offsetY + 8.5)
|
702
|
-
activeTempNodes.push(_this.activeLayer.pens[0])
|
703
|
-
_this.activeLayer.pens = activeTempNodes
|
704
|
-
_this.combine(activeTempNodes, null, 'temp');
|
705
|
-
} else {
|
706
|
-
_this.dropNodes(Array.isArray(obj) ? obj : [obj], event.offsetX, event.offsetY);
|
707
|
-
}
|
696
|
+
_this.dropNodes(Array.isArray(obj) ? obj : [obj], event.offsetX, event.offsetY);
|
708
697
|
} catch (_a) {
|
709
698
|
}
|
710
699
|
};
|
@@ -863,49 +852,16 @@ var Topology = (function (_super) {
|
|
863
852
|
}
|
864
853
|
|
865
854
|
if (json.name == 'define') {
|
866
|
-
|
867
855
|
// console.log('创建自定义组件 ', json);
|
868
|
-
|
869
856
|
console.log('store 中的 自定义 ', Store.get('defineNode'));
|
870
|
-
|
871
|
-
|
872
|
-
//
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
let renderNodesList = [];
|
877
|
-
|
878
|
-
for (let i = 0, len = nodesList.length; i < len; i++) {
|
879
|
-
|
880
|
-
nodesList[i].rect.x = offsetX - nodesList[i].rect.width / 2;
|
881
|
-
|
882
|
-
nodesList[i].rect.y = offsetY - nodesList[i].rect.height / 2;
|
883
|
-
|
884
|
-
let node = new Node(nodesList[i]);
|
885
|
-
|
886
|
-
node.setTID(s8());
|
887
|
-
node.id = s8();
|
888
|
-
node.fileId = defineNode.fileId;
|
889
|
-
|
890
|
-
// console.log('push之前的node', node);
|
891
|
-
|
892
|
-
_this.store.data.pens.push(node);
|
893
|
-
|
894
|
-
renderNodesList.push(node);
|
895
|
-
}
|
896
|
-
_this.activeLayer.setPens([renderNodesList[0]]);
|
897
|
-
|
898
|
-
_this.render(false);
|
899
|
-
|
900
|
-
_this.animate(true);
|
901
|
-
|
902
|
-
_this.cache();
|
903
|
-
|
904
|
-
_this.dispatch('addNode', renderNodesList[0]);
|
905
|
-
|
906
|
-
} else {
|
857
|
+
_this.dropDefineNode(json, offsetX, offsetY);
|
858
|
+
} else if(json.name === 'temp') {
|
859
|
+
// 温湿度元件
|
860
|
+
_this.dropTempNode(json);
|
861
|
+
}else {
|
907
862
|
var node = new Node(json);
|
908
863
|
if(node.name === 'echarts') node.dash = 4;
|
864
|
+
if(node.name === 'iframe') node.iframe = 'http://www.yingzeshiji.com.cn/'; // 默认展示盈泽世纪官网
|
909
865
|
node.setTID(_this.id);
|
910
866
|
node.clearChildrenIds();
|
911
867
|
_this.addNode(node, true);
|
@@ -922,6 +878,75 @@ var Topology = (function (_super) {
|
|
922
878
|
});
|
923
879
|
this.divLayer.canvas.focus();
|
924
880
|
};
|
881
|
+
Topology.prototype.setNodeData = function(node) {
|
882
|
+
const item = new Node(node);
|
883
|
+
item.setTID(this.id);
|
884
|
+
item.clearChildrenIds();
|
885
|
+
return item;
|
886
|
+
};
|
887
|
+
// 添加温湿度元件
|
888
|
+
Topology.prototype.dropTempNode = function(json) {
|
889
|
+
const nodeChildren = json.children;
|
890
|
+
delete json['children'];
|
891
|
+
const node = this.setNodeData(json);
|
892
|
+
const combinTempData = [];
|
893
|
+
let nodeX = node.rect.x;
|
894
|
+
let nodeY = node.rect.y;
|
895
|
+
for (let i = 0; i < nodeChildren.length; i++) {
|
896
|
+
const childNode = this.setNodeData(nodeChildren[i]);
|
897
|
+
childNode.rect.x = i === 0 ? nodeX : nodeX + childNode.rect.width / 2;
|
898
|
+
childNode.rect.y = i === 2 ? nodeY + childNode.rect.height + 1 : nodeY;
|
899
|
+
childNode.rect.center = {
|
900
|
+
x: childNode.rect.x + childNode.rect.width / 2,
|
901
|
+
y: childNode.rect.y + childNode.rect.height / 2
|
902
|
+
}
|
903
|
+
childNode.rect.ex = childNode.rect.x + childNode.rect.width;
|
904
|
+
childNode.rect.ey = childNode.rect.y + childNode.rect.height;
|
905
|
+
combinTempData.push(childNode);
|
906
|
+
}
|
907
|
+
this.combine(combinTempData, null, 'temp');
|
908
|
+
this.render();
|
909
|
+
this.cache();
|
910
|
+
};
|
911
|
+
// 添加自定义元件
|
912
|
+
Topology.prototype.dropDefineNode = function(josn, offsetX, offsetY) {
|
913
|
+
var _this = this;
|
914
|
+
if (_this.store.data.locked) return
|
915
|
+
// let defineNode = Store.get('defineNode');
|
916
|
+
// let nodesList = Store.get('defineNode').pens;
|
917
|
+
let defineNode = JSON.parse(localStorage.getItem("defineNode_"))
|
918
|
+
let nodesList = defineNode.pens;
|
919
|
+
|
920
|
+
let renderNodesList = [];
|
921
|
+
|
922
|
+
for (let i = 0, len = nodesList.length; i < len; i++) {
|
923
|
+
|
924
|
+
nodesList[i].rect.x = offsetX - nodesList[i].rect.width / 2;
|
925
|
+
|
926
|
+
nodesList[i].rect.y = offsetY - nodesList[i].rect.height / 2;
|
927
|
+
|
928
|
+
let node = new Node(nodesList[i]);
|
929
|
+
|
930
|
+
node.setTID(s8());
|
931
|
+
node.id = s8();
|
932
|
+
node.fileId = defineNode.fileId;
|
933
|
+
|
934
|
+
// console.log('push之前的node', node);
|
935
|
+
|
936
|
+
_this.store.data.pens.push(node);
|
937
|
+
|
938
|
+
renderNodesList.push(node);
|
939
|
+
}
|
940
|
+
_this.activeLayer.setPens([renderNodesList[0]]);
|
941
|
+
|
942
|
+
_this.render(false);
|
943
|
+
|
944
|
+
_this.animate(true);
|
945
|
+
|
946
|
+
_this.cache();
|
947
|
+
|
948
|
+
_this.dispatch('addNode', renderNodesList[0]);
|
949
|
+
};
|
925
950
|
Topology.prototype.addNode = function (node, focus, visit) {
|
926
951
|
if (focus === void 0) {
|
927
952
|
focus = false;
|
@@ -947,14 +972,13 @@ var Topology = (function (_super) {
|
|
947
972
|
this.store.data.pens.push(node);
|
948
973
|
this.setSwitchTabData(node, this.store.data.pens.length-1);
|
949
974
|
if (focus) {
|
975
|
+
this.render();
|
976
|
+
this.animate(true);
|
977
|
+
this.cache();
|
950
978
|
if(!visit) {
|
951
979
|
this.activeLayer.setPens([node]);
|
952
980
|
this.dispatch('addNode', node);
|
953
981
|
}
|
954
|
-
this.render();
|
955
|
-
this.animate(true);
|
956
|
-
this.cache();
|
957
|
-
this.dispatch('addNode', node);
|
958
982
|
}
|
959
983
|
return node;
|
960
984
|
};
|
@@ -1006,7 +1030,7 @@ var Topology = (function (_super) {
|
|
1006
1030
|
if (height < rect.height) {
|
1007
1031
|
height = rect.height;
|
1008
1032
|
}
|
1009
|
-
this.resize({width: width
|
1033
|
+
this.resize({width: width, height: height});
|
1010
1034
|
return rect;
|
1011
1035
|
}catch (e){
|
1012
1036
|
//console.log('init-error-----------',e)
|
@@ -1072,6 +1096,7 @@ var Topology = (function (_super) {
|
|
1072
1096
|
}
|
1073
1097
|
}
|
1074
1098
|
}
|
1099
|
+
this.store.data.dataResize = 1;
|
1075
1100
|
this.divLayer.canvas.style.cursor = 'default';
|
1076
1101
|
var len = this.store.data.pens.length;
|
1077
1102
|
for (var i = len - 1; i > -1; --i) {
|
@@ -1841,7 +1866,7 @@ var Topology = (function (_super) {
|
|
1841
1866
|
this.store.data.pens.splice(i + 1, 1);
|
1842
1867
|
}
|
1843
1868
|
};
|
1844
|
-
Topology.prototype.combine = function (pens, stand, temp) {
|
1869
|
+
Topology.prototype.combine = function (pens, stand, temp, rect) {
|
1845
1870
|
if (stand === void 0) {
|
1846
1871
|
stand = false;
|
1847
1872
|
}
|
package/core/src/divLayer.d.ts
CHANGED
@@ -2,28 +2,6 @@ import { Node } from './models';
|
|
2
2
|
import { Layer } from './layer';
|
3
3
|
export declare class DivLayer extends Layer {
|
4
4
|
canvas: HTMLDivElement;
|
5
|
-
player: HTMLDivElement;
|
6
|
-
curNode: Node;
|
7
|
-
playBtn: HTMLElement;
|
8
|
-
currentTime: HTMLElement;
|
9
|
-
progressCurrent: HTMLElement;
|
10
|
-
progress: HTMLElement;
|
11
|
-
loop: HTMLElement;
|
12
|
-
media: HTMLMediaElement;
|
13
|
-
videos: {
|
14
|
-
[key: string]: {
|
15
|
-
player: HTMLElement;
|
16
|
-
current: HTMLElement;
|
17
|
-
media: HTMLMediaElement;
|
18
|
-
};
|
19
|
-
};
|
20
|
-
audios: {
|
21
|
-
[key: string]: {
|
22
|
-
player: HTMLElement;
|
23
|
-
current: HTMLElement;
|
24
|
-
media: HTMLMediaElement;
|
25
|
-
};
|
26
|
-
};
|
27
5
|
iframes: {
|
28
6
|
[key: string]: HTMLIFrameElement;
|
29
7
|
};
|
@@ -37,10 +15,6 @@ export declare class DivLayer extends Layer {
|
|
37
15
|
private subcribeNode;
|
38
16
|
constructor(TID: String);
|
39
17
|
addDiv: (node: Node) => void;
|
40
|
-
createPlayer(): void;
|
41
|
-
getMediaCurrent(): void;
|
42
|
-
addMedia(node: Node, type: string): HTMLDivElement;
|
43
|
-
playNext(next: string): void;
|
44
18
|
addIframe(node: Node): HTMLIFrameElement;
|
45
19
|
addGif(node: Node): HTMLImageElement;
|
46
20
|
setElemPosition(node: Node, elem: HTMLElement): void;
|