@syncfusion/ej2-treemap 20.4.42 → 21.1.35
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 +122 -83
- package/dist/es6/ej2-treemap.es2015.js.map +1 -1
- package/dist/es6/ej2-treemap.es5.js +122 -83
- 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.d.ts +18 -1
- package/src/treemap/layout/legend.js +35 -18
- package/src/treemap/layout/render-panel.js +9 -10
- package/src/treemap/model/base-model.d.ts +97 -97
- package/src/treemap/model/base.d.ts +110 -113
- package/src/treemap/model/base.js +13 -13
- package/src/treemap/model/constants.d.ts +1 -1
- package/src/treemap/model/constants.js +1 -1
- package/src/treemap/model/interface.d.ts +41 -38
- package/src/treemap/model/pdf-export.d.ts +1 -1
- package/src/treemap/model/pdf-export.js +1 -1
- package/src/treemap/treemap-model.d.ts +46 -20
- package/src/treemap/treemap.d.ts +73 -28
- package/src/treemap/treemap.js +47 -33
- package/src/treemap/user-interaction/highlight-selection.d.ts +2 -0
- package/src/treemap/user-interaction/highlight-selection.js +2 -0
- package/src/treemap/user-interaction/tooltip.d.ts +2 -0
- package/src/treemap/user-interaction/tooltip.js +7 -5
- package/src/treemap/utils/enum.d.ts +74 -49
- package/src/treemap/utils/helper.d.ts +15 -12
- package/src/treemap/utils/helper.js +8 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ajax, Browser, ChildProperty, Collection, Complex, Component, Event, EventHandler, Internationalization, NotifyPropertyChanges, Property, compile, createElement, extend, isNullOrUndefined, merge, print, remove } from '@syncfusion/ej2-base';
|
|
1
|
+
import { Ajax, Browser, ChildProperty, Collection, Complex, Component, Event, EventHandler, Internationalization, NotifyPropertyChanges, Property, SanitizeHtmlHelper, compile, createElement, extend, isNullOrUndefined, merge, print, remove } from '@syncfusion/ej2-base';
|
|
2
2
|
import { SvgRenderer, Tooltip } from '@syncfusion/ej2-svg-base';
|
|
3
3
|
import { DataManager, Query } from '@syncfusion/ej2-data';
|
|
4
4
|
import { PdfBitmap, PdfDocument, PdfPageOrientation } from '@syncfusion/ej2-pdf-export';
|
|
@@ -115,7 +115,7 @@ var legendRendering = 'legendRendering';
|
|
|
115
115
|
*/
|
|
116
116
|
var resize = 'resize';
|
|
117
117
|
/**
|
|
118
|
-
* Define the font family in treemap
|
|
118
|
+
* Define the font family in treemap.
|
|
119
119
|
*
|
|
120
120
|
* @private
|
|
121
121
|
*/
|
|
@@ -144,7 +144,7 @@ var __decorate$1 = (undefined && undefined.__decorate) || function (decorators,
|
|
|
144
144
|
* Maps base doc
|
|
145
145
|
*/
|
|
146
146
|
/**
|
|
147
|
-
* Sets and gets the options for customizing the color and width of the border in treemap
|
|
147
|
+
* Sets and gets the options for customizing the color and width of the border in treemap.
|
|
148
148
|
*/
|
|
149
149
|
var Border = /** @__PURE__ @class */ (function (_super) {
|
|
150
150
|
__extends$1(Border, _super);
|
|
@@ -160,7 +160,7 @@ var Border = /** @__PURE__ @class */ (function (_super) {
|
|
|
160
160
|
return Border;
|
|
161
161
|
}(ChildProperty));
|
|
162
162
|
/**
|
|
163
|
-
* Sets and gets the margin for the treemap
|
|
163
|
+
* Sets and gets the margin for the treemap.
|
|
164
164
|
*/
|
|
165
165
|
var Margin = /** @__PURE__ @class */ (function (_super) {
|
|
166
166
|
__extends$1(Margin, _super);
|
|
@@ -182,7 +182,7 @@ var Margin = /** @__PURE__ @class */ (function (_super) {
|
|
|
182
182
|
return Margin;
|
|
183
183
|
}(ChildProperty));
|
|
184
184
|
/**
|
|
185
|
-
* Sets and gets the options to customize the style of the text contents in the treemap
|
|
185
|
+
* Sets and gets the options to customize the style of the text contents in the treemap.
|
|
186
186
|
*/
|
|
187
187
|
var Font = /** @__PURE__ @class */ (function (_super) {
|
|
188
188
|
__extends$1(Font, _super);
|
|
@@ -210,7 +210,7 @@ var Font = /** @__PURE__ @class */ (function (_super) {
|
|
|
210
210
|
return Font;
|
|
211
211
|
}(ChildProperty));
|
|
212
212
|
/**
|
|
213
|
-
* Sets and gets the options for customizing the
|
|
213
|
+
* Sets and gets the options for customizing the title of the treemap.
|
|
214
214
|
*/
|
|
215
215
|
var CommonTitleSettings = /** @__PURE__ @class */ (function (_super) {
|
|
216
216
|
__extends$1(CommonTitleSettings, _super);
|
|
@@ -226,7 +226,7 @@ var CommonTitleSettings = /** @__PURE__ @class */ (function (_super) {
|
|
|
226
226
|
return CommonTitleSettings;
|
|
227
227
|
}(ChildProperty));
|
|
228
228
|
/**
|
|
229
|
-
* Sets and gets the options for customizing the subtitle of the treemap
|
|
229
|
+
* Sets and gets the options for customizing the subtitle of the treemap.
|
|
230
230
|
*/
|
|
231
231
|
var SubTitleSettings = /** @__PURE__ @class */ (function (_super) {
|
|
232
232
|
__extends$1(SubTitleSettings, _super);
|
|
@@ -242,7 +242,7 @@ var SubTitleSettings = /** @__PURE__ @class */ (function (_super) {
|
|
|
242
242
|
return SubTitleSettings;
|
|
243
243
|
}(CommonTitleSettings));
|
|
244
244
|
/**
|
|
245
|
-
* Sets and gets the options for customizing the title of the treemap
|
|
245
|
+
* Sets and gets the options for customizing the title of the treemap.
|
|
246
246
|
*/
|
|
247
247
|
var TitleSettings = /** @__PURE__ @class */ (function (_super) {
|
|
248
248
|
__extends$1(TitleSettings, _super);
|
|
@@ -261,7 +261,7 @@ var TitleSettings = /** @__PURE__ @class */ (function (_super) {
|
|
|
261
261
|
return TitleSettings;
|
|
262
262
|
}(CommonTitleSettings));
|
|
263
263
|
/**
|
|
264
|
-
* Sets and gets the options to customize the color-mapping in treemap
|
|
264
|
+
* Sets and gets the options to customize the color-mapping in treemap.
|
|
265
265
|
*/
|
|
266
266
|
var ColorMapping = /** @__PURE__ @class */ (function (_super) {
|
|
267
267
|
__extends$1(ColorMapping, _super);
|
|
@@ -295,7 +295,7 @@ var ColorMapping = /** @__PURE__ @class */ (function (_super) {
|
|
|
295
295
|
return ColorMapping;
|
|
296
296
|
}(ChildProperty));
|
|
297
297
|
/**
|
|
298
|
-
* Sets and gets the options for customizing the legend of the treemap
|
|
298
|
+
* Sets and gets the options for customizing the legend of the treemap.
|
|
299
299
|
*/
|
|
300
300
|
var LegendSettings = /** @__PURE__ @class */ (function (_super) {
|
|
301
301
|
__extends$1(LegendSettings, _super);
|
|
@@ -386,7 +386,7 @@ var LegendSettings = /** @__PURE__ @class */ (function (_super) {
|
|
|
386
386
|
return LegendSettings;
|
|
387
387
|
}(ChildProperty));
|
|
388
388
|
/**
|
|
389
|
-
* Sets and gets the settings for drill to visualize the treemap rendered in the initial state.
|
|
389
|
+
* Sets and gets the settings for drill down to visualize the treemap rendered in the initial state.
|
|
390
390
|
*/
|
|
391
391
|
var InitialDrillSettings = /** @__PURE__ @class */ (function (_super) {
|
|
392
392
|
__extends$1(InitialDrillSettings, _super);
|
|
@@ -402,7 +402,7 @@ var InitialDrillSettings = /** @__PURE__ @class */ (function (_super) {
|
|
|
402
402
|
return InitialDrillSettings;
|
|
403
403
|
}(ChildProperty));
|
|
404
404
|
/**
|
|
405
|
-
* Sets and gets the options for customizing the leaf item of the treemap
|
|
405
|
+
* Sets and gets the options for customizing the leaf item of the treemap.
|
|
406
406
|
*/
|
|
407
407
|
var LeafItemSettings = /** @__PURE__ @class */ (function (_super) {
|
|
408
408
|
__extends$1(LeafItemSettings, _super);
|
|
@@ -457,7 +457,7 @@ var LeafItemSettings = /** @__PURE__ @class */ (function (_super) {
|
|
|
457
457
|
return LeafItemSettings;
|
|
458
458
|
}(ChildProperty));
|
|
459
459
|
/**
|
|
460
|
-
* Sets and gets the options for customizing the tooltip of the treemap
|
|
460
|
+
* Sets and gets the options for customizing the tooltip of the treemap.
|
|
461
461
|
*/
|
|
462
462
|
var TooltipSettings = /** @__PURE__ @class */ (function (_super) {
|
|
463
463
|
__extends$1(TooltipSettings, _super);
|
|
@@ -491,7 +491,7 @@ var TooltipSettings = /** @__PURE__ @class */ (function (_super) {
|
|
|
491
491
|
return TooltipSettings;
|
|
492
492
|
}(ChildProperty));
|
|
493
493
|
/**
|
|
494
|
-
* Sets and gets the options for customizing the selection of the leaf items in treemap
|
|
494
|
+
* Sets and gets the options for customizing the selection of the leaf items in treemap.
|
|
495
495
|
*/
|
|
496
496
|
var SelectionSettings = /** @__PURE__ @class */ (function (_super) {
|
|
497
497
|
__extends$1(SelectionSettings, _super);
|
|
@@ -542,7 +542,7 @@ var HighlightSettings = /** @__PURE__ @class */ (function (_super) {
|
|
|
542
542
|
return HighlightSettings;
|
|
543
543
|
}(ChildProperty));
|
|
544
544
|
/**
|
|
545
|
-
* Sets and gets the options for customizing the
|
|
545
|
+
* Sets and gets the options for customizing the level leaf items of the treemap.
|
|
546
546
|
*/
|
|
547
547
|
var LevelSettings = /** @__PURE__ @class */ (function (_super) {
|
|
548
548
|
__extends$1(LevelSettings, _super);
|
|
@@ -598,7 +598,7 @@ var LevelSettings = /** @__PURE__ @class */ (function (_super) {
|
|
|
598
598
|
}(ChildProperty));
|
|
599
599
|
|
|
600
600
|
/**
|
|
601
|
-
*
|
|
601
|
+
* Specifies the size parameters.
|
|
602
602
|
*/
|
|
603
603
|
var Size = /** @__PURE__ @class */ (function () {
|
|
604
604
|
function Size(width, height) {
|
|
@@ -679,7 +679,7 @@ function measureText(text, font) {
|
|
|
679
679
|
measureObject = createElement('text', { id: 'treeMapMeasureText' });
|
|
680
680
|
document.body.appendChild(measureObject);
|
|
681
681
|
}
|
|
682
|
-
measureObject.innerHTML = text;
|
|
682
|
+
measureObject.innerHTML = SanitizeHtmlHelper.sanitize(text);
|
|
683
683
|
measureObject.style.position = 'absolute';
|
|
684
684
|
measureObject.style.fontSize = font.size;
|
|
685
685
|
measureObject.style.fontWeight = font.fontWeight;
|
|
@@ -742,7 +742,7 @@ function textTrim(maxWidth, text, font) {
|
|
|
742
742
|
return label;
|
|
743
743
|
}
|
|
744
744
|
/**
|
|
745
|
-
*
|
|
745
|
+
* Specifies the location parameters.
|
|
746
746
|
*/
|
|
747
747
|
var Location = /** @__PURE__ @class */ (function () {
|
|
748
748
|
function Location(x, y) {
|
|
@@ -759,6 +759,7 @@ var Location = /** @__PURE__ @class */ (function () {
|
|
|
759
759
|
* @param {Size} textSize - Specifies the size of the text.
|
|
760
760
|
* @param {type} type - Specifies whether the provided text is title or subtitle.
|
|
761
761
|
* @returns {Location} - Returns the location of text.
|
|
762
|
+
* @private
|
|
762
763
|
*/
|
|
763
764
|
function findPosition(location, alignment, textSize, type) {
|
|
764
765
|
var x;
|
|
@@ -1442,6 +1443,7 @@ function textWrap(maxWidth, label, font) {
|
|
|
1442
1443
|
* @param {string} text - Specifies the text.
|
|
1443
1444
|
* @param {FontModel} font - Specifies the font.
|
|
1444
1445
|
* @returns {string} - Returns the hidden text.
|
|
1446
|
+
* @private
|
|
1445
1447
|
*/
|
|
1446
1448
|
function hide(maxWidth, maxHeight, text, font) {
|
|
1447
1449
|
var hideText = text;
|
|
@@ -1764,7 +1766,7 @@ function isParentItem(data, item) {
|
|
|
1764
1766
|
return isParentItem;
|
|
1765
1767
|
}
|
|
1766
1768
|
/**
|
|
1767
|
-
* Ajax
|
|
1769
|
+
* Specifies the data to be received through Ajax request for treemap.
|
|
1768
1770
|
*/
|
|
1769
1771
|
var TreeMapAjax = /** @__PURE__ @class */ (function () {
|
|
1770
1772
|
function TreeMapAjax(options, type, async, contentType, sendData) {
|
|
@@ -1885,6 +1887,7 @@ function pushCollection(collection, index, number, legendElement, shapeElement,
|
|
|
1885
1887
|
* @param {string} url - Specifies the url
|
|
1886
1888
|
* @param {boolean} isDownload - Specifies the boolean value
|
|
1887
1889
|
* @returns {void}
|
|
1890
|
+
* @private
|
|
1888
1891
|
*/
|
|
1889
1892
|
function triggerDownload(fileName, type, url, isDownload) {
|
|
1890
1893
|
createElement('a', {
|
|
@@ -1919,12 +1922,12 @@ var LayoutPanel = /** @__PURE__ @class */ (function () {
|
|
|
1919
1922
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1920
1923
|
var data;
|
|
1921
1924
|
var totalRect;
|
|
1922
|
-
if (
|
|
1925
|
+
if (this.treemap.treemapLevelData.levelsData && this.treemap.treemapLevelData.levelsData.length > 0) {
|
|
1923
1926
|
data = (!isNullOrUndefined(this.treemap.initialDrillDown.groupIndex) &&
|
|
1924
1927
|
!isNullOrUndefined(this.treemap.initialDrillDown.groupName)) &&
|
|
1925
1928
|
(isNullOrUndefined(this.treemap.drilledItems) ? isNullOrUndefined(this.treemap.drilledItems)
|
|
1926
1929
|
: this.treemap.drilledItems.length === 0) ?
|
|
1927
|
-
this.getDrilldownData(
|
|
1930
|
+
this.getDrilldownData(this.treemap.treemapLevelData.levelsData[0], [])[0] : this.treemap.treemapLevelData.levelsData[0];
|
|
1928
1931
|
totalRect = extend({}, this.treemap.areaRect, totalRect, false);
|
|
1929
1932
|
if (!isNullOrUndefined(this.treemap.treeMapLegendModule) && !isNullOrUndefined(this.treemap.totalRect)) {
|
|
1930
1933
|
if (this.treemap.legendSettings.position !== 'Float') {
|
|
@@ -1943,7 +1946,7 @@ var LayoutPanel = /** @__PURE__ @class */ (function () {
|
|
|
1943
1946
|
if (!isNullOrUndefined(this.treemap.initialDrillDown.groupIndex) && !this.treemap.enableBreadcrumb) {
|
|
1944
1947
|
this.treemap.currentLevel = this.treemap.drilledItems[count]['data']['groupIndex'];
|
|
1945
1948
|
}
|
|
1946
|
-
this.calculateLayoutItems(y ||
|
|
1949
|
+
this.calculateLayoutItems(y || this.treemap.treemapLevelData.levelsData[0], totalRect);
|
|
1947
1950
|
this.renderLayoutItems();
|
|
1948
1951
|
}
|
|
1949
1952
|
else {
|
|
@@ -1952,7 +1955,7 @@ var LayoutPanel = /** @__PURE__ @class */ (function () {
|
|
|
1952
1955
|
: this.treemap.drilledItems.length === 0)) {
|
|
1953
1956
|
this.treemap.currentLevel = this.treemap.initialDrillDown.groupIndex;
|
|
1954
1957
|
}
|
|
1955
|
-
this.calculateLayoutItems(data ||
|
|
1958
|
+
this.calculateLayoutItems(data || this.treemap.treemapLevelData.levelsData[0], totalRect);
|
|
1956
1959
|
this.renderLayoutItems();
|
|
1957
1960
|
}
|
|
1958
1961
|
}
|
|
@@ -2537,18 +2540,18 @@ var LayoutPanel = /** @__PURE__ @class */ (function () {
|
|
|
2537
2540
|
var treemap = this.treemap;
|
|
2538
2541
|
var itemFill = isLeafItem ? treemap.leafItemSettings.fill : treemap.levels[item['groupIndex']].fill;
|
|
2539
2542
|
var itemOpacity = isLeafItem ? treemap.leafItemSettings.opacity : treemap.levels[item['groupIndex']].opacity;
|
|
2540
|
-
if (!isNullOrUndefined(
|
|
2541
|
-
if (
|
|
2542
|
-
|
|
2543
|
+
if (!isNullOrUndefined(treemap.treemapLevelData.defaultLevelsData)) {
|
|
2544
|
+
if (treemap.treemapLevelData.defaultLevelsData.length > 0) {
|
|
2545
|
+
treemap.treemapLevelData.levelsData = treemap.treemapLevelData.defaultLevelsData;
|
|
2543
2546
|
}
|
|
2544
2547
|
}
|
|
2545
2548
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2546
|
-
var parentData = findChildren(
|
|
2549
|
+
var parentData = findChildren(treemap.treemapLevelData.levelsData[0])['values'];
|
|
2547
2550
|
var colorMapping = isLeafItem ? treemap.leafItemSettings.colorMapping :
|
|
2548
2551
|
treemap.levels[item['groupIndex']].colorMapping;
|
|
2549
2552
|
if (colorMapping.length > 0) {
|
|
2550
2553
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2551
|
-
var option = colorMap(colorMapping, item['data'][
|
|
2554
|
+
var option = colorMap(colorMapping, item['data'][treemap.equalColorValuePath], item['data'][treemap.rangeColorValuePath]);
|
|
2552
2555
|
itemFill = !isNullOrUndefined(option['fill']) ? option['fill'] : treemap.leafItemSettings.fill;
|
|
2553
2556
|
itemOpacity = option['opacity'];
|
|
2554
2557
|
}
|
|
@@ -3042,7 +3045,7 @@ var PdfExport = /** @__PURE__ @class */ (function () {
|
|
|
3042
3045
|
* @param {TreeMap} treeMap - Specifies the treemap instance.
|
|
3043
3046
|
* @param {ExportType} type - Specifies the type of the document.
|
|
3044
3047
|
* @param {string} fileName - Specifies the name of the document.
|
|
3045
|
-
* @param {PdfPageOrientation} orientation - Specifies the orientation of the PDF document to export the
|
|
3048
|
+
* @param {PdfPageOrientation} orientation - Specifies the orientation of the PDF document to export the treemap.
|
|
3046
3049
|
* @param {boolean} allowDownload - Specifies whether to download the document or not.
|
|
3047
3050
|
* @returns {Promise} - Returns the string.
|
|
3048
3051
|
* @private
|
|
@@ -3128,7 +3131,7 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
|
|
|
3128
3131
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3129
3132
|
};
|
|
3130
3133
|
/**
|
|
3131
|
-
* Represents the treemap
|
|
3134
|
+
* Represents the treemap control. It is used to visualize both hierarchical and flat data.
|
|
3132
3135
|
* ```html
|
|
3133
3136
|
* <div id="container"/>
|
|
3134
3137
|
* <script>
|
|
@@ -3140,7 +3143,7 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
|
|
|
3140
3143
|
var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
3141
3144
|
__extends(TreeMap, _super);
|
|
3142
3145
|
/**
|
|
3143
|
-
* Constructor for TreeMap
|
|
3146
|
+
* Constructor for TreeMap.
|
|
3144
3147
|
*
|
|
3145
3148
|
* @param {TreeMapModel} options - Specifies the treemap instance.
|
|
3146
3149
|
* @param {string | HTMLElement} element - Specifies the treemap element.
|
|
@@ -3178,16 +3181,17 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3178
3181
|
this.renderElements();
|
|
3179
3182
|
};
|
|
3180
3183
|
TreeMap.prototype.renderElements = function () {
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
+
this.treemapLevelData = new LevelsData();
|
|
3185
|
+
this.treemapLevelData.levelsData = null;
|
|
3186
|
+
this.treemapLevelData.defaultLevelsData = null;
|
|
3187
|
+
this.treemapLevelData.hierarchyData = null;
|
|
3184
3188
|
this.createSecondaryElement();
|
|
3185
3189
|
this.addTabIndex();
|
|
3186
3190
|
this.themeStyle = getThemeStyle(this.theme);
|
|
3187
3191
|
this.renderBorder();
|
|
3188
3192
|
this.renderTitle(this.titleSettings, 'title', null, null);
|
|
3189
|
-
if (!isNullOrUndefined(
|
|
3190
|
-
|
|
3193
|
+
if (!isNullOrUndefined(this.treemapLevelData.levelsData)) {
|
|
3194
|
+
this.treemapLevelData.defaultLevelsData = this.treemapLevelData.levelsData;
|
|
3191
3195
|
}
|
|
3192
3196
|
this.processDataManager();
|
|
3193
3197
|
};
|
|
@@ -3354,7 +3358,7 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3354
3358
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3355
3359
|
this.dataSource = this.dataSource;
|
|
3356
3360
|
if (!isNullOrUndefined(this.dataSource) && this.dataSource.length > 0 && this.weightValuePath) {
|
|
3357
|
-
|
|
3361
|
+
this.treemapLevelData.levelsData = [];
|
|
3358
3362
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3359
3363
|
this.dataSource.map(function (data) {
|
|
3360
3364
|
data[_this.weightValuePath] = (data[_this.weightValuePath]) ? data[_this.weightValuePath].toString() :
|
|
@@ -3394,28 +3398,28 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3394
3398
|
}
|
|
3395
3399
|
}
|
|
3396
3400
|
}
|
|
3397
|
-
|
|
3401
|
+
this.treemapLevelData.levelsData.push(data_1);
|
|
3398
3402
|
}
|
|
3399
3403
|
else {
|
|
3400
3404
|
if (this.isHierarchicalData) {
|
|
3401
|
-
|
|
3405
|
+
this.treemapLevelData.hierarchyData = [];
|
|
3402
3406
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3403
|
-
|
|
3404
|
-
for (var i = 0; i <
|
|
3405
|
-
this.processHierarchicalData(
|
|
3407
|
+
this.treemapLevelData.hierarchyData = extend([], this.dataSource, this.treemapLevelData.hierarchyData, true);
|
|
3408
|
+
for (var i = 0; i < this.treemapLevelData.hierarchyData.length; i++) {
|
|
3409
|
+
this.processHierarchicalData(this.treemapLevelData.hierarchyData[i], i);
|
|
3406
3410
|
}
|
|
3407
|
-
|
|
3411
|
+
this.treemapLevelData.levelsData = this.treemapLevelData.hierarchyData;
|
|
3408
3412
|
}
|
|
3409
3413
|
else {
|
|
3410
3414
|
this.processFlatJsonData();
|
|
3411
|
-
if (
|
|
3412
|
-
this.reOrderLevelData(
|
|
3415
|
+
if (this.treemapLevelData.levelsData.length > 1) {
|
|
3416
|
+
this.reOrderLevelData(this.treemapLevelData.levelsData.length - 1);
|
|
3413
3417
|
}
|
|
3414
3418
|
}
|
|
3415
3419
|
path = this.levels[0].groupPath;
|
|
3416
3420
|
}
|
|
3417
3421
|
if (!this.isHierarchicalData) {
|
|
3418
|
-
this.findTotalWeight(
|
|
3422
|
+
this.findTotalWeight(this.treemapLevelData.levelsData[0][path], 'Parent');
|
|
3419
3423
|
}
|
|
3420
3424
|
}
|
|
3421
3425
|
};
|
|
@@ -3477,19 +3481,19 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3477
3481
|
_this.processHierarchicalData(currentData, dataCount);
|
|
3478
3482
|
});
|
|
3479
3483
|
}
|
|
3480
|
-
if (dataCount ===
|
|
3484
|
+
if (dataCount === this.treemapLevelData.hierarchyData.length - 1) {
|
|
3481
3485
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3482
|
-
var mainData_1 =
|
|
3483
|
-
for (var k = 0; k <
|
|
3484
|
-
childData = findChildren(
|
|
3486
|
+
var mainData_1 = this.treemapLevelData.hierarchyData[0][this.levels[0].groupPath];
|
|
3487
|
+
for (var k = 0; k < this.treemapLevelData.hierarchyData.length; k++) {
|
|
3488
|
+
childData = findChildren(this.treemapLevelData.hierarchyData[k])['values'];
|
|
3485
3489
|
if (k !== 0 && childData) {
|
|
3486
3490
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3487
3491
|
childData.forEach(function (currentData) { mainData_1.push(currentData); });
|
|
3488
|
-
|
|
3492
|
+
this.treemapLevelData.hierarchyData.splice(k, 1);
|
|
3489
3493
|
k -= 1;
|
|
3490
3494
|
}
|
|
3491
3495
|
}
|
|
3492
|
-
mainData_1 =
|
|
3496
|
+
mainData_1 = this.treemapLevelData.hierarchyData[0][this.levels[0].groupPath];
|
|
3493
3497
|
for (var l = 0; l < mainData_1.length; l++) {
|
|
3494
3498
|
newData[this.levels[0].groupPath] = mainData_1;
|
|
3495
3499
|
mainData_1[l]['parent'] = newData;
|
|
@@ -3547,7 +3551,7 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3547
3551
|
var level = {};
|
|
3548
3552
|
level['level'] = i;
|
|
3549
3553
|
level[groupPath] = [];
|
|
3550
|
-
|
|
3554
|
+
this.treemapLevelData.levelsData.push(level);
|
|
3551
3555
|
for (var j = 0; j < this.dataSource.length; j++) {
|
|
3552
3556
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3553
3557
|
var currentData = {};
|
|
@@ -3569,7 +3573,7 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3569
3573
|
currentData['groupName'] = groupPath;
|
|
3570
3574
|
currentData['data'] = this.dataSource[j];
|
|
3571
3575
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3572
|
-
|
|
3576
|
+
this.treemapLevelData.levelsData[(this.treemapLevelData.levelsData.length - 1)][groupPath].push(currentData);
|
|
3573
3577
|
orderNames.push((childName) ? childName : name_1);
|
|
3574
3578
|
}
|
|
3575
3579
|
}
|
|
@@ -3581,15 +3585,16 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3581
3585
|
*
|
|
3582
3586
|
* @param {number} start - Specifies the start value of the treemap level.
|
|
3583
3587
|
* @returns {void}
|
|
3588
|
+
* @private
|
|
3584
3589
|
*/
|
|
3585
3590
|
TreeMap.prototype.reOrderLevelData = function (start) {
|
|
3586
3591
|
var currentName;
|
|
3587
3592
|
var currentPath = this.levels[start] ? this.levels[start].groupPath : this.leafItemSettings.labelPath;
|
|
3588
3593
|
var prevPath = this.levels[start - 1].groupPath;
|
|
3589
3594
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3590
|
-
var currentData =
|
|
3595
|
+
var currentData = this.treemapLevelData.levelsData[start][currentPath];
|
|
3591
3596
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3592
|
-
var previousData =
|
|
3597
|
+
var previousData = this.treemapLevelData.levelsData[start - 1][prevPath];
|
|
3593
3598
|
for (var i = 0; i < currentData.length; i++) {
|
|
3594
3599
|
currentName = currentData[i]['levelOrderName'];
|
|
3595
3600
|
for (var j = 0; j < previousData.length; j++) {
|
|
@@ -3605,8 +3610,8 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3605
3610
|
}
|
|
3606
3611
|
}
|
|
3607
3612
|
}
|
|
3608
|
-
this.findTotalWeight(
|
|
3609
|
-
|
|
3613
|
+
this.findTotalWeight(this.treemapLevelData.levelsData[this.treemapLevelData.levelsData.length - 1][currentPath], 'Child');
|
|
3614
|
+
this.treemapLevelData.levelsData.splice(start, 1);
|
|
3610
3615
|
if ((start - 1) > 0) {
|
|
3611
3616
|
this.reOrderLevelData(start - 1);
|
|
3612
3617
|
}
|
|
@@ -3629,6 +3634,7 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3629
3634
|
* @param {any[]} processData - Specifies the treemap data.
|
|
3630
3635
|
* @param {string} type - Specifies the type of the data.
|
|
3631
3636
|
* @returns {void}
|
|
3637
|
+
* @private
|
|
3632
3638
|
*/
|
|
3633
3639
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3634
3640
|
TreeMap.prototype.findTotalWeight = function (processData, type) {
|
|
@@ -3663,6 +3669,7 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3663
3669
|
* To unbind event handlers for treemap.
|
|
3664
3670
|
*
|
|
3665
3671
|
* @returns {void}
|
|
3672
|
+
* @private
|
|
3666
3673
|
*/
|
|
3667
3674
|
TreeMap.prototype.unWireEVents = function () {
|
|
3668
3675
|
EventHandler.remove(this.element, 'click', this.clickOnTreeMap);
|
|
@@ -3713,6 +3720,7 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3713
3720
|
*
|
|
3714
3721
|
* @param {Event} e - Specifies the pointer event.
|
|
3715
3722
|
* @returns {void}
|
|
3723
|
+
* @private
|
|
3716
3724
|
*/
|
|
3717
3725
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3718
3726
|
TreeMap.prototype.resizeOnTreeMap = function (e) {
|
|
@@ -3749,6 +3757,7 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3749
3757
|
*
|
|
3750
3758
|
* @param {PointerEvent} e - Specifies the mouse click event in the treemap.
|
|
3751
3759
|
* @returns {void}
|
|
3760
|
+
* @private
|
|
3752
3761
|
*/
|
|
3753
3762
|
TreeMap.prototype.clickOnTreeMap = function (e) {
|
|
3754
3763
|
var _this = this;
|
|
@@ -3771,7 +3780,7 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3771
3780
|
if (observedArgs.text !== labelText || observedArgs.contentItemTemplate !== labelText) {
|
|
3772
3781
|
if (isNullOrUndefined(_this.leafItemSettings.labelTemplate)) {
|
|
3773
3782
|
observedArgs.text = textFormatter(observedArgs.text, observedArgs['item']['data'], observedArgs.treemap);
|
|
3774
|
-
targetEle.
|
|
3783
|
+
targetEle.textContent = observedArgs.text;
|
|
3775
3784
|
}
|
|
3776
3785
|
else {
|
|
3777
3786
|
setItemTemplateContent(targetId, targetEle, observedArgs.contentItemTemplate);
|
|
@@ -3804,6 +3813,7 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3804
3813
|
*
|
|
3805
3814
|
* @param {PointerEvent} e - Specifies the pointer event of mouse click.
|
|
3806
3815
|
* @returns {void}
|
|
3816
|
+
* @private
|
|
3807
3817
|
*/
|
|
3808
3818
|
TreeMap.prototype.rightClickOnTreeMap = function (e) {
|
|
3809
3819
|
var rightClickArgs = { cancel: false, name: rightClick, treemap: this, mouseEvent: e };
|
|
@@ -3814,6 +3824,7 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3814
3824
|
*
|
|
3815
3825
|
* @param {PointerEvent} e - Specifies the pointer event of mouse click.
|
|
3816
3826
|
* @returns {void}
|
|
3827
|
+
* @private
|
|
3817
3828
|
*/
|
|
3818
3829
|
TreeMap.prototype.mouseDownOnTreeMap = function (e) {
|
|
3819
3830
|
if (e.target.id.indexOf('_Item_Index') > -1) {
|
|
@@ -3826,6 +3837,7 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3826
3837
|
*
|
|
3827
3838
|
* @param {PointerEvent} e - Specifies the pointer event of mouse click.
|
|
3828
3839
|
* @returns {void}
|
|
3840
|
+
* @private
|
|
3829
3841
|
*/
|
|
3830
3842
|
TreeMap.prototype.mouseMoveOnTreeMap = function (e) {
|
|
3831
3843
|
var targetEle = e.target;
|
|
@@ -3854,6 +3866,7 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3854
3866
|
* @param {string} labelText - Specifies the label text.
|
|
3855
3867
|
* @param {any} item - Specifies the treemap item.
|
|
3856
3868
|
* @returns {any} - Returns label of the drilled level.
|
|
3869
|
+
* @private
|
|
3857
3870
|
*/
|
|
3858
3871
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
3859
3872
|
TreeMap.prototype.calculateSelectedTextLevels = function (labelText, item) {
|
|
@@ -3921,6 +3934,7 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3921
3934
|
* @param {any} item - Specifies the treemap item.
|
|
3922
3935
|
* @param {number} i - Specifies the treemap item.
|
|
3923
3936
|
* @returns {any} - return the new drill down object.
|
|
3937
|
+
* @private
|
|
3924
3938
|
*/
|
|
3925
3939
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
3926
3940
|
TreeMap.prototype.compareSelectedLabelWithDrillDownItems = function (drillLevelValues, item, i) {
|
|
@@ -3947,6 +3961,7 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3947
3961
|
*
|
|
3948
3962
|
* @param {PointerEvent} e - Specifies the pointer event of mouse.
|
|
3949
3963
|
* @returns {void}
|
|
3964
|
+
* @private
|
|
3950
3965
|
*/
|
|
3951
3966
|
TreeMap.prototype.mouseEndOnTreeMap = function (e) {
|
|
3952
3967
|
var _this = this;
|
|
@@ -3972,7 +3987,7 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3972
3987
|
}
|
|
3973
3988
|
index = parseFloat(targetId.split('_Item_Index_')[1]);
|
|
3974
3989
|
item = this.layout.renderItems[index];
|
|
3975
|
-
var labelText = targetEle.
|
|
3990
|
+
var labelText = targetEle.textContent;
|
|
3976
3991
|
if (this.enableBreadcrumb) {
|
|
3977
3992
|
drillLevelValues = this.calculateSelectedTextLevels(labelText, item);
|
|
3978
3993
|
drillLevel = drillLevelValues['drillLevel'];
|
|
@@ -4090,6 +4105,7 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
4090
4105
|
*
|
|
4091
4106
|
* @param {PointerEvent} e - Specifies the pointer event of mouse.
|
|
4092
4107
|
* @return {void}
|
|
4108
|
+
* @private
|
|
4093
4109
|
*/
|
|
4094
4110
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
4095
4111
|
TreeMap.prototype.mouseLeaveOnTreeMap = function (e) {
|
|
@@ -4109,7 +4125,7 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
4109
4125
|
* This method is used to select or remove the selection of treemap item based on the provided selection settings.
|
|
4110
4126
|
*
|
|
4111
4127
|
* @param {string[]} levelOrder - Specifies the order of the level.
|
|
4112
|
-
* @param {boolean} isSelected -
|
|
4128
|
+
* @param {boolean} isSelected - Specifies whether the treemap item should be selected or the selection should be removed.
|
|
4113
4129
|
* @return {void}
|
|
4114
4130
|
*/
|
|
4115
4131
|
TreeMap.prototype.selectItem = function (levelOrder, isSelected) {
|
|
@@ -4222,12 +4238,13 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
4222
4238
|
* Gets component name.
|
|
4223
4239
|
*
|
|
4224
4240
|
* @returns {string} - return the treemap instance.
|
|
4241
|
+
* @private
|
|
4225
4242
|
*/
|
|
4226
4243
|
TreeMap.prototype.getModuleName = function () {
|
|
4227
4244
|
return 'treemap';
|
|
4228
4245
|
};
|
|
4229
4246
|
/**
|
|
4230
|
-
* This method
|
|
4247
|
+
* This method destroys the treemap. This method removes the events associated with the treemap and disposes the objects created for rendering and updating the treemap.
|
|
4231
4248
|
*/
|
|
4232
4249
|
TreeMap.prototype.destroy = function () {
|
|
4233
4250
|
this.unWireEVents();
|
|
@@ -4434,9 +4451,12 @@ var LevelsData = /** @__PURE__ @class */ (function () {
|
|
|
4434
4451
|
var TreeMapLegend = /** @__PURE__ @class */ (function () {
|
|
4435
4452
|
function TreeMapLegend(treemap) {
|
|
4436
4453
|
this.page = 0;
|
|
4454
|
+
/** @private */
|
|
4437
4455
|
this.legendBorderRect = new Rect(0, 0, 0, 0);
|
|
4438
4456
|
this.currentPage = 0;
|
|
4457
|
+
/** @private */
|
|
4439
4458
|
this.heightIncrement = 0;
|
|
4459
|
+
/** @private */
|
|
4440
4460
|
this.widthIncrement = 0;
|
|
4441
4461
|
this.textMaxWidth = 0;
|
|
4442
4462
|
this.legendInteractiveGradient = [];
|
|
@@ -4447,9 +4467,11 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
|
|
|
4447
4467
|
// eslint-disable-next-line valid-jsdoc
|
|
4448
4468
|
/**
|
|
4449
4469
|
* method for legend
|
|
4470
|
+
* @private
|
|
4450
4471
|
*/
|
|
4451
4472
|
TreeMapLegend.prototype.renderLegend = function () {
|
|
4452
4473
|
var _this = this;
|
|
4474
|
+
this.page = 0;
|
|
4453
4475
|
this.legendRenderingCollections = [];
|
|
4454
4476
|
this.legendCollections = [];
|
|
4455
4477
|
this.legendNames = [];
|
|
@@ -4473,14 +4495,15 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
|
|
|
4473
4495
|
}
|
|
4474
4496
|
});
|
|
4475
4497
|
};
|
|
4498
|
+
/** @private */
|
|
4476
4499
|
TreeMapLegend.prototype.calculateLegendBounds = function () {
|
|
4477
4500
|
var _this = this;
|
|
4478
4501
|
var treemap = this.treemap;
|
|
4479
4502
|
var legend = treemap.legendSettings;
|
|
4480
|
-
this.findColorMappingLegendItems(
|
|
4481
|
-
if ((this.treemap.palette.length > 0 || !isNullOrUndefined(
|
|
4503
|
+
this.findColorMappingLegendItems(treemap.treemapLevelData.levelsData[0]);
|
|
4504
|
+
if ((this.treemap.palette.length > 0 || !isNullOrUndefined(treemap.colorValuePath))
|
|
4482
4505
|
&& this.legendCollections.length === 0) {
|
|
4483
|
-
this.findPaletteLegendItems(
|
|
4506
|
+
this.findPaletteLegendItems(treemap.treemapLevelData.levelsData[0]);
|
|
4484
4507
|
}
|
|
4485
4508
|
if (this.legendCollections.length > 0) {
|
|
4486
4509
|
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
@@ -4966,16 +4989,16 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
|
|
|
4966
4989
|
// eslint-disable-next-line valid-jsdoc
|
|
4967
4990
|
/**
|
|
4968
4991
|
* To draw the legend
|
|
4992
|
+
* @private
|
|
4969
4993
|
*/
|
|
4970
4994
|
TreeMapLegend.prototype.drawLegend = function () {
|
|
4971
|
-
var
|
|
4972
|
-
var
|
|
4973
|
-
var render = treemap.renderer;
|
|
4995
|
+
var legend = this.treemap.legendSettings;
|
|
4996
|
+
var render = this.treemap.renderer;
|
|
4974
4997
|
var fill;
|
|
4975
4998
|
var textOptions;
|
|
4976
4999
|
var gradientElement;
|
|
4977
5000
|
var textFont = legend.textStyle;
|
|
4978
|
-
this.legendGroup = render.createGroup({ id: treemap.element.id + '_Legend_Group' });
|
|
5001
|
+
this.legendGroup = render.createGroup({ id: this.treemap.element.id + '_Legend_Group' });
|
|
4979
5002
|
this.renderLegendBorder();
|
|
4980
5003
|
this.renderLegendTitle();
|
|
4981
5004
|
if (legend.mode === 'Default') {
|
|
@@ -4983,8 +5006,8 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
|
|
|
4983
5006
|
}
|
|
4984
5007
|
else {
|
|
4985
5008
|
for (var i = 0; i < this.legendRenderingCollections.length; i++) {
|
|
4986
|
-
var itemId = treemap.element.id + '_Legend_Index_' + i;
|
|
4987
|
-
var textId = treemap.element.id + '_Legend_Index_' + i + '_Text';
|
|
5009
|
+
var itemId = this.treemap.element.id + '_Legend_Index_' + i;
|
|
5010
|
+
var textId = this.treemap.element.id + '_Legend_Index_' + i + '_Text';
|
|
4988
5011
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4989
5012
|
var item = this.legendRenderingCollections[i];
|
|
4990
5013
|
gradientElement = item['element'];
|
|
@@ -4993,8 +5016,8 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
|
|
|
4993
5016
|
var textLocation = new Location(item['textX'], item['textY']);
|
|
4994
5017
|
var rectOptions = new RectOption(itemId, fill, legend.shapeBorder, legend.opacity, bounds);
|
|
4995
5018
|
if (this.treemap.enableRtl) {
|
|
4996
|
-
if (treemap.legendSettings.position === 'Left' || treemap.legendSettings.position === 'Right'
|
|
4997
|
-
|| (treemap.legendSettings.position === 'Auto'
|
|
5019
|
+
if (this.treemap.legendSettings.position === 'Left' || this.treemap.legendSettings.position === 'Right'
|
|
5020
|
+
|| (this.treemap.legendSettings.position === 'Auto'
|
|
4998
5021
|
&& this.treemap.availableSize.width >= this.treemap.availableSize.height)) {
|
|
4999
5022
|
rectOptions.y = (this.translate.y + this.legendBorderRect.y + this.legendBorderRect.height)
|
|
5000
5023
|
- (this.translate.y + rectOptions.height) - Math.abs(this.legendBorderRect.y - rectOptions.y);
|
|
@@ -5074,11 +5097,11 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
|
|
|
5074
5097
|
cancel: false, name: legendItemRendering, treemap: treemap, fill: collection['Fill'],
|
|
5075
5098
|
shape: legend.shape, imageUrl: legend.imageUrl
|
|
5076
5099
|
};
|
|
5077
|
-
|
|
5100
|
+
treemap.trigger(legendItemRendering, eventArgs, function (observedArgs) {
|
|
5078
5101
|
var renderOptions = new PathOption(shapeId, observedArgs.fill, strokeWidth_1, isLineShape_1 ? collection['Fill'] : strokeColor_1, legend.opacity, '');
|
|
5079
5102
|
legendElement.appendChild(drawSymbol(shapeLocation, observedArgs.shape, shapeSize, observedArgs.imageUrl, renderOptions, legendText));
|
|
5080
5103
|
textOptions = new TextOption(textId, textLocation.x, textLocation.y, 'start', legendText, '', '');
|
|
5081
|
-
renderTextElement(textOptions, legend.textStyle, legend.textStyle.color ||
|
|
5104
|
+
renderTextElement(textOptions, legend.textStyle, legend.textStyle.color || treemap.themeStyle.legendTextColor, legendElement);
|
|
5082
5105
|
_this.legendGroup.appendChild(legendElement);
|
|
5083
5106
|
});
|
|
5084
5107
|
};
|
|
@@ -5158,8 +5181,7 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
|
|
|
5158
5181
|
treemap.svgObject.appendChild(this.legendGroup);
|
|
5159
5182
|
};
|
|
5160
5183
|
TreeMapLegend.prototype.renderLegendTitle = function () {
|
|
5161
|
-
var
|
|
5162
|
-
var legend = treemap.legendSettings;
|
|
5184
|
+
var legend = this.treemap.legendSettings;
|
|
5163
5185
|
var textStyle = legend.titleStyle;
|
|
5164
5186
|
var legendTitle = legend.title.text;
|
|
5165
5187
|
var textOptions;
|
|
@@ -5167,7 +5189,7 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
|
|
|
5167
5189
|
var trimTitle = textTrim((this.legendItemRect.width + (spacing * 2)), legendTitle, textStyle);
|
|
5168
5190
|
var textSize = measureText(trimTitle, textStyle);
|
|
5169
5191
|
if (legendTitle) {
|
|
5170
|
-
textOptions = new TextOption(treemap.element.id + '_LegendTitle', (this.legendItemRect.x) + (this.legendItemRect.width / 2), this.legendItemRect.y - (textSize.height / 2) - (spacing / 2), 'middle', trimTitle, '');
|
|
5192
|
+
textOptions = new TextOption(this.treemap.element.id + '_LegendTitle', (this.legendItemRect.x) + (this.legendItemRect.width / 2), this.legendItemRect.y - (textSize.height / 2) - (spacing / 2), 'middle', trimTitle, '');
|
|
5171
5193
|
renderTextElement(textOptions, textStyle, textStyle.color || this.treemap.themeStyle.legendTitleColor, this.legendGroup);
|
|
5172
5194
|
}
|
|
5173
5195
|
};
|
|
@@ -5176,6 +5198,7 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
|
|
|
5176
5198
|
*
|
|
5177
5199
|
* @param {PointerEvent | TouchEvent} e - Specifies the pointer argument.
|
|
5178
5200
|
* @returns {void}
|
|
5201
|
+
* @private
|
|
5179
5202
|
*/
|
|
5180
5203
|
TreeMapLegend.prototype.renderInteractivePointer = function (e) {
|
|
5181
5204
|
var treemap = this.treemap;
|
|
@@ -5317,6 +5340,7 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
|
|
|
5317
5340
|
this.translate = new Location(x, y);
|
|
5318
5341
|
}
|
|
5319
5342
|
};
|
|
5343
|
+
/** @private */
|
|
5320
5344
|
TreeMapLegend.prototype.mouseUpHandler = function (e) {
|
|
5321
5345
|
this.renderInteractivePointer(e);
|
|
5322
5346
|
clearTimeout(this.clearTimeout);
|
|
@@ -5325,6 +5349,7 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
|
|
|
5325
5349
|
// eslint-disable-next-line valid-jsdoc
|
|
5326
5350
|
/**
|
|
5327
5351
|
* To remove the interactive pointer
|
|
5352
|
+
* @private
|
|
5328
5353
|
*/
|
|
5329
5354
|
TreeMapLegend.prototype.removeInteractivePointer = function () {
|
|
5330
5355
|
if (document.getElementById(this.treemap.element.id + '_Interactive_Legend')) {
|
|
@@ -5337,17 +5362,24 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
|
|
|
5337
5362
|
*
|
|
5338
5363
|
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
5339
5364
|
* @returns {void}
|
|
5365
|
+
* @private
|
|
5340
5366
|
*/
|
|
5341
5367
|
TreeMapLegend.prototype.changeNextPage = function (e) {
|
|
5342
5368
|
this.currentPage = (e.target.id.indexOf('_Left_Page_') > -1) ? (this.currentPage - 1) :
|
|
5343
5369
|
(this.currentPage + 1);
|
|
5344
|
-
this.
|
|
5370
|
+
if (this.currentPage >= 0 && this.currentPage < this.totalPages.length) {
|
|
5371
|
+
this.drawLegend();
|
|
5372
|
+
}
|
|
5373
|
+
else {
|
|
5374
|
+
this.currentPage = (e.target.id.indexOf('_Left_Page_') > -1) ? 0 : this.totalPages.length - 1;
|
|
5375
|
+
}
|
|
5345
5376
|
};
|
|
5346
5377
|
/**
|
|
5347
5378
|
* Wire events for event handler
|
|
5348
5379
|
*
|
|
5349
5380
|
* @param {Element} element - Specifies the element.
|
|
5350
5381
|
* @returns {void}
|
|
5382
|
+
* @private
|
|
5351
5383
|
*/
|
|
5352
5384
|
TreeMapLegend.prototype.wireEvents = function (element) {
|
|
5353
5385
|
EventHandler.add(element, Browser.touchStartEvent, this.changeNextPage, this);
|
|
@@ -5355,6 +5387,7 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
|
|
|
5355
5387
|
// eslint-disable-next-line valid-jsdoc
|
|
5356
5388
|
/**
|
|
5357
5389
|
* To add the event listener
|
|
5390
|
+
* @private
|
|
5358
5391
|
*/
|
|
5359
5392
|
TreeMapLegend.prototype.addEventListener = function () {
|
|
5360
5393
|
if (this.treemap.isDestroyed) {
|
|
@@ -5366,6 +5399,7 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
|
|
|
5366
5399
|
// eslint-disable-next-line valid-jsdoc
|
|
5367
5400
|
/**
|
|
5368
5401
|
* To remove the event listener
|
|
5402
|
+
* @private
|
|
5369
5403
|
*/
|
|
5370
5404
|
TreeMapLegend.prototype.removeEventListener = function () {
|
|
5371
5405
|
if (this.treemap.isDestroyed) {
|
|
@@ -5411,6 +5445,7 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
|
|
|
5411
5445
|
* @param {ColorMappingModel} colorMap - Specifies the color mapping instance.
|
|
5412
5446
|
* @param {number} legendIndex - Specifies the index of legend.
|
|
5413
5447
|
* @returns {string} - Returns the legend color.
|
|
5448
|
+
* @private
|
|
5414
5449
|
*/
|
|
5415
5450
|
TreeMapLegend.prototype.legendGradientColor = function (colorMap$$1, legendIndex) {
|
|
5416
5451
|
var legendFillColor;
|
|
@@ -5467,6 +5502,7 @@ var TreeMapHighlight = /** @__PURE__ @class */ (function () {
|
|
|
5467
5502
|
*
|
|
5468
5503
|
* @param {PointerEvent} e - Specifies the pointer argument.
|
|
5469
5504
|
* @returns {boolean} - return the highlight process is true or false.
|
|
5505
|
+
* @private
|
|
5470
5506
|
*/
|
|
5471
5507
|
TreeMapHighlight.prototype.mouseMove = function (e) {
|
|
5472
5508
|
var treemap = this.treemap;
|
|
@@ -5677,6 +5713,7 @@ var TreeMapSelection = /** @__PURE__ @class */ (function () {
|
|
|
5677
5713
|
*
|
|
5678
5714
|
* @param {PointerEvent} e - Specifies the pointer argument.
|
|
5679
5715
|
* @returns {void}
|
|
5716
|
+
* @private
|
|
5680
5717
|
*/
|
|
5681
5718
|
TreeMapSelection.prototype.mouseDown = function (e) {
|
|
5682
5719
|
var targetEle = e.target;
|
|
@@ -6014,12 +6051,12 @@ var TreeMapTooltip = /** @__PURE__ @class */ (function () {
|
|
|
6014
6051
|
markerFill = item['options']['fill'];
|
|
6015
6052
|
}
|
|
6016
6053
|
if (this.treemap.enableRtl) {
|
|
6017
|
-
tooltipContent = [textFormatter(this.tooltipSettings.format, toolTipData, this.treemap) ||
|
|
6018
|
-
formatValue(value, this.treemap) + ' : ' + this.treemap.weightValuePath.toString()];
|
|
6054
|
+
tooltipContent = [SanitizeHtmlHelper.sanitize(textFormatter(this.tooltipSettings.format, toolTipData, this.treemap)) ||
|
|
6055
|
+
SanitizeHtmlHelper.sanitize(formatValue(value, this.treemap) + ' : ' + this.treemap.weightValuePath.toString())];
|
|
6019
6056
|
}
|
|
6020
6057
|
else {
|
|
6021
|
-
tooltipContent = [textFormatter(this.tooltipSettings.format, toolTipData, this.treemap) ||
|
|
6022
|
-
this.treemap.weightValuePath.toString() + ' : ' + formatValue(value, this.treemap)];
|
|
6058
|
+
tooltipContent = [SanitizeHtmlHelper.sanitize(textFormatter(this.tooltipSettings.format, toolTipData, this.treemap)) ||
|
|
6059
|
+
SanitizeHtmlHelper.sanitize(this.treemap.weightValuePath.toString() + ' : ' + formatValue(value, this.treemap))];
|
|
6023
6060
|
}
|
|
6024
6061
|
if (document.getElementById(this.tooltipId)) {
|
|
6025
6062
|
tooltipEle = document.getElementById(this.tooltipId);
|
|
@@ -6117,6 +6154,7 @@ var TreeMapTooltip = /** @__PURE__ @class */ (function () {
|
|
|
6117
6154
|
// eslint-disable-next-line valid-jsdoc
|
|
6118
6155
|
/**
|
|
6119
6156
|
* To bind events for tooltip module
|
|
6157
|
+
* @private
|
|
6120
6158
|
*/
|
|
6121
6159
|
TreeMapTooltip.prototype.addEventListener = function () {
|
|
6122
6160
|
if (this.treemap.isDestroyed) {
|
|
@@ -6128,6 +6166,7 @@ var TreeMapTooltip = /** @__PURE__ @class */ (function () {
|
|
|
6128
6166
|
// eslint-disable-next-line valid-jsdoc
|
|
6129
6167
|
/**
|
|
6130
6168
|
* To unbind events for tooltip module
|
|
6169
|
+
* @private
|
|
6131
6170
|
*/
|
|
6132
6171
|
TreeMapTooltip.prototype.removeEventListener = function () {
|
|
6133
6172
|
if (this.treemap.isDestroyed) {
|