@syncfusion/ej2-treemap 19.4.52 → 20.1.59
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 +14 -0
- package/dist/ej2-treemap.umd.min.js +2 -2
- package/dist/ej2-treemap.umd.min.js.map +1 -1
- package/dist/es6/ej2-treemap.es2015.js +26 -22
- package/dist/es6/ej2-treemap.es2015.js.map +1 -1
- package/dist/es6/ej2-treemap.es5.js +26 -22
- package/dist/es6/ej2-treemap.es5.js.map +1 -1
- package/dist/global/ej2-treemap.min.js +2 -2
- package/dist/global/ej2-treemap.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +11 -11
- package/src/treemap/layout/legend.js +1 -1
- package/src/treemap/model/pdf-export.js +2 -2
- package/src/treemap/model/theme.js +2 -2
- package/src/treemap/treemap.js +3 -3
- package/src/treemap/user-interaction/highlight-selection.js +12 -12
- package/src/treemap/user-interaction/tooltip.js +5 -1
- package/src/treemap/utils/enum.d.ts +5 -1
- package/src/treemap/utils/helper.js +1 -1
|
@@ -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
|
}
|
|
@@ -3344,7 +3344,7 @@ let TreeMap = class TreeMap extends Component {
|
|
|
3344
3344
|
this.trigger(click, clickArgs);
|
|
3345
3345
|
if (targetId.indexOf('_Item_Index') > -1) {
|
|
3346
3346
|
e.preventDefault();
|
|
3347
|
-
itemIndex = parseFloat(targetId.split('
|
|
3347
|
+
itemIndex = parseFloat(targetId.split('_Item_Index_')[1]);
|
|
3348
3348
|
eventArgs = {
|
|
3349
3349
|
cancel: false, name: itemClick, treemap: this, item: this.layout.renderItems[itemIndex], mouseEvent: e,
|
|
3350
3350
|
groupIndex: this.layout.renderItems[itemIndex]['groupIndex'], groupName: this.layout.renderItems[itemIndex]['name'],
|
|
@@ -3417,7 +3417,7 @@ let TreeMap = class TreeMap extends Component {
|
|
|
3417
3417
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3418
3418
|
let childItems;
|
|
3419
3419
|
if (targetId.indexOf('_Item_Index') > -1) {
|
|
3420
|
-
item = this.layout.renderItems[parseFloat(targetId.split('
|
|
3420
|
+
item = this.layout.renderItems[parseFloat(targetId.split('_Item_Index_')[1])];
|
|
3421
3421
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3422
3422
|
childItems = findChildren(item)['values'];
|
|
3423
3423
|
this.element.style.cursor = (!item['isLeafItem'] && childItems && childItems.length > 0 && this.enableDrillDown) ?
|
|
@@ -3542,7 +3542,7 @@ let TreeMap = class TreeMap extends Component {
|
|
|
3542
3542
|
if (e.cancelable) {
|
|
3543
3543
|
e.preventDefault();
|
|
3544
3544
|
}
|
|
3545
|
-
index = parseFloat(targetId.split('
|
|
3545
|
+
index = parseFloat(targetId.split('_Item_Index_')[1]);
|
|
3546
3546
|
item = this.layout.renderItems[index];
|
|
3547
3547
|
const labelText = targetEle.innerHTML;
|
|
3548
3548
|
if (this.enableBreadcrumb) {
|
|
@@ -4741,7 +4741,7 @@ class TreeMapLegend {
|
|
|
4741
4741
|
let stroke;
|
|
4742
4742
|
let strokeWidth;
|
|
4743
4743
|
let legendElement;
|
|
4744
|
-
targetItem = treemap.layout.renderItems[parseFloat(target.id.split('
|
|
4744
|
+
targetItem = treemap.layout.renderItems[parseFloat(target.id.split('_Item_Index_')[1])];
|
|
4745
4745
|
const svgRect = treemap.svgObject.getBoundingClientRect();
|
|
4746
4746
|
for (let i = 0; i < this.legendCollections.length; i++) {
|
|
4747
4747
|
currentData = this.legendCollections[i];
|
|
@@ -5014,14 +5014,14 @@ class TreeMapHighlight {
|
|
|
5014
5014
|
if (this.highLightId !== targetId) {
|
|
5015
5015
|
treeMapElement = document.getElementById(treemap.element.id + '_TreeMap_' + treemap.layoutType + '_Layout');
|
|
5016
5016
|
const selectionElements = document.getElementsByClassName('treeMapSelection');
|
|
5017
|
-
item = this.treemap.layout.renderItems[parseFloat(targetId.split('
|
|
5017
|
+
item = this.treemap.layout.renderItems[parseFloat(targetId.split('_Item_Index_')[1])];
|
|
5018
5018
|
let index;
|
|
5019
5019
|
if (this.treemap.legendSettings.visible) {
|
|
5020
5020
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5021
5021
|
const collection = this.treemap.treeMapLegendModule.legendCollections;
|
|
5022
5022
|
const length = this.treemap.treeMapLegendModule.legendCollections.length;
|
|
5023
5023
|
index = getLegendIndex(length, item, treemap);
|
|
5024
|
-
this.shapeElement = this.treemap.legendSettings.mode === 'Default' ? document.getElementById('
|
|
5024
|
+
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
5025
|
if (this.shapeElement !== null && (selectionModule ? this.shapeElement.getAttribute('id') !== selectionModule.legendSelectId : true)) {
|
|
5026
5026
|
if (selectionModule ? this.shapeElement !== selectionModule.shapeElement : true) {
|
|
5027
5027
|
this.currentElement.push({ currentElement: this.shapeElement });
|
|
@@ -5049,7 +5049,7 @@ class TreeMapHighlight {
|
|
|
5049
5049
|
for (let i = 0; i < treeMapElement.childElementCount; i++) {
|
|
5050
5050
|
element = treeMapElement.childNodes[i];
|
|
5051
5051
|
process = true;
|
|
5052
|
-
item = treemap.layout.renderItems[element.id.split('
|
|
5052
|
+
item = treemap.layout.renderItems[parseFloat(element.id.split('_Item_Index_')[1])];
|
|
5053
5053
|
for (let j = 0; j < selectionElements.length; j++) {
|
|
5054
5054
|
if (element.id === selectionElements[j].id) {
|
|
5055
5055
|
process = false;
|
|
@@ -5087,7 +5087,7 @@ class TreeMapHighlight {
|
|
|
5087
5087
|
removeLegend(this.legendHighlightCollection, 'highlight');
|
|
5088
5088
|
}
|
|
5089
5089
|
this.shapeTarget = 'highlight';
|
|
5090
|
-
const index = this.treemap.legendSettings.mode === 'Default' ? parseFloat(targetId.split('
|
|
5090
|
+
const index = this.treemap.legendSettings.mode === 'Default' ? parseFloat(targetId.split('_Legend_Shape_Index_')[1]) : parseFloat(targetId.split('_Legend_Index_')[1]);
|
|
5091
5091
|
const dataLength = this.treemap.treeMapLegendModule.legendCollections[index]['legendData'].length;
|
|
5092
5092
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5093
5093
|
const collection = this.treemap.treeMapLegendModule.legendCollections;
|
|
@@ -5097,7 +5097,7 @@ class TreeMapHighlight {
|
|
|
5097
5097
|
if (this.treemap.treeMapLegendModule.legendCollections[index]['legendData'][i]['levelOrderName'] === this.treemap.layout.renderItems[j]['levelOrderName']) {
|
|
5098
5098
|
itemIndex = j;
|
|
5099
5099
|
groupIndex = this.treemap.layout.renderItems[j]['groupIndex'];
|
|
5100
|
-
const nodeEle = document.getElementById('
|
|
5100
|
+
const nodeEle = document.getElementById(this.treemap.element.id + '_Level_Index_' + groupIndex + '_Item_Index_' + itemIndex + '_RectPath');
|
|
5101
5101
|
if (i === 0) {
|
|
5102
5102
|
this.legendHighlightCollection = [];
|
|
5103
5103
|
pushCollection(this.legendHighlightCollection, legendIndex, j, targetEle, nodeEle, this.treemap.layout.renderItems, collection);
|
|
@@ -5218,7 +5218,7 @@ class TreeMapSelection {
|
|
|
5218
5218
|
e.preventDefault();
|
|
5219
5219
|
if (this.treemap.selectionId !== targetId && this.legendSelect) {
|
|
5220
5220
|
treeMapElement = document.getElementById(layoutID);
|
|
5221
|
-
item = treemap.layout.renderItems[parseFloat(targetId.split('
|
|
5221
|
+
item = treemap.layout.renderItems[parseFloat(targetId.split('_Item_Index_')[1])];
|
|
5222
5222
|
let index;
|
|
5223
5223
|
if (this.treemap.legendSettings.visible) {
|
|
5224
5224
|
this.shapeSelect = false;
|
|
@@ -5232,7 +5232,7 @@ class TreeMapSelection {
|
|
|
5232
5232
|
highlightModule.shapeHighlightCollection = [];
|
|
5233
5233
|
}
|
|
5234
5234
|
index = getLegendIndex(length, item, treemap);
|
|
5235
|
-
this.shapeElement = this.treemap.legendSettings.mode === 'Default' ? document.getElementById('
|
|
5235
|
+
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
5236
|
if (this.shapeElement !== null) {
|
|
5237
5237
|
this.shapeSelectId = this.shapeElement.getAttribute('id');
|
|
5238
5238
|
this.shapeSelectionCollection.push({ legendEle: this.shapeElement, oldFill: collection[index]['legendFill'],
|
|
@@ -5245,7 +5245,7 @@ class TreeMapSelection {
|
|
|
5245
5245
|
orders = findHightLightItems(item, [], selection.mode, treemap);
|
|
5246
5246
|
for (let i = 0; i < treeMapElement.childElementCount; i++) {
|
|
5247
5247
|
element = treeMapElement.childNodes[i];
|
|
5248
|
-
item = treemap.layout.renderItems[element.id.split('
|
|
5248
|
+
item = treemap.layout.renderItems[parseFloat(element.id.split('_Item_Index_')[1])];
|
|
5249
5249
|
if (orders.indexOf(item['levelOrderName']) > -1) {
|
|
5250
5250
|
selectionElements.push(element);
|
|
5251
5251
|
treemap.levelSelection.push(element.id);
|
|
@@ -5305,14 +5305,14 @@ class TreeMapSelection {
|
|
|
5305
5305
|
if (highlightModule) {
|
|
5306
5306
|
highlightModule.shapeTarget = 'selection';
|
|
5307
5307
|
}
|
|
5308
|
-
const index = this.treemap.legendSettings.mode === 'Default' ? parseFloat(targetId.split('
|
|
5308
|
+
const index = this.treemap.legendSettings.mode === 'Default' ? parseFloat(targetId.split('_Legend_Shape_Index_')[1]) : parseFloat(targetId.split('_Legend_Index_')[1]);
|
|
5309
5309
|
const dataLength = this.treemap.treeMapLegendModule.legendCollections[index]['legendData'].length;
|
|
5310
5310
|
for (let k = 0; k < dataLength; k++) {
|
|
5311
5311
|
for (let l = 0; l < this.treemap.layout.renderItems.length; l++) {
|
|
5312
5312
|
if (this.treemap.treeMapLegendModule.legendCollections[index]['legendData'][k]['levelOrderName'] === this.treemap.layout.renderItems[l]['levelOrderName']) {
|
|
5313
5313
|
itemIndex = l;
|
|
5314
5314
|
groupIndex = this.treemap.layout.renderItems[l]['groupIndex'];
|
|
5315
|
-
const nodeEle = document.getElementById('
|
|
5315
|
+
const nodeEle = document.getElementById(this.treemap.element.id + '_Level_Index_' + groupIndex + '_Item_Index_' + itemIndex + '_RectPath');
|
|
5316
5316
|
if (k === 0) {
|
|
5317
5317
|
pushCollection(this.legendSelectionCollection, legendIndex, l, targetEle, nodeEle, this.treemap.layout.renderItems, collection);
|
|
5318
5318
|
length = this.legendSelectionCollection.length;
|
|
@@ -5364,7 +5364,7 @@ class TreeMapSelection {
|
|
|
5364
5364
|
const orders = findHightLightItems(item, [], selection.mode, this.treemap);
|
|
5365
5365
|
for (let i = 0; i < treeMapElement.childElementCount; i++) {
|
|
5366
5366
|
element = treeMapElement.childNodes[i];
|
|
5367
|
-
item = this.treemap.layout.renderItems[element.id.split('
|
|
5367
|
+
item = this.treemap.layout.renderItems[parseFloat(element.id.split('_Item_Index_')[1])];
|
|
5368
5368
|
if (orders.indexOf(item['levelOrderName']) > -1) {
|
|
5369
5369
|
selectionElements.push(element);
|
|
5370
5370
|
this.treemap.levelSelection.push(element.id);
|
|
@@ -5380,7 +5380,7 @@ class TreeMapSelection {
|
|
|
5380
5380
|
this.shapeElement = undefined;
|
|
5381
5381
|
removeShape(this.shapeSelectionCollection, 'selection');
|
|
5382
5382
|
index = getLegendIndex(length, items[m], this.treemap);
|
|
5383
|
-
this.shapeElement = this.treemap.legendSettings.mode === 'Default' ? document.getElementById('
|
|
5383
|
+
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
5384
|
if (this.shapeElement !== null) {
|
|
5385
5385
|
this.shapeSelectId = this.shapeElement.getAttribute('id');
|
|
5386
5386
|
this.treemap.legendId.push(this.shapeSelectId);
|
|
@@ -5521,7 +5521,7 @@ class TreeMapTooltip {
|
|
|
5521
5521
|
let tooltipContent = [];
|
|
5522
5522
|
let markerFill;
|
|
5523
5523
|
if (targetId.indexOf('_Item_Index') > -1) {
|
|
5524
|
-
item = this.treemap.layout.renderItems[parseFloat(targetId.split('
|
|
5524
|
+
item = this.treemap.layout.renderItems[parseFloat(targetId.split('_Item_Index_')[1])];
|
|
5525
5525
|
if (!isNullOrUndefined(item)) {
|
|
5526
5526
|
toolTipHeader = item['name'];
|
|
5527
5527
|
value = item['weight'];
|
|
@@ -5601,6 +5601,10 @@ class TreeMapTooltip {
|
|
|
5601
5601
|
textStyle: args['textStyle'],
|
|
5602
5602
|
fill: this.treemap.tooltipSettings.fill ? this.treemap.tooltipSettings.fill : this.treemap.themeStyle.tooltipFillColor
|
|
5603
5603
|
});
|
|
5604
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5605
|
+
if (this.treemap.isVue || this.treemap.isVue3) {
|
|
5606
|
+
this.svgTooltip.controlInstance = this.treemap;
|
|
5607
|
+
}
|
|
5604
5608
|
this.svgTooltip.opacity = this.treemap.themeStyle.tooltipFillOpacity || this.svgTooltip.opacity;
|
|
5605
5609
|
this.svgTooltip.appendTo(tooltipEle);
|
|
5606
5610
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|