dcim-topology2d 2.1.0 → 2.2.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/chart-diagram/index.d.ts +1 -1
- package/chart-diagram/index.js +1 -1
- package/chart-diagram/src/echarts/index.js +112 -109
- package/chart-diagram/src/utils/changeOptions.d.ts +8 -8
- package/chart-diagram/src/utils/changeOptions.js +8 -2
- package/chart-diagram/src/utils/conversion.d.ts +19 -19
- package/chart-diagram/src/utils/conversion.js +601 -559
- package/chart-diagram/src/utils/drawGraphic.d.ts +3 -3
- package/chart-diagram/src/utils/drawGraphic.js +97 -97
- package/chart-diagram/src/utils/index.d.ts +5 -5
- package/chart-diagram/src/utils/index.js +5 -5
- package/chart-diagram/src/utils/render.js +4 -0
- package/core/index.js +1 -19
- package/core/src/activeLayer.js +23 -23
- package/core/src/calling.js +32 -33
- package/core/src/common.d.ts +1 -0
- package/core/src/common.js +115 -83
- package/core/src/core.js +15 -1
- package/core/src/element/common.js +12 -4
- package/core/src/element/datePicker.js +13 -16
- package/core/src/element/select.d.ts +1 -1
- package/core/src/element/select.js +1 -3
- package/core/src/element/tab.js +3 -8
- package/core/src/healps/changeData.js +64 -41
- package/core/src/middles/default.js +49 -43
- package/core/src/middles/index.d.ts +1 -2
- package/core/src/middles/index.js +3 -2
- package/core/src/middles/nodes/formDatePicker.js +54 -12
- package/core/src/middles/nodes/formoverflow.js +17 -16
- package/core/src/middles/nodes/formselect.js +14 -5
- package/core/src/middles/nodes/index.d.ts +3 -1
- package/core/src/middles/nodes/index.js +2 -0
- package/core/src/middles/nodes/progress.d.ts +2 -0
- package/core/src/middles/nodes/progress.js +63 -0
- package/core/src/middles/nodes/progress.js.map +1 -0
- package/core/src/middles/nodes/rectangle.js +54 -15
- package/core/src/middles/nodes/switchs.d.ts +2 -0
- package/core/src/middles/nodes/switchs.js +46 -0
- package/core/src/models/line.js +7 -7
- package/core/src/models/node.js +90 -81
- package/core/src/models/pen.js +21 -12
- package/core/src/offscreen.js +19 -19
- package/core/src/preview.js +75 -40
- package/core/src/store/data.d.ts +11 -0
- package/core/src/store/data.js +11 -0
- package/core/src/utils/assignment.d.ts +1 -1
- package/core/src/utils/assignment.js +50 -6
- package/core/src/utils/construction.d.ts +24 -0
- package/core/src/utils/construction.js +22 -1
- package/core/src/utils/conversion.d.ts +2 -0
- package/core/src/utils/conversion.js +109 -0
- package/core/src/utils/math.d.ts +0 -1
- package/core/src/utils/math.js +0 -3
- package/core/src/utils/onmousevent.js +1 -1
- package/core/src/utils/params.d.ts +1 -0
- package/core/src/utils/params.js +75 -4
- package/package.json +1 -1
- package/static/echartsDefaultData.js +178 -178
- package/store/actions.js +2 -1
- package/store/clear.js +4 -0
- package/store/default.js +22 -0
- package/store/index.js +2 -1
- /package/myShape-diagram/{index.ts → index.d.ts} +0 -0
package/chart-diagram/index.d.ts
CHANGED
package/chart-diagram/index.js
CHANGED
|
@@ -1,109 +1,112 @@
|
|
|
1
|
-
import {s8, createDiv, rectangle, commonStore} from '../../../core';
|
|
2
|
-
import {plugsPool} from '../../../store';
|
|
3
|
-
import {
|
|
4
|
-
setMapScatterOptions,
|
|
5
|
-
setMapLineBarOptions,
|
|
6
|
-
setMapGaugeOptions,
|
|
7
|
-
setMapRingOptions,
|
|
8
|
-
setMap3dBarOptions,
|
|
9
|
-
setMapTopOptions,
|
|
10
|
-
setMapGlobalOptions,
|
|
11
|
-
setMapDataOptions,
|
|
12
|
-
|
|
13
|
-
} from '../utils';
|
|
14
|
-
import {echartsTypeMap} from '../../../static';
|
|
15
|
-
|
|
16
|
-
export function echarts(ctx, node) {
|
|
17
|
-
const currentStore = commonStore[node.TID];
|
|
18
|
-
if (!(currentStore && currentStore.data.dataResize)) return;
|
|
19
|
-
//console.log('echarts绘制-----node', node);
|
|
20
|
-
// if(currentElement) currentElement.style.display = !node.visible ? 'none': 'block';
|
|
21
|
-
// if(!node.visible) return;
|
|
22
|
-
// 绘制一个底图,类似于占位符。
|
|
23
|
-
rectangle(ctx, node)
|
|
24
|
-
// tslint:disable-next-line:no-shadowed-variable
|
|
25
|
-
var echarts = plugsPool.echarts || window.echarts
|
|
26
|
-
if (!node.data || !echarts) {
|
|
27
|
-
return
|
|
28
|
-
}
|
|
29
|
-
if (typeof node.data === 'string') {
|
|
30
|
-
node.data = JSON.parse(node.data)
|
|
31
|
-
}
|
|
32
|
-
if (!node.data.echarts) {
|
|
33
|
-
return
|
|
34
|
-
}
|
|
35
|
-
if (!node.elementId) {
|
|
36
|
-
node.elementId = s8()
|
|
37
|
-
}
|
|
38
|
-
let echartsData = currentStore.echartsDataPool[node.id];
|
|
39
|
-
if (!node.elementLoaded && !(echartsData && echartsData.div)) {
|
|
40
|
-
if(!echartsData) {
|
|
41
|
-
echartsData = {
|
|
42
|
-
div: createDiv(node)
|
|
43
|
-
};
|
|
44
|
-
}else {
|
|
45
|
-
echartsData.div = createDiv(node);
|
|
46
|
-
}
|
|
47
|
-
node.elementLoaded = true
|
|
48
|
-
document.body.appendChild(echartsData.div)
|
|
49
|
-
// 添加当前节点到div层
|
|
50
|
-
node.addToDiv()
|
|
51
|
-
echartsData.chart = echarts.init(echartsData.div, node.data.echarts.theme)
|
|
52
|
-
node.elementRendered = false
|
|
53
|
-
// 等待父div先渲染完成,避免初始图表控件太大
|
|
54
|
-
setTimeout(function () {
|
|
55
|
-
echartsData.chart.resize()
|
|
56
|
-
});
|
|
57
|
-
currentStore.echartsDataPool[node.id] = echartsData;
|
|
58
|
-
}
|
|
59
|
-
if (!node.elementRendered) {
|
|
60
|
-
const appearance = node.appearance;
|
|
61
|
-
// 初始化时,等待父div先渲染完成,避免初始图表控件太大。
|
|
62
|
-
setTimeout(function () {
|
|
63
|
-
let option = node.data.echarts.option;
|
|
64
|
-
if(!(echartsData && echartsData.chart)) return;
|
|
65
|
-
const pageZoom = currentStore.data.pageZoom;
|
|
66
|
-
echartsData.div.style.transform = `scale(${pageZoom})`;
|
|
67
|
-
echartsData.div.style.transformOrigin = '0 0';
|
|
68
|
-
if(node.data.params) node.data.params.tabCorrelationType = echartsData.tabCorrelationType || ''; // 统计图与Tab关联
|
|
69
|
-
const isLocked = currentStore.data.locked;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
//
|
|
73
|
-
|
|
74
|
-
//
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
option.
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
1
|
+
import {s8, createDiv, rectangle, commonStore} from '../../../core';
|
|
2
|
+
import {plugsPool} from '../../../store';
|
|
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
|
+
|
|
16
|
+
export function echarts(ctx, node) {
|
|
17
|
+
const currentStore = commonStore[node.TID];
|
|
18
|
+
if (!(currentStore && currentStore.data.dataResize)) return;
|
|
19
|
+
//console.log('echarts绘制-----node', node);
|
|
20
|
+
// if(currentElement) currentElement.style.display = !node.visible ? 'none': 'block';
|
|
21
|
+
// if(!node.visible) return;
|
|
22
|
+
// 绘制一个底图,类似于占位符。
|
|
23
|
+
rectangle(ctx, node)
|
|
24
|
+
// tslint:disable-next-line:no-shadowed-variable
|
|
25
|
+
var echarts = plugsPool.echarts || window.echarts
|
|
26
|
+
if (!node.data || !echarts) {
|
|
27
|
+
return
|
|
28
|
+
}
|
|
29
|
+
if (typeof node.data === 'string') {
|
|
30
|
+
node.data = JSON.parse(node.data)
|
|
31
|
+
}
|
|
32
|
+
if (!node.data.echarts) {
|
|
33
|
+
return
|
|
34
|
+
}
|
|
35
|
+
if (!node.elementId) {
|
|
36
|
+
node.elementId = s8()
|
|
37
|
+
}
|
|
38
|
+
let echartsData = currentStore.echartsDataPool[node.id];
|
|
39
|
+
if (!node.elementLoaded && !(echartsData && echartsData.div)) {
|
|
40
|
+
if(!echartsData) {
|
|
41
|
+
echartsData = {
|
|
42
|
+
div: createDiv(node)
|
|
43
|
+
};
|
|
44
|
+
}else {
|
|
45
|
+
echartsData.div = createDiv(node);
|
|
46
|
+
}
|
|
47
|
+
node.elementLoaded = true
|
|
48
|
+
document.body.appendChild(echartsData.div)
|
|
49
|
+
// 添加当前节点到div层
|
|
50
|
+
node.addToDiv()
|
|
51
|
+
echartsData.chart = echarts.init(echartsData.div, node.data.echarts.theme)
|
|
52
|
+
node.elementRendered = false
|
|
53
|
+
// 等待父div先渲染完成,避免初始图表控件太大
|
|
54
|
+
setTimeout(function () {
|
|
55
|
+
echartsData.chart.resize()
|
|
56
|
+
});
|
|
57
|
+
currentStore.echartsDataPool[node.id] = echartsData;
|
|
58
|
+
}
|
|
59
|
+
if (!node.elementRendered) {
|
|
60
|
+
const appearance = node.appearance;
|
|
61
|
+
// 初始化时,等待父div先渲染完成,避免初始图表控件太大。
|
|
62
|
+
setTimeout(function () {
|
|
63
|
+
let option = node.data.echarts.option;
|
|
64
|
+
if(!(echartsData && echartsData.chart)) return;
|
|
65
|
+
const pageZoom = currentStore.data.pageZoom;
|
|
66
|
+
echartsData.div.style.transform = `scale(${pageZoom})`;
|
|
67
|
+
echartsData.div.style.transformOrigin = '0 0';
|
|
68
|
+
if(node.data.params) node.data.params.tabCorrelationType = echartsData.tabCorrelationType || ''; // 统计图与Tab关联
|
|
69
|
+
const isLocked = currentStore.data.locked;
|
|
70
|
+
const echartsOptionsData = currentStore.echartsOptionsPool[node.id];
|
|
71
|
+
if (!isLocked || !echartsOptionsData) {
|
|
72
|
+
const tabData = initBindCorrelationSetting(node); // 初始化图表与其他组件关联的配置数据
|
|
73
|
+
// 【未锁定(编辑)状态, options未初始化的状态】
|
|
74
|
+
if (!appearance.type) appearance.type = echartsTypeMap[`type_${option.displayMode}`]; // 兼容旧数据配置
|
|
75
|
+
// 公共配置 Top排行榜散点图跳过公共属性配置
|
|
76
|
+
if (option.displayMode !== 4 && option.displayMode !== 7) setMapGlobalOptions(option, node);
|
|
77
|
+
// 散点图
|
|
78
|
+
if (appearance.type.includes('scatter')) setMapScatterOptions(option, node);
|
|
79
|
+
// 折线图和柱状图
|
|
80
|
+
if (appearance.type.includes('line') || appearance.type.includes('bar')) setMapLineBarOptions(option, node);
|
|
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
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
if (!isLocked) echartsData.chart.clear();
|
|
104
|
+
}
|
|
105
|
+
// echarts 数据渲染更新
|
|
106
|
+
setMapDataOptions(option, currentStore.echartsOptionsPool[node.id].data);
|
|
107
|
+
node.elementRendered = true;
|
|
108
|
+
})
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export declare function setRingChartText<T>(textData: T): void;
|
|
2
|
-
export declare function setRingPreSeriesOptions<T>(option: T, appearance: T): void;
|
|
3
|
-
export declare function setRingProSeriesOptions<T>(option: T, appearance: T): void;
|
|
4
|
-
export declare function set3DPieOptions<T>(option: T, appearance: T, labelLineData: any, realData: any): {};
|
|
5
|
-
export declare function setChartLegendData<T>(legend: T, appearance: T): void;
|
|
6
|
-
export declare function setChartXAxisData<T>(xAxis: [], appearance: T): void;
|
|
7
|
-
export declare function setChartYAxisData<T>(yAxis: [], appearance: T): void;
|
|
8
|
-
export declare function setLineSeriesStyleData<T>(series: [], appearance: T): void;
|
|
1
|
+
export declare function setRingChartText<T>(textData: T): void;
|
|
2
|
+
export declare function setRingPreSeriesOptions<T>(option: T, appearance: T): void;
|
|
3
|
+
export declare function setRingProSeriesOptions<T>(option: T, appearance: T): void;
|
|
4
|
+
export declare function set3DPieOptions<T>(option: T, appearance: T, labelLineData: any, realData: any): {};
|
|
5
|
+
export declare function setChartLegendData<T>(legend: T, appearance: T): void;
|
|
6
|
+
export declare function setChartXAxisData<T>(xAxis: [], appearance: T): void;
|
|
7
|
+
export declare function setChartYAxisData<T>(yAxis: [], appearance: T): void;
|
|
8
|
+
export declare function setLineSeriesStyleData<T>(series: [], appearance: T): void;
|
|
@@ -65,9 +65,15 @@ export function setRingProSeriesOptions(option, appearance) {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
// 3D饼图 | 环形图 属性配置
|
|
68
|
-
export function set3DPieOptions(option, appearance, labelLineData, realData){
|
|
68
|
+
export function set3DPieOptions(option, appearance, labelLineData, realData) {
|
|
69
69
|
let type = appearance.type.includes('pie') ? 'pie' : 'ring';
|
|
70
|
-
const {
|
|
70
|
+
const {
|
|
71
|
+
legendData,
|
|
72
|
+
series,
|
|
73
|
+
node,
|
|
74
|
+
total,
|
|
75
|
+
boxHeight
|
|
76
|
+
} = getPie3D(appearance.grid.internalDiameterRatio, type, appearance, labelLineData, realData);
|
|
71
77
|
option.grid3D.boxHeight = boxHeight;
|
|
72
78
|
option.legend.data = legendData;
|
|
73
79
|
option.series = series;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
interface echartsOptions {
|
|
2
|
-
color: '',
|
|
3
|
-
xAxis: [],
|
|
4
|
-
yAxis: [],
|
|
5
|
-
series: [],
|
|
6
|
-
tooltip: null
|
|
7
|
-
}
|
|
8
|
-
export declare function getXYAxisLabelVal(index: number, intervalNum: number, value: any): string;
|
|
9
|
-
export declare function
|
|
10
|
-
export declare function setMapScatterOptions(option: echartsOptions, node: any): void;
|
|
11
|
-
export declare function setMapLineBarOptions(option: echartsOptions, node: any): void;
|
|
12
|
-
export declare function setMapGaugeOptions(option: echartsOptions, node: any): void;
|
|
13
|
-
export declare function setMapRingOptions(option: echartsOptions, node: any): void;
|
|
14
|
-
export declare function setMap3dBarOptions(option: echartsOptions, node: any): void;
|
|
15
|
-
export declare function setMapTopOptions(option: echartsOptions, node: any): void;
|
|
16
|
-
export declare function setMapGlobalOptions(option: echartsOptions, node: any): void;
|
|
17
|
-
export declare function setMapDataOptions(option: echartsOptions, node: any): void;
|
|
18
|
-
export declare function setMapAutoMoveOptions(option: echartsOptions, chartNode: string,node: any, callback: any): void;
|
|
19
|
-
export declare function setMapStopAutoMoveOptions(chartNode: string): void;
|
|
1
|
+
interface echartsOptions {
|
|
2
|
+
color: '',
|
|
3
|
+
xAxis: [],
|
|
4
|
+
yAxis: [],
|
|
5
|
+
series: [],
|
|
6
|
+
tooltip: null
|
|
7
|
+
}
|
|
8
|
+
export declare function getXYAxisLabelVal(index: number, intervalNum: number, value: any): string;
|
|
9
|
+
export declare function initBindCorrelationSetting(node: any): string;
|
|
10
|
+
export declare function setMapScatterOptions(option: echartsOptions, node: any): void;
|
|
11
|
+
export declare function setMapLineBarOptions(option: echartsOptions, node: any): void;
|
|
12
|
+
export declare function setMapGaugeOptions(option: echartsOptions, node: any): void;
|
|
13
|
+
export declare function setMapRingOptions(option: echartsOptions, node: any): void;
|
|
14
|
+
export declare function setMap3dBarOptions(option: echartsOptions, node: any): void;
|
|
15
|
+
export declare function setMapTopOptions(option: echartsOptions, node: any): void;
|
|
16
|
+
export declare function setMapGlobalOptions(option: echartsOptions, node: any): void;
|
|
17
|
+
export declare function setMapDataOptions(option: echartsOptions, node: any): void;
|
|
18
|
+
export declare function setMapAutoMoveOptions(option: echartsOptions, chartNode: string,node: any, callback: any): void;
|
|
19
|
+
export declare function setMapStopAutoMoveOptions(chartNode: string): void;
|