@syncfusion/ej2-treemap 20.2.45 → 20.3.56
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 +0 -6
- package/dist/ej2-treemap.min.js +10 -0
- 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 +135 -100
- package/dist/es6/ej2-treemap.es2015.js.map +1 -1
- package/dist/es6/ej2-treemap.es5.js +136 -104
- 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 +13 -13
- package/src/treemap/layout/legend.d.ts +1 -2
- package/src/treemap/layout/legend.js +15 -5
- package/src/treemap/layout/render-panel.d.ts +6 -0
- package/src/treemap/layout/render-panel.js +14 -0
- package/src/treemap/model/image-export.d.ts +2 -4
- package/src/treemap/model/image-export.js +6 -11
- package/src/treemap/model/pdf-export.d.ts +3 -5
- package/src/treemap/model/pdf-export.js +9 -14
- package/src/treemap/model/print.d.ts +4 -7
- package/src/treemap/model/print.js +12 -19
- package/src/treemap/treemap.js +60 -47
- package/src/treemap/user-interaction/highlight-selection.d.ts +2 -3
- package/src/treemap/user-interaction/highlight-selection.js +11 -3
- package/src/treemap/user-interaction/tooltip.d.ts +1 -2
- package/src/treemap/user-interaction/tooltip.js +10 -6
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.3.56
|
|
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.3.47",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-VXZ9GMzOfevTzhitfOAxW3uX1sy3A+NNIOEMZd3fRO9S3W6U90usl9ukZfF9wBn2NCbkkVZChOU7kwakRAM2lg==",
|
|
6
6
|
"_location": "/@syncfusion/ej2-treemap",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
"/@syncfusion/ej2-react-treemap",
|
|
24
24
|
"/@syncfusion/ej2-vue-treemap"
|
|
25
25
|
],
|
|
26
|
-
"_resolved": "
|
|
27
|
-
"_shasum": "
|
|
26
|
+
"_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-treemap/-/ej2-treemap-20.3.47.tgz",
|
|
27
|
+
"_shasum": "0ad1a317dbf526bb77309166228575a21aa5d829",
|
|
28
28
|
"_spec": "@syncfusion/ej2-treemap@*",
|
|
29
|
-
"_where": "/jenkins/workspace/automation_release_19.1.0.1
|
|
29
|
+
"_where": "/jenkins/workspace/ease-automation_release_19.1.0.1/packages/included",
|
|
30
30
|
"author": {
|
|
31
31
|
"name": "Syncfusion Inc."
|
|
32
32
|
},
|
|
@@ -35,17 +35,17 @@
|
|
|
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.3.56",
|
|
39
|
+
"@syncfusion/ej2-compression": "~20.3.56",
|
|
40
|
+
"@syncfusion/ej2-data": "~20.3.56",
|
|
41
|
+
"@syncfusion/ej2-file-utils": "~20.3.56",
|
|
42
|
+
"@syncfusion/ej2-pdf-export": "~20.3.56",
|
|
43
|
+
"@syncfusion/ej2-svg-base": "~20.3.56"
|
|
44
44
|
},
|
|
45
45
|
"deprecated": false,
|
|
46
46
|
"description": "Essential JS 2 TreeMap Components",
|
|
47
47
|
"devDependencies": {},
|
|
48
|
-
"es2015": "./dist/es6/ej2-treemap.
|
|
48
|
+
"es2015": "./dist/es6/ej2-treemap.es5.js",
|
|
49
49
|
"homepage": "https://github.com/syncfusion/ej2-javascript-ui-controls#readme",
|
|
50
50
|
"keywords": [
|
|
51
51
|
"ej2",
|
|
@@ -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.3.56",
|
|
77
77
|
"sideEffects": false
|
|
78
78
|
}
|
|
@@ -84,11 +84,10 @@ export declare class TreeMapLegend {
|
|
|
84
84
|
/**
|
|
85
85
|
* To destroy the legend.
|
|
86
86
|
*
|
|
87
|
-
* @param {TreeMap} treemap - Specifies treemap instance
|
|
88
87
|
* @returns {void}
|
|
89
88
|
* @private
|
|
90
89
|
*/
|
|
91
|
-
destroy(
|
|
90
|
+
destroy(): void;
|
|
92
91
|
/**
|
|
93
92
|
* Get the gradient color for interactive legend.
|
|
94
93
|
*/
|
|
@@ -958,15 +958,25 @@ var TreeMapLegend = /** @class */ (function () {
|
|
|
958
958
|
/**
|
|
959
959
|
* To destroy the legend.
|
|
960
960
|
*
|
|
961
|
-
* @param {TreeMap} treemap - Specifies treemap instance
|
|
962
961
|
* @returns {void}
|
|
963
962
|
* @private
|
|
964
963
|
*/
|
|
965
|
-
TreeMapLegend.prototype.destroy = function (
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
964
|
+
TreeMapLegend.prototype.destroy = function () {
|
|
965
|
+
this.legendRenderingCollections = [];
|
|
966
|
+
this.legendCollections = [];
|
|
967
|
+
this.outOfRangeLegend = null;
|
|
968
|
+
this.totalPages = [];
|
|
969
|
+
this.translate = null;
|
|
970
|
+
this.legendBorderRect = null;
|
|
971
|
+
this.legendGroup = null;
|
|
972
|
+
this.legendNames = [];
|
|
973
|
+
this.defsElement = null;
|
|
974
|
+
this.legendLinearGradient = null;
|
|
975
|
+
this.legendInteractiveGradient = [];
|
|
976
|
+
this.legendItemRect = null;
|
|
969
977
|
this.removeEventListener();
|
|
978
|
+
//TODO: The removeInteractivePointer method (calling method) is called in a timer in the mouseUpHandler method. Because of this handling, adding the below code results in a spec failure.
|
|
979
|
+
//this.treemap = null;
|
|
970
980
|
};
|
|
971
981
|
// eslint-disable-next-line valid-jsdoc
|
|
972
982
|
/**
|
|
@@ -563,6 +563,7 @@ var LayoutPanel = /** @class */ (function () {
|
|
|
563
563
|
}
|
|
564
564
|
}
|
|
565
565
|
itemGroup.setAttribute('aria-label', item['name']);
|
|
566
|
+
itemGroup.setAttribute('role', '');
|
|
566
567
|
itemGroup.setAttribute('tabindex', (_this.treemap.tabIndex + i + 2).toString());
|
|
567
568
|
maintainSelection(_this.treemap, itemGroup, 'treeMapSelection');
|
|
568
569
|
_this.layoutGroup.appendChild(itemGroup);
|
|
@@ -734,6 +735,19 @@ var LayoutPanel = /** @class */ (function () {
|
|
|
734
735
|
}
|
|
735
736
|
return textValue;
|
|
736
737
|
};
|
|
738
|
+
/**
|
|
739
|
+
*
|
|
740
|
+
* @returns {void}
|
|
741
|
+
* @private
|
|
742
|
+
*/
|
|
743
|
+
LayoutPanel.prototype.destroy = function () {
|
|
744
|
+
this.treemap = null;
|
|
745
|
+
this.currentRect = null;
|
|
746
|
+
this.layoutGroup = null;
|
|
747
|
+
this.renderer = null;
|
|
748
|
+
this.renderItems = [];
|
|
749
|
+
this.parentData = [];
|
|
750
|
+
};
|
|
737
751
|
return LayoutPanel;
|
|
738
752
|
}());
|
|
739
753
|
export { LayoutPanel };
|
|
@@ -6,7 +6,6 @@ import { ExportType } from '../utils/enum';
|
|
|
6
6
|
* @hidden
|
|
7
7
|
*/
|
|
8
8
|
export declare class ImageExport {
|
|
9
|
-
private control;
|
|
10
9
|
/**
|
|
11
10
|
* Constructor for Maps
|
|
12
11
|
*
|
|
@@ -22,14 +21,13 @@ export declare class ImageExport {
|
|
|
22
21
|
* @returns {Promise} - Returns the promise string.
|
|
23
22
|
* @private
|
|
24
23
|
*/
|
|
25
|
-
export(type: ExportType, fileName: string, allowDownload?: boolean): Promise<string>;
|
|
24
|
+
export(treeMap: TreeMap, type: ExportType, fileName: string, allowDownload?: boolean): Promise<string>;
|
|
26
25
|
protected getModuleName(): string;
|
|
27
26
|
/**
|
|
28
27
|
* To destroy the ImageExport.
|
|
29
28
|
*
|
|
30
|
-
* @param {TreeMap} treemap - Specifies the instance of the treemap.
|
|
31
29
|
* @returns {void}
|
|
32
30
|
* @private
|
|
33
31
|
*/
|
|
34
|
-
destroy(
|
|
32
|
+
destroy(): void;
|
|
35
33
|
}
|
|
@@ -13,7 +13,6 @@ var ImageExport = /** @class */ (function () {
|
|
|
13
13
|
*/
|
|
14
14
|
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility
|
|
15
15
|
function ImageExport(control) {
|
|
16
|
-
this.control = control;
|
|
17
16
|
}
|
|
18
17
|
/**
|
|
19
18
|
* This method is used to perform the export functionality for the rendered treemap.
|
|
@@ -24,23 +23,22 @@ var ImageExport = /** @class */ (function () {
|
|
|
24
23
|
* @returns {Promise} - Returns the promise string.
|
|
25
24
|
* @private
|
|
26
25
|
*/
|
|
27
|
-
ImageExport.prototype.export = function (type, fileName, allowDownload) {
|
|
28
|
-
var _this = this;
|
|
26
|
+
ImageExport.prototype.export = function (treeMap, type, fileName, allowDownload) {
|
|
29
27
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
30
28
|
var promise = new Promise(function (resolve, reject) {
|
|
31
29
|
var element = createElement('canvas', {
|
|
32
30
|
id: 'ej2-canvas',
|
|
33
31
|
attrs: {
|
|
34
|
-
'height':
|
|
35
|
-
'width':
|
|
32
|
+
'height': treeMap.availableSize.height.toString(),
|
|
33
|
+
'width': treeMap.availableSize.width.toString()
|
|
36
34
|
}
|
|
37
35
|
});
|
|
38
36
|
var isDownload = !(Browser.userAgent.toString().indexOf('HeadlessChrome') > -1);
|
|
39
37
|
var svgData = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">' +
|
|
40
|
-
|
|
38
|
+
treeMap.svgObject.outerHTML +
|
|
41
39
|
'</svg>';
|
|
42
40
|
var url = window.URL.createObjectURL(new Blob(type === 'SVG' ? [svgData] :
|
|
43
|
-
[(new XMLSerializer()).serializeToString(
|
|
41
|
+
[(new XMLSerializer()).serializeToString(treeMap.svgObject)], { type: 'image/svg+xml' }));
|
|
44
42
|
if (type === 'SVG') {
|
|
45
43
|
if (allowDownload) {
|
|
46
44
|
triggerDownload(fileName, type, url, isDownload);
|
|
@@ -79,13 +77,10 @@ var ImageExport = /** @class */ (function () {
|
|
|
79
77
|
/**
|
|
80
78
|
* To destroy the ImageExport.
|
|
81
79
|
*
|
|
82
|
-
* @param {TreeMap} treemap - Specifies the instance of the treemap.
|
|
83
80
|
* @returns {void}
|
|
84
81
|
* @private
|
|
85
82
|
*/
|
|
86
|
-
ImageExport.prototype.destroy = function (
|
|
87
|
-
// Destroy method performed here
|
|
88
|
-
};
|
|
83
|
+
ImageExport.prototype.destroy = function () { };
|
|
89
84
|
return ImageExport;
|
|
90
85
|
}());
|
|
91
86
|
export { ImageExport };
|
|
@@ -7,7 +7,6 @@ import { PdfPageOrientation } from '@syncfusion/ej2-pdf-export';
|
|
|
7
7
|
* @hidden
|
|
8
8
|
*/
|
|
9
9
|
export declare class PdfExport {
|
|
10
|
-
private control;
|
|
11
10
|
/**
|
|
12
11
|
* Constructor for Maps
|
|
13
12
|
*
|
|
@@ -24,14 +23,13 @@ export declare class PdfExport {
|
|
|
24
23
|
* @returns {Promise} - Returns the string.
|
|
25
24
|
* @private
|
|
26
25
|
*/
|
|
27
|
-
export(type: ExportType, fileName: string, orientation?: PdfPageOrientation, allowDownload?: boolean): Promise<string>;
|
|
26
|
+
export(treeMap: TreeMap, type: ExportType, fileName: string, orientation?: PdfPageOrientation, allowDownload?: boolean): Promise<string>;
|
|
28
27
|
protected getModuleName(): string;
|
|
29
28
|
/**
|
|
30
|
-
* To destroy the
|
|
29
|
+
* To destroy the PdfExport.
|
|
31
30
|
*
|
|
32
|
-
* @param {TreeMap} treemap - Specifies the treemap instance.
|
|
33
31
|
* @returns {void}
|
|
34
32
|
* @private
|
|
35
33
|
*/
|
|
36
|
-
destroy(
|
|
34
|
+
destroy(): void;
|
|
37
35
|
}
|
|
@@ -13,7 +13,6 @@ var PdfExport = /** @class */ (function () {
|
|
|
13
13
|
*/
|
|
14
14
|
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility
|
|
15
15
|
function PdfExport(control) {
|
|
16
|
-
this.control = control;
|
|
17
16
|
}
|
|
18
17
|
/**
|
|
19
18
|
* This method is used to perform the export functionality for the rendered treemap.
|
|
@@ -25,25 +24,24 @@ var PdfExport = /** @class */ (function () {
|
|
|
25
24
|
* @returns {Promise} - Returns the string.
|
|
26
25
|
* @private
|
|
27
26
|
*/
|
|
28
|
-
PdfExport.prototype.export = function (type, fileName, orientation, allowDownload) {
|
|
29
|
-
var _this = this;
|
|
27
|
+
PdfExport.prototype.export = function (treeMap, type, fileName, orientation, allowDownload) {
|
|
30
28
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
31
29
|
var promise = new Promise(function (resolve, reject) {
|
|
32
30
|
var element = createElement('canvas', {
|
|
33
31
|
id: 'ej2-canvas',
|
|
34
32
|
attrs: {
|
|
35
|
-
'width':
|
|
36
|
-
'height':
|
|
33
|
+
'width': treeMap.availableSize.width.toString(),
|
|
34
|
+
'height': treeMap.availableSize.height.toString()
|
|
37
35
|
}
|
|
38
36
|
});
|
|
39
37
|
var isDownload = !(Browser.userAgent.toString().indexOf('HeadlessChrome') > -1);
|
|
40
38
|
orientation = isNullOrUndefined(orientation) ? PdfPageOrientation.Landscape : orientation;
|
|
41
|
-
var exportElement =
|
|
39
|
+
var exportElement = treeMap.svgObject.cloneNode(true);
|
|
42
40
|
var backgroundElement = exportElement.childNodes[0];
|
|
43
41
|
if (!isNullOrUndefined(backgroundElement)) {
|
|
44
42
|
var backgroundColor = backgroundElement.getAttribute('fill');
|
|
45
|
-
if ((
|
|
46
|
-
||
|
|
43
|
+
if ((treeMap.theme === 'Tailwind' || treeMap.theme === 'TailwindDark' || treeMap.theme === 'Bootstrap5' || treeMap.theme === 'Bootstrap5Dark'
|
|
44
|
+
|| treeMap.theme === 'Fluent' || treeMap.theme === 'FluentDark') && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
|
|
47
45
|
exportElement.childNodes[0].setAttribute('fill', 'rgba(255,255,255, 1)');
|
|
48
46
|
}
|
|
49
47
|
}
|
|
@@ -57,7 +55,7 @@ var PdfExport = /** @class */ (function () {
|
|
|
57
55
|
var imageString = element.toDataURL('image/jpeg').replace('image/jpeg', 'image/octet-stream');
|
|
58
56
|
document.pageSettings.orientation = orientation;
|
|
59
57
|
imageString = imageString.slice(imageString.indexOf(',') + 1);
|
|
60
|
-
document.pages.add().graphics.drawImage(new PdfBitmap(imageString), 0, 0, (
|
|
58
|
+
document.pages.add().graphics.drawImage(new PdfBitmap(imageString), 0, 0, (treeMap.availableSize.width - 60), treeMap.availableSize.height);
|
|
61
59
|
if (allowDownload) {
|
|
62
60
|
document.save(fileName + '.pdf');
|
|
63
61
|
document.destroy();
|
|
@@ -75,15 +73,12 @@ var PdfExport = /** @class */ (function () {
|
|
|
75
73
|
return 'PdfExport';
|
|
76
74
|
};
|
|
77
75
|
/**
|
|
78
|
-
* To destroy the
|
|
76
|
+
* To destroy the PdfExport.
|
|
79
77
|
*
|
|
80
|
-
* @param {TreeMap} treemap - Specifies the treemap instance.
|
|
81
78
|
* @returns {void}
|
|
82
79
|
* @private
|
|
83
80
|
*/
|
|
84
|
-
PdfExport.prototype.destroy = function (
|
|
85
|
-
// Destroy method performed here
|
|
86
|
-
};
|
|
81
|
+
PdfExport.prototype.destroy = function () { };
|
|
87
82
|
return PdfExport;
|
|
88
83
|
}());
|
|
89
84
|
export { PdfExport };
|
|
@@ -5,8 +5,6 @@ import { TreeMap } from '../../index';
|
|
|
5
5
|
* @hidden
|
|
6
6
|
*/
|
|
7
7
|
export declare class Print {
|
|
8
|
-
private control;
|
|
9
|
-
private printWindow;
|
|
10
8
|
/**
|
|
11
9
|
* Constructor for Maps
|
|
12
10
|
*
|
|
@@ -20,7 +18,7 @@ export declare class Print {
|
|
|
20
18
|
* @returns {void}
|
|
21
19
|
* @private
|
|
22
20
|
*/
|
|
23
|
-
print(elements?: string[] | string | Element): void;
|
|
21
|
+
print(treeMap: TreeMap, elements?: string[] | string | Element): void;
|
|
24
22
|
/**
|
|
25
23
|
* To get the html string of the Maps
|
|
26
24
|
*
|
|
@@ -28,7 +26,7 @@ export declare class Print {
|
|
|
28
26
|
* @returns {Element} - Returns the element
|
|
29
27
|
* @private
|
|
30
28
|
*/
|
|
31
|
-
getHTMLContent(elements?: string[] | string | Element): Element;
|
|
29
|
+
getHTMLContent(treeMap: TreeMap, elements?: string[] | string | Element): Element;
|
|
32
30
|
/**
|
|
33
31
|
* Get module name.
|
|
34
32
|
*
|
|
@@ -36,11 +34,10 @@ export declare class Print {
|
|
|
36
34
|
*/
|
|
37
35
|
protected getModuleName(): string;
|
|
38
36
|
/**
|
|
39
|
-
* To destroy the
|
|
37
|
+
* To destroy the Print module.
|
|
40
38
|
*
|
|
41
|
-
* @param {TreeMap} treemap - Specifies the treemap instance
|
|
42
39
|
* @returns {void}
|
|
43
40
|
* @private
|
|
44
41
|
*/
|
|
45
|
-
destroy(
|
|
42
|
+
destroy(): void;
|
|
46
43
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { print as
|
|
1
|
+
import { print as printFunction, createElement } from '@syncfusion/ej2-base';
|
|
2
2
|
import { getElement } from '../utils/helper';
|
|
3
3
|
import { beforePrint } from '../model/constants';
|
|
4
4
|
/**
|
|
@@ -14,7 +14,6 @@ var Print = /** @class */ (function () {
|
|
|
14
14
|
*/
|
|
15
15
|
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility
|
|
16
16
|
function Print(control) {
|
|
17
|
-
this.control = control;
|
|
18
17
|
}
|
|
19
18
|
/**
|
|
20
19
|
* This method is used to perform the print functionality in treemap.
|
|
@@ -23,17 +22,16 @@ var Print = /** @class */ (function () {
|
|
|
23
22
|
* @returns {void}
|
|
24
23
|
* @private
|
|
25
24
|
*/
|
|
26
|
-
Print.prototype.print = function (elements) {
|
|
27
|
-
var
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
this.printWindow.resizeTo(screen.availWidth, screen.availHeight);
|
|
25
|
+
Print.prototype.print = function (treeMap, elements) {
|
|
26
|
+
var printWindow = window.open('', 'print', 'height=' + window.outerHeight + ',width=' + window.outerWidth + ',tabbar=no');
|
|
27
|
+
printWindow.moveTo(0, 0);
|
|
28
|
+
printWindow.resizeTo(screen.availWidth, screen.availHeight);
|
|
31
29
|
var argsData = {
|
|
32
|
-
cancel: false, htmlContent: this.getHTMLContent(elements), name: beforePrint
|
|
30
|
+
cancel: false, htmlContent: this.getHTMLContent(treeMap, elements), name: beforePrint
|
|
33
31
|
};
|
|
34
|
-
|
|
32
|
+
treeMap.trigger(beforePrint, argsData, function () {
|
|
35
33
|
if (!argsData.cancel) {
|
|
36
|
-
|
|
34
|
+
printFunction(argsData.htmlContent, printWindow);
|
|
37
35
|
}
|
|
38
36
|
});
|
|
39
37
|
};
|
|
@@ -44,7 +42,7 @@ var Print = /** @class */ (function () {
|
|
|
44
42
|
* @returns {Element} - Returns the element
|
|
45
43
|
* @private
|
|
46
44
|
*/
|
|
47
|
-
Print.prototype.getHTMLContent = function (elements) {
|
|
45
|
+
Print.prototype.getHTMLContent = function (treeMap, elements) {
|
|
48
46
|
var div = createElement('div');
|
|
49
47
|
if (elements) {
|
|
50
48
|
if (elements instanceof Array) {
|
|
@@ -60,7 +58,7 @@ var Print = /** @class */ (function () {
|
|
|
60
58
|
}
|
|
61
59
|
}
|
|
62
60
|
else {
|
|
63
|
-
div.appendChild(
|
|
61
|
+
div.appendChild(treeMap.element.cloneNode(true));
|
|
64
62
|
}
|
|
65
63
|
return div;
|
|
66
64
|
};
|
|
@@ -74,17 +72,12 @@ var Print = /** @class */ (function () {
|
|
|
74
72
|
return 'Print';
|
|
75
73
|
};
|
|
76
74
|
/**
|
|
77
|
-
* To destroy the
|
|
75
|
+
* To destroy the Print module.
|
|
78
76
|
*
|
|
79
|
-
* @param {TreeMap} treemap - Specifies the treemap instance
|
|
80
77
|
* @returns {void}
|
|
81
78
|
* @private
|
|
82
79
|
*/
|
|
83
|
-
Print.prototype.destroy = function (
|
|
84
|
-
/**
|
|
85
|
-
* Destroy method performed here
|
|
86
|
-
*/
|
|
87
|
-
};
|
|
80
|
+
Print.prototype.destroy = function () { };
|
|
88
81
|
return Print;
|
|
89
82
|
}());
|
|
90
83
|
export { Print };
|
package/src/treemap/treemap.js
CHANGED
|
@@ -155,6 +155,12 @@ var TreeMap = /** @class */ (function (_super) {
|
|
|
155
155
|
remove(this.svgObject);
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
|
+
if (isNullOrUndefined(this.renderer)) {
|
|
159
|
+
this.renderer = new SvgRenderer(this.element.id);
|
|
160
|
+
}
|
|
161
|
+
if (isNullOrUndefined(this.layout)) {
|
|
162
|
+
this.layout = new LayoutPanel(this);
|
|
163
|
+
}
|
|
158
164
|
this.clearTemplate();
|
|
159
165
|
var containerWidth = this.element.clientWidth;
|
|
160
166
|
var containerHeight = this.element.clientHeight;
|
|
@@ -237,6 +243,7 @@ var TreeMap = /** @class */ (function (_super) {
|
|
|
237
243
|
var titleBounds = new Rect(location_1.x, location_1.y, elementSize.width, elementSize.height);
|
|
238
244
|
var element = renderTextElement(options, style, style.color || (type === 'title' ? this.themeStyle.titleFontColor : this.themeStyle.subTitleFontColor), groupEle);
|
|
239
245
|
element.setAttribute('aria-label', title.description || title.text);
|
|
246
|
+
element.setAttribute('role', '');
|
|
240
247
|
element.setAttribute('tabindex', (this.tabIndex + (type === 'title' ? 1 : 2)).toString());
|
|
241
248
|
if ((type === 'title' && !title.subtitleSettings.text) || (type === 'subtitle')) {
|
|
242
249
|
height = (this.availableSize.height - titleBounds.y - titlePadding - this.margin.bottom);
|
|
@@ -414,7 +421,7 @@ var TreeMap = /** @class */ (function (_super) {
|
|
|
414
421
|
*/
|
|
415
422
|
TreeMap.prototype.print = function (id) {
|
|
416
423
|
if (this.allowPrint && this.printModule) {
|
|
417
|
-
this.printModule.print(id);
|
|
424
|
+
this.printModule.print(this, id);
|
|
418
425
|
}
|
|
419
426
|
};
|
|
420
427
|
/**
|
|
@@ -432,13 +439,13 @@ var TreeMap = /** @class */ (function (_super) {
|
|
|
432
439
|
if (type === 'PDF' && this.allowPdfExport && this.pdfExportModule) {
|
|
433
440
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
434
441
|
return new Promise(function (resolve, reject) {
|
|
435
|
-
resolve(_this.pdfExportModule.export(type, fileName, orientation, allowDownload));
|
|
442
|
+
resolve(_this.pdfExportModule.export(_this, type, fileName, orientation, allowDownload));
|
|
436
443
|
});
|
|
437
444
|
}
|
|
438
445
|
else if (this.allowImageExport && (type !== 'PDF') && this.imageExportModule) {
|
|
439
446
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
440
447
|
return new Promise(function (resolve, reject) {
|
|
441
|
-
resolve(_this.imageExportModule.export(type, fileName, allowDownload));
|
|
448
|
+
resolve(_this.imageExportModule.export(_this, type, fileName, allowDownload));
|
|
442
449
|
});
|
|
443
450
|
}
|
|
444
451
|
return null;
|
|
@@ -614,6 +621,7 @@ var TreeMap = /** @class */ (function (_super) {
|
|
|
614
621
|
*/
|
|
615
622
|
TreeMap.prototype.addTabIndex = function () {
|
|
616
623
|
this.element.setAttribute('aria-label', this.description || 'TreeMap Element');
|
|
624
|
+
this.element.setAttribute('role', '');
|
|
617
625
|
this.element.setAttribute('tabindex', this.tabIndex.toString());
|
|
618
626
|
};
|
|
619
627
|
/**
|
|
@@ -623,28 +631,30 @@ var TreeMap = /** @class */ (function (_super) {
|
|
|
623
631
|
*/
|
|
624
632
|
TreeMap.prototype.resizeOnTreeMap = function (e) {
|
|
625
633
|
var _this = this;
|
|
626
|
-
this.
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
this.
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
_this.
|
|
646
|
-
|
|
647
|
-
|
|
634
|
+
if (!this.isDestroyed) {
|
|
635
|
+
this.isResize = true;
|
|
636
|
+
var args_1 = {
|
|
637
|
+
name: resize,
|
|
638
|
+
cancel: false,
|
|
639
|
+
previousSize: this.availableSize,
|
|
640
|
+
currentSize: new Size(0, 0),
|
|
641
|
+
treemap: this
|
|
642
|
+
};
|
|
643
|
+
if (this.resizeTo) {
|
|
644
|
+
clearTimeout(this.resizeTo);
|
|
645
|
+
}
|
|
646
|
+
if (!isNullOrUndefined(this.element) && this.element.classList.contains('e-treemap')) {
|
|
647
|
+
this.resizeTo = setTimeout(function () {
|
|
648
|
+
_this.unWireEVents();
|
|
649
|
+
_this.createSvg();
|
|
650
|
+
_this.refreshing = true;
|
|
651
|
+
_this.wireEVents();
|
|
652
|
+
args_1.currentSize = _this.availableSize;
|
|
653
|
+
_this.trigger(resize, args_1, function (observedArgs) {
|
|
654
|
+
_this.render();
|
|
655
|
+
});
|
|
656
|
+
}, 500);
|
|
657
|
+
}
|
|
648
658
|
}
|
|
649
659
|
};
|
|
650
660
|
/**
|
|
@@ -1078,29 +1088,31 @@ var TreeMap = /** @class */ (function (_super) {
|
|
|
1078
1088
|
* @private
|
|
1079
1089
|
*/
|
|
1080
1090
|
TreeMap.prototype.onPropertyChanged = function (newProp, oldProp) {
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
var
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1091
|
+
if (!this.isDestroyed) {
|
|
1092
|
+
var render = false;
|
|
1093
|
+
for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
|
|
1094
|
+
var prop = _a[_i];
|
|
1095
|
+
switch (prop) {
|
|
1096
|
+
case 'background':
|
|
1097
|
+
this.renderBorder();
|
|
1098
|
+
break;
|
|
1099
|
+
case 'height':
|
|
1100
|
+
case 'width':
|
|
1101
|
+
case 'layoutType':
|
|
1102
|
+
case 'levels':
|
|
1103
|
+
case 'drillDownView':
|
|
1104
|
+
case 'renderDirection':
|
|
1105
|
+
case 'leafItemSettings':
|
|
1106
|
+
case 'legendSettings':
|
|
1107
|
+
case 'dataSource':
|
|
1108
|
+
render = true;
|
|
1109
|
+
break;
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
if (render) {
|
|
1113
|
+
this.createSvg();
|
|
1114
|
+
this.renderElements();
|
|
1099
1115
|
}
|
|
1100
|
-
}
|
|
1101
|
-
if (render) {
|
|
1102
|
-
this.createSvg();
|
|
1103
|
-
this.renderElements();
|
|
1104
1116
|
}
|
|
1105
1117
|
};
|
|
1106
1118
|
/**
|
|
@@ -1114,6 +1126,7 @@ var TreeMap = /** @class */ (function (_super) {
|
|
|
1114
1126
|
*/
|
|
1115
1127
|
TreeMap.prototype.destroy = function () {
|
|
1116
1128
|
this.unWireEVents();
|
|
1129
|
+
removeElement('treeMapMeasureText');
|
|
1117
1130
|
this.drilledItems = [];
|
|
1118
1131
|
this.levelSelection = [];
|
|
1119
1132
|
this.legendId = [];
|
|
@@ -37,11 +37,10 @@ export declare class TreeMapHighlight {
|
|
|
37
37
|
/**
|
|
38
38
|
* To destroy the hightlight.
|
|
39
39
|
*
|
|
40
|
-
* @param {TreeMap} treeMap - Specifies the instance of the treemap.
|
|
41
40
|
* @returns {void}
|
|
42
41
|
* @private
|
|
43
42
|
*/
|
|
44
|
-
destroy(
|
|
43
|
+
destroy(): void;
|
|
45
44
|
}
|
|
46
45
|
/**
|
|
47
46
|
* Performing treemap selection
|
|
@@ -92,5 +91,5 @@ export declare class TreeMapSelection {
|
|
|
92
91
|
* @returns {void}
|
|
93
92
|
* @private
|
|
94
93
|
*/
|
|
95
|
-
destroy(
|
|
94
|
+
destroy(): void;
|
|
96
95
|
}
|