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,432 +0,0 @@
1
- import {echartsDataRoom, echartsColorData, rankingTopImageName} from '../../../static';
2
- import {
3
- setSeriesRenderGroup,
4
- drawGraphicShape,
5
- setChartLegendData,
6
- setChartXAxisData,
7
- setChartYAxisData,
8
- setLineSeriesStyleData,
9
- setRingPreSeriesOptions,
10
- setRingProSeriesOptions,
11
- mapFormatterSet
12
- } from '../utils';
13
- import {
14
- gaugeNormalAuto,
15
- lineBarDataAuto,
16
- pieRingAssetTotalAuto,
17
- pieRingProportionAuto,
18
- pieRingNormalAuto,
19
- topRankingListAuto,
20
- scatterDataAuto,
21
- barPileStaticDataAuto
22
- } from './render';
23
- import {commonStore, echartsStaticType} from "../../../core";
24
-
25
- export function getXYAxisLabelVal(index, intervalNum, value) {
26
- if (index === 0 || index % intervalNum === 0) {
27
- return value;
28
- } else {
29
- return '';
30
- }
31
- }
32
-
33
- /**
34
- * 初始化图表与tabs关联的配置数据
35
- * @param node 元件节点
36
- */
37
- export function initBindTabSetting(node) {
38
- const tabStaticKey = node.tags && node.tags.find((tag) => {return tag.includes('switchTabType')});
39
- const switchTabData = tabStaticKey && commonStore[node.TID].switchTabDataPool[`${tabStaticKey}Data`];
40
- if(switchTabData) {
41
- const tabNode = Object.values(switchTabData)[0];
42
- const tabEventNode = tabNode.events.find((ev) => {return ev.action === 8});
43
- const tabStaticType = tabEventNode && tabEventNode.dcimStaticForType || '';
44
- node.data.params.staticForType = tabStaticType;
45
- return {
46
- type: tabStaticType,
47
- data: tabNode.tabData
48
- };
49
- }
50
- return null;
51
- }
52
-
53
- // 自动滑动展示数据
54
- export function setMapAutoMoveOptions(option, chartNode, node, callback) {
55
- option.dataZoom = echartsDataRoom;
56
- const dataZoomNode = option.dataZoom[0];
57
- const {start, end, time} = node.appearance.zoomParams;
58
- const zoomStart = Number(start);
59
- const zoomEnd = Number(end);
60
- const zoomTime = Number(time);
61
- dataZoomNode.start = zoomStart;
62
- dataZoomNode.end = zoomEnd;
63
- chartNode.timeTicket = setInterval(() => {
64
- if (Number(dataZoomNode.end) > 100) {
65
- dataZoomNode.end = zoomEnd;
66
- dataZoomNode.start = zoomStart;
67
- } else {
68
- dataZoomNode.end = dataZoomNode.end + 1 * (100 / option.series[0].data.length);
69
- dataZoomNode.start = dataZoomNode.start + 1 * (100 / option.series[0].data.length);
70
- }
71
- callback(option);
72
- }, zoomTime * 1000);
73
- }
74
-
75
- // 停止自动滑动展示数据
76
- export function setMapStopAutoMoveOptions(chartNode) {
77
-
78
- clearInterval(chartNode.timeTicket);
79
-
80
- }
81
-
82
- // 自动配置散点图的节点数据
83
- export function setMapScatterOptions(option, node) {
84
- if(node.appearance.series) {
85
- for (let i = 0; i < option.series.length; i++) {
86
- const series = option.series[i];
87
- const setSeries = node.appearance.series[i];
88
- if(setSeries) {
89
- series.itemStyle.color = setSeries.itemColor;
90
- series.itemStyle.borderColor = setSeries.itemBorderColor;
91
- }
92
- }
93
- }
94
- if(node.appearance.yAxis && node.appearance.yAxis.axisLabel && node.appearance.yAxis.axisLabel.length) {
95
- const yAxisAxisLabelRich = option.yAxis[0].axisLabel.rich;
96
- const yAxisAxisLabel = node.appearance.yAxis.axisLabel;
97
- const yAxisData = [];
98
- for (let i = 0; i < yAxisAxisLabel.length; i++) {
99
- const axisLabel = yAxisAxisLabel[i];
100
- yAxisAxisLabelRich[`f${i+1}`] = {
101
- color: axisLabel.color
102
- };
103
- if(axisLabel.label) yAxisData.push(axisLabel.label);
104
- }
105
- option.yAxis[0].data = yAxisData;
106
- }
107
- }
108
-
109
- // 自动配置折线和柱状图的节点数据
110
- export function setMapLineBarOptions(option, node) {
111
- option.color = node.appearance.color;
112
- option.xAxis[0].axisLabel.formatter = function (value, index) {
113
- return getXYAxisLabelVal(index, node.appearance.intervalNumX, value);
114
- }
115
- option.yAxis[0].axisLabel.formatter = function (value, index) {
116
- return getXYAxisLabelVal(index, node.appearance.intervalNumY, value);
117
- }
118
- if(option.series.length < 2) return;
119
- const total = node.appearance.total;
120
- if(total && total.length) {
121
- const seriesData = option.series[0].data;
122
- if(seriesData.length < total.length && total[total.length - 1].value) seriesData.push(20);
123
- const data2 = [];
124
- for (let i = 0; i < seriesData.length; i++) {
125
- const dr = node.appearance.total[i] ? node.appearance.total[i].value - Number(seriesData[i]) : option.series[1].data[i];
126
- data2.push(dr);
127
- }
128
- option.series[1].data = data2;
129
- }else {
130
- option.series.map((item, index) => {
131
- if(!(item.itemStyle && item.itemStyle.normal && item.itemStyle.normal.color)) {
132
- item.itemStyle = {
133
- normal: {
134
- color : echartsColorData[index]
135
- }
136
- }
137
- }
138
- });
139
- }
140
- // chartOption.yAxis[0].splitLine = node.appearance.splitLine;
141
- }
142
-
143
- // 自动配置仪表盘的节点数据
144
- export function setMapGaugeOptions(option, node) {
145
- //const chartOption = JSON.parse(JSON.stringify(option));
146
- const seriesNode = option.series[0];
147
- const appearance = node.appearance;
148
- if(!appearance.min) appearance.min = 0;
149
- if(!appearance.max) appearance.max = 100;
150
- if (typeof appearance.min === 'number') seriesNode.min = appearance.min;
151
- if (appearance.max) seriesNode.max = appearance.max;
152
- if (appearance.splitNumber) seriesNode.splitNumber = appearance.splitNumber;
153
- if (appearance.pointer) seriesNode.pointer = appearance.pointer;
154
- if (appearance.axisLabel) seriesNode.axisLabel = appearance.axisLabel;
155
- if (appearance.axisLine) seriesNode.axisLine.lineStyle = appearance.axisLine.lineStyle;
156
- if (appearance.detail) seriesNode.detail = appearance.detail;
157
- if (appearance.data) seriesNode.data = appearance.data;
158
- if (appearance.detail) seriesNode.detail = appearance.detail;
159
- if (appearance.data) seriesNode.data = appearance.data;
160
- if (option.isGaugeLinear) {
161
- seriesNode.axisLine.lineStyle.color = [
162
- [1, new echarts.graphic.LinearGradient(0, 0, 1, 0, option.linearColors)]
163
- ]
164
- }
165
- }
166
-
167
- // 自动配置环形图和饼图的节点数据
168
- export function setMapRingOptions(option, node) {
169
- //const chartOption = JSON.parse(JSON.stringify(option));
170
- const appearance = node.appearance;
171
- if(appearance.type === 'ringPre'){
172
-
173
- setRingPreSeriesOptions(option, appearance);
174
-
175
- }else if(appearance.type === 'ringPro'){
176
-
177
- setRingProSeriesOptions(option, appearance);
178
-
179
- }else {
180
- const seriesNode = option.series[0];
181
- if ((!appearance.label || typeof appearance.label.showValue !== 'boolean')) {
182
- appearance.label = {
183
- showValue: appearance.type === 'ring',
184
- unit: appearance.type === 'ring' ? '%' : ''
185
- }
186
- }
187
- seriesNode.label = {
188
- normal: {
189
- show: true,
190
- position: 'outside',
191
- color: appearance.label.color || '',
192
- fontSize: appearance.label.fontSize || '12'
193
- }
194
- };
195
-
196
- seriesNode.labelLine = appearance.labelLine && {...appearance.labelLine} || {};
197
-
198
- if(seriesNode.labelLine.lineStyle && !seriesNode.labelLine.lineStyle.color) {
199
- delete seriesNode.labelLine.lineStyle['color'];
200
- }
201
-
202
- const rich = {};
203
-
204
- if(appearance.cir && appearance.cir.show) {
205
- rich.cir = {...appearance.cir};
206
- if(!rich.cir.borderColor) rich.cir.borderColor = 'auto';
207
- if(!rich.cir.backgroundColor) rich.cir.backgroundColor = 'transparent';
208
- }
209
-
210
- if(appearance.labelDetail && appearance.labelDetail.length) {
211
- // 环形明细展示配置,线条样式配置
212
- rich.a = {
213
- color: appearance.label.color || '',
214
- fontSize: appearance.label.fontSize || '12'
215
- };
216
- for (let i = 0; i < appearance.labelDetail.length; i++) {
217
- const detail = appearance.labelDetail[i];
218
- rich[`b${i+1}`] = {
219
- color: detail.color,
220
- fontSize: detail.fontSize || '12'
221
- };
222
- }
223
- }
224
- seriesNode.label.normal.rich = rich;
225
- }
226
- }
227
-
228
- // 自动配置3D柱状图的节点数据
229
- export function setMap3dBarOptions(option, node) {
230
- // 取消注册自定义形状
231
- //const chartOption = JSON.parse(JSON.stringify(option));
232
- const seriesNode = option.series[0];
233
- const appearance = node.appearance;
234
- if (appearance.seriesCubeLeftLinear) appearance.seriesCubeLeftColor = 'rgb(0, 128, 215)';
235
- if (appearance.seriesCubeRightLinear) appearance.seriesCubeRightColor = 'rgb(3, 58, 125)';
236
- if (appearance.graphicShape) {
237
- const {CubeLeft, CubeRight, CubeTop} = drawGraphicShape(appearance);
238
- // 注册三个面图形
239
- echarts.graphic.registerShape('CubeLeft', CubeLeft);
240
- echarts.graphic.registerShape('CubeRight', CubeRight);
241
- echarts.graphic.registerShape('CubeTop', CubeTop);
242
- }
243
- option.tooltip.formatter = function (params) {
244
- const item = params[0];
245
- return item.name + ' : ' + item.value;
246
- }
247
- }
248
-
249
- function renderMap3dBarSeriesItem(seriesNode, appearance) {
250
- seriesNode.renderItem = (params, api) => {
251
- const seriesRenderData = setSeriesRenderGroup(appearance, api);
252
- return {
253
- type: 'group',
254
- children: seriesRenderData,
255
- };
256
- };
257
- }
258
-
259
- export function setMapTopOptions(option, node) {
260
- //const chartOption = JSON.parse(JSON.stringify(option));
261
- const appearance = node.appearance;
262
- Object.assign(option.grid, appearance.grid);
263
- if(!appearance.type.includes('TOPRanking')) return;
264
- const yNode = option.yAxis[0];
265
- if(yNode.axisLabel.rich['a1']) return;
266
- for (let i = 0, length = yNode.data.length; i < length; i++) {
267
- const order = i + 1;
268
- yNode.axisLabel.rich[`a${order}`] = {
269
- width: 30,
270
- height: 17,
271
- lineHeight: 22,
272
- verticalAlign: 'bottom',
273
- backgroundColor: {
274
- image: `../../../images/TOP/NO-${order}-${rankingTopImageName[i]}.png`
275
- }
276
- }
277
- }
278
- }
279
-
280
- /**
281
- * 公共配置
282
- * @param option 图表配置数据
283
- * @param node 元件数据
284
- */
285
- export function setMapGlobalOptions(option, node) {
286
- // const chartOption = JSON.parse(JSON.stringify(option));
287
- const appearance = node.appearance;
288
- // 图表网格数据
289
- if (appearance.grid) {
290
-
291
- option.grid ? Object.assign(option.grid, appearance.grid) : option.grid = appearance.grid;
292
-
293
- }
294
- // 图表X轴数据
295
- if (option.xAxis) setChartXAxisData(option.xAxis, appearance);
296
- // 图表Y轴数据
297
- if (option.yAxis) setChartYAxisData(option.yAxis, appearance);
298
- // 图表图例数据
299
- //if (option.legend) setChartLegendData(option.legend, appearance);
300
- // 曲线样式数据
301
- if (appearance.type.includes('line')) setLineSeriesStyleData(option.series, appearance);
302
- }
303
-
304
- // 实时改变图表data值
305
- export function setMapDataOptions(option, node) {
306
- const optionNode = commonStore[node.TID].echartsOptionsPool[node.id].option;
307
- const appearance = node.appearance;
308
- const params = node.params;
309
- // 3d 柱状图
310
- if (appearance.type === '3dBar') renderMap3dBarSeriesItem(optionNode.series[0], appearance);
311
- const displayMode = parseInt(option.displayMode); // 图表类型
312
- const staticForType = params && params.staticForType || ''; //统计类型:日,周,月,年,实时,其他
313
- const syncEchartsData = commonStore[node.TID].echartsRealDataPool[node.id]; // 统计图实时数据
314
- let staticTypeData = null; // 统计类型数据
315
- if(staticForType === 'OTHER'){
316
- // 其他类型,类型中的数据通常统计的都是历史数据,日、周、月、年、实时中的某一类,通常搭配分组统计使用。
317
- // 类型中绑定一个测点为一个类型,绑定多个测点为多个类型。比如:有电功率和功率因数为两个分类,图表分组中分类数据绑定时就要同时绑定有电功率和功率因数两个测点,否则无法实现切换
318
- for (let i = 0 ; i < echartsStaticType.length; i++) {
319
- const chartData = syncEchartsData && syncEchartsData[`${echartsStaticType[i]}_Data`];
320
- if(chartData) staticTypeData = chartData;
321
- }
322
- }else {
323
- // 日,周,月,年,实时类型,不与分组统计一起使用
324
- staticTypeData = staticForType ? syncEchartsData && syncEchartsData[`${staticForType}_Data`] : syncEchartsData;
325
- }
326
- // 实时数据加载
327
- if(staticTypeData) {
328
-
329
- if (displayMode === 1 || displayMode === 2) { // 折线图,柱状图
330
-
331
- if(node.tabData && node.tabData.data.state && optionNode.yAxis[0].max) Object.assign(optionNode.yAxis[0], node.tabData.data); //若Tabs切换配置了数据,则修改Y轴原有配置
332
-
333
- if(appearance.type === 'barPileStatic') {
334
-
335
- barPileStaticDataAuto(optionNode, staticTypeData, appearance);
336
-
337
- }else {
338
-
339
- lineBarDataAuto(optionNode, params, staticTypeData, appearance);
340
-
341
- }
342
-
343
- }
344
- if(displayMode === 4) { // top排行榜-电量仪
345
-
346
- topRankingListAuto(optionNode, staticTypeData, appearance);
347
-
348
- }
349
- if(displayMode === 7) { // 散点图
350
-
351
- scatterDataAuto(optionNode, staticTypeData);
352
-
353
- }
354
- if (displayMode === 5 || displayMode === 3) { // 饼图/环形图
355
- const pieData = staticTypeData && staticTypeData.data || staticTypeData || [];
356
- if(appearance.type === 'ringPre') {
357
- // 按照资产总台数统计设备告警数量
358
- pieRingAssetTotalAuto(optionNode, pieData, appearance.total, appearance.alarmCount);
359
-
360
- }else if(appearance.type === 'ringPro'){
361
- // 按照百分比统计设备配置情况
362
- pieRingProportionAuto(optionNode, pieData, appearance.proportion);
363
- }else {
364
-
365
- pieRingNormalAuto(optionNode, pieData);
366
-
367
- }
368
- }
369
- if(displayMode === 6) { // 仪表盘
370
-
371
- gaugeNormalAuto(optionNode, staticTypeData);
372
-
373
- }
374
- }else {
375
- if(option.title && option.title.text) {
376
- optionNode.title.text = option.title.text;
377
- }
378
- if (option.legend) {
379
- optionNode.legend = option.legend;
380
- } else {
381
- delete optionNode['legend'];
382
- }
383
- if (option.xAxis) {
384
- for (let i = 0; i < option.xAxis.length; i++) {
385
- const item = option.xAxis[i];
386
- if (item.data) {
387
- optionNode.xAxis[i].data = item.data;
388
- }
389
- }
390
- }
391
- if (option.yAxis) {
392
- for (let i = 0; i < option.yAxis.length; i++) {
393
- const item = option.yAxis[i];
394
- if (item.data) {
395
- optionNode.yAxis[i].data = item.data;
396
- }
397
- }
398
- }
399
- if (option.series) {
400
- for (let i = 0; i < option.series.length; i++) {
401
- const item = option.series[i];
402
- if(item.name) optionNode.series[i].name = item.name;
403
- optionNode.series[i].data = item.data;
404
- }
405
- }
406
- }
407
-
408
- mapFormatterSet(appearance, optionNode, staticTypeData);
409
-
410
- const currentChartNode = commonStore[node.TID].echartsDataPool[node.id];
411
- const mapChart = currentChartNode.chart;
412
- clearInterval(currentChartNode.timeTicket);
413
- currentChartNode.timeTicket = null;
414
- // 自动滑动展示数据
415
- if (appearance.timeTicket) {
416
- mapChart.off('mouseover');
417
- mapChart.off('mouseout');
418
- mapChart.on('mouseover', function () {
419
- setMapStopAutoMoveOptions(currentChartNode);
420
- });
421
- mapChart.on('mouseout', function () {
422
- setMapAutoMoveOptions(optionNode, currentChartNode, node, function (chartNode) {
423
- return mapChart.setOption(chartNode);
424
- })
425
- });
426
- setMapAutoMoveOptions(optionNode, currentChartNode, node, function (chartNode) {
427
- return mapChart.setOption(chartNode);
428
- })
429
- }
430
- mapChart.setOption(optionNode);
431
- mapChart.resize();
432
- }
@@ -1,3 +0,0 @@
1
- export declare function drawGraphicShape(appearance: any): any;
2
- export declare function graphicLinearGradient(nr: number, nb: number, nl: number, nt: number, colors: []): any;
3
- export declare function setSeriesRenderGroup(appearance: any, api: any): [];
@@ -1,97 +0,0 @@
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
- }
@@ -1 +0,0 @@
1
- export declare function mapFormatterSet(appearance: object, option: any, data: any): void;