@syncfusion/ej2-treemap 20.3.47 → 20.3.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 +6 -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 +57 -47
- package/dist/es6/ej2-treemap.es2015.js.map +1 -1
- package/dist/es6/ej2-treemap.es5.js +58 -49
- 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 +12 -12
- package/src/treemap/layout/legend.js +7 -4
- package/src/treemap/treemap.js +48 -44
- package/src/treemap/user-interaction/tooltip.js +3 -1
|
@@ -3467,28 +3467,30 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3467
3467
|
*/
|
|
3468
3468
|
TreeMap.prototype.resizeOnTreeMap = function (e) {
|
|
3469
3469
|
var _this = this;
|
|
3470
|
-
this.
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
this.
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
_this.
|
|
3490
|
-
|
|
3491
|
-
|
|
3470
|
+
if (!this.isDestroyed) {
|
|
3471
|
+
this.isResize = true;
|
|
3472
|
+
var args_1 = {
|
|
3473
|
+
name: resize,
|
|
3474
|
+
cancel: false,
|
|
3475
|
+
previousSize: this.availableSize,
|
|
3476
|
+
currentSize: new Size(0, 0),
|
|
3477
|
+
treemap: this
|
|
3478
|
+
};
|
|
3479
|
+
if (this.resizeTo) {
|
|
3480
|
+
clearTimeout(this.resizeTo);
|
|
3481
|
+
}
|
|
3482
|
+
if (!isNullOrUndefined(this.element) && this.element.classList.contains('e-treemap')) {
|
|
3483
|
+
this.resizeTo = setTimeout(function () {
|
|
3484
|
+
_this.unWireEVents();
|
|
3485
|
+
_this.createSvg();
|
|
3486
|
+
_this.refreshing = true;
|
|
3487
|
+
_this.wireEVents();
|
|
3488
|
+
args_1.currentSize = _this.availableSize;
|
|
3489
|
+
_this.trigger(resize, args_1, function (observedArgs) {
|
|
3490
|
+
_this.render();
|
|
3491
|
+
});
|
|
3492
|
+
}, 500);
|
|
3493
|
+
}
|
|
3492
3494
|
}
|
|
3493
3495
|
};
|
|
3494
3496
|
/**
|
|
@@ -3922,29 +3924,31 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3922
3924
|
* @private
|
|
3923
3925
|
*/
|
|
3924
3926
|
TreeMap.prototype.onPropertyChanged = function (newProp, oldProp) {
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
var
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3927
|
+
if (!this.isDestroyed) {
|
|
3928
|
+
var render = false;
|
|
3929
|
+
for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
|
|
3930
|
+
var prop = _a[_i];
|
|
3931
|
+
switch (prop) {
|
|
3932
|
+
case 'background':
|
|
3933
|
+
this.renderBorder();
|
|
3934
|
+
break;
|
|
3935
|
+
case 'height':
|
|
3936
|
+
case 'width':
|
|
3937
|
+
case 'layoutType':
|
|
3938
|
+
case 'levels':
|
|
3939
|
+
case 'drillDownView':
|
|
3940
|
+
case 'renderDirection':
|
|
3941
|
+
case 'leafItemSettings':
|
|
3942
|
+
case 'legendSettings':
|
|
3943
|
+
case 'dataSource':
|
|
3944
|
+
render = true;
|
|
3945
|
+
break;
|
|
3946
|
+
}
|
|
3947
|
+
}
|
|
3948
|
+
if (render) {
|
|
3949
|
+
this.createSvg();
|
|
3950
|
+
this.renderElements();
|
|
3943
3951
|
}
|
|
3944
|
-
}
|
|
3945
|
-
if (render) {
|
|
3946
|
-
this.createSvg();
|
|
3947
|
-
this.renderElements();
|
|
3948
3952
|
}
|
|
3949
3953
|
};
|
|
3950
3954
|
/**
|
|
@@ -4217,6 +4221,9 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
|
|
|
4217
4221
|
this.findPaletteLegendItems(LevelsData.levelsData[0], 'Parent');
|
|
4218
4222
|
}
|
|
4219
4223
|
if (this.legendCollections.length > 0) {
|
|
4224
|
+
this.legendCollections.sort(function (firstItem, nextItem) { return (firstItem.levelIndex > nextItem.levelIndex) ? 1 : (firstItem.levelIndex < nextItem.levelIndex) ? -1 : 0; });
|
|
4225
|
+
this.legendCollections.sort(function (firstItem, nextItem) { return (firstItem.groupIndex > nextItem.groupIndex) ? 1 : (firstItem.groupIndex < nextItem.groupIndex) ? -1 : 0; });
|
|
4226
|
+
this.legendCollections.sort(function (firstItem, nextItem) { return (firstItem.leafIndex > nextItem.leafIndex) ? 1 : (firstItem.leafIndex < nextItem.leafIndex) ? -1 : 0; });
|
|
4220
4227
|
var defaultSize = 25;
|
|
4221
4228
|
var textPadding = 10;
|
|
4222
4229
|
var position = legend.position;
|
|
@@ -4552,8 +4559,8 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
|
|
|
4552
4559
|
groupIndex = data[i]['groupIndex'];
|
|
4553
4560
|
isLeafItem = (this.treemap.levels.length === 0 || groupIndex === this.treemap.levels.length);
|
|
4554
4561
|
colorMapping = isLeafItem ? leaf.colorMapping : levels[groupIndex].colorMapping;
|
|
4555
|
-
for (var
|
|
4556
|
-
var colorMap$$1 =
|
|
4562
|
+
for (var j = 0; j < colorMapping.length; j++) {
|
|
4563
|
+
var colorMap$$1 = colorMapping[j];
|
|
4557
4564
|
gradientElement = null;
|
|
4558
4565
|
rangeValue = Number(currentData[this.treemap.rangeColorValuePath]);
|
|
4559
4566
|
equalValue = currentData[this.treemap.equalColorValuePath];
|
|
@@ -4614,8 +4621,8 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
|
|
|
4614
4621
|
fill = ((Object.prototype.toString.call(colorMap$$1.color) === '[object Array]')) && isNullOrUndefined(gradientElement)
|
|
4615
4622
|
&& isNullOrUndefined(colorMap$$1.value) ? this.legendGradientColor(colorMap$$1, legendIndex) : fill;
|
|
4616
4623
|
this.legendCollections.push({
|
|
4617
|
-
actualValue: actualValue,
|
|
4618
|
-
legendName: legendText, legendFill: fill, legendData: [],
|
|
4624
|
+
actualValue: actualValue, levelIndex: !isLeafItem ? j : -1, leafIndex: isLeafItem ? j : -1,
|
|
4625
|
+
legendName: legendText, legendFill: fill, legendData: [], groupIndex: !isLeafItem ? groupIndex : -1,
|
|
4619
4626
|
gradientElement: !isNullOrUndefined(gradientElement) ? gradientElement : isNullOrUndefined(colorMap$$1.value)
|
|
4620
4627
|
? this.legendLinearGradient : null, name: data[i]['name'],
|
|
4621
4628
|
opacity: this.treemap.legendSettings.opacity, borderColor: this.treemap.legendSettings.border.color,
|
|
@@ -5727,7 +5734,9 @@ var TreeMapTooltip = /** @__PURE__ @class */ (function () {
|
|
|
5727
5734
|
toolTipHeader = item['name'];
|
|
5728
5735
|
value = item['weight'];
|
|
5729
5736
|
toolTipData = item['data'];
|
|
5730
|
-
|
|
5737
|
+
if (!isNullOrUndefined(item['options'])) {
|
|
5738
|
+
markerFill = item['options']['fill'];
|
|
5739
|
+
}
|
|
5731
5740
|
if (this.treemap.enableRtl) {
|
|
5732
5741
|
tooltipContent = [textFormatter(this.tooltipSettings.format, toolTipData, this.treemap) ||
|
|
5733
5742
|
formatValue(value, this.treemap) + ' : ' + this.treemap.weightValuePath.toString()];
|