@syncfusion/ej2-treemap 31.2.12 → 32.1.23
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/README.md +1 -1
- package/aceconfig.js +17 -0
- 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 +26 -7
- package/dist/es6/ej2-treemap.es2015.js.map +1 -1
- package/dist/es6/ej2-treemap.es5.js +27 -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 +7 -7
- package/src/treemap/layout/render-panel.js +14 -2
- package/src/treemap/utils/helper.d.ts +2 -1
- package/src/treemap/utils/helper.js +13 -5
|
@@ -1048,24 +1048,32 @@ function convertElement(element, labelId, data) {
|
|
|
1048
1048
|
* @param {Size} labelSize - Specifies the label size.
|
|
1049
1049
|
* @param {string} type - Specifies the type.
|
|
1050
1050
|
* @param {TreeMap} treemap - Specifies the treemap instance.
|
|
1051
|
+
* @param {number} textCount - Specifies the number of text.
|
|
1051
1052
|
* @returns {Location} - Returns the text location.
|
|
1052
1053
|
*/
|
|
1053
|
-
function findLabelLocation(rect, position, labelSize, type, treemap) {
|
|
1054
|
+
function findLabelLocation(rect, position, labelSize, type, treemap, textCount) {
|
|
1055
|
+
if (textCount === void 0) { textCount = 0; }
|
|
1054
1056
|
var location = new Location(0, 0);
|
|
1055
1057
|
var padding = 5;
|
|
1056
1058
|
var paddings = 2;
|
|
1057
1059
|
var x = (type === 'Template') ? treemap.areaRect.x : 0;
|
|
1058
1060
|
var y = (type === 'Template') ? treemap.areaRect.y : 0;
|
|
1061
|
+
var isTopLabel = (treemap.leafItemSettings.labelPosition === 'TopCenter' ||
|
|
1062
|
+
treemap.leafItemSettings.labelPosition === 'TopLeft' ||
|
|
1063
|
+
treemap.leafItemSettings.labelPosition === 'TopRight');
|
|
1064
|
+
var textHeight = (textCount > 1 && !isTopLabel &&
|
|
1065
|
+
(treemap.renderDirection === 'BottomLeftTopRight' ||
|
|
1066
|
+
treemap.renderDirection === 'BottomRightTopLeft')) ? (labelSize.height * textCount) : labelSize.height;
|
|
1059
1067
|
location.x = (Math.abs(x - ((position.indexOf('Left') > -1) ? rect.x + padding : !(position.indexOf('Right') > -1) ?
|
|
1060
1068
|
rect.x + ((rect.width / 2) - (labelSize.width / 2)) : (rect.x + rect.width) - labelSize.width))) - paddings;
|
|
1061
1069
|
if (treemap.enableDrillDown && (treemap.renderDirection === 'BottomLeftTopRight'
|
|
1062
1070
|
|| treemap.renderDirection === 'BottomRightTopLeft')) {
|
|
1063
|
-
location.y = Math.abs((rect.y + rect.height) -
|
|
1071
|
+
location.y = Math.abs((rect.y + rect.height) - textHeight + padding);
|
|
1064
1072
|
}
|
|
1065
1073
|
else {
|
|
1066
|
-
location.y = Math.abs(y - ((position.indexOf('Top') > -1) ? (type === 'Template' ? rect.y : rect.y +
|
|
1067
|
-
!(position.indexOf('Bottom') > -1) ? type === 'Template' ? (rect.y + ((rect.height / 2) - (
|
|
1068
|
-
(rect.y + (rect.height / 2) +
|
|
1074
|
+
location.y = Math.abs(y - ((position.indexOf('Top') > -1) ? (type === 'Template' ? rect.y : rect.y + textHeight) :
|
|
1075
|
+
!(position.indexOf('Bottom') > -1) ? type === 'Template' ? (rect.y + ((rect.height / 2) - (textHeight / 2))) :
|
|
1076
|
+
(rect.y + (rect.height / 2) + textHeight / 4) : (rect.y + rect.height) - textHeight));
|
|
1069
1077
|
}
|
|
1070
1078
|
return location;
|
|
1071
1079
|
}
|
|
@@ -2572,7 +2580,18 @@ var LayoutPanel = /** @__PURE__ @class */ (function () {
|
|
|
2572
2580
|
var textName;
|
|
2573
2581
|
textCollection = ((text.indexOf('<br>')) !== -1) ? text.split('<br>') : null;
|
|
2574
2582
|
customText = this.labelInterSectAction(rect, text, textStyle, interSectAction);
|
|
2575
|
-
|
|
2583
|
+
var largerText = '';
|
|
2584
|
+
var largerTextWidth = 0;
|
|
2585
|
+
if (!isNullOrUndefined(textCollection) && textCollection.length > 0) {
|
|
2586
|
+
for (var i = 0; i < textCollection.length; i++) {
|
|
2587
|
+
var currentTextWidth = measureText(textCollection[i], textStyle).width;
|
|
2588
|
+
if (currentTextWidth > largerTextWidth) {
|
|
2589
|
+
largerTextWidth = currentTextWidth;
|
|
2590
|
+
largerText = textCollection[i];
|
|
2591
|
+
}
|
|
2592
|
+
}
|
|
2593
|
+
}
|
|
2594
|
+
textSize = measureText(textCollection && largerText || customText[0], textStyle);
|
|
2576
2595
|
if (this.treemap.enableRtl) {
|
|
2577
2596
|
var labelSize = measureText(text, textStyle);
|
|
2578
2597
|
var drillSymbolCount = text.search('[+]') || text.search('[-]');
|
|
@@ -2583,7 +2602,8 @@ var LayoutPanel = /** @__PURE__ @class */ (function () {
|
|
|
2583
2602
|
customText['0'] = textTrim(rect.width - drillSymbolSize.width - padding, customText[0], textStyle) + label;
|
|
2584
2603
|
}
|
|
2585
2604
|
}
|
|
2586
|
-
var
|
|
2605
|
+
var textCount = (!isNullOrUndefined(textCollection) && textCollection.length > 1) ? textCollection.length : 0;
|
|
2606
|
+
var textLocation = findLabelLocation(rect, position, textSize, 'Text', this.treemap, textCount);
|
|
2587
2607
|
if (!isNullOrUndefined(textCollection)) {
|
|
2588
2608
|
var collection = [];
|
|
2589
2609
|
var texts = null;
|