@syncfusion/ej2-treemap 20.4.48 → 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 @@ const legendRendering = 'legendRendering';
|
|
|
115
115
|
*/
|
|
116
116
|
const 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
|
*/
|
|
@@ -131,7 +131,7 @@ var __decorate$1 = (undefined && undefined.__decorate) || function (decorators,
|
|
|
131
131
|
* Maps base doc
|
|
132
132
|
*/
|
|
133
133
|
/**
|
|
134
|
-
* Sets and gets the options for customizing the color and width of the border in treemap
|
|
134
|
+
* Sets and gets the options for customizing the color and width of the border in treemap.
|
|
135
135
|
*/
|
|
136
136
|
class Border extends ChildProperty {
|
|
137
137
|
}
|
|
@@ -142,7 +142,7 @@ __decorate$1([
|
|
|
142
142
|
Property(0)
|
|
143
143
|
], Border.prototype, "width", void 0);
|
|
144
144
|
/**
|
|
145
|
-
* Sets and gets the margin for the treemap
|
|
145
|
+
* Sets and gets the margin for the treemap.
|
|
146
146
|
*/
|
|
147
147
|
class Margin extends ChildProperty {
|
|
148
148
|
}
|
|
@@ -159,7 +159,7 @@ __decorate$1([
|
|
|
159
159
|
Property(10)
|
|
160
160
|
], Margin.prototype, "bottom", void 0);
|
|
161
161
|
/**
|
|
162
|
-
* Sets and gets the options to customize the style of the text contents in the treemap
|
|
162
|
+
* Sets and gets the options to customize the style of the text contents in the treemap.
|
|
163
163
|
*/
|
|
164
164
|
class Font extends ChildProperty {
|
|
165
165
|
}
|
|
@@ -182,7 +182,7 @@ __decorate$1([
|
|
|
182
182
|
Property(1)
|
|
183
183
|
], Font.prototype, "opacity", void 0);
|
|
184
184
|
/**
|
|
185
|
-
* Sets and gets the options for customizing the
|
|
185
|
+
* Sets and gets the options for customizing the title of the treemap.
|
|
186
186
|
*/
|
|
187
187
|
class CommonTitleSettings extends ChildProperty {
|
|
188
188
|
}
|
|
@@ -193,7 +193,7 @@ __decorate$1([
|
|
|
193
193
|
Property('')
|
|
194
194
|
], CommonTitleSettings.prototype, "description", void 0);
|
|
195
195
|
/**
|
|
196
|
-
* Sets and gets the options for customizing the subtitle of the treemap
|
|
196
|
+
* Sets and gets the options for customizing the subtitle of the treemap.
|
|
197
197
|
*/
|
|
198
198
|
class SubTitleSettings extends CommonTitleSettings {
|
|
199
199
|
}
|
|
@@ -204,7 +204,7 @@ __decorate$1([
|
|
|
204
204
|
Property('Center')
|
|
205
205
|
], SubTitleSettings.prototype, "alignment", void 0);
|
|
206
206
|
/**
|
|
207
|
-
* Sets and gets the options for customizing the title of the treemap
|
|
207
|
+
* Sets and gets the options for customizing the title of the treemap.
|
|
208
208
|
*/
|
|
209
209
|
class TitleSettings extends CommonTitleSettings {
|
|
210
210
|
}
|
|
@@ -218,7 +218,7 @@ __decorate$1([
|
|
|
218
218
|
Complex({}, SubTitleSettings)
|
|
219
219
|
], TitleSettings.prototype, "subtitleSettings", void 0);
|
|
220
220
|
/**
|
|
221
|
-
* Sets and gets the options to customize the color-mapping in treemap
|
|
221
|
+
* Sets and gets the options to customize the color-mapping in treemap.
|
|
222
222
|
*/
|
|
223
223
|
class ColorMapping extends ChildProperty {
|
|
224
224
|
}
|
|
@@ -247,7 +247,7 @@ __decorate$1([
|
|
|
247
247
|
Property(true)
|
|
248
248
|
], ColorMapping.prototype, "showLegend", void 0);
|
|
249
249
|
/**
|
|
250
|
-
* Sets and gets the options for customizing the legend of the treemap
|
|
250
|
+
* Sets and gets the options for customizing the legend of the treemap.
|
|
251
251
|
*/
|
|
252
252
|
class LegendSettings extends ChildProperty {
|
|
253
253
|
}
|
|
@@ -333,7 +333,7 @@ __decorate$1([
|
|
|
333
333
|
Property(false)
|
|
334
334
|
], LegendSettings.prototype, "removeDuplicateLegend", void 0);
|
|
335
335
|
/**
|
|
336
|
-
* Sets and gets the settings for drill to visualize the treemap rendered in the initial state.
|
|
336
|
+
* Sets and gets the settings for drill down to visualize the treemap rendered in the initial state.
|
|
337
337
|
*/
|
|
338
338
|
class InitialDrillSettings extends ChildProperty {
|
|
339
339
|
}
|
|
@@ -344,7 +344,7 @@ __decorate$1([
|
|
|
344
344
|
Property(null)
|
|
345
345
|
], InitialDrillSettings.prototype, "groupName", void 0);
|
|
346
346
|
/**
|
|
347
|
-
* Sets and gets the options for customizing the leaf item of the treemap
|
|
347
|
+
* Sets and gets the options for customizing the leaf item of the treemap.
|
|
348
348
|
*/
|
|
349
349
|
class LeafItemSettings extends ChildProperty {
|
|
350
350
|
}
|
|
@@ -394,7 +394,7 @@ __decorate$1([
|
|
|
394
394
|
Collection([], ColorMapping)
|
|
395
395
|
], LeafItemSettings.prototype, "colorMapping", void 0);
|
|
396
396
|
/**
|
|
397
|
-
* Sets and gets the options for customizing the tooltip of the treemap
|
|
397
|
+
* Sets and gets the options for customizing the tooltip of the treemap.
|
|
398
398
|
*/
|
|
399
399
|
class TooltipSettings extends ChildProperty {
|
|
400
400
|
}
|
|
@@ -423,7 +423,7 @@ __decorate$1([
|
|
|
423
423
|
Complex({ fontFamily: defaultFont, size: '13px' }, Font)
|
|
424
424
|
], TooltipSettings.prototype, "textStyle", void 0);
|
|
425
425
|
/**
|
|
426
|
-
* Sets and gets the options for customizing the selection of the leaf items in treemap
|
|
426
|
+
* Sets and gets the options for customizing the selection of the leaf items in treemap.
|
|
427
427
|
*/
|
|
428
428
|
class SelectionSettings extends ChildProperty {
|
|
429
429
|
}
|
|
@@ -464,7 +464,7 @@ __decorate$1([
|
|
|
464
464
|
Property('Item')
|
|
465
465
|
], HighlightSettings.prototype, "mode", void 0);
|
|
466
466
|
/**
|
|
467
|
-
* Sets and gets the options for customizing the
|
|
467
|
+
* Sets and gets the options for customizing the level leaf items of the treemap.
|
|
468
468
|
*/
|
|
469
469
|
class LevelSettings extends ChildProperty {
|
|
470
470
|
}
|
|
@@ -515,7 +515,7 @@ __decorate$1([
|
|
|
515
515
|
], LevelSettings.prototype, "colorMapping", void 0);
|
|
516
516
|
|
|
517
517
|
/**
|
|
518
|
-
*
|
|
518
|
+
* Specifies the size parameters.
|
|
519
519
|
*/
|
|
520
520
|
class Size {
|
|
521
521
|
constructor(width, height) {
|
|
@@ -592,7 +592,7 @@ function measureText(text, font) {
|
|
|
592
592
|
measureObject = createElement('text', { id: 'treeMapMeasureText' });
|
|
593
593
|
document.body.appendChild(measureObject);
|
|
594
594
|
}
|
|
595
|
-
measureObject.innerHTML = text;
|
|
595
|
+
measureObject.innerHTML = SanitizeHtmlHelper.sanitize(text);
|
|
596
596
|
measureObject.style.position = 'absolute';
|
|
597
597
|
measureObject.style.fontSize = font.size;
|
|
598
598
|
measureObject.style.fontWeight = font.fontWeight;
|
|
@@ -653,7 +653,7 @@ function textTrim(maxWidth, text, font) {
|
|
|
653
653
|
return label;
|
|
654
654
|
}
|
|
655
655
|
/**
|
|
656
|
-
*
|
|
656
|
+
* Specifies the location parameters.
|
|
657
657
|
*/
|
|
658
658
|
class Location {
|
|
659
659
|
constructor(x, y) {
|
|
@@ -669,6 +669,7 @@ class Location {
|
|
|
669
669
|
* @param {Size} textSize - Specifies the size of the text.
|
|
670
670
|
* @param {type} type - Specifies whether the provided text is title or subtitle.
|
|
671
671
|
* @returns {Location} - Returns the location of text.
|
|
672
|
+
* @private
|
|
672
673
|
*/
|
|
673
674
|
function findPosition(location, alignment, textSize, type) {
|
|
674
675
|
let x;
|
|
@@ -1351,6 +1352,7 @@ function textWrap(maxWidth, label, font) {
|
|
|
1351
1352
|
* @param {string} text - Specifies the text.
|
|
1352
1353
|
* @param {FontModel} font - Specifies the font.
|
|
1353
1354
|
* @returns {string} - Returns the hidden text.
|
|
1355
|
+
* @private
|
|
1354
1356
|
*/
|
|
1355
1357
|
function hide(maxWidth, maxHeight, text, font) {
|
|
1356
1358
|
let hideText = text;
|
|
@@ -1671,7 +1673,7 @@ function isParentItem(data, item) {
|
|
|
1671
1673
|
return isParentItem;
|
|
1672
1674
|
}
|
|
1673
1675
|
/**
|
|
1674
|
-
* Ajax
|
|
1676
|
+
* Specifies the data to be received through Ajax request for treemap.
|
|
1675
1677
|
*/
|
|
1676
1678
|
class TreeMapAjax {
|
|
1677
1679
|
constructor(options, type, async, contentType, sendData) {
|
|
@@ -1791,6 +1793,7 @@ function pushCollection(collection, index, number, legendElement, shapeElement,
|
|
|
1791
1793
|
* @param {string} url - Specifies the url
|
|
1792
1794
|
* @param {boolean} isDownload - Specifies the boolean value
|
|
1793
1795
|
* @returns {void}
|
|
1796
|
+
* @private
|
|
1794
1797
|
*/
|
|
1795
1798
|
function triggerDownload(fileName, type, url, isDownload) {
|
|
1796
1799
|
createElement('a', {
|
|
@@ -1825,12 +1828,12 @@ class LayoutPanel {
|
|
|
1825
1828
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1826
1829
|
let data;
|
|
1827
1830
|
let totalRect;
|
|
1828
|
-
if (
|
|
1831
|
+
if (this.treemap.treemapLevelData.levelsData && this.treemap.treemapLevelData.levelsData.length > 0) {
|
|
1829
1832
|
data = (!isNullOrUndefined(this.treemap.initialDrillDown.groupIndex) &&
|
|
1830
1833
|
!isNullOrUndefined(this.treemap.initialDrillDown.groupName)) &&
|
|
1831
1834
|
(isNullOrUndefined(this.treemap.drilledItems) ? isNullOrUndefined(this.treemap.drilledItems)
|
|
1832
1835
|
: this.treemap.drilledItems.length === 0) ?
|
|
1833
|
-
this.getDrilldownData(
|
|
1836
|
+
this.getDrilldownData(this.treemap.treemapLevelData.levelsData[0], [])[0] : this.treemap.treemapLevelData.levelsData[0];
|
|
1834
1837
|
totalRect = extend({}, this.treemap.areaRect, totalRect, false);
|
|
1835
1838
|
if (!isNullOrUndefined(this.treemap.treeMapLegendModule) && !isNullOrUndefined(this.treemap.totalRect)) {
|
|
1836
1839
|
if (this.treemap.legendSettings.position !== 'Float') {
|
|
@@ -1849,7 +1852,7 @@ class LayoutPanel {
|
|
|
1849
1852
|
if (!isNullOrUndefined(this.treemap.initialDrillDown.groupIndex) && !this.treemap.enableBreadcrumb) {
|
|
1850
1853
|
this.treemap.currentLevel = this.treemap.drilledItems[count]['data']['groupIndex'];
|
|
1851
1854
|
}
|
|
1852
|
-
this.calculateLayoutItems(y ||
|
|
1855
|
+
this.calculateLayoutItems(y || this.treemap.treemapLevelData.levelsData[0], totalRect);
|
|
1853
1856
|
this.renderLayoutItems();
|
|
1854
1857
|
}
|
|
1855
1858
|
else {
|
|
@@ -1858,7 +1861,7 @@ class LayoutPanel {
|
|
|
1858
1861
|
: this.treemap.drilledItems.length === 0)) {
|
|
1859
1862
|
this.treemap.currentLevel = this.treemap.initialDrillDown.groupIndex;
|
|
1860
1863
|
}
|
|
1861
|
-
this.calculateLayoutItems(data ||
|
|
1864
|
+
this.calculateLayoutItems(data || this.treemap.treemapLevelData.levelsData[0], totalRect);
|
|
1862
1865
|
this.renderLayoutItems();
|
|
1863
1866
|
}
|
|
1864
1867
|
}
|
|
@@ -2438,18 +2441,18 @@ class LayoutPanel {
|
|
|
2438
2441
|
const treemap = this.treemap;
|
|
2439
2442
|
let itemFill = isLeafItem ? treemap.leafItemSettings.fill : treemap.levels[item['groupIndex']].fill;
|
|
2440
2443
|
let itemOpacity = isLeafItem ? treemap.leafItemSettings.opacity : treemap.levels[item['groupIndex']].opacity;
|
|
2441
|
-
if (!isNullOrUndefined(
|
|
2442
|
-
if (
|
|
2443
|
-
|
|
2444
|
+
if (!isNullOrUndefined(treemap.treemapLevelData.defaultLevelsData)) {
|
|
2445
|
+
if (treemap.treemapLevelData.defaultLevelsData.length > 0) {
|
|
2446
|
+
treemap.treemapLevelData.levelsData = treemap.treemapLevelData.defaultLevelsData;
|
|
2444
2447
|
}
|
|
2445
2448
|
}
|
|
2446
2449
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2447
|
-
const parentData = findChildren(
|
|
2450
|
+
const parentData = findChildren(treemap.treemapLevelData.levelsData[0])['values'];
|
|
2448
2451
|
const colorMapping = isLeafItem ? treemap.leafItemSettings.colorMapping :
|
|
2449
2452
|
treemap.levels[item['groupIndex']].colorMapping;
|
|
2450
2453
|
if (colorMapping.length > 0) {
|
|
2451
2454
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2452
|
-
const option = colorMap(colorMapping, item['data'][
|
|
2455
|
+
const option = colorMap(colorMapping, item['data'][treemap.equalColorValuePath], item['data'][treemap.rangeColorValuePath]);
|
|
2453
2456
|
itemFill = !isNullOrUndefined(option['fill']) ? option['fill'] : treemap.leafItemSettings.fill;
|
|
2454
2457
|
itemOpacity = option['opacity'];
|
|
2455
2458
|
}
|
|
@@ -2940,7 +2943,7 @@ class PdfExport {
|
|
|
2940
2943
|
* @param {TreeMap} treeMap - Specifies the treemap instance.
|
|
2941
2944
|
* @param {ExportType} type - Specifies the type of the document.
|
|
2942
2945
|
* @param {string} fileName - Specifies the name of the document.
|
|
2943
|
-
* @param {PdfPageOrientation} orientation - Specifies the orientation of the PDF document to export the
|
|
2946
|
+
* @param {PdfPageOrientation} orientation - Specifies the orientation of the PDF document to export the treemap.
|
|
2944
2947
|
* @param {boolean} allowDownload - Specifies whether to download the document or not.
|
|
2945
2948
|
* @returns {Promise} - Returns the string.
|
|
2946
2949
|
* @private
|
|
@@ -3012,7 +3015,7 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
|
|
|
3012
3015
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3013
3016
|
};
|
|
3014
3017
|
/**
|
|
3015
|
-
* Represents the treemap
|
|
3018
|
+
* Represents the treemap control. It is used to visualize both hierarchical and flat data.
|
|
3016
3019
|
* ```html
|
|
3017
3020
|
* <div id="container"/>
|
|
3018
3021
|
* <script>
|
|
@@ -3023,7 +3026,7 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
|
|
|
3023
3026
|
*/
|
|
3024
3027
|
let TreeMap = class TreeMap extends Component {
|
|
3025
3028
|
/**
|
|
3026
|
-
* Constructor for TreeMap
|
|
3029
|
+
* Constructor for TreeMap.
|
|
3027
3030
|
*
|
|
3028
3031
|
* @param {TreeMapModel} options - Specifies the treemap instance.
|
|
3029
3032
|
* @param {string | HTMLElement} element - Specifies the treemap element.
|
|
@@ -3059,16 +3062,17 @@ let TreeMap = class TreeMap extends Component {
|
|
|
3059
3062
|
this.renderElements();
|
|
3060
3063
|
}
|
|
3061
3064
|
renderElements() {
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
+
this.treemapLevelData = new LevelsData();
|
|
3066
|
+
this.treemapLevelData.levelsData = null;
|
|
3067
|
+
this.treemapLevelData.defaultLevelsData = null;
|
|
3068
|
+
this.treemapLevelData.hierarchyData = null;
|
|
3065
3069
|
this.createSecondaryElement();
|
|
3066
3070
|
this.addTabIndex();
|
|
3067
3071
|
this.themeStyle = getThemeStyle(this.theme);
|
|
3068
3072
|
this.renderBorder();
|
|
3069
3073
|
this.renderTitle(this.titleSettings, 'title', null, null);
|
|
3070
|
-
if (!isNullOrUndefined(
|
|
3071
|
-
|
|
3074
|
+
if (!isNullOrUndefined(this.treemapLevelData.levelsData)) {
|
|
3075
|
+
this.treemapLevelData.defaultLevelsData = this.treemapLevelData.levelsData;
|
|
3072
3076
|
}
|
|
3073
3077
|
this.processDataManager();
|
|
3074
3078
|
}
|
|
@@ -3233,7 +3237,7 @@ let TreeMap = class TreeMap extends Component {
|
|
|
3233
3237
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3234
3238
|
this.dataSource = this.dataSource;
|
|
3235
3239
|
if (!isNullOrUndefined(this.dataSource) && this.dataSource.length > 0 && this.weightValuePath) {
|
|
3236
|
-
|
|
3240
|
+
this.treemapLevelData.levelsData = [];
|
|
3237
3241
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3238
3242
|
this.dataSource.map((data) => {
|
|
3239
3243
|
data[this.weightValuePath] = (data[this.weightValuePath]) ? data[this.weightValuePath].toString() :
|
|
@@ -3273,28 +3277,28 @@ let TreeMap = class TreeMap extends Component {
|
|
|
3273
3277
|
}
|
|
3274
3278
|
}
|
|
3275
3279
|
}
|
|
3276
|
-
|
|
3280
|
+
this.treemapLevelData.levelsData.push(data);
|
|
3277
3281
|
}
|
|
3278
3282
|
else {
|
|
3279
3283
|
if (this.isHierarchicalData) {
|
|
3280
|
-
|
|
3284
|
+
this.treemapLevelData.hierarchyData = [];
|
|
3281
3285
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3282
|
-
|
|
3283
|
-
for (let i = 0; i <
|
|
3284
|
-
this.processHierarchicalData(
|
|
3286
|
+
this.treemapLevelData.hierarchyData = extend([], this.dataSource, this.treemapLevelData.hierarchyData, true);
|
|
3287
|
+
for (let i = 0; i < this.treemapLevelData.hierarchyData.length; i++) {
|
|
3288
|
+
this.processHierarchicalData(this.treemapLevelData.hierarchyData[i], i);
|
|
3285
3289
|
}
|
|
3286
|
-
|
|
3290
|
+
this.treemapLevelData.levelsData = this.treemapLevelData.hierarchyData;
|
|
3287
3291
|
}
|
|
3288
3292
|
else {
|
|
3289
3293
|
this.processFlatJsonData();
|
|
3290
|
-
if (
|
|
3291
|
-
this.reOrderLevelData(
|
|
3294
|
+
if (this.treemapLevelData.levelsData.length > 1) {
|
|
3295
|
+
this.reOrderLevelData(this.treemapLevelData.levelsData.length - 1);
|
|
3292
3296
|
}
|
|
3293
3297
|
}
|
|
3294
3298
|
path = this.levels[0].groupPath;
|
|
3295
3299
|
}
|
|
3296
3300
|
if (!this.isHierarchicalData) {
|
|
3297
|
-
this.findTotalWeight(
|
|
3301
|
+
this.findTotalWeight(this.treemapLevelData.levelsData[0][path], 'Parent');
|
|
3298
3302
|
}
|
|
3299
3303
|
}
|
|
3300
3304
|
}
|
|
@@ -3355,19 +3359,19 @@ let TreeMap = class TreeMap extends Component {
|
|
|
3355
3359
|
this.processHierarchicalData(currentData, dataCount);
|
|
3356
3360
|
});
|
|
3357
3361
|
}
|
|
3358
|
-
if (dataCount ===
|
|
3362
|
+
if (dataCount === this.treemapLevelData.hierarchyData.length - 1) {
|
|
3359
3363
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3360
|
-
let mainData =
|
|
3361
|
-
for (let k = 0; k <
|
|
3362
|
-
childData = findChildren(
|
|
3364
|
+
let mainData = this.treemapLevelData.hierarchyData[0][this.levels[0].groupPath];
|
|
3365
|
+
for (let k = 0; k < this.treemapLevelData.hierarchyData.length; k++) {
|
|
3366
|
+
childData = findChildren(this.treemapLevelData.hierarchyData[k])['values'];
|
|
3363
3367
|
if (k !== 0 && childData) {
|
|
3364
3368
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3365
3369
|
childData.forEach((currentData) => { mainData.push(currentData); });
|
|
3366
|
-
|
|
3370
|
+
this.treemapLevelData.hierarchyData.splice(k, 1);
|
|
3367
3371
|
k -= 1;
|
|
3368
3372
|
}
|
|
3369
3373
|
}
|
|
3370
|
-
mainData =
|
|
3374
|
+
mainData = this.treemapLevelData.hierarchyData[0][this.levels[0].groupPath];
|
|
3371
3375
|
for (let l = 0; l < mainData.length; l++) {
|
|
3372
3376
|
newData[this.levels[0].groupPath] = mainData;
|
|
3373
3377
|
mainData[l]['parent'] = newData;
|
|
@@ -3424,7 +3428,7 @@ let TreeMap = class TreeMap extends Component {
|
|
|
3424
3428
|
const level = {};
|
|
3425
3429
|
level['level'] = i;
|
|
3426
3430
|
level[groupPath] = [];
|
|
3427
|
-
|
|
3431
|
+
this.treemapLevelData.levelsData.push(level);
|
|
3428
3432
|
for (let j = 0; j < this.dataSource.length; j++) {
|
|
3429
3433
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3430
3434
|
const currentData = {};
|
|
@@ -3446,7 +3450,7 @@ let TreeMap = class TreeMap extends Component {
|
|
|
3446
3450
|
currentData['groupName'] = groupPath;
|
|
3447
3451
|
currentData['data'] = this.dataSource[j];
|
|
3448
3452
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3449
|
-
|
|
3453
|
+
this.treemapLevelData.levelsData[(this.treemapLevelData.levelsData.length - 1)][groupPath].push(currentData);
|
|
3450
3454
|
orderNames.push((childName) ? childName : name);
|
|
3451
3455
|
}
|
|
3452
3456
|
}
|
|
@@ -3458,15 +3462,16 @@ let TreeMap = class TreeMap extends Component {
|
|
|
3458
3462
|
*
|
|
3459
3463
|
* @param {number} start - Specifies the start value of the treemap level.
|
|
3460
3464
|
* @returns {void}
|
|
3465
|
+
* @private
|
|
3461
3466
|
*/
|
|
3462
3467
|
reOrderLevelData(start) {
|
|
3463
3468
|
let currentName;
|
|
3464
3469
|
const currentPath = this.levels[start] ? this.levels[start].groupPath : this.leafItemSettings.labelPath;
|
|
3465
3470
|
const prevPath = this.levels[start - 1].groupPath;
|
|
3466
3471
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3467
|
-
const currentData =
|
|
3472
|
+
const currentData = this.treemapLevelData.levelsData[start][currentPath];
|
|
3468
3473
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3469
|
-
const previousData =
|
|
3474
|
+
const previousData = this.treemapLevelData.levelsData[start - 1][prevPath];
|
|
3470
3475
|
for (let i = 0; i < currentData.length; i++) {
|
|
3471
3476
|
currentName = currentData[i]['levelOrderName'];
|
|
3472
3477
|
for (let j = 0; j < previousData.length; j++) {
|
|
@@ -3482,8 +3487,8 @@ let TreeMap = class TreeMap extends Component {
|
|
|
3482
3487
|
}
|
|
3483
3488
|
}
|
|
3484
3489
|
}
|
|
3485
|
-
this.findTotalWeight(
|
|
3486
|
-
|
|
3490
|
+
this.findTotalWeight(this.treemapLevelData.levelsData[this.treemapLevelData.levelsData.length - 1][currentPath], 'Child');
|
|
3491
|
+
this.treemapLevelData.levelsData.splice(start, 1);
|
|
3487
3492
|
if ((start - 1) > 0) {
|
|
3488
3493
|
this.reOrderLevelData(start - 1);
|
|
3489
3494
|
}
|
|
@@ -3506,6 +3511,7 @@ let TreeMap = class TreeMap extends Component {
|
|
|
3506
3511
|
* @param {any[]} processData - Specifies the treemap data.
|
|
3507
3512
|
* @param {string} type - Specifies the type of the data.
|
|
3508
3513
|
* @returns {void}
|
|
3514
|
+
* @private
|
|
3509
3515
|
*/
|
|
3510
3516
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3511
3517
|
findTotalWeight(processData, type) {
|
|
@@ -3535,6 +3541,7 @@ let TreeMap = class TreeMap extends Component {
|
|
|
3535
3541
|
* To unbind event handlers for treemap.
|
|
3536
3542
|
*
|
|
3537
3543
|
* @returns {void}
|
|
3544
|
+
* @private
|
|
3538
3545
|
*/
|
|
3539
3546
|
unWireEVents() {
|
|
3540
3547
|
EventHandler.remove(this.element, 'click', this.clickOnTreeMap);
|
|
@@ -3585,6 +3592,7 @@ let TreeMap = class TreeMap extends Component {
|
|
|
3585
3592
|
*
|
|
3586
3593
|
* @param {Event} e - Specifies the pointer event.
|
|
3587
3594
|
* @returns {void}
|
|
3595
|
+
* @private
|
|
3588
3596
|
*/
|
|
3589
3597
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3590
3598
|
resizeOnTreeMap(e) {
|
|
@@ -3620,6 +3628,7 @@ let TreeMap = class TreeMap extends Component {
|
|
|
3620
3628
|
*
|
|
3621
3629
|
* @param {PointerEvent} e - Specifies the mouse click event in the treemap.
|
|
3622
3630
|
* @returns {void}
|
|
3631
|
+
* @private
|
|
3623
3632
|
*/
|
|
3624
3633
|
clickOnTreeMap(e) {
|
|
3625
3634
|
const targetEle = e.target;
|
|
@@ -3641,7 +3650,7 @@ let TreeMap = class TreeMap extends Component {
|
|
|
3641
3650
|
if (observedArgs.text !== labelText || observedArgs.contentItemTemplate !== labelText) {
|
|
3642
3651
|
if (isNullOrUndefined(this.leafItemSettings.labelTemplate)) {
|
|
3643
3652
|
observedArgs.text = textFormatter(observedArgs.text, observedArgs['item']['data'], observedArgs.treemap);
|
|
3644
|
-
targetEle.
|
|
3653
|
+
targetEle.textContent = observedArgs.text;
|
|
3645
3654
|
}
|
|
3646
3655
|
else {
|
|
3647
3656
|
setItemTemplateContent(targetId, targetEle, observedArgs.contentItemTemplate);
|
|
@@ -3674,6 +3683,7 @@ let TreeMap = class TreeMap extends Component {
|
|
|
3674
3683
|
*
|
|
3675
3684
|
* @param {PointerEvent} e - Specifies the pointer event of mouse click.
|
|
3676
3685
|
* @returns {void}
|
|
3686
|
+
* @private
|
|
3677
3687
|
*/
|
|
3678
3688
|
rightClickOnTreeMap(e) {
|
|
3679
3689
|
const rightClickArgs = { cancel: false, name: rightClick, treemap: this, mouseEvent: e };
|
|
@@ -3684,6 +3694,7 @@ let TreeMap = class TreeMap extends Component {
|
|
|
3684
3694
|
*
|
|
3685
3695
|
* @param {PointerEvent} e - Specifies the pointer event of mouse click.
|
|
3686
3696
|
* @returns {void}
|
|
3697
|
+
* @private
|
|
3687
3698
|
*/
|
|
3688
3699
|
mouseDownOnTreeMap(e) {
|
|
3689
3700
|
if (e.target.id.indexOf('_Item_Index') > -1) {
|
|
@@ -3696,6 +3707,7 @@ let TreeMap = class TreeMap extends Component {
|
|
|
3696
3707
|
*
|
|
3697
3708
|
* @param {PointerEvent} e - Specifies the pointer event of mouse click.
|
|
3698
3709
|
* @returns {void}
|
|
3710
|
+
* @private
|
|
3699
3711
|
*/
|
|
3700
3712
|
mouseMoveOnTreeMap(e) {
|
|
3701
3713
|
const targetEle = e.target;
|
|
@@ -3724,6 +3736,7 @@ let TreeMap = class TreeMap extends Component {
|
|
|
3724
3736
|
* @param {string} labelText - Specifies the label text.
|
|
3725
3737
|
* @param {any} item - Specifies the treemap item.
|
|
3726
3738
|
* @returns {any} - Returns label of the drilled level.
|
|
3739
|
+
* @private
|
|
3727
3740
|
*/
|
|
3728
3741
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
3729
3742
|
calculateSelectedTextLevels(labelText, item) {
|
|
@@ -3789,6 +3802,7 @@ let TreeMap = class TreeMap extends Component {
|
|
|
3789
3802
|
* @param {any} item - Specifies the treemap item.
|
|
3790
3803
|
* @param {number} i - Specifies the treemap item.
|
|
3791
3804
|
* @returns {any} - return the new drill down object.
|
|
3805
|
+
* @private
|
|
3792
3806
|
*/
|
|
3793
3807
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
3794
3808
|
compareSelectedLabelWithDrillDownItems(drillLevelValues, item, i) {
|
|
@@ -3815,6 +3829,7 @@ let TreeMap = class TreeMap extends Component {
|
|
|
3815
3829
|
*
|
|
3816
3830
|
* @param {PointerEvent} e - Specifies the pointer event of mouse.
|
|
3817
3831
|
* @returns {void}
|
|
3832
|
+
* @private
|
|
3818
3833
|
*/
|
|
3819
3834
|
mouseEndOnTreeMap(e) {
|
|
3820
3835
|
const targetEle = e.target;
|
|
@@ -3839,7 +3854,7 @@ let TreeMap = class TreeMap extends Component {
|
|
|
3839
3854
|
}
|
|
3840
3855
|
index = parseFloat(targetId.split('_Item_Index_')[1]);
|
|
3841
3856
|
item = this.layout.renderItems[index];
|
|
3842
|
-
const labelText = targetEle.
|
|
3857
|
+
const labelText = targetEle.textContent;
|
|
3843
3858
|
if (this.enableBreadcrumb) {
|
|
3844
3859
|
drillLevelValues = this.calculateSelectedTextLevels(labelText, item);
|
|
3845
3860
|
drillLevel = drillLevelValues['drillLevel'];
|
|
@@ -3957,6 +3972,7 @@ let TreeMap = class TreeMap extends Component {
|
|
|
3957
3972
|
*
|
|
3958
3973
|
* @param {PointerEvent} e - Specifies the pointer event of mouse.
|
|
3959
3974
|
* @return {void}
|
|
3975
|
+
* @private
|
|
3960
3976
|
*/
|
|
3961
3977
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3962
3978
|
mouseLeaveOnTreeMap(e) {
|
|
@@ -3976,7 +3992,7 @@ let TreeMap = class TreeMap extends Component {
|
|
|
3976
3992
|
* This method is used to select or remove the selection of treemap item based on the provided selection settings.
|
|
3977
3993
|
*
|
|
3978
3994
|
* @param {string[]} levelOrder - Specifies the order of the level.
|
|
3979
|
-
* @param {boolean} isSelected -
|
|
3995
|
+
* @param {boolean} isSelected - Specifies whether the treemap item should be selected or the selection should be removed.
|
|
3980
3996
|
* @return {void}
|
|
3981
3997
|
*/
|
|
3982
3998
|
selectItem(levelOrder, isSelected) {
|
|
@@ -4088,12 +4104,13 @@ let TreeMap = class TreeMap extends Component {
|
|
|
4088
4104
|
* Gets component name.
|
|
4089
4105
|
*
|
|
4090
4106
|
* @returns {string} - return the treemap instance.
|
|
4107
|
+
* @private
|
|
4091
4108
|
*/
|
|
4092
4109
|
getModuleName() {
|
|
4093
4110
|
return 'treemap';
|
|
4094
4111
|
}
|
|
4095
4112
|
/**
|
|
4096
|
-
* This method
|
|
4113
|
+
* 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.
|
|
4097
4114
|
*/
|
|
4098
4115
|
destroy() {
|
|
4099
4116
|
this.unWireEVents();
|
|
@@ -4296,9 +4313,12 @@ class LevelsData {
|
|
|
4296
4313
|
class TreeMapLegend {
|
|
4297
4314
|
constructor(treemap) {
|
|
4298
4315
|
this.page = 0;
|
|
4316
|
+
/** @private */
|
|
4299
4317
|
this.legendBorderRect = new Rect(0, 0, 0, 0);
|
|
4300
4318
|
this.currentPage = 0;
|
|
4319
|
+
/** @private */
|
|
4301
4320
|
this.heightIncrement = 0;
|
|
4321
|
+
/** @private */
|
|
4302
4322
|
this.widthIncrement = 0;
|
|
4303
4323
|
this.textMaxWidth = 0;
|
|
4304
4324
|
this.legendInteractiveGradient = [];
|
|
@@ -4309,8 +4329,10 @@ class TreeMapLegend {
|
|
|
4309
4329
|
// eslint-disable-next-line valid-jsdoc
|
|
4310
4330
|
/**
|
|
4311
4331
|
* method for legend
|
|
4332
|
+
* @private
|
|
4312
4333
|
*/
|
|
4313
4334
|
renderLegend() {
|
|
4335
|
+
this.page = 0;
|
|
4314
4336
|
this.legendRenderingCollections = [];
|
|
4315
4337
|
this.legendCollections = [];
|
|
4316
4338
|
this.legendNames = [];
|
|
@@ -4334,13 +4356,14 @@ class TreeMapLegend {
|
|
|
4334
4356
|
}
|
|
4335
4357
|
});
|
|
4336
4358
|
}
|
|
4359
|
+
/** @private */
|
|
4337
4360
|
calculateLegendBounds() {
|
|
4338
4361
|
const treemap = this.treemap;
|
|
4339
4362
|
const legend = treemap.legendSettings;
|
|
4340
|
-
this.findColorMappingLegendItems(
|
|
4341
|
-
if ((this.treemap.palette.length > 0 || !isNullOrUndefined(
|
|
4363
|
+
this.findColorMappingLegendItems(treemap.treemapLevelData.levelsData[0]);
|
|
4364
|
+
if ((this.treemap.palette.length > 0 || !isNullOrUndefined(treemap.colorValuePath))
|
|
4342
4365
|
&& this.legendCollections.length === 0) {
|
|
4343
|
-
this.findPaletteLegendItems(
|
|
4366
|
+
this.findPaletteLegendItems(treemap.treemapLevelData.levelsData[0]);
|
|
4344
4367
|
}
|
|
4345
4368
|
if (this.legendCollections.length > 0) {
|
|
4346
4369
|
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
@@ -4826,16 +4849,16 @@ class TreeMapLegend {
|
|
|
4826
4849
|
// eslint-disable-next-line valid-jsdoc
|
|
4827
4850
|
/**
|
|
4828
4851
|
* To draw the legend
|
|
4852
|
+
* @private
|
|
4829
4853
|
*/
|
|
4830
4854
|
drawLegend() {
|
|
4831
|
-
const
|
|
4832
|
-
const
|
|
4833
|
-
const render = treemap.renderer;
|
|
4855
|
+
const legend = this.treemap.legendSettings;
|
|
4856
|
+
const render = this.treemap.renderer;
|
|
4834
4857
|
let fill;
|
|
4835
4858
|
let textOptions;
|
|
4836
4859
|
let gradientElement;
|
|
4837
4860
|
const textFont = legend.textStyle;
|
|
4838
|
-
this.legendGroup = render.createGroup({ id: treemap.element.id + '_Legend_Group' });
|
|
4861
|
+
this.legendGroup = render.createGroup({ id: this.treemap.element.id + '_Legend_Group' });
|
|
4839
4862
|
this.renderLegendBorder();
|
|
4840
4863
|
this.renderLegendTitle();
|
|
4841
4864
|
if (legend.mode === 'Default') {
|
|
@@ -4843,8 +4866,8 @@ class TreeMapLegend {
|
|
|
4843
4866
|
}
|
|
4844
4867
|
else {
|
|
4845
4868
|
for (let i = 0; i < this.legendRenderingCollections.length; i++) {
|
|
4846
|
-
const itemId = treemap.element.id + '_Legend_Index_' + i;
|
|
4847
|
-
const textId = treemap.element.id + '_Legend_Index_' + i + '_Text';
|
|
4869
|
+
const itemId = this.treemap.element.id + '_Legend_Index_' + i;
|
|
4870
|
+
const textId = this.treemap.element.id + '_Legend_Index_' + i + '_Text';
|
|
4848
4871
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4849
4872
|
const item = this.legendRenderingCollections[i];
|
|
4850
4873
|
gradientElement = item['element'];
|
|
@@ -4853,8 +4876,8 @@ class TreeMapLegend {
|
|
|
4853
4876
|
const textLocation = new Location(item['textX'], item['textY']);
|
|
4854
4877
|
const rectOptions = new RectOption(itemId, fill, legend.shapeBorder, legend.opacity, bounds);
|
|
4855
4878
|
if (this.treemap.enableRtl) {
|
|
4856
|
-
if (treemap.legendSettings.position === 'Left' || treemap.legendSettings.position === 'Right'
|
|
4857
|
-
|| (treemap.legendSettings.position === 'Auto'
|
|
4879
|
+
if (this.treemap.legendSettings.position === 'Left' || this.treemap.legendSettings.position === 'Right'
|
|
4880
|
+
|| (this.treemap.legendSettings.position === 'Auto'
|
|
4858
4881
|
&& this.treemap.availableSize.width >= this.treemap.availableSize.height)) {
|
|
4859
4882
|
rectOptions.y = (this.translate.y + this.legendBorderRect.y + this.legendBorderRect.height)
|
|
4860
4883
|
- (this.translate.y + rectOptions.height) - Math.abs(this.legendBorderRect.y - rectOptions.y);
|
|
@@ -4934,11 +4957,11 @@ class TreeMapLegend {
|
|
|
4934
4957
|
cancel: false, name: legendItemRendering, treemap: treemap, fill: collection['Fill'],
|
|
4935
4958
|
shape: legend.shape, imageUrl: legend.imageUrl
|
|
4936
4959
|
};
|
|
4937
|
-
|
|
4960
|
+
treemap.trigger(legendItemRendering, eventArgs, (observedArgs) => {
|
|
4938
4961
|
const renderOptions = new PathOption(shapeId, observedArgs.fill, strokeWidth, isLineShape ? collection['Fill'] : strokeColor, legend.opacity, '');
|
|
4939
4962
|
legendElement.appendChild(drawSymbol(shapeLocation, observedArgs.shape, shapeSize, observedArgs.imageUrl, renderOptions, legendText));
|
|
4940
4963
|
textOptions = new TextOption(textId, textLocation.x, textLocation.y, 'start', legendText, '', '');
|
|
4941
|
-
renderTextElement(textOptions, legend.textStyle, legend.textStyle.color ||
|
|
4964
|
+
renderTextElement(textOptions, legend.textStyle, legend.textStyle.color || treemap.themeStyle.legendTextColor, legendElement);
|
|
4942
4965
|
this.legendGroup.appendChild(legendElement);
|
|
4943
4966
|
});
|
|
4944
4967
|
}
|
|
@@ -5013,8 +5036,7 @@ class TreeMapLegend {
|
|
|
5013
5036
|
treemap.svgObject.appendChild(this.legendGroup);
|
|
5014
5037
|
}
|
|
5015
5038
|
renderLegendTitle() {
|
|
5016
|
-
const
|
|
5017
|
-
const legend = treemap.legendSettings;
|
|
5039
|
+
const legend = this.treemap.legendSettings;
|
|
5018
5040
|
const textStyle = legend.titleStyle;
|
|
5019
5041
|
const legendTitle = legend.title.text;
|
|
5020
5042
|
let textOptions;
|
|
@@ -5022,7 +5044,7 @@ class TreeMapLegend {
|
|
|
5022
5044
|
const trimTitle = textTrim((this.legendItemRect.width + (spacing * 2)), legendTitle, textStyle);
|
|
5023
5045
|
const textSize = measureText(trimTitle, textStyle);
|
|
5024
5046
|
if (legendTitle) {
|
|
5025
|
-
textOptions = new TextOption(treemap.element.id + '_LegendTitle', (this.legendItemRect.x) + (this.legendItemRect.width / 2), this.legendItemRect.y - (textSize.height / 2) - (spacing / 2), 'middle', trimTitle, '');
|
|
5047
|
+
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, '');
|
|
5026
5048
|
renderTextElement(textOptions, textStyle, textStyle.color || this.treemap.themeStyle.legendTitleColor, this.legendGroup);
|
|
5027
5049
|
}
|
|
5028
5050
|
}
|
|
@@ -5031,6 +5053,7 @@ class TreeMapLegend {
|
|
|
5031
5053
|
*
|
|
5032
5054
|
* @param {PointerEvent | TouchEvent} e - Specifies the pointer argument.
|
|
5033
5055
|
* @returns {void}
|
|
5056
|
+
* @private
|
|
5034
5057
|
*/
|
|
5035
5058
|
renderInteractivePointer(e) {
|
|
5036
5059
|
const treemap = this.treemap;
|
|
@@ -5172,6 +5195,7 @@ class TreeMapLegend {
|
|
|
5172
5195
|
this.translate = new Location(x, y);
|
|
5173
5196
|
}
|
|
5174
5197
|
}
|
|
5198
|
+
/** @private */
|
|
5175
5199
|
mouseUpHandler(e) {
|
|
5176
5200
|
this.renderInteractivePointer(e);
|
|
5177
5201
|
clearTimeout(this.clearTimeout);
|
|
@@ -5180,6 +5204,7 @@ class TreeMapLegend {
|
|
|
5180
5204
|
// eslint-disable-next-line valid-jsdoc
|
|
5181
5205
|
/**
|
|
5182
5206
|
* To remove the interactive pointer
|
|
5207
|
+
* @private
|
|
5183
5208
|
*/
|
|
5184
5209
|
removeInteractivePointer() {
|
|
5185
5210
|
if (document.getElementById(this.treemap.element.id + '_Interactive_Legend')) {
|
|
@@ -5192,17 +5217,24 @@ class TreeMapLegend {
|
|
|
5192
5217
|
*
|
|
5193
5218
|
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
5194
5219
|
* @returns {void}
|
|
5220
|
+
* @private
|
|
5195
5221
|
*/
|
|
5196
5222
|
changeNextPage(e) {
|
|
5197
5223
|
this.currentPage = (e.target.id.indexOf('_Left_Page_') > -1) ? (this.currentPage - 1) :
|
|
5198
5224
|
(this.currentPage + 1);
|
|
5199
|
-
this.
|
|
5225
|
+
if (this.currentPage >= 0 && this.currentPage < this.totalPages.length) {
|
|
5226
|
+
this.drawLegend();
|
|
5227
|
+
}
|
|
5228
|
+
else {
|
|
5229
|
+
this.currentPage = (e.target.id.indexOf('_Left_Page_') > -1) ? 0 : this.totalPages.length - 1;
|
|
5230
|
+
}
|
|
5200
5231
|
}
|
|
5201
5232
|
/**
|
|
5202
5233
|
* Wire events for event handler
|
|
5203
5234
|
*
|
|
5204
5235
|
* @param {Element} element - Specifies the element.
|
|
5205
5236
|
* @returns {void}
|
|
5237
|
+
* @private
|
|
5206
5238
|
*/
|
|
5207
5239
|
wireEvents(element) {
|
|
5208
5240
|
EventHandler.add(element, Browser.touchStartEvent, this.changeNextPage, this);
|
|
@@ -5210,6 +5242,7 @@ class TreeMapLegend {
|
|
|
5210
5242
|
// eslint-disable-next-line valid-jsdoc
|
|
5211
5243
|
/**
|
|
5212
5244
|
* To add the event listener
|
|
5245
|
+
* @private
|
|
5213
5246
|
*/
|
|
5214
5247
|
addEventListener() {
|
|
5215
5248
|
if (this.treemap.isDestroyed) {
|
|
@@ -5221,6 +5254,7 @@ class TreeMapLegend {
|
|
|
5221
5254
|
// eslint-disable-next-line valid-jsdoc
|
|
5222
5255
|
/**
|
|
5223
5256
|
* To remove the event listener
|
|
5257
|
+
* @private
|
|
5224
5258
|
*/
|
|
5225
5259
|
removeEventListener() {
|
|
5226
5260
|
if (this.treemap.isDestroyed) {
|
|
@@ -5266,6 +5300,7 @@ class TreeMapLegend {
|
|
|
5266
5300
|
* @param {ColorMappingModel} colorMap - Specifies the color mapping instance.
|
|
5267
5301
|
* @param {number} legendIndex - Specifies the index of legend.
|
|
5268
5302
|
* @returns {string} - Returns the legend color.
|
|
5303
|
+
* @private
|
|
5269
5304
|
*/
|
|
5270
5305
|
legendGradientColor(colorMap$$1, legendIndex) {
|
|
5271
5306
|
let legendFillColor;
|
|
@@ -5321,6 +5356,7 @@ class TreeMapHighlight {
|
|
|
5321
5356
|
*
|
|
5322
5357
|
* @param {PointerEvent} e - Specifies the pointer argument.
|
|
5323
5358
|
* @returns {boolean} - return the highlight process is true or false.
|
|
5359
|
+
* @private
|
|
5324
5360
|
*/
|
|
5325
5361
|
mouseMove(e) {
|
|
5326
5362
|
const treemap = this.treemap;
|
|
@@ -5530,6 +5566,7 @@ class TreeMapSelection {
|
|
|
5530
5566
|
*
|
|
5531
5567
|
* @param {PointerEvent} e - Specifies the pointer argument.
|
|
5532
5568
|
* @returns {void}
|
|
5569
|
+
* @private
|
|
5533
5570
|
*/
|
|
5534
5571
|
mouseDown(e) {
|
|
5535
5572
|
const targetEle = e.target;
|
|
@@ -5865,12 +5902,12 @@ class TreeMapTooltip {
|
|
|
5865
5902
|
markerFill = item['options']['fill'];
|
|
5866
5903
|
}
|
|
5867
5904
|
if (this.treemap.enableRtl) {
|
|
5868
|
-
tooltipContent = [textFormatter(this.tooltipSettings.format, toolTipData, this.treemap) ||
|
|
5869
|
-
formatValue(value, this.treemap) + ' : ' + this.treemap.weightValuePath.toString()];
|
|
5905
|
+
tooltipContent = [SanitizeHtmlHelper.sanitize(textFormatter(this.tooltipSettings.format, toolTipData, this.treemap)) ||
|
|
5906
|
+
SanitizeHtmlHelper.sanitize(formatValue(value, this.treemap) + ' : ' + this.treemap.weightValuePath.toString())];
|
|
5870
5907
|
}
|
|
5871
5908
|
else {
|
|
5872
|
-
tooltipContent = [textFormatter(this.tooltipSettings.format, toolTipData, this.treemap) ||
|
|
5873
|
-
this.treemap.weightValuePath.toString() + ' : ' + formatValue(value, this.treemap)];
|
|
5909
|
+
tooltipContent = [SanitizeHtmlHelper.sanitize(textFormatter(this.tooltipSettings.format, toolTipData, this.treemap)) ||
|
|
5910
|
+
SanitizeHtmlHelper.sanitize(this.treemap.weightValuePath.toString() + ' : ' + formatValue(value, this.treemap))];
|
|
5874
5911
|
}
|
|
5875
5912
|
if (document.getElementById(this.tooltipId)) {
|
|
5876
5913
|
tooltipEle = document.getElementById(this.tooltipId);
|
|
@@ -5968,6 +6005,7 @@ class TreeMapTooltip {
|
|
|
5968
6005
|
// eslint-disable-next-line valid-jsdoc
|
|
5969
6006
|
/**
|
|
5970
6007
|
* To bind events for tooltip module
|
|
6008
|
+
* @private
|
|
5971
6009
|
*/
|
|
5972
6010
|
addEventListener() {
|
|
5973
6011
|
if (this.treemap.isDestroyed) {
|
|
@@ -5979,6 +6017,7 @@ class TreeMapTooltip {
|
|
|
5979
6017
|
// eslint-disable-next-line valid-jsdoc
|
|
5980
6018
|
/**
|
|
5981
6019
|
* To unbind events for tooltip module
|
|
6020
|
+
* @private
|
|
5982
6021
|
*/
|
|
5983
6022
|
removeEventListener() {
|
|
5984
6023
|
if (this.treemap.isDestroyed) {
|