@syncfusion/ej2-treemap 20.1.55 → 20.2.38
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 +3 -3
- 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 +65 -41
- package/dist/es6/ej2-treemap.es2015.js.map +1 -1
- package/dist/es6/ej2-treemap.es5.js +68 -44
- 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 +11 -11
- package/src/treemap/layout/legend.js +7 -8
- package/src/treemap/layout/render-panel.js +17 -12
- package/src/treemap/model/base.js +3 -3
- package/src/treemap/model/interface.d.ts +4 -0
- package/src/treemap/model/theme.js +16 -0
- package/src/treemap/treemap.js +11 -7
- package/src/treemap/user-interaction/highlight-selection.js +12 -12
- package/src/treemap/user-interaction/tooltip.js +1 -1
- package/src/treemap/utils/helper.js +1 -1
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 20.
|
|
3
|
+
* version : 20.2.38
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_from": "@syncfusion/ej2-treemap@*",
|
|
3
|
-
"_id": "@syncfusion/ej2-treemap@20.
|
|
3
|
+
"_id": "@syncfusion/ej2-treemap@20.2.36",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-O9p2cHCn0wOPeJGmPgjtaxXoX0un0jktwpnKK+2DxtfgxvA9C5zdUP9XJxBahzgWd0g5/XSdcAVlmUSazhJYHg==",
|
|
6
6
|
"_location": "/@syncfusion/ej2-treemap",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"/@syncfusion/ej2-react-treemap",
|
|
24
24
|
"/@syncfusion/ej2-vue-treemap"
|
|
25
25
|
],
|
|
26
|
-
"_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-treemap/-/ej2-treemap-20.
|
|
27
|
-
"_shasum": "
|
|
26
|
+
"_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-treemap/-/ej2-treemap-20.2.36.tgz",
|
|
27
|
+
"_shasum": "ae196659e471cbb0764f84dd74d64db624233128",
|
|
28
28
|
"_spec": "@syncfusion/ej2-treemap@*",
|
|
29
29
|
"_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
|
|
30
30
|
"author": {
|
|
@@ -35,12 +35,12 @@
|
|
|
35
35
|
},
|
|
36
36
|
"bundleDependencies": false,
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@syncfusion/ej2-base": "~20.
|
|
39
|
-
"@syncfusion/ej2-compression": "~20.
|
|
40
|
-
"@syncfusion/ej2-data": "~20.
|
|
41
|
-
"@syncfusion/ej2-file-utils": "~20.
|
|
42
|
-
"@syncfusion/ej2-pdf-export": "~20.
|
|
43
|
-
"@syncfusion/ej2-svg-base": "~20.
|
|
38
|
+
"@syncfusion/ej2-base": "~20.2.38",
|
|
39
|
+
"@syncfusion/ej2-compression": "~20.2.38",
|
|
40
|
+
"@syncfusion/ej2-data": "~20.2.38",
|
|
41
|
+
"@syncfusion/ej2-file-utils": "~20.2.38",
|
|
42
|
+
"@syncfusion/ej2-pdf-export": "~20.2.38",
|
|
43
|
+
"@syncfusion/ej2-svg-base": "~20.2.38"
|
|
44
44
|
},
|
|
45
45
|
"deprecated": false,
|
|
46
46
|
"description": "Essential JS 2 TreeMap Components",
|
|
@@ -73,6 +73,6 @@
|
|
|
73
73
|
"url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
|
|
74
74
|
},
|
|
75
75
|
"typings": "index.d.ts",
|
|
76
|
-
"version": "20.
|
|
76
|
+
"version": "20.2.38",
|
|
77
77
|
"sideEffects": false
|
|
78
78
|
}
|
|
@@ -99,8 +99,8 @@ var TreeMapLegend = /** @class */ (function () {
|
|
|
99
99
|
var rectHeight = void 0;
|
|
100
100
|
var itemTextStyle = legend.textStyle;
|
|
101
101
|
var legendLength = this.legendCollections.length;
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
itemTextStyle.size = itemTextStyle.size || treemap.themeStyle.legendFontSize;
|
|
103
|
+
itemTextStyle.fontFamily = itemTextStyle.fontFamily || treemap.themeStyle.fontFamily;
|
|
104
104
|
if (legendMode === 'Default') {
|
|
105
105
|
legendWidth = (isNullOrUndefined(legendWidth)) ? treemap.areaRect.width : legendWidth;
|
|
106
106
|
legendHeight = (isNullOrUndefined(legendHeight)) ? treemap.areaRect.height : legendHeight;
|
|
@@ -111,7 +111,7 @@ var TreeMapLegend = /** @class */ (function () {
|
|
|
111
111
|
if (isNullOrUndefined(this.totalPages[this.page])) {
|
|
112
112
|
this.totalPages[this.page] = { Page: (this.page + 1), Collection: [] };
|
|
113
113
|
}
|
|
114
|
-
var legendTextSize = measureText(legendItem['legendName'],
|
|
114
|
+
var legendTextSize = measureText(legendItem['legendName'], itemTextStyle);
|
|
115
115
|
this.textMaxWidth = Math.max(this.textMaxWidth, legendTextSize.width);
|
|
116
116
|
if (i === 0) {
|
|
117
117
|
startX_1 = shapeX = (leftPadding + (shapeWidth / 2));
|
|
@@ -208,7 +208,6 @@ var TreeMapLegend = /** @class */ (function () {
|
|
|
208
208
|
};
|
|
209
209
|
}
|
|
210
210
|
else {
|
|
211
|
-
var itemTextStyle_1 = legend.textStyle;
|
|
212
211
|
var legendLength_1 = this.legendCollections.length;
|
|
213
212
|
var rectWidth_1 = (orientation_1 === 'Horizontal') ? (isNullOrUndefined(legendWidth)) ? (treemap.areaRect.width / legendLength_1) :
|
|
214
213
|
(legendWidth / legendLength_1) : (isNullOrUndefined(legendWidth)) ? defaultSize : legendWidth;
|
|
@@ -229,11 +228,11 @@ var TreeMapLegend = /** @class */ (function () {
|
|
|
229
228
|
var legendText = this.legendCollections[i]['legendName'];
|
|
230
229
|
var itemTextSize = new Size(0, 0);
|
|
231
230
|
if (labelAction === 'None') {
|
|
232
|
-
itemTextSize = measureText(legendText,
|
|
231
|
+
itemTextSize = measureText(legendText, itemTextStyle);
|
|
233
232
|
}
|
|
234
233
|
else if (labelAction === 'Trim') {
|
|
235
|
-
legendText = textTrim((orientation_1 === 'Horizontal' ? rectWidth_1 : rectHeight_1), legendText,
|
|
236
|
-
itemTextSize = measureText(legendText,
|
|
234
|
+
legendText = textTrim((orientation_1 === 'Horizontal' ? rectWidth_1 : rectHeight_1), legendText, itemTextStyle);
|
|
235
|
+
itemTextSize = measureText(legendText, itemTextStyle);
|
|
237
236
|
}
|
|
238
237
|
else {
|
|
239
238
|
legendText = '';
|
|
@@ -775,7 +774,7 @@ var TreeMapLegend = /** @class */ (function () {
|
|
|
775
774
|
var stroke = void 0;
|
|
776
775
|
var strokeWidth = void 0;
|
|
777
776
|
var legendElement = void 0;
|
|
778
|
-
targetItem = treemap.layout.renderItems[parseFloat(target.id.split('
|
|
777
|
+
targetItem = treemap.layout.renderItems[parseFloat(target.id.split('_Item_Index_')[1])];
|
|
779
778
|
var svgRect = treemap.svgObject.getBoundingClientRect();
|
|
780
779
|
for (var i = 0; i < this.legendCollections.length; i++) {
|
|
781
780
|
currentData = this.legendCollections[i];
|
|
@@ -556,9 +556,11 @@ var LayoutPanel = /** @class */ (function () {
|
|
|
556
556
|
}
|
|
557
557
|
if (template) {
|
|
558
558
|
templateEle = _this.renderTemplate(secondaryEle, groupId, rect, templatePosition, template, item, isLeafItem);
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
559
|
+
if (!isNullOrUndefined(templateEle)) {
|
|
560
|
+
templateGroup.appendChild(templateEle);
|
|
561
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
562
|
+
_this.treemap.renderReactTemplates();
|
|
563
|
+
}
|
|
562
564
|
}
|
|
563
565
|
itemGroup.setAttribute('aria-label', item['name']);
|
|
564
566
|
itemGroup.setAttribute('tabindex', (_this.treemap.tabIndex + i + 2).toString());
|
|
@@ -700,15 +702,18 @@ var LayoutPanel = /** @class */ (function () {
|
|
|
700
702
|
template = template.replace(new RegExp('{{:' + keys[i] + '}}', 'g'), item['data'][keys[i].toString()]);
|
|
701
703
|
}
|
|
702
704
|
}
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
705
|
+
var labelElement;
|
|
706
|
+
if (!isNullOrUndefined(document.getElementById(this.treemap.element.id + '_Secondary_Element'))) {
|
|
707
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
708
|
+
var templateFn = getTemplateFunction(template);
|
|
709
|
+
var templateElement = templateFn(item['data'], this.treemap, template, this.treemap.element.id + baseTemplateId, false);
|
|
710
|
+
labelElement = convertElement(templateElement, templateId, item['data']);
|
|
711
|
+
var templateSize = measureElement(labelElement, secondaryEle);
|
|
712
|
+
var templateLocation = findLabelLocation(rect, position, templateSize, 'Template', this.treemap);
|
|
713
|
+
labelElement.style.left = templateLocation.x + 'px';
|
|
714
|
+
labelElement.style.top = templateLocation.y + 'px';
|
|
715
|
+
}
|
|
716
|
+
return labelElement;
|
|
712
717
|
};
|
|
713
718
|
LayoutPanel.prototype.labelInterSectAction = function (rect, text, textStyle, alignment) {
|
|
714
719
|
var textValue;
|
|
@@ -117,7 +117,7 @@ var SubTitleSettings = /** @class */ (function (_super) {
|
|
|
117
117
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
118
118
|
}
|
|
119
119
|
__decorate([
|
|
120
|
-
Complex({
|
|
120
|
+
Complex({ fontFamily: null }, Font)
|
|
121
121
|
], SubTitleSettings.prototype, "textStyle", void 0);
|
|
122
122
|
__decorate([
|
|
123
123
|
Property('Center')
|
|
@@ -134,7 +134,7 @@ var TitleSettings = /** @class */ (function (_super) {
|
|
|
134
134
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
135
135
|
}
|
|
136
136
|
__decorate([
|
|
137
|
-
Complex({
|
|
137
|
+
Complex({ fontFamily: null }, Font)
|
|
138
138
|
], TitleSettings.prototype, "textStyle", void 0);
|
|
139
139
|
__decorate([
|
|
140
140
|
Property('Center')
|
|
@@ -207,7 +207,7 @@ var LegendSettings = /** @class */ (function (_super) {
|
|
|
207
207
|
Property('')
|
|
208
208
|
], LegendSettings.prototype, "height", void 0);
|
|
209
209
|
__decorate([
|
|
210
|
-
Complex({
|
|
210
|
+
Complex({ fontFamily: null }, Font)
|
|
211
211
|
], LegendSettings.prototype, "textStyle", void 0);
|
|
212
212
|
__decorate([
|
|
213
213
|
Property(null)
|
|
@@ -496,6 +496,10 @@ export interface IThemeStyle {
|
|
|
496
496
|
* Defines the font size of the texts in the treemap, supporting the theme.
|
|
497
497
|
*/
|
|
498
498
|
fontSize?: string;
|
|
499
|
+
/**
|
|
500
|
+
* Defines the font size of the texts in the subtitle of the TreeMap, supporting the theme.
|
|
501
|
+
*/
|
|
502
|
+
subtitleFontSize?: string;
|
|
499
503
|
/**
|
|
500
504
|
* Defines the font size of the legend texts in the treemap, supporting the theme.
|
|
501
505
|
*/
|
|
@@ -48,6 +48,9 @@ export function getThemeStyle(theme) {
|
|
|
48
48
|
tooltipFontColor: '#ffffff',
|
|
49
49
|
legendTitleColor: '#DADADA',
|
|
50
50
|
legendTextColor: '#DADADA',
|
|
51
|
+
fontSize: '15px',
|
|
52
|
+
subtitleFontSize: '14px',
|
|
53
|
+
legendFontSize: '13px',
|
|
51
54
|
fontFamily: 'Roboto, Noto, Sans-serif'
|
|
52
55
|
};
|
|
53
56
|
break;
|
|
@@ -60,6 +63,9 @@ export function getThemeStyle(theme) {
|
|
|
60
63
|
tooltipFontColor: '#ffffff',
|
|
61
64
|
legendTitleColor: '#FFFFFF',
|
|
62
65
|
legendTextColor: '#FFFFFF',
|
|
66
|
+
fontSize: '15px',
|
|
67
|
+
subtitleFontSize: '14px',
|
|
68
|
+
legendFontSize: '13px',
|
|
63
69
|
fontFamily: 'Roboto, Noto, Sans-serif'
|
|
64
70
|
};
|
|
65
71
|
break;
|
|
@@ -76,6 +82,7 @@ export function getThemeStyle(theme) {
|
|
|
76
82
|
legendTextColor: '#212529',
|
|
77
83
|
fontFamily: 'HelveticaNeue-Medium',
|
|
78
84
|
fontSize: '16px',
|
|
85
|
+
subtitleFontSize: '14px',
|
|
79
86
|
legendFontSize: '14px',
|
|
80
87
|
labelFontFamily: 'HelveticaNeue'
|
|
81
88
|
};
|
|
@@ -93,6 +100,7 @@ export function getThemeStyle(theme) {
|
|
|
93
100
|
legendTextColor: '#374151',
|
|
94
101
|
fontFamily: 'Inter',
|
|
95
102
|
fontSize: '14px',
|
|
103
|
+
subtitleFontSize: '12px',
|
|
96
104
|
legendFontSize: '12px',
|
|
97
105
|
labelFontFamily: 'Inter'
|
|
98
106
|
};
|
|
@@ -110,6 +118,7 @@ export function getThemeStyle(theme) {
|
|
|
110
118
|
legendTextColor: '#D1D5DB',
|
|
111
119
|
fontFamily: 'Inter',
|
|
112
120
|
fontSize: '14px',
|
|
121
|
+
subtitleFontSize: '12px',
|
|
113
122
|
legendFontSize: '12px',
|
|
114
123
|
labelFontFamily: 'Inter'
|
|
115
124
|
};
|
|
@@ -127,6 +136,7 @@ export function getThemeStyle(theme) {
|
|
|
127
136
|
legendTextColor: '#212529',
|
|
128
137
|
fontFamily: 'Helvetica Neue',
|
|
129
138
|
fontSize: '14px',
|
|
139
|
+
subtitleFontSize: '12px',
|
|
130
140
|
legendFontSize: '12px',
|
|
131
141
|
labelFontFamily: 'Helvetica Neue'
|
|
132
142
|
};
|
|
@@ -144,6 +154,7 @@ export function getThemeStyle(theme) {
|
|
|
144
154
|
legendTextColor: '#FFFFFF',
|
|
145
155
|
fontFamily: 'Helvetica Neue',
|
|
146
156
|
fontSize: '14px',
|
|
157
|
+
subtitleFontSize: '12px',
|
|
147
158
|
legendFontSize: '12px',
|
|
148
159
|
labelFontFamily: 'Helvetica Neue'
|
|
149
160
|
};
|
|
@@ -161,6 +172,7 @@ export function getThemeStyle(theme) {
|
|
|
161
172
|
legendTextColor: '#201F1E',
|
|
162
173
|
fontFamily: 'Segoe UI',
|
|
163
174
|
fontSize: '14px',
|
|
175
|
+
subtitleFontSize: '12px',
|
|
164
176
|
legendFontSize: '12px',
|
|
165
177
|
labelFontFamily: 'Segoe UI'
|
|
166
178
|
};
|
|
@@ -178,6 +190,7 @@ export function getThemeStyle(theme) {
|
|
|
178
190
|
legendTextColor: '#F3F2F1',
|
|
179
191
|
fontFamily: 'Segoe UI',
|
|
180
192
|
fontSize: '14px',
|
|
193
|
+
subtitleFontSize: '12px',
|
|
181
194
|
legendFontSize: '12px',
|
|
182
195
|
labelFontFamily: 'Segoe UI'
|
|
183
196
|
};
|
|
@@ -191,6 +204,9 @@ export function getThemeStyle(theme) {
|
|
|
191
204
|
tooltipFontColor: '#ffffff',
|
|
192
205
|
legendTitleColor: '#353535',
|
|
193
206
|
legendTextColor: '#353535',
|
|
207
|
+
fontSize: '15px',
|
|
208
|
+
subtitleFontSize: '14px',
|
|
209
|
+
legendFontSize: '13px',
|
|
194
210
|
fontFamily: 'Roboto, Noto, Sans-serif'
|
|
195
211
|
};
|
|
196
212
|
break;
|
package/src/treemap/treemap.js
CHANGED
|
@@ -193,7 +193,8 @@ var TreeMap = /** @class */ (function (_super) {
|
|
|
193
193
|
};
|
|
194
194
|
TreeMap.prototype.elementChange = function () {
|
|
195
195
|
if (this.treeMapLegendModule && this.legendSettings.visible && this.treeMapLegendModule.legendGroup && this.layout.layoutGroup
|
|
196
|
-
&& !isNullOrUndefined(this.svgObject))
|
|
196
|
+
&& !isNullOrUndefined(this.svgObject) && !isNullOrUndefined(document.getElementById(this.layout.layoutGroup.id))
|
|
197
|
+
&& !isNullOrUndefined(document.getElementById(this.treeMapLegendModule.legendGroup.id))) {
|
|
197
198
|
this.svgObject.insertBefore(this.layout.layoutGroup, this.treeMapLegendModule.legendGroup);
|
|
198
199
|
}
|
|
199
200
|
};
|
|
@@ -215,12 +216,15 @@ var TreeMap = /** @class */ (function (_super) {
|
|
|
215
216
|
}
|
|
216
217
|
};
|
|
217
218
|
TreeMap.prototype.renderTitle = function (title, type, bounds, groupEle) {
|
|
218
|
-
var style =
|
|
219
|
+
var style = {
|
|
220
|
+
color: title.textStyle.color, size: title.textStyle.size, fontFamily: title.textStyle.fontFamily,
|
|
221
|
+
fontStyle: title.textStyle.fontStyle, fontWeight: title.textStyle.fontWeight, opacity: title.textStyle.opacity
|
|
222
|
+
};
|
|
219
223
|
var height;
|
|
220
224
|
var titlePadding = 10;
|
|
221
225
|
var width = (this.availableSize.width - this.margin.right - this.margin.left);
|
|
222
|
-
|
|
223
|
-
|
|
226
|
+
style.fontFamily = style.fontFamily || this.themeStyle.fontFamily;
|
|
227
|
+
style.size = style.size || (type === 'title' ? this.themeStyle.fontSize : this.themeStyle.subtitleFontSize);
|
|
224
228
|
if (title.text) {
|
|
225
229
|
if (isNullOrUndefined(groupEle)) {
|
|
226
230
|
groupEle = this.renderer.createGroup({ id: this.element.id + '_Title_Group' });
|
|
@@ -659,7 +663,7 @@ var TreeMap = /** @class */ (function (_super) {
|
|
|
659
663
|
this.trigger(click, clickArgs);
|
|
660
664
|
if (targetId.indexOf('_Item_Index') > -1) {
|
|
661
665
|
e.preventDefault();
|
|
662
|
-
itemIndex = parseFloat(targetId.split('
|
|
666
|
+
itemIndex = parseFloat(targetId.split('_Item_Index_')[1]);
|
|
663
667
|
eventArgs = {
|
|
664
668
|
cancel: false, name: itemClick, treemap: this, item: this.layout.renderItems[itemIndex], mouseEvent: e,
|
|
665
669
|
groupIndex: this.layout.renderItems[itemIndex]['groupIndex'], groupName: this.layout.renderItems[itemIndex]['name'],
|
|
@@ -732,7 +736,7 @@ var TreeMap = /** @class */ (function (_super) {
|
|
|
732
736
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
733
737
|
var childItems;
|
|
734
738
|
if (targetId.indexOf('_Item_Index') > -1) {
|
|
735
|
-
item = this.layout.renderItems[parseFloat(targetId.split('
|
|
739
|
+
item = this.layout.renderItems[parseFloat(targetId.split('_Item_Index_')[1])];
|
|
736
740
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
737
741
|
childItems = findChildren(item)['values'];
|
|
738
742
|
this.element.style.cursor = (!item['isLeafItem'] && childItems && childItems.length > 0 && this.enableDrillDown) ?
|
|
@@ -860,7 +864,7 @@ var TreeMap = /** @class */ (function (_super) {
|
|
|
860
864
|
if (e.cancelable) {
|
|
861
865
|
e.preventDefault();
|
|
862
866
|
}
|
|
863
|
-
index = parseFloat(targetId.split('
|
|
867
|
+
index = parseFloat(targetId.split('_Item_Index_')[1]);
|
|
864
868
|
item = this.layout.renderItems[index];
|
|
865
869
|
var labelText = targetEle.innerHTML;
|
|
866
870
|
if (this.enableBreadcrumb) {
|
|
@@ -43,14 +43,14 @@ var TreeMapHighlight = /** @class */ (function () {
|
|
|
43
43
|
if (this.highLightId !== targetId) {
|
|
44
44
|
treeMapElement = document.getElementById(treemap.element.id + '_TreeMap_' + treemap.layoutType + '_Layout');
|
|
45
45
|
var selectionElements = document.getElementsByClassName('treeMapSelection');
|
|
46
|
-
item = this.treemap.layout.renderItems[parseFloat(targetId.split('
|
|
46
|
+
item = this.treemap.layout.renderItems[parseFloat(targetId.split('_Item_Index_')[1])];
|
|
47
47
|
var index = void 0;
|
|
48
48
|
if (this.treemap.legendSettings.visible) {
|
|
49
49
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
50
50
|
var collection = this.treemap.treeMapLegendModule.legendCollections;
|
|
51
51
|
var length_1 = this.treemap.treeMapLegendModule.legendCollections.length;
|
|
52
52
|
index = getLegendIndex(length_1, item, treemap);
|
|
53
|
-
this.shapeElement = this.treemap.legendSettings.mode === 'Default' ? document.getElementById('
|
|
53
|
+
this.shapeElement = this.treemap.legendSettings.mode === 'Default' ? document.getElementById(this.treemap.element.id + '_Legend_Shape_Index_' + index) : document.getElementById(this.treemap.element.id + '_Legend_Index_' + index);
|
|
54
54
|
if (this.shapeElement !== null && (selectionModule ? this.shapeElement.getAttribute('id') !== selectionModule.legendSelectId : true)) {
|
|
55
55
|
if (selectionModule ? this.shapeElement !== selectionModule.shapeElement : true) {
|
|
56
56
|
this.currentElement.push({ currentElement: this.shapeElement });
|
|
@@ -78,7 +78,7 @@ var TreeMapHighlight = /** @class */ (function () {
|
|
|
78
78
|
for (var i = 0; i < treeMapElement.childElementCount; i++) {
|
|
79
79
|
element = treeMapElement.childNodes[i];
|
|
80
80
|
process = true;
|
|
81
|
-
item = treemap.layout.renderItems[element.id.split('
|
|
81
|
+
item = treemap.layout.renderItems[parseFloat(element.id.split('_Item_Index_')[1])];
|
|
82
82
|
for (var j = 0; j < selectionElements.length; j++) {
|
|
83
83
|
if (element.id === selectionElements[j].id) {
|
|
84
84
|
process = false;
|
|
@@ -116,7 +116,7 @@ var TreeMapHighlight = /** @class */ (function () {
|
|
|
116
116
|
removeLegend(this.legendHighlightCollection, 'highlight');
|
|
117
117
|
}
|
|
118
118
|
this.shapeTarget = 'highlight';
|
|
119
|
-
var index = this.treemap.legendSettings.mode === 'Default' ? parseFloat(targetId.split('
|
|
119
|
+
var index = this.treemap.legendSettings.mode === 'Default' ? parseFloat(targetId.split('_Legend_Shape_Index_')[1]) : parseFloat(targetId.split('_Legend_Index_')[1]);
|
|
120
120
|
var dataLength = this.treemap.treeMapLegendModule.legendCollections[index]['legendData'].length;
|
|
121
121
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
122
122
|
var collection = this.treemap.treeMapLegendModule.legendCollections;
|
|
@@ -126,7 +126,7 @@ var TreeMapHighlight = /** @class */ (function () {
|
|
|
126
126
|
if (this.treemap.treeMapLegendModule.legendCollections[index]['legendData'][i]['levelOrderName'] === this.treemap.layout.renderItems[j]['levelOrderName']) {
|
|
127
127
|
itemIndex = j;
|
|
128
128
|
groupIndex = this.treemap.layout.renderItems[j]['groupIndex'];
|
|
129
|
-
var nodeEle = document.getElementById('
|
|
129
|
+
var nodeEle = document.getElementById(this.treemap.element.id + '_Level_Index_' + groupIndex + '_Item_Index_' + itemIndex + '_RectPath');
|
|
130
130
|
if (i === 0) {
|
|
131
131
|
this.legendHighlightCollection = [];
|
|
132
132
|
pushCollection(this.legendHighlightCollection, legendIndex, j, targetEle, nodeEle, this.treemap.layout.renderItems, collection);
|
|
@@ -250,7 +250,7 @@ var TreeMapSelection = /** @class */ (function () {
|
|
|
250
250
|
e.preventDefault();
|
|
251
251
|
if (this.treemap.selectionId !== targetId && this.legendSelect) {
|
|
252
252
|
treeMapElement = document.getElementById(layoutID);
|
|
253
|
-
item = treemap.layout.renderItems[parseFloat(targetId.split('
|
|
253
|
+
item = treemap.layout.renderItems[parseFloat(targetId.split('_Item_Index_')[1])];
|
|
254
254
|
var index = void 0;
|
|
255
255
|
if (this.treemap.legendSettings.visible) {
|
|
256
256
|
this.shapeSelect = false;
|
|
@@ -264,7 +264,7 @@ var TreeMapSelection = /** @class */ (function () {
|
|
|
264
264
|
highlightModule.shapeHighlightCollection = [];
|
|
265
265
|
}
|
|
266
266
|
index = getLegendIndex(length_3, item, treemap);
|
|
267
|
-
this.shapeElement = this.treemap.legendSettings.mode === 'Default' ? document.getElementById('
|
|
267
|
+
this.shapeElement = this.treemap.legendSettings.mode === 'Default' ? document.getElementById(this.treemap.element.id + '_Legend_Shape_Index_' + index) : document.getElementById(this.treemap.element.id + '_Legend_Index_' + index);
|
|
268
268
|
if (this.shapeElement !== null) {
|
|
269
269
|
this.shapeSelectId = this.shapeElement.getAttribute('id');
|
|
270
270
|
this.shapeSelectionCollection.push({ legendEle: this.shapeElement, oldFill: collection[index]['legendFill'],
|
|
@@ -277,7 +277,7 @@ var TreeMapSelection = /** @class */ (function () {
|
|
|
277
277
|
orders = findHightLightItems(item, [], selection.mode, treemap);
|
|
278
278
|
for (var i = 0; i < treeMapElement.childElementCount; i++) {
|
|
279
279
|
element = treeMapElement.childNodes[i];
|
|
280
|
-
item = treemap.layout.renderItems[element.id.split('
|
|
280
|
+
item = treemap.layout.renderItems[parseFloat(element.id.split('_Item_Index_')[1])];
|
|
281
281
|
if (orders.indexOf(item['levelOrderName']) > -1) {
|
|
282
282
|
selectionElements.push(element);
|
|
283
283
|
treemap.levelSelection.push(element.id);
|
|
@@ -337,14 +337,14 @@ var TreeMapSelection = /** @class */ (function () {
|
|
|
337
337
|
if (highlightModule) {
|
|
338
338
|
highlightModule.shapeTarget = 'selection';
|
|
339
339
|
}
|
|
340
|
-
var index = this.treemap.legendSettings.mode === 'Default' ? parseFloat(targetId.split('
|
|
340
|
+
var index = this.treemap.legendSettings.mode === 'Default' ? parseFloat(targetId.split('_Legend_Shape_Index_')[1]) : parseFloat(targetId.split('_Legend_Index_')[1]);
|
|
341
341
|
var dataLength = this.treemap.treeMapLegendModule.legendCollections[index]['legendData'].length;
|
|
342
342
|
for (var k = 0; k < dataLength; k++) {
|
|
343
343
|
for (var l = 0; l < this.treemap.layout.renderItems.length; l++) {
|
|
344
344
|
if (this.treemap.treeMapLegendModule.legendCollections[index]['legendData'][k]['levelOrderName'] === this.treemap.layout.renderItems[l]['levelOrderName']) {
|
|
345
345
|
itemIndex = l;
|
|
346
346
|
groupIndex = this.treemap.layout.renderItems[l]['groupIndex'];
|
|
347
|
-
var nodeEle = document.getElementById('
|
|
347
|
+
var nodeEle = document.getElementById(this.treemap.element.id + '_Level_Index_' + groupIndex + '_Item_Index_' + itemIndex + '_RectPath');
|
|
348
348
|
if (k === 0) {
|
|
349
349
|
pushCollection(this.legendSelectionCollection, legendIndex, l, targetEle_1, nodeEle, this.treemap.layout.renderItems, collection);
|
|
350
350
|
length_4 = this.legendSelectionCollection.length;
|
|
@@ -396,7 +396,7 @@ var TreeMapSelection = /** @class */ (function () {
|
|
|
396
396
|
var orders = findHightLightItems(item, [], selection.mode, this.treemap);
|
|
397
397
|
for (var i = 0; i < treeMapElement.childElementCount; i++) {
|
|
398
398
|
element = treeMapElement.childNodes[i];
|
|
399
|
-
item = this.treemap.layout.renderItems[element.id.split('
|
|
399
|
+
item = this.treemap.layout.renderItems[parseFloat(element.id.split('_Item_Index_')[1])];
|
|
400
400
|
if (orders.indexOf(item['levelOrderName']) > -1) {
|
|
401
401
|
selectionElements.push(element);
|
|
402
402
|
this.treemap.levelSelection.push(element.id);
|
|
@@ -412,7 +412,7 @@ var TreeMapSelection = /** @class */ (function () {
|
|
|
412
412
|
this.shapeElement = undefined;
|
|
413
413
|
removeShape(this.shapeSelectionCollection, 'selection');
|
|
414
414
|
index = getLegendIndex(length_5, items[m], this.treemap);
|
|
415
|
-
this.shapeElement = this.treemap.legendSettings.mode === 'Default' ? document.getElementById('
|
|
415
|
+
this.shapeElement = this.treemap.legendSettings.mode === 'Default' ? document.getElementById(this.treemap.element.id + '_Legend_Shape_Index_' + index) : document.getElementById(this.treemap.element.id + '_Legend_Index_' + index);
|
|
416
416
|
if (this.shapeElement !== null) {
|
|
417
417
|
this.shapeSelectId = this.shapeElement.getAttribute('id');
|
|
418
418
|
this.treemap.legendId.push(this.shapeSelectId);
|
|
@@ -54,7 +54,7 @@ var TreeMapTooltip = /** @class */ (function () {
|
|
|
54
54
|
var tooltipContent = [];
|
|
55
55
|
var markerFill;
|
|
56
56
|
if (targetId.indexOf('_Item_Index') > -1) {
|
|
57
|
-
item = this.treemap.layout.renderItems[parseFloat(targetId.split('
|
|
57
|
+
item = this.treemap.layout.renderItems[parseFloat(targetId.split('_Item_Index_')[1])];
|
|
58
58
|
if (!isNullOrUndefined(item)) {
|
|
59
59
|
toolTipHeader = item['name'];
|
|
60
60
|
value = item['weight'];
|
|
@@ -762,7 +762,7 @@ export function removeClassNames(elements, type, treemap) {
|
|
|
762
762
|
for (var j = 0; j < elements.length; j++) {
|
|
763
763
|
element = isNullOrUndefined(elements[j].childNodes[0]) ? elements[j] :
|
|
764
764
|
elements[j].childNodes[0];
|
|
765
|
-
options = treemap.layout.renderItems[element.id.split('
|
|
765
|
+
options = treemap.layout.renderItems[parseFloat(element.id.split('_Item_Index_')[1])]['options'];
|
|
766
766
|
applyOptions(element, options);
|
|
767
767
|
elements[j].classList.remove(type);
|
|
768
768
|
j -= 1;
|