dcim-topology2d 2.0.8 → 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.
Files changed (204) hide show
  1. package/activity-diagram/src/final/final.d.ts +1 -1
  2. package/activity-diagram/src/final/final.rect.d.ts +1 -1
  3. package/activity-diagram/src/final/final.rect.js +1 -1
  4. package/activity-diagram/src/fork/fork.anchor.d.ts +1 -1
  5. package/activity-diagram/src/fork/fork.anchor.js +1 -1
  6. package/activity-diagram/src/fork/fork.d.ts +1 -1
  7. package/activity-diagram/src/fork/fork.rect.d.ts +1 -1
  8. package/activity-diagram/src/fork/fork.rect.js +1 -1
  9. package/activity-diagram/src/register.js +1 -1
  10. package/activity-diagram/src/swimlaneH/swimlaneH.d.ts +1 -1
  11. package/activity-diagram/src/swimlaneH/swimlaneH.rect.d.ts +1 -1
  12. package/activity-diagram/src/swimlaneH/swimlaneH.rect.js +1 -1
  13. package/activity-diagram/src/swimlaneV/swimlaneV.d.ts +1 -1
  14. package/activity-diagram/src/swimlaneV/swimlaneV.rect.d.ts +1 -1
  15. package/activity-diagram/src/swimlaneV/swimlaneV.rect.js +1 -1
  16. package/chart-diagram/index.d.ts +1 -3
  17. package/chart-diagram/index.js +1 -2
  18. package/chart-diagram/src/echarts/index.d.ts +2 -1
  19. package/chart-diagram/src/echarts/index.js +104 -109
  20. package/chart-diagram/src/register.js +8 -9
  21. package/class-diagram/src/class/class.d.ts +1 -1
  22. package/class-diagram/src/class/class.rect.d.ts +1 -1
  23. package/class-diagram/src/class/class.rect.js +1 -1
  24. package/class-diagram/src/register.js +1 -1
  25. package/core/index.d.ts +0 -2
  26. package/core/index.js +0 -2
  27. package/core/src/activeLayer.d.ts +10 -2
  28. package/core/src/activeLayer.js +47 -42
  29. package/core/src/animateLayer.d.ts +7 -3
  30. package/core/src/animateLayer.js +12 -10
  31. package/core/src/calling.d.ts +4 -1
  32. package/core/src/calling.js +41 -43
  33. package/core/src/canvas.d.ts +6 -1
  34. package/core/src/canvas.js +21 -22
  35. package/core/src/common.d.ts +7 -6
  36. package/core/src/common.js +673 -332
  37. package/core/src/core.d.ts +4 -3
  38. package/core/src/core.js +367 -466
  39. package/core/src/divLayer.d.ts +36 -2
  40. package/core/src/divLayer.js +305 -33
  41. package/core/src/healps/changeData.d.ts +2 -1
  42. package/core/src/healps/changeData.js +66 -32
  43. package/core/src/hoverLayer.d.ts +9 -2
  44. package/core/src/hoverLayer.js +34 -31
  45. package/core/src/middles/default.d.ts +3 -1
  46. package/core/src/middles/default.js +51 -53
  47. package/core/src/middles/index.js +2 -3
  48. package/core/src/middles/nodes/arbitrarygraph.js +9 -11
  49. package/core/src/middles/nodes/pentagon.rect.js +1 -1
  50. package/core/src/middles/nodes/rectangle.rect.js +1 -1
  51. package/core/src/models/data.d.ts +26 -0
  52. package/core/src/models/data.js +77 -0
  53. package/core/src/models/data.js.map +1 -0
  54. package/core/src/models/index.d.ts +1 -0
  55. package/core/src/models/index.js +1 -0
  56. package/core/src/models/node.d.ts +0 -10
  57. package/core/src/models/node.js +36 -69
  58. package/core/src/models/pen.js +59 -19
  59. package/core/src/models/rect.js +2 -2
  60. package/core/src/mqtt.d.ts +14 -0
  61. package/core/src/mqtt.js +82 -0
  62. package/core/src/mqtt.js.map +1 -0
  63. package/core/src/offscreen.d.ts +4 -1
  64. package/core/src/offscreen.js +8 -10
  65. package/core/src/options.d.ts +1 -3
  66. package/core/src/options.js +0 -2
  67. package/core/src/poll.js +39 -0
  68. package/core/src/preview.d.ts +13 -1
  69. package/core/src/preview.js +43 -111
  70. package/core/src/renderLayer.d.ts +9 -11
  71. package/core/src/renderLayer.js +61 -60
  72. package/core/src/socket.d.ts +10 -0
  73. package/core/src/socket.js +51 -0
  74. package/core/src/socket.js.map +1 -0
  75. package/core/src/utils/canvas.js +1 -1
  76. package/core/src/utils/construction.d.ts +3 -12
  77. package/core/src/utils/construction.js +1 -8
  78. package/core/src/utils/conversion.d.ts +0 -11
  79. package/core/src/utils/conversion.js +0 -168
  80. package/core/src/utils/dom.d.ts +8 -0
  81. package/core/src/utils/dom.js +67 -0
  82. package/core/src/utils/dom.js.map +1 -0
  83. package/core/src/utils/index.d.ts +1 -2
  84. package/core/src/utils/index.js +1 -2
  85. package/core/src/utils/math.d.ts +0 -1
  86. package/core/src/utils/math.js +0 -3
  87. package/core/src/utils/onmousevent.d.ts +0 -3
  88. package/core/src/utils/onmousevent.js +10 -42
  89. package/flow-diagram/src/comment/comment.anchor.d.ts +1 -1
  90. package/flow-diagram/src/comment/comment.anchor.js +1 -1
  91. package/flow-diagram/src/comment/comment.d.ts +1 -1
  92. package/flow-diagram/src/data/data.anchor.d.ts +1 -1
  93. package/flow-diagram/src/data/data.anchor.js +1 -1
  94. package/flow-diagram/src/data/data.d.ts +1 -1
  95. package/flow-diagram/src/data/data.rect.d.ts +1 -1
  96. package/flow-diagram/src/data/data.rect.js +1 -1
  97. package/flow-diagram/src/db/db.d.ts +1 -1
  98. package/flow-diagram/src/db/db.rect.d.ts +1 -1
  99. package/flow-diagram/src/db/db.rect.js +1 -1
  100. package/flow-diagram/src/display/display.anchor.d.ts +1 -1
  101. package/flow-diagram/src/display/display.anchor.js +1 -1
  102. package/flow-diagram/src/display/display.d.ts +1 -1
  103. package/flow-diagram/src/display/display.rect.d.ts +1 -1
  104. package/flow-diagram/src/display/display.rect.js +1 -1
  105. package/flow-diagram/src/document/document.anchor.d.ts +1 -1
  106. package/flow-diagram/src/document/document.anchor.js +1 -1
  107. package/flow-diagram/src/document/document.d.ts +1 -1
  108. package/flow-diagram/src/document/document.rect.d.ts +1 -1
  109. package/flow-diagram/src/document/document.rect.js +1 -1
  110. package/flow-diagram/src/externStorage/externStorage.anchor.d.ts +1 -1
  111. package/flow-diagram/src/externStorage/externStorage.anchor.js +1 -1
  112. package/flow-diagram/src/externStorage/externStorage.d.ts +1 -1
  113. package/flow-diagram/src/externStorage/externStorage.rect.d.ts +1 -1
  114. package/flow-diagram/src/externStorage/externStorage.rect.js +1 -1
  115. package/flow-diagram/src/internalStorage/internalStorage.d.ts +1 -1
  116. package/flow-diagram/src/internalStorage/internalStorage.rect.d.ts +1 -1
  117. package/flow-diagram/src/internalStorage/internalStorage.rect.js +1 -1
  118. package/flow-diagram/src/manually/manually.anchor.d.ts +1 -1
  119. package/flow-diagram/src/manually/manually.anchor.js +1 -1
  120. package/flow-diagram/src/manually/manually.d.ts +1 -1
  121. package/flow-diagram/src/manually/manually.rect.d.ts +1 -1
  122. package/flow-diagram/src/manually/manually.rect.js +1 -1
  123. package/flow-diagram/src/parallel/parallel.anchor.d.ts +1 -1
  124. package/flow-diagram/src/parallel/parallel.anchor.js +1 -1
  125. package/flow-diagram/src/parallel/parallel.d.ts +1 -1
  126. package/flow-diagram/src/queue/queue.d.ts +1 -1
  127. package/flow-diagram/src/queue/queue.rect.d.ts +1 -1
  128. package/flow-diagram/src/queue/queue.rect.js +1 -1
  129. package/flow-diagram/src/register.js +1 -1
  130. package/flow-diagram/src/subprocess/subprocess.d.ts +1 -1
  131. package/flow-diagram/src/subprocess/subprocess.rect.d.ts +1 -1
  132. package/flow-diagram/src/subprocess/subprocess.rect.js +1 -1
  133. package/layout/src/align.d.ts +1 -1
  134. package/layout/src/align.js +1 -1
  135. package/layout/src/layout.d.ts +1 -1
  136. package/layout/src/layout.js +1 -1
  137. package/myShape-diagram/{index.js → myShape.js} +1 -4
  138. package/package.json +1 -1
  139. package/sequence-diagram/src/focus/focus.anchor.d.ts +1 -1
  140. package/sequence-diagram/src/focus/focus.anchor.js +1 -1
  141. package/sequence-diagram/src/focus/focus.d.ts +1 -1
  142. package/sequence-diagram/src/focus/focus.rect.d.ts +1 -1
  143. package/sequence-diagram/src/focus/focus.rect.js +1 -1
  144. package/sequence-diagram/src/lifeline/lifeline.anchor.d.ts +1 -1
  145. package/sequence-diagram/src/lifeline/lifeline.anchor.js +1 -1
  146. package/sequence-diagram/src/lifeline/lifeline.d.ts +1 -1
  147. package/sequence-diagram/src/lifeline/lifeline.rect.d.ts +1 -1
  148. package/sequence-diagram/src/lifeline/lifeline.rect.js +1 -1
  149. package/sequence-diagram/src/register.js +1 -1
  150. package/chart-diagram/src/utils/changeOptions.d.ts +0 -7
  151. package/chart-diagram/src/utils/changeOptions.js +0 -261
  152. package/chart-diagram/src/utils/conversion.d.ts +0 -19
  153. package/chart-diagram/src/utils/conversion.js +0 -432
  154. package/chart-diagram/src/utils/drawGraphic.d.ts +0 -3
  155. package/chart-diagram/src/utils/drawGraphic.js +0 -97
  156. package/chart-diagram/src/utils/formatter.d.ts +0 -1
  157. package/chart-diagram/src/utils/formatter.js +0 -170
  158. package/chart-diagram/src/utils/index.d.ts +0 -4
  159. package/chart-diagram/src/utils/index.js +0 -4
  160. package/chart-diagram/src/utils/render.d.ts +0 -8
  161. package/chart-diagram/src/utils/render.js +0 -228
  162. package/core/src/element/common.d.ts +0 -5
  163. package/core/src/element/common.js +0 -54
  164. package/core/src/element/iframe.d.ts +0 -3
  165. package/core/src/element/iframe.js +0 -12
  166. package/core/src/element/index.d.ts +0 -4
  167. package/core/src/element/index.js +0 -4
  168. package/core/src/element/select.d.ts +0 -11
  169. package/core/src/element/select.js +0 -263
  170. package/core/src/element/tab.d.ts +0 -1
  171. package/core/src/element/tab.js +0 -23
  172. package/core/src/middles/arrows/index.d.ts +0 -4
  173. package/core/src/middles/arrows/index.js +0 -5
  174. package/core/src/middles/lines/index.d.ts +0 -4
  175. package/core/src/middles/lines/index.js +0 -5
  176. package/core/src/middles/nodes/formoverflow.js +0 -61
  177. package/core/src/middles/nodes/formselect.d.ts +0 -2
  178. package/core/src/middles/nodes/formselect.js +0 -95
  179. package/core/src/middles/nodes/iframe.d.ts +0 -2
  180. package/core/src/middles/nodes/iframe.js +0 -29
  181. package/core/src/middles/nodes/index.d.ts +0 -48
  182. package/core/src/middles/nodes/index.js +0 -49
  183. package/core/src/store/common.d.ts +0 -9
  184. package/core/src/store/common.js +0 -5
  185. package/core/src/store/data.d.ts +0 -189
  186. package/core/src/store/data.js +0 -180
  187. package/core/src/store/index.d.ts +0 -2
  188. package/core/src/store/index.js +0 -2
  189. package/core/src/utils/assignment.d.ts +0 -6
  190. package/core/src/utils/assignment.js +0 -173
  191. package/core/src/utils/params.d.ts +0 -2
  192. package/core/src/utils/params.js +0 -60
  193. package/static/echartsDefaultData.js +0 -178
  194. package/static/element.js +0 -14
  195. package/static/form.js +0 -11
  196. package/static/index.js +0 -3
  197. package/store/actions.js +0 -1
  198. package/store/clear.js +0 -10
  199. package/store/index.js +0 -2
  200. package/style/common.css +0 -18
  201. package/style/editor.css +0 -13
  202. package/style/index.css +0 -4
  203. package/style/select.css +0 -143
  204. /package/myShape-diagram/{index.ts → myShape.ts} +0 -0
@@ -1,170 +0,0 @@
1
- import {rankingTopColorList} from '../../../static';
2
-
3
- export function mapFormatterSet(appearance, options, data) {
4
- if(appearance.type.includes('ring') || appearance.type.includes('pie')) {
5
- const seriesNode = options.series[0];
6
- if(seriesNode.label && seriesNode.label.normal &&!seriesNode.label.normal.formatter) {
7
- setMapRingOptionsFormatter(appearance, seriesNode);
8
- }
9
- }
10
- if(appearance.type.includes('line') || appearance.type.includes('bar')) setMapLineBarFormatter(appearance, options);
11
- if(appearance.type.includes('lineTwins')) setMapLineTwinsFormatter(appearance, options);
12
- if(appearance.type.includes('scatter')) setMapScatterFormatter(options);
13
- if(appearance.type.includes('TOPRanking')) setMapTopScoreFormatter(options, data, appearance);
14
- if(appearance.type.includes('barPileStatic')) setMapBarPileStaticFormatter(appearance, options);
15
- }
16
- function setMapLineTwinsFormatter(appearance, options) {
17
- if(!options.tooltip.formatter && appearance.tooltipUnit) {
18
- options.tooltip.formatter = function (params) {
19
- let relVal = params[0].name;
20
- for (var i = 0, l = params.length; i < l; i++) {
21
- const unit = appearance.tooltipUnit[i] || '';
22
- relVal +=
23
- "<br/>" +
24
- params[i].marker +
25
- params[i].seriesName +
26
- " : " +
27
- params[i].value +
28
- unit;
29
- }
30
- return relVal;
31
- }
32
- }
33
- }
34
- // 折线 || 柱状图
35
- function setMapLineBarFormatter(appearance, options){
36
- if(!options.tooltip.formatter){
37
- options.tooltip.formatter = function(param) {
38
- const firstUnit = getTooltipUnit(0, appearance);
39
- const firstDott = getTooltipDott(param[0].color);
40
- let data = `${firstDott}${param[0].seriesName}:${param[0].value} ${firstUnit}`;
41
- for (let i = 1; i < param.length; i++){
42
- const item = param[i];
43
- const unit = getTooltipUnit(i, appearance);
44
- const dott = getTooltipDott(param[i].color);
45
- data += `<br>${dott}${item.seriesName}:${item.value} ${unit}`;
46
- }
47
- return `<div style="border-bottom: 1px solid rgba(255,255,255,.3); font-size: 12px;margin-bottom: 5px;">${param[0].name}</div>${data}`;
48
- }
49
- }
50
- }
51
- function getTooltipUnit(index, appearance) {
52
- if(!(appearance.tooltipUnit && appearance.tooltipUnit[index])) return '';
53
- return appearance.tooltipUnit[index];
54
- }
55
- function getTooltipDott(color) {
56
- return `<span style="display: inline-block;margin-right: 8px;border: 5px solid ${color};border-radius: 100%"></span>`;
57
- }
58
- // 堆叠统计
59
- function setMapBarPileStaticFormatter(appearance, options) {
60
- if(!options.tooltip.formatter){
61
- options.tooltip.formatter = function(param) {
62
- let data = `${param[0].seriesName}:${param[0].value} ${appearance.series[0] && appearance.series[0].labelUnit || ''}`;
63
- for (let i = 1; i < param.length; i++){
64
- const item = param[i];
65
- const series = appearance.series[i];
66
- data += `<br>${item.seriesName}:${appearance.total && appearance.total[item.dataIndex].value || item.value} ${series && series.labelUnit || ''}`;
67
- }
68
- return `<div style="border-bottom: 1px solid rgba(255,255,255,.3); font-size: 12px;margin-bottom: 5px;">${param[0].name}</div>${data}`;
69
- }
70
- }
71
- for (let i = 0; i < options.series.length; i++) {
72
- const item = options.series[i];
73
- const setItem = appearance.series[i];
74
- if(setItem) {
75
- item.itemStyle.normal.color = setItem.itemColor;
76
- item.label.color = setItem.labelColor;
77
- item.label.fontSize = setItem.labelSize;
78
- item.label.padding[0] = setItem.labelTop;
79
- }
80
- item.label.formatter = `{c}${setItem ? setItem.labelUnit : ''}`;
81
- }
82
- if(appearance.total && appearance.total.length) {
83
- options.series[1].label.formatter = function(param) {
84
- if(!param.value) return '';
85
- const val = appearance.totalLabel ? appearance.total[param.dataIndex].value || options.series[1].data[param.dataIndex] : '';
86
- return `${val}${appearance.series[1].labelUnit}`;
87
- }
88
- }
89
- }
90
- // Top排行榜自定义展示配置
91
- function setMapTopScoreFormatter(options, data, appearance) {
92
- const yNode = options.yAxis[0];
93
- if(!yNode.axisLabel.formatter) {
94
- yNode.axisLabel.formatter = function(value, i) {
95
- return `{a${i+1}|}{b|${value}}`;
96
- }
97
- }
98
- const seriesNode = options.series[0];
99
- if(appearance.total && appearance.total.length) {
100
- const realData = data && data.seriesData && data.seriesData[0] && data.seriesData[0].data;
101
- const normalData = [28.7, 24.2, 20.3, 19.8, 19.3];
102
- const resultData = realData && realData.length ? realData : normalData;
103
- seriesNode.itemStyle.normal.label.formatter = function(param) {
104
- return `${resultData[param.dataIndex]}${appearance.unit}`;
105
- }
106
- for(let i = 0; i < appearance.total.length; i++) {
107
- const value = appearance.total[i].value;
108
- seriesNode.data[i] = value ? parseInt(value) : normalData[i];
109
- }
110
- }
111
- if(seriesNode.itemStyle.normal.color) return;
112
- const colorList = appearance.barColor || rankingTopColorList;
113
- for (let i = 0; i < options.series.length; i++) {
114
- const node = options.series[i];
115
- node.itemStyle.normal.color = function(params) {
116
- return colorList[params.dataIndex];
117
- }
118
- }
119
- }
120
- // 散点图series自定义展示配置
121
- function setMapScatterFormatter(options) {
122
- const seriesNode = options.series[0];
123
- if(!options.tooltip.formatter) {
124
- options.tooltip.formatter = function(param) {
125
- const value = param.value;
126
- // prettier-ignore
127
- return `<div style="border-bottom: 1px solid rgba(255,255,255,.3); font-size: 12px;padding-bottom: 5px;margin-bottom: 5px;">${param.seriesName}告警</div>告警等级:${value[1]}<br>告警数量:${value[2]}`;
128
- }
129
- }
130
- if(!options.yAxis[0].axisLabel.formatter) {
131
- options.yAxis[0].axisLabel.formatter = function (value, index) {
132
- return `{f${index+1}|${value}}`;
133
- }
134
- }
135
- if(seriesNode.symbolSize) return;
136
- for (let i = 0; i < options.series.length; i++) {
137
- const node = options.series[i];
138
- node.symbolSize = function(d) {
139
- let markSize = Math.sqrt(d[2]) * 2;
140
- if(markSize < 6) markSize = 6;
141
- if(markSize > 20) markSize = 20;
142
- //if(!markSize) markSize = 1;
143
- return markSize;
144
- }
145
- node.label.emphasis.formatter = function(param) {
146
- return param.data[0];
147
- }
148
- }
149
- }
150
- // 环形图自定义展示配置
151
- function setMapRingOptionsFormatter(appearance, seriesNode) {
152
- if(appearance.labelDetail && appearance.labelDetail.length) {
153
- seriesNode.label.normal.formatter = (data) => {
154
- let result = `{a|${data.name}}\n{cir|}`;
155
- for (let i = 0; i < appearance.labelDetail.length; i++) {
156
- const detail = appearance.labelDetail[i];
157
- result += '\n'+`{b${i+1}|${detail.title}${i === 0 ? data.value : data[`value${i+1}`]}${detail.unit}}`;
158
- }
159
- return result;
160
- }
161
- }else {
162
- seriesNode.label.normal.formatter = (data) => {
163
- if (appearance.label.showValue === true) {
164
- return `${data.name}:${data.value}${appearance.label.unit}`;
165
- } else {
166
- return `${data.name}`;
167
- }
168
- }
169
- }
170
- }
@@ -1,4 +0,0 @@
1
- export * from './conversion';
2
- export * from './drawGraphic';
3
- export * from './changeOptions';
4
- export * from './formatter';
@@ -1,4 +0,0 @@
1
- export * from './conversion';
2
- export * from './drawGraphic';
3
- export * from './changeOptions';
4
- export * from './formatter';
@@ -1,8 +0,0 @@
1
- export declare function lineBarDataAuto(option: any, params: {}, data: {}, appearance: {}): void;
2
- export declare function barPileStaticDataAuto(option: any, data: {}, appearance: {}): void;
3
- export declare function topRankingListAuto(option: any, data: {}, appearance: {}): void;
4
- export declare function scatterDataAuto(option: any, data: {}): void;
5
- export declare function pieRingAssetTotalAuto(option: any, data: {}, total: number, count: number): void;
6
- export declare function pieRingProportionAuto(option: any, data: {}, proportion: number): void;
7
- export declare function pieRingNormalAuto(option: any, data: {}): void;
8
- export declare function gaugeNormalAuto(option: any, data: {}): void;
@@ -1,228 +0,0 @@
1
- import {echartsColorData} from "../../../static";
2
-
3
- /**
4
- * 折线和柱状图实时数据
5
- * @param option 图表配置数据
6
- * @param params 绑定的图表参数
7
- * @param data 实时图表数据
8
- * @param appearance 配置参数
9
- */
10
- export function lineBarDataAuto(option, params, data, appearance) {
11
- const seriesNodes = option.series;
12
- if(data && data.XData) option.xAxis[0].data = data.XData;
13
- if(!(data && data.seriesData && data.seriesData.length)) return;
14
- if(params.tabCorrelationType) {
15
- // 如果操作类型是select下拉分组下的tab切换,执行下面的逻辑
16
- const realSeriesNode = data.seriesData[params.tabVisitOrder || 0];
17
- seriesNodes[0].data = realSeriesNode.data;
18
- if(realSeriesNode.name) seriesNodes[0].name = realSeriesNode.name;
19
- return;
20
- }
21
- if(seriesNodes.length > 1 || params && params.curveNum > 1){
22
- // 双曲线|柱状
23
- if(option.yAxis.length > 1 && appearance.yAxisValueAuto) {
24
- if(!appearance.yAxisMaxIntervalue) appearance.yAxisMaxIntervalue = 1;
25
- // 双轴曲线,且曲线值为自适应
26
- const dataGroup = {
27
- data1: data.seriesData[0] && data.seriesData[0].data || [],
28
- data2: data.seriesData[1] && data.seriesData[1].data || []
29
- };
30
- const newData = [...dataGroup.data1, ...dataGroup.data2];
31
- let min = Math.min(...newData);
32
- let max = Math.max(...newData);
33
- const power = Math.floor(Math.log10(min));
34
- for (let i = 0; i < option.yAxis.length; i++) {
35
- const currentData = dataGroup[`data${i + 1}`];
36
- if(min < 0 && Math.max(...currentData) < max) max *= appearance.yAxisMaxIntervalue;
37
- if(min > 0 && Math.max(...currentData) < max) min = Math.pow(10, power);
38
- option.yAxis[i].min = Math.ceil(min);
39
- option.yAxis[i].max = Math.ceil(max);
40
- }
41
- }
42
- const legendData = [];
43
- let legendChange = false;
44
- seriesNodes.map((item, index) => {
45
- const seriesItem = data.seriesData[index];
46
- item.data = seriesItem ? seriesItem.data : [];
47
- // 获取角标数据
48
- if(seriesItem && seriesItem.name) {
49
- item.name = seriesItem.name;
50
- legendData.push(seriesItem.name);
51
- legendChange = true;
52
- }
53
- });
54
- if(option.legend && legendChange) option.legend.data = legendData; // 为角标数据赋值
55
- }else{
56
- if(!data.seriesData.length) return;
57
- let seriesData = [];
58
- for (let i = 0; i < data.seriesData.length; i++){
59
- const realSeriesNode = data.seriesData[i];
60
- let currSeriesNode = {};
61
- const seriesItem = seriesNodes[i];
62
- if(seriesItem) {
63
- currSeriesNode = seriesItem;
64
- }else {
65
- const newSeriesItem = JSON.parse(JSON.stringify(seriesNodes[0]));
66
- newSeriesItem.itemStyle.normal.lineStyle.color = echartsColorData[i];
67
- newSeriesItem.itemStyle.normal.color = echartsColorData[i];
68
- currSeriesNode = newSeriesItem;
69
- }
70
- if(realSeriesNode.name) currSeriesNode.name = realSeriesNode.name;
71
- currSeriesNode.data = realSeriesNode.data;
72
- seriesData.push(currSeriesNode);
73
- }
74
- option.series = seriesData;
75
- }
76
- }
77
-
78
- export function barPileStaticDataAuto(option, data, appearance) {
79
- if(data && data.XData) option.yAxis[0].data = data.XData;
80
- if(!(data && data.seriesData && data.seriesData.length)) return;
81
- const seriesData = data.seriesData[0].data;
82
- option.series[0].data = seriesData;
83
- const data2 = [];
84
- for (let i = 0; i < seriesData.length; i++) {
85
- const dr = appearance.total[i] ? appearance.total[i].value - Number(seriesData[i]) : data.seriesData[1].data[i];
86
- data2.push(dr);
87
- }
88
- option.series[1].data = data2;
89
- }
90
-
91
- /**
92
- * TOP排行-电量仪实时数据
93
- * @param option 图表配置数据
94
- * @param data 实时图表数据
95
- * @param appearance 自定义配置数据
96
- */
97
- export function topRankingListAuto(option, data, appearance) {
98
- if(data && data.XData) option.yAxis[0].data = data.XData;
99
- if(!(data && data.seriesData && data.seriesData.length)) return;
100
- if(appearance.type === 'TOPRanking') {
101
- if(appearance.total && appearance.total.length) return;
102
- option.series[0].data = data.seriesData[0].data;
103
- }else {
104
- const seriesData = data.seriesData[0].data;
105
- option.yAxis[1].data = seriesData;
106
- for (let i = 0; i < option.series.length; i++) {
107
- const node = option.series[i];
108
- node.symbolBoundingData = data.total;
109
- node.data = seriesData;
110
- }
111
- }
112
- }
113
- /**
114
- * 散点图-分数实时数据
115
- * @param option 图表配置数据
116
- * @param data 实时图表数据
117
- */
118
- export function scatterDataAuto(option, data) {
119
- if(data && data.XData) option.xAxis[0].data = data.XData;
120
- if(!(data && data.seriesData && data.seriesData.length)) return;
121
- const { scatterData, legend, yData } = convertScatter3DTo2D(data);
122
- option.legend.data = [...legend];
123
- option.yAxis[0].data = [...yData];
124
- for (let i = 0; i < option.series.length; i++) {
125
- const seriesNode = option.series[i];
126
- const name = option.legend.data[i];
127
- seriesNode.name = name;
128
- seriesNode.data = scatterData[name];
129
- }
130
- }
131
-
132
- function convertScatter3DTo2D(arr3d) {
133
- const { XData, seriesData } = arr3d;
134
- const scatterData = {};
135
- const legend = [];
136
- const yData = new Set();
137
- // 第一层遍历
138
- for (let d = 0, depth = seriesData.length; d < depth; d++) {
139
- const areaData = seriesData[d];
140
- const areaName = areaData.name;
141
- if(!scatterData[areaName]) scatterData[areaName] = [];
142
- legend.push(areaData.name);
143
- // 第二层遍历
144
- const statusData = areaData.data;
145
- for (let h = 0, height = statusData.length; h < height; h++) {
146
- const issues = statusData[h];
147
- const statusName = XData[h];
148
- // 第三层遍历
149
- for (let w = 0, width = issues.length; w < width; w++) {
150
- const { name, value } = issues[w];
151
- yData.add(name);
152
- if(value) scatterData[areaName].push([statusName, name, Number(value)]);
153
- }
154
- }
155
- }
156
- return {
157
- scatterData,
158
- legend,
159
- yData
160
- };
161
- }
162
-
163
- /**
164
- * 环形设备告警数量实时数据
165
- * @param option 图表配置数据
166
- * @param data 实时图表数据
167
- * @param total 总数
168
- * @param count 告警数
169
- */
170
- export function pieRingAssetTotalAuto(option, data, total, count) {
171
- if(data && data.length > 1) {
172
- total = parseInt(data[0].value);
173
- count = parseInt(data[1].value);
174
- }
175
- option.title.text = '{v|'+count+'}{unit|/'+total+'台}';
176
- const value1 = ((100 / total) * count).toFixed(6);
177
- option.series[0].data[0].value = value1;
178
- option.series[0].data[1].value = 100 - value1;
179
- }
180
-
181
- /**
182
- *
183
- * @param option 图表配置数据
184
- * @param data 实时图表数据
185
- * @param proportion 默认百分数
186
- */
187
- export function pieRingProportionAuto(option, data, proportion) {
188
- if(data && data.length) {
189
- proportion = Number(data[0].value);
190
- }
191
- if(!option.series[0].data[0].label.normal.formatter) option.series[0].data[0].label.normal.formatter = function(params){
192
- return params.value ? `{v|${params.value}}{unit|%}` : `{v|${params.value}}`;
193
- }
194
- option.series[0].data[0].value = proportion;
195
- option.series[0].data[1].value = 100 - proportion;
196
- }
197
-
198
- /**
199
- * 饼图环形图默认展示 实时数据
200
- * @param option 图表配置数据
201
- * @param data 实时图表数据
202
- */
203
- export function pieRingNormalAuto(option, data) {
204
- if(!(data && data.length)) return;
205
- const colors = option.color || echartsColorData;
206
- const seriesData = [];
207
- data.map((chd, index) => {
208
- seriesData.push({
209
- itemStyle: { color: colors[index] },
210
- name: chd.name,
211
- value: chd.value
212
- })
213
- })
214
- option.series[0].data = seriesData;
215
- }
216
-
217
- /**
218
- * 仪表盘默认展示 实时数据
219
- * @param option 图表配置数据
220
- * @param data 实时图表数据
221
- */
222
- export function gaugeNormalAuto(option, data) {
223
- if(!data) return;
224
- // 仪表盘分两种,分别有不同的取值方式,下面两行先注释掉
225
- // node.appearance.title.text = data.name;
226
- // option.title.text = data.name;
227
- option.series[0].data[0].value = data.value;
228
- }
@@ -1,5 +0,0 @@
1
- import { Node } from '../models';
2
- import { visualization2DStore } from '../store';
3
- export declare function setStyleForElementIdDiv(node: Node, elem: HTMLElement, data: visualization2DStore): void;
4
- export declare function createDiv(node: Node): HTMLDivElement;
5
- // export declare function loadJS(url: string, callback?: () => void, render?: boolean): void;
@@ -1,54 +0,0 @@
1
- import {Lock} from '../models';
2
- import {commonStore} from '../store';
3
- export function setStyleForElementIdDiv(node, elem, data) {
4
- if (!elem) return;
5
- const store = commonStore[node.TID].data;
6
- elem.style.position = 'absolute';
7
- elem.style.outline = 'none';
8
- elem.style.left = node.rect.x + 'px';
9
- elem.style.top = node.rect.y + 'px';
10
- elem.style.width = node.rect.width / store.pageZoom + 'px';
11
- elem.style.height = node.rect.height / store.pageZoom + 'px';
12
- if (node.rotate || node.offsetRotate) {
13
- elem.style.transform = "rotate(" + (node.rotate + node.offsetRotate) + "deg)";
14
- }
15
- if (data && data.locked > Lock.None || node.locked > Lock.None) {
16
- elem.style.userSelect = 'initial';
17
- elem.style.pointerEvents = 'initial';
18
- } else {
19
- elem.style.userSelect = 'none';
20
- elem.style.pointerEvents = 'none';
21
- }
22
- }
23
-
24
- // 创建div
25
- export function createDiv(node) {
26
- var div = document.createElement('div');
27
- div.setAttribute('class', 'topoEchart');
28
- div.style.position = 'absolute';
29
- div.style.outline = 'none';
30
- div.style.left = '-9999px';
31
- div.style.bottom = '-9999px';
32
- div.style.width = node.rect.width + 'px';
33
- div.style.height = node.rect.height + 'px';
34
- div.id = node.id;
35
- return div;
36
- }
37
-
38
- // export function loadJS(url, callback, render) {
39
- // var loaderScript = document.createElement('script');
40
- // loaderScript.type = 'text/javascript';
41
- // loaderScript.src = url;
42
- // loaderScript.addEventListener('load', function () {
43
- // if (callback) {
44
- // callback();
45
- // }
46
- // // how to do
47
- // if (render) {
48
- // Store.set('LT:render', true);
49
- // }
50
- // });
51
- // document.body.appendChild(loaderScript);
52
- // }
53
-
54
- //# sourceMappingURL=dom.js.map
@@ -1,3 +0,0 @@
1
- import { Node } from '../models';
2
-
3
- export declare function createIframeElement(node: Node): HTMLIFrameElement;
@@ -1,12 +0,0 @@
1
- // 创建iframe
2
- export function createIframeElement(node) {
3
- const iframe = document.createElement('iframe');
4
- // iframe.scrolling = 'no';
5
- iframe.frameBorder = '0';
6
- iframe.src = node.iframe;
7
- iframe.width = node.rect.width;
8
- iframe.height = node.rect.height;
9
- iframe.setAttribute('id', node.id);
10
- iframe.setAttribute('class', 'topology2dConfIfram');
11
- return iframe;
12
- }
@@ -1,4 +0,0 @@
1
- export * from './common';
2
- export * from './iframe';
3
- export * from './select';
4
- export * from './tab';
@@ -1,4 +0,0 @@
1
- export * from './common';
2
- export * from './iframe';
3
- export * from './select';
4
- export * from './tab';
@@ -1,11 +0,0 @@
1
- import { Node } from '../models';
2
-
3
- export declare function createSelectElement(node: Node): HTMLDivElement;
4
- export declare function createSelectDropdown(node: Node): HTMLDivElement;
5
- export declare function createSelectOptions(data: [], node: Node): string;
6
- export declare function getSelectedData(e: Event, data: any, editData: any): void;
7
- export declare function setSelectInteractiveState(selected: any, node: Node): void;
8
- export declare function resetSelectInteractiveState(node: Node): void;
9
- export declare function setSelectDropdownInteractiveState(node: any, staticType: any, type: any): void;
10
- export declare function setSelectElementPosition(node: Node, type: string): void;
11
- export declare function setSelectElementTheme(node: Node): void;