@syncfusion/ej2-treemap 20.1.59 → 20.2.43
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 +2 -10
- 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 +47 -23
- package/dist/es6/ej2-treemap.es2015.js.map +1 -1
- package/dist/es6/ej2-treemap.es5.js +50 -26
- 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 +6 -7
- 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 +8 -4
|
@@ -198,7 +198,7 @@ __decorate$1([
|
|
|
198
198
|
class SubTitleSettings extends CommonTitleSettings {
|
|
199
199
|
}
|
|
200
200
|
__decorate$1([
|
|
201
|
-
Complex({
|
|
201
|
+
Complex({ fontFamily: null }, Font)
|
|
202
202
|
], SubTitleSettings.prototype, "textStyle", void 0);
|
|
203
203
|
__decorate$1([
|
|
204
204
|
Property('Center')
|
|
@@ -209,7 +209,7 @@ __decorate$1([
|
|
|
209
209
|
class TitleSettings extends CommonTitleSettings {
|
|
210
210
|
}
|
|
211
211
|
__decorate$1([
|
|
212
|
-
Complex({
|
|
212
|
+
Complex({ fontFamily: null }, Font)
|
|
213
213
|
], TitleSettings.prototype, "textStyle", void 0);
|
|
214
214
|
__decorate$1([
|
|
215
215
|
Property('Center')
|
|
@@ -270,7 +270,7 @@ __decorate$1([
|
|
|
270
270
|
Property('')
|
|
271
271
|
], LegendSettings.prototype, "height", void 0);
|
|
272
272
|
__decorate$1([
|
|
273
|
-
Complex({
|
|
273
|
+
Complex({ fontFamily: null }, Font)
|
|
274
274
|
], LegendSettings.prototype, "textStyle", void 0);
|
|
275
275
|
__decorate$1([
|
|
276
276
|
Property(null)
|
|
@@ -2111,9 +2111,11 @@ class LayoutPanel {
|
|
|
2111
2111
|
}
|
|
2112
2112
|
if (template) {
|
|
2113
2113
|
templateEle = this.renderTemplate(secondaryEle, groupId, rect, templatePosition, template, item, isLeafItem);
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2114
|
+
if (!isNullOrUndefined(templateEle)) {
|
|
2115
|
+
templateGroup.appendChild(templateEle);
|
|
2116
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2117
|
+
this.treemap.renderReactTemplates();
|
|
2118
|
+
}
|
|
2117
2119
|
}
|
|
2118
2120
|
itemGroup.setAttribute('aria-label', item['name']);
|
|
2119
2121
|
itemGroup.setAttribute('tabindex', (this.treemap.tabIndex + i + 2).toString());
|
|
@@ -2248,15 +2250,18 @@ class LayoutPanel {
|
|
|
2248
2250
|
template = template.replace(new RegExp('{{:' + keys[i] + '}}', 'g'), item['data'][keys[i].toString()]);
|
|
2249
2251
|
}
|
|
2250
2252
|
}
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2253
|
+
let labelElement;
|
|
2254
|
+
if (!isNullOrUndefined(document.getElementById(this.treemap.element.id + '_Secondary_Element'))) {
|
|
2255
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2256
|
+
const templateFn = getTemplateFunction(template);
|
|
2257
|
+
const templateElement = templateFn(item['data'], this.treemap, template, this.treemap.element.id + baseTemplateId, false);
|
|
2258
|
+
labelElement = convertElement(templateElement, templateId, item['data']);
|
|
2259
|
+
const templateSize = measureElement(labelElement, secondaryEle);
|
|
2260
|
+
const templateLocation = findLabelLocation(rect, position, templateSize, 'Template', this.treemap);
|
|
2261
|
+
labelElement.style.left = templateLocation.x + 'px';
|
|
2262
|
+
labelElement.style.top = templateLocation.y + 'px';
|
|
2263
|
+
}
|
|
2264
|
+
return labelElement;
|
|
2260
2265
|
}
|
|
2261
2266
|
labelInterSectAction(rect, text, textStyle, alignment) {
|
|
2262
2267
|
let textValue;
|
|
@@ -2329,6 +2334,9 @@ function getThemeStyle(theme) {
|
|
|
2329
2334
|
tooltipFontColor: '#ffffff',
|
|
2330
2335
|
legendTitleColor: '#DADADA',
|
|
2331
2336
|
legendTextColor: '#DADADA',
|
|
2337
|
+
fontSize: '15px',
|
|
2338
|
+
subtitleFontSize: '14px',
|
|
2339
|
+
legendFontSize: '13px',
|
|
2332
2340
|
fontFamily: 'Roboto, Noto, Sans-serif'
|
|
2333
2341
|
};
|
|
2334
2342
|
break;
|
|
@@ -2341,6 +2349,9 @@ function getThemeStyle(theme) {
|
|
|
2341
2349
|
tooltipFontColor: '#ffffff',
|
|
2342
2350
|
legendTitleColor: '#FFFFFF',
|
|
2343
2351
|
legendTextColor: '#FFFFFF',
|
|
2352
|
+
fontSize: '15px',
|
|
2353
|
+
subtitleFontSize: '14px',
|
|
2354
|
+
legendFontSize: '13px',
|
|
2344
2355
|
fontFamily: 'Roboto, Noto, Sans-serif'
|
|
2345
2356
|
};
|
|
2346
2357
|
break;
|
|
@@ -2357,6 +2368,7 @@ function getThemeStyle(theme) {
|
|
|
2357
2368
|
legendTextColor: '#212529',
|
|
2358
2369
|
fontFamily: 'HelveticaNeue-Medium',
|
|
2359
2370
|
fontSize: '16px',
|
|
2371
|
+
subtitleFontSize: '14px',
|
|
2360
2372
|
legendFontSize: '14px',
|
|
2361
2373
|
labelFontFamily: 'HelveticaNeue'
|
|
2362
2374
|
};
|
|
@@ -2374,6 +2386,7 @@ function getThemeStyle(theme) {
|
|
|
2374
2386
|
legendTextColor: '#374151',
|
|
2375
2387
|
fontFamily: 'Inter',
|
|
2376
2388
|
fontSize: '14px',
|
|
2389
|
+
subtitleFontSize: '12px',
|
|
2377
2390
|
legendFontSize: '12px',
|
|
2378
2391
|
labelFontFamily: 'Inter'
|
|
2379
2392
|
};
|
|
@@ -2391,6 +2404,7 @@ function getThemeStyle(theme) {
|
|
|
2391
2404
|
legendTextColor: '#D1D5DB',
|
|
2392
2405
|
fontFamily: 'Inter',
|
|
2393
2406
|
fontSize: '14px',
|
|
2407
|
+
subtitleFontSize: '12px',
|
|
2394
2408
|
legendFontSize: '12px',
|
|
2395
2409
|
labelFontFamily: 'Inter'
|
|
2396
2410
|
};
|
|
@@ -2408,6 +2422,7 @@ function getThemeStyle(theme) {
|
|
|
2408
2422
|
legendTextColor: '#212529',
|
|
2409
2423
|
fontFamily: 'Helvetica Neue',
|
|
2410
2424
|
fontSize: '14px',
|
|
2425
|
+
subtitleFontSize: '12px',
|
|
2411
2426
|
legendFontSize: '12px',
|
|
2412
2427
|
labelFontFamily: 'Helvetica Neue'
|
|
2413
2428
|
};
|
|
@@ -2425,6 +2440,7 @@ function getThemeStyle(theme) {
|
|
|
2425
2440
|
legendTextColor: '#FFFFFF',
|
|
2426
2441
|
fontFamily: 'Helvetica Neue',
|
|
2427
2442
|
fontSize: '14px',
|
|
2443
|
+
subtitleFontSize: '12px',
|
|
2428
2444
|
legendFontSize: '12px',
|
|
2429
2445
|
labelFontFamily: 'Helvetica Neue'
|
|
2430
2446
|
};
|
|
@@ -2442,6 +2458,7 @@ function getThemeStyle(theme) {
|
|
|
2442
2458
|
legendTextColor: '#201F1E',
|
|
2443
2459
|
fontFamily: 'Segoe UI',
|
|
2444
2460
|
fontSize: '14px',
|
|
2461
|
+
subtitleFontSize: '12px',
|
|
2445
2462
|
legendFontSize: '12px',
|
|
2446
2463
|
labelFontFamily: 'Segoe UI'
|
|
2447
2464
|
};
|
|
@@ -2459,6 +2476,7 @@ function getThemeStyle(theme) {
|
|
|
2459
2476
|
legendTextColor: '#F3F2F1',
|
|
2460
2477
|
fontFamily: 'Segoe UI',
|
|
2461
2478
|
fontSize: '14px',
|
|
2479
|
+
subtitleFontSize: '12px',
|
|
2462
2480
|
legendFontSize: '12px',
|
|
2463
2481
|
labelFontFamily: 'Segoe UI'
|
|
2464
2482
|
};
|
|
@@ -2472,6 +2490,9 @@ function getThemeStyle(theme) {
|
|
|
2472
2490
|
tooltipFontColor: '#ffffff',
|
|
2473
2491
|
legendTitleColor: '#353535',
|
|
2474
2492
|
legendTextColor: '#353535',
|
|
2493
|
+
fontSize: '15px',
|
|
2494
|
+
subtitleFontSize: '14px',
|
|
2495
|
+
legendFontSize: '13px',
|
|
2475
2496
|
fontFamily: 'Roboto, Noto, Sans-serif'
|
|
2476
2497
|
};
|
|
2477
2498
|
break;
|
|
@@ -2896,7 +2917,8 @@ let TreeMap = class TreeMap extends Component {
|
|
|
2896
2917
|
}
|
|
2897
2918
|
elementChange() {
|
|
2898
2919
|
if (this.treeMapLegendModule && this.legendSettings.visible && this.treeMapLegendModule.legendGroup && this.layout.layoutGroup
|
|
2899
|
-
&& !isNullOrUndefined(this.svgObject))
|
|
2920
|
+
&& !isNullOrUndefined(this.svgObject) && !isNullOrUndefined(document.getElementById(this.layout.layoutGroup.id))
|
|
2921
|
+
&& !isNullOrUndefined(document.getElementById(this.treeMapLegendModule.legendGroup.id))) {
|
|
2900
2922
|
this.svgObject.insertBefore(this.layout.layoutGroup, this.treeMapLegendModule.legendGroup);
|
|
2901
2923
|
}
|
|
2902
2924
|
}
|
|
@@ -2918,12 +2940,15 @@ let TreeMap = class TreeMap extends Component {
|
|
|
2918
2940
|
}
|
|
2919
2941
|
}
|
|
2920
2942
|
renderTitle(title, type, bounds, groupEle) {
|
|
2921
|
-
const style =
|
|
2943
|
+
const style = {
|
|
2944
|
+
color: title.textStyle.color, size: title.textStyle.size, fontFamily: title.textStyle.fontFamily,
|
|
2945
|
+
fontStyle: title.textStyle.fontStyle, fontWeight: title.textStyle.fontWeight, opacity: title.textStyle.opacity
|
|
2946
|
+
};
|
|
2922
2947
|
let height;
|
|
2923
2948
|
const titlePadding = 10;
|
|
2924
2949
|
const width = (this.availableSize.width - this.margin.right - this.margin.left);
|
|
2925
|
-
|
|
2926
|
-
|
|
2950
|
+
style.fontFamily = style.fontFamily || this.themeStyle.fontFamily;
|
|
2951
|
+
style.size = style.size || (type === 'title' ? this.themeStyle.fontSize : this.themeStyle.subtitleFontSize);
|
|
2927
2952
|
if (title.text) {
|
|
2928
2953
|
if (isNullOrUndefined(groupEle)) {
|
|
2929
2954
|
groupEle = this.renderer.createGroup({ id: this.element.id + '_Title_Group' });
|
|
@@ -4075,8 +4100,8 @@ class TreeMapLegend {
|
|
|
4075
4100
|
const shapePadding = legend.shapePadding;
|
|
4076
4101
|
const itemTextStyle = legend.textStyle;
|
|
4077
4102
|
const legendLength = this.legendCollections.length;
|
|
4078
|
-
|
|
4079
|
-
|
|
4103
|
+
itemTextStyle.size = itemTextStyle.size || treemap.themeStyle.legendFontSize;
|
|
4104
|
+
itemTextStyle.fontFamily = itemTextStyle.fontFamily || treemap.themeStyle.fontFamily;
|
|
4080
4105
|
if (legendMode === 'Default') {
|
|
4081
4106
|
legendWidth = (isNullOrUndefined(legendWidth)) ? treemap.areaRect.width : legendWidth;
|
|
4082
4107
|
legendHeight = (isNullOrUndefined(legendHeight)) ? treemap.areaRect.height : legendHeight;
|
|
@@ -4087,7 +4112,7 @@ class TreeMapLegend {
|
|
|
4087
4112
|
if (isNullOrUndefined(this.totalPages[this.page])) {
|
|
4088
4113
|
this.totalPages[this.page] = { Page: (this.page + 1), Collection: [] };
|
|
4089
4114
|
}
|
|
4090
|
-
const legendTextSize = measureText(legendItem['legendName'],
|
|
4115
|
+
const legendTextSize = measureText(legendItem['legendName'], itemTextStyle);
|
|
4091
4116
|
this.textMaxWidth = Math.max(this.textMaxWidth, legendTextSize.width);
|
|
4092
4117
|
if (i === 0) {
|
|
4093
4118
|
startX = shapeX = (leftPadding + (shapeWidth / 2));
|
|
@@ -4184,7 +4209,6 @@ class TreeMapLegend {
|
|
|
4184
4209
|
};
|
|
4185
4210
|
}
|
|
4186
4211
|
else {
|
|
4187
|
-
const itemTextStyle = legend.textStyle;
|
|
4188
4212
|
const legendLength = this.legendCollections.length;
|
|
4189
4213
|
const rectWidth = (orientation === 'Horizontal') ? (isNullOrUndefined(legendWidth)) ? (treemap.areaRect.width / legendLength) :
|
|
4190
4214
|
(legendWidth / legendLength) : (isNullOrUndefined(legendWidth)) ? defaultSize : legendWidth;
|