@syncfusion/ej2-treemap 21.2.10 → 22.1.34
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/.eslintrc.json +1 -0
- 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 +125 -18
- package/dist/es6/ej2-treemap.es2015.js.map +1 -1
- package/dist/es6/ej2-treemap.es5.js +125 -18
- 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 +2 -0
- package/src/treemap/layout/render-panel.js +2 -1
- package/src/treemap/model/base-model.d.ts +7 -4
- package/src/treemap/model/base.d.ts +7 -4
- package/src/treemap/model/base.js +5 -5
- package/src/treemap/model/image-export.js +14 -3
- package/src/treemap/model/interface.d.ts +15 -1
- package/src/treemap/model/pdf-export.js +4 -2
- package/src/treemap/model/print.js +14 -2
- package/src/treemap/model/theme.js +72 -0
- package/src/treemap/treemap-model.d.ts +1 -1
- package/src/treemap/treemap.js +7 -6
- package/src/treemap/user-interaction/tooltip.js +3 -0
- package/src/treemap/utils/enum.d.ts +5 -1
- package/src/treemap/utils/helper.d.ts +1 -1
- package/src/treemap/utils/helper.js +4 -1
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version :
|
|
3
|
+
* version : 22.1.34
|
|
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@
|
|
3
|
+
"_id": "@syncfusion/ej2-treemap@16.31.19",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-Zd0QP8PC3dYhL0gNq60V2FFbZA39NcVMG0N1Ta95KdJOGa4o2dMv4AkYCb9AEP7ET8QZyINPYHW/cJJM2AdQUg==",
|
|
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": "https://nexus.syncfusion.com/repository/ej2-
|
|
27
|
-
"_shasum": "
|
|
26
|
+
"_resolved": "https://nexus.syncfusion.com/repository/ej2-release/@syncfusion/ej2-treemap/-/ej2-treemap-16.31.19.tgz",
|
|
27
|
+
"_shasum": "9886c29bc2547d8c1f38499e3b95aa49f4a678f8",
|
|
28
28
|
"_spec": "@syncfusion/ej2-treemap@*",
|
|
29
29
|
"_where": "/jenkins/workspace/elease-automation_release_21.1.1/packages/included",
|
|
30
30
|
"author": {
|
|
@@ -35,12 +35,12 @@
|
|
|
35
35
|
},
|
|
36
36
|
"bundleDependencies": false,
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@syncfusion/ej2-base": "~
|
|
39
|
-
"@syncfusion/ej2-compression": "~
|
|
40
|
-
"@syncfusion/ej2-data": "~
|
|
41
|
-
"@syncfusion/ej2-file-utils": "~
|
|
42
|
-
"@syncfusion/ej2-pdf-export": "~
|
|
43
|
-
"@syncfusion/ej2-svg-base": "~
|
|
38
|
+
"@syncfusion/ej2-base": "~22.1.34",
|
|
39
|
+
"@syncfusion/ej2-compression": "~22.1.34",
|
|
40
|
+
"@syncfusion/ej2-data": "~22.1.34",
|
|
41
|
+
"@syncfusion/ej2-file-utils": "~22.1.34",
|
|
42
|
+
"@syncfusion/ej2-pdf-export": "~22.1.34",
|
|
43
|
+
"@syncfusion/ej2-svg-base": "~22.1.34"
|
|
44
44
|
},
|
|
45
45
|
"deprecated": false,
|
|
46
46
|
"description": "Essential JS 2 TreeMap Components",
|
|
@@ -81,6 +81,6 @@
|
|
|
81
81
|
"url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
|
|
82
82
|
},
|
|
83
83
|
"typings": "index.d.ts",
|
|
84
|
-
"version": "
|
|
84
|
+
"version": "22.1.34",
|
|
85
85
|
"sideEffects": false
|
|
86
86
|
}
|
|
@@ -97,6 +97,7 @@ var TreeMapLegend = /** @class */ (function () {
|
|
|
97
97
|
var legendHeight = (legend.height.length > 1) ? (legend.height.indexOf('%') > -1) ?
|
|
98
98
|
(treemap.availableSize.height / 100) * parseFloat(legend.height) : parseFloat(legend.height) : null;
|
|
99
99
|
titleTextStyle.fontFamily = treemap.themeStyle.fontFamily || titleTextStyle.fontFamily;
|
|
100
|
+
titleTextStyle.fontWeight = titleTextStyle.fontWeight || treemap.themeStyle.titleFontWeight;
|
|
100
101
|
titleTextStyle.size = treemap.themeStyle.legendFontSize || titleTextStyle.size;
|
|
101
102
|
var legendTitleSize = measureText(legendTitle, titleTextStyle);
|
|
102
103
|
var startX_1 = 0;
|
|
@@ -105,6 +106,7 @@ var TreeMapLegend = /** @class */ (function () {
|
|
|
105
106
|
var itemTextStyle = legend.textStyle;
|
|
106
107
|
itemTextStyle.size = itemTextStyle.size || treemap.themeStyle.legendFontSize;
|
|
107
108
|
itemTextStyle.fontFamily = itemTextStyle.fontFamily || treemap.themeStyle.fontFamily;
|
|
109
|
+
itemTextStyle.fontWeight = itemTextStyle.fontWeight || treemap.themeStyle.fontWeight;
|
|
108
110
|
if (legendMode === 'Default') {
|
|
109
111
|
legendWidth = (isNullOrUndefined(legendWidth)) ? treemap.areaRect.width : legendWidth;
|
|
110
112
|
legendHeight = (isNullOrUndefined(legendHeight)) ? treemap.areaRect.height : legendHeight;
|
|
@@ -516,6 +516,7 @@ var LayoutPanel = /** @class */ (function () {
|
|
|
516
516
|
treeMap.enableRtl ? renderText + ' [-]' : '[-] ' + renderText : renderText;
|
|
517
517
|
textStyle = (isLeafItem ? leaf.labelStyle : levels[index].headerStyle);
|
|
518
518
|
textStyle.fontFamily = this_1.treemap.themeStyle.labelFontFamily || textStyle.fontFamily;
|
|
519
|
+
textStyle.fontWeight = textStyle.fontWeight || this_1.treemap.themeStyle.fontWeight;
|
|
519
520
|
border = isLeafItem ? leaf.border : levels[index].border;
|
|
520
521
|
position = !isLeafItem ? (levels[index].headerAlignment) === 'Near' ? 'TopLeft' : (levels[index].headerAlignment) === 'Center' ?
|
|
521
522
|
'TopCenter' : 'TopRight' : leaf.labelPosition;
|
|
@@ -675,7 +676,7 @@ var LayoutPanel = /** @class */ (function () {
|
|
|
675
676
|
secondaryEle, groupId, rect, position, template, item, isLeafItem) {
|
|
676
677
|
var templateId = isLeafItem ? groupId + '_LabelTemplate' : groupId + '_HeaderTemplate';
|
|
677
678
|
var baseTemplateId = isLeafItem ? '_LabelTemplate' : '_HeaderTemplate';
|
|
678
|
-
if (isNullOrUndefined(template['prototype'])) {
|
|
679
|
+
if (isNullOrUndefined(template['prototype']) && typeof template === 'string') {
|
|
679
680
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
680
681
|
var keys = Object.keys(item['data']);
|
|
681
682
|
for (var i = 0; i < keys.length; i++) {
|
|
@@ -85,7 +85,7 @@ export interface FontModel {
|
|
|
85
85
|
/**
|
|
86
86
|
* Sets and gets the font weight for the text in the treemap.
|
|
87
87
|
*
|
|
88
|
-
* @default
|
|
88
|
+
* @default null
|
|
89
89
|
*/
|
|
90
90
|
fontWeight?: string;
|
|
91
91
|
|
|
@@ -519,8 +519,9 @@ export interface LeafItemSettingsModel {
|
|
|
519
519
|
* Sets and gets the label template of leaf item in the treemap to render custom elements in the labels.
|
|
520
520
|
*
|
|
521
521
|
* @default null
|
|
522
|
+
* @aspType string
|
|
522
523
|
*/
|
|
523
|
-
labelTemplate?: string;
|
|
524
|
+
labelTemplate?: string | Function;
|
|
524
525
|
|
|
525
526
|
/**
|
|
526
527
|
* Sets and gets the position of the label template of treemap leaf item.
|
|
@@ -559,8 +560,9 @@ export interface TooltipSettingsModel {
|
|
|
559
560
|
* Sets and gets the template for tooltip in the treemap.
|
|
560
561
|
*
|
|
561
562
|
* @default ''
|
|
563
|
+
* @aspType string
|
|
562
564
|
*/
|
|
563
|
-
template?: string;
|
|
565
|
+
template?: string | Function;
|
|
564
566
|
|
|
565
567
|
/**
|
|
566
568
|
* Sets and gets the string to format the tooltip in the treemap.
|
|
@@ -755,8 +757,9 @@ export interface LevelSettingsModel {
|
|
|
755
757
|
* Sets and gets the template for header in the treemap.
|
|
756
758
|
*
|
|
757
759
|
* @default null
|
|
760
|
+
* @aspType string
|
|
758
761
|
*/
|
|
759
|
-
headerTemplate?: string;
|
|
762
|
+
headerTemplate?: string | Function;
|
|
760
763
|
|
|
761
764
|
/**
|
|
762
765
|
* Sets and gets the string to format the header label of the level leaf items in the treemap.
|
|
@@ -77,7 +77,7 @@ export declare class Font extends ChildProperty<Font> {
|
|
|
77
77
|
/**
|
|
78
78
|
* Sets and gets the font weight for the text in the treemap.
|
|
79
79
|
*
|
|
80
|
-
* @default
|
|
80
|
+
* @default null
|
|
81
81
|
*/
|
|
82
82
|
fontWeight: string;
|
|
83
83
|
/**
|
|
@@ -439,8 +439,9 @@ export declare class LeafItemSettings extends ChildProperty<LeafItemSettings> {
|
|
|
439
439
|
* Sets and gets the label template of leaf item in the treemap to render custom elements in the labels.
|
|
440
440
|
*
|
|
441
441
|
* @default null
|
|
442
|
+
* @aspType string
|
|
442
443
|
*/
|
|
443
|
-
labelTemplate: string;
|
|
444
|
+
labelTemplate: string | Function;
|
|
444
445
|
/**
|
|
445
446
|
* Sets and gets the position of the label template of treemap leaf item.
|
|
446
447
|
*
|
|
@@ -472,8 +473,9 @@ export declare class TooltipSettings extends ChildProperty<TooltipSettings> {
|
|
|
472
473
|
* Sets and gets the template for tooltip in the treemap.
|
|
473
474
|
*
|
|
474
475
|
* @default ''
|
|
476
|
+
* @aspType string
|
|
475
477
|
*/
|
|
476
|
-
template: string;
|
|
478
|
+
template: string | Function;
|
|
477
479
|
/**
|
|
478
480
|
* Sets and gets the string to format the tooltip in the treemap.
|
|
479
481
|
*
|
|
@@ -637,8 +639,9 @@ export declare class LevelSettings extends ChildProperty<LevelSettings> {
|
|
|
637
639
|
* Sets and gets the template for header in the treemap.
|
|
638
640
|
*
|
|
639
641
|
* @default null
|
|
642
|
+
* @aspType string
|
|
640
643
|
*/
|
|
641
|
-
headerTemplate: string;
|
|
644
|
+
headerTemplate: string | Function;
|
|
642
645
|
/**
|
|
643
646
|
* Sets and gets the string to format the header label of the level leaf items in the treemap.
|
|
644
647
|
*
|
|
@@ -80,7 +80,7 @@ var Font = /** @class */ (function (_super) {
|
|
|
80
80
|
Property(defaultFont)
|
|
81
81
|
], Font.prototype, "fontFamily", void 0);
|
|
82
82
|
__decorate([
|
|
83
|
-
Property('
|
|
83
|
+
Property('')
|
|
84
84
|
], Font.prototype, "fontWeight", void 0);
|
|
85
85
|
__decorate([
|
|
86
86
|
Property('Normal')
|
|
@@ -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({ fontFamily: null }, Font)
|
|
120
|
+
Complex({ fontFamily: null, fontWeight: 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({ fontFamily: null }, Font)
|
|
137
|
+
Complex({ fontFamily: null, fontWeight: 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({ fontFamily: null }, Font)
|
|
210
|
+
Complex({ size: '12px', fontFamily: null, fontWeight: null }, Font)
|
|
211
211
|
], LegendSettings.prototype, "textStyle", void 0);
|
|
212
212
|
__decorate([
|
|
213
213
|
Property(null)
|
|
@@ -375,7 +375,7 @@ var TooltipSettings = /** @class */ (function (_super) {
|
|
|
375
375
|
Complex({}, Border)
|
|
376
376
|
], TooltipSettings.prototype, "border", void 0);
|
|
377
377
|
__decorate([
|
|
378
|
-
Complex({ fontFamily: defaultFont, size:
|
|
378
|
+
Complex({ fontFamily: defaultFont, size: null, fontWeight: null }, Font)
|
|
379
379
|
], TooltipSettings.prototype, "textStyle", void 0);
|
|
380
380
|
return TooltipSettings;
|
|
381
381
|
}(ChildProperty));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createElement, Browser } from '@syncfusion/ej2-base';
|
|
1
|
+
import { createElement, Browser, isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
2
2
|
import { triggerDownload } from '../utils/helper';
|
|
3
3
|
/**
|
|
4
4
|
* ImageExport module handles the export to image functionality for treemap.
|
|
@@ -34,12 +34,23 @@ var ImageExport = /** @class */ (function () {
|
|
|
34
34
|
'width': treeMap.availableSize.width.toString()
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
|
+
var exportElement = treeMap.svgObject.cloneNode(true);
|
|
38
|
+
var backgroundElement = exportElement.childNodes[0];
|
|
39
|
+
if (!isNullOrUndefined(backgroundElement)) {
|
|
40
|
+
var backgroundColor = backgroundElement.getAttribute('fill');
|
|
41
|
+
if ((treeMap.theme === 'Tailwind' || treeMap.theme === 'Bootstrap5' || treeMap.theme === 'Fluent' || treeMap.theme === 'Material3') && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
|
|
42
|
+
exportElement.childNodes[0].setAttribute('fill', 'rgba(255,255,255, 1)');
|
|
43
|
+
}
|
|
44
|
+
else if ((treeMap.theme === 'TailwindDark' || treeMap.theme === 'Bootstrap5Dark' || treeMap.theme === 'FluentDark' || treeMap.theme === 'Material3Dark') && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
|
|
45
|
+
exportElement.childNodes[0].setAttribute('fill', 'rgba(0, 0, 0, 1)');
|
|
46
|
+
}
|
|
47
|
+
}
|
|
37
48
|
var isDownload = !(Browser.userAgent.toString().indexOf('HeadlessChrome') > -1);
|
|
38
49
|
var svgData = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">' +
|
|
39
|
-
|
|
50
|
+
exportElement.outerHTML +
|
|
40
51
|
'</svg>';
|
|
41
52
|
var url = window.URL.createObjectURL(new Blob(type === 'SVG' ? [svgData] :
|
|
42
|
-
[(new XMLSerializer()).serializeToString(
|
|
53
|
+
[(new XMLSerializer()).serializeToString(exportElement)], { type: 'image/svg+xml' }));
|
|
43
54
|
if (type === 'SVG') {
|
|
44
55
|
if (allowDownload) {
|
|
45
56
|
triggerDownload(fileName, type, url, isDownload);
|
|
@@ -370,8 +370,10 @@ export interface ITreeMapTooltipArgs extends ITreeMapEventArgs {
|
|
|
370
370
|
textStyle: FontModel;
|
|
371
371
|
/**
|
|
372
372
|
* Defines the template for rendering the tooltip.
|
|
373
|
+
*
|
|
374
|
+
* @aspType string
|
|
373
375
|
*/
|
|
374
|
-
template: string;
|
|
376
|
+
template: string | Function;
|
|
375
377
|
}
|
|
376
378
|
/**
|
|
377
379
|
* Specifies the event arguments available when rendering each legend item in the treemap.
|
|
@@ -463,6 +465,10 @@ export interface IThemeStyle {
|
|
|
463
465
|
* Defines the title text color of the treemap, supporting the theme.
|
|
464
466
|
*/
|
|
465
467
|
titleFontColor: string;
|
|
468
|
+
/**
|
|
469
|
+
* Defines the title font weight of the treemap, supporting the theme.
|
|
470
|
+
*/
|
|
471
|
+
titleFontWeight: string;
|
|
466
472
|
/**
|
|
467
473
|
* Defines the subtitle text color of the treemap, supporting the theme.
|
|
468
474
|
*/
|
|
@@ -475,6 +481,10 @@ export interface IThemeStyle {
|
|
|
475
481
|
* Defines the tooltip text color of the treemap supporting the theme.
|
|
476
482
|
*/
|
|
477
483
|
tooltipFontColor: string;
|
|
484
|
+
/**
|
|
485
|
+
* Defines the tooltip text size of the treemap supporting the theme.
|
|
486
|
+
*/
|
|
487
|
+
tooltipFontSize: string;
|
|
478
488
|
/**
|
|
479
489
|
* Defines the opacity of tooltip in the treemap, supporting the theme.
|
|
480
490
|
*/
|
|
@@ -491,6 +501,10 @@ export interface IThemeStyle {
|
|
|
491
501
|
* Defines the color of the legend text in the treemap, supporting the theme.
|
|
492
502
|
*/
|
|
493
503
|
legendTextColor: string;
|
|
504
|
+
/**
|
|
505
|
+
* Defines the font weight of texts in the treemap, supporting the theme.
|
|
506
|
+
*/
|
|
507
|
+
fontWeight?: string;
|
|
494
508
|
/**
|
|
495
509
|
* Defines the font family of texts in the treemap, supporting the theme.
|
|
496
510
|
*/
|
|
@@ -40,10 +40,12 @@ var PdfExport = /** @class */ (function () {
|
|
|
40
40
|
var backgroundElement = exportElement.childNodes[0];
|
|
41
41
|
if (!isNullOrUndefined(backgroundElement)) {
|
|
42
42
|
var backgroundColor = backgroundElement.getAttribute('fill');
|
|
43
|
-
if ((treeMap.theme === 'Tailwind' || treeMap.theme === '
|
|
44
|
-
|| treeMap.theme === 'Fluent' || treeMap.theme === 'FluentDark') && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
|
|
43
|
+
if ((treeMap.theme === 'Tailwind' || treeMap.theme === 'Bootstrap5' || treeMap.theme === 'Fluent' || treeMap.theme === 'Material3') && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
|
|
45
44
|
exportElement.childNodes[0].setAttribute('fill', 'rgba(255,255,255, 1)');
|
|
46
45
|
}
|
|
46
|
+
else if ((treeMap.theme === 'TailwindDark' || treeMap.theme === 'Bootstrap5Dark' || treeMap.theme === 'FluentDark' || treeMap.theme === 'Material3Dark') && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
|
|
47
|
+
exportElement.childNodes[0].setAttribute('fill', 'rgba(0, 0, 0, 1)');
|
|
48
|
+
}
|
|
47
49
|
}
|
|
48
50
|
var url = window.URL.createObjectURL(new Blob([(new XMLSerializer()).serializeToString(exportElement)], { type: 'image/svg+xml' }));
|
|
49
51
|
var image = new Image();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { print as printFunction, createElement } from '@syncfusion/ej2-base';
|
|
1
|
+
import { print as printFunction, createElement, isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
2
2
|
import { getElement } from '../utils/helper';
|
|
3
3
|
import { beforePrint } from '../model/constants';
|
|
4
4
|
/**
|
|
@@ -60,7 +60,19 @@ var Print = /** @class */ (function () {
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
else {
|
|
63
|
-
|
|
63
|
+
var exportElement = treeMap.element.cloneNode(true);
|
|
64
|
+
var backgroundElement = exportElement.childNodes[1];
|
|
65
|
+
if (!isNullOrUndefined(backgroundElement)) {
|
|
66
|
+
backgroundElement = backgroundElement.childNodes[0];
|
|
67
|
+
var backgroundColor = backgroundElement.getAttribute('fill');
|
|
68
|
+
if ((treeMap.theme === 'Tailwind' || treeMap.theme === 'Bootstrap5' || treeMap.theme === 'Fluent' || treeMap.theme === 'Material3') && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
|
|
69
|
+
exportElement.childNodes[1].childNodes[0].setAttribute('fill', 'rgba(255,255,255, 1)');
|
|
70
|
+
}
|
|
71
|
+
else if ((treeMap.theme === 'TailwindDark' || treeMap.theme === 'Bootstrap5Dark' || treeMap.theme === 'FluentDark' || treeMap.theme === 'Material3Dark') && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
|
|
72
|
+
exportElement.childNodes[1].childNodes[0].setAttribute('fill', 'rgba(0, 0, 0, 1)');
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
div.appendChild(exportElement);
|
|
64
76
|
}
|
|
65
77
|
return div;
|
|
66
78
|
};
|
|
@@ -43,12 +43,15 @@ export function getThemeStyle(theme) {
|
|
|
43
43
|
style = {
|
|
44
44
|
backgroundColor: color,
|
|
45
45
|
titleFontColor: '#FFFFFF',
|
|
46
|
+
titleFontWeight: 'Normal',
|
|
46
47
|
subTitleFontColor: '#FFFFFF',
|
|
47
48
|
tooltipFillColor: '#363F4C',
|
|
48
49
|
tooltipFontColor: '#ffffff',
|
|
50
|
+
tooltipFontSize: '13px',
|
|
49
51
|
legendTitleColor: '#DADADA',
|
|
50
52
|
legendTextColor: '#DADADA',
|
|
51
53
|
fontSize: '15px',
|
|
54
|
+
fontWeight: 'Normal',
|
|
52
55
|
subtitleFontSize: '14px',
|
|
53
56
|
legendFontSize: '13px',
|
|
54
57
|
fontFamily: 'Roboto, Noto, Sans-serif'
|
|
@@ -58,12 +61,15 @@ export function getThemeStyle(theme) {
|
|
|
58
61
|
style = {
|
|
59
62
|
backgroundColor: '#000000',
|
|
60
63
|
titleFontColor: '#FFFFFF',
|
|
64
|
+
titleFontWeight: 'Normal',
|
|
61
65
|
subTitleFontColor: '#FFFFFF',
|
|
62
66
|
tooltipFillColor: '#363F4C',
|
|
63
67
|
tooltipFontColor: '#ffffff',
|
|
68
|
+
tooltipFontSize: '13px',
|
|
64
69
|
legendTitleColor: '#FFFFFF',
|
|
65
70
|
legendTextColor: '#FFFFFF',
|
|
66
71
|
fontSize: '15px',
|
|
72
|
+
fontWeight: 'Normal',
|
|
67
73
|
subtitleFontSize: '14px',
|
|
68
74
|
legendFontSize: '13px',
|
|
69
75
|
fontFamily: 'Roboto, Noto, Sans-serif'
|
|
@@ -73,15 +79,18 @@ export function getThemeStyle(theme) {
|
|
|
73
79
|
style = {
|
|
74
80
|
backgroundColor: '#FFFFFF',
|
|
75
81
|
titleFontColor: '#212529',
|
|
82
|
+
titleFontWeight: 'Normal',
|
|
76
83
|
subTitleFontColor: '#212529',
|
|
77
84
|
tooltipFillColor: '#000000',
|
|
78
85
|
tooltipFontColor: '#FFFFFF',
|
|
86
|
+
tooltipFontSize: '13px',
|
|
79
87
|
tooltipFillOpacity: 1,
|
|
80
88
|
tooltipTextOpacity: 0.9,
|
|
81
89
|
legendTitleColor: '#212529',
|
|
82
90
|
legendTextColor: '#212529',
|
|
83
91
|
fontFamily: 'HelveticaNeue-Medium',
|
|
84
92
|
fontSize: '16px',
|
|
93
|
+
fontWeight: 'Normal',
|
|
85
94
|
subtitleFontSize: '14px',
|
|
86
95
|
legendFontSize: '14px',
|
|
87
96
|
labelFontFamily: 'HelveticaNeue'
|
|
@@ -91,15 +100,18 @@ export function getThemeStyle(theme) {
|
|
|
91
100
|
style = {
|
|
92
101
|
backgroundColor: 'transparent',
|
|
93
102
|
titleFontColor: '#374151',
|
|
103
|
+
titleFontWeight: 'Normal',
|
|
94
104
|
subTitleFontColor: '#374151',
|
|
95
105
|
tooltipFillColor: '#111827',
|
|
96
106
|
tooltipFontColor: '#F9FAFB',
|
|
107
|
+
tooltipFontSize: '13px',
|
|
97
108
|
tooltipFillOpacity: 1,
|
|
98
109
|
tooltipTextOpacity: 1,
|
|
99
110
|
legendTitleColor: '#374151',
|
|
100
111
|
legendTextColor: '#374151',
|
|
101
112
|
fontFamily: 'Inter',
|
|
102
113
|
fontSize: '14px',
|
|
114
|
+
fontWeight: 'Normal',
|
|
103
115
|
subtitleFontSize: '12px',
|
|
104
116
|
legendFontSize: '12px',
|
|
105
117
|
labelFontFamily: 'Inter'
|
|
@@ -109,14 +121,17 @@ export function getThemeStyle(theme) {
|
|
|
109
121
|
style = {
|
|
110
122
|
backgroundColor: 'transparent',
|
|
111
123
|
titleFontColor: '#D1D5DB',
|
|
124
|
+
titleFontWeight: 'Normal',
|
|
112
125
|
subTitleFontColor: '#D1D5DB',
|
|
113
126
|
tooltipFillColor: '#F9FAFB',
|
|
114
127
|
tooltipFontColor: '#1F2937',
|
|
128
|
+
tooltipFontSize: '13px',
|
|
115
129
|
tooltipFillOpacity: 1,
|
|
116
130
|
tooltipTextOpacity: 1,
|
|
117
131
|
legendTitleColor: '#D1D5DB',
|
|
118
132
|
legendTextColor: '#D1D5DB',
|
|
119
133
|
fontFamily: 'Inter',
|
|
134
|
+
fontWeight: 'Normal',
|
|
120
135
|
fontSize: '14px',
|
|
121
136
|
subtitleFontSize: '12px',
|
|
122
137
|
legendFontSize: '12px',
|
|
@@ -127,15 +142,18 @@ export function getThemeStyle(theme) {
|
|
|
127
142
|
style = {
|
|
128
143
|
backgroundColor: 'rgba(255,255,255, 0.0)',
|
|
129
144
|
titleFontColor: '#212529',
|
|
145
|
+
titleFontWeight: 'Normal',
|
|
130
146
|
subTitleFontColor: '#212529',
|
|
131
147
|
tooltipFillColor: '#212529',
|
|
132
148
|
tooltipFontColor: '#F9FAFB',
|
|
149
|
+
tooltipFontSize: '13px',
|
|
133
150
|
tooltipFillOpacity: 1,
|
|
134
151
|
tooltipTextOpacity: 1,
|
|
135
152
|
legendTitleColor: '#212529',
|
|
136
153
|
legendTextColor: '#212529',
|
|
137
154
|
fontFamily: 'Helvetica Neue',
|
|
138
155
|
fontSize: '14px',
|
|
156
|
+
fontWeight: 'Normal',
|
|
139
157
|
subtitleFontSize: '12px',
|
|
140
158
|
legendFontSize: '12px',
|
|
141
159
|
labelFontFamily: 'Helvetica Neue'
|
|
@@ -145,15 +163,18 @@ export function getThemeStyle(theme) {
|
|
|
145
163
|
style = {
|
|
146
164
|
backgroundColor: 'rgba(255,255,255, 0.0)',
|
|
147
165
|
titleFontColor: '#FFFFFF',
|
|
166
|
+
titleFontWeight: 'Normal',
|
|
148
167
|
subTitleFontColor: '#FFFFFF',
|
|
149
168
|
tooltipFillColor: '#E9ECEF',
|
|
150
169
|
tooltipFontColor: '#212529',
|
|
170
|
+
tooltipFontSize: '13px',
|
|
151
171
|
tooltipFillOpacity: 1,
|
|
152
172
|
tooltipTextOpacity: 1,
|
|
153
173
|
legendTitleColor: '#FFFFFF',
|
|
154
174
|
legendTextColor: '#FFFFFF',
|
|
155
175
|
fontFamily: 'Helvetica Neue',
|
|
156
176
|
fontSize: '14px',
|
|
177
|
+
fontWeight: 'Normal',
|
|
157
178
|
subtitleFontSize: '12px',
|
|
158
179
|
legendFontSize: '12px',
|
|
159
180
|
labelFontFamily: 'Helvetica Neue'
|
|
@@ -163,15 +184,18 @@ export function getThemeStyle(theme) {
|
|
|
163
184
|
style = {
|
|
164
185
|
backgroundColor: 'rgba(255,255,255, 0.0)',
|
|
165
186
|
titleFontColor: '#201F1E',
|
|
187
|
+
titleFontWeight: 'Normal',
|
|
166
188
|
subTitleFontColor: '#201F1E',
|
|
167
189
|
tooltipFillColor: '#FFFFFF',
|
|
168
190
|
tooltipFontColor: '#323130',
|
|
191
|
+
tooltipFontSize: '13px',
|
|
169
192
|
tooltipFillOpacity: 1,
|
|
170
193
|
tooltipTextOpacity: 1,
|
|
171
194
|
legendTitleColor: '#201F1E',
|
|
172
195
|
legendTextColor: '#201F1E',
|
|
173
196
|
fontFamily: 'Segoe UI',
|
|
174
197
|
fontSize: '14px',
|
|
198
|
+
fontWeight: 'Normal',
|
|
175
199
|
subtitleFontSize: '12px',
|
|
176
200
|
legendFontSize: '12px',
|
|
177
201
|
labelFontFamily: 'Segoe UI'
|
|
@@ -181,30 +205,78 @@ export function getThemeStyle(theme) {
|
|
|
181
205
|
style = {
|
|
182
206
|
backgroundColor: 'rgba(255,255,255, 0.0)',
|
|
183
207
|
titleFontColor: '#F3F2F1',
|
|
208
|
+
titleFontWeight: 'Normal',
|
|
184
209
|
subTitleFontColor: '#F3F2F1',
|
|
185
210
|
tooltipFillColor: '#252423',
|
|
186
211
|
tooltipFontColor: '#F3F2F1',
|
|
212
|
+
tooltipFontSize: '13px',
|
|
187
213
|
tooltipFillOpacity: 1,
|
|
188
214
|
tooltipTextOpacity: 1,
|
|
189
215
|
legendTitleColor: '#F3F2F1',
|
|
190
216
|
legendTextColor: '#F3F2F1',
|
|
191
217
|
fontFamily: 'Segoe UI',
|
|
192
218
|
fontSize: '14px',
|
|
219
|
+
fontWeight: 'Normal',
|
|
193
220
|
subtitleFontSize: '12px',
|
|
194
221
|
legendFontSize: '12px',
|
|
195
222
|
labelFontFamily: 'Segoe UI'
|
|
196
223
|
};
|
|
197
224
|
break;
|
|
225
|
+
case 'material3':
|
|
226
|
+
style = {
|
|
227
|
+
backgroundColor: 'transparent',
|
|
228
|
+
titleFontColor: '#1C1B1F',
|
|
229
|
+
titleFontWeight: '500',
|
|
230
|
+
subTitleFontColor: '#1C1B1F',
|
|
231
|
+
tooltipFillColor: '#313033',
|
|
232
|
+
tooltipFontColor: '#F4EFF4',
|
|
233
|
+
tooltipFontSize: '14px',
|
|
234
|
+
tooltipFillOpacity: 1,
|
|
235
|
+
tooltipTextOpacity: 1,
|
|
236
|
+
legendTitleColor: '#1C1B1F',
|
|
237
|
+
legendTextColor: '#49454E',
|
|
238
|
+
fontFamily: 'Roboto',
|
|
239
|
+
fontSize: '16px',
|
|
240
|
+
fontWeight: '400',
|
|
241
|
+
subtitleFontSize: '14px',
|
|
242
|
+
legendFontSize: '14px',
|
|
243
|
+
labelFontFamily: 'Roboto'
|
|
244
|
+
};
|
|
245
|
+
break;
|
|
246
|
+
case 'material3dark':
|
|
247
|
+
style = {
|
|
248
|
+
backgroundColor: 'transparent',
|
|
249
|
+
titleFontColor: '#E6E1E5',
|
|
250
|
+
titleFontWeight: '500',
|
|
251
|
+
subTitleFontColor: '#E6E1E5',
|
|
252
|
+
tooltipFillColor: '#E6E1E5',
|
|
253
|
+
tooltipFontColor: '#313033',
|
|
254
|
+
tooltipFontSize: '14px',
|
|
255
|
+
tooltipFillOpacity: 1,
|
|
256
|
+
tooltipTextOpacity: 1,
|
|
257
|
+
legendTitleColor: '#E6E1E5',
|
|
258
|
+
legendTextColor: '#CAC4D0',
|
|
259
|
+
fontFamily: 'Roboto',
|
|
260
|
+
fontSize: '16px',
|
|
261
|
+
fontWeight: '400',
|
|
262
|
+
subtitleFontSize: '14px',
|
|
263
|
+
legendFontSize: '14px',
|
|
264
|
+
labelFontFamily: 'Roboto'
|
|
265
|
+
};
|
|
266
|
+
break;
|
|
198
267
|
default:
|
|
199
268
|
style = {
|
|
200
269
|
backgroundColor: '#FFFFFF',
|
|
201
270
|
titleFontColor: '#424242',
|
|
271
|
+
titleFontWeight: 'Normal',
|
|
202
272
|
subTitleFontColor: '#424242',
|
|
203
273
|
tooltipFillColor: '#363F4C',
|
|
204
274
|
tooltipFontColor: '#ffffff',
|
|
275
|
+
tooltipFontSize: '13px',
|
|
205
276
|
legendTitleColor: '#353535',
|
|
206
277
|
legendTextColor: '#353535',
|
|
207
278
|
fontSize: '15px',
|
|
279
|
+
fontWeight: 'Normal',
|
|
208
280
|
subtitleFontSize: '14px',
|
|
209
281
|
legendFontSize: '13px',
|
|
210
282
|
fontFamily: 'Roboto, Noto, Sans-serif'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, NotifyPropertyChanges, INotifyPropertyChanged, Property, extend,
|
|
1
|
+
import { Component, NotifyPropertyChanges, INotifyPropertyChanged, Property, extend, Fetch } from '@syncfusion/ej2-base';import { Complex, Collection, ModuleDeclaration } from '@syncfusion/ej2-base';import { Event, EmitType, Internationalization } from '@syncfusion/ej2-base';import { SvgRenderer } from '@syncfusion/ej2-svg-base';import { isNullOrUndefined, createElement, EventHandler, Browser, remove } from '@syncfusion/ej2-base';import { BorderModel, TitleSettingsModel, MarginModel, LevelSettingsModel, FontModel } from './model/base-model';import { LeafItemSettingsModel, TooltipSettingsModel, LegendSettingsModel, InitialDrillSettingsModel } from './model/base-model';import { HighlightSettingsModel, SelectionSettingsModel } from './model/base-model';import { Border, Margin, TitleSettings, LegendSettings, InitialDrillSettings } from './model/base';import { SelectionSettings, TooltipSettings, LevelSettings, LeafItemSettings, HighlightSettings } from './model/base';import { LayoutMode, TreeMapTheme, RenderingMode } from './utils/enum';import { ILoadEventArgs, ILoadedEventArgs, IPrintEventArgs } from '../treemap/model/interface';import { ILegendItemRenderingEventArgs, ILegendRenderingEventArgs } from '../treemap/model/interface';import { IItemRenderingEventArgs, IResizeEventArgs, IDoubleClickEventArgs, IRightClickEventArgs } from '../treemap/model/interface';import { IItemClickEventArgs, IItemMoveEventArgs, IClickEventArgs, IMouseMoveEventArgs } from '../treemap/model/interface';import { IDrillStartEventArgs, IItemSelectedEventArgs, ITreeMapTooltipRenderEventArgs } from '../treemap/model/interface';import { IItemHighlightEventArgs, IDrillEndEventArgs, IThemeStyle } from '../treemap/model/interface';import { Size, stringToNumber, RectOption, Rect, textTrim, measureText, findChildren, removeElement, setItemTemplateContent } from '../treemap/utils/helper';import { removeClassNames, removeShape, textFormatter } from '../treemap/utils/helper';import { findPosition, Location, TextOption, renderTextElement, isContainsData, TreeMapAjax } from '../treemap/utils/helper';import { load, loaded, drillStart, drillEnd } from '../treemap/model/constants';import { itemClick, itemMove, click, mouseMove, resize, doubleClick, rightClick } from '../treemap/model/constants';import { LayoutPanel } from './layout/render-panel';import { TreeMapTooltip } from './user-interaction/tooltip';import { ExportType } from '../treemap/utils/enum';import { PdfPageOrientation } from '@syncfusion/ej2-pdf-export';import { TreeMapHighlight, TreeMapSelection } from './user-interaction/highlight-selection';import { TreeMapLegend } from './layout/legend';import { DataManager, Query } from '@syncfusion/ej2-data';import { getThemeStyle } from './model/theme';import { Print } from './model/print';import { ImageExport } from './model/image-export';import { PdfExport } from './model/pdf-export';
|
|
2
2
|
import {ComponentModel} from '@syncfusion/ej2-base';
|
|
3
3
|
|
|
4
4
|
/**
|
package/src/treemap/treemap.js
CHANGED
|
@@ -20,7 +20,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
20
20
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
21
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
22
|
};
|
|
23
|
-
import { Component, NotifyPropertyChanges, Property, extend,
|
|
23
|
+
import { Component, NotifyPropertyChanges, Property, extend, Fetch } from '@syncfusion/ej2-base';
|
|
24
24
|
import { Complex, Collection } from '@syncfusion/ej2-base';
|
|
25
25
|
import { Event, Internationalization } from '@syncfusion/ej2-base';
|
|
26
26
|
import { SvgRenderer } from '@syncfusion/ej2-svg-base';
|
|
@@ -107,7 +107,7 @@ var TreeMap = /** @class */ (function (_super) {
|
|
|
107
107
|
var _this = this;
|
|
108
108
|
var dataModule;
|
|
109
109
|
var queryModule;
|
|
110
|
-
var
|
|
110
|
+
var fetchApiModule;
|
|
111
111
|
var localAjax;
|
|
112
112
|
if (this.dataSource instanceof DataManager) {
|
|
113
113
|
dataModule = this.dataSource;
|
|
@@ -122,12 +122,12 @@ var TreeMap = /** @class */ (function (_super) {
|
|
|
122
122
|
}
|
|
123
123
|
else if (this.dataSource instanceof TreeMapAjax) {
|
|
124
124
|
localAjax = this.dataSource;
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
_this.dataSource =
|
|
125
|
+
fetchApiModule = new Fetch(localAjax.dataOptions, localAjax.type, localAjax.contentType);
|
|
126
|
+
fetchApiModule.onSuccess = function (args) {
|
|
127
|
+
_this.dataSource = args;
|
|
128
128
|
_this.renderTreeMapElements();
|
|
129
129
|
};
|
|
130
|
-
|
|
130
|
+
fetchApiModule.send(localAjax.sendData);
|
|
131
131
|
}
|
|
132
132
|
else {
|
|
133
133
|
this.renderTreeMapElements();
|
|
@@ -229,6 +229,7 @@ var TreeMap = /** @class */ (function (_super) {
|
|
|
229
229
|
var titlePadding = 10;
|
|
230
230
|
var width = (this.availableSize.width - this.margin.right - this.margin.left);
|
|
231
231
|
style.fontFamily = style.fontFamily || this.themeStyle.fontFamily;
|
|
232
|
+
style.fontWeight = style.fontWeight || this.themeStyle.titleFontWeight;
|
|
232
233
|
style.size = style.size || (type === 'title' ? this.themeStyle.fontSize : this.themeStyle.subtitleFontSize);
|
|
233
234
|
if (title.text) {
|
|
234
235
|
if (isNullOrUndefined(groupEle)) {
|
|
@@ -80,7 +80,10 @@ var TreeMapTooltip = /** @class */ (function () {
|
|
|
80
80
|
}
|
|
81
81
|
location = getMousePosition(pageX, pageY, this.treemap.svgObject);
|
|
82
82
|
location.y = (this.tooltipSettings.template) ? location.y + 10 : location.y;
|
|
83
|
+
this.tooltipSettings.textStyle.size = this.tooltipSettings.textStyle.size || this.treemap.themeStyle.tooltipFontSize;
|
|
83
84
|
this.tooltipSettings.textStyle.fontFamily = this.treemap.themeStyle.fontFamily;
|
|
85
|
+
this.tooltipSettings.textStyle.fontStyle = !isNullOrUndefined(this.tooltipSettings.textStyle.fontStyle) ? this.tooltipSettings.textStyle.fontStyle : 'Normal';
|
|
86
|
+
this.tooltipSettings.textStyle.fontWeight = this.tooltipSettings.textStyle.fontWeight || this.treemap.themeStyle.fontWeight;
|
|
84
87
|
this.tooltipSettings.textStyle.color = this.treemap.themeStyle.tooltipFontColor
|
|
85
88
|
|| this.tooltipSettings.textStyle.color;
|
|
86
89
|
this.tooltipSettings.textStyle.opacity = this.treemap.themeStyle.tooltipTextOpacity
|