@syncfusion/ej2-treemap 34.2.2 → 34.2.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.
- package/dist/ej2-treemap.min.js +2 -2
- 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 +44 -7
- package/dist/es6/ej2-treemap.es2015.js.map +1 -1
- package/dist/es6/ej2-treemap.es5.js +44 -7
- 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 +1 -1
- package/src/treemap/layout/render-panel.js +11 -1
- package/src/treemap/treemap.js +15 -5
- package/src/treemap/utils/helper.js +18 -1
|
@@ -827,7 +827,24 @@ function isContainsData(source, pathName, processData, treemap) {
|
|
|
827
827
|
for (let i = 0; i < source.length; i++) {
|
|
828
828
|
path = treemap.levels[i] ? treemap.levels[i].groupPath : leaf.labelPath ? leaf.labelPath :
|
|
829
829
|
treemap.weightValuePath;
|
|
830
|
-
|
|
830
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
831
|
+
const rawValue = processData[path];
|
|
832
|
+
const isBlank = isNullOrUndefined(rawValue) || rawValue === '';
|
|
833
|
+
let data;
|
|
834
|
+
if (isBlank) {
|
|
835
|
+
if (treemap.levels && treemap.levels.length > 0) {
|
|
836
|
+
// Multi-level: match the '+ ""' coercion result (null -> 'null', undefined -> 'undefined')
|
|
837
|
+
data = isNullOrUndefined(rawValue) ? String(rawValue) : '';
|
|
838
|
+
}
|
|
839
|
+
else {
|
|
840
|
+
// Flat data: use the unique 'undefined_<weight>' suffix
|
|
841
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
842
|
+
data = 'undefined_' + processData[treemap.weightValuePath];
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
else {
|
|
846
|
+
data = rawValue.toString();
|
|
847
|
+
}
|
|
831
848
|
if (source[i] === data) {
|
|
832
849
|
name += data + (i === source.length - 1 ? '' : '#');
|
|
833
850
|
if (name === pathName) {
|
|
@@ -2395,7 +2412,17 @@ class LayoutPanel {
|
|
|
2395
2412
|
}
|
|
2396
2413
|
levelName = item['name'];
|
|
2397
2414
|
}
|
|
2398
|
-
|
|
2415
|
+
// Use nullish coalescing (??) to preserve empty string '' (blank tile for null labelPath)
|
|
2416
|
+
const formatterOutput = textFormatter(format, item['data'], this.treemap);
|
|
2417
|
+
if (!isNullOrUndefined(formatterOutput)) {
|
|
2418
|
+
renderText = formatterOutput;
|
|
2419
|
+
}
|
|
2420
|
+
else if (!isNullOrUndefined(levelName)) {
|
|
2421
|
+
renderText = levelName;
|
|
2422
|
+
}
|
|
2423
|
+
else {
|
|
2424
|
+
renderText = 'undefined';
|
|
2425
|
+
}
|
|
2399
2426
|
childItems = findChildren(item)['values'];
|
|
2400
2427
|
renderText = !isLeafItem && childItems && childItems.length > 0 && this.treemap.enableDrillDown ?
|
|
2401
2428
|
!item['isDrilled'] ? treeMap.enableRtl ? renderText + ' [+]' : '[+] ' + renderText :
|
|
@@ -3661,21 +3688,31 @@ let TreeMap = class TreeMap extends Component {
|
|
|
3661
3688
|
if (this.isHierarchicalData && child && child.length > 0) {
|
|
3662
3689
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3663
3690
|
child.forEach((currentData) => {
|
|
3664
|
-
if (currentData[
|
|
3691
|
+
if (!isNullOrUndefined(currentData[this.weightValuePath])) {
|
|
3665
3692
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3693
|
+
const labelValue = currentData[path];
|
|
3694
|
+
const isBlank = isNullOrUndefined(labelValue) || labelValue === '';
|
|
3695
|
+
const itemName = isBlank ? '' : labelValue;
|
|
3696
|
+
const orderName = isBlank ?
|
|
3697
|
+
'undefined_' + currentData[this.weightValuePath] : labelValue.toString();
|
|
3666
3698
|
data[path].push({
|
|
3667
|
-
groupIndex: 0, name:
|
|
3668
|
-
levelOrderName:
|
|
3699
|
+
groupIndex: 0, name: itemName,
|
|
3700
|
+
levelOrderName: orderName,
|
|
3669
3701
|
data: currentData, weight: currentData[this.weightValuePath]
|
|
3670
3702
|
});
|
|
3671
3703
|
}
|
|
3672
3704
|
});
|
|
3673
3705
|
}
|
|
3674
3706
|
else {
|
|
3675
|
-
if (this.dataSource[i][
|
|
3707
|
+
if (!isNullOrUndefined(this.dataSource[i][this.weightValuePath])) {
|
|
3676
3708
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3709
|
+
const labelValue = this.dataSource[i][path];
|
|
3710
|
+
const isBlank = isNullOrUndefined(labelValue) || labelValue === '';
|
|
3711
|
+
const itemName = isBlank ? '' : labelValue;
|
|
3712
|
+
const orderName = isBlank ?
|
|
3713
|
+
'undefined_' + this.dataSource[i][this.weightValuePath] : labelValue.toString();
|
|
3677
3714
|
data[path].push({
|
|
3678
|
-
groupIndex: 0, name:
|
|
3715
|
+
groupIndex: 0, name: itemName, levelOrderName: orderName, data: this.dataSource[i],
|
|
3679
3716
|
weight: this.dataSource[i][this.weightValuePath]
|
|
3680
3717
|
});
|
|
3681
3718
|
}
|