@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
|
@@ -234,7 +234,7 @@ var SubTitleSettings = /** @__PURE__ @class */ (function (_super) {
|
|
|
234
234
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
235
235
|
}
|
|
236
236
|
__decorate$1([
|
|
237
|
-
Complex({
|
|
237
|
+
Complex({ fontFamily: null }, Font)
|
|
238
238
|
], SubTitleSettings.prototype, "textStyle", void 0);
|
|
239
239
|
__decorate$1([
|
|
240
240
|
Property('Center')
|
|
@@ -250,7 +250,7 @@ var TitleSettings = /** @__PURE__ @class */ (function (_super) {
|
|
|
250
250
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
251
251
|
}
|
|
252
252
|
__decorate$1([
|
|
253
|
-
Complex({
|
|
253
|
+
Complex({ fontFamily: null }, Font)
|
|
254
254
|
], TitleSettings.prototype, "textStyle", void 0);
|
|
255
255
|
__decorate$1([
|
|
256
256
|
Property('Center')
|
|
@@ -321,7 +321,7 @@ var LegendSettings = /** @__PURE__ @class */ (function (_super) {
|
|
|
321
321
|
Property('')
|
|
322
322
|
], LegendSettings.prototype, "height", void 0);
|
|
323
323
|
__decorate$1([
|
|
324
|
-
Complex({
|
|
324
|
+
Complex({ fontFamily: null }, Font)
|
|
325
325
|
], LegendSettings.prototype, "textStyle", void 0);
|
|
326
326
|
__decorate$1([
|
|
327
327
|
Property(null)
|
|
@@ -2206,9 +2206,11 @@ var LayoutPanel = /** @__PURE__ @class */ (function () {
|
|
|
2206
2206
|
}
|
|
2207
2207
|
if (template) {
|
|
2208
2208
|
templateEle = _this.renderTemplate(secondaryEle, groupId, rect, templatePosition, template, item, isLeafItem);
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2209
|
+
if (!isNullOrUndefined(templateEle)) {
|
|
2210
|
+
templateGroup.appendChild(templateEle);
|
|
2211
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2212
|
+
_this.treemap.renderReactTemplates();
|
|
2213
|
+
}
|
|
2212
2214
|
}
|
|
2213
2215
|
itemGroup.setAttribute('aria-label', item['name']);
|
|
2214
2216
|
itemGroup.setAttribute('tabindex', (_this.treemap.tabIndex + i + 2).toString());
|
|
@@ -2347,15 +2349,18 @@ var LayoutPanel = /** @__PURE__ @class */ (function () {
|
|
|
2347
2349
|
template = template.replace(new RegExp('{{:' + keys[i] + '}}', 'g'), item['data'][keys[i].toString()]);
|
|
2348
2350
|
}
|
|
2349
2351
|
}
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2352
|
+
var labelElement;
|
|
2353
|
+
if (!isNullOrUndefined(document.getElementById(this.treemap.element.id + '_Secondary_Element'))) {
|
|
2354
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2355
|
+
var templateFn = getTemplateFunction(template);
|
|
2356
|
+
var templateElement = templateFn(item['data'], this.treemap, template, this.treemap.element.id + baseTemplateId, false);
|
|
2357
|
+
labelElement = convertElement(templateElement, templateId, item['data']);
|
|
2358
|
+
var templateSize = measureElement(labelElement, secondaryEle);
|
|
2359
|
+
var templateLocation = findLabelLocation(rect, position, templateSize, 'Template', this.treemap);
|
|
2360
|
+
labelElement.style.left = templateLocation.x + 'px';
|
|
2361
|
+
labelElement.style.top = templateLocation.y + 'px';
|
|
2362
|
+
}
|
|
2363
|
+
return labelElement;
|
|
2359
2364
|
};
|
|
2360
2365
|
LayoutPanel.prototype.labelInterSectAction = function (rect, text, textStyle, alignment) {
|
|
2361
2366
|
var textValue;
|
|
@@ -2429,6 +2434,9 @@ function getThemeStyle(theme) {
|
|
|
2429
2434
|
tooltipFontColor: '#ffffff',
|
|
2430
2435
|
legendTitleColor: '#DADADA',
|
|
2431
2436
|
legendTextColor: '#DADADA',
|
|
2437
|
+
fontSize: '15px',
|
|
2438
|
+
subtitleFontSize: '14px',
|
|
2439
|
+
legendFontSize: '13px',
|
|
2432
2440
|
fontFamily: 'Roboto, Noto, Sans-serif'
|
|
2433
2441
|
};
|
|
2434
2442
|
break;
|
|
@@ -2441,6 +2449,9 @@ function getThemeStyle(theme) {
|
|
|
2441
2449
|
tooltipFontColor: '#ffffff',
|
|
2442
2450
|
legendTitleColor: '#FFFFFF',
|
|
2443
2451
|
legendTextColor: '#FFFFFF',
|
|
2452
|
+
fontSize: '15px',
|
|
2453
|
+
subtitleFontSize: '14px',
|
|
2454
|
+
legendFontSize: '13px',
|
|
2444
2455
|
fontFamily: 'Roboto, Noto, Sans-serif'
|
|
2445
2456
|
};
|
|
2446
2457
|
break;
|
|
@@ -2457,6 +2468,7 @@ function getThemeStyle(theme) {
|
|
|
2457
2468
|
legendTextColor: '#212529',
|
|
2458
2469
|
fontFamily: 'HelveticaNeue-Medium',
|
|
2459
2470
|
fontSize: '16px',
|
|
2471
|
+
subtitleFontSize: '14px',
|
|
2460
2472
|
legendFontSize: '14px',
|
|
2461
2473
|
labelFontFamily: 'HelveticaNeue'
|
|
2462
2474
|
};
|
|
@@ -2474,6 +2486,7 @@ function getThemeStyle(theme) {
|
|
|
2474
2486
|
legendTextColor: '#374151',
|
|
2475
2487
|
fontFamily: 'Inter',
|
|
2476
2488
|
fontSize: '14px',
|
|
2489
|
+
subtitleFontSize: '12px',
|
|
2477
2490
|
legendFontSize: '12px',
|
|
2478
2491
|
labelFontFamily: 'Inter'
|
|
2479
2492
|
};
|
|
@@ -2491,6 +2504,7 @@ function getThemeStyle(theme) {
|
|
|
2491
2504
|
legendTextColor: '#D1D5DB',
|
|
2492
2505
|
fontFamily: 'Inter',
|
|
2493
2506
|
fontSize: '14px',
|
|
2507
|
+
subtitleFontSize: '12px',
|
|
2494
2508
|
legendFontSize: '12px',
|
|
2495
2509
|
labelFontFamily: 'Inter'
|
|
2496
2510
|
};
|
|
@@ -2508,6 +2522,7 @@ function getThemeStyle(theme) {
|
|
|
2508
2522
|
legendTextColor: '#212529',
|
|
2509
2523
|
fontFamily: 'Helvetica Neue',
|
|
2510
2524
|
fontSize: '14px',
|
|
2525
|
+
subtitleFontSize: '12px',
|
|
2511
2526
|
legendFontSize: '12px',
|
|
2512
2527
|
labelFontFamily: 'Helvetica Neue'
|
|
2513
2528
|
};
|
|
@@ -2525,6 +2540,7 @@ function getThemeStyle(theme) {
|
|
|
2525
2540
|
legendTextColor: '#FFFFFF',
|
|
2526
2541
|
fontFamily: 'Helvetica Neue',
|
|
2527
2542
|
fontSize: '14px',
|
|
2543
|
+
subtitleFontSize: '12px',
|
|
2528
2544
|
legendFontSize: '12px',
|
|
2529
2545
|
labelFontFamily: 'Helvetica Neue'
|
|
2530
2546
|
};
|
|
@@ -2542,6 +2558,7 @@ function getThemeStyle(theme) {
|
|
|
2542
2558
|
legendTextColor: '#201F1E',
|
|
2543
2559
|
fontFamily: 'Segoe UI',
|
|
2544
2560
|
fontSize: '14px',
|
|
2561
|
+
subtitleFontSize: '12px',
|
|
2545
2562
|
legendFontSize: '12px',
|
|
2546
2563
|
labelFontFamily: 'Segoe UI'
|
|
2547
2564
|
};
|
|
@@ -2559,6 +2576,7 @@ function getThemeStyle(theme) {
|
|
|
2559
2576
|
legendTextColor: '#F3F2F1',
|
|
2560
2577
|
fontFamily: 'Segoe UI',
|
|
2561
2578
|
fontSize: '14px',
|
|
2579
|
+
subtitleFontSize: '12px',
|
|
2562
2580
|
legendFontSize: '12px',
|
|
2563
2581
|
labelFontFamily: 'Segoe UI'
|
|
2564
2582
|
};
|
|
@@ -2572,6 +2590,9 @@ function getThemeStyle(theme) {
|
|
|
2572
2590
|
tooltipFontColor: '#ffffff',
|
|
2573
2591
|
legendTitleColor: '#353535',
|
|
2574
2592
|
legendTextColor: '#353535',
|
|
2593
|
+
fontSize: '15px',
|
|
2594
|
+
subtitleFontSize: '14px',
|
|
2595
|
+
legendFontSize: '13px',
|
|
2575
2596
|
fontFamily: 'Roboto, Noto, Sans-serif'
|
|
2576
2597
|
};
|
|
2577
2598
|
break;
|
|
@@ -3019,7 +3040,8 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3019
3040
|
};
|
|
3020
3041
|
TreeMap.prototype.elementChange = function () {
|
|
3021
3042
|
if (this.treeMapLegendModule && this.legendSettings.visible && this.treeMapLegendModule.legendGroup && this.layout.layoutGroup
|
|
3022
|
-
&& !isNullOrUndefined(this.svgObject))
|
|
3043
|
+
&& !isNullOrUndefined(this.svgObject) && !isNullOrUndefined(document.getElementById(this.layout.layoutGroup.id))
|
|
3044
|
+
&& !isNullOrUndefined(document.getElementById(this.treeMapLegendModule.legendGroup.id))) {
|
|
3023
3045
|
this.svgObject.insertBefore(this.layout.layoutGroup, this.treeMapLegendModule.legendGroup);
|
|
3024
3046
|
}
|
|
3025
3047
|
};
|
|
@@ -3041,12 +3063,15 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3041
3063
|
}
|
|
3042
3064
|
};
|
|
3043
3065
|
TreeMap.prototype.renderTitle = function (title, type, bounds, groupEle) {
|
|
3044
|
-
var style =
|
|
3066
|
+
var style = {
|
|
3067
|
+
color: title.textStyle.color, size: title.textStyle.size, fontFamily: title.textStyle.fontFamily,
|
|
3068
|
+
fontStyle: title.textStyle.fontStyle, fontWeight: title.textStyle.fontWeight, opacity: title.textStyle.opacity
|
|
3069
|
+
};
|
|
3045
3070
|
var height;
|
|
3046
3071
|
var titlePadding = 10;
|
|
3047
3072
|
var width = (this.availableSize.width - this.margin.right - this.margin.left);
|
|
3048
|
-
|
|
3049
|
-
|
|
3073
|
+
style.fontFamily = style.fontFamily || this.themeStyle.fontFamily;
|
|
3074
|
+
style.size = style.size || (type === 'title' ? this.themeStyle.fontSize : this.themeStyle.subtitleFontSize);
|
|
3050
3075
|
if (title.text) {
|
|
3051
3076
|
if (isNullOrUndefined(groupEle)) {
|
|
3052
3077
|
groupEle = this.renderer.createGroup({ id: this.element.id + '_Title_Group' });
|
|
@@ -4218,8 +4243,8 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
|
|
|
4218
4243
|
var shapePadding = legend.shapePadding;
|
|
4219
4244
|
var itemTextStyle = legend.textStyle;
|
|
4220
4245
|
var legendLength = this.legendCollections.length;
|
|
4221
|
-
|
|
4222
|
-
|
|
4246
|
+
itemTextStyle.size = itemTextStyle.size || treemap.themeStyle.legendFontSize;
|
|
4247
|
+
itemTextStyle.fontFamily = itemTextStyle.fontFamily || treemap.themeStyle.fontFamily;
|
|
4223
4248
|
if (legendMode === 'Default') {
|
|
4224
4249
|
legendWidth = (isNullOrUndefined(legendWidth)) ? treemap.areaRect.width : legendWidth;
|
|
4225
4250
|
legendHeight = (isNullOrUndefined(legendHeight)) ? treemap.areaRect.height : legendHeight;
|
|
@@ -4230,7 +4255,7 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
|
|
|
4230
4255
|
if (isNullOrUndefined(this.totalPages[this.page])) {
|
|
4231
4256
|
this.totalPages[this.page] = { Page: (this.page + 1), Collection: [] };
|
|
4232
4257
|
}
|
|
4233
|
-
var legendTextSize = measureText(legendItem['legendName'],
|
|
4258
|
+
var legendTextSize = measureText(legendItem['legendName'], itemTextStyle);
|
|
4234
4259
|
this.textMaxWidth = Math.max(this.textMaxWidth, legendTextSize.width);
|
|
4235
4260
|
if (i === 0) {
|
|
4236
4261
|
startX_1 = shapeX = (leftPadding + (shapeWidth / 2));
|
|
@@ -4327,7 +4352,6 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
|
|
|
4327
4352
|
};
|
|
4328
4353
|
}
|
|
4329
4354
|
else {
|
|
4330
|
-
var itemTextStyle_1 = legend.textStyle;
|
|
4331
4355
|
var legendLength_1 = this.legendCollections.length;
|
|
4332
4356
|
var rectWidth_1 = (orientation_1 === 'Horizontal') ? (isNullOrUndefined(legendWidth)) ? (treemap.areaRect.width / legendLength_1) :
|
|
4333
4357
|
(legendWidth / legendLength_1) : (isNullOrUndefined(legendWidth)) ? defaultSize : legendWidth;
|
|
@@ -4348,11 +4372,11 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
|
|
|
4348
4372
|
var legendText = this.legendCollections[i]['legendName'];
|
|
4349
4373
|
var itemTextSize = new Size(0, 0);
|
|
4350
4374
|
if (labelAction === 'None') {
|
|
4351
|
-
itemTextSize = measureText(legendText,
|
|
4375
|
+
itemTextSize = measureText(legendText, itemTextStyle);
|
|
4352
4376
|
}
|
|
4353
4377
|
else if (labelAction === 'Trim') {
|
|
4354
|
-
legendText = textTrim((orientation_1 === 'Horizontal' ? rectWidth_1 : rectHeight_1), legendText,
|
|
4355
|
-
itemTextSize = measureText(legendText,
|
|
4378
|
+
legendText = textTrim((orientation_1 === 'Horizontal' ? rectWidth_1 : rectHeight_1), legendText, itemTextStyle);
|
|
4379
|
+
itemTextSize = measureText(legendText, itemTextStyle);
|
|
4356
4380
|
}
|
|
4357
4381
|
else {
|
|
4358
4382
|
legendText = '';
|