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
|
@@ -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,112 +1,104 @@
|
|
|
1
|
-
import {s8, createDiv, rectangle
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
setMapScatterOptions,
|
|
5
|
-
setMapLineBarOptions,
|
|
6
|
-
setMapGaugeOptions,
|
|
7
|
-
setMapRingOptions,
|
|
8
|
-
setMap3dBarOptions,
|
|
9
|
-
setMapTopOptions,
|
|
10
|
-
setMapGlobalOptions,
|
|
11
|
-
setMapDataOptions,
|
|
12
|
-
initBindCorrelationSetting
|
|
13
|
-
} from '../utils';
|
|
14
|
-
import {echartsTypeMap} from '../../../static';
|
|
15
|
-
|
|
1
|
+
import { s8, createDiv, rectangle } from 'dcim-topology/core';
|
|
2
|
+
export let echartsData = {};
|
|
16
3
|
export function echarts(ctx, node) {
|
|
17
|
-
const currentStore = commonStore[node.TID];
|
|
18
|
-
if (!(currentStore && currentStore.data.dataResize)) return;
|
|
19
4
|
//console.log('echarts绘制-----node', node);
|
|
20
|
-
// if(currentElement) currentElement.style.display = !node.visible ? 'none': 'block';
|
|
21
|
-
// if(!node.visible) return;
|
|
22
5
|
// 绘制一个底图,类似于占位符。
|
|
23
|
-
rectangle(ctx, node)
|
|
6
|
+
rectangle(ctx, node);
|
|
24
7
|
// tslint:disable-next-line:no-shadowed-variable
|
|
25
|
-
var echarts =
|
|
8
|
+
var echarts = echartsData.echarts || window.echarts;
|
|
26
9
|
if (!node.data || !echarts) {
|
|
27
|
-
return
|
|
10
|
+
return;
|
|
28
11
|
}
|
|
29
12
|
if (typeof node.data === 'string') {
|
|
30
|
-
node.data = JSON.parse(node.data)
|
|
13
|
+
node.data = JSON.parse(node.data);
|
|
31
14
|
}
|
|
32
15
|
if (!node.data.echarts) {
|
|
33
|
-
return
|
|
16
|
+
return;
|
|
34
17
|
}
|
|
35
18
|
if (!node.elementId) {
|
|
36
|
-
node.elementId = s8()
|
|
19
|
+
node.elementId = s8();
|
|
37
20
|
}
|
|
38
|
-
|
|
39
|
-
if (!node.elementLoaded && !
|
|
40
|
-
if(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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);
|
|
49
33
|
// 添加当前节点到div层
|
|
50
|
-
node.addToDiv()
|
|
51
|
-
echartsData.chart = echarts.init(echartsData.div, node.data.echarts.theme)
|
|
52
|
-
node.elementRendered = false
|
|
34
|
+
node.addToDiv('init');
|
|
35
|
+
echartsData[node.id].chart = echarts.init(echartsData[node.id].div, node.data.echarts.theme);
|
|
36
|
+
node.elementRendered = false;
|
|
53
37
|
// 等待父div先渲染完成,避免初始图表控件太大
|
|
54
38
|
setTimeout(function () {
|
|
55
|
-
echartsData.chart.resize()
|
|
39
|
+
echartsData[node.id].chart.resize();
|
|
56
40
|
});
|
|
57
|
-
currentStore.echartsDataPool[node.id] = echartsData;
|
|
58
41
|
}
|
|
59
42
|
if (!node.elementRendered) {
|
|
60
|
-
const appearance = node.appearance;
|
|
61
43
|
// 初始化时,等待父div先渲染完成,避免初始图表控件太大。
|
|
62
44
|
setTimeout(function () {
|
|
63
|
-
let option = node.data.echarts.option;
|
|
64
|
-
if(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
// 仪表盘
|
|
82
|
-
if (appearance.type === 'gauge') setMapGaugeOptions(option, node);
|
|
83
|
-
// 环形图 || 饼图
|
|
84
|
-
if (appearance.type.includes('ring') || appearance.type.includes('pie')) setMapRingOptions(option, node);
|
|
85
|
-
// 3d 柱状图
|
|
86
|
-
if (appearance.type === '3dBar') setMap3dBarOptions(option, node);
|
|
87
|
-
// Top排行榜
|
|
88
|
-
if (appearance.type.includes('TOP')) setMapTopOptions(option, node);
|
|
89
|
-
//option.title = appearance.title;
|
|
90
|
-
option.backgroundColor = appearance.backgroundColor;
|
|
91
|
-
const correlationData = echartsOptionsData && echartsOptionsData.correlationData || null;
|
|
92
|
-
currentStore.echartsOptionsPool[node.id] = {
|
|
93
|
-
option: JSON.parse(JSON.stringify(option)),
|
|
94
|
-
correlationData,
|
|
95
|
-
data: {
|
|
96
|
-
TID: node.TID,
|
|
97
|
-
appearance,
|
|
98
|
-
id: node.id,
|
|
99
|
-
params: node.data.params,
|
|
100
|
-
tabData
|
|
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 '';
|
|
101
63
|
}
|
|
102
|
-
}
|
|
103
|
-
if
|
|
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;
|
|
104
94
|
}
|
|
105
|
-
|
|
106
|
-
|
|
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();
|
|
107
100
|
node.elementRendered = true;
|
|
108
|
-
})
|
|
101
|
+
});
|
|
109
102
|
}
|
|
110
103
|
}
|
|
111
|
-
|
|
112
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,5 +6,21 @@ export * from './src/utils';
|
|
|
6
6
|
export * from './src/models';
|
|
7
7
|
export * from './src/middles';
|
|
8
8
|
export * from './src/healps';
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
10
|
+
import axios from 'axios'
|
|
11
|
+
if(axios.defaults.headers.common) axios.defaults.headers.common['Authorization'] = getToken();
|
|
12
|
+
|
|
13
|
+
function getToken(){
|
|
14
|
+
if(process.browser){
|
|
15
|
+
var strcookie = document.cookie;//获取cookie字符串
|
|
16
|
+
var arrcookie = strcookie.split("; ");//分割
|
|
17
|
+
//遍历匹配
|
|
18
|
+
for ( var i = 0; i < arrcookie.length; i++) {
|
|
19
|
+
var arr = arrcookie[i].split("=");
|
|
20
|
+
if (arr[0] == "token"){
|
|
21
|
+
return arr[1];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return "";
|
|
26
|
+
}
|
|
@@ -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[];
|