dcim-topology2d 1.1.2 → 1.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. package/chart-diagram/index.d.ts +2 -0
  2. package/chart-diagram/index.js +1 -0
  3. package/chart-diagram/src/echarts/index.d.ts +0 -1
  4. package/chart-diagram/src/echarts/index.js +106 -101
  5. package/chart-diagram/src/register.js +4 -3
  6. package/chart-diagram/src/utils/changeOptions.d.ts +4 -0
  7. package/chart-diagram/src/utils/changeOptions.js +163 -0
  8. package/chart-diagram/src/utils/conversion.d.ts +17 -0
  9. package/chart-diagram/src/utils/conversion.js +179 -0
  10. package/chart-diagram/src/utils/drawGraphic.d.ts +3 -0
  11. package/chart-diagram/src/utils/drawGraphic.js +97 -0
  12. package/chart-diagram/src/utils/index.d.ts +3 -0
  13. package/chart-diagram/src/utils/index.js +3 -0
  14. package/core/src/common.js +41 -35
  15. package/core/src/core.js +87 -58
  16. package/core/src/divLayer.d.ts +0 -26
  17. package/core/src/divLayer.js +22 -276
  18. package/core/src/healps/changeData.d.ts +1 -1
  19. package/core/src/healps/changeData.js +95 -57
  20. package/core/src/middles/arrows/index.d.ts +4 -0
  21. package/core/src/middles/arrows/index.js +5 -0
  22. package/core/src/middles/default.d.ts +1 -3
  23. package/core/src/middles/default.js +51 -51
  24. package/core/src/middles/index.js +3 -2
  25. package/core/src/middles/lines/index.d.ts +4 -0
  26. package/core/src/middles/lines/index.js +5 -0
  27. package/core/src/middles/nodes/iframe.d.ts +2 -0
  28. package/core/src/middles/nodes/iframe.js +12 -0
  29. package/core/src/middles/nodes/index.d.ts +46 -0
  30. package/core/src/middles/nodes/index.js +47 -0
  31. package/core/src/middles/nodes/pentagon.rect.js +1 -1
  32. package/core/src/middles/nodes/rectangle.rect.js +1 -1
  33. package/core/src/models/node.d.ts +6 -0
  34. package/core/src/models/node.js +17 -7
  35. package/core/src/models/pen.js +10 -1
  36. package/core/src/preview.js +30 -7
  37. package/core/src/renderLayer.js +1 -1
  38. package/core/src/store/data.js +2 -0
  39. package/core/src/utils/canvas.js +1 -1
  40. package/core/src/utils/dom.d.ts +2 -0
  41. package/core/src/utils/dom.js +66 -32
  42. package/core/src/utils/onmousevent.js +12 -3
  43. package/package.json +1 -1
  44. package/static/echartsDefaultData.js +239 -0
  45. package/static/echartsStore.js +14 -0
  46. package/static/index.js +2 -0
  47. package/style/index.css +13 -0
@@ -1,5 +1,6 @@
1
1
  import { ptInPolyXY } from './math';
2
2
  import { moveDataType, downDataType } from './construction'
3
+ import { Node } from '../models'
3
4
  // 执行window函数
4
5
  export function omouseEventPrototDoWindowFn (eventNode, node) {
5
6
 
@@ -18,8 +19,16 @@ export function mousMoveFun(type, pos, data) {
18
19
 
19
20
  for (var _i = 0, _a = data; _i < _a.length; _i++) {
20
21
  var item = _a[_i];
21
- const isPoint = ptInPolyXY(pos, item.rotatedAnchors);
22
- if(isPoint) {
22
+ //const isPoint = ptInPolyXY(pos, item.rotatedAnchors);
23
+ let isInPointNode = null;
24
+ if(item.name === 'arbitraryGraph') {
25
+ // 任意多边形通过点获取区域
26
+ isInPointNode = ptInPolyXY(pos, item.rotatedAnchors);
27
+ }else {
28
+ if(!(item instanceof Node)) item = new Node(item);
29
+ isInPointNode = item.hit(pos);
30
+ }
31
+ if(isInPointNode) {
23
32
  params.hoverNode = item;
24
33
  params.order = _i;
25
34
  }
@@ -43,7 +52,7 @@ export function mousDownFun(type, eventNode) {
43
52
  if(action === 3) {
44
53
  params.eventType = downDataType.Window; // 打开会话窗口
45
54
  }else if(action === 7){
46
- params.eventType = downDataType.Showhide; // 链接跳转
55
+ params.eventType = downDataType.Showhide; // 显示/隐藏
47
56
  params.value = eventNode.value;
48
57
  }else if(action === 8){
49
58
  params.eventType = downDataType.Tabswitch; // Tab切换
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dcim-topology2d",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "",
5
5
  "main": "-",
6
6
  "scripts": {
@@ -0,0 +1,239 @@
1
+ /**
2
+ * echarts图表默认数据组
3
+ * @type {{displayMode_1: string}}
4
+ */
5
+ export const echartsDefaultDataMap = {
6
+ displayMode_1: {
7
+ legend: null,
8
+ XData: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
9
+ seriesData: [{
10
+ type: 'line',
11
+ data: [820, 932, 901, 934, 1290, 1330, 1320]
12
+ }]
13
+ }, // 折线图
14
+ displayMode_2: {
15
+ legend: null,
16
+ XData: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
17
+ seriesData: [{
18
+ name: '',
19
+ data: [20, 60, 110, 220, 80, 100, 180]
20
+ }]
21
+ },// 柱状图
22
+ displayMode_3: {
23
+ legend: null,
24
+ seriesData: [{
25
+ value: 10,
26
+ name: '机房1'
27
+ }, {
28
+ value: 30,
29
+ name: '机房2'
30
+ }, {
31
+ value: 50,
32
+ name: '机房3'
33
+ }, {
34
+ value: 20,
35
+ name: '机房4'
36
+ }, {
37
+ value: 60,
38
+ name: '机房5'
39
+ }, {
40
+ value: 15,
41
+ name: '机房6'
42
+ }, {
43
+ value: 18,
44
+ name: '机房7'
45
+ }, {
46
+ value: 26,
47
+ name: '机房8'
48
+ }]
49
+ },// 环形图
50
+ displayMode_4: {
51
+ legend: null,
52
+ total: 100,
53
+ XData: ['CA机房', '五层IT', '四层IT', '冷水机组'],
54
+ seriesData: [{
55
+ data: [5, 20, 50, 80]
56
+ }]
57
+ },// TOP排行榜
58
+ displayMode_5: {
59
+ legend: null,
60
+ seriesData: [{
61
+ name: '一般',
62
+ value: 0
63
+ }, {
64
+ name: '较大',
65
+ value: 0
66
+ }, {
67
+ name: '重大',
68
+ value: 0
69
+ }, {
70
+ name: '严重',
71
+ value: 0
72
+ }, {
73
+ name: '高级',
74
+ value: 0
75
+ }]
76
+ },// 饼图
77
+ displayMode_6: {
78
+ value: 8
79
+ },// 仪表盘
80
+ displayMode_1_tem_line_1: {
81
+ legend: ['温度', '湿度'],
82
+ XData: ['00:00','03:00','06:00','09:00','12:00','15:00','18:00','21:00','24:00'],
83
+ seriesData: [{
84
+ name: '温度',
85
+ data: [20,24,20,24,20,24,20,24,20]
86
+ },{
87
+ name: '湿度',
88
+ data: [40,45,40,45,40,45,40,45,40]
89
+ }]
90
+ }, // 双轴双曲线
91
+ displayMode_1_tem_line_2: {
92
+ legend: null,
93
+ XData: ['00:00','03:00','06:00','09:00','12:00','15:00','18:00','21:00','24:00'],
94
+ seriesData: [{
95
+ name: '温度',
96
+ data: [20,24,20,24,20,24,20,24,20]
97
+ }]
98
+ }, // 单轴双曲线区域
99
+ displayMode_2_tem_3dbar_1: {
100
+ legend: null,
101
+ XData: ['制冷', '配电制冷', '网络机房制冷', '主机房制冷', '网络机房IT', '主机房IT', 'IT'],
102
+ seriesData: [{
103
+ name: '',
104
+ data: [82, 115, 42, 82, 70, 40, 92]
105
+ }]
106
+ }, // 3D柱状图模板-3d柱状图1
107
+ };
108
+ // 图例默认数据
109
+ export const echartsLegendDefaultData = {
110
+ icon: 'rect', // 图标类型:'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow', 'none'
111
+ itemWidth: 12, // 图标宽
112
+ itemHeight: 12, // 图标高
113
+ itemGap: 8, // 图例之间的间隔 number
114
+ top: '0%', // 图例距离容器上边位置
115
+ right: 'auto', // 图例距离容器右边位置
116
+ bottom: 'auto', // 图例距离容器下边位置
117
+ left: '60', // 图例距离容器左边位置
118
+ padding: [20, 0, 0, 0], // 图例内边距 string
119
+ color: '#fff', // 文字颜色
120
+ height: 8, // 文本显示高度 number
121
+ fontSize: 12 // 文字大小 number
122
+ };
123
+ // 柱状图和折线图默认标注
124
+ export const echartsLineBarDefaultLegendData = {
125
+ data: ['标注1'],
126
+ icon: 'rich',
127
+ show: true,
128
+ itemWidth: 14,
129
+ itemHeight: 14,
130
+ textStyle: {
131
+ color: '#C6D1DB',
132
+ fontSize: '14px',
133
+ },
134
+ top: '12%',
135
+ left: '10%',
136
+ itemGap: 8
137
+ };
138
+ // 曲线默认配置数据
139
+ export const echartsLineSeriesStyleData = {
140
+ smooth: false,
141
+ symbol: 'none',
142
+ symbolSize: 18,
143
+ itemLineStyle:{
144
+ color: '#2F86ED', //改变折线颜色
145
+ type: 'solid',
146
+ width: 1
147
+ },
148
+ area: false, // 是否是区域图
149
+ linear: false, // 是否是线性渐变
150
+ areaColor: {
151
+ type: 'linear',
152
+ x: 0,
153
+ y: 0,
154
+ x2: 0,
155
+ y2: 1,
156
+ global: false // 缺省为 false
157
+ },
158
+ areaColorStops:[{
159
+ offset: 0,
160
+ color: 'rgba(49, 144, 255, 0.21)' // 0% 处的颜色
161
+ }, {
162
+ offset: 1,
163
+ color: 'rgba(49, 144, 255, 0)' // 100% 处的颜色
164
+ }]
165
+ }
166
+ // 图表X轴默认配置数据
167
+ export const echartsXAxisDefaultStyleData = {
168
+ x1AxisLabel: {
169
+ color: '#fff',
170
+ fontSize:"12"
171
+ }
172
+ }
173
+ // 图表Y轴默认配置数据
174
+ export const echartsYAxisDefaultStyleData = {
175
+ ySplitLineShow: true, // y轴轴线是否显示
176
+ //坐标轴线样式
177
+ ysplitLineLineStyle: {
178
+ type: 'solid', //solid实线;dashed虚线
179
+ color: 'rgba(148, 147, 197, 0.5)'
180
+ },
181
+ y1axisLabelTextStyle: {
182
+ //坐标轴颜色
183
+ color: '#fff',
184
+ fontSize:"12",
185
+ padding: 5
186
+ },
187
+ // y轴刻度最大最小值和分隔值
188
+ y1MinMaxData: {
189
+ min: 0,
190
+ max: 60,
191
+ interval: 20
192
+ },
193
+ // y轴名称
194
+ y1NameData: {
195
+ name: '℃',
196
+ nameTextStyle: {
197
+ color: '#FDFDFD',
198
+ padding: [0, 0, 0, -52],
199
+ },
200
+ nameGap: 25
201
+ },
202
+ // y轴刻度标签文字样式
203
+ y2axisLabelTextStyle: {
204
+ //坐标轴颜色
205
+ color: '#fff',
206
+ fontSize:"12",
207
+ padding: 5
208
+ },
209
+ y2MinMaxData: {
210
+ name: '%',
211
+ nameTextStyle: {
212
+ color: '#FDFDFD',
213
+ padding: [0, -42, 0, 0],
214
+ },
215
+ nameGap: 25
216
+ },
217
+ y2NameData: {
218
+ min: 0,
219
+ max: 90,
220
+ interval: 30
221
+ }
222
+ }
223
+ // 图表的数据缩放
224
+ export const echartsDataRoom = [{ //给x轴设置滚动条
225
+ start: 0, //默认为0
226
+ end: 50, //默认为100
227
+ type: 'slider',
228
+ show: false,
229
+ xAxisIndex: [0],
230
+ handleSize: 10, //滑动条的 左右2个滑动条的大小
231
+ height: 0, //组件高度
232
+ }, { //下面这个属性是里面拖到
233
+ type: 'inside',
234
+ show: true,
235
+ xAxisIndex: [0],
236
+ start: 0, //默认为1
237
+ end: 50 // 100 - 1500 / 31, //默认为100
238
+ }];
239
+
@@ -0,0 +1,14 @@
1
+ export let echartsDataStore = {};
2
+ export let echartsOptionsStore = {};
3
+ export const destroyEcharts = function(){
4
+ for (let node of Object.values(echartsDataStore)) {
5
+ if(node) {
6
+ clearInterval(node.timeTicket);
7
+ node.chart.off('mouseover');
8
+ node.chart.off('mouseout');
9
+ node.chart.dispose();
10
+ }
11
+ }
12
+ echartsDataStore = {};
13
+ echartsOptionsStore = {};
14
+ };
@@ -0,0 +1,2 @@
1
+ export * from './echartsDefaultData';
2
+ export * from './echartsStore';
@@ -0,0 +1,13 @@
1
+ .canvas-point.pointer{
2
+ cursor: pointer;
3
+ }
4
+ .canvas-point,
5
+ .canvas-point.default{
6
+ cursor: default;
7
+ }
8
+ .canvas-point.pointer > div{
9
+ z-index: -2;
10
+ }
11
+ .topology2dConfIfram{
12
+
13
+ }