@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 +18 -9
- package/dist/index.es6.js.map +1 -1
- package/dist/index.js +18 -9
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +4 -4
- package/src/SVGZoomWidget.ts +17 -7
- package/src/__package__.ts +2 -2
- package/types/SVGZoomWidget.d.ts +5 -0
- package/types/SVGZoomWidget.d.ts.map +1 -1
- package/types/__package__.d.ts +2 -2
- package/types-3.4/SVGZoomWidget.d.ts +5 -0
- package/types-3.4/__package__.d.ts +2 -2
package/dist/index.js
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
})(this, (function (exports, util) { 'use strict';
|
|
6
6
|
|
|
7
7
|
var PKG_NAME = "@hpcc-js/common";
|
|
8
|
-
var PKG_VERSION = "2.71.
|
|
9
|
-
var BUILD_VERSION = "2.104.
|
|
8
|
+
var PKG_VERSION = "2.71.3";
|
|
9
|
+
var BUILD_VERSION = "2.104.7";
|
|
10
10
|
|
|
11
11
|
/******************************************************************************
|
|
12
12
|
Copyright (c) Microsoft Corporation.
|
|
@@ -14222,38 +14222,47 @@
|
|
|
14222
14222
|
this.zoomTo(translate, scale, transitionDuration);
|
|
14223
14223
|
}
|
|
14224
14224
|
};
|
|
14225
|
-
SVGZoomWidget.prototype.
|
|
14225
|
+
SVGZoomWidget.prototype.getRenderElementBBox = function () {
|
|
14226
|
+
return this._renderElement.node().getBBox();
|
|
14227
|
+
};
|
|
14228
|
+
SVGZoomWidget.prototype.calcZoomToBBox = function (bbox, widthOnly, scale) {
|
|
14226
14229
|
if (widthOnly === void 0) { widthOnly = false; }
|
|
14230
|
+
var width = this.width();
|
|
14231
|
+
var height = this.height();
|
|
14227
14232
|
if (bbox.width && bbox.height) {
|
|
14228
14233
|
var x = bbox.x + bbox.width / 2;
|
|
14229
14234
|
var y = bbox.y + bbox.height / 2;
|
|
14230
14235
|
var dx = bbox.width;
|
|
14231
14236
|
var dy = bbox.height;
|
|
14232
|
-
var width = this.width();
|
|
14233
|
-
var height = this.height();
|
|
14234
14237
|
var newScale = scale || 1 / (widthOnly ? dx / width : Math.max(dx / width, dy / height));
|
|
14235
14238
|
if (this.zoomToFitLimit_exists() && newScale > this.zoomToFitLimit()) {
|
|
14236
14239
|
newScale = this.zoomToFitLimit();
|
|
14237
14240
|
}
|
|
14238
14241
|
var translate = [width / 2 - newScale * x, height / 2 - newScale * y];
|
|
14239
|
-
|
|
14242
|
+
return { translate: translate, newScale: newScale };
|
|
14240
14243
|
}
|
|
14244
|
+
return { translate: [width / 2, height / 2], newScale: scale };
|
|
14245
|
+
};
|
|
14246
|
+
SVGZoomWidget.prototype.zoomToBBox = function (bbox, transitionDuration, widthOnly, scale) {
|
|
14247
|
+
if (widthOnly === void 0) { widthOnly = false; }
|
|
14248
|
+
var _a = this.calcZoomToBBox(bbox, widthOnly, scale), translate = _a.translate, newScale = _a.newScale;
|
|
14249
|
+
this.zoomTo(translate, newScale, transitionDuration);
|
|
14241
14250
|
};
|
|
14242
14251
|
SVGZoomWidget.prototype.zoomToScale = function (scale, transitionDuration) {
|
|
14243
14252
|
if (this._renderElement) {
|
|
14244
|
-
var bbox = this.
|
|
14253
|
+
var bbox = this.getRenderElementBBox();
|
|
14245
14254
|
this.zoomToBBox(bbox, transitionDuration, undefined, scale);
|
|
14246
14255
|
}
|
|
14247
14256
|
};
|
|
14248
14257
|
SVGZoomWidget.prototype.zoomToWidth = function (transitionDuration) {
|
|
14249
14258
|
if (this._renderElement) {
|
|
14250
|
-
var bbox = this.
|
|
14259
|
+
var bbox = this.getRenderElementBBox();
|
|
14251
14260
|
this.zoomToBBox(bbox, transitionDuration, true);
|
|
14252
14261
|
}
|
|
14253
14262
|
};
|
|
14254
14263
|
SVGZoomWidget.prototype.zoomToFit = function (transitionDuration) {
|
|
14255
14264
|
if (this._renderElement) {
|
|
14256
|
-
var bbox = this.
|
|
14265
|
+
var bbox = this.getRenderElementBBox();
|
|
14257
14266
|
this.zoomToBBox(bbox, transitionDuration);
|
|
14258
14267
|
}
|
|
14259
14268
|
};
|