@hecom/codearts 0.4.1 → 0.4.3

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.
@@ -8,10 +8,10 @@ const bug_by_fix_duration_1 = require("./modules/bug-by-fix-duration");
8
8
  const bug_by_developer_hours_1 = require("./modules/bug-by-developer-hours");
9
9
  const bug_open_priority_heatmap_1 = require("./modules/bug-open-priority-heatmap");
10
10
  exports.allCharts = [
11
- bug_by_defect_analysis_1.bugByDefectAnalysisChart,
12
- bug_by_assignee_1.bugByAssigneeChart,
13
11
  bug_by_module_1.bugByModuleChart,
12
+ bug_by_defect_analysis_1.bugByDefectAnalysisChart,
14
13
  bug_by_fix_duration_1.bugByFixDurationChart,
15
- bug_by_developer_hours_1.bugByDeveloperHoursChart,
16
14
  bug_open_priority_heatmap_1.bugOpenPriorityHeatmapChart,
15
+ bug_by_assignee_1.bugByAssigneeChart,
16
+ bug_by_developer_hours_1.bugByDeveloperHoursChart,
17
17
  ];
@@ -0,0 +1,354 @@
1
+ declare const macarons: {
2
+ color: string[];
3
+ backgroundColor: string;
4
+ textStyle: {};
5
+ title: {
6
+ textStyle: {
7
+ color: string;
8
+ };
9
+ subtextStyle: {
10
+ color: string;
11
+ };
12
+ };
13
+ line: {
14
+ itemStyle: {
15
+ borderWidth: number;
16
+ };
17
+ lineStyle: {
18
+ width: number;
19
+ };
20
+ symbolSize: number;
21
+ symbol: string;
22
+ smooth: boolean;
23
+ };
24
+ radar: {
25
+ itemStyle: {
26
+ borderWidth: number;
27
+ };
28
+ lineStyle: {
29
+ width: number;
30
+ };
31
+ symbolSize: number;
32
+ symbol: string;
33
+ smooth: boolean;
34
+ };
35
+ bar: {
36
+ itemStyle: {
37
+ barBorderWidth: number;
38
+ barBorderColor: string;
39
+ };
40
+ };
41
+ pie: {
42
+ itemStyle: {
43
+ borderWidth: number;
44
+ borderColor: string;
45
+ };
46
+ };
47
+ scatter: {
48
+ itemStyle: {
49
+ borderWidth: number;
50
+ borderColor: string;
51
+ };
52
+ };
53
+ boxplot: {
54
+ itemStyle: {
55
+ borderWidth: number;
56
+ borderColor: string;
57
+ };
58
+ };
59
+ parallel: {
60
+ itemStyle: {
61
+ borderWidth: number;
62
+ borderColor: string;
63
+ };
64
+ };
65
+ sankey: {
66
+ itemStyle: {
67
+ borderWidth: number;
68
+ borderColor: string;
69
+ };
70
+ };
71
+ funnel: {
72
+ itemStyle: {
73
+ borderWidth: number;
74
+ borderColor: string;
75
+ };
76
+ };
77
+ gauge: {
78
+ itemStyle: {
79
+ borderWidth: number;
80
+ borderColor: string;
81
+ };
82
+ };
83
+ candlestick: {
84
+ itemStyle: {
85
+ color: string;
86
+ color0: string;
87
+ borderColor: string;
88
+ borderColor0: string;
89
+ borderWidth: number;
90
+ };
91
+ };
92
+ graph: {
93
+ itemStyle: {
94
+ borderWidth: number;
95
+ borderColor: string;
96
+ };
97
+ lineStyle: {
98
+ width: number;
99
+ color: string;
100
+ };
101
+ symbolSize: number;
102
+ symbol: string;
103
+ smooth: boolean;
104
+ color: string[];
105
+ label: {
106
+ color: string;
107
+ };
108
+ };
109
+ map: {
110
+ itemStyle: {
111
+ areaColor: string;
112
+ borderColor: string;
113
+ borderWidth: number;
114
+ };
115
+ label: {
116
+ color: string;
117
+ };
118
+ emphasis: {
119
+ itemStyle: {
120
+ areaColor: string;
121
+ borderColor: string;
122
+ borderWidth: number;
123
+ };
124
+ label: {
125
+ color: string;
126
+ };
127
+ };
128
+ };
129
+ geo: {
130
+ itemStyle: {
131
+ areaColor: string;
132
+ borderColor: string;
133
+ borderWidth: number;
134
+ };
135
+ label: {
136
+ color: string;
137
+ };
138
+ emphasis: {
139
+ itemStyle: {
140
+ areaColor: string;
141
+ borderColor: string;
142
+ borderWidth: number;
143
+ };
144
+ label: {
145
+ color: string;
146
+ };
147
+ };
148
+ };
149
+ categoryAxis: {
150
+ axisLine: {
151
+ show: boolean;
152
+ lineStyle: {
153
+ color: string;
154
+ };
155
+ };
156
+ axisTick: {
157
+ show: boolean;
158
+ lineStyle: {
159
+ color: string;
160
+ };
161
+ };
162
+ axisLabel: {
163
+ show: boolean;
164
+ color: string;
165
+ };
166
+ splitLine: {
167
+ show: boolean;
168
+ lineStyle: {
169
+ color: string[];
170
+ };
171
+ };
172
+ splitArea: {
173
+ show: boolean;
174
+ areaStyle: {
175
+ color: string[];
176
+ };
177
+ };
178
+ };
179
+ valueAxis: {
180
+ axisLine: {
181
+ show: boolean;
182
+ lineStyle: {
183
+ color: string;
184
+ };
185
+ };
186
+ axisTick: {
187
+ show: boolean;
188
+ lineStyle: {
189
+ color: string;
190
+ };
191
+ };
192
+ axisLabel: {
193
+ show: boolean;
194
+ color: string;
195
+ };
196
+ splitLine: {
197
+ show: boolean;
198
+ lineStyle: {
199
+ color: string[];
200
+ };
201
+ };
202
+ splitArea: {
203
+ show: boolean;
204
+ areaStyle: {
205
+ color: string[];
206
+ };
207
+ };
208
+ };
209
+ logAxis: {
210
+ axisLine: {
211
+ show: boolean;
212
+ lineStyle: {
213
+ color: string;
214
+ };
215
+ };
216
+ axisTick: {
217
+ show: boolean;
218
+ lineStyle: {
219
+ color: string;
220
+ };
221
+ };
222
+ axisLabel: {
223
+ show: boolean;
224
+ color: string;
225
+ };
226
+ splitLine: {
227
+ show: boolean;
228
+ lineStyle: {
229
+ color: string[];
230
+ };
231
+ };
232
+ splitArea: {
233
+ show: boolean;
234
+ areaStyle: {
235
+ color: string[];
236
+ };
237
+ };
238
+ };
239
+ timeAxis: {
240
+ axisLine: {
241
+ show: boolean;
242
+ lineStyle: {
243
+ color: string;
244
+ };
245
+ };
246
+ axisTick: {
247
+ show: boolean;
248
+ lineStyle: {
249
+ color: string;
250
+ };
251
+ };
252
+ axisLabel: {
253
+ show: boolean;
254
+ color: string;
255
+ };
256
+ splitLine: {
257
+ show: boolean;
258
+ lineStyle: {
259
+ color: string[];
260
+ };
261
+ };
262
+ splitArea: {
263
+ show: boolean;
264
+ areaStyle: {
265
+ color: string[];
266
+ };
267
+ };
268
+ };
269
+ toolbox: {
270
+ iconStyle: {
271
+ borderColor: string;
272
+ };
273
+ emphasis: {
274
+ iconStyle: {
275
+ borderColor: string;
276
+ };
277
+ };
278
+ };
279
+ legend: {
280
+ textStyle: {
281
+ color: string;
282
+ };
283
+ left: string;
284
+ right: string;
285
+ top: number;
286
+ bottom: number;
287
+ };
288
+ tooltip: {
289
+ axisPointer: {
290
+ lineStyle: {
291
+ color: string;
292
+ width: string;
293
+ };
294
+ crossStyle: {
295
+ color: string;
296
+ width: string;
297
+ };
298
+ };
299
+ };
300
+ timeline: {
301
+ lineStyle: {
302
+ color: string;
303
+ width: number;
304
+ };
305
+ itemStyle: {
306
+ color: string;
307
+ borderWidth: number;
308
+ };
309
+ controlStyle: {
310
+ color: string;
311
+ borderColor: string;
312
+ borderWidth: number;
313
+ };
314
+ checkpointStyle: {
315
+ color: string;
316
+ borderColor: string;
317
+ };
318
+ label: {
319
+ color: string;
320
+ };
321
+ emphasis: {
322
+ itemStyle: {
323
+ color: string;
324
+ };
325
+ controlStyle: {
326
+ color: string;
327
+ borderColor: string;
328
+ borderWidth: number;
329
+ };
330
+ label: {
331
+ color: string;
332
+ };
333
+ };
334
+ };
335
+ visualMap: {
336
+ color: string[];
337
+ };
338
+ markPoint: {
339
+ label: {
340
+ color: string;
341
+ };
342
+ emphasis: {
343
+ label: {
344
+ color: string;
345
+ };
346
+ };
347
+ };
348
+ grid: {
349
+ left: string;
350
+ right: string;
351
+ bottom: number;
352
+ };
353
+ };
354
+ export default macarons;
@@ -0,0 +1,398 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const macarons = {
4
+ color: [
5
+ '#2ec7c9',
6
+ '#b6a2de',
7
+ '#5ab1ef',
8
+ '#ffb980',
9
+ '#d87a80',
10
+ '#8d98b3',
11
+ '#e5cf0d',
12
+ '#97b552',
13
+ '#95706d',
14
+ '#dc69aa',
15
+ '#07a2a4',
16
+ '#9a7fd1',
17
+ '#588dd5',
18
+ '#f5994e',
19
+ '#c05050',
20
+ '#59678c',
21
+ '#c9ab00',
22
+ '#7eb00a',
23
+ '#6f5553',
24
+ '#c14089',
25
+ ],
26
+ backgroundColor: 'rgba(0,0,0,0)',
27
+ textStyle: {},
28
+ title: {
29
+ textStyle: {
30
+ color: '#008acd',
31
+ },
32
+ subtextStyle: {
33
+ color: '#aaa',
34
+ },
35
+ },
36
+ line: {
37
+ itemStyle: {
38
+ borderWidth: 1,
39
+ },
40
+ lineStyle: {
41
+ width: 2,
42
+ },
43
+ symbolSize: 3,
44
+ symbol: 'emptyCircle',
45
+ smooth: true,
46
+ },
47
+ radar: {
48
+ itemStyle: {
49
+ borderWidth: 1,
50
+ },
51
+ lineStyle: {
52
+ width: 2,
53
+ },
54
+ symbolSize: 3,
55
+ symbol: 'emptyCircle',
56
+ smooth: true,
57
+ },
58
+ bar: {
59
+ itemStyle: {
60
+ barBorderWidth: 0,
61
+ barBorderColor: '#ccc',
62
+ },
63
+ },
64
+ pie: {
65
+ itemStyle: {
66
+ borderWidth: 0,
67
+ borderColor: '#ccc',
68
+ },
69
+ },
70
+ scatter: {
71
+ itemStyle: {
72
+ borderWidth: 0,
73
+ borderColor: '#ccc',
74
+ },
75
+ },
76
+ boxplot: {
77
+ itemStyle: {
78
+ borderWidth: 0,
79
+ borderColor: '#ccc',
80
+ },
81
+ },
82
+ parallel: {
83
+ itemStyle: {
84
+ borderWidth: 0,
85
+ borderColor: '#ccc',
86
+ },
87
+ },
88
+ sankey: {
89
+ itemStyle: {
90
+ borderWidth: 0,
91
+ borderColor: '#ccc',
92
+ },
93
+ },
94
+ funnel: {
95
+ itemStyle: {
96
+ borderWidth: 0,
97
+ borderColor: '#ccc',
98
+ },
99
+ },
100
+ gauge: {
101
+ itemStyle: {
102
+ borderWidth: 0,
103
+ borderColor: '#ccc',
104
+ },
105
+ },
106
+ candlestick: {
107
+ itemStyle: {
108
+ color: '#d87a80',
109
+ color0: '#2ec7c9',
110
+ borderColor: '#d87a80',
111
+ borderColor0: '#2ec7c9',
112
+ borderWidth: 1,
113
+ },
114
+ },
115
+ graph: {
116
+ itemStyle: {
117
+ borderWidth: 0,
118
+ borderColor: '#ccc',
119
+ },
120
+ lineStyle: {
121
+ width: 1,
122
+ color: '#aaa',
123
+ },
124
+ symbolSize: 3,
125
+ symbol: 'emptyCircle',
126
+ smooth: true,
127
+ color: [
128
+ '#2ec7c9',
129
+ '#b6a2de',
130
+ '#5ab1ef',
131
+ '#ffb980',
132
+ '#d87a80',
133
+ '#8d98b3',
134
+ '#e5cf0d',
135
+ '#97b552',
136
+ '#95706d',
137
+ '#dc69aa',
138
+ '#07a2a4',
139
+ '#9a7fd1',
140
+ '#588dd5',
141
+ '#f5994e',
142
+ '#c05050',
143
+ '#59678c',
144
+ '#c9ab00',
145
+ '#7eb00a',
146
+ '#6f5553',
147
+ '#c14089',
148
+ ],
149
+ label: {
150
+ color: '#eee',
151
+ },
152
+ },
153
+ map: {
154
+ itemStyle: {
155
+ areaColor: '#dddddd',
156
+ borderColor: '#eeeeee',
157
+ borderWidth: 0.5,
158
+ },
159
+ label: {
160
+ color: '#d87a80',
161
+ },
162
+ emphasis: {
163
+ itemStyle: {
164
+ areaColor: 'rgba(254,153,78,1)',
165
+ borderColor: '#444',
166
+ borderWidth: 1,
167
+ },
168
+ label: {
169
+ color: 'rgb(100,0,0)',
170
+ },
171
+ },
172
+ },
173
+ geo: {
174
+ itemStyle: {
175
+ areaColor: '#dddddd',
176
+ borderColor: '#eeeeee',
177
+ borderWidth: 0.5,
178
+ },
179
+ label: {
180
+ color: '#d87a80',
181
+ },
182
+ emphasis: {
183
+ itemStyle: {
184
+ areaColor: 'rgba(254,153,78,1)',
185
+ borderColor: '#444',
186
+ borderWidth: 1,
187
+ },
188
+ label: {
189
+ color: 'rgb(100,0,0)',
190
+ },
191
+ },
192
+ },
193
+ categoryAxis: {
194
+ axisLine: {
195
+ show: true,
196
+ lineStyle: {
197
+ color: '#008acd',
198
+ },
199
+ },
200
+ axisTick: {
201
+ show: true,
202
+ lineStyle: {
203
+ color: '#333',
204
+ },
205
+ },
206
+ axisLabel: {
207
+ show: true,
208
+ color: '#333',
209
+ },
210
+ splitLine: {
211
+ show: false,
212
+ lineStyle: {
213
+ color: ['#eee'],
214
+ },
215
+ },
216
+ splitArea: {
217
+ show: false,
218
+ areaStyle: {
219
+ color: ['rgba(250,250,250,0.3)', 'rgba(200,200,200,0.3)'],
220
+ },
221
+ },
222
+ },
223
+ valueAxis: {
224
+ axisLine: {
225
+ show: true,
226
+ lineStyle: {
227
+ color: '#008acd',
228
+ },
229
+ },
230
+ axisTick: {
231
+ show: true,
232
+ lineStyle: {
233
+ color: '#333',
234
+ },
235
+ },
236
+ axisLabel: {
237
+ show: true,
238
+ color: '#333',
239
+ },
240
+ splitLine: {
241
+ show: true,
242
+ lineStyle: {
243
+ color: ['#eee'],
244
+ },
245
+ },
246
+ splitArea: {
247
+ show: true,
248
+ areaStyle: {
249
+ color: ['rgba(250,250,250,0.3)', 'rgba(200,200,200,0.3)'],
250
+ },
251
+ },
252
+ },
253
+ logAxis: {
254
+ axisLine: {
255
+ show: true,
256
+ lineStyle: {
257
+ color: '#008acd',
258
+ },
259
+ },
260
+ axisTick: {
261
+ show: true,
262
+ lineStyle: {
263
+ color: '#333',
264
+ },
265
+ },
266
+ axisLabel: {
267
+ show: true,
268
+ color: '#333',
269
+ },
270
+ splitLine: {
271
+ show: true,
272
+ lineStyle: {
273
+ color: ['#eee'],
274
+ },
275
+ },
276
+ splitArea: {
277
+ show: true,
278
+ areaStyle: {
279
+ color: ['rgba(250,250,250,0.3)', 'rgba(200,200,200,0.3)'],
280
+ },
281
+ },
282
+ },
283
+ timeAxis: {
284
+ axisLine: {
285
+ show: true,
286
+ lineStyle: {
287
+ color: '#008acd',
288
+ },
289
+ },
290
+ axisTick: {
291
+ show: true,
292
+ lineStyle: {
293
+ color: '#333',
294
+ },
295
+ },
296
+ axisLabel: {
297
+ show: true,
298
+ color: '#333',
299
+ },
300
+ splitLine: {
301
+ show: true,
302
+ lineStyle: {
303
+ color: ['#eee'],
304
+ },
305
+ },
306
+ splitArea: {
307
+ show: false,
308
+ areaStyle: {
309
+ color: ['rgba(250,250,250,0.3)', 'rgba(200,200,200,0.3)'],
310
+ },
311
+ },
312
+ },
313
+ toolbox: {
314
+ iconStyle: {
315
+ borderColor: '#2ec7c9',
316
+ },
317
+ emphasis: {
318
+ iconStyle: {
319
+ borderColor: '#18a4a6',
320
+ },
321
+ },
322
+ },
323
+ legend: {
324
+ textStyle: {
325
+ color: '#333333',
326
+ },
327
+ left: 'center',
328
+ right: 'auto',
329
+ top: 0,
330
+ bottom: 10,
331
+ },
332
+ tooltip: {
333
+ axisPointer: {
334
+ lineStyle: {
335
+ color: '#008acd',
336
+ width: '1',
337
+ },
338
+ crossStyle: {
339
+ color: '#008acd',
340
+ width: '1',
341
+ },
342
+ },
343
+ },
344
+ timeline: {
345
+ lineStyle: {
346
+ color: '#008acd',
347
+ width: 1,
348
+ },
349
+ itemStyle: {
350
+ color: '#008acd',
351
+ borderWidth: 1,
352
+ },
353
+ controlStyle: {
354
+ color: '#008acd',
355
+ borderColor: '#008acd',
356
+ borderWidth: 0.5,
357
+ },
358
+ checkpointStyle: {
359
+ color: '#2ec7c9',
360
+ borderColor: 'rgba(46,199,201,0.4)',
361
+ },
362
+ label: {
363
+ color: '#008acd',
364
+ },
365
+ emphasis: {
366
+ itemStyle: {
367
+ color: '#a9334c',
368
+ },
369
+ controlStyle: {
370
+ color: '#008acd',
371
+ borderColor: '#008acd',
372
+ borderWidth: 0.5,
373
+ },
374
+ label: {
375
+ color: '#008acd',
376
+ },
377
+ },
378
+ },
379
+ visualMap: {
380
+ color: ['#5ab1ef', '#e0ffff'],
381
+ },
382
+ markPoint: {
383
+ label: {
384
+ color: '#eee',
385
+ },
386
+ emphasis: {
387
+ label: {
388
+ color: '#eee',
389
+ },
390
+ },
391
+ },
392
+ grid: {
393
+ left: '3%',
394
+ right: '6%',
395
+ bottom: 70,
396
+ },
397
+ };
398
+ exports.default = macarons;
@@ -14,15 +14,25 @@ exports.bugByAssigneeChart = {
14
14
  const values = sorted.map(([, value]) => value);
15
15
  return {
16
16
  tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } },
17
- grid: { left: '3%', right: '8%', bottom: '3%', containLabel: true },
18
- xAxis: { type: 'value' },
19
- yAxis: { type: 'category', data: names, inverse: true },
17
+ // grid: { left: '3%', right: '6%', bottom: '3%', containLabel: true },
18
+ xAxis: {
19
+ type: 'value',
20
+ axisLine: { show: false },
21
+ },
22
+ yAxis: {
23
+ type: 'category',
24
+ data: names,
25
+ inverse: true,
26
+ axisLine: { show: false },
27
+ axisTick: { show: false },
28
+ },
20
29
  series: [
21
30
  {
22
31
  type: 'bar',
23
32
  data: values,
24
- label: { show: true, position: 'right' },
25
- itemStyle: { color: '#5470c6' },
33
+ label: { show: true, position: 'right', fontWeight: 600 },
34
+ itemStyle: { borderRadius: 6 },
35
+ barCategoryGap: '40%',
26
36
  },
27
37
  ],
28
38
  };
@@ -19,9 +19,14 @@ exports.bugByDefectAnalysisChart = {
19
19
  series: [
20
20
  {
21
21
  type: 'pie',
22
- radius: ['40%', '70%'],
22
+ radius: ['42%', '68%'],
23
23
  avoidLabelOverlap: true,
24
- label: { show: true, formatter: '{b}: {d}%' },
24
+ label: {
25
+ show: true,
26
+ position: 'outside',
27
+ formatter: '{b}: {d}%',
28
+ },
29
+ labelLine: { length: 18, length2: 6, lineStyle: { width: 1 } },
25
30
  data,
26
31
  },
27
32
  ],
@@ -16,15 +16,31 @@ exports.bugByDeveloperHoursChart = {
16
16
  const values = sorted.map(([, hours]) => hours);
17
17
  return {
18
18
  tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } },
19
- grid: { left: '3%', right: '8%', bottom: '3%', containLabel: true },
20
- xAxis: { type: 'value', name: '小时' },
21
- yAxis: { type: 'category', data: names, inverse: true },
19
+ // grid: { left: '3%', right: '6%', bottom: '3%', containLabel: true },
20
+ xAxis: {
21
+ type: 'value',
22
+ name: '小时',
23
+ axisLine: { show: false },
24
+ },
25
+ yAxis: {
26
+ type: 'category',
27
+ data: names,
28
+ inverse: true,
29
+ axisLine: { show: false },
30
+ axisTick: { show: false },
31
+ },
22
32
  series: [
23
33
  {
24
34
  type: 'bar',
25
35
  data: values,
26
- label: { show: true, position: 'right', formatter: '{c}h' },
27
- itemStyle: { color: '#ee6666' },
36
+ label: {
37
+ show: true,
38
+ position: 'right',
39
+ formatter: '{c}h',
40
+ fontWeight: 600,
41
+ },
42
+ itemStyle: { borderRadius: 6 },
43
+ barCategoryGap: '40%',
28
44
  },
29
45
  ],
30
46
  };
@@ -27,10 +27,12 @@ exports.bugByFixDurationChart = {
27
27
  const values = BUCKETS.map((b) => countMap.get(b) ?? 0);
28
28
  return {
29
29
  tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } },
30
- grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true },
30
+ // grid: { left: '6%', right: '6%', bottom: '8%', containLabel: true },
31
31
  xAxis: {
32
32
  type: 'category',
33
33
  data: [...BUCKETS],
34
+ axisLine: { show: false },
35
+ axisTick: { show: false },
34
36
  },
35
37
  yAxis: { type: 'value', minInterval: 1 },
36
38
  series: [
@@ -38,7 +40,8 @@ exports.bugByFixDurationChart = {
38
40
  type: 'bar',
39
41
  data: values,
40
42
  label: { show: true, position: 'top' },
41
- itemStyle: { color: '#fac858' },
43
+ itemStyle: { borderRadius: [6, 6, 0, 0] },
44
+ barWidth: '46%',
42
45
  },
43
46
  ],
44
47
  };
@@ -14,19 +14,21 @@ exports.bugByModuleChart = {
14
14
  const values = sorted.map(([, value]) => value);
15
15
  return {
16
16
  tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } },
17
- grid: { left: '3%', right: '4%', bottom: '15%', containLabel: true },
17
+ // grid: { left: '4%', right: '4%', bottom: '18%', containLabel: true },
18
18
  xAxis: {
19
19
  type: 'category',
20
20
  data: names,
21
- axisLabel: { rotate: 30, overflow: 'truncate', width: 80 },
21
+ axisLabel: { rotate: 30, overflow: 'truncate', width: 90 },
22
+ axisLine: { show: false },
22
23
  },
23
- yAxis: { type: 'value' },
24
+ yAxis: { type: 'value', splitLine: { lineStyle: {} } },
24
25
  series: [
25
26
  {
26
27
  type: 'bar',
27
28
  data: values,
28
29
  label: { show: true, position: 'top' },
29
- itemStyle: { color: '#91cc75' },
30
+ itemStyle: { borderRadius: 6 },
31
+ barWidth: '48%',
30
32
  },
31
33
  ],
32
34
  };
@@ -38,7 +38,7 @@ exports.bugOpenPriorityHeatmapChart = {
38
38
  position: 'top',
39
39
  formatter: (params) => `${yCategories[params.data[1]]} / ${xCategories[params.data[0]]}: ${params.data[2]} 个`,
40
40
  },
41
- grid: { left: '3%', right: '4%', bottom: '10%', containLabel: true },
41
+ // grid: { left: '4%', right: '4%', bottom: '12%', containLabel: true },
42
42
  xAxis: {
43
43
  type: 'category',
44
44
  data: xCategories,
@@ -56,7 +56,6 @@ exports.bugOpenPriorityHeatmapChart = {
56
56
  orient: 'horizontal',
57
57
  left: 'center',
58
58
  bottom: '0%',
59
- inRange: { color: ['#ffffff', '#ee6666'] },
60
59
  },
61
60
  series: [
62
61
  {
@@ -32,6 +32,9 @@ var __importStar = (this && this.__importStar) || (function () {
32
32
  return result;
33
33
  };
34
34
  })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
35
38
  Object.defineProperty(exports, "__esModule", { value: true });
36
39
  exports.renderReport = renderReport;
37
40
  exports.openInBrowser = openInBrowser;
@@ -39,6 +42,7 @@ const child_process_1 = require("child_process");
39
42
  const fs = __importStar(require("fs"));
40
43
  const path = __importStar(require("path"));
41
44
  const logger_1 = require("../utils/logger");
45
+ const macarons_1 = __importDefault(require("./macarons"));
42
46
  /**
43
47
  * 生成 HTML 报告并写入文件,返回文件路径。
44
48
  * @param bugs Bug 列表
@@ -87,18 +91,65 @@ function renderReport(bugs, charts, meta, outputDir) {
87
91
  return outputPath;
88
92
  }
89
93
  function buildHtml(bugs, charts, meta) {
94
+ // 使用打包友好的方式:直接从 macarons.ts 导出对象(避免构建后 JSON 丢失)
95
+ const macaronsForHtml = JSON.stringify(macarons_1.default || {});
90
96
  const chartContainers = charts
91
97
  .map((chart, i) => `<div class="chart-card">
92
98
  <div class="chart-title">${chart.title}</div>
93
- <div id="chart-${i}" style="height:400px;"></div>
99
+ <div id="chart-${i}" class="chart-canvas"></div>
94
100
  </div>`)
95
101
  .join('\n');
96
102
  const chartScripts = charts
97
103
  .map((chart, i) => {
98
104
  const option = JSON.stringify(chart.buildOption(bugs));
99
- return `echarts.init(document.getElementById('chart-${i}')).setOption(${option});`;
105
+ return `(() => {
106
+ const el = document.getElementById('chart-${i}');
107
+ if (!el) return;
108
+ let myChart;
109
+ try {
110
+ // 优先使用已注册的 macarons 主题进行初始化
111
+ myChart = echarts.init(el, 'macarons');
112
+ myChart.setOption(${option}, true);
113
+ } catch (e) {
114
+ // 回退:若主题不可用或初始化失败,使用原先的默认样式并继续渲染
115
+ const defaultTheme = {
116
+ color: ['#4A6CF7', '#6AD3FF', '#6BCB9B', '#FFD66B', '#FF9A76', '#7E63FF', '#FFA2EC'],
117
+ textStyle: { color: '#2b2b2b', fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif' },
118
+ tooltip: { backgroundColor: 'rgba(0,0,0,0.75)', textStyle: { color: '#fff' } },
119
+ legend: { textStyle: { color: '#666' } },
120
+ axis: { axisLine: { lineStyle: { color: '#e9edf1' } }, axisLabel: { color: '#9aa0a6' }, splitLine: { lineStyle: { color: '#f0f3f7' } } }
121
+ };
122
+ myChart = echarts.init(el);
123
+ const userOption = ${option};
124
+ const merged = Object.assign({}, defaultTheme, userOption);
125
+ myChart.setOption(merged, true);
126
+ }
127
+ // store instance for global resize handling
128
+ window.__HECOM_CHARTS = window.__HECOM_CHARTS || [];
129
+ window.__HECOM_CHARTS.push(myChart);
130
+ // ensure initial render after layout
131
+ setTimeout(() => myChart.resize(), 60);
132
+ })();`;
100
133
  })
101
- .join('\n');
134
+ .join('\n') +
135
+ `
136
+ ;(function(){
137
+ if (window.__HECOM_CHARTS_RESIZE_ADDED) return;
138
+ window.__HECOM_CHARTS_RESIZE_ADDED = true;
139
+ let _rt;
140
+ function resizeAll(){
141
+ (window.__HECOM_CHARTS || []).forEach(c => { try { c.resize(); } catch(e){} });
142
+ }
143
+ window.addEventListener('resize', () => { clearTimeout(_rt); _rt = setTimeout(resizeAll, 120); });
144
+ window.addEventListener('load', () => setTimeout(resizeAll, 100));
145
+ // in case layout changes without window resize (e.g. CSS media query), observe container
146
+ try {
147
+ const ro = new ResizeObserver(() => { clearTimeout(_rt); _rt = setTimeout(resizeAll, 80); });
148
+ document.querySelectorAll('.chart-canvas').forEach(el => ro.observe(el));
149
+ } catch (e) {
150
+ // ResizeObserver not available -> fallback only to window resize
151
+ }
152
+ })();`;
102
153
  const iterationsText = meta.iterationNames.join(', ') || '全部';
103
154
  const terminalText = meta.terminalTypes.join(', ') || '全部';
104
155
  return `<!DOCTYPE html>
@@ -108,20 +159,36 @@ function buildHtml(bugs, charts, meta) {
108
159
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
109
160
  <title>Bug 分析报告</title>
110
161
  <style>
111
- body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; margin: 0; padding: 20px; background: #f5f5f5; color: #333; }
112
- .header { background: #fff; border-radius: 8px; padding: 24px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
113
- .header h1 { margin: 0 0 16px; font-size: 22px; color: #1a1a1a; }
114
- .meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
115
- .meta-item { background: #f8f9fa; border-radius: 6px; padding: 12px; }
116
- .meta-label { font-size: 12px; color: #888; margin-bottom: 4px; }
117
- .meta-value { font-size: 14px; font-weight: 600; color: #333; }
118
- .charts-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
119
- .chart-card { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
120
- .chart-title { font-size: 15px; font-weight: 600; color: #1a1a1a; margin-bottom: 12px; }
121
- @media (max-width: 900px) { .charts-grid { grid-template-columns: 1fr; } }
162
+ :root{ --bg:#f5f7fa; --card:#ffffff; --muted:#9aa0a6; --text:#2b2b2b; --accent:#4A6CF7; }
163
+ html,body{height:100%;}
164
+ body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; margin: 0; padding: 28px 28px 64px; background: var(--bg); color: var(--text); -webkit-font-smoothing:antialiased; }
165
+ .container{max-width:1200px;margin:0 auto}
166
+ .header { background: var(--card); border-radius: 10px; padding: 28px; margin-bottom: 22px; box-shadow: 0 6px 18px rgba(18,23,34,0.06); }
167
+ .header h1 { margin: 0 0 10px; font-size: 20px; color: #111827; }
168
+ .meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
169
+ .meta-item { background: #f8f9fb; border-radius: 8px; padding: 14px; }
170
+ .meta-label { font-size: 12px; color: #818a91; margin-bottom: 6px; }
171
+ .meta-value { font-size: 15px; font-weight: 700; color: #111827; }
172
+ .charts-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; align-items: start; }
173
+ .chart-card { background: var(--card); border-radius: 10px; padding: 18px; box-shadow: 0 6px 18px rgba(18,23,34,0.04); display:flex; flex-direction:column; }
174
+ .chart-title { font-size: 15px; font-weight: 600; color: #111827; margin-bottom: 12px; }
175
+ .chart-canvas { width:100%; height:400px; }
176
+ .page-footer-spacer{height:56px;flex:0 0 56px}
177
+ /* card footer or small notes */
178
+ .muted { color: var(--muted); font-size:12px }
179
+
180
+ @media (max-width: 1199px){ .container{max-width:980px} }
181
+ @media (max-width: 900px) {
182
+ body{padding:16px}
183
+ .charts-grid { grid-template-columns: 1fr; }
184
+ .chart-canvas{height:320px}
185
+ .header { padding:18px }
186
+ }
187
+ @media (max-width: 480px){ .chart-canvas{height:280px} }
122
188
  </style>
123
189
  </head>
124
190
  <body>
191
+ <div class="container">
125
192
  <div class="header">
126
193
  <h1>Bug 分析报告</h1>
127
194
  <div class="meta-grid">
@@ -134,8 +201,21 @@ function buildHtml(bugs, charts, meta) {
134
201
  <div class="charts-grid">
135
202
  ${chartContainers}
136
203
  </div>
204
+ <div class="page-footer-spacer" aria-hidden="true"></div>
205
+ </div>
137
206
  <script src="https://cdn.jsdelivr.net/npm/echarts/dist/echarts.min.js"></script>
138
207
  <script>
208
+ // 注册 macarons 主题(若可用)
209
+ (function(){
210
+ try {
211
+ const theme = ${macaronsForHtml};
212
+ if (typeof echarts !== 'undefined' && theme && Object.keys(theme).length) {
213
+ echarts.registerTheme('macarons', theme);
214
+ }
215
+ } catch (e) {
216
+ // 主题注册失败则忽略,chart 初始化中有回退处理
217
+ }
218
+ })();
139
219
  ${chartScripts}
140
220
  </script>
141
221
  </body>
@@ -52,9 +52,11 @@ async function fixCommand(cliOptions) {
52
52
  logger_1.logger.info('操作取消');
53
53
  return;
54
54
  }
55
- // Step 5: 填写缺陷分析信息
55
+ // Step 5: 检查是否为客户反馈 bug
56
+ const isCustomerFeedback = checkIsCustomerFeedback(selectedBug);
57
+ // Step 6: 填写缺陷分析信息
56
58
  const bugFixData = {};
57
- // 5.1: 选择缺陷技术分析(必填)
59
+ // 6.1: 选择缺陷技术分析(必填)
58
60
  const defectAnalysisOptions = customFieldOptions[types_1.CustomFieldId.DEFECT_TECHNICAL_ANALYSIS] || [];
59
61
  if (defectAnalysisOptions.length === 0) {
60
62
  logger_1.logger.error('无法获取缺陷技术分析选项');
@@ -67,24 +69,30 @@ async function fixCommand(cliOptions) {
67
69
  value: option,
68
70
  })),
69
71
  });
70
- // 5.2: 填写问题原因及解决办法(可选)
72
+ // 6.2: 填写问题原因及解决办法
71
73
  const problemReason = await (0, prompts_1.input)({
72
- message: '请输入问题原因及解决办法(可选,留空跳过)',
74
+ message: isCustomerFeedback
75
+ ? '请输入问题原因及解决办法(必填)'
76
+ : '请输入问题原因及解决办法(可选,留空跳过)',
77
+ validate: (value) => {
78
+ if (isCustomerFeedback && !value.trim()) {
79
+ return '问题原因及解决办法不能为空';
80
+ }
81
+ return true;
82
+ },
73
83
  });
74
84
  if (problemReason.trim()) {
75
85
  bugFixData.problemReason = problemReason;
76
86
  }
77
- // 5.3: 填写影响范围(可选)
87
+ // 6.3: 填写影响范围(可选)
78
88
  const impactScope = await (0, prompts_1.input)({
79
89
  message: '请输入影响范围(可选,留空跳过)',
80
90
  });
81
91
  if (impactScope.trim()) {
82
92
  bugFixData.impactScope = impactScope;
83
93
  }
84
- // Step 6: 检查是否为客户反馈 bug
85
- const isCustomerFeedback = checkIsCustomerFeedback(selectedBug);
86
94
  if (isCustomerFeedback) {
87
- // 6.1: 选择引入阶段(必填)
95
+ // 6.4: 选择引入阶段(必填)
88
96
  const introductionPhaseOptions = customFieldOptions[types_1.CustomFieldId.INTRODUCTION_PHASE] || [];
89
97
  if (introductionPhaseOptions.length === 0) {
90
98
  logger_1.logger.error('无法获取引入阶段选项');
@@ -100,7 +108,7 @@ async function fixCommand(cliOptions) {
100
108
  value: option,
101
109
  })),
102
110
  });
103
- // 6.2: 输入发布时间(必填)
111
+ // 6.5: 输入发布时间(必填)
104
112
  let releaseDate;
105
113
  let validDate = false;
106
114
  while (!validDate) {
@@ -205,7 +213,7 @@ async function showSummaryAndConfirm(bug, bugFixData, isCustomerFeedback) {
205
213
  logger_1.logger.info(`Bug ID: #${bug.id}`);
206
214
  logger_1.logger.info(`Bug 标题: ${bug.name}`);
207
215
  logger_1.logger.info(`缺陷技术分析: ${bugFixData.defectAnalysis || '未填写'}`);
208
- logger_1.logger.info(`问题原因: ${bugFixData.problemReason || '未填写'}`);
216
+ logger_1.logger.info(`问题原因及解决办法: ${bugFixData.problemReason || '未填写'}`);
209
217
  logger_1.logger.info(`影响范围: ${bugFixData.impactScope || '未填写'}`);
210
218
  if (isCustomerFeedback) {
211
219
  logger_1.logger.info(`引入阶段: ${bugFixData.introductionStage || '未填写'}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hecom/codearts",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "description": "华为云 CodeArts 统计分析工具",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -18,9 +18,9 @@
18
18
  "test:coverage": "jest --coverage --passWithNoTests",
19
19
  "prepublishOnly": "npm run build",
20
20
  "dev": "ts-node src/bin/cli.ts",
21
- "minor": "npm version minor -m \"Bump version to %s\"; git push --tags",
22
- "patch": "npm version patch -m \"Bump version to %s\"; git push --tags",
23
- "major": "npm version major -m \"Bump version to %s\"; git push --tags"
21
+ "minor": "npm version minor -m \"Bump version to %s\"; git push --follow-tags",
22
+ "patch": "npm version patch -m \"Bump version to %s\"; git push --follow-tags",
23
+ "major": "npm version major -m \"Bump version to %s\"; git push --follow-tags"
24
24
  },
25
25
  "keywords": [
26
26
  "huawei-cloud",