evui 3.3.48 → 3.3.50
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/dist/evui.common.js +380 -109
- package/dist/evui.common.js.map +1 -1
- package/dist/evui.umd.js +380 -109
- package/dist/evui.umd.js.map +1 -1
- package/dist/evui.umd.min.js +1 -1
- package/dist/evui.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/chart/chart.core.js +23 -2
- package/src/components/chart/element/element.heatmap.js +115 -46
- package/src/components/chart/element/element.line.js +63 -7
- package/src/components/chart/element/element.tip.js +51 -1
- package/src/components/chart/helpers/helpers.constant.js +1 -0
- package/src/components/chart/model/model.series.js +1 -1
- package/src/components/chart/model/model.store.js +24 -8
- package/src/components/chart/plugins/plugins.interaction.js +48 -5
- package/src/components/chart/plugins/plugins.legend.js +4 -0
- package/src/components/chart/scale/scale.js +1 -1
- package/src/components/chart/scale/scale.step.js +1 -1
- package/src/components/chart/scale/scale.time.category.js +1 -1
- package/src/components/chart/uses.js +18 -3
- package/src/components/grid/uses.js +2 -0
- package/src/components/treeGrid/uses.js +2 -0
|
@@ -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
|
|
|
@@ -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
|
-
|
|
200
|
-
|
|
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
|
-
|
|
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) {
|