@syncfusion/ej2-treemap 24.2.3 → 25.2.3

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.
@@ -1642,11 +1642,10 @@ function colorNameToHex(color) {
1642
1642
  * @param {Size} size - Specifies the size
1643
1643
  * @param {string} url - Specifies the url
1644
1644
  * @param {PathOption} options - Specifies the options
1645
- * @param {string} label - Specifies the label
1646
1645
  * @returns {Element} - Returns the element
1647
1646
  * @private
1648
1647
  */
1649
- function drawSymbol(location, shape, size, url, options, label) {
1648
+ function drawSymbol(location, shape, size, url, options) {
1650
1649
  var svgRenderer = new SvgRenderer('');
1651
1650
  var temp = renderLegendShape(location, size, shape, options, url);
1652
1651
  var htmlElement = svgRenderer['draw' + temp.functionName](temp.renderOption);
@@ -2461,10 +2460,11 @@ var LayoutPanel = /** @__PURE__ @class */ (function () {
2461
2460
  }
2462
2461
  }
2463
2462
  itemGroup.setAttribute('aria-label', item['name']);
2464
- if ((_this.treemap.enableDrillDown && isLeafItem) || (_this.treemap.selectionSettings.enable || _this.treemap.highlightSettings.enable)) {
2463
+ if ((_this.treemap.enableDrillDown && isLeafItem) || (_this.treemap.selectionSettings.enable ||
2464
+ _this.treemap.highlightSettings.enable)) {
2465
2465
  itemGroup.setAttribute('role', 'button');
2466
2466
  itemGroup.setAttribute('tabindex', _this.treemap.tabIndex.toString());
2467
- itemGroup.style.cursor = _this.treemap.highlightSettings.enable && !_this.treemap.selectionSettings.enable && (_this.treemap.enableDrillDown && item['groupIndex'] == (_this.treemap.levels.length - 1)) ? 'default' :
2467
+ itemGroup.style.cursor = _this.treemap.highlightSettings.enable && !_this.treemap.selectionSettings.enable && (_this.treemap.enableDrillDown && item['groupIndex'] === (_this.treemap.levels.length - 1)) ? 'default' :
2468
2468
  _this.treemap.highlightSettings.enable && !_this.treemap.selectionSettings.enable && !_this.treemap.enableDrillDown ? 'default' : 'pointer';
2469
2469
  }
2470
2470
  else {
@@ -2999,6 +2999,7 @@ var Print = /** @__PURE__ @class */ (function () {
2999
2999
  }
3000
3000
  else {
3001
3001
  var exportElement = treeMap.element.cloneNode(true);
3002
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3002
3003
  var backgroundElement = exportElement.getElementsByTagName('svg')[0];
3003
3004
  if (!isNullOrUndefined(backgroundElement)) {
3004
3005
  backgroundElement = backgroundElement.childNodes[0];
@@ -3329,8 +3330,9 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
3329
3330
  fetchApiModule.onSuccess = function (args) {
3330
3331
  if (!isNullOrUndefined(args.type) && args.type === 'application/octet-stream') {
3331
3332
  var reader_1 = new FileReader();
3333
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
3332
3334
  var treemap_1 = _this;
3333
- reader_1.onload = function (data) {
3335
+ reader_1.onload = function () {
3334
3336
  args = JSON.parse(reader_1.result.toString());
3335
3337
  treemap_1.dataSource = args;
3336
3338
  treemap_1.renderTreeMapElements();
@@ -3458,7 +3460,7 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
3458
3460
  var titleBounds = new Rect(location_1.x, location_1.y, elementSize.width, elementSize.height);
3459
3461
  var element = renderTextElement(options, style, style.color || (type === 'title' ? this.themeStyle.titleFontColor : this.themeStyle.subTitleFontColor), groupEle);
3460
3462
  element.setAttribute('aria-label', title.description || title.text);
3461
- element.setAttribute('role', '');
3463
+ element.setAttribute('role', 'region');
3462
3464
  element.setAttribute('tabindex', this.tabIndex.toString());
3463
3465
  if ((type === 'title' && !title.subtitleSettings.text) || (type === 'subtitle')) {
3464
3466
  height = (this.availableSize.height - titleBounds.y - titlePadding - this.margin.bottom);
@@ -4284,43 +4286,50 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
4284
4286
  if (this.tooltipSettings.visible) {
4285
4287
  modules.push({
4286
4288
  member: 'treeMapTooltip',
4287
- args: [this]
4289
+ args: [this],
4290
+ name: 'TreeMapTooltip'
4288
4291
  });
4289
4292
  }
4290
4293
  if (this.highlightSettings.enable) {
4291
4294
  modules.push({
4292
4295
  member: 'treeMapHighlight',
4293
- args: [this]
4296
+ args: [this],
4297
+ name: 'TreeMapHighlight'
4294
4298
  });
4295
4299
  }
4296
4300
  if (this.selectionSettings.enable) {
4297
4301
  modules.push({
4298
4302
  member: 'treeMapSelection',
4299
- args: [this]
4303
+ args: [this],
4304
+ name: 'TreeMapSelection'
4300
4305
  });
4301
4306
  }
4302
4307
  if (this.legendSettings.visible) {
4303
4308
  modules.push({
4304
4309
  member: 'treeMapLegend',
4305
- args: [this]
4310
+ args: [this],
4311
+ name: 'TreeMapLegend'
4306
4312
  });
4307
4313
  }
4308
4314
  if (this.allowPrint) {
4309
4315
  modules.push({
4310
4316
  member: 'Print',
4311
- args: [this, Print]
4317
+ args: [this, Print],
4318
+ name: 'Print'
4312
4319
  });
4313
4320
  }
4314
4321
  if (this.allowImageExport) {
4315
4322
  modules.push({
4316
4323
  member: 'ImageExport',
4317
- args: [this, ImageExport]
4324
+ args: [this, ImageExport],
4325
+ name: 'ImageExport'
4318
4326
  });
4319
4327
  }
4320
4328
  if (this.allowPdfExport) {
4321
4329
  modules.push({
4322
4330
  member: 'PdfExport',
4323
- args: [this, PdfExport]
4331
+ args: [this, PdfExport],
4332
+ name: 'PdfExport'
4324
4333
  });
4325
4334
  }
4326
4335
  return modules;
@@ -4382,6 +4391,20 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
4382
4391
  this.legendId = [];
4383
4392
  this.removeSvg();
4384
4393
  _super.prototype.destroy.call(this);
4394
+ this.areaRect = null;
4395
+ this.themeStyle = null;
4396
+ this.totalRect = null;
4397
+ this.drilledLegendItems = null;
4398
+ this.doubleTapTimer = null;
4399
+ this.treemapLevelData = null;
4400
+ this.resizeEvent = null;
4401
+ this.availableSize = null;
4402
+ this.intl = null;
4403
+ if (!isNullOrUndefined(this.layout)) {
4404
+ this.layout.destroy();
4405
+ }
4406
+ this.layout = null;
4407
+ this.renderer = null;
4385
4408
  };
4386
4409
  TreeMap.prototype.removeSvg = function () {
4387
4410
  removeElement(this.element.id + '_Secondary_Element');
@@ -4592,9 +4615,10 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
4592
4615
  this.treemap = treemap;
4593
4616
  this.addEventListener();
4594
4617
  }
4595
- // eslint-disable-next-line valid-jsdoc
4596
4618
  /**
4597
4619
  * method for legend
4620
+ *
4621
+ * @returns {void}
4598
4622
  * @private
4599
4623
  */
4600
4624
  TreeMapLegend.prototype.renderLegend = function () {
@@ -5120,6 +5144,7 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
5120
5144
  // eslint-disable-next-line valid-jsdoc
5121
5145
  /**
5122
5146
  * To draw the legend
5147
+ *
5123
5148
  * @private
5124
5149
  */
5125
5150
  TreeMapLegend.prototype.drawLegend = function () {
@@ -5232,7 +5257,7 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
5232
5257
  };
5233
5258
  treemap.trigger(legendItemRendering, eventArgs, function (observedArgs) {
5234
5259
  var renderOptions = new PathOption(shapeId, observedArgs.fill, strokeWidth_1, isLineShape_1 ? collection['Fill'] : strokeColor_1, legend.opacity, '');
5235
- legendElement.appendChild(drawSymbol(shapeLocation, observedArgs.shape, shapeSize, observedArgs.imageUrl, renderOptions, legendText));
5260
+ legendElement.appendChild(drawSymbol(shapeLocation, observedArgs.shape, shapeSize, observedArgs.imageUrl, renderOptions));
5236
5261
  textOptions = new TextOption(textId, textLocation.x, textLocation.y, 'start', legendText, '', '');
5237
5262
  renderTextElement(textOptions, legend.textStyle, legend.textStyle.color || treemap.themeStyle.legendTextColor, legendElement);
5238
5263
  _this.legendGroup.appendChild(legendElement);
@@ -5287,7 +5312,9 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
5287
5312
  'text-anchor': 'middle',
5288
5313
  'transform': '',
5289
5314
  'opacity': 1,
5290
- 'dominant-baseline': ''
5315
+ 'dominant-baseline': '',
5316
+ 'role': 'region',
5317
+ 'aria-label': pagingText
5291
5318
  };
5292
5319
  pagingGroup.appendChild(render.createText(pageTextOptions, pagingText));
5293
5320
  this.legendGroup.appendChild(pagingGroup);
@@ -5323,7 +5350,10 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
5323
5350
  var textSize = measureText(trimTitle, textStyle);
5324
5351
  if (legendTitle) {
5325
5352
  textOptions = new TextOption(this.treemap.element.id + '_LegendTitle', (this.legendItemRect.x) + (this.legendItemRect.width / 2), this.legendItemRect.y - (textSize.height / 2) - (spacing / 2), 'middle', trimTitle, '');
5326
- renderTextElement(textOptions, textStyle, textStyle.color || this.treemap.themeStyle.legendTitleColor, this.legendGroup);
5353
+ var textElement = renderTextElement(textOptions, textStyle, textStyle.color ||
5354
+ this.treemap.themeStyle.legendTitleColor, this.legendGroup);
5355
+ textElement.setAttribute('role', 'region');
5356
+ textElement.setAttribute('aria-label', legendTitle);
5327
5357
  }
5328
5358
  };
5329
5359
  /**
@@ -5473,8 +5503,11 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
5473
5503
  this.translate = new Location(x, y);
5474
5504
  }
5475
5505
  };
5476
- // eslint-disable-next-line valid-jsdoc
5477
- /** @private */
5506
+ /**
5507
+ * @param {PointerEvent} e - Specifies the event.
5508
+ * @returns {void}
5509
+ * @private
5510
+ */
5478
5511
  TreeMapLegend.prototype.mouseUpHandler = function (e) {
5479
5512
  this.renderInteractivePointer(e);
5480
5513
  clearTimeout(this.clearTimeout);
@@ -5483,6 +5516,7 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
5483
5516
  // eslint-disable-next-line valid-jsdoc
5484
5517
  /**
5485
5518
  * To remove the interactive pointer
5519
+ *
5486
5520
  * @private
5487
5521
  */
5488
5522
  TreeMapLegend.prototype.removeInteractivePointer = function () {
@@ -5521,6 +5555,7 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
5521
5555
  // eslint-disable-next-line valid-jsdoc
5522
5556
  /**
5523
5557
  * To add the event listener
5558
+ *
5524
5559
  * @private
5525
5560
  */
5526
5561
  TreeMapLegend.prototype.addEventListener = function () {
@@ -5533,6 +5568,7 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
5533
5568
  // eslint-disable-next-line valid-jsdoc
5534
5569
  /**
5535
5570
  * To remove the event listener
5571
+ *
5536
5572
  * @private
5537
5573
  */
5538
5574
  TreeMapLegend.prototype.removeEventListener = function () {
@@ -5557,6 +5593,8 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
5557
5593
  * @private
5558
5594
  */
5559
5595
  TreeMapLegend.prototype.destroy = function () {
5596
+ clearTimeout(this.clearTimeout);
5597
+ this.clearTimeout = null;
5560
5598
  this.legendRenderingCollections = [];
5561
5599
  this.legendCollections = [];
5562
5600
  this.outOfRangeLegend = null;
@@ -5570,8 +5608,7 @@ var TreeMapLegend = /** @__PURE__ @class */ (function () {
5570
5608
  this.legendInteractiveGradient = [];
5571
5609
  this.legendItemRect = null;
5572
5610
  this.removeEventListener();
5573
- //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.
5574
- //this.treemap = null;
5611
+ this.treemap = null;
5575
5612
  };
5576
5613
  /**
5577
5614
  * Get the gradient color for interactive legend.
@@ -6185,11 +6222,13 @@ var TreeMapTooltip = /** @__PURE__ @class */ (function () {
6185
6222
  markerFill = item['options']['fill'];
6186
6223
  }
6187
6224
  if (this.treemap.enableRtl) {
6188
- tooltipContent = [(!isNullOrUndefined(this.tooltipSettings.format) ? textFormatter(this.tooltipSettings.format, toolTipData, this.treemap) : null)
6225
+ tooltipContent = [(!isNullOrUndefined(this.tooltipSettings.format) ?
6226
+ textFormatter(this.tooltipSettings.format, toolTipData, this.treemap) : null)
6189
6227
  || formatValue(value, this.treemap) + ' : ' + this.treemap.weightValuePath.toString()];
6190
6228
  }
6191
6229
  else {
6192
- tooltipContent = [(!isNullOrUndefined(this.tooltipSettings.format) ? textFormatter(this.tooltipSettings.format, toolTipData, this.treemap) : null)
6230
+ tooltipContent = [(!isNullOrUndefined(this.tooltipSettings.format) ?
6231
+ textFormatter(this.tooltipSettings.format, toolTipData, this.treemap) : null)
6193
6232
  || this.treemap.weightValuePath.toString() + ' : ' + formatValue(value, this.treemap)];
6194
6233
  }
6195
6234
  if (document.getElementById(this.tooltipId)) {
@@ -6293,6 +6332,7 @@ var TreeMapTooltip = /** @__PURE__ @class */ (function () {
6293
6332
  // eslint-disable-next-line valid-jsdoc
6294
6333
  /**
6295
6334
  * To bind events for tooltip module
6335
+ *
6296
6336
  * @private
6297
6337
  */
6298
6338
  TreeMapTooltip.prototype.addEventListener = function () {
@@ -6305,6 +6345,7 @@ var TreeMapTooltip = /** @__PURE__ @class */ (function () {
6305
6345
  // eslint-disable-next-line valid-jsdoc
6306
6346
  /**
6307
6347
  * To unbind events for tooltip module
6348
+ *
6308
6349
  * @private
6309
6350
  */
6310
6351
  TreeMapTooltip.prototype.removeEventListener = function () {