evui 3.3.48 → 3.3.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "evui",
3
- "version": "3.3.48",
3
+ "version": "3.3.49",
4
4
  "description": "A EXEM Library project",
5
5
  "author": "exem <dev_client@ex-em.com>",
6
6
  "license": "MIT",
@@ -219,12 +219,33 @@ class EvChart {
219
219
  const series = this.seriesList[chartTypeSet[jx]];
220
220
 
221
221
  switch (chartType) {
222
- case 'line':
222
+ case 'line': {
223
+ const legendHitInfo = hitInfo?.legend;
224
+
225
+ series.draw({
226
+ legendHitInfo,
227
+ ...opt,
228
+ });
229
+ break;
230
+ }
223
231
  case 'heatMap': {
224
232
  const legendHitInfo = hitInfo?.legend;
225
233
 
234
+ let selectInfo;
235
+ const defaultSelectInfo = this.defaultSelectItemInfo;
236
+ if (defaultSelectInfo?.dataIndex || defaultSelectInfo?.dataIndex === 0) {
237
+ selectInfo = { ...defaultSelectInfo };
238
+ } else {
239
+ selectInfo = null;
240
+ }
241
+
226
242
  series.draw({
227
243
  legendHitInfo,
244
+ selectInfo,
245
+ selectItem: {
246
+ option: selectItem,
247
+ selected: selectInfo,
248
+ },
228
249
  ...opt,
229
250
  });
230
251
  break;
@@ -718,7 +739,7 @@ class EvChart {
718
739
 
719
740
  if (options.legend.show) {
720
741
  const useTable = !!options.legend?.table?.use
721
- && options.type !== 'heatmap'
742
+ && options.type !== 'heatMap'
722
743
  && options.type !== 'scatter';
723
744
 
724
745
  if (!this.isInitLegend) {
@@ -4,12 +4,13 @@ import { HEAT_MAP_OPTION } from '../helpers/helpers.constant';
4
4
  import { convertToPercent } from '../../../common/utils';
5
5
 
6
6
  class HeatMap {
7
- constructor(sId, opt, colorOpt, isGradient) {
7
+ constructor(sId, opt, colorOpt, isHorizontal, isGradient) {
8
8
  const merged = merge({}, HEAT_MAP_OPTION, opt);
9
9
  Object.keys(merged).forEach((key) => {
10
10
  this[key] = merged[key];
11
11
  });
12
12
 
13
+ this.isHorizontal = isHorizontal;
13
14
  this.isGradient = isGradient;
14
15
  this.createColorState(colorOpt);
15
16
 
@@ -35,7 +36,7 @@ class HeatMap {
35
36
  createColorState(colorOpt) {
36
37
  const colorState = [];
37
38
  const regex = /[^0-9]&[^,]/g;
38
- const { min, max, categoryCnt, categoryColors, error, stroke } = colorOpt;
39
+ const { min, max, rangeCount, colorsByRange, error, stroke } = colorOpt;
39
40
 
40
41
  const minColor = min.includes('#') ? Util.hexToRgb(min) : min.replace(regex, '');
41
42
  const maxColor = max.includes('#') ? Util.hexToRgb(max) : max.replace(regex, '');
@@ -47,14 +48,13 @@ class HeatMap {
47
48
  colorState.push({
48
49
  minColor: { minR, minG, minB },
49
50
  maxColor: { maxR, maxG, maxB },
50
- categoryCnt,
51
+ rangeCount,
51
52
  start: 0,
52
53
  end: 100,
53
54
  selectedValue: null,
54
55
  });
55
- } else if (categoryColors.length) {
56
- colorOpt.categoryCnt = categoryColors.length;
57
- categoryColors.forEach(({ color, label }, ix) => {
56
+ } else if (colorsByRange.length) {
57
+ colorsByRange.forEach(({ color, label }, ix) => {
58
58
  colorState.push({
59
59
  id: `color#${ix}`,
60
60
  color,
@@ -64,11 +64,11 @@ class HeatMap {
64
64
  });
65
65
  });
66
66
  } else {
67
- const unitR = Math.floor((minR - maxR) / (categoryCnt - 1));
68
- const unitG = Math.floor((minG - maxG) / (categoryCnt - 1));
69
- const unitB = Math.floor((minB - maxB) / (categoryCnt - 1));
67
+ const unitR = Math.floor((minR - maxR) / (rangeCount - 1));
68
+ const unitG = Math.floor((minG - maxG) / (rangeCount - 1));
69
+ const unitB = Math.floor((minB - maxB) / (rangeCount - 1));
70
70
 
71
- for (let ix = 0; ix < categoryCnt; ix++) {
71
+ for (let ix = 0; ix < rangeCount; ix++) {
72
72
  const r = +minR - (unitR * ix);
73
73
  const g = +minG - (unitG * ix);
74
74
  const b = +minB - (unitB * ix);
@@ -100,7 +100,7 @@ class HeatMap {
100
100
  return `rgb(${r},${g},${b})`;
101
101
  }
102
102
 
103
- getColorIndexForIcon(value) {
103
+ getColorIndexByValue(value) {
104
104
  const { existError, min, interval, decimalPoint } = this.valueOpt;
105
105
  const maxIndex = this.colorState.length - 1;
106
106
  if (existError && value < 0) {
@@ -120,7 +120,7 @@ class HeatMap {
120
120
  const { min, max } = this.valueOpt;
121
121
  const itemInfo = {
122
122
  show: false,
123
- opacity: 0,
123
+ opacity: 1,
124
124
  dataColor: null,
125
125
  id: null,
126
126
  isHighlight: null,
@@ -132,12 +132,11 @@ class HeatMap {
132
132
  itemInfo.show = true;
133
133
  itemInfo.isHighlight = selectedValue !== null
134
134
  && (Math.floor(value) === Math.floor(min + ((max - min) * (selectedValue / 100))));
135
- itemInfo.opacity = 1;
136
135
  itemInfo.dataColor = value < 0
137
136
  ? this.errorColor : this.getColorForGradient(ratio);
138
137
  }
139
138
  } else {
140
- const colorIndex = this.getColorIndexForIcon(value);
139
+ const colorIndex = this.getColorIndexByValue(value);
141
140
  const { show, state, color, id } = this.colorState[colorIndex];
142
141
  itemInfo.show = show;
143
142
  itemInfo.opacity = state === 'downplay' ? 0.1 : 1;
@@ -147,16 +146,22 @@ class HeatMap {
147
146
  return itemInfo;
148
147
  }
149
148
 
150
- drawItem(ctx, x, y, w, h) {
149
+ drawItem(ctx, x, y, w, h, borderOpt) {
151
150
  ctx.beginPath();
152
- if (this.stroke.show) {
153
- const { radius } = this.stroke;
154
- if (radius > 0 && radius < h && radius < w) {
155
- ctx.moveTo(x + radius, y);
156
- ctx.arcTo(x + w, y, x + w, y + h, radius);
157
- ctx.arcTo(x + w, y + h, x, y + h, radius);
158
- ctx.arcTo(x, y + h, x, y, radius);
159
- ctx.arcTo(x, y, x + w, y, radius);
151
+ if (borderOpt.show) {
152
+ const { radius } = borderOpt;
153
+ if (radius > 0) {
154
+ const minSize = Math.min(w, h);
155
+ let r = radius;
156
+ if (r > (minSize / 2)) {
157
+ r = Math.floor(minSize / 2);
158
+ }
159
+ ctx.moveTo(x + r, y);
160
+ ctx.arcTo(x + w, y, x + w, y + h, r);
161
+ ctx.arcTo(x + w, y + h, x, y + h, r);
162
+ ctx.arcTo(x, y + h, x, y, r);
163
+ ctx.arcTo(x, y, x + w, y, r);
164
+ ctx.stroke();
160
165
  ctx.fill();
161
166
  } else {
162
167
  ctx.strokeRect(x, y, w, h);
@@ -204,7 +209,15 @@ class HeatMap {
204
209
  return;
205
210
  }
206
211
 
207
- const { ctx, chartRect, labelOffset, overlayCtx } = param;
212
+ const {
213
+ ctx,
214
+ chartRect,
215
+ labelOffset,
216
+ overlayCtx,
217
+ selectLabel,
218
+ legendHitInfo,
219
+ selectItem,
220
+ } = param;
208
221
 
209
222
  const xArea = chartRect.chartWidth - (labelOffset.left + labelOffset.right);
210
223
  const yArea = chartRect.chartHeight - (labelOffset.top + labelOffset.bottom);
@@ -215,34 +228,80 @@ class HeatMap {
215
228
  this.size.w = xArea / this.labels.x.length;
216
229
  this.size.h = yArea / this.labels.y.length;
217
230
 
218
- this.data.forEach((item) => {
219
- let xp = this.calculateXY('x', item.x, xsp);
231
+ const getOpacity = (item, opacity, index) => {
232
+ const selectLabelOption = selectLabel?.option;
233
+ const useSelectLabel = selectLabelOption?.use && selectLabelOption?.useSeriesOpacity;
234
+ const selectItemOption = selectItem?.option;
235
+ const useSelectItem = selectItemOption?.use && selectItemOption?.useSeriesOpacity;
236
+ if (!legendHitInfo) {
237
+ let isDownplay = false;
238
+ if (useSelectItem) {
239
+ isDownplay = selectItem?.selected && index !== selectItem?.selected?.dataIndex;
240
+ } else if (useSelectLabel) {
241
+ const selectedLabelList = selectLabel?.selected?.label;
242
+ isDownplay = selectedLabelList.length
243
+ && !selectedLabelList.includes(this.isHorizontal ? item.y : item.x);
244
+ }
245
+ return isDownplay ? 0.1 : 1;
246
+ }
247
+ return opacity;
248
+ };
249
+
250
+ this.data.forEach((item, index) => {
251
+ const axisLineWidth = 1;
252
+ let xp = this.calculateXY('x', item.x, xsp) + axisLineWidth;
220
253
  let yp = this.calculateXY('y', item.y, ysp);
221
254
  let w = this.size.w;
222
255
  let h = this.size.h;
256
+
223
257
  const value = item.o;
224
258
 
225
259
  if (xp !== null && yp !== null
226
260
  && (value !== null && value !== undefined)) {
227
- const { show, opacity, dataColor, id, isHighlight } = this.getItemInfo(value);
261
+ const {
262
+ show,
263
+ opacity,
264
+ dataColor,
265
+ id,
266
+ isHighlight,
267
+ } = this.getItemInfo(value);
268
+
269
+ const itemOpacity = getOpacity(item, opacity, index);
270
+
228
271
  item.dataColor = dataColor;
229
272
  item.cId = id;
230
273
  ctx.save();
274
+
231
275
  if (show) {
232
- ctx.fillStyle = Util.colorStringToRgba(item.dataColor, opacity);
233
- if (this.stroke.show) {
234
- const { color, lineWidth, opacity: sOpacity } = this.stroke;
276
+ ctx.fillStyle = Util.colorStringToRgba(item.dataColor, itemOpacity);
277
+
278
+ let borderOpt = this.stroke;
279
+ const selectItemOption = selectItem?.option;
280
+ const useSelectItem = selectItemOption?.use && selectItemOption?.showBorder;
281
+ const isHit = (index === selectItem?.selected?.dataIndex);
282
+ if (useSelectItem && isHit) {
283
+ borderOpt = {
284
+ show: selectItemOption?.showBorder,
285
+ ...selectItemOption?.borderStyle,
286
+ };
287
+ }
288
+
289
+ if (borderOpt.show) {
290
+ const { color, lineWidth, opacity: borderOpacity } = borderOpt;
235
291
  ctx.strokeStyle = Util.colorStringToRgba(
236
292
  color,
237
- opacity === 1 ? sOpacity : opacity,
293
+ itemOpacity === 1 ? borderOpacity : itemOpacity,
238
294
  );
295
+
239
296
  ctx.lineWidth = lineWidth;
240
- xp += (lineWidth * 1.5);
241
- yp += (lineWidth * 1.5);
242
- w -= (lineWidth * 2);
243
- h -= (lineWidth * 2);
297
+
298
+ xp += (lineWidth * 0.5);
299
+ yp += (lineWidth * 0.5);
300
+ w -= (lineWidth);
301
+ h -= (lineWidth);
244
302
  }
245
- this.drawItem(ctx, xp, yp, w, h);
303
+
304
+ this.drawItem(ctx, xp, yp, w, h, borderOpt);
246
305
  ctx.restore();
247
306
 
248
307
  item.xp = xp;
@@ -369,10 +428,10 @@ class HeatMap {
369
428
  const gdata = item.data;
370
429
  const ctx = context;
371
430
 
372
- const x = gdata.xp;
373
- const y = gdata.yp;
374
- const w = gdata.w;
375
- const h = gdata.h;
431
+ let x = gdata.xp;
432
+ let y = gdata.yp;
433
+ let w = gdata.w;
434
+ let h = gdata.h;
376
435
  const cId = gdata.cId;
377
436
 
378
437
  let isShow;
@@ -385,16 +444,24 @@ class HeatMap {
385
444
  isShow = this.colorState.find(({ id }) => id === cId)?.show;
386
445
  }
387
446
  ctx.save();
388
- ctx.shadowOffsetX = 2;
389
- ctx.shadowOffsetY = 2;
447
+ ctx.shadowOffsetX = 0;
448
+ ctx.shadowOffsetY = 0;
390
449
  ctx.shadowBlur = 4;
391
450
 
392
451
  if (x !== null && y !== null && isShow) {
393
452
  const color = gdata.dataColor;
394
- ctx.shadowColor = Util.colorStringToRgba('#605F5F');
453
+ ctx.shadowColor = Util.colorStringToRgba('#959494');
395
454
  ctx.strokeStyle = Util.colorStringToRgba(color);
396
455
  ctx.fillStyle = Util.colorStringToRgba(color);
397
- this.drawItem(ctx, x - 2, y - 2, w + 4, h + 4);
456
+
457
+ if (this.stroke.show) {
458
+ const { lineWidth } = this.stroke;
459
+ x += (lineWidth * 0.5);
460
+ y += (lineWidth * 0.5);
461
+ w -= (lineWidth);
462
+ h -= (lineWidth);
463
+ }
464
+ this.drawItem(ctx, x - 0.5, y - 0.5, w + 1, h + 1, this.stroke);
398
465
 
399
466
  ctx.restore();
400
467
 
@@ -424,7 +491,7 @@ class HeatMap {
424
491
  };
425
492
  const gdata = this.data;
426
493
 
427
- const foundItem = gdata.find((data) => {
494
+ const itemIndex = gdata.findIndex((data) => {
428
495
  const { xp: x, yp: y, w: wSize, h: hSize } = data;
429
496
 
430
497
  return (x <= xp)
@@ -433,9 +500,11 @@ class HeatMap {
433
500
  && (yp <= y + hSize);
434
501
  });
435
502
 
436
- if (foundItem) {
503
+ if (itemIndex > -1) {
504
+ const foundItem = gdata[itemIndex];
437
505
  item.data = foundItem;
438
506
  item.color = foundItem.dataColor;
507
+ item.index = itemIndex;
439
508
  item.hit = true;
440
509
  }
441
510
 
@@ -19,7 +19,8 @@ const modules = {
19
19
  let isExistSelectedLabel;
20
20
 
21
21
  if (labelTipOpt.use && labelTipOpt.showTip) {
22
- isExistSelectedLabel = this.drawLabelTip();
22
+ const isHeatMap = opt.type === 'heatMap';
23
+ isExistSelectedLabel = isHeatMap ? this.drawLabelTipForHeatMap() : this.drawLabelTip();
23
24
  }
24
25
 
25
26
  const executeDrawIndicator = (tipOpt) => {
@@ -365,6 +366,55 @@ const modules = {
365
366
 
366
367
  return drawTip;
367
368
  },
369
+
370
+ /**
371
+ * Draw Selected Label Tip
372
+ * @returns {boolean} Whether drew at least one tip
373
+ */
374
+ drawLabelTipForHeatMap() {
375
+ const opt = this.options;
376
+ const isHorizontal = !!opt.horizontal;
377
+ const labelTipOpt = opt.selectLabel;
378
+ const { dataIndex } = this.defaultSelectInfo;
379
+ let drawTip = false;
380
+
381
+ if (dataIndex) {
382
+ drawTip = true;
383
+
384
+ const chartRect = this.chartRect;
385
+ const labelOffset = this.labelOffset;
386
+ const aPos = {
387
+ x1: chartRect.x1 + labelOffset.left,
388
+ x2: chartRect.x2 - labelOffset.right,
389
+ y1: chartRect.y1 + labelOffset.top,
390
+ y2: chartRect.y2 - labelOffset.bottom,
391
+ };
392
+ const labelAxes = isHorizontal ? this.axesY[0] : this.axesX[0];
393
+ const labelStartPoint = aPos[labelAxes.units.rectStart];
394
+ const labelEndPoint = aPos[labelAxes.units.rectEnd];
395
+ const labelGap = (labelEndPoint - labelStartPoint) / labelAxes.labels.length;
396
+
397
+ const valueAxes = isHorizontal ? this.axesX[0] : this.axesY[0];
398
+ const offset = 6 * (isHorizontal ? 1 : -1);
399
+ const gp = aPos[valueAxes.units.rectEnd] + offset;
400
+
401
+ dataIndex?.forEach((index) => {
402
+ const labelCenter = Math.round(labelStartPoint + (labelGap * index));
403
+ const dp = labelCenter + (labelGap / 2);
404
+
405
+ this.showTip({
406
+ context: this.bufferCtx,
407
+ x: isHorizontal ? gp : dp,
408
+ y: isHorizontal ? dp : gp,
409
+ opt: labelTipOpt,
410
+ isSamePos: false,
411
+ });
412
+ });
413
+ }
414
+
415
+ return drawTip;
416
+ },
417
+
368
418
  /**
369
419
  * Calculate x, y position to draw text tip
370
420
  * @param {object} param object for drawing text tip
@@ -86,6 +86,7 @@ export const AXIS_OPTION = {
86
86
  startToZero: false,
87
87
  showAxis: true,
88
88
  axisLineColor: '#C9CFDC',
89
+ axisLineWidth: 1,
89
90
  showGrid: true,
90
91
  gridLineColor: '#C9CFDC',
91
92
  showIndicator: false,
@@ -56,7 +56,7 @@ const modules = {
56
56
  this.seriesInfo.charts.heatMap.push(id);
57
57
  const { heatMapColor, legend } = this.options;
58
58
  const isGradient = legend.type === 'gradient';
59
- return new HeatMap(id, opt, heatMapColor, isGradient);
59
+ return new HeatMap(id, opt, heatMapColor, isHorizontal, isGradient);
60
60
  }
61
61
 
62
62
  return false;
@@ -420,7 +420,7 @@ const modules = {
420
420
  getSeriesValueOptForHeatMap(series) {
421
421
  const { data, colorState, isGradient } = series;
422
422
  const colorOpt = this.options.heatMapColor;
423
- const categoryCnt = colorOpt.categoryCnt;
423
+ const rangeCount = colorOpt.colorsByRange.length || colorOpt.rangeCount;
424
424
  const decimalPoint = colorOpt.decimalPoint;
425
425
 
426
426
  let minValue;
@@ -444,10 +444,10 @@ const modules = {
444
444
  if (
445
445
  isExistError
446
446
  && !isGradient
447
- && colorState.length === categoryCnt
447
+ && colorState.length === rangeCount
448
448
  ) {
449
449
  colorState.push({
450
- id: `color#${categoryCnt}`,
450
+ id: `color#${rangeCount}`,
451
451
  color: colorOpt.error,
452
452
  state: 'normal',
453
453
  label: 'Error',
@@ -455,10 +455,10 @@ const modules = {
455
455
  });
456
456
  }
457
457
 
458
- let interval = maxValue > minValue ? Math.floor((maxValue - minValue) / categoryCnt) : 1;
459
- if ((maxValue - minValue) <= categoryCnt) {
458
+ let interval = maxValue > minValue ? Math.floor((maxValue - minValue) / rangeCount) : 1;
459
+ if ((maxValue - minValue) <= rangeCount) {
460
460
  if (decimalPoint > 0) {
461
- interval = +((maxValue - minValue) / categoryCnt).toFixed(decimalPoint);
461
+ interval = +((maxValue - minValue) / rangeCount).toFixed(decimalPoint);
462
462
  } else {
463
463
  interval = 1;
464
464
  }
@@ -121,10 +121,6 @@ const modules = {
121
121
  const offset = this.getMousePosition(e);
122
122
  const hitInfo = this.getItemByPosition(offset, false);
123
123
 
124
- if (hitInfo.label !== null) {
125
- this.render(hitInfo);
126
- }
127
-
128
124
  ({
129
125
  label: args.label,
130
126
  value: args.value,
@@ -132,6 +128,14 @@ const modules = {
132
128
  maxIndex: args.dataIndex,
133
129
  acc: args.acc,
134
130
  } = hitInfo);
131
+
132
+ if (this.options.type === 'heatMap') {
133
+ args.deselect = this.setDeselectItem(hitInfo);
134
+ }
135
+
136
+ if (hitInfo.label !== null) {
137
+ this.render(hitInfo);
138
+ }
135
139
  } else if (this.options.selectLabel.use && this.options.selectLabel.useClick) {
136
140
  const offset = this.getMousePosition(e);
137
141
  const clickedLabelInfo = this.getLabelInfoByPosition(offset);
@@ -619,10 +623,16 @@ const modules = {
619
623
  */
620
624
  initSelectedInfo() {
621
625
  if (this.options.selectLabel.use) {
622
- const { limit } = this.options.selectLabel;
623
626
  if (!this.defaultSelectInfo) {
624
627
  this.defaultSelectInfo = { dataIndex: [] };
625
628
  }
629
+
630
+ if (this.options.type === 'heatMap') {
631
+ this.initSelectedInfoForHeatMap();
632
+ return;
633
+ }
634
+
635
+ const { limit } = this.options.selectLabel;
626
636
  const infoObj = this.defaultSelectInfo;
627
637
  infoObj.dataIndex.splice(limit);
628
638
  infoObj.label = infoObj.dataIndex.map(i => this.data.labels[i]);
@@ -636,6 +646,26 @@ const modules = {
636
646
  }
637
647
  },
638
648
 
649
+ /**
650
+ * init defaultSelectInfo object for HeatMap.
651
+ * - at selectLabel using: set each series data and label text
652
+ */
653
+ initSelectedInfoForHeatMap() {
654
+ const { limit } = this.options.selectLabel;
655
+ const isHorizontal = this.options.horizontal;
656
+
657
+ const infoObj = this.defaultSelectInfo;
658
+ infoObj.dataIndex.splice(limit);
659
+
660
+ const targetLabel = isHorizontal ? 'y' : 'x';
661
+ infoObj.label = infoObj.dataIndex.map(i => this.data.labels[targetLabel][i]);
662
+
663
+ const dataValues = Object.values(this.data.data)[0];
664
+ infoObj.data = dataValues.filter(({ x, y }) =>
665
+ (infoObj.label.includes(isHorizontal ? y : x)),
666
+ );
667
+ },
668
+
639
669
  /**
640
670
  * Add or delete selected label index, according to policy and option
641
671
  * (set each series data and label text)
@@ -788,6 +818,19 @@ const modules = {
788
818
  yMax: yMax ?? dataRangeY.graphMax,
789
819
  };
790
820
  },
821
+
822
+ setDeselectItem(hitInfo) {
823
+ let deselect = false;
824
+ if (this.options.selectItem.useDeselectItem) {
825
+ const isEqualSelectItem = hitInfo?.maxIndex === this.defaultSelectItemInfo?.dataIndex;
826
+ if (!isNaN(hitInfo?.maxIndex) && isEqualSelectItem) {
827
+ deselect = true;
828
+ this.defaultSelectItemInfo = null;
829
+ return true;
830
+ }
831
+ }
832
+ return deselect;
833
+ },
791
834
  };
792
835
 
793
836
  export default modules;
@@ -427,6 +427,7 @@ const modules = {
427
427
  }
428
428
 
429
429
  const targetId = targetDOM?.series?.cId;
430
+ const legendHitInfo = { sId: targetId, type: this.options.type };
430
431
 
431
432
  series.colorState.forEach((colorItem) => {
432
433
  colorItem.state = colorItem.id === targetId ? 'highlight' : 'downplay';
@@ -435,6 +436,9 @@ const modules = {
435
436
  this.update({
436
437
  updateSeries: false,
437
438
  updateSelTip: { update: false, keepDomain: false },
439
+ hitInfo: {
440
+ legend: legendHitInfo,
441
+ },
438
442
  });
439
443
  };
440
444
 
@@ -251,7 +251,7 @@ class Scale {
251
251
  }
252
252
 
253
253
  if (this.showAxis) {
254
- ctx.lineWidth = 2;
254
+ ctx.lineWidth = this.axisLineWidth;
255
255
  aliasPixel = Util.aliasPixel(ctx.lineWidth);
256
256
 
257
257
  ctx.beginPath();
@@ -110,7 +110,7 @@ class StepScale extends Scale {
110
110
  }
111
111
 
112
112
  ctx.fillStyle = this.labelStyle.color;
113
- ctx.lineWidth = 1;
113
+ ctx.lineWidth = this.axisLineWidth;
114
114
  const aliasPixel = Util.aliasPixel(ctx.lineWidth);
115
115
 
116
116
  ctx.beginPath();
@@ -146,7 +146,7 @@ class TimeCategoryScale extends Scale {
146
146
  }
147
147
 
148
148
  ctx.fillStyle = this.labelStyle.color;
149
- ctx.lineWidth = 1;
149
+ ctx.lineWidth = this.axisLineWidth;
150
150
  const aliasPixel = Util.aliasPixel(ctx.lineWidth);
151
151
 
152
152
  ctx.beginPath();
@@ -127,6 +127,14 @@ const DEFAULT_OPTIONS = {
127
127
  fontWeight: 400,
128
128
  },
129
129
  useSeriesOpacity: false,
130
+ useDeselectItem: false,
131
+ showBorder: false,
132
+ borderStyle: {
133
+ color: '#FFFFFF',
134
+ lineWidth: 1,
135
+ opacity: 1,
136
+ radius: 0,
137
+ },
130
138
  },
131
139
  selectLabel: {
132
140
  use: false,
@@ -196,8 +204,8 @@ const DEFAULT_OPTIONS = {
196
204
  heatMapColor: {
197
205
  min: '#FFFFFF',
198
206
  max: '#0052FF',
199
- categoryCnt: 1,
200
- categoryColors: [],
207
+ rangeCount: 1,
208
+ colorsByRange: [],
201
209
  stroke: {
202
210
  show: false,
203
211
  color: '#FFFFFF',
@@ -248,7 +256,14 @@ export const useModel = (selectedLabel) => {
248
256
  click: async (e) => {
249
257
  await nextTick();
250
258
  if (e.label) {
251
- emit('update:selectedItem', { seriesID: e.seriesId, dataIndex: e.dataIndex });
259
+ let selectedItem = { seriesID: e.seriesId, dataIndex: e.dataIndex };
260
+ if ('deselect' in e) {
261
+ if (e.deselect) {
262
+ selectedItem = null;
263
+ }
264
+ delete e.deselect;
265
+ }
266
+ emit('update:selectedItem', selectedItem);
252
267
  }
253
268
  if (e.selected?.dataIndex) {
254
269
  if (selectedLabel?.value) {