@hpcc-js/common 2.71.1 → 2.71.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.
package/dist/index.es6.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { classID2Meta, hashSum, isArray } from '@hpcc-js/util';
2
2
 
3
3
  var PKG_NAME = "@hpcc-js/common";
4
- var PKG_VERSION = "2.71.1";
5
- var BUILD_VERSION = "2.104.2";
4
+ var PKG_VERSION = "2.71.3";
5
+ var BUILD_VERSION = "2.104.7";
6
6
 
7
7
  /******************************************************************************
8
8
  Copyright (c) Microsoft Corporation.
@@ -14218,38 +14218,47 @@ var SVGZoomWidget = /** @class */ (function (_super) {
14218
14218
  this.zoomTo(translate, scale, transitionDuration);
14219
14219
  }
14220
14220
  };
14221
- SVGZoomWidget.prototype.zoomToBBox = function (bbox, transitionDuration, widthOnly, scale) {
14221
+ SVGZoomWidget.prototype.getRenderElementBBox = function () {
14222
+ return this._renderElement.node().getBBox();
14223
+ };
14224
+ SVGZoomWidget.prototype.calcZoomToBBox = function (bbox, widthOnly, scale) {
14222
14225
  if (widthOnly === void 0) { widthOnly = false; }
14226
+ var width = this.width();
14227
+ var height = this.height();
14223
14228
  if (bbox.width && bbox.height) {
14224
14229
  var x = bbox.x + bbox.width / 2;
14225
14230
  var y = bbox.y + bbox.height / 2;
14226
14231
  var dx = bbox.width;
14227
14232
  var dy = bbox.height;
14228
- var width = this.width();
14229
- var height = this.height();
14230
14233
  var newScale = scale || 1 / (widthOnly ? dx / width : Math.max(dx / width, dy / height));
14231
14234
  if (this.zoomToFitLimit_exists() && newScale > this.zoomToFitLimit()) {
14232
14235
  newScale = this.zoomToFitLimit();
14233
14236
  }
14234
14237
  var translate = [width / 2 - newScale * x, height / 2 - newScale * y];
14235
- this.zoomTo(translate, newScale, transitionDuration);
14238
+ return { translate: translate, newScale: newScale };
14236
14239
  }
14240
+ return { translate: [width / 2, height / 2], newScale: scale };
14241
+ };
14242
+ SVGZoomWidget.prototype.zoomToBBox = function (bbox, transitionDuration, widthOnly, scale) {
14243
+ if (widthOnly === void 0) { widthOnly = false; }
14244
+ var _a = this.calcZoomToBBox(bbox, widthOnly, scale), translate = _a.translate, newScale = _a.newScale;
14245
+ this.zoomTo(translate, newScale, transitionDuration);
14237
14246
  };
14238
14247
  SVGZoomWidget.prototype.zoomToScale = function (scale, transitionDuration) {
14239
14248
  if (this._renderElement) {
14240
- var bbox = this._renderElement.node().getBBox();
14249
+ var bbox = this.getRenderElementBBox();
14241
14250
  this.zoomToBBox(bbox, transitionDuration, undefined, scale);
14242
14251
  }
14243
14252
  };
14244
14253
  SVGZoomWidget.prototype.zoomToWidth = function (transitionDuration) {
14245
14254
  if (this._renderElement) {
14246
- var bbox = this._renderElement.node().getBBox();
14255
+ var bbox = this.getRenderElementBBox();
14247
14256
  this.zoomToBBox(bbox, transitionDuration, true);
14248
14257
  }
14249
14258
  };
14250
14259
  SVGZoomWidget.prototype.zoomToFit = function (transitionDuration) {
14251
14260
  if (this._renderElement) {
14252
- var bbox = this._renderElement.node().getBBox();
14261
+ var bbox = this.getRenderElementBBox();
14253
14262
  this.zoomToBBox(bbox, transitionDuration);
14254
14263
  }
14255
14264
  };