dcim-topology2d 1.1.6 → 3.0.2
Sign up to get free protection for your applications and to get access to all the features.
- 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 +0 -2
- package/chart-diagram/index.js +0 -1
- package/chart-diagram/src/echarts/index.d.ts +2 -1
- package/chart-diagram/src/echarts/index.js +104 -106
- 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 -1
- package/core/index.js +0 -1
- package/core/src/activeLayer.d.ts +10 -2
- package/core/src/activeLayer.js +41 -42
- 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 +41 -43
- package/core/src/canvas.d.ts +6 -1
- package/core/src/canvas.js +18 -17
- package/core/src/common.d.ts +5 -5
- package/core/src/common.js +202 -172
- package/core/src/core.d.ts +4 -3
- package/core/src/core.js +321 -339
- package/core/src/divLayer.d.ts +33 -2
- package/core/src/divLayer.js +292 -41
- package/core/src/healps/changeData.d.ts +1 -1
- package/core/src/healps/changeData.js +44 -102
- 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 -51
- package/core/src/middles/index.js +2 -3
- package/core/src/middles/nodes/pentagon.rect.js +1 -1
- 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/node.d.ts +0 -6
- package/core/src/models/node.js +16 -29
- package/core/src/models/pen.js +7 -16
- 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 +8 -10
- package/core/src/options.js +0 -1
- package/core/src/poll.js +2 -0
- package/core/src/preview.d.ts +13 -1
- package/core/src/preview.js +34 -56
- package/core/src/renderLayer.d.ts +3 -1
- package/core/src/renderLayer.js +31 -26
- 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/conversion.d.ts +0 -7
- package/core/src/utils/conversion.js +0 -54
- package/core/src/utils/dom.d.ts +5 -6
- package/core/src/utils/dom.js +46 -82
- package/core/src/utils/index.d.ts +0 -1
- package/core/src/utils/index.js +0 -1
- package/core/src/utils/onmousevent.js +3 -12
- 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/myShape.js +1 -1
- 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 -4
- package/chart-diagram/src/utils/changeOptions.js +0 -163
- package/chart-diagram/src/utils/conversion.d.ts +0 -17
- package/chart-diagram/src/utils/conversion.js +0 -179
- package/chart-diagram/src/utils/drawGraphic.d.ts +0 -3
- package/chart-diagram/src/utils/drawGraphic.js +0 -97
- package/chart-diagram/src/utils/index.d.ts +0 -3
- package/chart-diagram/src/utils/index.js +0 -3
- 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/iframe.d.ts +0 -2
- package/core/src/middles/nodes/iframe.js +0 -12
- package/core/src/middles/nodes/index.d.ts +0 -46
- package/core/src/middles/nodes/index.js +0 -47
- 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 -129
- package/core/src/store/data.js +0 -86
- 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 -3
- package/core/src/utils/assignment.js +0 -69
- package/static/echartsDefaultData.js +0 -239
- package/static/echartsStore.js +0 -14
- package/static/index.js +0 -2
- package/style/index.css +0 -13
@@ -1,2 +1,2 @@
|
|
1
|
-
import { Node } from '
|
1
|
+
import { Node } from 'dcim-topology/core';
|
2
2
|
export declare function activityFinal(ctx: CanvasRenderingContext2D, node: Node): void;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Point, Direction } from '
|
1
|
+
import { Point, Direction } from 'dcim-topology/core';
|
2
2
|
export function forkHAnchors(node) {
|
3
3
|
node.anchors.push(new Point(node.rect.x, node.rect.y + node.rect.height / 2, Direction.Left));
|
4
4
|
node.anchors.push(new Point(node.rect.ex, node.rect.y + node.rect.height / 2, Direction.Right));
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { Node } from '
|
1
|
+
import { Node } from 'dcim-topology/core';
|
2
2
|
export declare function fork(ctx: CanvasRenderingContext2D, node: Node): void;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { registerNode } from '
|
1
|
+
import { registerNode } from 'dcim-topology/core';
|
2
2
|
import { activityFinal, activityFinalIconRect, activityFinalTextRect } from './final';
|
3
3
|
import { fork, forkHAnchors, forkVAnchors, forkIconRect, forkTextRect } from './fork';
|
4
4
|
import { swimlaneH, swimlaneHIconRect, swimlaneHTextRect } from './swimlaneH';
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { Node } from '
|
1
|
+
import { Node } from 'dcim-topology/core';
|
2
2
|
export declare function swimlaneH(ctx: CanvasRenderingContext2D, node: Node): void;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { Node } from '
|
1
|
+
import { Node } from 'dcim-topology/core';
|
2
2
|
export declare function swimlaneV(ctx: CanvasRenderingContext2D, node: Node): void;
|
package/chart-diagram/index.d.ts
CHANGED
package/chart-diagram/index.js
CHANGED
@@ -1,106 +1,104 @@
|
|
1
|
-
import { s8, createDiv, rectangle
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
node.
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
}
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
//# sourceMappingURL=index.js.map
|
1
|
+
import { s8, createDiv, rectangle } from 'dcim-topology/core';
|
2
|
+
export let echartsData = {};
|
3
|
+
export function echarts(ctx, node) {
|
4
|
+
//console.log('echarts绘制-----node', node);
|
5
|
+
// 绘制一个底图,类似于占位符。
|
6
|
+
rectangle(ctx, node);
|
7
|
+
// tslint:disable-next-line:no-shadowed-variable
|
8
|
+
var echarts = echartsData.echarts || window.echarts;
|
9
|
+
if (!node.data || !echarts) {
|
10
|
+
return;
|
11
|
+
}
|
12
|
+
if (typeof node.data === 'string') {
|
13
|
+
node.data = JSON.parse(node.data);
|
14
|
+
}
|
15
|
+
if (!node.data.echarts) {
|
16
|
+
return;
|
17
|
+
}
|
18
|
+
if (!node.elementId) {
|
19
|
+
node.elementId = s8();
|
20
|
+
}
|
21
|
+
const currentElement = document.getElementById(node.id);
|
22
|
+
if (!node.elementLoaded && !currentElement) {
|
23
|
+
// if(echartsData[node.id]) {
|
24
|
+
// const appearCharts = echarts.getInstanceByDom(echartsData[node.id].div);
|
25
|
+
// if (appearCharts) echarts.dispose(appearCharts);
|
26
|
+
// echartsData[node.id] = null;
|
27
|
+
// }
|
28
|
+
echartsData[node.id] = {
|
29
|
+
div: createDiv(node)
|
30
|
+
};
|
31
|
+
node.elementLoaded = true;
|
32
|
+
document.body.appendChild(echartsData[node.id].div);
|
33
|
+
// 添加当前节点到div层
|
34
|
+
node.addToDiv('init');
|
35
|
+
echartsData[node.id].chart = echarts.init(echartsData[node.id].div, node.data.echarts.theme);
|
36
|
+
node.elementRendered = false;
|
37
|
+
// 等待父div先渲染完成,避免初始图表控件太大
|
38
|
+
setTimeout(function () {
|
39
|
+
echartsData[node.id].chart.resize();
|
40
|
+
});
|
41
|
+
}
|
42
|
+
if (!node.elementRendered) {
|
43
|
+
// 初始化时,等待父div先渲染完成,避免初始图表控件太大。
|
44
|
+
setTimeout(function () {
|
45
|
+
let option = {...node.data.echarts.option};
|
46
|
+
if(node.appearance.type === 'line' || node.appearance.type === 'bar') {
|
47
|
+
option.color = node.appearance.color;
|
48
|
+
option.xAxis[0].axisLabel.formatter = function(value, index){
|
49
|
+
if (index === 0 || index%(node.appearance.intervalNumX) === 0){
|
50
|
+
return value;
|
51
|
+
}
|
52
|
+
else {
|
53
|
+
return '';
|
54
|
+
}
|
55
|
+
}
|
56
|
+
|
57
|
+
option.yAxis[0].axisLabel.formatter = function(value, index){
|
58
|
+
if (index === 0 || index%(node.appearance.intervalNumY) === 0){
|
59
|
+
return value;
|
60
|
+
}
|
61
|
+
else {
|
62
|
+
return '';
|
63
|
+
}
|
64
|
+
}
|
65
|
+
// if(option.series.length >= 2) {
|
66
|
+
|
67
|
+
// for(let i=0; i<option.series.length-1 ; i++){
|
68
|
+
|
69
|
+
// option.color.push(node.appearance.color[0])
|
70
|
+
// }
|
71
|
+
// }
|
72
|
+
option.yAxis[0].splitLine = node.appearance.splitLine;
|
73
|
+
|
74
|
+
}else if(node.appearance.type === 'gauge') {
|
75
|
+
const pointerColor = node.appearance.pointerColor;
|
76
|
+
node.appearance.pointer.length = `${node.appearance.pointer.length}%`;
|
77
|
+
option.series[0].min = node.appearance.min;
|
78
|
+
option.series[0].max = node.appearance.max;
|
79
|
+
option.series[0].itemStyle.color = pointerColor ? pointerColor : node.appearance.axisLabel.color;
|
80
|
+
option.series[0].splitNumber = node.appearance.splitNumber;
|
81
|
+
option.series[0].pointer = node.appearance.pointer;
|
82
|
+
option.series[0].axisLabel = node.appearance.axisLabel;
|
83
|
+
option.series[0].axisLine.lineStyle = node.appearance.axisLine.lineStyle;
|
84
|
+
option.series[0].detail = node.appearance.detail;
|
85
|
+
//option.series[0].data = node.appearance.data;
|
86
|
+
if(option.isGaugeLinear) {
|
87
|
+
option.series[0].axisLine.lineStyle.color = [
|
88
|
+
[1, new echarts.graphic.LinearGradient(0, 0, 1, 0, option.linearColors)]
|
89
|
+
]
|
90
|
+
}
|
91
|
+
}else if(node.appearance.type === 'ring') {
|
92
|
+
option.series[0].radius = [`${node.appearance.innerRadius}%`, `${node.appearance.outerRadius}%`];
|
93
|
+
option.series[0].label = node.appearance.label;
|
94
|
+
}
|
95
|
+
option.title = node.appearance.title;
|
96
|
+
option.backgroundColor = node.appearance.backgroundColor;
|
97
|
+
echartsData[node.id].chart.clear();
|
98
|
+
echartsData[node.id].chart.setOption(option);
|
99
|
+
echartsData[node.id].chart.resize();
|
100
|
+
node.elementRendered = true;
|
101
|
+
});
|
102
|
+
}
|
103
|
+
}
|
104
|
+
//# sourceMappingURL=index.js.map
|
@@ -1,13 +1,12 @@
|
|
1
|
-
import { registerNode } from '
|
2
|
-
import { echarts } from './echarts';
|
3
|
-
import
|
4
|
-
// import './echarts/echarts.min.js';
|
1
|
+
import { registerNode, loadJS } from 'dcim-topology/core';
|
2
|
+
import { echarts, echartsData } from './echarts';
|
3
|
+
import './echarts/echarts.min.js';
|
5
4
|
export function register(_echarts) {
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
5
|
+
echartsData.echarts = _echarts;
|
6
|
+
if (process.browser && !echartsData.echarts && !window.echarts) {
|
7
|
+
//loadJS('https://cdn.bootcdn.net/ajax/libs/echarts/4.8.0/echarts.min.js', null, true);
|
8
|
+
loadJS(`${location.origin}/libary/echarts.min.js`, null, true);
|
9
|
+
}
|
11
10
|
registerNode('echarts', echarts, null, null, null);
|
12
11
|
}
|
13
12
|
//# sourceMappingURL=register.js.map
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Node } from '
|
1
|
+
import { Node } from 'dcim-topology/core';
|
2
2
|
export declare function simpleClassIconRect(node: Node): void;
|
3
3
|
export declare function simpleClassTextRect(node: Node): void;
|
4
4
|
export declare function interfaceClassIconRect(node: Node): void;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { registerNode } from '
|
1
|
+
import { registerNode } from 'dcim-topology/core';
|
2
2
|
import { simpleClass, simpleClassIconRect, simpleClassTextRect, interfaceClass, interfaceClassIconRect, interfaceClassTextRect } from './class';
|
3
3
|
export function register() {
|
4
4
|
registerNode('simpleClass', simpleClass, null, simpleClassIconRect, simpleClassTextRect);
|
package/core/index.d.ts
CHANGED
package/core/index.js
CHANGED
@@ -6,7 +6,6 @@ export * from './src/utils';
|
|
6
6
|
export * from './src/models';
|
7
7
|
export * from './src/middles';
|
8
8
|
export * from './src/healps';
|
9
|
-
export * from './src/store';
|
10
9
|
//# sourceMappingURL=index.js.map
|
11
10
|
import axios from 'axios'
|
12
11
|
if(axios.defaults.headers.common) axios.defaults.headers.common['Authorization'] = getToken();
|
@@ -1,7 +1,15 @@
|
|
1
|
-
import {
|
1
|
+
import { Options } from './options';
|
2
|
+
import { Pen } from './models/pen';
|
3
|
+
import { Node } from './models/node';
|
4
|
+
import { Line } from './models/line';
|
5
|
+
import { Rect } from './models/rect';
|
6
|
+
import { Point } from './models/point';
|
7
|
+
import { TopologyData } from './models/data';
|
2
8
|
import { Layer } from './layer';
|
3
9
|
import { Topology } from './core';
|
4
10
|
export declare class ActiveLayer extends Layer {
|
11
|
+
options: Options;
|
12
|
+
protected data: TopologyData;
|
5
13
|
rotateCPs: Point[];
|
6
14
|
sizeCPs: Point[];
|
7
15
|
rect: Rect;
|
@@ -18,7 +26,7 @@ export declare class ActiveLayer extends Layer {
|
|
18
26
|
dockWatchers: Point[];
|
19
27
|
topology: Topology;
|
20
28
|
rotating: boolean;
|
21
|
-
constructor(TID: String);
|
29
|
+
constructor(options: Options, TID: String);
|
22
30
|
calcControlPoints(): void;
|
23
31
|
locked(): boolean;
|
24
32
|
getPoints(): Point[];
|