all files / treemap/user-interaction/ highlight-selection.js

95.03% Statements 306/322
87.28% Branches 151/173
100% Functions 17/17
95.03% Lines 306/322
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434   29× 29× 29× 29× 29× 29× 29×   31× 31× 31× 31× 31× 31× 31× 31× 31× 31× 31× 31× 31× 31× 19× 18× 18× 18× 18× 18× 12× 12× 12× 12× 12× 11× 10× 10× 10×       10× 10×           18× 18× 17×   16× 798× 798× 798× 798× 99×     798× 30× 30×     16× 16× 30× 30× 30× 30×   16× 16×             12×     136× 6936× 136× 136× 136× 136×   136× 136× 136× 136×                             31×   29×     29×   29×   23×   943×   29× 29× 29× 29× 29× 29×     18× 18× 18× 18× 18× 18×   17× 17× 17× 17× 17× 17× 17× 17× 17× 17× 17× 17× 17× 17× 17× 17×             249× 249× 249×                                 10×   170× 8670× 170× 170× 170× 170×   170× 170× 170× 170×                   23×     51× 51× 51×                                                                     18×     18×   18×   14×   943×   18× 18× 18× 18× 18×        
define(["require", "exports", "@syncfusion/ej2-base", "../model/constants", "../utils/helper"], function (require, exports, ej2_base_1, constants_1, helper_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var TreeMapHighlight = (function () {
        function TreeMapHighlight(treeMap) {
            this.target = 'highlight';
            this.shapeTarget = 'highlight';
            this.shapeHighlightCollection = [];
            this.legendHighlightCollection = [];
            this.currentElement = [];
            this.treemap = treeMap;
            this.addEventListener();
        }
        TreeMapHighlight.prototype.mouseMove = function (e) {
            var treemap = this.treemap;
            var processHighlight;
            var targetId = e.target.id;
            var eventArgs;
            var items = [];
            var highlight = this.treemap.highlightSettings;
            var item;
            var highLightElements = [];
            var process;
            var treeMapElement;
            var element;
            var orders;
            var selectionModule = this.treemap.treeMapSelectionModule;
            if (targetId.indexOf('_Item_Index') > -1 && (selectionModule ? this.treemap.selectionId !== targetId : true)) {
                if (this.highLightId !== targetId) {
                    treeMapElement = document.getElementById(treemap.element.id + '_TreeMap_' + treemap.layoutType + '_Layout');
                    var selectionElements = document.getElementsByClassName('treeMapSelection');
                    item = this.treemap.layout.renderItems[parseFloat(targetId.split('_Item_Index_')[1])];
                    var index = void 0;
                    if (this.treemap.legendSettings.visible) {
                        var collection = this.treemap.treeMapLegendModule.legendCollections;
                        var length_1 = this.treemap.treeMapLegendModule.legendCollections.length;
                        index = helper_1.getLegendIndex(length_1, item, treemap);
                        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);
                        if (this.shapeElement !== null && (selectionModule ? this.shapeElement.getAttribute('id') !== selectionModule.legendSelectId : true)) {
                            if (selectionModule ? this.shapeElement !== selectionModule.shapeElement : true) {
                                this.currentElement.push({ currentElement: this.shapeElement });
                                helper_1.removeShape(this.shapeHighlightCollection);
                                this.shapeHighlightCollection.push({ legendEle: this.shapeElement, oldFill: collection[index]['legendFill'],
                                    oldOpacity: collection[index]['opacity'], oldBorderColor: collection[index]['borderColor'],
                                    oldBorderWidth: collection[index]['borderWidth']
                                });
                                helper_1.setColor(this.shapeElement, highlight.fill, highlight.opacity, highlight.border.color, highlight.border.width.toString());
                                this.target = 'highlight';
                            }
                            else Eif (this.currentElement.length > 0 && this.currentElement[this.currentElement.length - 1]['currentElement'] !== this.shapeElement) {
                                helper_1.removeSelectionWithHighlight(this.shapeHighlightCollection, this.currentElement, treemap);
                                this.highLightId = '';
                            }
                        }
                        else Eif (this.currentElement.length > 0 && this.currentElement[this.currentElement.length - 1]['currentElement'] !== this.shapeElement) {
                            helper_1.removeSelectionWithHighlight(this.shapeHighlightCollection, this.currentElement, treemap);
                            this.highLightId = '';
                        }
                    }
                    orders = helper_1.findHightLightItems(item, [], highlight.mode, treemap);
                    if (this.treemap.legendSettings.visible ? selectionModule ? this.shapeElement ? this.shapeElement.getAttribute('id') !== selectionModule.legendSelectId : true : true : true) {
                        if (this.treemap.legendSettings.visible ? selectionModule ?
                            this.shapeElement !== selectionModule.shapeElement : true : true) {
                            for (var i = 0; i < treeMapElement.childElementCount; i++) {
                                element = treeMapElement.childNodes[i];
                                process = true;
                                item = treemap.layout.renderItems[parseFloat(element.id.split('_Item_Index_')[1])];
                                for (var j = 0; j < selectionElements.length; j++) {
                                    if (element.id === selectionElements[j].id) {
                                        process = false;
                                        break;
                                    }
                                }
                                if (orders.indexOf(item['levelOrderName']) > -1 && process) {
                                    highLightElements.push(element);
                                    items.push(item);
                                }
                            }
                            helper_1.removeClassNames(document.getElementsByClassName('treeMapHighLight'), 'treeMapHighLight', treemap);
                            for (var k = 0; k < highLightElements.length; k++) {
                                element = highLightElements[k];
                                helper_1.applyOptions(element.childNodes[0], { border: highlight.border, fill: highlight.fill, opacity: highlight.opacity });
                                element.classList.add('treeMapHighLight');
                                this.highLightId = targetId;
                            }
                            eventArgs = { cancel: false, name: constants_1.itemHighlight, treemap: treemap, items: items, elements: highLightElements };
                            treemap.trigger(constants_1.itemHighlight, eventArgs);
                        }
                        else {
                            processHighlight = false;
                        }
                    }
                }
            }
            else if (targetId.indexOf('_Legend_Shape') > -1 || targetId.indexOf('_Legend_Index') > -1) {
                Eif (this.treemap.legendSettings.visible && (selectionModule ? selectionModule.legendSelectId !== targetId : true)
                    && (selectionModule ? selectionModule.shapeSelectId !== targetId : true)) {
                    var itemIndex = void 0;
                    var groupIndex = void 0;
                    var length_2;
                    var targetEle = document.getElementById(targetId);
                    Eif (this.shapeTarget === 'highlight') {
                        helper_1.removeLegend(this.legendHighlightCollection);
                    }
                    this.shapeTarget = 'highlight';
                    var index = this.treemap.legendSettings.mode === 'Default' ? parseFloat(targetId.split('_Legend_Shape_Index_')[1]) : parseFloat(targetId.split('_Legend_Index_')[1]);
                    var dataLength = this.treemap.treeMapLegendModule.legendCollections[index]['legendData'].length;
                    var collection = this.treemap.treeMapLegendModule.legendCollections;
                    var legendIndex = parseInt(targetId[targetId.length - 1], 10);
                    for (var i = 0; i < dataLength; i++) {
                        for (var j = 0; j < this.treemap.layout.renderItems.length; j++) {
                            if (this.treemap.treeMapLegendModule.legendCollections[index]['legendData'][i]['levelOrderName'] === this.treemap.layout.renderItems[j]['levelOrderName']) {
                                itemIndex = j;
                                groupIndex = this.treemap.layout.renderItems[j]['groupIndex'];
                                var nodeEle = document.getElementById(this.treemap.element.id + '_Level_Index_' + groupIndex + '_Item_Index_' + itemIndex + '_RectPath');
                                if (i === 0) {
                                    this.legendHighlightCollection = [];
                                    helper_1.pushCollection(this.legendHighlightCollection, legendIndex, j, targetEle, nodeEle, this.treemap.layout.renderItems, collection);
                                    length_2 = this.legendHighlightCollection.length;
                                    this.legendHighlightCollection[length_2 - 1]['ShapeCollection'] = { Elements: [] };
                                }
                                helper_1.setColor(targetEle, highlight.fill, highlight.opacity, highlight.border.color, highlight.border.width.toString());
                                helper_1.setColor(nodeEle, highlight.fill, highlight.opacity, highlight.border.color, highlight.border.width.toString());
                                length_2 = this.legendHighlightCollection.length;
                                this.legendHighlightCollection[length_2 - 1]['ShapeCollection']['Elements'].push(nodeEle);
                            }
                        }
                    }
                }
            }
            else {
                Eif (selectionModule ? this.shapeElement ? this.shapeElement.getAttribute('id') !== selectionModule.legendSelectId : true : true) {
                    if (selectionModule ? this.shapeElement !== selectionModule.shapeElement : true && this.treemap.legendSettings.visible) {
                        helper_1.removeClassNames(document.getElementsByClassName('treeMapHighLight'), 'treeMapHighLight', treemap);
                    }
                }
                if ((this.shapeTarget === 'highlight' || this.target === 'highlight') && this.treemap.legendSettings.visible) {
                    Eif (selectionModule ? this.shapeElement ? this.shapeElement.getAttribute('id') !== selectionModule.legendSelectId : true : true) {
                        if (selectionModule ? this.shapeElement !== selectionModule.shapeElement : true && selectionModule ?
                            selectionModule.legendSelect : true) {
                            helper_1.removeShape(this.shapeHighlightCollection);
                            this.shapeHighlightCollection = [];
                        }
                    }
                }
                if (this.shapeTarget === 'highlight' && this.treemap.legendSettings.visible) {
                    helper_1.removeLegend(this.legendHighlightCollection);
                }
                this.highLightId = '';
                processHighlight = false;
            }
            return processHighlight;
        };
        TreeMapHighlight.prototype.addEventListener = function () {
            Iif (this.treemap.isDestroyed) {
                return;
            }
            this.treemap.on(ej2_base_1.Browser.touchMoveEvent, this.mouseMove, this);
        };
        TreeMapHighlight.prototype.removeEventListener = function () {
            if (this.treemap.isDestroyed) {
                return;
            }
            this.treemap.off(ej2_base_1.Browser.touchMoveEvent, this.mouseMove);
        };
        TreeMapHighlight.prototype.getModuleName = function () {
            return 'treeMapHighlight';
        };
        TreeMapHighlight.prototype.destroy = function () {
            this.shapeElement = null;
            this.shapeHighlightCollection = [];
            this.legendHighlightCollection = [];
            this.currentElement = [];
            this.removeEventListener();
            this.treemap = null;
        };
        return TreeMapHighlight;
    }());
    exports.TreeMapHighlight = TreeMapHighlight;
    var TreeMapSelection = (function () {
        function TreeMapSelection(treeMap) {
            this.shapeSelectionCollection = [];
            this.legendSelectionCollection = [];
            this.shapeSelect = true;
            this.legendSelect = true;
            this.treemap = treeMap;
            this.addEventListener();
        }
        TreeMapSelection.prototype.mouseDown = function (e) {
            var targetEle = e.target;
            var eventArgs;
            var treemap = this.treemap;
            treemap.levelSelection = [];
            var items = [];
            var targetId = targetEle.id;
            var labelText = targetEle.innerHTML;
            var item;
            var selectionElements = [];
            var treeMapElement;
            var element;
            var orders;
            var selection = treemap.selectionSettings;
            var highlightModule = this.treemap.treeMapHighlightModule;
            var layoutID = treemap.element.id + '_TreeMap_' + treemap.layoutType + '_Layout';
            if (targetId.indexOf('_Item_Index') > -1) {
                e.preventDefault();
                if (this.treemap.selectionId !== targetId && this.legendSelect) {
                    treeMapElement = document.getElementById(layoutID);
                    item = treemap.layout.renderItems[parseFloat(targetId.split('_Item_Index_')[1])];
                    var index = void 0;
                    if (this.treemap.legendSettings.visible) {
                        this.shapeSelect = false;
                        var length_3 = this.treemap.treeMapLegendModule.legendCollections.length;
                        var collection = this.treemap.treeMapLegendModule.legendCollections;
                        this.shapeElement = undefined;
                        helper_1.removeShape(this.shapeSelectionCollection);
                        if (highlightModule) {
                            highlightModule.shapeTarget = 'selection';
                            highlightModule.shapeHighlightCollection = [];
                        }
                        index = helper_1.getLegendIndex(length_3, item, treemap);
                        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);
                        Eif (this.shapeElement !== null) {
                            this.shapeSelectId = this.shapeElement.getAttribute('id');
                            this.shapeSelectionCollection.push({ legendEle: this.shapeElement, oldFill: collection[index]['legendFill'],
                                oldOpacity: collection[index]['opacity'], oldBorderColor: collection[index]['borderColor'],
                                oldBorderWidth: collection[index]['borderWidth']
                            });
                            helper_1.setColor(this.shapeElement, selection.fill, selection.opacity, selection.border.color, selection.border.width.toString());
                        }
                    }
                    orders = helper_1.findHightLightItems(item, [], selection.mode, treemap);
                    for (var i = 0; i < treeMapElement.childElementCount; i++) {
                        element = treeMapElement.childNodes[i];
                        item = treemap.layout.renderItems[parseFloat(element.id.split('_Item_Index_')[1])];
                        if (orders.indexOf(item['levelOrderName']) > -1) {
                            selectionElements.push(element);
                            treemap.levelSelection.push(element.id);
                            items.push(item);
                        }
                    }
                    helper_1.removeClassNames(document.getElementsByClassName('treeMapSelection'), 'treeMapSelection', treemap);
                    this.treemap.selectionId = targetId;
                    var highLightElements = document.getElementsByClassName('treeMapHighLight');
                    for (var k = 0; k < selectionElements.length; k++) {
                        element = selectionElements[k];
                        if (highLightElements.length > 0) {
                            for (var j = 0; j < highLightElements.length; j++) {
                                Eif (highLightElements[j].id === element.id) {
                                    highLightElements[j].classList.remove('treeMapHighLight');
                                }
                                helper_1.applyOptions(element.childNodes[0], { border: selection.border, fill: selection.fill, opacity: selection.opacity });
                                element.classList.add('treeMapSelection');
                            }
                        }
                        else {
                            helper_1.applyOptions(element.childNodes[0], { border: selection.border, fill: selection.fill, opacity: selection.opacity });
                            element.classList.add('treeMapSelection');
                        }
                        eventArgs = { cancel: false, name: constants_1.itemSelected, treemap: treemap, items: items, elements: selectionElements,
                            text: labelText, contentItemTemplate: labelText };
                        treemap.trigger(constants_1.itemSelected, eventArgs, function (observedArgs) {
                            Iif (observedArgs.contentItemTemplate !== labelText) {
                                helper_1.setItemTemplateContent(targetId, targetEle, observedArgs.contentItemTemplate);
                            }
                        });
                    }
                }
                else {
                    helper_1.removeShape(this.shapeSelectionCollection);
                    this.shapeSelectionCollection = [];
                    this.shapeElement = undefined;
                    this.shapeSelect = true;
                    this.shapeSelectId = '';
                    this.treemap.legendId = [];
                    helper_1.removeClassNames(document.getElementsByClassName('treeMapSelection'), 'treeMapSelection', treemap);
                    this.treemap.selectionId = '';
                }
            }
            else if (targetId.indexOf('_Legend_Shape') > -1 || targetId.indexOf('_Legend_Index') > -1) {
                var collection = this.treemap.treeMapLegendModule.legendCollections;
                if (this.treemap.legendSettings.visible && this.legendSelectId !== targetId && this.shapeSelect) {
                    var itemIndex = void 0;
                    var groupIndex = void 0;
                    var length_4;
                    this.legendSelectId = targetId;
                    this.legendSelect = false;
                    var legendIndex = parseInt(targetId[targetId.length - 1], 10);
                    var targetEle_1 = document.getElementById(targetId);
                    helper_1.removeLegend(this.legendSelectionCollection);
                    if (highlightModule) {
                        highlightModule.shapeTarget = 'selection';
                    }
                    var index = this.treemap.legendSettings.mode === 'Default' ? parseFloat(targetId.split('_Legend_Shape_Index_')[1]) : parseFloat(targetId.split('_Legend_Index_')[1]);
                    var dataLength = this.treemap.treeMapLegendModule.legendCollections[index]['legendData'].length;
                    for (var k = 0; k < dataLength; k++) {
                        for (var l = 0; l < this.treemap.layout.renderItems.length; l++) {
                            if (this.treemap.treeMapLegendModule.legendCollections[index]['legendData'][k]['levelOrderName'] === this.treemap.layout.renderItems[l]['levelOrderName']) {
                                itemIndex = l;
                                groupIndex = this.treemap.layout.renderItems[l]['groupIndex'];
                                var nodeEle = document.getElementById(this.treemap.element.id + '_Level_Index_' + groupIndex + '_Item_Index_' + itemIndex + '_RectPath');
                                if (k === 0) {
                                    helper_1.pushCollection(this.legendSelectionCollection, legendIndex, l, targetEle_1, nodeEle, this.treemap.layout.renderItems, collection);
                                    length_4 = this.legendSelectionCollection.length;
                                    this.legendSelectionCollection[length_4 - 1]['ShapeCollection'] = { Elements: [] };
                                }
                                helper_1.setColor(targetEle_1, selection.fill, selection.opacity, selection.border.color, selection.border.width.toString());
                                helper_1.setColor(nodeEle, selection.fill, selection.opacity, selection.border.color, selection.border.width.toString());
                                length_4 = this.legendSelectionCollection.length;
                                this.legendSelectionCollection[length_4 - 1]['ShapeCollection']['Elements'].push(nodeEle);
                            }
                        }
                    }
                }
                else {
                    helper_1.removeLegend(this.legendSelectionCollection);
                    if (highlightModule) {
                        highlightModule.shapeTarget = 'highlight';
                    }
                    this.legendSelect = true;
                    this.legendSelectId = '';
                }
            }
        };
        TreeMapSelection.prototype.selectTreemapItem = function (levelOrder, enable) {
            Eif (enable) {
                var item = void 0;
                for (var s = 0; s < this.treemap.layout.renderItems.length; s++) {
                    if (levelOrder === this.treemap.layout.renderItems[s]['levelOrderName']) {
                        item = this.treemap.layout.renderItems[s];
                        break;
                    }
                }
                var selection = this.treemap.selectionSettings;
                var selectionElements = [];
                var element = void 0;
                var index = void 0;
                var items = [];
                this.treemap.levelSelection = [];
                var layoutID = this.treemap.element.id + '_TreeMap_' + this.treemap.layoutType + '_Layout';
                var treeMapElement = document.getElementById(layoutID);
                var orders = helper_1.findHightLightItems(item, [], selection.mode, this.treemap);
                for (var i = 0; i < treeMapElement.childElementCount; i++) {
                    element = treeMapElement.childNodes[i];
                    item = this.treemap.layout.renderItems[parseFloat(element.id.split('_Item_Index_')[1])];
                    if (orders.indexOf(item['levelOrderName']) > -1) {
                        selectionElements.push(element);
                        this.treemap.levelSelection.push(element.id);
                        items.push(item);
                    }
                }
                Eif (this.treemap.legendSettings.visible) {
                    for (var m = 0; m < items.length; m++) {
                        this.shapeSelect = false;
                        var length_5 = this.treemap.treeMapLegendModule.legendCollections.length;
                        var collection = this.treemap.treeMapLegendModule.legendCollections;
                        this.shapeElement = undefined;
                        helper_1.removeShape(this.shapeSelectionCollection);
                        index = helper_1.getLegendIndex(length_5, items[m], this.treemap);
                        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);
                        Eif (this.shapeElement !== null) {
                            this.shapeSelectId = this.shapeElement.getAttribute('id');
                            this.treemap.legendId.push(this.shapeSelectId);
                            this.shapeSelectionCollection.push({
                                legendEle: this.shapeElement, oldFill: collection[index]['legendFill'],
                                oldOpacity: collection[index]['opacity'], oldBorderColor: collection[index]['borderColor'],
                                oldBorderWidth: collection[index]['borderWidth']
                            });
                            helper_1.setColor(this.shapeElement, selection.fill, selection.opacity, selection.border.color, selection.border.width.toString());
                        }
                    }
                }
                helper_1.removeClassNames(document.getElementsByClassName('treeMapSelection'), 'treeMapSelection', this.treemap);
                var selectionElement = document.getElementById(this.treemap.levelSelection[0]);
                this.treemap.selectionId = selectionElement.childNodes[0]['id'];
                var highLightElements = document.getElementsByClassName('treeMapHighLight');
                for (var k = 0; k < selectionElements.length; k++) {
                    element = selectionElements[k];
                    Iif (highLightElements.length > 0) {
                        for (var j = 0; j < highLightElements.length; j++) {
                            if (highLightElements[j].id === element.id) {
                                highLightElements[j].classList.remove('treeMapHighLight');
                            }
                            helper_1.applyOptions(element.childNodes[0], { border: selection.border, fill: selection.fill, opacity: selection.opacity });
                            element.classList.add('treeMapSelection');
                        }
                    }
                    else {
                        selection.fill = selection.fill === 'null' ?
                            this.treemap.layout.renderItems[parseInt(element.id.split('Item_Index_')[1], 10)]['options']['fill']
                            : selection.fill;
                        helper_1.applyOptions(element.childNodes[0], { border: selection.border, fill: selection.fill, opacity: selection.opacity });
                        element.classList.add('treeMapSelection');
                    }
                }
            }
            else {
                helper_1.removeShape(this.shapeSelectionCollection);
                this.shapeElement = undefined;
                this.treemap.levelSelection = [];
                this.shapeSelect = true;
                this.shapeSelectId = '';
                this.treemap.legendId = [];
                helper_1.removeClassNames(document.getElementsByClassName('treeMapSelection'), 'treeMapSelection', this.treemap);
                this.treemap.selectionId = '';
            }
        };
        TreeMapSelection.prototype.addEventListener = function () {
            Iif (this.treemap.isDestroyed) {
                return;
            }
            this.treemap.on(ej2_base_1.Browser.touchStartEvent, this.mouseDown, this);
        };
        TreeMapSelection.prototype.removeEventListener = function () {
            if (this.treemap.isDestroyed) {
                return;
            }
            this.treemap.off(ej2_base_1.Browser.touchStartEvent, this.mouseDown);
        };
        TreeMapSelection.prototype.getModuleName = function () {
            return 'treeMapSelection';
        };
        TreeMapSelection.prototype.destroy = function () {
            this.shapeElement = null;
            this.shapeSelectionCollection = [];
            this.legendSelectionCollection = [];
            this.removeEventListener();
            this.treemap = null;
        };
        return TreeMapSelection;
    }());
    exports.TreeMapSelection = TreeMapSelection;
});