@syncfusion/ej2-treemap 20.4.42 → 21.1.35
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/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 +122 -83
- package/dist/es6/ej2-treemap.es2015.js.map +1 -1
- package/dist/es6/ej2-treemap.es5.js +122 -83
- 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 +12 -12
- package/src/treemap/layout/legend.d.ts +18 -1
- package/src/treemap/layout/legend.js +35 -18
- package/src/treemap/layout/render-panel.js +9 -10
- package/src/treemap/model/base-model.d.ts +97 -97
- package/src/treemap/model/base.d.ts +110 -113
- package/src/treemap/model/base.js +13 -13
- package/src/treemap/model/constants.d.ts +1 -1
- package/src/treemap/model/constants.js +1 -1
- package/src/treemap/model/interface.d.ts +41 -38
- package/src/treemap/model/pdf-export.d.ts +1 -1
- package/src/treemap/model/pdf-export.js +1 -1
- package/src/treemap/treemap-model.d.ts +46 -20
- package/src/treemap/treemap.d.ts +73 -28
- package/src/treemap/treemap.js +47 -33
- package/src/treemap/user-interaction/highlight-selection.d.ts +2 -0
- package/src/treemap/user-interaction/highlight-selection.js +2 -0
- package/src/treemap/user-interaction/tooltip.d.ts +2 -0
- package/src/treemap/user-interaction/tooltip.js +7 -5
- package/src/treemap/utils/enum.d.ts +74 -49
- package/src/treemap/utils/helper.d.ts +15 -12
- package/src/treemap/utils/helper.js +8 -5
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version :
|
|
3
|
+
* version : 21.1.35
|
|
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.12",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-RcTtbIN6kW5mlgmDXMySYusmdzc3jyCiEtunj4tq/wo+SnHxk9Xp6rY5GlnTETS+Ve3PGxlY/h0UrPRDwesR+w==",
|
|
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": "https://nexus.syncfusion.com/repository/ej2-
|
|
27
|
-
"_shasum": "
|
|
26
|
+
"_resolved": "https://nexus.syncfusion.com/repository/ej2-release/@syncfusion/ej2-treemap/-/ej2-treemap-16.31.12.tgz",
|
|
27
|
+
"_shasum": "35004e1d677555412fd3e74f5075c72adde0af7b",
|
|
28
28
|
"_spec": "@syncfusion/ej2-treemap@*",
|
|
29
|
-
"_where": "/jenkins/workspace/
|
|
29
|
+
"_where": "/jenkins/workspace/elease-automation_release_21.1.1/packages/included",
|
|
30
30
|
"author": {
|
|
31
31
|
"name": "Syncfusion Inc."
|
|
32
32
|
},
|
|
@@ -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": "~21.1.35",
|
|
39
|
+
"@syncfusion/ej2-compression": "~21.1.35",
|
|
40
|
+
"@syncfusion/ej2-data": "~21.1.35",
|
|
41
|
+
"@syncfusion/ej2-file-utils": "~21.1.35",
|
|
42
|
+
"@syncfusion/ej2-pdf-export": "~21.1.35",
|
|
43
|
+
"@syncfusion/ej2-svg-base": "~21.1.35"
|
|
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": "21.1.35",
|
|
85
85
|
"sideEffects": false
|
|
86
86
|
}
|
|
@@ -7,21 +7,27 @@ import { Rect } from '../utils/helper';
|
|
|
7
7
|
export declare class TreeMapLegend {
|
|
8
8
|
private treemap;
|
|
9
9
|
/** collection of rendering legends */
|
|
10
|
+
/** @private */
|
|
10
11
|
legendRenderingCollections: any[];
|
|
11
12
|
/** collection of legends */
|
|
13
|
+
/** @private */
|
|
12
14
|
legendCollections: any[];
|
|
15
|
+
/** @private */
|
|
13
16
|
outOfRangeLegend: any;
|
|
14
17
|
private legendHeight;
|
|
15
18
|
private legendWidth;
|
|
16
19
|
private totalPages;
|
|
17
20
|
private page;
|
|
18
21
|
private translate;
|
|
22
|
+
/** @private */
|
|
19
23
|
legendBorderRect: Rect;
|
|
20
24
|
private currentPage;
|
|
25
|
+
/** @private */
|
|
21
26
|
heightIncrement: number;
|
|
27
|
+
/** @private */
|
|
22
28
|
widthIncrement: number;
|
|
23
29
|
private textMaxWidth;
|
|
24
|
-
/**
|
|
30
|
+
/** @private */
|
|
25
31
|
legendGroup: Element;
|
|
26
32
|
private legendNames;
|
|
27
33
|
private defsElement;
|
|
@@ -33,8 +39,10 @@ export declare class TreeMapLegend {
|
|
|
33
39
|
constructor(treemap: TreeMap);
|
|
34
40
|
/**
|
|
35
41
|
* method for legend
|
|
42
|
+
* @private
|
|
36
43
|
*/
|
|
37
44
|
renderLegend(): void;
|
|
45
|
+
/** @private */
|
|
38
46
|
calculateLegendBounds(): void;
|
|
39
47
|
private getPageChanged;
|
|
40
48
|
private findColorMappingLegendItems;
|
|
@@ -44,6 +52,7 @@ export declare class TreeMapLegend {
|
|
|
44
52
|
private isAddNewLegendData;
|
|
45
53
|
/**
|
|
46
54
|
* To draw the legend
|
|
55
|
+
* @private
|
|
47
56
|
*/
|
|
48
57
|
drawLegend(): void;
|
|
49
58
|
private defaultLegendRtlLocation;
|
|
@@ -55,13 +64,16 @@ export declare class TreeMapLegend {
|
|
|
55
64
|
*
|
|
56
65
|
* @param {PointerEvent | TouchEvent} e - Specifies the pointer argument.
|
|
57
66
|
* @returns {void}
|
|
67
|
+
* @private
|
|
58
68
|
*/
|
|
59
69
|
renderInteractivePointer(e: PointerEvent | TouchEvent): void;
|
|
60
70
|
private drawInteractivePointer;
|
|
61
71
|
private getLegendAlignment;
|
|
72
|
+
/** @private */
|
|
62
73
|
mouseUpHandler(e: PointerEvent): void;
|
|
63
74
|
/**
|
|
64
75
|
* To remove the interactive pointer
|
|
76
|
+
* @private
|
|
65
77
|
*/
|
|
66
78
|
removeInteractivePointer(): void;
|
|
67
79
|
/**
|
|
@@ -69,6 +81,7 @@ export declare class TreeMapLegend {
|
|
|
69
81
|
*
|
|
70
82
|
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
71
83
|
* @returns {void}
|
|
84
|
+
* @private
|
|
72
85
|
*/
|
|
73
86
|
changeNextPage(e: PointerEvent): void;
|
|
74
87
|
/**
|
|
@@ -76,14 +89,17 @@ export declare class TreeMapLegend {
|
|
|
76
89
|
*
|
|
77
90
|
* @param {Element} element - Specifies the element.
|
|
78
91
|
* @returns {void}
|
|
92
|
+
* @private
|
|
79
93
|
*/
|
|
80
94
|
wireEvents(element: Element): void;
|
|
81
95
|
/**
|
|
82
96
|
* To add the event listener
|
|
97
|
+
* @private
|
|
83
98
|
*/
|
|
84
99
|
addEventListener(): void;
|
|
85
100
|
/**
|
|
86
101
|
* To remove the event listener
|
|
102
|
+
* @private
|
|
87
103
|
*/
|
|
88
104
|
removeEventListener(): void;
|
|
89
105
|
/**
|
|
@@ -105,6 +121,7 @@ export declare class TreeMapLegend {
|
|
|
105
121
|
* @param {ColorMappingModel} colorMap - Specifies the color mapping instance.
|
|
106
122
|
* @param {number} legendIndex - Specifies the index of legend.
|
|
107
123
|
* @returns {string} - Returns the legend color.
|
|
124
|
+
* @private
|
|
108
125
|
*/
|
|
109
126
|
legendGradientColor(colorMap: ColorMappingModel, legendIndex: number): string;
|
|
110
127
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { LevelsData } from '../treemap';
|
|
2
1
|
import { findChildren, Location, Rect, Size, measureText, TextOption, PathOption, RectOption, drawSymbol, orderByArea, legendMaintain } from '../utils/helper';
|
|
3
2
|
import { Browser, isNullOrUndefined, EventHandler, extend } from '@syncfusion/ej2-base';
|
|
4
3
|
import { renderTextElement, textTrim } from '../utils/helper';
|
|
@@ -9,9 +8,12 @@ import { legendItemRendering, legendRendering } from '../model/constants';
|
|
|
9
8
|
var TreeMapLegend = /** @class */ (function () {
|
|
10
9
|
function TreeMapLegend(treemap) {
|
|
11
10
|
this.page = 0;
|
|
11
|
+
/** @private */
|
|
12
12
|
this.legendBorderRect = new Rect(0, 0, 0, 0);
|
|
13
13
|
this.currentPage = 0;
|
|
14
|
+
/** @private */
|
|
14
15
|
this.heightIncrement = 0;
|
|
16
|
+
/** @private */
|
|
15
17
|
this.widthIncrement = 0;
|
|
16
18
|
this.textMaxWidth = 0;
|
|
17
19
|
this.legendInteractiveGradient = [];
|
|
@@ -22,9 +24,11 @@ var TreeMapLegend = /** @class */ (function () {
|
|
|
22
24
|
// eslint-disable-next-line valid-jsdoc
|
|
23
25
|
/**
|
|
24
26
|
* method for legend
|
|
27
|
+
* @private
|
|
25
28
|
*/
|
|
26
29
|
TreeMapLegend.prototype.renderLegend = function () {
|
|
27
30
|
var _this = this;
|
|
31
|
+
this.page = 0;
|
|
28
32
|
this.legendRenderingCollections = [];
|
|
29
33
|
this.legendCollections = [];
|
|
30
34
|
this.legendNames = [];
|
|
@@ -48,14 +52,15 @@ var TreeMapLegend = /** @class */ (function () {
|
|
|
48
52
|
}
|
|
49
53
|
});
|
|
50
54
|
};
|
|
55
|
+
/** @private */
|
|
51
56
|
TreeMapLegend.prototype.calculateLegendBounds = function () {
|
|
52
57
|
var _this = this;
|
|
53
58
|
var treemap = this.treemap;
|
|
54
59
|
var legend = treemap.legendSettings;
|
|
55
|
-
this.findColorMappingLegendItems(
|
|
56
|
-
if ((this.treemap.palette.length > 0 || !isNullOrUndefined(
|
|
60
|
+
this.findColorMappingLegendItems(treemap.treemapLevelData.levelsData[0]);
|
|
61
|
+
if ((this.treemap.palette.length > 0 || !isNullOrUndefined(treemap.colorValuePath))
|
|
57
62
|
&& this.legendCollections.length === 0) {
|
|
58
|
-
this.findPaletteLegendItems(
|
|
63
|
+
this.findPaletteLegendItems(treemap.treemapLevelData.levelsData[0]);
|
|
59
64
|
}
|
|
60
65
|
if (this.legendCollections.length > 0) {
|
|
61
66
|
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
@@ -541,16 +546,16 @@ var TreeMapLegend = /** @class */ (function () {
|
|
|
541
546
|
// eslint-disable-next-line valid-jsdoc
|
|
542
547
|
/**
|
|
543
548
|
* To draw the legend
|
|
549
|
+
* @private
|
|
544
550
|
*/
|
|
545
551
|
TreeMapLegend.prototype.drawLegend = function () {
|
|
546
|
-
var
|
|
547
|
-
var
|
|
548
|
-
var render = treemap.renderer;
|
|
552
|
+
var legend = this.treemap.legendSettings;
|
|
553
|
+
var render = this.treemap.renderer;
|
|
549
554
|
var fill;
|
|
550
555
|
var textOptions;
|
|
551
556
|
var gradientElement;
|
|
552
557
|
var textFont = legend.textStyle;
|
|
553
|
-
this.legendGroup = render.createGroup({ id: treemap.element.id + '_Legend_Group' });
|
|
558
|
+
this.legendGroup = render.createGroup({ id: this.treemap.element.id + '_Legend_Group' });
|
|
554
559
|
this.renderLegendBorder();
|
|
555
560
|
this.renderLegendTitle();
|
|
556
561
|
if (legend.mode === 'Default') {
|
|
@@ -558,8 +563,8 @@ var TreeMapLegend = /** @class */ (function () {
|
|
|
558
563
|
}
|
|
559
564
|
else {
|
|
560
565
|
for (var i = 0; i < this.legendRenderingCollections.length; i++) {
|
|
561
|
-
var itemId = treemap.element.id + '_Legend_Index_' + i;
|
|
562
|
-
var textId = treemap.element.id + '_Legend_Index_' + i + '_Text';
|
|
566
|
+
var itemId = this.treemap.element.id + '_Legend_Index_' + i;
|
|
567
|
+
var textId = this.treemap.element.id + '_Legend_Index_' + i + '_Text';
|
|
563
568
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
564
569
|
var item = this.legendRenderingCollections[i];
|
|
565
570
|
gradientElement = item['element'];
|
|
@@ -568,8 +573,8 @@ var TreeMapLegend = /** @class */ (function () {
|
|
|
568
573
|
var textLocation = new Location(item['textX'], item['textY']);
|
|
569
574
|
var rectOptions = new RectOption(itemId, fill, legend.shapeBorder, legend.opacity, bounds);
|
|
570
575
|
if (this.treemap.enableRtl) {
|
|
571
|
-
if (treemap.legendSettings.position === 'Left' || treemap.legendSettings.position === 'Right'
|
|
572
|
-
|| (treemap.legendSettings.position === 'Auto'
|
|
576
|
+
if (this.treemap.legendSettings.position === 'Left' || this.treemap.legendSettings.position === 'Right'
|
|
577
|
+
|| (this.treemap.legendSettings.position === 'Auto'
|
|
573
578
|
&& this.treemap.availableSize.width >= this.treemap.availableSize.height)) {
|
|
574
579
|
rectOptions.y = (this.translate.y + this.legendBorderRect.y + this.legendBorderRect.height)
|
|
575
580
|
- (this.translate.y + rectOptions.height) - Math.abs(this.legendBorderRect.y - rectOptions.y);
|
|
@@ -649,11 +654,11 @@ var TreeMapLegend = /** @class */ (function () {
|
|
|
649
654
|
cancel: false, name: legendItemRendering, treemap: treemap, fill: collection['Fill'],
|
|
650
655
|
shape: legend.shape, imageUrl: legend.imageUrl
|
|
651
656
|
};
|
|
652
|
-
|
|
657
|
+
treemap.trigger(legendItemRendering, eventArgs, function (observedArgs) {
|
|
653
658
|
var renderOptions = new PathOption(shapeId, observedArgs.fill, strokeWidth_1, isLineShape_1 ? collection['Fill'] : strokeColor_1, legend.opacity, '');
|
|
654
659
|
legendElement.appendChild(drawSymbol(shapeLocation, observedArgs.shape, shapeSize, observedArgs.imageUrl, renderOptions, legendText));
|
|
655
660
|
textOptions = new TextOption(textId, textLocation.x, textLocation.y, 'start', legendText, '', '');
|
|
656
|
-
renderTextElement(textOptions, legend.textStyle, legend.textStyle.color ||
|
|
661
|
+
renderTextElement(textOptions, legend.textStyle, legend.textStyle.color || treemap.themeStyle.legendTextColor, legendElement);
|
|
657
662
|
_this.legendGroup.appendChild(legendElement);
|
|
658
663
|
});
|
|
659
664
|
};
|
|
@@ -733,8 +738,7 @@ var TreeMapLegend = /** @class */ (function () {
|
|
|
733
738
|
treemap.svgObject.appendChild(this.legendGroup);
|
|
734
739
|
};
|
|
735
740
|
TreeMapLegend.prototype.renderLegendTitle = function () {
|
|
736
|
-
var
|
|
737
|
-
var legend = treemap.legendSettings;
|
|
741
|
+
var legend = this.treemap.legendSettings;
|
|
738
742
|
var textStyle = legend.titleStyle;
|
|
739
743
|
var legendTitle = legend.title.text;
|
|
740
744
|
var textOptions;
|
|
@@ -742,7 +746,7 @@ var TreeMapLegend = /** @class */ (function () {
|
|
|
742
746
|
var trimTitle = textTrim((this.legendItemRect.width + (spacing * 2)), legendTitle, textStyle);
|
|
743
747
|
var textSize = measureText(trimTitle, textStyle);
|
|
744
748
|
if (legendTitle) {
|
|
745
|
-
textOptions = new TextOption(treemap.element.id + '_LegendTitle', (this.legendItemRect.x) + (this.legendItemRect.width / 2), this.legendItemRect.y - (textSize.height / 2) - (spacing / 2), 'middle', trimTitle, '');
|
|
749
|
+
textOptions = new TextOption(this.treemap.element.id + '_LegendTitle', (this.legendItemRect.x) + (this.legendItemRect.width / 2), this.legendItemRect.y - (textSize.height / 2) - (spacing / 2), 'middle', trimTitle, '');
|
|
746
750
|
renderTextElement(textOptions, textStyle, textStyle.color || this.treemap.themeStyle.legendTitleColor, this.legendGroup);
|
|
747
751
|
}
|
|
748
752
|
};
|
|
@@ -751,6 +755,7 @@ var TreeMapLegend = /** @class */ (function () {
|
|
|
751
755
|
*
|
|
752
756
|
* @param {PointerEvent | TouchEvent} e - Specifies the pointer argument.
|
|
753
757
|
* @returns {void}
|
|
758
|
+
* @private
|
|
754
759
|
*/
|
|
755
760
|
TreeMapLegend.prototype.renderInteractivePointer = function (e) {
|
|
756
761
|
var treemap = this.treemap;
|
|
@@ -892,6 +897,7 @@ var TreeMapLegend = /** @class */ (function () {
|
|
|
892
897
|
this.translate = new Location(x, y);
|
|
893
898
|
}
|
|
894
899
|
};
|
|
900
|
+
/** @private */
|
|
895
901
|
TreeMapLegend.prototype.mouseUpHandler = function (e) {
|
|
896
902
|
this.renderInteractivePointer(e);
|
|
897
903
|
clearTimeout(this.clearTimeout);
|
|
@@ -900,6 +906,7 @@ var TreeMapLegend = /** @class */ (function () {
|
|
|
900
906
|
// eslint-disable-next-line valid-jsdoc
|
|
901
907
|
/**
|
|
902
908
|
* To remove the interactive pointer
|
|
909
|
+
* @private
|
|
903
910
|
*/
|
|
904
911
|
TreeMapLegend.prototype.removeInteractivePointer = function () {
|
|
905
912
|
if (document.getElementById(this.treemap.element.id + '_Interactive_Legend')) {
|
|
@@ -912,17 +919,24 @@ var TreeMapLegend = /** @class */ (function () {
|
|
|
912
919
|
*
|
|
913
920
|
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
914
921
|
* @returns {void}
|
|
922
|
+
* @private
|
|
915
923
|
*/
|
|
916
924
|
TreeMapLegend.prototype.changeNextPage = function (e) {
|
|
917
925
|
this.currentPage = (e.target.id.indexOf('_Left_Page_') > -1) ? (this.currentPage - 1) :
|
|
918
926
|
(this.currentPage + 1);
|
|
919
|
-
this.
|
|
927
|
+
if (this.currentPage >= 0 && this.currentPage < this.totalPages.length) {
|
|
928
|
+
this.drawLegend();
|
|
929
|
+
}
|
|
930
|
+
else {
|
|
931
|
+
this.currentPage = (e.target.id.indexOf('_Left_Page_') > -1) ? 0 : this.totalPages.length - 1;
|
|
932
|
+
}
|
|
920
933
|
};
|
|
921
934
|
/**
|
|
922
935
|
* Wire events for event handler
|
|
923
936
|
*
|
|
924
937
|
* @param {Element} element - Specifies the element.
|
|
925
938
|
* @returns {void}
|
|
939
|
+
* @private
|
|
926
940
|
*/
|
|
927
941
|
TreeMapLegend.prototype.wireEvents = function (element) {
|
|
928
942
|
EventHandler.add(element, Browser.touchStartEvent, this.changeNextPage, this);
|
|
@@ -930,6 +944,7 @@ var TreeMapLegend = /** @class */ (function () {
|
|
|
930
944
|
// eslint-disable-next-line valid-jsdoc
|
|
931
945
|
/**
|
|
932
946
|
* To add the event listener
|
|
947
|
+
* @private
|
|
933
948
|
*/
|
|
934
949
|
TreeMapLegend.prototype.addEventListener = function () {
|
|
935
950
|
if (this.treemap.isDestroyed) {
|
|
@@ -941,6 +956,7 @@ var TreeMapLegend = /** @class */ (function () {
|
|
|
941
956
|
// eslint-disable-next-line valid-jsdoc
|
|
942
957
|
/**
|
|
943
958
|
* To remove the event listener
|
|
959
|
+
* @private
|
|
944
960
|
*/
|
|
945
961
|
TreeMapLegend.prototype.removeEventListener = function () {
|
|
946
962
|
if (this.treemap.isDestroyed) {
|
|
@@ -986,6 +1002,7 @@ var TreeMapLegend = /** @class */ (function () {
|
|
|
986
1002
|
* @param {ColorMappingModel} colorMap - Specifies the color mapping instance.
|
|
987
1003
|
* @param {number} legendIndex - Specifies the index of legend.
|
|
988
1004
|
* @returns {string} - Returns the legend color.
|
|
1005
|
+
* @private
|
|
989
1006
|
*/
|
|
990
1007
|
TreeMapLegend.prototype.legendGradientColor = function (colorMap, legendIndex) {
|
|
991
1008
|
var legendFillColor;
|
|
@@ -2,7 +2,6 @@ import { Rect, itemsToOrder, TextOption, measureText, textTrim, hide, wordWrap,
|
|
|
2
2
|
import { isNullOrUndefined, createElement, extend } from '@syncfusion/ej2-base';
|
|
3
3
|
import { findChildren, renderTextElement } from '../utils/helper';
|
|
4
4
|
import { itemRendering } from '../model/constants';
|
|
5
|
-
import { LevelsData } from './../treemap';
|
|
6
5
|
/**
|
|
7
6
|
* To calculate and render the shape layer
|
|
8
7
|
*/
|
|
@@ -14,12 +13,12 @@ var LayoutPanel = /** @class */ (function () {
|
|
|
14
13
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15
14
|
var data;
|
|
16
15
|
var totalRect;
|
|
17
|
-
if (
|
|
16
|
+
if (this.treemap.treemapLevelData.levelsData && this.treemap.treemapLevelData.levelsData.length > 0) {
|
|
18
17
|
data = (!isNullOrUndefined(this.treemap.initialDrillDown.groupIndex) &&
|
|
19
18
|
!isNullOrUndefined(this.treemap.initialDrillDown.groupName)) &&
|
|
20
19
|
(isNullOrUndefined(this.treemap.drilledItems) ? isNullOrUndefined(this.treemap.drilledItems)
|
|
21
20
|
: this.treemap.drilledItems.length === 0) ?
|
|
22
|
-
this.getDrilldownData(
|
|
21
|
+
this.getDrilldownData(this.treemap.treemapLevelData.levelsData[0], [])[0] : this.treemap.treemapLevelData.levelsData[0];
|
|
23
22
|
totalRect = extend({}, this.treemap.areaRect, totalRect, false);
|
|
24
23
|
if (!isNullOrUndefined(this.treemap.treeMapLegendModule) && !isNullOrUndefined(this.treemap.totalRect)) {
|
|
25
24
|
if (this.treemap.legendSettings.position !== 'Float') {
|
|
@@ -38,7 +37,7 @@ var LayoutPanel = /** @class */ (function () {
|
|
|
38
37
|
if (!isNullOrUndefined(this.treemap.initialDrillDown.groupIndex) && !this.treemap.enableBreadcrumb) {
|
|
39
38
|
this.treemap.currentLevel = this.treemap.drilledItems[count]['data']['groupIndex'];
|
|
40
39
|
}
|
|
41
|
-
this.calculateLayoutItems(y ||
|
|
40
|
+
this.calculateLayoutItems(y || this.treemap.treemapLevelData.levelsData[0], totalRect);
|
|
42
41
|
this.renderLayoutItems();
|
|
43
42
|
}
|
|
44
43
|
else {
|
|
@@ -47,7 +46,7 @@ var LayoutPanel = /** @class */ (function () {
|
|
|
47
46
|
: this.treemap.drilledItems.length === 0)) {
|
|
48
47
|
this.treemap.currentLevel = this.treemap.initialDrillDown.groupIndex;
|
|
49
48
|
}
|
|
50
|
-
this.calculateLayoutItems(data ||
|
|
49
|
+
this.calculateLayoutItems(data || this.treemap.treemapLevelData.levelsData[0], totalRect);
|
|
51
50
|
this.renderLayoutItems();
|
|
52
51
|
}
|
|
53
52
|
}
|
|
@@ -632,18 +631,18 @@ var LayoutPanel = /** @class */ (function () {
|
|
|
632
631
|
var treemap = this.treemap;
|
|
633
632
|
var itemFill = isLeafItem ? treemap.leafItemSettings.fill : treemap.levels[item['groupIndex']].fill;
|
|
634
633
|
var itemOpacity = isLeafItem ? treemap.leafItemSettings.opacity : treemap.levels[item['groupIndex']].opacity;
|
|
635
|
-
if (!isNullOrUndefined(
|
|
636
|
-
if (
|
|
637
|
-
|
|
634
|
+
if (!isNullOrUndefined(treemap.treemapLevelData.defaultLevelsData)) {
|
|
635
|
+
if (treemap.treemapLevelData.defaultLevelsData.length > 0) {
|
|
636
|
+
treemap.treemapLevelData.levelsData = treemap.treemapLevelData.defaultLevelsData;
|
|
638
637
|
}
|
|
639
638
|
}
|
|
640
639
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
641
|
-
var parentData = findChildren(
|
|
640
|
+
var parentData = findChildren(treemap.treemapLevelData.levelsData[0])['values'];
|
|
642
641
|
var colorMapping = isLeafItem ? treemap.leafItemSettings.colorMapping :
|
|
643
642
|
treemap.levels[item['groupIndex']].colorMapping;
|
|
644
643
|
if (colorMapping.length > 0) {
|
|
645
644
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
646
|
-
var option = colorMap(colorMapping, item['data'][
|
|
645
|
+
var option = colorMap(colorMapping, item['data'][treemap.equalColorValuePath], item['data'][treemap.rangeColorValuePath]);
|
|
647
646
|
itemFill = !isNullOrUndefined(option['fill']) ? option['fill'] : treemap.leafItemSettings.fill;
|
|
648
647
|
itemOpacity = option['opacity'];
|
|
649
648
|
}
|