@syncfusion/ej2-treemap 19.4.52 → 20.1.47-14088
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/CHANGELOG.md +96 -80
- package/README.md +69 -69
- package/dist/ej2-treemap.umd.min.js +1 -10
- package/dist/ej2-treemap.umd.min.js.map +1 -1
- package/dist/es6/ej2-treemap.es2015.js +80 -71
- package/dist/es6/ej2-treemap.es2015.js.map +1 -1
- package/dist/es6/ej2-treemap.es5.js +138 -129
- package/dist/es6/ej2-treemap.es5.js.map +1 -1
- package/helper/e2e/index.js +3 -3
- package/helper/e2e/treemap-helper.js +13 -13
- package/license +9 -9
- package/package.json +78 -78
- package/src/treemap/layout/legend.js +1 -1
- package/src/treemap/model/base-model.d.ts +485 -485
- package/src/treemap/model/base.js +19 -19
- package/src/treemap/model/interface.d.ts +17 -17
- package/src/treemap/model/pdf-export.js +2 -2
- package/src/treemap/model/theme.js +2 -2
- package/src/treemap/treemap-model.d.ts +221 -221
- package/src/treemap/treemap.d.ts +2 -1
- package/src/treemap/treemap.js +51 -46
- package/src/treemap/user-interaction/highlight-selection.js +12 -12
- package/src/treemap/user-interaction/tooltip.js +14 -10
- package/src/treemap/utils/enum.d.ts +5 -1
- package/src/treemap/utils/helper.js +5 -5
- package/.eslintrc.json +0 -244
- package/.github/PULL_REQUEST_TEMPLATE/Bug.md +0 -72
- package/.github/PULL_REQUEST_TEMPLATE/Feature.md +0 -49
- package/dist/global/ej2-treemap.min.js +0 -11
- package/dist/global/ej2-treemap.min.js.map +0 -1
- package/dist/global/index.d.ts +0 -14
- package/tslint.json +0 -111
|
@@ -121,12 +121,12 @@ const resize = 'resize';
|
|
|
121
121
|
*/
|
|
122
122
|
const defaultFont = 'Roboto, Segoe UI, Noto, Sans-serif';
|
|
123
123
|
|
|
124
|
-
var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
125
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
126
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
127
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
128
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
129
|
-
};
|
|
124
|
+
var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
125
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
126
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
127
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
128
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
129
|
+
};
|
|
130
130
|
/**
|
|
131
131
|
* Maps base doc
|
|
132
132
|
*/
|
|
@@ -991,7 +991,7 @@ value, weightValuePath) {
|
|
|
991
991
|
const dataValue = value;
|
|
992
992
|
if (!isNullOrUndefined(colorMapping[i].from) && !isNullOrUndefined(colorMapping[i].to)
|
|
993
993
|
&& !isNullOrUndefined(colorMapping[i].value)) {
|
|
994
|
-
if ((value >= colorMapping[i].from && colorMapping[i].to >= value) && (colorMapping[i].value === equalValue)) {
|
|
994
|
+
if ((value >= colorMapping[i].from && colorMapping[i].to >= value) && (colorMapping[i].value.toString() === equalValue)) {
|
|
995
995
|
isEqualColor = true;
|
|
996
996
|
if (Object.prototype.toString.call(colorMapping[i].color) === '[object Array]') {
|
|
997
997
|
fill = !isEqualColor ? colorCollections(colorMapping[i], dataValue) : colorMapping[i].color[0];
|
|
@@ -1003,8 +1003,8 @@ value, weightValuePath) {
|
|
|
1003
1003
|
}
|
|
1004
1004
|
else if ((!isNullOrUndefined(colorMapping[i].from) && !isNullOrUndefined(colorMapping[i].to))
|
|
1005
1005
|
|| !isNullOrUndefined((colorMapping[i].value))) {
|
|
1006
|
-
if ((value >= colorMapping[i].from && colorMapping[i].to >= value) || (colorMapping[i].value === equalValue)) {
|
|
1007
|
-
if (colorMapping[i].value === equalValue) {
|
|
1006
|
+
if ((value >= colorMapping[i].from && colorMapping[i].to >= value) || (colorMapping[i].value.toString() === equalValue)) {
|
|
1007
|
+
if (colorMapping[i].value.toString() === equalValue) {
|
|
1008
1008
|
isEqualColor = true;
|
|
1009
1009
|
}
|
|
1010
1010
|
if (Object.prototype.toString.call(colorMapping[i].color) === '[object Array]') {
|
|
@@ -1015,7 +1015,7 @@ value, weightValuePath) {
|
|
|
1015
1015
|
}
|
|
1016
1016
|
}
|
|
1017
1017
|
}
|
|
1018
|
-
if (((value >= colorMapping[i].from && value <= colorMapping[i].to) || (colorMapping[i].value === equalValue))
|
|
1018
|
+
if (((value >= colorMapping[i].from && value <= colorMapping[i].to) || (colorMapping[i].value.toString() === equalValue))
|
|
1019
1019
|
&& !isNullOrUndefined(colorMapping[i].minOpacity) && !isNullOrUndefined(colorMapping[i].maxOpacity) && fill) {
|
|
1020
1020
|
opacity = deSaturationColor(weightValuePath, colorMapping[i], fill, value);
|
|
1021
1021
|
}
|
|
@@ -1252,7 +1252,7 @@ function removeClassNames(elements, type, treemap) {
|
|
|
1252
1252
|
for (let j = 0; j < elements.length; j++) {
|
|
1253
1253
|
element = isNullOrUndefined(elements[j].childNodes[0]) ? elements[j] :
|
|
1254
1254
|
elements[j].childNodes[0];
|
|
1255
|
-
options = treemap.layout.renderItems[element.id.split('
|
|
1255
|
+
options = treemap.layout.renderItems[parseFloat(element.id.split('_Item_Index_')[1])]['options'];
|
|
1256
1256
|
applyOptions(element, options);
|
|
1257
1257
|
elements[j].classList.remove(type);
|
|
1258
1258
|
j -= 1;
|
|
@@ -2429,7 +2429,7 @@ function getThemeStyle(theme) {
|
|
|
2429
2429
|
labelFontFamily: 'Helvetica Neue'
|
|
2430
2430
|
};
|
|
2431
2431
|
break;
|
|
2432
|
-
case '
|
|
2432
|
+
case 'fluent':
|
|
2433
2433
|
style = {
|
|
2434
2434
|
backgroundColor: 'rgba(255,255,255, 0.0)',
|
|
2435
2435
|
titleFontColor: '#201F1E',
|
|
@@ -2446,7 +2446,7 @@ function getThemeStyle(theme) {
|
|
|
2446
2446
|
labelFontFamily: 'Segoe UI'
|
|
2447
2447
|
};
|
|
2448
2448
|
break;
|
|
2449
|
-
case '
|
|
2449
|
+
case 'fluentdark':
|
|
2450
2450
|
style = {
|
|
2451
2451
|
backgroundColor: 'rgba(255,255,255, 0.0)',
|
|
2452
2452
|
titleFontColor: '#F3F2F1',
|
|
@@ -2692,8 +2692,8 @@ class PdfExport {
|
|
|
2692
2692
|
const backgroundElement = exportElement.childNodes[0];
|
|
2693
2693
|
if (!isNullOrUndefined(backgroundElement)) {
|
|
2694
2694
|
const backgroundColor = backgroundElement.getAttribute('fill');
|
|
2695
|
-
if ((this.control.theme === 'Tailwind' || this.control.theme === 'TailwindDark' || this.control.theme === 'Bootstrap5' || this.control.theme === 'Bootstrap5Dark'
|
|
2696
|
-
&& (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
|
|
2695
|
+
if ((this.control.theme === 'Tailwind' || this.control.theme === 'TailwindDark' || this.control.theme === 'Bootstrap5' || this.control.theme === 'Bootstrap5Dark'
|
|
2696
|
+
|| this.control.theme === 'Fluent' || this.control.theme === 'FluentDark') && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
|
|
2697
2697
|
exportElement.childNodes[0].setAttribute('fill', 'rgba(255,255,255, 1)');
|
|
2698
2698
|
}
|
|
2699
2699
|
}
|
|
@@ -2743,12 +2743,12 @@ class PdfExport {
|
|
|
2743
2743
|
/**
|
|
2744
2744
|
* Tree Map Components
|
|
2745
2745
|
*/
|
|
2746
|
-
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
2747
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2748
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2749
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2750
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2751
|
-
};
|
|
2746
|
+
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
2747
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2748
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2749
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2750
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2751
|
+
};
|
|
2752
2752
|
/**
|
|
2753
2753
|
* Represents the treemap component.
|
|
2754
2754
|
* ```html
|
|
@@ -3265,7 +3265,7 @@ let TreeMap = class TreeMap extends Component {
|
|
|
3265
3265
|
EventHandler.remove(this.element, Browser.touchMoveEvent, this.mouseMoveOnTreeMap);
|
|
3266
3266
|
EventHandler.remove(this.element, Browser.touchEndEvent, this.mouseEndOnTreeMap);
|
|
3267
3267
|
EventHandler.remove(this.element, 'pointerleave mouseleave', this.mouseLeaveOnTreeMap);
|
|
3268
|
-
window.removeEventListener('resize', this.
|
|
3268
|
+
window.removeEventListener('resize', this.resizeEvent);
|
|
3269
3269
|
}
|
|
3270
3270
|
/**
|
|
3271
3271
|
* To bind event handlers for treemap.
|
|
@@ -3280,7 +3280,8 @@ let TreeMap = class TreeMap extends Component {
|
|
|
3280
3280
|
EventHandler.add(this.element, Browser.touchMoveEvent, this.mouseMoveOnTreeMap, this);
|
|
3281
3281
|
EventHandler.add(this.element, Browser.touchEndEvent, this.mouseEndOnTreeMap, this);
|
|
3282
3282
|
EventHandler.add(this.element, 'pointerleave mouseleave', this.mouseLeaveOnTreeMap, this);
|
|
3283
|
-
|
|
3283
|
+
this.resizeEvent = this.resizeOnTreeMap.bind(this);
|
|
3284
|
+
window.addEventListener('resize', this.resizeEvent);
|
|
3284
3285
|
}
|
|
3285
3286
|
/**
|
|
3286
3287
|
* Method to set culture for maps
|
|
@@ -3305,28 +3306,32 @@ let TreeMap = class TreeMap extends Component {
|
|
|
3305
3306
|
* @param e - Specifies the pointer event.
|
|
3306
3307
|
*/
|
|
3307
3308
|
resizeOnTreeMap(e) {
|
|
3308
|
-
this.
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
this.
|
|
3321
|
-
this.
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3309
|
+
if (!this.isDestroyed) {
|
|
3310
|
+
this.isResize = true;
|
|
3311
|
+
const args = {
|
|
3312
|
+
name: resize,
|
|
3313
|
+
cancel: false,
|
|
3314
|
+
previousSize: this.availableSize,
|
|
3315
|
+
currentSize: new Size(0, 0),
|
|
3316
|
+
treemap: this
|
|
3317
|
+
};
|
|
3318
|
+
if (this.resizeTo) {
|
|
3319
|
+
clearTimeout(this.resizeTo);
|
|
3320
|
+
}
|
|
3321
|
+
if (!isNullOrUndefined(this.element) && this.element.classList.contains('e-treemap')) {
|
|
3322
|
+
this.resizeTo = setTimeout(() => {
|
|
3323
|
+
this.unWireEVents();
|
|
3324
|
+
this.createSvg();
|
|
3325
|
+
this.refreshing = true;
|
|
3326
|
+
this.wireEVents();
|
|
3327
|
+
args.currentSize = this.availableSize;
|
|
3328
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3329
|
+
this.trigger(resize, args, (observedArgs) => {
|
|
3330
|
+
this.render();
|
|
3331
|
+
this.refreshing = false;
|
|
3332
|
+
});
|
|
3333
|
+
}, 500);
|
|
3334
|
+
}
|
|
3330
3335
|
}
|
|
3331
3336
|
}
|
|
3332
3337
|
/**
|
|
@@ -3344,7 +3349,7 @@ let TreeMap = class TreeMap extends Component {
|
|
|
3344
3349
|
this.trigger(click, clickArgs);
|
|
3345
3350
|
if (targetId.indexOf('_Item_Index') > -1) {
|
|
3346
3351
|
e.preventDefault();
|
|
3347
|
-
itemIndex = parseFloat(targetId.split('
|
|
3352
|
+
itemIndex = parseFloat(targetId.split('_Item_Index_')[1]);
|
|
3348
3353
|
eventArgs = {
|
|
3349
3354
|
cancel: false, name: itemClick, treemap: this, item: this.layout.renderItems[itemIndex], mouseEvent: e,
|
|
3350
3355
|
groupIndex: this.layout.renderItems[itemIndex]['groupIndex'], groupName: this.layout.renderItems[itemIndex]['name'],
|
|
@@ -3417,7 +3422,7 @@ let TreeMap = class TreeMap extends Component {
|
|
|
3417
3422
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3418
3423
|
let childItems;
|
|
3419
3424
|
if (targetId.indexOf('_Item_Index') > -1) {
|
|
3420
|
-
item = this.layout.renderItems[parseFloat(targetId.split('
|
|
3425
|
+
item = this.layout.renderItems[parseFloat(targetId.split('_Item_Index_')[1])];
|
|
3421
3426
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3422
3427
|
childItems = findChildren(item)['values'];
|
|
3423
3428
|
this.element.style.cursor = (!item['isLeafItem'] && childItems && childItems.length > 0 && this.enableDrillDown) ?
|
|
@@ -3542,7 +3547,7 @@ let TreeMap = class TreeMap extends Component {
|
|
|
3542
3547
|
if (e.cancelable) {
|
|
3543
3548
|
e.preventDefault();
|
|
3544
3549
|
}
|
|
3545
|
-
index = parseFloat(targetId.split('
|
|
3550
|
+
index = parseFloat(targetId.split('_Item_Index_')[1]);
|
|
3546
3551
|
item = this.layout.renderItems[index];
|
|
3547
3552
|
const labelText = targetEle.innerHTML;
|
|
3548
3553
|
if (this.enableBreadcrumb) {
|
|
@@ -4741,7 +4746,7 @@ class TreeMapLegend {
|
|
|
4741
4746
|
let stroke;
|
|
4742
4747
|
let strokeWidth;
|
|
4743
4748
|
let legendElement;
|
|
4744
|
-
targetItem = treemap.layout.renderItems[parseFloat(target.id.split('
|
|
4749
|
+
targetItem = treemap.layout.renderItems[parseFloat(target.id.split('_Item_Index_')[1])];
|
|
4745
4750
|
const svgRect = treemap.svgObject.getBoundingClientRect();
|
|
4746
4751
|
for (let i = 0; i < this.legendCollections.length; i++) {
|
|
4747
4752
|
currentData = this.legendCollections[i];
|
|
@@ -5014,14 +5019,14 @@ class TreeMapHighlight {
|
|
|
5014
5019
|
if (this.highLightId !== targetId) {
|
|
5015
5020
|
treeMapElement = document.getElementById(treemap.element.id + '_TreeMap_' + treemap.layoutType + '_Layout');
|
|
5016
5021
|
const selectionElements = document.getElementsByClassName('treeMapSelection');
|
|
5017
|
-
item = this.treemap.layout.renderItems[parseFloat(targetId.split('
|
|
5022
|
+
item = this.treemap.layout.renderItems[parseFloat(targetId.split('_Item_Index_')[1])];
|
|
5018
5023
|
let index;
|
|
5019
5024
|
if (this.treemap.legendSettings.visible) {
|
|
5020
5025
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5021
5026
|
const collection = this.treemap.treeMapLegendModule.legendCollections;
|
|
5022
5027
|
const length = this.treemap.treeMapLegendModule.legendCollections.length;
|
|
5023
5028
|
index = getLegendIndex(length, item, treemap);
|
|
5024
|
-
this.shapeElement = this.treemap.legendSettings.mode === 'Default' ? document.getElementById('
|
|
5029
|
+
this.shapeElement = this.treemap.legendSettings.mode === 'Default' ? document.getElementById(this.treemap.element.id + '_Legend_Shape_Index_' + index) : document.getElementById(this.treemap.element.id + '_Legend_Index_' + index);
|
|
5025
5030
|
if (this.shapeElement !== null && (selectionModule ? this.shapeElement.getAttribute('id') !== selectionModule.legendSelectId : true)) {
|
|
5026
5031
|
if (selectionModule ? this.shapeElement !== selectionModule.shapeElement : true) {
|
|
5027
5032
|
this.currentElement.push({ currentElement: this.shapeElement });
|
|
@@ -5049,7 +5054,7 @@ class TreeMapHighlight {
|
|
|
5049
5054
|
for (let i = 0; i < treeMapElement.childElementCount; i++) {
|
|
5050
5055
|
element = treeMapElement.childNodes[i];
|
|
5051
5056
|
process = true;
|
|
5052
|
-
item = treemap.layout.renderItems[element.id.split('
|
|
5057
|
+
item = treemap.layout.renderItems[parseFloat(element.id.split('_Item_Index_')[1])];
|
|
5053
5058
|
for (let j = 0; j < selectionElements.length; j++) {
|
|
5054
5059
|
if (element.id === selectionElements[j].id) {
|
|
5055
5060
|
process = false;
|
|
@@ -5087,7 +5092,7 @@ class TreeMapHighlight {
|
|
|
5087
5092
|
removeLegend(this.legendHighlightCollection, 'highlight');
|
|
5088
5093
|
}
|
|
5089
5094
|
this.shapeTarget = 'highlight';
|
|
5090
|
-
const index = this.treemap.legendSettings.mode === 'Default' ? parseFloat(targetId.split('
|
|
5095
|
+
const index = this.treemap.legendSettings.mode === 'Default' ? parseFloat(targetId.split('_Legend_Shape_Index_')[1]) : parseFloat(targetId.split('_Legend_Index_')[1]);
|
|
5091
5096
|
const dataLength = this.treemap.treeMapLegendModule.legendCollections[index]['legendData'].length;
|
|
5092
5097
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5093
5098
|
const collection = this.treemap.treeMapLegendModule.legendCollections;
|
|
@@ -5097,7 +5102,7 @@ class TreeMapHighlight {
|
|
|
5097
5102
|
if (this.treemap.treeMapLegendModule.legendCollections[index]['legendData'][i]['levelOrderName'] === this.treemap.layout.renderItems[j]['levelOrderName']) {
|
|
5098
5103
|
itemIndex = j;
|
|
5099
5104
|
groupIndex = this.treemap.layout.renderItems[j]['groupIndex'];
|
|
5100
|
-
const nodeEle = document.getElementById('
|
|
5105
|
+
const nodeEle = document.getElementById(this.treemap.element.id + '_Level_Index_' + groupIndex + '_Item_Index_' + itemIndex + '_RectPath');
|
|
5101
5106
|
if (i === 0) {
|
|
5102
5107
|
this.legendHighlightCollection = [];
|
|
5103
5108
|
pushCollection(this.legendHighlightCollection, legendIndex, j, targetEle, nodeEle, this.treemap.layout.renderItems, collection);
|
|
@@ -5218,7 +5223,7 @@ class TreeMapSelection {
|
|
|
5218
5223
|
e.preventDefault();
|
|
5219
5224
|
if (this.treemap.selectionId !== targetId && this.legendSelect) {
|
|
5220
5225
|
treeMapElement = document.getElementById(layoutID);
|
|
5221
|
-
item = treemap.layout.renderItems[parseFloat(targetId.split('
|
|
5226
|
+
item = treemap.layout.renderItems[parseFloat(targetId.split('_Item_Index_')[1])];
|
|
5222
5227
|
let index;
|
|
5223
5228
|
if (this.treemap.legendSettings.visible) {
|
|
5224
5229
|
this.shapeSelect = false;
|
|
@@ -5232,7 +5237,7 @@ class TreeMapSelection {
|
|
|
5232
5237
|
highlightModule.shapeHighlightCollection = [];
|
|
5233
5238
|
}
|
|
5234
5239
|
index = getLegendIndex(length, item, treemap);
|
|
5235
|
-
this.shapeElement = this.treemap.legendSettings.mode === 'Default' ? document.getElementById('
|
|
5240
|
+
this.shapeElement = this.treemap.legendSettings.mode === 'Default' ? document.getElementById(this.treemap.element.id + '_Legend_Shape_Index_' + index) : document.getElementById(this.treemap.element.id + '_Legend_Index_' + index);
|
|
5236
5241
|
if (this.shapeElement !== null) {
|
|
5237
5242
|
this.shapeSelectId = this.shapeElement.getAttribute('id');
|
|
5238
5243
|
this.shapeSelectionCollection.push({ legendEle: this.shapeElement, oldFill: collection[index]['legendFill'],
|
|
@@ -5245,7 +5250,7 @@ class TreeMapSelection {
|
|
|
5245
5250
|
orders = findHightLightItems(item, [], selection.mode, treemap);
|
|
5246
5251
|
for (let i = 0; i < treeMapElement.childElementCount; i++) {
|
|
5247
5252
|
element = treeMapElement.childNodes[i];
|
|
5248
|
-
item = treemap.layout.renderItems[element.id.split('
|
|
5253
|
+
item = treemap.layout.renderItems[parseFloat(element.id.split('_Item_Index_')[1])];
|
|
5249
5254
|
if (orders.indexOf(item['levelOrderName']) > -1) {
|
|
5250
5255
|
selectionElements.push(element);
|
|
5251
5256
|
treemap.levelSelection.push(element.id);
|
|
@@ -5305,14 +5310,14 @@ class TreeMapSelection {
|
|
|
5305
5310
|
if (highlightModule) {
|
|
5306
5311
|
highlightModule.shapeTarget = 'selection';
|
|
5307
5312
|
}
|
|
5308
|
-
const index = this.treemap.legendSettings.mode === 'Default' ? parseFloat(targetId.split('
|
|
5313
|
+
const index = this.treemap.legendSettings.mode === 'Default' ? parseFloat(targetId.split('_Legend_Shape_Index_')[1]) : parseFloat(targetId.split('_Legend_Index_')[1]);
|
|
5309
5314
|
const dataLength = this.treemap.treeMapLegendModule.legendCollections[index]['legendData'].length;
|
|
5310
5315
|
for (let k = 0; k < dataLength; k++) {
|
|
5311
5316
|
for (let l = 0; l < this.treemap.layout.renderItems.length; l++) {
|
|
5312
5317
|
if (this.treemap.treeMapLegendModule.legendCollections[index]['legendData'][k]['levelOrderName'] === this.treemap.layout.renderItems[l]['levelOrderName']) {
|
|
5313
5318
|
itemIndex = l;
|
|
5314
5319
|
groupIndex = this.treemap.layout.renderItems[l]['groupIndex'];
|
|
5315
|
-
const nodeEle = document.getElementById('
|
|
5320
|
+
const nodeEle = document.getElementById(this.treemap.element.id + '_Level_Index_' + groupIndex + '_Item_Index_' + itemIndex + '_RectPath');
|
|
5316
5321
|
if (k === 0) {
|
|
5317
5322
|
pushCollection(this.legendSelectionCollection, legendIndex, l, targetEle, nodeEle, this.treemap.layout.renderItems, collection);
|
|
5318
5323
|
length = this.legendSelectionCollection.length;
|
|
@@ -5364,7 +5369,7 @@ class TreeMapSelection {
|
|
|
5364
5369
|
const orders = findHightLightItems(item, [], selection.mode, this.treemap);
|
|
5365
5370
|
for (let i = 0; i < treeMapElement.childElementCount; i++) {
|
|
5366
5371
|
element = treeMapElement.childNodes[i];
|
|
5367
|
-
item = this.treemap.layout.renderItems[element.id.split('
|
|
5372
|
+
item = this.treemap.layout.renderItems[parseFloat(element.id.split('_Item_Index_')[1])];
|
|
5368
5373
|
if (orders.indexOf(item['levelOrderName']) > -1) {
|
|
5369
5374
|
selectionElements.push(element);
|
|
5370
5375
|
this.treemap.levelSelection.push(element.id);
|
|
@@ -5380,7 +5385,7 @@ class TreeMapSelection {
|
|
|
5380
5385
|
this.shapeElement = undefined;
|
|
5381
5386
|
removeShape(this.shapeSelectionCollection, 'selection');
|
|
5382
5387
|
index = getLegendIndex(length, items[m], this.treemap);
|
|
5383
|
-
this.shapeElement = this.treemap.legendSettings.mode === 'Default' ? document.getElementById('
|
|
5388
|
+
this.shapeElement = this.treemap.legendSettings.mode === 'Default' ? document.getElementById(this.treemap.element.id + '_Legend_Shape_Index_' + index) : document.getElementById(this.treemap.element.id + '_Legend_Index_' + index);
|
|
5384
5389
|
if (this.shapeElement !== null) {
|
|
5385
5390
|
this.shapeSelectId = this.shapeElement.getAttribute('id');
|
|
5386
5391
|
this.treemap.legendId.push(this.shapeSelectId);
|
|
@@ -5470,15 +5475,15 @@ class TreeMapSelection {
|
|
|
5470
5475
|
}
|
|
5471
5476
|
}
|
|
5472
5477
|
|
|
5473
|
-
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
5474
|
-
var t = {};
|
|
5475
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5476
|
-
t[p] = s[p];
|
|
5477
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
5478
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
|
|
5479
|
-
t[p[i]] = s[p[i]];
|
|
5480
|
-
return t;
|
|
5481
|
-
};
|
|
5478
|
+
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
5479
|
+
var t = {};
|
|
5480
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5481
|
+
t[p] = s[p];
|
|
5482
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
5483
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
|
|
5484
|
+
t[p[i]] = s[p[i]];
|
|
5485
|
+
return t;
|
|
5486
|
+
};
|
|
5482
5487
|
/**
|
|
5483
5488
|
* Render Tooltip
|
|
5484
5489
|
*/
|
|
@@ -5521,7 +5526,7 @@ class TreeMapTooltip {
|
|
|
5521
5526
|
let tooltipContent = [];
|
|
5522
5527
|
let markerFill;
|
|
5523
5528
|
if (targetId.indexOf('_Item_Index') > -1) {
|
|
5524
|
-
item = this.treemap.layout.renderItems[parseFloat(targetId.split('
|
|
5529
|
+
item = this.treemap.layout.renderItems[parseFloat(targetId.split('_Item_Index_')[1])];
|
|
5525
5530
|
if (!isNullOrUndefined(item)) {
|
|
5526
5531
|
toolTipHeader = item['name'];
|
|
5527
5532
|
value = item['weight'];
|
|
@@ -5601,6 +5606,10 @@ class TreeMapTooltip {
|
|
|
5601
5606
|
textStyle: args['textStyle'],
|
|
5602
5607
|
fill: this.treemap.tooltipSettings.fill ? this.treemap.tooltipSettings.fill : this.treemap.themeStyle.tooltipFillColor
|
|
5603
5608
|
});
|
|
5609
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5610
|
+
if (this.treemap.isVue || this.treemap.isVue3) {
|
|
5611
|
+
this.svgTooltip.controlInstance = this.treemap;
|
|
5612
|
+
}
|
|
5604
5613
|
this.svgTooltip.opacity = this.treemap.themeStyle.tooltipFillOpacity || this.svgTooltip.opacity;
|
|
5605
5614
|
this.svgTooltip.appendTo(tooltipEle);
|
|
5606
5615
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|