@syncfusion/ej2-treemap 20.3.59 → 20.4.40
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 +16 -1
- package/CHANGELOG.md +0 -6
- package/README.md +53 -41
- 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 +469 -193
- package/dist/es6/ej2-treemap.es2015.js.map +1 -1
- package/dist/es6/ej2-treemap.es5.js +491 -215
- 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 +26 -20
- package/src/treemap/layout/legend.d.ts +15 -0
- package/src/treemap/layout/legend.js +47 -45
- package/src/treemap/layout/render-panel.d.ts +2 -1
- package/src/treemap/layout/render-panel.js +25 -44
- package/src/treemap/model/image-export.d.ts +1 -0
- package/src/treemap/model/image-export.js +4 -2
- package/src/treemap/model/pdf-export.d.ts +1 -0
- package/src/treemap/model/pdf-export.js +5 -4
- package/src/treemap/model/print.d.ts +2 -0
- package/src/treemap/model/print.js +4 -1
- package/src/treemap/treemap-model.d.ts +19 -19
- package/src/treemap/treemap.d.ts +74 -47
- package/src/treemap/treemap.js +74 -59
- package/src/treemap/user-interaction/highlight-selection.d.ts +6 -1
- package/src/treemap/user-interaction/highlight-selection.js +22 -21
- package/src/treemap/user-interaction/tooltip.js +3 -5
- package/src/treemap/utils/helper.d.ts +281 -12
- package/src/treemap/utils/helper.js +308 -77
|
@@ -607,6 +607,12 @@ var Size = /** @__PURE__ @class */ (function () {
|
|
|
607
607
|
}
|
|
608
608
|
return Size;
|
|
609
609
|
}());
|
|
610
|
+
/**
|
|
611
|
+
*
|
|
612
|
+
* @param {string} value - specifies the text.
|
|
613
|
+
* @param {number} containerSize - specifies the container size value.
|
|
614
|
+
* @returns {number} - Returns the number value which is converted from string.
|
|
615
|
+
*/
|
|
610
616
|
function stringToNumber(value, containerSize) {
|
|
611
617
|
if (value !== null && value !== undefined) {
|
|
612
618
|
return value.indexOf('%') !== -1 ? (containerSize / 100) * parseInt(value, 10) : parseInt(value, 10);
|
|
@@ -664,7 +670,6 @@ var PathOption = /** @__PURE__ @class */ (function () {
|
|
|
664
670
|
*
|
|
665
671
|
* @param {string} text - Specifies the text.
|
|
666
672
|
* @param {FontModel} font - Specifies the font.
|
|
667
|
-
* @param {string} id - Specifies the id.
|
|
668
673
|
* @returns {Size} - Returns the size.
|
|
669
674
|
* @private
|
|
670
675
|
*/
|
|
@@ -748,6 +753,12 @@ var Location = /** @__PURE__ @class */ (function () {
|
|
|
748
753
|
}());
|
|
749
754
|
/**
|
|
750
755
|
* Method to calculate x position of title
|
|
756
|
+
*
|
|
757
|
+
* @param {Rect} location - Specifies the location of text.
|
|
758
|
+
* @param {Alignment} alignment - Specifies the alignment of the text.
|
|
759
|
+
* @param {Size} textSize - Specifies the size of the text.
|
|
760
|
+
* @param {type} type - Specifies whether the provided text is title or subtitle.
|
|
761
|
+
* @returns {Location} - Returns the location of text.
|
|
751
762
|
*/
|
|
752
763
|
function findPosition(location, alignment, textSize, type) {
|
|
753
764
|
var x;
|
|
@@ -767,9 +778,14 @@ function findPosition(location, alignment, textSize, type) {
|
|
|
767
778
|
var y = (type === 'title') ? location.y + (textSize.height / 2) : ((location.y + location.height / 2) + textSize.height / 2);
|
|
768
779
|
return new Location(x, y);
|
|
769
780
|
}
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
renderer
|
|
781
|
+
/**
|
|
782
|
+
*
|
|
783
|
+
* @param {SvgRenderer} renderer - Specifies the rendering element of the SVG.
|
|
784
|
+
* @param {any} renderOptions - Specifies the settings of the text.
|
|
785
|
+
* @param {string} text - Specifies the text.
|
|
786
|
+
* @returns {HTMLElement} - Returns the HTML element for the text.
|
|
787
|
+
*/
|
|
788
|
+
function createTextStyle(renderer, renderOptions, text) {
|
|
773
789
|
var htmlObject = renderer.createText(renderOptions, text);
|
|
774
790
|
htmlObject.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve');
|
|
775
791
|
htmlObject.style['user-select'] = 'none';
|
|
@@ -787,14 +803,13 @@ renderer, renderOptions, text) {
|
|
|
787
803
|
* @param {TextOption} options - Specifies the text option
|
|
788
804
|
* @param {FontModel} font - Specifies the font model
|
|
789
805
|
* @param {string} color - Specifies the color
|
|
790
|
-
* @param {HTMLElement | Element} parent -
|
|
806
|
+
* @param {HTMLElement | Element} parent - Specifies the parent element of the text
|
|
791
807
|
* @param {boolean} isMinus - Specifies the boolean value
|
|
792
808
|
* @returns {Element} - Returns the element
|
|
793
809
|
* @private
|
|
794
810
|
*/
|
|
795
811
|
function renderTextElement(options, font, color, parent, isMinus) {
|
|
796
812
|
if (isMinus === void 0) { isMinus = false; }
|
|
797
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
798
813
|
var renderOptions = {
|
|
799
814
|
'font-size': font.size,
|
|
800
815
|
'font-style': font.fontStyle,
|
|
@@ -821,7 +836,8 @@ function renderTextElement(options, font, color, parent, isMinus) {
|
|
|
821
836
|
var spacing = 5;
|
|
822
837
|
var drillLevelText = drilledLabel.split('#');
|
|
823
838
|
for (var z = 0; z < drillLevelText.length; z++) {
|
|
824
|
-
var drillText = (drillLevelText[z].search(options.connectorText) !== -1 &&
|
|
839
|
+
var drillText = (drillLevelText[z].search(options.connectorText) !== -1 &&
|
|
840
|
+
!isNullOrUndefined(options.connectorText)) ?
|
|
825
841
|
options.connectorText : drillLevelText[z];
|
|
826
842
|
renderOptions['id'] = options.id + '_' + z;
|
|
827
843
|
htmlObject = createTextStyle(renderer, renderOptions, drillText);
|
|
@@ -851,6 +867,13 @@ function renderTextElement(options, font, color, parent, isMinus) {
|
|
|
851
867
|
}
|
|
852
868
|
return htmlObject;
|
|
853
869
|
}
|
|
870
|
+
/**
|
|
871
|
+
*
|
|
872
|
+
* @param {string} targetId - Specifies the id of the element to which template is to be appended.
|
|
873
|
+
* @param {Element} targetElement - Specifies the element to which template is to be appended.
|
|
874
|
+
* @param {string} contentItemTemplate - Specifies the content to be appended as template.
|
|
875
|
+
* @returns {void}
|
|
876
|
+
*/
|
|
854
877
|
function setItemTemplateContent(targetId, targetElement, contentItemTemplate) {
|
|
855
878
|
var itemSelect = targetId.split('_RectPath')[0];
|
|
856
879
|
var itemTemplate;
|
|
@@ -864,21 +887,39 @@ function setItemTemplateContent(targetId, targetElement, contentItemTemplate) {
|
|
|
864
887
|
itemTemplate.innerHTML = contentItemTemplate;
|
|
865
888
|
}
|
|
866
889
|
}
|
|
890
|
+
/**
|
|
891
|
+
*
|
|
892
|
+
* @param {string} id - Specifies the id of the element.
|
|
893
|
+
* @returns {Element} - Returns the element.
|
|
894
|
+
*/
|
|
867
895
|
function getElement(id) {
|
|
868
896
|
return document.getElementById(id);
|
|
869
897
|
}
|
|
870
|
-
|
|
898
|
+
/**
|
|
899
|
+
*
|
|
900
|
+
* @param {any} a - Specifies the first order of TreeMap leaf elements.
|
|
901
|
+
* @param {any} b - Specifies the second order of TreeMap leaf elements.
|
|
902
|
+
* @returns {number} - Returns the order of the TreeMap leaf element.
|
|
903
|
+
*/
|
|
871
904
|
function itemsToOrder(a, b) {
|
|
872
905
|
return a['weight'] === b['weight'] ? 0 : a['weight'] < b['weight'] ? 1 : -1;
|
|
873
906
|
}
|
|
874
|
-
|
|
907
|
+
/**
|
|
908
|
+
*
|
|
909
|
+
* @param {string[]} source - Specifies the data from the data source.
|
|
910
|
+
* @param {string} pathName - Specifies the path name in the data source.
|
|
911
|
+
* @param {any} processData - Specifies the data source object.
|
|
912
|
+
* @param {TreeMap} treemap - Specifies the treemap instance.
|
|
913
|
+
* @returns {boolean} - Specifies whether data is available in the data source or not.
|
|
914
|
+
*/
|
|
875
915
|
function isContainsData(source, pathName, processData, treemap) {
|
|
876
916
|
var isExist = false;
|
|
877
917
|
var name = '';
|
|
878
918
|
var path;
|
|
879
919
|
var leaf = treemap.leafItemSettings;
|
|
880
920
|
for (var i = 0; i < source.length; i++) {
|
|
881
|
-
path = treemap.levels[i] ? treemap.levels[i].groupPath : leaf.labelPath ? leaf.labelPath :
|
|
921
|
+
path = treemap.levels[i] ? treemap.levels[i].groupPath : leaf.labelPath ? leaf.labelPath :
|
|
922
|
+
treemap.weightValuePath;
|
|
882
923
|
var data = processData[path] || 'undefined';
|
|
883
924
|
if (source[i] === data) {
|
|
884
925
|
name += data + (i === source.length - 1 ? '' : '#');
|
|
@@ -890,9 +931,12 @@ function isContainsData(source, pathName, processData, treemap) {
|
|
|
890
931
|
}
|
|
891
932
|
return isExist;
|
|
892
933
|
}
|
|
893
|
-
|
|
934
|
+
/**
|
|
935
|
+
*
|
|
936
|
+
* @param {any} data - Specifies the data to which the children elements to be found.
|
|
937
|
+
* @returns {any} - Returns the children elements of the TreeMap leaf element.
|
|
938
|
+
*/
|
|
894
939
|
function findChildren(data) {
|
|
895
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
896
940
|
var children;
|
|
897
941
|
if (data) {
|
|
898
942
|
var keys = Object.keys(data);
|
|
@@ -907,11 +951,17 @@ function findChildren(data) {
|
|
|
907
951
|
}
|
|
908
952
|
return children;
|
|
909
953
|
}
|
|
910
|
-
|
|
954
|
+
/**
|
|
955
|
+
*
|
|
956
|
+
* @param {any} data - Specifies the data to which highlight must be done.
|
|
957
|
+
* @param {items} items - Specifies the data source items.
|
|
958
|
+
* @param {string} mode - Specifies the mode of highlight.
|
|
959
|
+
* @param {TreeMap} treeMap - Specifies the treemap instance.
|
|
960
|
+
* @returns {string[]} - Returns the highlighted items.
|
|
961
|
+
*/
|
|
911
962
|
function findHightLightItems(data, items, mode, treeMap) {
|
|
912
963
|
if (mode === 'Child') {
|
|
913
964
|
items.push(data['levelOrderName']);
|
|
914
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
915
965
|
var children = findChildren(data)['values'];
|
|
916
966
|
if (children && children.length > 0) {
|
|
917
967
|
for (var i = 0; i < children.length; i++) {
|
|
@@ -932,7 +982,6 @@ function findHightLightItems(data, items, mode, treeMap) {
|
|
|
932
982
|
}
|
|
933
983
|
else if (mode === 'All') {
|
|
934
984
|
var parentName = data['levelOrderName'].split('#')[0];
|
|
935
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
936
985
|
var currentItem = void 0;
|
|
937
986
|
for (var i = 0; i < treeMap.layout.renderItems.length; i++) {
|
|
938
987
|
currentItem = treeMap.layout.renderItems[i];
|
|
@@ -953,11 +1002,8 @@ function findHightLightItems(data, items, mode, treeMap) {
|
|
|
953
1002
|
* @returns {Function} - Returns the template function
|
|
954
1003
|
* @private
|
|
955
1004
|
*/
|
|
956
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
957
1005
|
function getTemplateFunction(template) {
|
|
958
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
959
1006
|
var templateFn = null;
|
|
960
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
961
1007
|
try {
|
|
962
1008
|
if (document.querySelectorAll(template).length) {
|
|
963
1009
|
templateFn = compile(document.querySelector(template).innerHTML.trim());
|
|
@@ -975,31 +1021,38 @@ function getTemplateFunction(template) {
|
|
|
975
1021
|
* @param {Object} data - Specifies the data
|
|
976
1022
|
* @returns {HTMLElement} - Returns the element
|
|
977
1023
|
*/
|
|
978
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
979
1024
|
function convertElement(element, labelId, data) {
|
|
980
1025
|
var childElement = createElement('div', {
|
|
981
|
-
id: labelId
|
|
982
|
-
styles: 'position: absolute;pointer-events: auto;'
|
|
1026
|
+
id: labelId
|
|
983
1027
|
});
|
|
1028
|
+
childElement.style.cssText = 'position: absolute;pointer-events: auto;';
|
|
984
1029
|
var elementLength = element.length;
|
|
985
1030
|
while (elementLength > 0) {
|
|
986
1031
|
childElement.appendChild(element[0]);
|
|
987
1032
|
elementLength--;
|
|
988
1033
|
}
|
|
989
1034
|
var templateHtml = childElement.innerHTML;
|
|
990
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
991
1035
|
var keys = Object.keys(data);
|
|
992
1036
|
for (var i = 0; i < keys.length; i++) {
|
|
993
|
-
|
|
1037
|
+
var regExp = RegExp;
|
|
1038
|
+
templateHtml = templateHtml.replace(new regExp('{{:' + keys[i] + '}}', 'g'), data[keys[i].toString()]);
|
|
994
1039
|
}
|
|
995
1040
|
childElement.innerHTML = templateHtml;
|
|
996
1041
|
return childElement;
|
|
997
1042
|
}
|
|
1043
|
+
/**
|
|
1044
|
+
*
|
|
1045
|
+
* @param {Rect} rect - Specifies the area.
|
|
1046
|
+
* @param {LabelPosition} position - Specifies the position
|
|
1047
|
+
* @param {Size} labelSize - Specifies the label size.
|
|
1048
|
+
* @param {string} type - Specifies the type.
|
|
1049
|
+
* @param {TreeMap} treemap - Specifies the treemap instance.
|
|
1050
|
+
* @returns {Location} - Returns the text location.
|
|
1051
|
+
*/
|
|
998
1052
|
function findLabelLocation(rect, position, labelSize, type, treemap) {
|
|
999
1053
|
var location = new Location(0, 0);
|
|
1000
1054
|
var padding = 5;
|
|
1001
1055
|
var paddings = 2;
|
|
1002
|
-
var elementRect = treemap.element.getBoundingClientRect();
|
|
1003
1056
|
var x = (type === 'Template') ? treemap.areaRect.x : 0;
|
|
1004
1057
|
var y = (type === 'Template') ? treemap.areaRect.y : 0;
|
|
1005
1058
|
location.x = (Math.abs(x - ((position.indexOf('Left') > -1) ? rect.x + padding : !(position.indexOf('Right') > -1) ?
|
|
@@ -1015,6 +1068,12 @@ function findLabelLocation(rect, position, labelSize, type, treemap) {
|
|
|
1015
1068
|
}
|
|
1016
1069
|
return location;
|
|
1017
1070
|
}
|
|
1071
|
+
/**
|
|
1072
|
+
*
|
|
1073
|
+
* @param {HTMLElement} element - Specifies the element to be measured.
|
|
1074
|
+
* @param {HTMLElement} parentElement - Specifies the parent element of the element to be measured.
|
|
1075
|
+
* @returns {Size} - Returns the element size.
|
|
1076
|
+
*/
|
|
1018
1077
|
function measureElement(element, parentElement) {
|
|
1019
1078
|
var size = new Size(0, 0);
|
|
1020
1079
|
parentElement.appendChild(element);
|
|
@@ -1024,9 +1083,19 @@ function measureElement(element, parentElement) {
|
|
|
1024
1083
|
measureElementId.parentNode.removeChild(measureElementId);
|
|
1025
1084
|
return size;
|
|
1026
1085
|
}
|
|
1086
|
+
/**
|
|
1087
|
+
*
|
|
1088
|
+
* @param {Rect} rect - Specifies the area.
|
|
1089
|
+
* @returns {number} - Returns the area width.
|
|
1090
|
+
*/
|
|
1027
1091
|
function getArea(rect) {
|
|
1028
1092
|
return (rect.width - rect.x) * (rect.height - rect.y);
|
|
1029
1093
|
}
|
|
1094
|
+
/**
|
|
1095
|
+
*
|
|
1096
|
+
* @param {Rect} input - Specifies input for the calculation.
|
|
1097
|
+
* @returns {number} - Returns the shortest edge.
|
|
1098
|
+
*/
|
|
1030
1099
|
function getShortestEdge(input) {
|
|
1031
1100
|
var container = convertToContainer(input);
|
|
1032
1101
|
var width = container.width;
|
|
@@ -1034,6 +1103,11 @@ function getShortestEdge(input) {
|
|
|
1034
1103
|
var result = Math.min(width, height);
|
|
1035
1104
|
return result;
|
|
1036
1105
|
}
|
|
1106
|
+
/**
|
|
1107
|
+
*
|
|
1108
|
+
* @param {Rect} rect - Specifies the rectangle bounds of the container.
|
|
1109
|
+
* @returns {Rect} - Returns the rectangle bounds.
|
|
1110
|
+
*/
|
|
1037
1111
|
function convertToContainer(rect) {
|
|
1038
1112
|
var x = rect.x;
|
|
1039
1113
|
var y = rect.y;
|
|
@@ -1046,6 +1120,11 @@ function convertToContainer(rect) {
|
|
|
1046
1120
|
height: height - y
|
|
1047
1121
|
};
|
|
1048
1122
|
}
|
|
1123
|
+
/**
|
|
1124
|
+
*
|
|
1125
|
+
* @param {Rect} container - Specifies the rectangle bounds of the container.
|
|
1126
|
+
* @returns {Rect} - Returns the rectangle bounds.
|
|
1127
|
+
*/
|
|
1049
1128
|
function convertToRect(container) {
|
|
1050
1129
|
var xOffset = container.x;
|
|
1051
1130
|
var yOffset = container.y;
|
|
@@ -1058,6 +1137,13 @@ function convertToRect(container) {
|
|
|
1058
1137
|
height: yOffset + height
|
|
1059
1138
|
};
|
|
1060
1139
|
}
|
|
1140
|
+
/**
|
|
1141
|
+
*
|
|
1142
|
+
* @param {number} pageX - Specifies the horizontal position of the mouse location.
|
|
1143
|
+
* @param {number} pageY - Specifies the vertical position of the mouse location.
|
|
1144
|
+
* @param {Element} element - Specifies the element to which the click is done.
|
|
1145
|
+
* @returns {Location} - Returns the clicked location.
|
|
1146
|
+
*/
|
|
1061
1147
|
function getMousePosition(pageX, pageY, element) {
|
|
1062
1148
|
var elementRect = element.getBoundingClientRect();
|
|
1063
1149
|
var pageXOffset = element.ownerDocument.defaultView.pageXOffset;
|
|
@@ -1068,9 +1154,15 @@ function getMousePosition(pageX, pageY, element) {
|
|
|
1068
1154
|
var positionY = elementRect.top + pageYOffset - clientTop;
|
|
1069
1155
|
return new Location((pageX - positionX), (pageY - positionY));
|
|
1070
1156
|
}
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1157
|
+
/**
|
|
1158
|
+
*
|
|
1159
|
+
* @param {ColorMappingModel[]} colorMapping - Specifies the color mapping instance.
|
|
1160
|
+
* @param {string} equalValue - Specifies the equal value.
|
|
1161
|
+
* @param {number | string} value - Specifies the range value.
|
|
1162
|
+
* @returns {any} - Returns the color mapping object.
|
|
1163
|
+
* @private
|
|
1164
|
+
*/
|
|
1165
|
+
function colorMap(colorMapping, equalValue, value) {
|
|
1074
1166
|
var fill;
|
|
1075
1167
|
var paths = [];
|
|
1076
1168
|
var opacity;
|
|
@@ -1082,7 +1174,8 @@ value, weightValuePath) {
|
|
|
1082
1174
|
var dataValue = value;
|
|
1083
1175
|
if (!isNullOrUndefined(colorMapping[i].from) && !isNullOrUndefined(colorMapping[i].to)
|
|
1084
1176
|
&& !isNullOrUndefined(colorMapping[i].value)) {
|
|
1085
|
-
if ((value >= colorMapping[i].from && colorMapping[i].to >= value) &&
|
|
1177
|
+
if ((value >= colorMapping[i].from && colorMapping[i].to >= value) &&
|
|
1178
|
+
(colorMapping[i].value === equalValue)) {
|
|
1086
1179
|
isEqualColor = true;
|
|
1087
1180
|
if (Object.prototype.toString.call(colorMapping[i].color) === '[object Array]') {
|
|
1088
1181
|
fill = !isEqualColor ? colorCollections(colorMapping[i], dataValue) : colorMapping[i].color[0];
|
|
@@ -1094,7 +1187,8 @@ value, weightValuePath) {
|
|
|
1094
1187
|
}
|
|
1095
1188
|
else if ((!isNullOrUndefined(colorMapping[i].from) && !isNullOrUndefined(colorMapping[i].to))
|
|
1096
1189
|
|| !isNullOrUndefined((colorMapping[i].value))) {
|
|
1097
|
-
if ((value >= colorMapping[i].from && colorMapping[i].to >= value)
|
|
1190
|
+
if ((value >= colorMapping[i].from && colorMapping[i].to >= value)
|
|
1191
|
+
|| (colorMapping[i].value === equalValue)) {
|
|
1098
1192
|
if (colorMapping[i].value === equalValue) {
|
|
1099
1193
|
isEqualColor = true;
|
|
1100
1194
|
}
|
|
@@ -1106,9 +1200,11 @@ value, weightValuePath) {
|
|
|
1106
1200
|
}
|
|
1107
1201
|
}
|
|
1108
1202
|
}
|
|
1109
|
-
if (((value >= colorMapping[i].from && value <= colorMapping[i].to)
|
|
1110
|
-
|
|
1111
|
-
|
|
1203
|
+
if (((value >= colorMapping[i].from && value <= colorMapping[i].to)
|
|
1204
|
+
|| (colorMapping[i].value === equalValue))
|
|
1205
|
+
&& !isNullOrUndefined(colorMapping[i].minOpacity) && !isNullOrUndefined(colorMapping[i].maxOpacity)
|
|
1206
|
+
&& fill) {
|
|
1207
|
+
opacity = deSaturationColor(colorMapping[i], value);
|
|
1112
1208
|
}
|
|
1113
1209
|
if ((fill === '' || isNullOrUndefined(fill))
|
|
1114
1210
|
&& isNullOrUndefined(colorMapping[i].from) && isNullOrUndefined(colorMapping[i].to)
|
|
@@ -1126,7 +1222,14 @@ value, weightValuePath) {
|
|
|
1126
1222
|
}
|
|
1127
1223
|
return { fill: fill, opacity: opacity };
|
|
1128
1224
|
}
|
|
1129
|
-
|
|
1225
|
+
/**
|
|
1226
|
+
*
|
|
1227
|
+
* @param {ColorMappingModel} colorMapping - Specifies the color mapping object.
|
|
1228
|
+
* @param {number} rangeValue - Specifies the range value.
|
|
1229
|
+
* @returns {string} - Returns the opacity for the color mapping.
|
|
1230
|
+
* @private
|
|
1231
|
+
*/
|
|
1232
|
+
function deSaturationColor(colorMapping, rangeValue) {
|
|
1130
1233
|
var opacity = 1;
|
|
1131
1234
|
if ((rangeValue >= colorMapping.from && rangeValue <= colorMapping.to)) {
|
|
1132
1235
|
var ratio = (rangeValue - colorMapping.from) / (colorMapping.to - colorMapping.from);
|
|
@@ -1134,13 +1237,32 @@ function deSaturationColor(weightValuePath, colorMapping, color, rangeValue) {
|
|
|
1134
1237
|
}
|
|
1135
1238
|
return opacity.toString();
|
|
1136
1239
|
}
|
|
1240
|
+
/**
|
|
1241
|
+
*
|
|
1242
|
+
* @param {ColorMappingModel} colorMap - Specifies the color mapping object.
|
|
1243
|
+
* @param {number} value - Specifies the range value.
|
|
1244
|
+
* @returns {string} - Returns the fill color.
|
|
1245
|
+
*/
|
|
1137
1246
|
function colorCollections(colorMap, value) {
|
|
1138
1247
|
var gradientFill = getColorByValue(colorMap, value);
|
|
1139
1248
|
return gradientFill;
|
|
1140
1249
|
}
|
|
1250
|
+
/**
|
|
1251
|
+
*
|
|
1252
|
+
* @param {number} r - Specifies the red color value.
|
|
1253
|
+
* @param {number} g - Specifies the green color value.
|
|
1254
|
+
* @param {number} b - Specifies the blue color value.
|
|
1255
|
+
* @returns {string} - Returns the fill color.
|
|
1256
|
+
*/
|
|
1141
1257
|
function rgbToHex(r, g, b) {
|
|
1142
1258
|
return '#' + componentToHex(r) + componentToHex(g) + componentToHex(b);
|
|
1143
1259
|
}
|
|
1260
|
+
/**
|
|
1261
|
+
*
|
|
1262
|
+
* @param {ColorMappingModel} colorMap - Specifies the color mapping.
|
|
1263
|
+
* @param {number} value - Specifies the range value.
|
|
1264
|
+
* @returns {string} - Returns the fill color.
|
|
1265
|
+
*/
|
|
1144
1266
|
function getColorByValue(colorMap, value) {
|
|
1145
1267
|
var color = '';
|
|
1146
1268
|
var rbg;
|
|
@@ -1156,6 +1278,12 @@ function getColorByValue(colorMap, value) {
|
|
|
1156
1278
|
}
|
|
1157
1279
|
return color;
|
|
1158
1280
|
}
|
|
1281
|
+
/**
|
|
1282
|
+
*
|
|
1283
|
+
* @param {number} value - Specifies the range value.
|
|
1284
|
+
* @param {ColorMappingModel} colorMap - Specifies the color mapping.
|
|
1285
|
+
* @returns {ColorValue} - Returns the color value object.
|
|
1286
|
+
*/
|
|
1159
1287
|
function getGradientColor(value, colorMap) {
|
|
1160
1288
|
var previousOffset = colorMap.from;
|
|
1161
1289
|
var nextOffset = colorMap.to;
|
|
@@ -1178,7 +1306,6 @@ function getGradientColor(value, colorMap) {
|
|
|
1178
1306
|
var b = void 0;
|
|
1179
1307
|
var c = void 0;
|
|
1180
1308
|
var length_1 = colorMap.color.length - 1;
|
|
1181
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1182
1309
|
var splitColorValueOffset = [];
|
|
1183
1310
|
var splitColor = {};
|
|
1184
1311
|
for (var j = 1; j < length_1; j++) {
|
|
@@ -1216,6 +1343,13 @@ function getGradientColor(value, colorMap) {
|
|
|
1216
1343
|
}
|
|
1217
1344
|
return getPercentageColor(percent, previousColor, nextColor);
|
|
1218
1345
|
}
|
|
1346
|
+
/**
|
|
1347
|
+
*
|
|
1348
|
+
* @param {number} percent - Specifies the percentage of the color.
|
|
1349
|
+
* @param {number} previous - Specifies the previous color.
|
|
1350
|
+
* @param {number} next - Specifies the next color.
|
|
1351
|
+
* @returns {ColorValue} - Returns the color value object.
|
|
1352
|
+
*/
|
|
1219
1353
|
function getPercentageColor(percent, previous, next) {
|
|
1220
1354
|
var nextColor = next.split('#')[1];
|
|
1221
1355
|
var prevColor = previous.split('#')[1];
|
|
@@ -1224,10 +1358,24 @@ function getPercentageColor(percent, previous, next) {
|
|
|
1224
1358
|
var b = getPercentage(percent, parseInt(prevColor.substr(4, 2), 16), parseInt(nextColor.substr(4, 2), 16));
|
|
1225
1359
|
return new ColorValue(r, g, b);
|
|
1226
1360
|
}
|
|
1361
|
+
/**
|
|
1362
|
+
*
|
|
1363
|
+
* @param {number} percent - Specifies the percentage of the color.
|
|
1364
|
+
* @param {number} previous - Specifies the previous color.
|
|
1365
|
+
* @param {number} next - Specifies the next color.
|
|
1366
|
+
* @returns {number} - Returns the color value.
|
|
1367
|
+
*/
|
|
1227
1368
|
function getPercentage(percent, previous, next) {
|
|
1228
1369
|
var full = next - previous;
|
|
1229
1370
|
return Math.round((previous + (full * percent)));
|
|
1230
1371
|
}
|
|
1372
|
+
/**
|
|
1373
|
+
*
|
|
1374
|
+
* @param {number} maximumWidth - Specifies the length of the text.
|
|
1375
|
+
* @param {string} dataLabel - Specifies the label.
|
|
1376
|
+
* @param {FontModel} font - Specifies the font of the label.
|
|
1377
|
+
* @returns {string[]} - Returns the labels.
|
|
1378
|
+
*/
|
|
1231
1379
|
function wordWrap(maximumWidth, dataLabel, font) {
|
|
1232
1380
|
var textCollection = dataLabel.split(' ');
|
|
1233
1381
|
var label = '';
|
|
@@ -1254,6 +1402,13 @@ function wordWrap(maximumWidth, dataLabel, font) {
|
|
|
1254
1402
|
}
|
|
1255
1403
|
return labelCollection;
|
|
1256
1404
|
}
|
|
1405
|
+
/**
|
|
1406
|
+
*
|
|
1407
|
+
* @param {number} maxWidth - Specifies the length of the text.
|
|
1408
|
+
* @param {string} label - Specifies the label.
|
|
1409
|
+
* @param {FontModel} font - Specifies the font of the label.
|
|
1410
|
+
* @returns {string[]} - Returns the labels.
|
|
1411
|
+
*/
|
|
1257
1412
|
function textWrap(maxWidth, label, font) {
|
|
1258
1413
|
var resultText = [];
|
|
1259
1414
|
var currentLength = 0;
|
|
@@ -1282,11 +1437,11 @@ function textWrap(maxWidth, label, font) {
|
|
|
1282
1437
|
/**
|
|
1283
1438
|
* hide function
|
|
1284
1439
|
*
|
|
1285
|
-
* @param {number} maxWidth - Specifies the maximum width
|
|
1286
|
-
* @param {number} maxHeight - Specifies the maximum height
|
|
1287
|
-
* @param {string} text - Specifies the text
|
|
1288
|
-
* @param {FontModel} font - Specifies the font
|
|
1289
|
-
* @returns {string} - Returns the
|
|
1440
|
+
* @param {number} maxWidth - Specifies the maximum width.
|
|
1441
|
+
* @param {number} maxHeight - Specifies the maximum height.
|
|
1442
|
+
* @param {string} text - Specifies the text.
|
|
1443
|
+
* @param {FontModel} font - Specifies the font.
|
|
1444
|
+
* @returns {string} - Returns the hidden text.
|
|
1290
1445
|
*/
|
|
1291
1446
|
function hide(maxWidth, maxHeight, text, font) {
|
|
1292
1447
|
var hideText = text;
|
|
@@ -1294,6 +1449,12 @@ function hide(maxWidth, maxHeight, text, font) {
|
|
|
1294
1449
|
hideText = (textSize.width > maxWidth || textSize.height > maxHeight) ? ' ' : text;
|
|
1295
1450
|
return hideText;
|
|
1296
1451
|
}
|
|
1452
|
+
/**
|
|
1453
|
+
*
|
|
1454
|
+
* @param {number} a - Specifies the first value of the leaf.
|
|
1455
|
+
* @param {number} b - Specifies the second value of the leaf.
|
|
1456
|
+
* @returns {number} - Returns whether values are equal or not.
|
|
1457
|
+
*/
|
|
1297
1458
|
function orderByArea(a, b) {
|
|
1298
1459
|
if (a['itemArea'] === b['itemArea']) {
|
|
1299
1460
|
return 0;
|
|
@@ -1303,6 +1464,13 @@ function orderByArea(a, b) {
|
|
|
1303
1464
|
}
|
|
1304
1465
|
return -1;
|
|
1305
1466
|
}
|
|
1467
|
+
/**
|
|
1468
|
+
*
|
|
1469
|
+
* @param {TreeMap} treemap - Specifies the treemap instance.
|
|
1470
|
+
* @param {Element} element - Specifies the selected TreeMap leaf item.
|
|
1471
|
+
* @param {string} className -Specifies the selected class name.
|
|
1472
|
+
* @returns {void}
|
|
1473
|
+
*/
|
|
1306
1474
|
function maintainSelection(treemap, element, className) {
|
|
1307
1475
|
var elementId = treemap.levelSelection;
|
|
1308
1476
|
if (elementId) {
|
|
@@ -1322,21 +1490,35 @@ function maintainSelection(treemap, element, className) {
|
|
|
1322
1490
|
}
|
|
1323
1491
|
}
|
|
1324
1492
|
}
|
|
1493
|
+
/**
|
|
1494
|
+
*
|
|
1495
|
+
* @param {TreeMap} treemap - Specifies the treemap instance.
|
|
1496
|
+
* @param {Element} legendGroup - Specifies the selected element.
|
|
1497
|
+
* @returns {void}
|
|
1498
|
+
*/
|
|
1325
1499
|
function legendMaintain(treemap, legendGroup) {
|
|
1326
1500
|
var elementId = treemap.legendId;
|
|
1327
1501
|
if (elementId) {
|
|
1328
1502
|
for (var i = 0; i < elementId.length; i++) {
|
|
1329
1503
|
for (var j = 0; j < legendGroup.childElementCount; j++) {
|
|
1330
1504
|
if (legendGroup.childNodes[j]['id'] === elementId[i]) {
|
|
1331
|
-
legendGroup.childNodes[j]
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1505
|
+
var treemapSVGRectElement = legendGroup.childNodes[j];
|
|
1506
|
+
treemapSVGRectElement.setAttribute('fill', treemap.selectionSettings.fill);
|
|
1507
|
+
treemapSVGRectElement.setAttribute('stroke', treemap.selectionSettings.border.color);
|
|
1508
|
+
treemapSVGRectElement.setAttribute('stroke-width', (treemap.selectionSettings.border.width).toString());
|
|
1509
|
+
treemapSVGRectElement.setAttribute('opacity', treemap.selectionSettings.opacity);
|
|
1335
1510
|
}
|
|
1336
1511
|
}
|
|
1337
1512
|
}
|
|
1338
1513
|
}
|
|
1339
1514
|
}
|
|
1515
|
+
/**
|
|
1516
|
+
*
|
|
1517
|
+
* @param {HTMLCollection} elements - Specifies the selected TreeMap element.
|
|
1518
|
+
* @param {string} type - Specifies the selection type.
|
|
1519
|
+
* @param {TreeMap} treemap - Specifies the TreeMap instance.
|
|
1520
|
+
* @returns {void}
|
|
1521
|
+
*/
|
|
1340
1522
|
function removeClassNames(elements, type, treemap) {
|
|
1341
1523
|
var element;
|
|
1342
1524
|
var options = {};
|
|
@@ -1349,7 +1531,12 @@ function removeClassNames(elements, type, treemap) {
|
|
|
1349
1531
|
j -= 1;
|
|
1350
1532
|
}
|
|
1351
1533
|
}
|
|
1352
|
-
|
|
1534
|
+
/**
|
|
1535
|
+
*
|
|
1536
|
+
* @param {SVGPathElement} element - Specifies the SVG path element.
|
|
1537
|
+
* @param {any} options - Specifies the settings for the SVG path element.
|
|
1538
|
+
* @returns {void}
|
|
1539
|
+
*/
|
|
1353
1540
|
function applyOptions(element, options) {
|
|
1354
1541
|
element.setAttribute('opacity', options['opacity']);
|
|
1355
1542
|
if (!isNullOrUndefined(options['fill'])) {
|
|
@@ -1358,7 +1545,13 @@ function applyOptions(element, options) {
|
|
|
1358
1545
|
element.setAttribute('stroke', options['border']['color']);
|
|
1359
1546
|
element.setAttribute('stroke-width', options['border']['width']);
|
|
1360
1547
|
}
|
|
1361
|
-
|
|
1548
|
+
/**
|
|
1549
|
+
*
|
|
1550
|
+
* @param {string} format - Specifies the format value.
|
|
1551
|
+
* @param {any} data - Specifies the data source object.
|
|
1552
|
+
* @param {TreeMap} treemap - Specifies the TreeMap instance.
|
|
1553
|
+
* @returns {string} - Returns the formatted text.
|
|
1554
|
+
*/
|
|
1362
1555
|
function textFormatter(format, data, treemap) {
|
|
1363
1556
|
if (isNullOrUndefined(format)) {
|
|
1364
1557
|
return null;
|
|
@@ -1370,8 +1563,13 @@ function textFormatter(format, data, treemap) {
|
|
|
1370
1563
|
}
|
|
1371
1564
|
return format;
|
|
1372
1565
|
}
|
|
1566
|
+
/**
|
|
1567
|
+
*
|
|
1568
|
+
* @param {number} value - Specifies the text to be formatted.
|
|
1569
|
+
* @param {TreeMap} treemap - Specifies the TreeMap instance.
|
|
1570
|
+
* @returns {string | number} - Returns the formatted text.
|
|
1571
|
+
*/
|
|
1373
1572
|
function formatValue(value, treemap) {
|
|
1374
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1375
1573
|
var formatValue;
|
|
1376
1574
|
var formatFunction;
|
|
1377
1575
|
if (treemap.format && !isNaN(Number(value))) {
|
|
@@ -1403,7 +1601,7 @@ function convertToHexCode(value) {
|
|
|
1403
1601
|
return '#' + componentToHex(value.r) + componentToHex(value.g) + componentToHex(value.b);
|
|
1404
1602
|
}
|
|
1405
1603
|
/**
|
|
1406
|
-
* @param {number} value -
|
|
1604
|
+
* @param {number} value - Specifies the value
|
|
1407
1605
|
* @returns {string} - Returns the string
|
|
1408
1606
|
* @private */
|
|
1409
1607
|
function componentToHex(value) {
|
|
@@ -1430,9 +1628,8 @@ function colorNameToHex(color) {
|
|
|
1430
1628
|
var element = document.getElementById('treeMapMeasureText');
|
|
1431
1629
|
element.style.color = color;
|
|
1432
1630
|
color = window.getComputedStyle(element).color;
|
|
1433
|
-
var
|
|
1434
|
-
|
|
1435
|
-
return convertToHexCode(new ColorValue(parseInt(isRGBValue[3], 10), parseInt(isRGBValue[4], 10), parseInt(isRGBValue[5], 10)));
|
|
1631
|
+
var isRGBValue = color.replace(/[()RGBrgba ]/g, '').split(',');
|
|
1632
|
+
return convertToHexCode(new ColorValue(parseInt(isRGBValue[0], 10), parseInt(isRGBValue[1], 10), parseInt(isRGBValue[2], 10)));
|
|
1436
1633
|
}
|
|
1437
1634
|
/**
|
|
1438
1635
|
* @param {Location} location - Specifies the location
|
|
@@ -1550,7 +1747,12 @@ function renderLegendShape(location, size, shape, options, url) {
|
|
|
1550
1747
|
}
|
|
1551
1748
|
return { renderOption: options, functionName: functionName };
|
|
1552
1749
|
}
|
|
1553
|
-
|
|
1750
|
+
/**
|
|
1751
|
+
*
|
|
1752
|
+
* @param {any} data - Specifies the data source object.
|
|
1753
|
+
* @param {any} item - Specifies the leaf item.
|
|
1754
|
+
* @returns {boolean} - Returns whether the TreeMap item is level item or leaf item.
|
|
1755
|
+
*/
|
|
1554
1756
|
function isParentItem(data, item) {
|
|
1555
1757
|
var isParentItem = false;
|
|
1556
1758
|
for (var j = 0; j < data.length; j++) {
|
|
@@ -1565,7 +1767,6 @@ function isParentItem(data, item) {
|
|
|
1565
1767
|
* Ajax support for treemap
|
|
1566
1768
|
*/
|
|
1567
1769
|
var TreeMapAjax = /** @__PURE__ @class */ (function () {
|
|
1568
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1569
1770
|
function TreeMapAjax(options, type, async, contentType, sendData) {
|
|
1570
1771
|
this.dataOptions = options;
|
|
1571
1772
|
this.type = type || 'GET';
|
|
@@ -1575,21 +1776,29 @@ var TreeMapAjax = /** @__PURE__ @class */ (function () {
|
|
|
1575
1776
|
}
|
|
1576
1777
|
return TreeMapAjax;
|
|
1577
1778
|
}());
|
|
1578
|
-
|
|
1579
|
-
|
|
1779
|
+
/**
|
|
1780
|
+
*
|
|
1781
|
+
* @param {any[]} collection - Specifies the legend collection.
|
|
1782
|
+
* @returns {void}
|
|
1783
|
+
* @private
|
|
1784
|
+
*/
|
|
1785
|
+
function removeShape(collection) {
|
|
1580
1786
|
if (collection.length > 0) {
|
|
1581
1787
|
for (var i = 0; i < collection.length; i++) {
|
|
1582
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1583
1788
|
var item = collection[i];
|
|
1584
1789
|
setColor(item['legendEle'], item['oldFill'], item['oldOpacity'], item['oldBorderColor'], item['oldBorderWidth']);
|
|
1585
1790
|
}
|
|
1586
1791
|
}
|
|
1587
1792
|
}
|
|
1588
|
-
|
|
1589
|
-
|
|
1793
|
+
/**
|
|
1794
|
+
*
|
|
1795
|
+
* @param {any[]} collection - Specifies the legend collection.
|
|
1796
|
+
* @returns {void}
|
|
1797
|
+
* @private
|
|
1798
|
+
*/
|
|
1799
|
+
function removeLegend(collection) {
|
|
1590
1800
|
if (collection.length > 0) {
|
|
1591
1801
|
for (var j = 0; j < collection.length; j++) {
|
|
1592
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1593
1802
|
var item = collection[j];
|
|
1594
1803
|
setColor(item['legendEle'], item['oldFill'], item['oldOpacity'], item['oldBorderColor'], item['oldBorderWidth']);
|
|
1595
1804
|
var dataCount = item['ShapeCollection']['Elements'].length;
|
|
@@ -1599,19 +1808,40 @@ function removeLegend(collection, value) {
|
|
|
1599
1808
|
}
|
|
1600
1809
|
}
|
|
1601
1810
|
}
|
|
1811
|
+
/**
|
|
1812
|
+
*
|
|
1813
|
+
* @param {Element} element - Specifies the selected element.
|
|
1814
|
+
* @param {string} fill - Specifies the fill color.
|
|
1815
|
+
* @param {string} opacity - Specifies the opacity.
|
|
1816
|
+
* @param {string} borderColor - Specifies the border color.
|
|
1817
|
+
* @param {string} borderWidth - Specifies the border width.
|
|
1818
|
+
* @returns {void}
|
|
1819
|
+
*/
|
|
1602
1820
|
function setColor(element, fill, opacity, borderColor, borderWidth) {
|
|
1603
1821
|
element.setAttribute('fill', fill);
|
|
1604
1822
|
element.setAttribute('opacity', opacity);
|
|
1605
1823
|
element.setAttribute('stroke', borderColor);
|
|
1606
1824
|
element.setAttribute('stroke-width', borderWidth);
|
|
1607
1825
|
}
|
|
1608
|
-
|
|
1826
|
+
/**
|
|
1827
|
+
*
|
|
1828
|
+
* @param {any[]} collection - Specifies the selected item collection.
|
|
1829
|
+
* @param {any[]} element - Specifies the selected element collection.
|
|
1830
|
+
* @param {TreeMap} treemap - Specifies the TreeMap instance.
|
|
1831
|
+
* @returns {void}
|
|
1832
|
+
*/
|
|
1609
1833
|
function removeSelectionWithHighlight(collection, element, treemap) {
|
|
1610
|
-
removeShape(collection
|
|
1834
|
+
removeShape(collection);
|
|
1611
1835
|
element = [];
|
|
1612
1836
|
removeClassNames(document.getElementsByClassName('treeMapHighLight'), 'treeMapHighLight', treemap);
|
|
1613
1837
|
}
|
|
1614
|
-
|
|
1838
|
+
/**
|
|
1839
|
+
*
|
|
1840
|
+
* @param {number} length - Specifies the length of the legend group.
|
|
1841
|
+
* @param {any} item - Specifies the legend item.
|
|
1842
|
+
* @param {TreeMap} treemap - Specifies the TreeMap instance.
|
|
1843
|
+
* @returns {number} - Returns the legend index.
|
|
1844
|
+
*/
|
|
1615
1845
|
function getLegendIndex(length, item, treemap) {
|
|
1616
1846
|
var index;
|
|
1617
1847
|
for (var i = 0; i < length; i++) {
|
|
@@ -1625,11 +1855,18 @@ function getLegendIndex(length, item, treemap) {
|
|
|
1625
1855
|
}
|
|
1626
1856
|
return index;
|
|
1627
1857
|
}
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
collection
|
|
1631
|
-
|
|
1632
|
-
|
|
1858
|
+
/**
|
|
1859
|
+
*
|
|
1860
|
+
* @param {any[]} collection - Specifies the legend collection.
|
|
1861
|
+
* @param {number} index - Specifies the index of legend.
|
|
1862
|
+
* @param {number} number - Specifies the leaf item index.
|
|
1863
|
+
* @param {Element} legendElement - Specifies the legend element.
|
|
1864
|
+
* @param {Element} shapeElement - Specifies the shape element.
|
|
1865
|
+
* @param {any[]} renderItems - Specifies the item index.
|
|
1866
|
+
* @param {any[]} legendCollection - Specifies the legend collection.
|
|
1867
|
+
* @returns {void}
|
|
1868
|
+
*/
|
|
1869
|
+
function pushCollection(collection, index, number, legendElement, shapeElement, renderItems, legendCollection) {
|
|
1633
1870
|
collection.push({
|
|
1634
1871
|
legendEle: legendElement, oldFill: legendCollection[index]['legendFill'],
|
|
1635
1872
|
oldOpacity: legendCollection[index]['opacity'], oldBorderColor: legendCollection[index]['borderColor'],
|
|
@@ -1661,6 +1898,11 @@ function triggerDownload(fileName, type, url, isDownload) {
|
|
|
1661
1898
|
cancelable: true
|
|
1662
1899
|
}));
|
|
1663
1900
|
}
|
|
1901
|
+
/**
|
|
1902
|
+
*
|
|
1903
|
+
* @param {string} id - Specifies the id of the element to be removed.
|
|
1904
|
+
* @returns {void}
|
|
1905
|
+
*/
|
|
1664
1906
|
function removeElement(id) {
|
|
1665
1907
|
var element = document.getElementById(id);
|
|
1666
1908
|
return element ? remove(element) : null;
|
|
@@ -1670,7 +1912,6 @@ function removeElement(id) {
|
|
|
1670
1912
|
* To calculate and render the shape layer
|
|
1671
1913
|
*/
|
|
1672
1914
|
var LayoutPanel = /** @__PURE__ @class */ (function () {
|
|
1673
|
-
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility
|
|
1674
1915
|
function LayoutPanel(treemap) {
|
|
1675
1916
|
this.treemap = treemap;
|
|
1676
1917
|
}
|
|
@@ -1703,7 +1944,7 @@ var LayoutPanel = /** @__PURE__ @class */ (function () {
|
|
|
1703
1944
|
this.treemap.currentLevel = this.treemap.drilledItems[count]['data']['groupIndex'];
|
|
1704
1945
|
}
|
|
1705
1946
|
this.calculateLayoutItems(y || LevelsData.levelsData[0], totalRect);
|
|
1706
|
-
this.renderLayoutItems(
|
|
1947
|
+
this.renderLayoutItems();
|
|
1707
1948
|
}
|
|
1708
1949
|
else {
|
|
1709
1950
|
if (!isNullOrUndefined(this.treemap.initialDrillDown.groupIndex) &&
|
|
@@ -1712,7 +1953,7 @@ var LayoutPanel = /** @__PURE__ @class */ (function () {
|
|
|
1712
1953
|
this.treemap.currentLevel = this.treemap.initialDrillDown.groupIndex;
|
|
1713
1954
|
}
|
|
1714
1955
|
this.calculateLayoutItems(data || LevelsData.levelsData[0], totalRect);
|
|
1715
|
-
this.renderLayoutItems(
|
|
1956
|
+
this.renderLayoutItems();
|
|
1716
1957
|
}
|
|
1717
1958
|
}
|
|
1718
1959
|
};
|
|
@@ -1738,7 +1979,7 @@ var LayoutPanel = /** @__PURE__ @class */ (function () {
|
|
|
1738
1979
|
}
|
|
1739
1980
|
return drillData;
|
|
1740
1981
|
};
|
|
1741
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1982
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
1742
1983
|
LayoutPanel.prototype.calculateLayoutItems = function (data, rect) {
|
|
1743
1984
|
this.renderItems = [];
|
|
1744
1985
|
this.parentData = [];
|
|
@@ -1772,7 +2013,8 @@ var LayoutPanel = /** @__PURE__ @class */ (function () {
|
|
|
1772
2013
|
isLeafItem = (groups.length === 0 || groupIndex === groups.length);
|
|
1773
2014
|
gap = isLeafItem ? leafItem.gap : groups[groupIndex].groupGap;
|
|
1774
2015
|
headerHeight = groups.length === 0 ? 0 : groups[groupIndex] ? groups[groupIndex].showHeader ?
|
|
1775
|
-
groups[groupIndex].headerHeight : 0 : groups[groupIndex - 1].showHeader ?
|
|
2016
|
+
groups[groupIndex].headerHeight : 0 : groups[groupIndex - 1].showHeader ?
|
|
2017
|
+
groups[groupIndex - 1].headerHeight : 0;
|
|
1776
2018
|
rect = children[i]['rect'];
|
|
1777
2019
|
rect = new Rect(rect.x + (gap / 2), rect.y + (headerHeight + (gap / 2)), rect.width - gap, Math.abs(rect.height - (gap + headerHeight)));
|
|
1778
2020
|
this.computeSliceAndDiceDimensional(children[i], rect);
|
|
@@ -1844,8 +2086,9 @@ var LayoutPanel = /** @__PURE__ @class */ (function () {
|
|
|
1844
2086
|
rect = item['rect'];
|
|
1845
2087
|
padding = (item['isLeafItem'] ? leaf.padding : levels[index].groupPadding) / 2;
|
|
1846
2088
|
headerHeight = this.treemap.isHierarchicalData ? index === 0 && item['isLeafItem'] ? 0 : levels[index] ?
|
|
1847
|
-
levels[index].showHeader ? levels[index].headerHeight : 0 : 0 :
|
|
1848
|
-
levels
|
|
2089
|
+
levels[index].showHeader ? levels[index].headerHeight : 0 : 0 :
|
|
2090
|
+
(levels.length === 0) ? 0 : levels[index] ?
|
|
2091
|
+
levels[index].showHeader ? levels[index].headerHeight : 0 : 0;
|
|
1849
2092
|
rect = new Rect(rect.x + padding, rect.y + (headerHeight + padding), rect.width - padding, rect.height - padding);
|
|
1850
2093
|
if (!item['isLeafItem'] && item['weight'] > 0) {
|
|
1851
2094
|
this.computeSquarifyDimensional(child[i], rect);
|
|
@@ -2026,11 +2269,11 @@ var LayoutPanel = /** @__PURE__ @class */ (function () {
|
|
|
2026
2269
|
var result = [];
|
|
2027
2270
|
for (var i = 0; i < dataLength; i += 1) {
|
|
2028
2271
|
var dataLength_1 = data.length;
|
|
2029
|
-
var
|
|
2272
|
+
var dataSum = 0;
|
|
2030
2273
|
for (var i_1 = 0; i_1 < dataLength_1; i_1 += 1) {
|
|
2031
|
-
|
|
2274
|
+
dataSum += data[i_1]['weight'];
|
|
2032
2275
|
}
|
|
2033
|
-
var multiplier = area /
|
|
2276
|
+
var multiplier = area / dataSum;
|
|
2034
2277
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2035
2278
|
var datum = void 0;
|
|
2036
2279
|
for (var j = 0; j < dataLength_1; j++) {
|
|
@@ -2041,7 +2284,7 @@ var LayoutPanel = /** @__PURE__ @class */ (function () {
|
|
|
2041
2284
|
}
|
|
2042
2285
|
return result;
|
|
2043
2286
|
};
|
|
2044
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2287
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
2045
2288
|
LayoutPanel.prototype.onDemandProcess = function (childItems) {
|
|
2046
2289
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2047
2290
|
var parentItem = {};
|
|
@@ -2071,14 +2314,13 @@ var LayoutPanel = /** @__PURE__ @class */ (function () {
|
|
|
2071
2314
|
}
|
|
2072
2315
|
}
|
|
2073
2316
|
this.calculateLayoutItems(parentItemGroupname, totalRect);
|
|
2074
|
-
this.renderLayoutItems(
|
|
2317
|
+
this.renderLayoutItems();
|
|
2075
2318
|
};
|
|
2076
|
-
|
|
2077
|
-
LayoutPanel.prototype.renderLayoutItems = function (
|
|
2319
|
+
/** @private */
|
|
2320
|
+
LayoutPanel.prototype.renderLayoutItems = function () {
|
|
2078
2321
|
var _this = this;
|
|
2079
2322
|
var position;
|
|
2080
2323
|
var treeMap = this.treemap;
|
|
2081
|
-
var colorMapping;
|
|
2082
2324
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2083
2325
|
var txtVisible;
|
|
2084
2326
|
var getItemColor;
|
|
@@ -2110,13 +2352,13 @@ var LayoutPanel = /** @__PURE__ @class */ (function () {
|
|
|
2110
2352
|
var border;
|
|
2111
2353
|
var templateGroup = createElement('div', {
|
|
2112
2354
|
id: treeMap.element.id + '_Label_Template_Group',
|
|
2113
|
-
className: 'template'
|
|
2114
|
-
styles: 'overflow: hidden; position: absolute;pointer-events: none;' +
|
|
2115
|
-
'top:' + treeMap.areaRect.y + 'px;' +
|
|
2116
|
-
'left:' + treeMap.areaRect.x + 'px;' +
|
|
2117
|
-
'height:' + treeMap.areaRect.height + 'px;' +
|
|
2118
|
-
'width:' + treeMap.areaRect.width + 'px;'
|
|
2355
|
+
className: 'template'
|
|
2119
2356
|
});
|
|
2357
|
+
templateGroup.style.cssText = 'overflow: hidden; position: absolute;pointer-events: none;' +
|
|
2358
|
+
'top:' + treeMap.areaRect.y + 'px;' +
|
|
2359
|
+
'left:' + treeMap.areaRect.x + 'px;' +
|
|
2360
|
+
'height:' + treeMap.areaRect.height + 'px;' +
|
|
2361
|
+
'width:' + treeMap.areaRect.width + 'px;';
|
|
2120
2362
|
var isLeafItem = false;
|
|
2121
2363
|
var leaf = treeMap.leafItemSettings;
|
|
2122
2364
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -2150,7 +2392,6 @@ var LayoutPanel = /** @__PURE__ @class */ (function () {
|
|
|
2150
2392
|
rect.x = (treemapItemRect.x + treemapItemRect.width) - rect.width - Math.abs(treemapItemRect.x - rect.x);
|
|
2151
2393
|
rect.y = (treemapItemRect.y + treemapItemRect.height) - rect.height - Math.abs(treemapItemRect.y - rect.y);
|
|
2152
2394
|
}
|
|
2153
|
-
colorMapping = isLeafItem ? leaf.colorMapping : levels[index].colorMapping;
|
|
2154
2395
|
getItemColor = this_1.getItemColor(isLeafItem, item);
|
|
2155
2396
|
fill = getItemColor['fill'];
|
|
2156
2397
|
opacity = getItemColor['opacity'];
|
|
@@ -2230,8 +2471,6 @@ var LayoutPanel = /** @__PURE__ @class */ (function () {
|
|
|
2230
2471
|
this.treemap.svgObject.appendChild(this.layoutGroup);
|
|
2231
2472
|
};
|
|
2232
2473
|
LayoutPanel.prototype.renderItemText = function (text, parentElement, textStyle, rect, interSectAction, groupId, fill, position, connectorText) {
|
|
2233
|
-
var secondaryEle = document.getElementById(this.treemap.element.id + '_Secondary_Element');
|
|
2234
|
-
var leaf = this.treemap.leafItemSettings;
|
|
2235
2474
|
var padding = 5;
|
|
2236
2475
|
var textSize;
|
|
2237
2476
|
var textCollection = [];
|
|
@@ -2309,7 +2548,7 @@ var LayoutPanel = /** @__PURE__ @class */ (function () {
|
|
|
2309
2548
|
treemap.levels[item['groupIndex']].colorMapping;
|
|
2310
2549
|
if (colorMapping.length > 0) {
|
|
2311
2550
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2312
|
-
var option = colorMap(colorMapping, item['data'][this.treemap.equalColorValuePath], item['data'][this.treemap.rangeColorValuePath]
|
|
2551
|
+
var option = colorMap(colorMapping, item['data'][this.treemap.equalColorValuePath], item['data'][this.treemap.rangeColorValuePath]);
|
|
2313
2552
|
itemFill = !isNullOrUndefined(option['fill']) ? option['fill'] : treemap.leafItemSettings.fill;
|
|
2314
2553
|
itemOpacity = option['opacity'];
|
|
2315
2554
|
}
|
|
@@ -2346,8 +2585,8 @@ var LayoutPanel = /** @__PURE__ @class */ (function () {
|
|
|
2346
2585
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2347
2586
|
var keys = Object.keys(item['data']);
|
|
2348
2587
|
for (var i = 0; i < keys.length; i++) {
|
|
2349
|
-
|
|
2350
|
-
template = template.replace(new
|
|
2588
|
+
var regExp = RegExp;
|
|
2589
|
+
template = template.replace(new regExp('{{:' + keys[i] + '}}', 'g'), item['data'][keys[i].toString()]);
|
|
2351
2590
|
}
|
|
2352
2591
|
}
|
|
2353
2592
|
var labelElement;
|
|
@@ -2625,12 +2864,13 @@ var Print = /** @__PURE__ @class */ (function () {
|
|
|
2625
2864
|
*
|
|
2626
2865
|
* @param {TreeMap} control - Specifies the treemap instance.
|
|
2627
2866
|
*/
|
|
2628
|
-
// eslint-disable-next-line @typescript-eslint/
|
|
2867
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
|
|
2629
2868
|
function Print(control) {
|
|
2630
2869
|
}
|
|
2631
2870
|
/**
|
|
2632
2871
|
* This method is used to perform the print functionality in treemap.
|
|
2633
2872
|
*
|
|
2873
|
+
* @param {TreeMap} treeMap - Specifies the treemap instance.
|
|
2634
2874
|
* @param { string[] | string | Element} elements - Specifies the element.
|
|
2635
2875
|
* @returns {void}
|
|
2636
2876
|
* @private
|
|
@@ -2651,6 +2891,7 @@ var Print = /** @__PURE__ @class */ (function () {
|
|
|
2651
2891
|
/**
|
|
2652
2892
|
* To get the html string of the Maps
|
|
2653
2893
|
*
|
|
2894
|
+
* @param {TreeMap} treeMap - Specifies the treemap instance.
|
|
2654
2895
|
* @param {string[] | string | Element} elements - Specifies the element
|
|
2655
2896
|
* @returns {Element} - Returns the element
|
|
2656
2897
|
* @private
|
|
@@ -2690,6 +2931,7 @@ var Print = /** @__PURE__ @class */ (function () {
|
|
|
2690
2931
|
* @returns {void}
|
|
2691
2932
|
* @private
|
|
2692
2933
|
*/
|
|
2934
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
2693
2935
|
Print.prototype.destroy = function () { };
|
|
2694
2936
|
return Print;
|
|
2695
2937
|
}());
|
|
@@ -2705,12 +2947,13 @@ var ImageExport = /** @__PURE__ @class */ (function () {
|
|
|
2705
2947
|
*
|
|
2706
2948
|
* @param {TreeMap} control - Specifies the treemap instance
|
|
2707
2949
|
*/
|
|
2708
|
-
// eslint-disable-next-line @typescript-eslint/
|
|
2950
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
|
|
2709
2951
|
function ImageExport(control) {
|
|
2710
2952
|
}
|
|
2711
2953
|
/**
|
|
2712
2954
|
* This method is used to perform the export functionality for the rendered treemap.
|
|
2713
2955
|
*
|
|
2956
|
+
* @param {TreeMap} treeMap - Specifies the treemap instance.
|
|
2714
2957
|
* @param {ExportType} type - Specifies the type of the image file.
|
|
2715
2958
|
* @param {string} fileName - Specifies the file name of the image file.
|
|
2716
2959
|
* @param {boolean} allowDownload - Specifies whether to download the file or not.
|
|
@@ -2718,7 +2961,7 @@ var ImageExport = /** @__PURE__ @class */ (function () {
|
|
|
2718
2961
|
* @private
|
|
2719
2962
|
*/
|
|
2720
2963
|
ImageExport.prototype.export = function (treeMap, type, fileName, allowDownload) {
|
|
2721
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2964
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
|
|
2722
2965
|
var promise = new Promise(function (resolve, reject) {
|
|
2723
2966
|
var element = createElement('canvas', {
|
|
2724
2967
|
id: 'ej2-canvas',
|
|
@@ -2774,6 +3017,7 @@ var ImageExport = /** @__PURE__ @class */ (function () {
|
|
|
2774
3017
|
* @returns {void}
|
|
2775
3018
|
* @private
|
|
2776
3019
|
*/
|
|
3020
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
2777
3021
|
ImageExport.prototype.destroy = function () { };
|
|
2778
3022
|
return ImageExport;
|
|
2779
3023
|
}());
|
|
@@ -2789,12 +3033,13 @@ var PdfExport = /** @__PURE__ @class */ (function () {
|
|
|
2789
3033
|
*
|
|
2790
3034
|
* @param {TreeMap} control - Specifies the treemap instance
|
|
2791
3035
|
*/
|
|
2792
|
-
// eslint-disable-next-line @typescript-eslint/
|
|
3036
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
|
|
2793
3037
|
function PdfExport(control) {
|
|
2794
3038
|
}
|
|
2795
3039
|
/**
|
|
2796
3040
|
* This method is used to perform the export functionality for the rendered treemap.
|
|
2797
3041
|
*
|
|
3042
|
+
* @param {TreeMap} treeMap - Specifies the treemap instance.
|
|
2798
3043
|
* @param {ExportType} type - Specifies the type of the document.
|
|
2799
3044
|
* @param {string} fileName - Specifies the name of the document.
|
|
2800
3045
|
* @param {PdfPageOrientation} orientation - Specifies the orientation of the PDF document to export the component.
|
|
@@ -2803,7 +3048,7 @@ var PdfExport = /** @__PURE__ @class */ (function () {
|
|
|
2803
3048
|
* @private
|
|
2804
3049
|
*/
|
|
2805
3050
|
PdfExport.prototype.export = function (treeMap, type, fileName, orientation, allowDownload) {
|
|
2806
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3051
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
|
|
2807
3052
|
var promise = new Promise(function (resolve, reject) {
|
|
2808
3053
|
var element = createElement('canvas', {
|
|
2809
3054
|
id: 'ej2-canvas',
|
|
@@ -2812,7 +3057,6 @@ var PdfExport = /** @__PURE__ @class */ (function () {
|
|
|
2812
3057
|
'height': treeMap.availableSize.height.toString()
|
|
2813
3058
|
}
|
|
2814
3059
|
});
|
|
2815
|
-
var isDownload = !(Browser.userAgent.toString().indexOf('HeadlessChrome') > -1);
|
|
2816
3060
|
orientation = isNullOrUndefined(orientation) ? PdfPageOrientation.Landscape : orientation;
|
|
2817
3061
|
var exportElement = treeMap.svgObject.cloneNode(true);
|
|
2818
3062
|
var backgroundElement = exportElement.childNodes[0];
|
|
@@ -2856,14 +3100,11 @@ var PdfExport = /** @__PURE__ @class */ (function () {
|
|
|
2856
3100
|
* @returns {void}
|
|
2857
3101
|
* @private
|
|
2858
3102
|
*/
|
|
3103
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
2859
3104
|
PdfExport.prototype.destroy = function () { };
|
|
2860
3105
|
return PdfExport;
|
|
2861
3106
|
}());
|
|
2862
3107
|
|
|
2863
|
-
/* eslint-disable @typescript-eslint/ban-types */
|
|
2864
|
-
/* eslint-disable @typescript-eslint/dot-notation */
|
|
2865
|
-
/* eslint-disable brace-style */
|
|
2866
|
-
/* eslint-disable max-len */
|
|
2867
3108
|
/**
|
|
2868
3109
|
* Tree Map Components
|
|
2869
3110
|
*/
|
|
@@ -2898,10 +3139,12 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
|
|
|
2898
3139
|
*/
|
|
2899
3140
|
var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
2900
3141
|
__extends(TreeMap, _super);
|
|
2901
|
-
/**
|
|
3142
|
+
/**
|
|
2902
3143
|
* Constructor for TreeMap component.
|
|
3144
|
+
*
|
|
3145
|
+
* @param {TreeMapModel} options - Specifies the treemap instance.
|
|
3146
|
+
* @param {string | HTMLElement} element - Specifies the treemap element.
|
|
2903
3147
|
*/
|
|
2904
|
-
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility
|
|
2905
3148
|
function TreeMap(options, element) {
|
|
2906
3149
|
var _this = _super.call(this, options, element) || this;
|
|
2907
3150
|
/**
|
|
@@ -3035,9 +3278,9 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3035
3278
|
}
|
|
3036
3279
|
if (isNullOrUndefined(document.getElementById(this.element.id + '_Secondary_Element'))) {
|
|
3037
3280
|
var secondaryElement = createElement('div', {
|
|
3038
|
-
id: this.element.id + '_Secondary_Element'
|
|
3039
|
-
styles: 'position: absolute;z-index:1;'
|
|
3281
|
+
id: this.element.id + '_Secondary_Element'
|
|
3040
3282
|
});
|
|
3283
|
+
secondaryElement.style.cssText = 'position: absolute;z-index:1;';
|
|
3041
3284
|
this.element.appendChild(secondaryElement);
|
|
3042
3285
|
}
|
|
3043
3286
|
};
|
|
@@ -3049,9 +3292,9 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3049
3292
|
}
|
|
3050
3293
|
};
|
|
3051
3294
|
/**
|
|
3052
|
-
* @private
|
|
3053
3295
|
* Render the treemap border
|
|
3054
3296
|
*
|
|
3297
|
+
* @private
|
|
3055
3298
|
* @returns {void}
|
|
3056
3299
|
*/
|
|
3057
3300
|
TreeMap.prototype.renderBorder = function () {
|
|
@@ -3130,11 +3373,12 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3130
3373
|
var child = findChildren(this.dataSource[i])['values'];
|
|
3131
3374
|
if (this.isHierarchicalData && child && child.length > 0) {
|
|
3132
3375
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3133
|
-
child.forEach(function (currentData
|
|
3376
|
+
child.forEach(function (currentData) {
|
|
3134
3377
|
if (currentData[path]) {
|
|
3135
3378
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3136
3379
|
data_1[path].push({
|
|
3137
|
-
groupIndex: 0, name: currentData[path],
|
|
3380
|
+
groupIndex: 0, name: currentData[path],
|
|
3381
|
+
levelOrderName: currentData[path].toString(),
|
|
3138
3382
|
data: currentData, weight: currentData[_this.weightValuePath]
|
|
3139
3383
|
});
|
|
3140
3384
|
}
|
|
@@ -3195,11 +3439,10 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3195
3439
|
var _this = this;
|
|
3196
3440
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3197
3441
|
var childData;
|
|
3442
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3198
3443
|
var newData = {};
|
|
3199
3444
|
var levelIndex;
|
|
3200
3445
|
var path = this.leafItemSettings.labelPath ? this.leafItemSettings.labelPath : this.weightValuePath;
|
|
3201
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3202
|
-
var level;
|
|
3203
3446
|
var key;
|
|
3204
3447
|
newData = findChildren(data);
|
|
3205
3448
|
childData = newData ? newData['values'] : null;
|
|
@@ -3207,7 +3450,6 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3207
3450
|
key = newData['key'];
|
|
3208
3451
|
for (var i = 0; i < this.levels.length; i++) {
|
|
3209
3452
|
if (key === this.levels[i].groupPath) {
|
|
3210
|
-
level = this.levels[i];
|
|
3211
3453
|
levelIndex = i;
|
|
3212
3454
|
}
|
|
3213
3455
|
}
|
|
@@ -3258,7 +3500,8 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3258
3500
|
/**
|
|
3259
3501
|
* This method is used to perform the print functionality in treemap.
|
|
3260
3502
|
*
|
|
3261
|
-
* @param id - Specifies the element to print the treemap.
|
|
3503
|
+
* @param {string[] | string | Element} id - Specifies the element to print the treemap.
|
|
3504
|
+
* @returns {void}
|
|
3262
3505
|
*/
|
|
3263
3506
|
TreeMap.prototype.print = function (id) {
|
|
3264
3507
|
if (this.allowPrint && this.printModule) {
|
|
@@ -3268,9 +3511,11 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3268
3511
|
/**
|
|
3269
3512
|
* This method is used to perform the export functionality for the rendered treemap.
|
|
3270
3513
|
*
|
|
3271
|
-
* @param type - Specifies the
|
|
3272
|
-
* @param fileName - Specifies file name for exporting the rendered
|
|
3273
|
-
* @param orientation - Specifies the orientation of the
|
|
3514
|
+
* @param {ExportType} type - Specifies the extension type of the exported document.
|
|
3515
|
+
* @param {string} fileName - Specifies file name for exporting the rendered TreeMap.
|
|
3516
|
+
* @param {PdfPageOrientation} orientation - Specifies the orientation of the PDF document.
|
|
3517
|
+
* @param {boolean} allowDownload - Specifies whether the exported file should be downloaded or not.
|
|
3518
|
+
* @returns {string} - Specifies the base64 string of the exported image which is returned when the allowDownload is set to false.
|
|
3274
3519
|
*/
|
|
3275
3520
|
TreeMap.prototype.export = function (type, fileName, orientation, allowDownload) {
|
|
3276
3521
|
var _this = this;
|
|
@@ -3278,13 +3523,13 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3278
3523
|
allowDownload = true;
|
|
3279
3524
|
}
|
|
3280
3525
|
if (type === 'PDF' && this.allowPdfExport && this.pdfExportModule) {
|
|
3281
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3526
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
|
|
3282
3527
|
return new Promise(function (resolve, reject) {
|
|
3283
3528
|
resolve(_this.pdfExportModule.export(_this, type, fileName, orientation, allowDownload));
|
|
3284
3529
|
});
|
|
3285
3530
|
}
|
|
3286
3531
|
else if (this.allowImageExport && (type !== 'PDF') && this.imageExportModule) {
|
|
3287
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3532
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
|
|
3288
3533
|
return new Promise(function (resolve, reject) {
|
|
3289
3534
|
resolve(_this.imageExportModule.export(_this, type, fileName, allowDownload));
|
|
3290
3535
|
});
|
|
@@ -3311,8 +3556,8 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3311
3556
|
var name_1 = this.dataSource[j][groupPath];
|
|
3312
3557
|
if (i !== 0) {
|
|
3313
3558
|
for (var k = 0; k <= i; k++) {
|
|
3314
|
-
var
|
|
3315
|
-
childName += (this.dataSource[j][
|
|
3559
|
+
var childGroupPath = this.levels[k] ? this.levels[k].groupPath : groupPath;
|
|
3560
|
+
childName += (this.dataSource[j][childGroupPath]) + ((k === i) ? '' : '#');
|
|
3316
3561
|
}
|
|
3317
3562
|
}
|
|
3318
3563
|
if (!(orderNames.length > 0 ? orderNames.indexOf(childName ?
|
|
@@ -3324,7 +3569,7 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3324
3569
|
currentData['groupName'] = groupPath;
|
|
3325
3570
|
currentData['data'] = this.dataSource[j];
|
|
3326
3571
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3327
|
-
LevelsData.levelsData[LevelsData.levelsData.length - 1][groupPath].push(currentData);
|
|
3572
|
+
LevelsData.levelsData[(LevelsData.levelsData.length - 1)][groupPath].push(currentData);
|
|
3328
3573
|
orderNames.push((childName) ? childName : name_1);
|
|
3329
3574
|
}
|
|
3330
3575
|
}
|
|
@@ -3334,7 +3579,8 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3334
3579
|
/**
|
|
3335
3580
|
* This method orders the treemap level data.
|
|
3336
3581
|
*
|
|
3337
|
-
* @param start - Specifies the start value of the treemap level.
|
|
3582
|
+
* @param {number} start - Specifies the start value of the treemap level.
|
|
3583
|
+
* @returns {void}
|
|
3338
3584
|
*/
|
|
3339
3585
|
TreeMap.prototype.reOrderLevelData = function (start) {
|
|
3340
3586
|
var currentName;
|
|
@@ -3347,7 +3593,8 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3347
3593
|
for (var i = 0; i < currentData.length; i++) {
|
|
3348
3594
|
currentName = currentData[i]['levelOrderName'];
|
|
3349
3595
|
for (var j = 0; j < previousData.length; j++) {
|
|
3350
|
-
previousData[j][currentPath] = isNullOrUndefined(previousData[j][currentPath]) ?
|
|
3596
|
+
previousData[j][currentPath] = isNullOrUndefined(previousData[j][currentPath]) ?
|
|
3597
|
+
[] : previousData[j][currentPath];
|
|
3351
3598
|
if (this.IsChildHierarchy(currentName.split('#'), previousData[j]['levelOrderName'].split('#'))) {
|
|
3352
3599
|
if (isNullOrUndefined(currentData[i]['parent'])) {
|
|
3353
3600
|
currentData[i]['parent'] = previousData[j];
|
|
@@ -3379,13 +3626,13 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3379
3626
|
/**
|
|
3380
3627
|
* This method finds the weight value of the treemap level.
|
|
3381
3628
|
*
|
|
3382
|
-
* @param processData - Specifies the treemap data.
|
|
3383
|
-
* @param type - Specifies the type of the data.
|
|
3629
|
+
* @param {any[]} processData - Specifies the treemap data.
|
|
3630
|
+
* @param {string} type - Specifies the type of the data.
|
|
3631
|
+
* @returns {void}
|
|
3384
3632
|
*/
|
|
3385
3633
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3386
3634
|
TreeMap.prototype.findTotalWeight = function (processData, type) {
|
|
3387
3635
|
var _this = this;
|
|
3388
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3389
3636
|
var totalWeight;
|
|
3390
3637
|
var split;
|
|
3391
3638
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -3463,8 +3710,10 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3463
3710
|
/**
|
|
3464
3711
|
* This method handles the window resize event on treemap.
|
|
3465
3712
|
*
|
|
3466
|
-
* @param e - Specifies the pointer event.
|
|
3713
|
+
* @param {Event} e - Specifies the pointer event.
|
|
3714
|
+
* @returns {void}
|
|
3467
3715
|
*/
|
|
3716
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3468
3717
|
TreeMap.prototype.resizeOnTreeMap = function (e) {
|
|
3469
3718
|
var _this = this;
|
|
3470
3719
|
if (!this.isDestroyed) {
|
|
@@ -3486,6 +3735,7 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3486
3735
|
_this.refreshing = true;
|
|
3487
3736
|
_this.wireEVents();
|
|
3488
3737
|
args_1.currentSize = _this.availableSize;
|
|
3738
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3489
3739
|
_this.trigger(resize, args_1, function (observedArgs) {
|
|
3490
3740
|
_this.render();
|
|
3491
3741
|
});
|
|
@@ -3496,7 +3746,8 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3496
3746
|
/**
|
|
3497
3747
|
* This method handles the click event on the treemap.
|
|
3498
3748
|
*
|
|
3499
|
-
* @param e - Specifies the mouse click event in the treemap.
|
|
3749
|
+
* @param {PointerEvent} e - Specifies the mouse click event in the treemap.
|
|
3750
|
+
* @returns {void}
|
|
3500
3751
|
*/
|
|
3501
3752
|
TreeMap.prototype.clickOnTreeMap = function (e) {
|
|
3502
3753
|
var _this = this;
|
|
@@ -3539,7 +3790,8 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3539
3790
|
/**
|
|
3540
3791
|
* This method handles the double click event in the treemap.
|
|
3541
3792
|
*
|
|
3542
|
-
* @param e - Specifies the pointer event of mouse click.
|
|
3793
|
+
* @param {PointerEvent} e - Specifies the pointer event of mouse click.
|
|
3794
|
+
* @returns {void}
|
|
3543
3795
|
*/
|
|
3544
3796
|
TreeMap.prototype.doubleClickOnTreeMap = function (e) {
|
|
3545
3797
|
var doubleClickArgs = { cancel: false, name: doubleClick, treemap: this, mouseEvent: e };
|
|
@@ -3549,7 +3801,8 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3549
3801
|
/**
|
|
3550
3802
|
* This method handles the right click event in the treemap.
|
|
3551
3803
|
*
|
|
3552
|
-
* @param e - Specifies the pointer event of mouse click.
|
|
3804
|
+
* @param {PointerEvent} e - Specifies the pointer event of mouse click.
|
|
3805
|
+
* @returns {void}
|
|
3553
3806
|
*/
|
|
3554
3807
|
TreeMap.prototype.rightClickOnTreeMap = function (e) {
|
|
3555
3808
|
var rightClickArgs = { cancel: false, name: rightClick, treemap: this, mouseEvent: e };
|
|
@@ -3558,7 +3811,8 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3558
3811
|
/**
|
|
3559
3812
|
* This method handles the mouse down event in the treemap.
|
|
3560
3813
|
*
|
|
3561
|
-
* @param e - Specifies the pointer event of mouse click.
|
|
3814
|
+
* @param {PointerEvent} e - Specifies the pointer event of mouse click.
|
|
3815
|
+
* @returns {void}
|
|
3562
3816
|
*/
|
|
3563
3817
|
TreeMap.prototype.mouseDownOnTreeMap = function (e) {
|
|
3564
3818
|
if (e.target.id.indexOf('_Item_Index') > -1) {
|
|
@@ -3569,7 +3823,8 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3569
3823
|
/**
|
|
3570
3824
|
* This method handles the mouse move event in the treemap.
|
|
3571
3825
|
*
|
|
3572
|
-
* @param e - Specifies the pointer event of mouse click.
|
|
3826
|
+
* @param {PointerEvent} e - Specifies the pointer event of mouse click.
|
|
3827
|
+
* @returns {void}
|
|
3573
3828
|
*/
|
|
3574
3829
|
TreeMap.prototype.mouseMoveOnTreeMap = function (e) {
|
|
3575
3830
|
var targetEle = e.target;
|
|
@@ -3595,10 +3850,11 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3595
3850
|
/**
|
|
3596
3851
|
* This method calculates the selected treemap levels.
|
|
3597
3852
|
*
|
|
3598
|
-
* @param labelText - Specifies the label text.
|
|
3599
|
-
* @param item - Specifies the treemap item.
|
|
3853
|
+
* @param {string} labelText - Specifies the label text.
|
|
3854
|
+
* @param {any} item - Specifies the treemap item.
|
|
3855
|
+
* @returns {any} - Returns label of the drilled level.
|
|
3600
3856
|
*/
|
|
3601
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3857
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
3602
3858
|
TreeMap.prototype.calculateSelectedTextLevels = function (labelText, item) {
|
|
3603
3859
|
//to find the levels by clicking the particular text both for drillDownView as true / false.
|
|
3604
3860
|
var drillLevel;
|
|
@@ -3618,13 +3874,14 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3618
3874
|
/**
|
|
3619
3875
|
* This method calculates the previous level of child items in treemap.
|
|
3620
3876
|
*
|
|
3621
|
-
* @param
|
|
3622
|
-
* @param
|
|
3623
|
-
* @param
|
|
3624
|
-
* @
|
|
3877
|
+
* @param {any} drillLevelValues - Specifies the values of drill level.
|
|
3878
|
+
* @param {any} item - Specifies the treemap item.
|
|
3879
|
+
* @param {boolean} directLevel - Specifies the current level.
|
|
3880
|
+
* @returns {boolean} - check whether it is previous level or not.
|
|
3881
|
+
* @private
|
|
3625
3882
|
*/
|
|
3626
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3627
|
-
TreeMap.prototype.calculatePreviousLevelChildItems = function (
|
|
3883
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
3884
|
+
TreeMap.prototype.calculatePreviousLevelChildItems = function (drillLevelValues, item, directLevel) {
|
|
3628
3885
|
//By clicking any child items drilldown to the particular level.
|
|
3629
3886
|
//At the time store all the previous drilled level items in drilledItems
|
|
3630
3887
|
// This condition satisfies while drilldown View is set as false and the text contains '[+]'
|
|
@@ -3659,11 +3916,12 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3659
3916
|
/**
|
|
3660
3917
|
* This method compares the selected labels with the drill down items.
|
|
3661
3918
|
*
|
|
3662
|
-
* @param drillLevelValues - Specifies the values of drill level.
|
|
3663
|
-
* @param item - Specifies the treemap item.
|
|
3664
|
-
* @param i - Specifies the treemap item.
|
|
3919
|
+
* @param {any} drillLevelValues - Specifies the values of drill level.
|
|
3920
|
+
* @param {any} item - Specifies the treemap item.
|
|
3921
|
+
* @param {number} i - Specifies the treemap item.
|
|
3922
|
+
* @returns {any} - return the new drill down object.
|
|
3665
3923
|
*/
|
|
3666
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3924
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
3667
3925
|
TreeMap.prototype.compareSelectedLabelWithDrillDownItems = function (drillLevelValues, item, i) {
|
|
3668
3926
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3669
3927
|
var drillLevelChild;
|
|
@@ -3686,7 +3944,8 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3686
3944
|
/**
|
|
3687
3945
|
* This method handles mouse end event in treemap.
|
|
3688
3946
|
*
|
|
3689
|
-
* @param e - Specifies the pointer event of mouse.
|
|
3947
|
+
* @param {PointerEvent} e - Specifies the pointer event of mouse.
|
|
3948
|
+
* @returns {void}
|
|
3690
3949
|
*/
|
|
3691
3950
|
TreeMap.prototype.mouseEndOnTreeMap = function (e) {
|
|
3692
3951
|
var _this = this;
|
|
@@ -3717,7 +3976,7 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3717
3976
|
drillLevelValues = this.calculateSelectedTextLevels(labelText, item);
|
|
3718
3977
|
drillLevel = drillLevelValues['drillLevel'];
|
|
3719
3978
|
if (!this.drillDownView && labelText.search('[+]') !== -1) {
|
|
3720
|
-
directLevel = this.calculatePreviousLevelChildItems(
|
|
3979
|
+
directLevel = this.calculatePreviousLevelChildItems(drillLevelValues, item, directLevel);
|
|
3721
3980
|
}
|
|
3722
3981
|
}
|
|
3723
3982
|
if (this.levels.length !== 0 && !item['isLeafItem'] && findChildren(item)['values'] &&
|
|
@@ -3809,7 +4068,7 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3809
4068
|
}
|
|
3810
4069
|
else {
|
|
3811
4070
|
_this.layout.calculateLayoutItems(newDrillItem, totalRect);
|
|
3812
|
-
_this.layout.renderLayoutItems(
|
|
4071
|
+
_this.layout.renderLayoutItems();
|
|
3813
4072
|
}
|
|
3814
4073
|
}
|
|
3815
4074
|
});
|
|
@@ -3828,8 +4087,10 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3828
4087
|
/**
|
|
3829
4088
|
* This method handles mouse leave event in treemap.
|
|
3830
4089
|
*
|
|
3831
|
-
* @param e - Specifies the pointer event of mouse.
|
|
4090
|
+
* @param {PointerEvent} e - Specifies the pointer event of mouse.
|
|
4091
|
+
* @return {void}
|
|
3832
4092
|
*/
|
|
4093
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3833
4094
|
TreeMap.prototype.mouseLeaveOnTreeMap = function (e) {
|
|
3834
4095
|
if (this.treeMapTooltipModule) {
|
|
3835
4096
|
this.treeMapTooltipModule.removeTooltip();
|
|
@@ -3839,12 +4100,16 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3839
4100
|
}
|
|
3840
4101
|
removeClassNames(document.getElementsByClassName('treeMapHighLight'), 'treeMapHighLight', this);
|
|
3841
4102
|
if (this.treeMapHighlightModule) {
|
|
3842
|
-
removeShape(this.treeMapHighlightModule.shapeHighlightCollection
|
|
4103
|
+
removeShape(this.treeMapHighlightModule.shapeHighlightCollection);
|
|
3843
4104
|
this.treeMapHighlightModule.highLightId = '';
|
|
3844
4105
|
}
|
|
3845
4106
|
};
|
|
3846
4107
|
/**
|
|
3847
4108
|
* This method is used to select or remove the selection of treemap item based on the provided selection settings.
|
|
4109
|
+
*
|
|
4110
|
+
* @param {string[]} levelOrder - Specifies the order of the level.
|
|
4111
|
+
* @param {boolean} isSelected - check whether it is selected or not.
|
|
4112
|
+
* @return {void}
|
|
3848
4113
|
*/
|
|
3849
4114
|
TreeMap.prototype.selectItem = function (levelOrder, isSelected) {
|
|
3850
4115
|
if (isNullOrUndefined(isSelected)) {
|
|
@@ -3923,6 +4188,7 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3923
4188
|
* @returns {void}
|
|
3924
4189
|
* @private
|
|
3925
4190
|
*/
|
|
4191
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3926
4192
|
TreeMap.prototype.onPropertyChanged = function (newProp, oldProp) {
|
|
3927
4193
|
if (!this.isDestroyed) {
|
|
3928
4194
|
var render = false;
|
|
@@ -3953,6 +4219,8 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
|
|
|
3953
4219
|
};
|
|
3954
4220
|
/**
|
|
3955
4221
|
* Gets component name.
|
|
4222
|
+
*
|
|
4223
|
+
* @returns {string} - return the treemap instance.
|
|
3956
4224
|
*/
|
|
3957
4225
|
TreeMap.prototype.getModuleName = function () {
|
|
3958
4226
|
return 'treemap';
|
|
@@ -4159,14 +4427,10 @@ var LevelsData = /** @__PURE__ @class */ (function () {
|
|
|
4159
4427
|
return LevelsData;
|
|
4160
4428
|
}());
|
|
4161
4429
|
|
|
4162
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
4163
|
-
/* eslint-disable @typescript-eslint/dot-notation */
|
|
4164
|
-
/* eslint-disable max-len */
|
|
4165
4430
|
/**
|
|
4166
4431
|
* Legend module class
|
|
4167
4432
|
*/
|
|
4168
4433
|
var TreeMapLegend = /** @__PURE__ @class */ (function () {
|
|
4169
|
-
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility
|
|
4170
4434
|
function TreeMapLegend(treemap) {
|
|
4171
4435
|
this.page = 0;
|
|
4172
4436
|
this.legendBorderRect = new Rect(0, 0, 0, 0);
|
|
@@ -4194,15 +4458,12 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
|
|
|
4194
4458
|
this.heightIncrement = 0;
|
|
4195
4459
|
this.defsElement = this.treemap.renderer.createDefs();
|
|
4196
4460
|
this.treemap.svgObject.appendChild(this.defsElement);
|
|
4197
|
-
var eventArgs
|
|
4198
|
-
eventArgs = {
|
|
4461
|
+
var eventArgs = {
|
|
4199
4462
|
cancel: false, name: legendRendering, treemap: this.treemap, _changePosition: this.treemap.legendSettings.position,
|
|
4200
4463
|
position: this.treemap.legendSettings.position
|
|
4201
4464
|
};
|
|
4202
4465
|
this.treemap.trigger(legendRendering, eventArgs, function (observedArgs) {
|
|
4203
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
4204
4466
|
if (!observedArgs.cancel && observedArgs._changePosition !== _this.treemap.legendSettings.position) {
|
|
4205
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
4206
4467
|
_this.treemap.legendSettings.position = observedArgs._changePosition;
|
|
4207
4468
|
}
|
|
4208
4469
|
_this.calculateLegendBounds();
|
|
@@ -4218,12 +4479,18 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
|
|
|
4218
4479
|
this.findColorMappingLegendItems(LevelsData.levelsData[0]);
|
|
4219
4480
|
if ((this.treemap.palette.length > 0 || !isNullOrUndefined(this.treemap.colorValuePath))
|
|
4220
4481
|
&& this.legendCollections.length === 0) {
|
|
4221
|
-
this.findPaletteLegendItems(LevelsData.levelsData[0]
|
|
4482
|
+
this.findPaletteLegendItems(LevelsData.levelsData[0]);
|
|
4222
4483
|
}
|
|
4223
4484
|
if (this.legendCollections.length > 0) {
|
|
4224
|
-
|
|
4225
|
-
this.legendCollections.sort(function (firstItem, nextItem) { return (firstItem.
|
|
4226
|
-
|
|
4485
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
4486
|
+
this.legendCollections.sort(function (firstItem, nextItem) { return (firstItem.levelIndex > nextItem.levelIndex) ? 1 :
|
|
4487
|
+
(firstItem.levelIndex < nextItem.levelIndex) ? -1 : 0; });
|
|
4488
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
4489
|
+
this.legendCollections.sort(function (firstItem, nextItem) { return (firstItem.groupIndex > nextItem.groupIndex) ? 1 :
|
|
4490
|
+
(firstItem.groupIndex < nextItem.groupIndex) ? -1 : 0; });
|
|
4491
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
4492
|
+
this.legendCollections.sort(function (firstItem, nextItem) { return (firstItem.leafIndex > nextItem.leafIndex) ? 1 :
|
|
4493
|
+
(firstItem.leafIndex < nextItem.leafIndex) ? -1 : 0; });
|
|
4227
4494
|
var defaultSize = 25;
|
|
4228
4495
|
var textPadding = 10;
|
|
4229
4496
|
var position = legend.position;
|
|
@@ -4255,7 +4522,6 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
|
|
|
4255
4522
|
var startY_1 = 0;
|
|
4256
4523
|
var shapePadding = legend.shapePadding;
|
|
4257
4524
|
var itemTextStyle = legend.textStyle;
|
|
4258
|
-
var legendLength = this.legendCollections.length;
|
|
4259
4525
|
itemTextStyle.size = itemTextStyle.size || treemap.themeStyle.legendFontSize;
|
|
4260
4526
|
itemTextStyle.fontFamily = itemTextStyle.fontFamily || treemap.themeStyle.fontFamily;
|
|
4261
4527
|
if (legendMode === 'Default') {
|
|
@@ -4365,11 +4631,11 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
|
|
|
4365
4631
|
};
|
|
4366
4632
|
}
|
|
4367
4633
|
else {
|
|
4368
|
-
var
|
|
4369
|
-
var
|
|
4370
|
-
(legendWidth /
|
|
4371
|
-
var
|
|
4372
|
-
(isNullOrUndefined(legendHeight)) ? (treemap.areaRect.height /
|
|
4634
|
+
var legendLength = this.legendCollections.length;
|
|
4635
|
+
var rectWidth = (orientation_1 === 'Horizontal') ? (isNullOrUndefined(legendWidth)) ? (treemap.areaRect.width / legendLength) :
|
|
4636
|
+
(legendWidth / legendLength) : (isNullOrUndefined(legendWidth)) ? defaultSize : legendWidth;
|
|
4637
|
+
var rectHeight = (orientation_1 === 'Horizontal') ? (isNullOrUndefined(legendHeight)) ? defaultSize : legendHeight :
|
|
4638
|
+
(isNullOrUndefined(legendHeight)) ? (treemap.areaRect.height / legendLength) : (legendHeight / legendLength);
|
|
4373
4639
|
startX_1 = 0;
|
|
4374
4640
|
startY_1 = legendTitleSize.height + spacing;
|
|
4375
4641
|
var textPadding_1 = 10;
|
|
@@ -4380,15 +4646,15 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
|
|
|
4380
4646
|
var maxTextHeight = 0;
|
|
4381
4647
|
var maxTextWidth = 0;
|
|
4382
4648
|
for (var i = 0; i < this.legendCollections.length; i++) {
|
|
4383
|
-
startX_1 = (orientation_1 === 'Horizontal') ? (startX_1 +
|
|
4384
|
-
startY_1 = (orientation_1 === 'Horizontal') ? startY_1 : (startY_1 +
|
|
4649
|
+
startX_1 = (orientation_1 === 'Horizontal') ? (startX_1 + rectWidth) : startX_1;
|
|
4650
|
+
startY_1 = (orientation_1 === 'Horizontal') ? startY_1 : (startY_1 + rectHeight);
|
|
4385
4651
|
var legendText = this.legendCollections[i]['legendName'];
|
|
4386
4652
|
var itemTextSize = new Size(0, 0);
|
|
4387
4653
|
if (labelAction === 'None') {
|
|
4388
4654
|
itemTextSize = measureText(legendText, itemTextStyle);
|
|
4389
4655
|
}
|
|
4390
4656
|
else if (labelAction === 'Trim') {
|
|
4391
|
-
legendText = textTrim((orientation_1 === 'Horizontal' ?
|
|
4657
|
+
legendText = textTrim((orientation_1 === 'Horizontal' ? rectWidth : rectHeight), legendText, itemTextStyle);
|
|
4392
4658
|
itemTextSize = measureText(legendText, itemTextStyle);
|
|
4393
4659
|
}
|
|
4394
4660
|
else {
|
|
@@ -4398,14 +4664,14 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
|
|
|
4398
4664
|
maxTextWidth = Math.max(maxTextWidth, itemTextSize.width);
|
|
4399
4665
|
if (itemTextSize.width > 0 && itemTextSize.height > 0) {
|
|
4400
4666
|
if (orientation_1 === 'Horizontal') {
|
|
4401
|
-
textX = startX_1 + (
|
|
4402
|
-
textY = (placement === 'After') ? (startY_1 +
|
|
4667
|
+
textX = startX_1 + (rectWidth / 2);
|
|
4668
|
+
textY = (placement === 'After') ? (startY_1 + rectHeight + (itemTextSize.height / 2)) + textPadding_1 :
|
|
4403
4669
|
(startY_1 - textPadding_1);
|
|
4404
4670
|
}
|
|
4405
4671
|
else {
|
|
4406
4672
|
textX = (placement === 'After') ? startX_1 - (itemTextSize.width / 2) - textPadding_1
|
|
4407
|
-
: (startX_1 +
|
|
4408
|
-
textY = startY_1 + (
|
|
4673
|
+
: (startX_1 + rectWidth + itemTextSize.width / 2) + textPadding_1;
|
|
4674
|
+
textY = startY_1 + (rectHeight / 2) + (itemTextSize.height / 4);
|
|
4409
4675
|
}
|
|
4410
4676
|
}
|
|
4411
4677
|
if (i === 0) {
|
|
@@ -4414,15 +4680,15 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
|
|
|
4414
4680
|
itemStartY = (orientation_1 === 'Horizontal') ? (placement === 'After') ? startY_1 :
|
|
4415
4681
|
textY - (itemTextSize.height / 2) : startY_1;
|
|
4416
4682
|
}
|
|
4417
|
-
if (i ===
|
|
4418
|
-
legendWidth = (orientation_1 === 'Horizontal') ? Math.abs((startX_1 +
|
|
4419
|
-
(
|
|
4420
|
-
legendHeight = (orientation_1 === 'Horizontal') ? (
|
|
4421
|
-
Math.abs((startY_1 +
|
|
4683
|
+
if (i === legendLength - 1) {
|
|
4684
|
+
legendWidth = (orientation_1 === 'Horizontal') ? Math.abs((startX_1 + rectWidth) - itemStartX) :
|
|
4685
|
+
(rectWidth + maxTextWidth + textPadding_1);
|
|
4686
|
+
legendHeight = (orientation_1 === 'Horizontal') ? (rectHeight + (maxTextHeight / 2) + textPadding_1) :
|
|
4687
|
+
Math.abs((startY_1 + rectHeight) - itemStartY);
|
|
4422
4688
|
}
|
|
4423
4689
|
this.legendRenderingCollections.push({
|
|
4424
4690
|
fill: this.legendCollections[i]['legendFill'], x: startX_1, y: startY_1,
|
|
4425
|
-
width:
|
|
4691
|
+
width: rectWidth, height: rectHeight, element: this.legendCollections[i]['gradientElement'],
|
|
4426
4692
|
text: legendText, textX: textX, textY: textY,
|
|
4427
4693
|
textWidth: itemTextSize.width, textHeight: itemTextSize.height,
|
|
4428
4694
|
data: this.legendCollections[i]['legendData']
|
|
@@ -4452,7 +4718,7 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
|
|
|
4452
4718
|
}
|
|
4453
4719
|
};
|
|
4454
4720
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4455
|
-
TreeMapLegend.prototype.findPaletteLegendItems = function (data
|
|
4721
|
+
TreeMapLegend.prototype.findPaletteLegendItems = function (data) {
|
|
4456
4722
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4457
4723
|
var child;
|
|
4458
4724
|
var legendFillColor;
|
|
@@ -4904,9 +5170,11 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
|
|
|
4904
5170
|
renderTextElement(textOptions, textStyle, textStyle.color || this.treemap.themeStyle.legendTitleColor, this.legendGroup);
|
|
4905
5171
|
}
|
|
4906
5172
|
};
|
|
4907
|
-
// eslint-disable-next-line valid-jsdoc
|
|
4908
5173
|
/**
|
|
4909
5174
|
* To rendered the interactive pointer
|
|
5175
|
+
*
|
|
5176
|
+
* @param {PointerEvent | TouchEvent} e - Specifies the pointer argument.
|
|
5177
|
+
* @returns {void}
|
|
4910
5178
|
*/
|
|
4911
5179
|
TreeMapLegend.prototype.renderInteractivePointer = function (e) {
|
|
4912
5180
|
var treemap = this.treemap;
|
|
@@ -4933,7 +5201,7 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
|
|
|
4933
5201
|
currentData = this.legendCollections[i];
|
|
4934
5202
|
legendElement = document.getElementById(treemap.element.id + '_Legend_Index_' + i);
|
|
4935
5203
|
legendRect = legendElement.getBoundingClientRect();
|
|
4936
|
-
var
|
|
5204
|
+
var rect = new Rect(Math.abs(legendRect.left - svgRect.left), Math.abs(legendRect.top - svgRect.top), legendRect.width, legendRect.height);
|
|
4937
5205
|
fill = legendElement.getAttribute('fill');
|
|
4938
5206
|
stroke = legend.shapeBorder.color;
|
|
4939
5207
|
strokeWidth = legend.shapeBorder.width;
|
|
@@ -4942,7 +5210,7 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
|
|
|
4942
5210
|
data = currentData['legendData'];
|
|
4943
5211
|
for (var j = 0; j < data.length; j++) {
|
|
4944
5212
|
if (data[j]['levelOrderName'] === targetItem['levelOrderName']) {
|
|
4945
|
-
this.drawInteractivePointer(legend, fill, stroke, interactiveId, strokeWidth,
|
|
5213
|
+
this.drawInteractivePointer(legend, fill, stroke, interactiveId, strokeWidth, rect);
|
|
4946
5214
|
break;
|
|
4947
5215
|
}
|
|
4948
5216
|
}
|
|
@@ -5063,18 +5331,22 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
|
|
|
5063
5331
|
legendElementId.parentNode.removeChild(legendElementId);
|
|
5064
5332
|
}
|
|
5065
5333
|
};
|
|
5066
|
-
// eslint-disable-next-line valid-jsdoc
|
|
5067
5334
|
/**
|
|
5068
5335
|
* To change the next page
|
|
5336
|
+
*
|
|
5337
|
+
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
5338
|
+
* @returns {void}
|
|
5069
5339
|
*/
|
|
5070
5340
|
TreeMapLegend.prototype.changeNextPage = function (e) {
|
|
5071
5341
|
this.currentPage = (e.target.id.indexOf('_Left_Page_') > -1) ? (this.currentPage - 1) :
|
|
5072
5342
|
(this.currentPage + 1);
|
|
5073
5343
|
this.drawLegend();
|
|
5074
5344
|
};
|
|
5075
|
-
// eslint-disable-next-line valid-jsdoc
|
|
5076
5345
|
/**
|
|
5077
5346
|
* Wire events for event handler
|
|
5347
|
+
*
|
|
5348
|
+
* @param {Element} element - Specifies the element.
|
|
5349
|
+
* @returns {void}
|
|
5078
5350
|
*/
|
|
5079
5351
|
TreeMapLegend.prototype.wireEvents = function (element) {
|
|
5080
5352
|
EventHandler.add(element, Browser.touchStartEvent, this.changeNextPage, this);
|
|
@@ -5101,9 +5373,10 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
|
|
|
5101
5373
|
this.treemap.off(Browser.touchMoveEvent, this.renderInteractivePointer);
|
|
5102
5374
|
this.treemap.off(Browser.touchEndEvent, this.mouseUpHandler);
|
|
5103
5375
|
};
|
|
5104
|
-
// eslint-disable-next-line valid-jsdoc
|
|
5105
5376
|
/**
|
|
5106
5377
|
* Get module name.
|
|
5378
|
+
*
|
|
5379
|
+
* @returns {string} Returns the legend module name.
|
|
5107
5380
|
*/
|
|
5108
5381
|
TreeMapLegend.prototype.getModuleName = function () {
|
|
5109
5382
|
return 'treeMapLegend';
|
|
@@ -5131,9 +5404,12 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
|
|
|
5131
5404
|
//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.
|
|
5132
5405
|
//this.treemap = null;
|
|
5133
5406
|
};
|
|
5134
|
-
// eslint-disable-next-line valid-jsdoc
|
|
5135
5407
|
/**
|
|
5136
5408
|
* Get the gradient color for interactive legend.
|
|
5409
|
+
*
|
|
5410
|
+
* @param {ColorMappingModel} colorMap - Specifies the color mapping instance.
|
|
5411
|
+
* @param {number} legendIndex - Specifies the index of legend.
|
|
5412
|
+
* @returns {string} - Returns the legend color.
|
|
5137
5413
|
*/
|
|
5138
5414
|
TreeMapLegend.prototype.legendGradientColor = function (colorMap$$1, legendIndex) {
|
|
5139
5415
|
var legendFillColor;
|
|
@@ -5173,7 +5449,6 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
|
|
|
5173
5449
|
* Performing treemap highlight
|
|
5174
5450
|
*/
|
|
5175
5451
|
var TreeMapHighlight = /** @__PURE__ @class */ (function () {
|
|
5176
|
-
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility
|
|
5177
5452
|
function TreeMapHighlight(treeMap) {
|
|
5178
5453
|
this.target = 'highlight';
|
|
5179
5454
|
this.shapeTarget = 'highlight';
|
|
@@ -5186,10 +5461,11 @@ var TreeMapHighlight = /** @__PURE__ @class */ (function () {
|
|
|
5186
5461
|
this.treemap = treeMap;
|
|
5187
5462
|
this.addEventListener();
|
|
5188
5463
|
}
|
|
5189
|
-
/* eslint-disable max-len */
|
|
5190
|
-
// eslint-disable-next-line valid-jsdoc
|
|
5191
5464
|
/**
|
|
5192
5465
|
* Mouse down event in highlight
|
|
5466
|
+
*
|
|
5467
|
+
* @param {PointerEvent} e - Specifies the pointer argument.
|
|
5468
|
+
* @returns {boolean} - return the highlight process is true or false.
|
|
5193
5469
|
*/
|
|
5194
5470
|
TreeMapHighlight.prototype.mouseMove = function (e) {
|
|
5195
5471
|
var treemap = this.treemap;
|
|
@@ -5222,7 +5498,7 @@ var TreeMapHighlight = /** @__PURE__ @class */ (function () {
|
|
|
5222
5498
|
if (this.shapeElement !== null && (selectionModule ? this.shapeElement.getAttribute('id') !== selectionModule.legendSelectId : true)) {
|
|
5223
5499
|
if (selectionModule ? this.shapeElement !== selectionModule.shapeElement : true) {
|
|
5224
5500
|
this.currentElement.push({ currentElement: this.shapeElement });
|
|
5225
|
-
removeShape(this.shapeHighlightCollection
|
|
5501
|
+
removeShape(this.shapeHighlightCollection);
|
|
5226
5502
|
this.shapeHighlightCollection.push({ legendEle: this.shapeElement, oldFill: collection[index]['legendFill'],
|
|
5227
5503
|
oldOpacity: collection[index]['opacity'], oldBorderColor: collection[index]['borderColor'],
|
|
5228
5504
|
oldBorderWidth: collection[index]['borderWidth']
|
|
@@ -5242,7 +5518,8 @@ var TreeMapHighlight = /** @__PURE__ @class */ (function () {
|
|
|
5242
5518
|
}
|
|
5243
5519
|
orders = findHightLightItems(item, [], highlight.mode, treemap);
|
|
5244
5520
|
if (this.treemap.legendSettings.visible ? selectionModule ? this.shapeElement ? this.shapeElement.getAttribute('id') !== selectionModule.legendSelectId : true : true : true) {
|
|
5245
|
-
if (this.treemap.legendSettings.visible ? selectionModule ?
|
|
5521
|
+
if (this.treemap.legendSettings.visible ? selectionModule ?
|
|
5522
|
+
this.shapeElement !== selectionModule.shapeElement : true : true) {
|
|
5246
5523
|
for (var i = 0; i < treeMapElement.childElementCount; i++) {
|
|
5247
5524
|
element = treeMapElement.childNodes[i];
|
|
5248
5525
|
process = true;
|
|
@@ -5275,13 +5552,14 @@ var TreeMapHighlight = /** @__PURE__ @class */ (function () {
|
|
|
5275
5552
|
}
|
|
5276
5553
|
}
|
|
5277
5554
|
else if (targetId.indexOf('_Legend_Shape') > -1 || targetId.indexOf('_Legend_Index') > -1) {
|
|
5278
|
-
if (this.treemap.legendSettings.visible && (selectionModule ? selectionModule.legendSelectId !== targetId : true)
|
|
5555
|
+
if (this.treemap.legendSettings.visible && (selectionModule ? selectionModule.legendSelectId !== targetId : true)
|
|
5556
|
+
&& (selectionModule ? selectionModule.shapeSelectId !== targetId : true)) {
|
|
5279
5557
|
var itemIndex = void 0;
|
|
5280
5558
|
var groupIndex = void 0;
|
|
5281
5559
|
var length_2;
|
|
5282
5560
|
var targetEle = document.getElementById(targetId);
|
|
5283
5561
|
if (this.shapeTarget === 'highlight') {
|
|
5284
|
-
removeLegend(this.legendHighlightCollection
|
|
5562
|
+
removeLegend(this.legendHighlightCollection);
|
|
5285
5563
|
}
|
|
5286
5564
|
this.shapeTarget = 'highlight';
|
|
5287
5565
|
var index = this.treemap.legendSettings.mode === 'Default' ? parseFloat(targetId.split('_Legend_Shape_Index_')[1]) : parseFloat(targetId.split('_Legend_Index_')[1]);
|
|
@@ -5318,14 +5596,15 @@ var TreeMapHighlight = /** @__PURE__ @class */ (function () {
|
|
|
5318
5596
|
}
|
|
5319
5597
|
if ((this.shapeTarget === 'highlight' || this.target === 'highlight') && this.treemap.legendSettings.visible) {
|
|
5320
5598
|
if (selectionModule ? this.shapeElement ? this.shapeElement.getAttribute('id') !== selectionModule.legendSelectId : true : true) {
|
|
5321
|
-
if (selectionModule ? this.shapeElement !== selectionModule.shapeElement : true && selectionModule ?
|
|
5322
|
-
|
|
5599
|
+
if (selectionModule ? this.shapeElement !== selectionModule.shapeElement : true && selectionModule ?
|
|
5600
|
+
selectionModule.legendSelect : true) {
|
|
5601
|
+
removeShape(this.shapeHighlightCollection);
|
|
5323
5602
|
this.shapeHighlightCollection = [];
|
|
5324
5603
|
}
|
|
5325
5604
|
}
|
|
5326
5605
|
}
|
|
5327
5606
|
if (this.shapeTarget === 'highlight' && this.treemap.legendSettings.visible) {
|
|
5328
|
-
removeLegend(this.legendHighlightCollection
|
|
5607
|
+
removeLegend(this.legendHighlightCollection);
|
|
5329
5608
|
}
|
|
5330
5609
|
this.highLightId = '';
|
|
5331
5610
|
processHighlight = false;
|
|
@@ -5382,7 +5661,6 @@ var TreeMapHighlight = /** @__PURE__ @class */ (function () {
|
|
|
5382
5661
|
* Performing treemap selection
|
|
5383
5662
|
*/
|
|
5384
5663
|
var TreeMapSelection = /** @__PURE__ @class */ (function () {
|
|
5385
|
-
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility
|
|
5386
5664
|
function TreeMapSelection(treeMap) {
|
|
5387
5665
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5388
5666
|
this.shapeSelectionCollection = [];
|
|
@@ -5393,14 +5671,15 @@ var TreeMapSelection = /** @__PURE__ @class */ (function () {
|
|
|
5393
5671
|
this.treemap = treeMap;
|
|
5394
5672
|
this.addEventListener();
|
|
5395
5673
|
}
|
|
5396
|
-
// eslint-disable-next-line valid-jsdoc
|
|
5397
5674
|
/**
|
|
5398
5675
|
* Mouse down event in selection
|
|
5676
|
+
*
|
|
5677
|
+
* @param {PointerEvent} e - Specifies the pointer argument.
|
|
5678
|
+
* @returns {void}
|
|
5399
5679
|
*/
|
|
5400
5680
|
TreeMapSelection.prototype.mouseDown = function (e) {
|
|
5401
5681
|
var targetEle = e.target;
|
|
5402
5682
|
var eventArgs;
|
|
5403
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5404
5683
|
var treemap = this.treemap;
|
|
5405
5684
|
treemap.levelSelection = [];
|
|
5406
5685
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -5428,7 +5707,7 @@ var TreeMapSelection = /** @__PURE__ @class */ (function () {
|
|
|
5428
5707
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5429
5708
|
var collection = this.treemap.treeMapLegendModule.legendCollections;
|
|
5430
5709
|
this.shapeElement = undefined;
|
|
5431
|
-
removeShape(this.shapeSelectionCollection
|
|
5710
|
+
removeShape(this.shapeSelectionCollection);
|
|
5432
5711
|
if (highlightModule) {
|
|
5433
5712
|
highlightModule.shapeTarget = 'selection';
|
|
5434
5713
|
highlightModule.shapeHighlightCollection = [];
|
|
@@ -5482,7 +5761,7 @@ var TreeMapSelection = /** @__PURE__ @class */ (function () {
|
|
|
5482
5761
|
}
|
|
5483
5762
|
}
|
|
5484
5763
|
else {
|
|
5485
|
-
removeShape(this.shapeSelectionCollection
|
|
5764
|
+
removeShape(this.shapeSelectionCollection);
|
|
5486
5765
|
this.shapeSelectionCollection = [];
|
|
5487
5766
|
this.shapeElement = undefined;
|
|
5488
5767
|
this.shapeSelect = true;
|
|
@@ -5503,7 +5782,7 @@ var TreeMapSelection = /** @__PURE__ @class */ (function () {
|
|
|
5503
5782
|
this.legendSelect = false;
|
|
5504
5783
|
var legendIndex = parseInt(targetId[targetId.length - 1], 10);
|
|
5505
5784
|
var targetEle_1 = document.getElementById(targetId);
|
|
5506
|
-
removeLegend(this.legendSelectionCollection
|
|
5785
|
+
removeLegend(this.legendSelectionCollection);
|
|
5507
5786
|
if (highlightModule) {
|
|
5508
5787
|
highlightModule.shapeTarget = 'selection';
|
|
5509
5788
|
}
|
|
@@ -5529,7 +5808,7 @@ var TreeMapSelection = /** @__PURE__ @class */ (function () {
|
|
|
5529
5808
|
}
|
|
5530
5809
|
}
|
|
5531
5810
|
else {
|
|
5532
|
-
removeLegend(this.legendSelectionCollection
|
|
5811
|
+
removeLegend(this.legendSelectionCollection);
|
|
5533
5812
|
if (highlightModule) {
|
|
5534
5813
|
highlightModule.shapeTarget = 'highlight';
|
|
5535
5814
|
}
|
|
@@ -5580,7 +5859,7 @@ var TreeMapSelection = /** @__PURE__ @class */ (function () {
|
|
|
5580
5859
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5581
5860
|
var collection = this.treemap.treeMapLegendModule.legendCollections;
|
|
5582
5861
|
this.shapeElement = undefined;
|
|
5583
|
-
removeShape(this.shapeSelectionCollection
|
|
5862
|
+
removeShape(this.shapeSelectionCollection);
|
|
5584
5863
|
index = getLegendIndex(length_5, items[m], this.treemap);
|
|
5585
5864
|
this.shapeElement = this.treemap.legendSettings.mode === 'Default' ? document.getElementById(this.treemap.element.id + '_Legend_Shape_Index_' + index) : document.getElementById(this.treemap.element.id + '_Legend_Index_' + index);
|
|
5586
5865
|
if (this.shapeElement !== null) {
|
|
@@ -5620,7 +5899,7 @@ var TreeMapSelection = /** @__PURE__ @class */ (function () {
|
|
|
5620
5899
|
}
|
|
5621
5900
|
}
|
|
5622
5901
|
else {
|
|
5623
|
-
removeShape(this.shapeSelectionCollection
|
|
5902
|
+
removeShape(this.shapeSelectionCollection);
|
|
5624
5903
|
this.shapeElement = undefined;
|
|
5625
5904
|
this.treemap.levelSelection = [];
|
|
5626
5905
|
this.shapeSelect = true;
|
|
@@ -5663,7 +5942,6 @@ var TreeMapSelection = /** @__PURE__ @class */ (function () {
|
|
|
5663
5942
|
/**
|
|
5664
5943
|
* To destroy the selection.
|
|
5665
5944
|
*
|
|
5666
|
-
* @param {TreeMap} treeMap - Specifies the treemap instance.
|
|
5667
5945
|
* @returns {void}
|
|
5668
5946
|
* @private
|
|
5669
5947
|
*/
|
|
@@ -5690,7 +5968,6 @@ var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
|
5690
5968
|
* Render Tooltip
|
|
5691
5969
|
*/
|
|
5692
5970
|
var TreeMapTooltip = /** @__PURE__ @class */ (function () {
|
|
5693
|
-
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility
|
|
5694
5971
|
function TreeMapTooltip(treeMap) {
|
|
5695
5972
|
this.treemap = treeMap;
|
|
5696
5973
|
this.tooltipSettings = this.treemap.tooltipSettings;
|
|
@@ -5724,14 +6001,12 @@ var TreeMapTooltip = /** @__PURE__ @class */ (function () {
|
|
|
5724
6001
|
var tooltipEle;
|
|
5725
6002
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5726
6003
|
var location;
|
|
5727
|
-
var toolTipHeader;
|
|
5728
6004
|
var toolTipData = {};
|
|
5729
6005
|
var tooltipContent = [];
|
|
5730
6006
|
var markerFill;
|
|
5731
6007
|
if (targetId.indexOf('_Item_Index') > -1) {
|
|
5732
6008
|
item = this.treemap.layout.renderItems[parseFloat(targetId.split('_Item_Index_')[1])];
|
|
5733
6009
|
if (!isNullOrUndefined(item)) {
|
|
5734
|
-
toolTipHeader = item['name'];
|
|
5735
6010
|
value = item['weight'];
|
|
5736
6011
|
toolTipData = item['data'];
|
|
5737
6012
|
if (!isNullOrUndefined(item['options'])) {
|
|
@@ -5751,9 +6026,9 @@ var TreeMapTooltip = /** @__PURE__ @class */ (function () {
|
|
|
5751
6026
|
else {
|
|
5752
6027
|
tooltipEle = createElement('div', {
|
|
5753
6028
|
id: this.treemap.element.id + '_TreeMapTooltip',
|
|
5754
|
-
className: 'EJ2-TreeMap-Tooltip'
|
|
5755
|
-
styles: 'position: absolute;pointer-events:none;'
|
|
6029
|
+
className: 'EJ2-TreeMap-Tooltip'
|
|
5756
6030
|
});
|
|
6031
|
+
tooltipEle.style.cssText = 'position: absolute;pointer-events:none;';
|
|
5757
6032
|
document.getElementById(this.treemap.element.id + '_Secondary_Element').appendChild(tooltipEle);
|
|
5758
6033
|
}
|
|
5759
6034
|
location = getMousePosition(pageX, pageY, this.treemap.svgObject);
|
|
@@ -5772,6 +6047,7 @@ var TreeMapTooltip = /** @__PURE__ @class */ (function () {
|
|
|
5772
6047
|
treemap: this.treemap,
|
|
5773
6048
|
element: target, eventArgs: e
|
|
5774
6049
|
};
|
|
6050
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5775
6051
|
this.treemap.trigger(tooltipRendering, tootipArgs, function (args) {
|
|
5776
6052
|
_this.addTooltip(tootipArgs, markerFill, tooltipEle);
|
|
5777
6053
|
});
|