Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@openseadragon-imaging/openseadragon-imaginghelper

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@openseadragon-imaging/openseadragon-imaginghelper - npm Package Compare versions

Comparing version 2.1.0 to 2.1.1

.DS_Store

4

dist/openseadragon-imaginghelper.js

@@ -1,3 +0,3 @@

/*! @openseadragon-imaging/openseadragon-imaginghelper 2.1.0 376a6eb (clean) */
!function(i,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("openseadragon")):"function"==typeof define&&define.amd?define(["openseadragon"],e):"object"==typeof exports?exports["openseadragon-imaginghelper"]=e(require("openseadragon")):i["openseadragon-imaginghelper"]=e(i.openseadragon)}(window,(function(i){return function(i){function e(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return i[o].call(n.exports,n,n.exports,e),n.l=!0,n.exports}var t={};return e.m=i,e.c=t,e.d=function(i,t,o){e.o(i,t)||Object.defineProperty(i,t,{enumerable:!0,get:o})},e.r=function(i){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},e.t=function(i,t){if(1&t&&(i=e(i)),8&t)return i;if(4&t&&"object"==typeof i&&i&&i.__esModule)return i;var o=Object.create(null);if(e.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:i}),2&t&&"string"!=typeof i)for(var n in i)e.d(o,n,function(e){return i[e]}.bind(null,n));return o},e.n=function(i){var t=i&&i.__esModule?function(){return i.default}:function(){return i};return e.d(t,"a",t),t},e.o=function(i,e){return Object.prototype.hasOwnProperty.call(i,e)},e.p="",e(e.s=1)}([function(e){e.exports=i},function(i,e,t){"use strict";t.r(e);var o=t(0),n=t.n(o);e.default=function(i,e){function t(){i.console.log("!!! [onOpen]");var e=this._viewer.world.getItemAt(this._worldIndex);this._haveImage=!0,this.imgWidth=e.source.dimensions.x,this.imgHeight=e.source.dimensions.y,this.imgAspectRatio=this.imgWidth/this.imgHeight,this._trackZoomPan()}function o(){i.console.log("!!! [onClose]"),this._haveImage=!1,this.imgWidth=0,this.imgHeight=0,this.imgAspectRatio=0}function r(){this._trackZoomPan()}function a(){this._trackZoomPan()}function h(){this._viewer&&this._viewer.autoResize&&this._trackZoomPan()}function s(){this._trackZoomPan()}function g(){this._trackZoomPan()}function m(){i.console.log("!!! [onWorldAddItem]")}function c(){i.console.log("!!! [onWorldRemoveItem]")}function l(){i.console.log("!!! [onWorldItemIndexChange]")}function w(){i.console.log("!!! [onWorldMetricsChange]")}if(!i.version||2>i.version.major)throw new Error("OpenSeadragonImagingHelper requires OpenSeadragon version 2.0.0+");i.Viewer.prototype.activateImagingHelper=function(i){return this.imagingHelper||((i=i||{}).viewer=this,this.imagingHelper=new e.ImagingHelper(i)),this.imagingHelper},e.ImagingHelper=function(e){if(!(e=e||{}).viewer)throw new Error("A viewer must be specified.");if(e.viewer.imagingHelper)throw new Error("Viewer already has an ImagingHelper.");this._viewer=e.viewer,this._worldIndex="number"==typeof e.worldIndex?e.worldIndex:0,i.EventSource.call(this),this._viewer.imagingHelper=this,this.options=e,this.imgWidth=0,this.imgHeight=0,this.imgAspectRatio=0,this._zoomFactor=1,this._minZoom=.001,this._maxZoom=10,this._zoomStepPercent=30,this._haveImage=!1,this._viewerSize=null,this._viewportWidth=0,this._viewportHeight=0,this._viewportOrigin=new n.a.Point(0,0),this._viewportCenter=new n.a.Point(0,0),e.onImageViewChanged&&this.addHandler("image-view-changed",e.onImageViewChanged),this._viewer.addHandler("open",i.delegate(this,t)),this._viewer.addHandler("close",i.delegate(this,o)),this._viewer.addHandler("animation",i.delegate(this,r)),this._viewer.addHandler("animation-finish",i.delegate(this,a)),this._viewer.addHandler("resize",i.delegate(this,h)),this._viewer.addHandler("full-page",i.delegate(this,s)),this._viewer.addHandler("full-screen",i.delegate(this,g)),this._viewer.world.addHandler("add-item",i.delegate(this,m)),this._viewer.world.addHandler("remove-item",i.delegate(this,c)),this._viewer.world.addHandler("item-index-change",i.delegate(this,l)),this._viewer.world.addHandler("metrics-change",i.delegate(this,w))},e.ImagingHelper.version={versionStr:"2.1.0"};var d=e.ImagingHelper.version.versionStr.split(".");return e.ImagingHelper.version.major=parseInt(d[0],10),e.ImagingHelper.version.minor=parseInt(d[1],10),e.ImagingHelper.version.revision=parseInt(d[2],10),i.extend(e.ImagingHelper.prototype,i.EventSource.prototype,{_raiseImageViewChanged:function(){this.raiseEvent("image-view-changed",{viewportWidth:this._viewportWidth,viewportHeight:this._viewportHeight,viewportOrigin:this._viewportOrigin,viewportCenter:this._viewportCenter,zoomFactor:this._zoomFactor})},_trackZoomPan:function(){var i=this._viewer.viewport.getBounds(!0);this._viewportOrigin.x=i.x,this._viewportOrigin.y=i.y*this.imgAspectRatio,this._viewportWidth=i.width,this._viewportHeight=i.height*this.imgAspectRatio,this._viewportCenter.x=this._viewportOrigin.x+this._viewportWidth/2,this._viewportCenter.y=this._viewportOrigin.y+this._viewportHeight/2,this._zoomFactor=this.getViewerContainerSize().x/(this._viewportWidth*this.imgWidth),this._raiseImageViewChanged()},getViewerContainerSize:function(){var e=this._viewer.container;return new i.Point(e.clientWidth,e.clientHeight)},notifyResize:function(){var i,e,t;this._haveImage&&(!(i=this.getViewerContainerSize()).equals(this._viewerSize)&&(this._viewerSize=i,e=new n.a.Point(this._viewportCenter.x,this._viewportCenter.y/this.imgAspectRatio),t=this._zoomFactor,this._viewer.viewport.resize(i,!1),this._viewer.viewport.zoomTo(t*this.imgWidth/i.x,null,!0),this._viewer.viewport.panTo(e,!0),this._raiseImageViewChanged()))},getMinZoom:function(){return this._minZoom},setMinZoom:function(i){this._minZoom=i,this._viewer.minZoomLevel=i*this.imgWidth/this.getViewerContainerSize().x},getMaxZoom:function(){return this._maxZoom},setMaxZoom:function(i){this._maxZoom=i,this._viewer.maxZoomLevel=i*this.imgWidth/this.getViewerContainerSize().x},getZoomStepPercent:function(){return this._zoomStepPercent},setZoomStepPercent:function(i){this._zoomStepPercent=i},setView:function(i,e,t,o){this._haveImage&&((this._viewportWidth!==i||this._viewportHeight!==e)&&this._viewer.viewport.zoomTo(1/i,null,o),(this._viewportCenter.x!==t.x||this._viewportCenter.y!==t.y)&&this._viewer.viewport.panTo(new n.a.Point(t.x,t.y/this.imgAspectRatio),o))},getZoomFactor:function(){return this._zoomFactor},setZoomFactor:function(i,e){this._haveImage&&i!==this._zoomFactor&&0<i&&this._viewer.viewport.zoomTo(i*this.imgWidth/this.getViewerContainerSize().x,new n.a.Point(this._viewportCenter.x,this._viewportCenter.y/this.imgAspectRatio),e)},zoomIn:function(i){var e=this._zoomFactor;(e*=1+this._zoomStepPercent/100)>this._maxZoom&&(e=this._maxZoom),this.setZoomFactor(e,i)},zoomOut:function(i){var e=this._zoomFactor;(e/=1+this._zoomStepPercent/100)<this._minZoom&&(e=this._minZoom),this.setZoomFactor(e,i)},zoomAboutLogicalPoint:function(i,e,t){this._haveImage&&i!==this._zoomFactor&&0<i&&this._viewer.viewport.zoomTo(i*this.imgWidth/this.getViewerContainerSize().x,new n.a.Point(e.x,e.y/this.imgAspectRatio),t)},zoomInAboutLogicalPoint:function(i,e){var t=this._zoomFactor;(t*=1+this._zoomStepPercent/100)>this._maxZoom&&(t=this._maxZoom),this.zoomAboutLogicalPoint(t,i,e)},zoomOutAboutLogicalPoint:function(i,e){var t=this._zoomFactor;(t/=1+this._zoomStepPercent/100)<this._minZoom&&(t=this._minZoom),this.zoomAboutLogicalPoint(t,i,e)},centerAboutLogicalPoint:function(i,e){this._haveImage&&(this._viewportCenter.x!==i.x||this._viewportCenter.y!==i.y)&&this._viewer.viewport.panTo(new n.a.Point(i.x,i.y/this.imgAspectRatio),e)},physicalToLogicalPoint:function(i){return new n.a.Point(this.physicalToLogicalX(i.x),this.physicalToLogicalY(i.y))},logicalToPhysicalPoint:function(i){return new n.a.Point(this.logicalToPhysicalX(i.x),this.logicalToPhysicalY(i.y))},physicalToLogicalX:function(i){return this._haveImage?this._viewportOrigin.x+i/this.getViewerContainerSize().x*this._viewportWidth:0},physicalToLogicalY:function(i){return this._haveImage?this._viewportOrigin.y+i/this.getViewerContainerSize().y*this._viewportHeight:0},logicalToPhysicalX:function(i){return this._haveImage?(i-this._viewportOrigin.x)/this._viewportWidth*this.getViewerContainerSize().x:0},logicalToPhysicalY:function(i){return this._haveImage?(i-this._viewportOrigin.y)/this._viewportHeight*this.getViewerContainerSize().y:0},physicalToLogicalDistance:function(i){return this._haveImage?i/this.getViewerContainerSize().x*this._viewportWidth:0},logicalToPhysicalDistance:function(i){return this._haveImage?i/this._viewportWidth*this.getViewerContainerSize().x:0},logicalToDataPoint:function(i){return new n.a.Point(this.logicalToDataX(i.x),this.logicalToDataY(i.y))},dataToLogicalPoint:function(i){return new n.a.Point(this.dataToLogicalX(i.x),this.dataToLogicalY(i.y))},physicalToDataPoint:function(i){return 1===this._viewer.world.getItemCount()?new n.a.Point(this.physicalToDataX(i.x),this.physicalToDataY(i.y)):this._viewer.world.getItemAt(this._worldIndex).viewerElementToImageCoordinates(i)},dataToPhysicalPoint:function(i){return new n.a.Point(this.dataToPhysicalX(i.x),this.dataToPhysicalY(i.y))},logicalToDataX:function(i){return this._haveImage?i*this.imgWidth:0},logicalToDataY:function(i){return this._haveImage?i*this.imgHeight:0},dataToLogicalX:function(i){return this._haveImage&&0<this.imgWidth?i/this.imgWidth:0},dataToLogicalY:function(i){return this._haveImage&&0<this.imgHeight?i/this.imgHeight:0},physicalToDataX:function(i){return 1===this._viewer.world.getItemCount()?this._haveImage&&0<this.getViewerContainerSize().x?(this._viewportOrigin.x+i/this.getViewerContainerSize().x*this._viewportWidth)*this.imgWidth:0:this._viewer.world.getItemAt(this._worldIndex).viewerElementToImageCoordinates(new n.a.Point(i,0)).x},physicalToDataY:function(i){return 1===this._viewer.world.getItemCount()?this._haveImage&&0<this.getViewerContainerSize().y?(this._viewportOrigin.y+i/this.getViewerContainerSize().y*this._viewportHeight)*this.imgHeight:0:this._viewer.world.getItemAt(this._worldIndex).viewerElementToImageCoordinates(new n.a.Point(0,i)).y},dataToPhysicalX:function(i){return this._haveImage&&0<this.imgWidth?(i/this.imgWidth-this._viewportOrigin.x)/this._viewportWidth*this.getViewerContainerSize().x:0},dataToPhysicalY:function(i){return this._haveImage&&0<this.imgHeight?(i/this.imgHeight-this._viewportOrigin.y)/this._viewportHeight*this.getViewerContainerSize().y:0}}),e.ImagingHelper}(n.a||window.OpenSeadragon,window.OpenSeadragonImaging=window.OpenSeadragonImaging||{})}]).default}));
/*! @openseadragon-imaging/openseadragon-imaginghelper 2.1.1 7640719 (clean) */
!function(i,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("openseadragon")):"function"==typeof define&&define.amd?define(["openseadragon"],e):"object"==typeof exports?exports["openseadragon-imaginghelper"]=e(require("openseadragon")):i["openseadragon-imaginghelper"]=e(i.openseadragon)}(window,(function(i){return function(i){function e(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return i[o].call(n.exports,n,n.exports,e),n.l=!0,n.exports}var t={};return e.m=i,e.c=t,e.d=function(i,t,o){e.o(i,t)||Object.defineProperty(i,t,{enumerable:!0,get:o})},e.r=function(i){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},e.t=function(i,t){if(1&t&&(i=e(i)),8&t)return i;if(4&t&&"object"==typeof i&&i&&i.__esModule)return i;var o=Object.create(null);if(e.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:i}),2&t&&"string"!=typeof i)for(var n in i)e.d(o,n,function(e){return i[e]}.bind(null,n));return o},e.n=function(i){var t=i&&i.__esModule?function(){return i.default}:function(){return i};return e.d(t,"a",t),t},e.o=function(i,e){return Object.prototype.hasOwnProperty.call(i,e)},e.p="",e(e.s=1)}([function(e){e.exports=i},function(i,e,t){"use strict";t.r(e);var o=t(0),n=t.n(o);e.default=function(i,e){function t(){i.console.log("!!! [onOpen]");var e=this._viewer.world.getItemAt(this._worldIndex);this._haveImage=!0,this.imgWidth=e.source.dimensions.x,this.imgHeight=e.source.dimensions.y,this.imgAspectRatio=this.imgWidth/this.imgHeight,this._trackZoomPan()}function o(){i.console.log("!!! [onClose]"),this._haveImage=!1,this.imgWidth=0,this.imgHeight=0,this.imgAspectRatio=0}function r(){this._trackZoomPan()}function a(){this._trackZoomPan()}function h(){this._viewer&&this._viewer.autoResize&&this._trackZoomPan()}function s(){this._trackZoomPan()}function g(){this._trackZoomPan()}function m(){i.console.log("!!! [onWorldAddItem]")}function c(){i.console.log("!!! [onWorldRemoveItem]")}function l(){i.console.log("!!! [onWorldItemIndexChange]")}function w(){i.console.log("!!! [onWorldMetricsChange]")}if(!i.version||2>i.version.major)throw new Error("OpenSeadragonImagingHelper requires OpenSeadragon version 2.0.0+");i.Viewer.prototype.activateImagingHelper=function(i){return this.imagingHelper||((i=i||{}).viewer=this,this.imagingHelper=new e.ImagingHelper(i)),this.imagingHelper},e.ImagingHelper=function(e){if(!(e=e||{}).viewer)throw new Error("A viewer must be specified.");if(e.viewer.imagingHelper)throw new Error("Viewer already has an ImagingHelper.");this._viewer=e.viewer,this._worldIndex="number"==typeof e.worldIndex?e.worldIndex:0,i.EventSource.call(this),this._viewer.imagingHelper=this,this.options=e,this.imgWidth=0,this.imgHeight=0,this.imgAspectRatio=0,this._zoomFactor=1,this._minZoom=.001,this._maxZoom=10,this._zoomStepPercent=30,this._haveImage=!1,this._viewerSize=null,this._viewportWidth=0,this._viewportHeight=0,this._viewportOrigin=new n.a.Point(0,0),this._viewportCenter=new n.a.Point(0,0),e.onImageViewChanged&&this.addHandler("image-view-changed",e.onImageViewChanged),this._viewer.addHandler("open",i.delegate(this,t)),this._viewer.addHandler("close",i.delegate(this,o)),this._viewer.addHandler("animation",i.delegate(this,r)),this._viewer.addHandler("animation-finish",i.delegate(this,a)),this._viewer.addHandler("resize",i.delegate(this,h)),this._viewer.addHandler("full-page",i.delegate(this,s)),this._viewer.addHandler("full-screen",i.delegate(this,g)),this._viewer.world.addHandler("add-item",i.delegate(this,m)),this._viewer.world.addHandler("remove-item",i.delegate(this,c)),this._viewer.world.addHandler("item-index-change",i.delegate(this,l)),this._viewer.world.addHandler("metrics-change",i.delegate(this,w))},e.ImagingHelper.version={versionStr:"2.1.1"};var d=e.ImagingHelper.version.versionStr.split(".");return e.ImagingHelper.version.major=parseInt(d[0],10),e.ImagingHelper.version.minor=parseInt(d[1],10),e.ImagingHelper.version.revision=parseInt(d[2],10),i.extend(e.ImagingHelper.prototype,i.EventSource.prototype,{_raiseImageViewChanged:function(){this.raiseEvent("image-view-changed",{viewportWidth:this._viewportWidth,viewportHeight:this._viewportHeight,viewportOrigin:this._viewportOrigin,viewportCenter:this._viewportCenter,zoomFactor:this._zoomFactor})},_trackZoomPan:function(){var i=this._viewer.viewport.getBounds(!0);this._viewportOrigin.x=i.x,this._viewportOrigin.y=i.y*this.imgAspectRatio,this._viewportWidth=i.width,this._viewportHeight=i.height*this.imgAspectRatio,this._viewportCenter.x=this._viewportOrigin.x+this._viewportWidth/2,this._viewportCenter.y=this._viewportOrigin.y+this._viewportHeight/2,this._zoomFactor=this.getViewerContainerSize().x/(this._viewportWidth*this.imgWidth),this._raiseImageViewChanged()},getViewerContainerSize:function(){var e=this._viewer.container;return new i.Point(e.clientWidth,e.clientHeight)},notifyResize:function(){var i,e,t;this._haveImage&&(!(i=this.getViewerContainerSize()).equals(this._viewerSize)&&(this._viewerSize=i,e=new n.a.Point(this._viewportCenter.x,this._viewportCenter.y/this.imgAspectRatio),t=this._zoomFactor,this._viewer.viewport.resize(i,!1),this._viewer.viewport.zoomTo(t*this.imgWidth/i.x,null,!0),this._viewer.viewport.panTo(e,!0),this._raiseImageViewChanged()))},getMinZoom:function(){return this._minZoom},setMinZoom:function(i){this._minZoom=i,this._viewer.minZoomLevel=i*this.imgWidth/this.getViewerContainerSize().x},getMaxZoom:function(){return this._maxZoom},setMaxZoom:function(i){this._maxZoom=i,this._viewer.maxZoomLevel=i*this.imgWidth/this.getViewerContainerSize().x},getZoomStepPercent:function(){return this._zoomStepPercent},setZoomStepPercent:function(i){this._zoomStepPercent=i},setView:function(i,e,t,o){this._haveImage&&((this._viewportWidth!==i||this._viewportHeight!==e)&&this._viewer.viewport.zoomTo(1/i,null,o),(this._viewportCenter.x!==t.x||this._viewportCenter.y!==t.y)&&this._viewer.viewport.panTo(new n.a.Point(t.x,t.y/this.imgAspectRatio),o))},getZoomFactor:function(){return this._zoomFactor},setZoomFactor:function(i,e){this._haveImage&&i!==this._zoomFactor&&0<i&&this._viewer.viewport.zoomTo(i*this.imgWidth/this.getViewerContainerSize().x,new n.a.Point(this._viewportCenter.x,this._viewportCenter.y/this.imgAspectRatio),e)},zoomIn:function(i){var e=this._zoomFactor;(e*=1+this._zoomStepPercent/100)>this._maxZoom&&(e=this._maxZoom),this.setZoomFactor(e,i)},zoomOut:function(i){var e=this._zoomFactor;(e/=1+this._zoomStepPercent/100)<this._minZoom&&(e=this._minZoom),this.setZoomFactor(e,i)},zoomAboutLogicalPoint:function(i,e,t){this._haveImage&&i!==this._zoomFactor&&0<i&&this._viewer.viewport.zoomTo(i*this.imgWidth/this.getViewerContainerSize().x,new n.a.Point(e.x,e.y/this.imgAspectRatio),t)},zoomInAboutLogicalPoint:function(i,e){var t=this._zoomFactor;(t*=1+this._zoomStepPercent/100)>this._maxZoom&&(t=this._maxZoom),this.zoomAboutLogicalPoint(t,i,e)},zoomOutAboutLogicalPoint:function(i,e){var t=this._zoomFactor;(t/=1+this._zoomStepPercent/100)<this._minZoom&&(t=this._minZoom),this.zoomAboutLogicalPoint(t,i,e)},centerAboutLogicalPoint:function(i,e){this._haveImage&&(this._viewportCenter.x!==i.x||this._viewportCenter.y!==i.y)&&this._viewer.viewport.panTo(new n.a.Point(i.x,i.y/this.imgAspectRatio),e)},physicalToLogicalPoint:function(i){return new n.a.Point(this.physicalToLogicalX(i.x),this.physicalToLogicalY(i.y))},logicalToPhysicalPoint:function(i){return new n.a.Point(this.logicalToPhysicalX(i.x),this.logicalToPhysicalY(i.y))},physicalToLogicalX:function(i){return this._haveImage?this._viewportOrigin.x+i/this.getViewerContainerSize().x*this._viewportWidth:0},physicalToLogicalY:function(i){return this._haveImage?this._viewportOrigin.y+i/this.getViewerContainerSize().y*this._viewportHeight:0},logicalToPhysicalX:function(i){return this._haveImage?(i-this._viewportOrigin.x)/this._viewportWidth*this.getViewerContainerSize().x:0},logicalToPhysicalY:function(i){return this._haveImage?(i-this._viewportOrigin.y)/this._viewportHeight*this.getViewerContainerSize().y:0},physicalToLogicalDistance:function(i){return this._haveImage?i/this.getViewerContainerSize().x*this._viewportWidth:0},logicalToPhysicalDistance:function(i){return this._haveImage?i/this._viewportWidth*this.getViewerContainerSize().x:0},logicalToDataPoint:function(i){return new n.a.Point(this.logicalToDataX(i.x),this.logicalToDataY(i.y))},dataToLogicalPoint:function(i){return new n.a.Point(this.dataToLogicalX(i.x),this.dataToLogicalY(i.y))},physicalToDataPoint:function(i){return 1===this._viewer.world.getItemCount()?new n.a.Point(this.physicalToDataX(i.x),this.physicalToDataY(i.y)):this._viewer.world.getItemAt(this._worldIndex).viewerElementToImageCoordinates(i)},dataToPhysicalPoint:function(i){return new n.a.Point(this.dataToPhysicalX(i.x),this.dataToPhysicalY(i.y))},logicalToDataX:function(i){return this._haveImage?i*this.imgWidth:0},logicalToDataY:function(i){return this._haveImage?i*this.imgHeight:0},dataToLogicalX:function(i){return this._haveImage&&0<this.imgWidth?i/this.imgWidth:0},dataToLogicalY:function(i){return this._haveImage&&0<this.imgHeight?i/this.imgHeight:0},physicalToDataX:function(i){return 1===this._viewer.world.getItemCount()?this._haveImage&&0<this.getViewerContainerSize().x?(this._viewportOrigin.x+i/this.getViewerContainerSize().x*this._viewportWidth)*this.imgWidth:0:this._viewer.world.getItemAt(this._worldIndex).viewerElementToImageCoordinates(new n.a.Point(i,0)).x},physicalToDataY:function(i){return 1===this._viewer.world.getItemCount()?this._haveImage&&0<this.getViewerContainerSize().y?(this._viewportOrigin.y+i/this.getViewerContainerSize().y*this._viewportHeight)*this.imgHeight:0:this._viewer.world.getItemAt(this._worldIndex).viewerElementToImageCoordinates(new n.a.Point(0,i)).y},dataToPhysicalX:function(i){return this._haveImage&&0<this.imgWidth?(i/this.imgWidth-this._viewportOrigin.x)/this._viewportWidth*this.getViewerContainerSize().x:0},dataToPhysicalY:function(i){return this._haveImage&&0<this.imgHeight?(i/this.imgHeight-this._viewportOrigin.y)/this._viewportHeight*this.getViewerContainerSize().y:0}}),e.ImagingHelper}(n.a||window.OpenSeadragon,window.OpenSeadragonImaging=window.OpenSeadragonImaging||{})}]).default}));
//# sourceMappingURL=openseadragon-imaginghelper.js.map
{
"name": "@openseadragon-imaging/openseadragon-imaginghelper",
"version": "2.1.0",
"version": "2.1.1",
"publishConfig": {

@@ -5,0 +5,0 @@ "access": "public"

@@ -14,6 +14,14 @@ ## OpenSeadragonImagingHelper

Download [openseadragon-imaginghelper.min.js](http://msalsbery.github.io/openseadragon-imaging/builds/openseadragon-imaginghelper.min.js) (or the un-minified [openseadragon-imaginghelper.js](http://msalsbery.github.io/openseadragon-imaging/builds/openseadragon-imaginghelper.js))
_**Prerequisite note: OpenSeadragonImagingHelper requires [OpenSeadragon](https://github.com/openseadragon/openseadragon) version 2.0+.**_
To use the plugin, add **openseadragon-imaginghelper.min.js** after **openseadragon.min.js** to your site.
The OpenSeadragonImagingHelper bundle can be obtained the following ways:
1. Direct download [openseadragon-imaginghelper.js](http://msalsbery.github.io/openseadragon-imaging/builds/openseadragon-imaginghelper.js) (and optionally [openseadragon-imaginghelper.js.map](http://msalsbery.github.io/openseadragon-imaging/builds/openseadragon-imaginghelper.js.map))
2. npm
```
npm install @openseadragon-imaging/openseadragon-imaginghelper
```
The OpenSeadragonImagingHelper bundle can be included using a script tag in HTML or imported as a library module (ES2015, CommonJS, AMD).
An **ImagingHelper** object can be created and attached to an [OpenSeadragon.Viewer](http://openseadragon.github.io/docs/OpenSeadragon.Viewer.html) two ways:

@@ -28,2 +36,7 @@

**Example using an HTML script tag**
```html
<script type="text/javascript" src="path_to/openseadragon/openseadragon.js"></script>
<script type="text/javascript" src="path_to/openseadragon-imaging/openseadragon-imaginghelper.js"></script>
```
```javascript

@@ -33,2 +46,24 @@ // Example 1 - Use the Viewer.activateImagingHelper() method to create an ImagingHelper

// create an OpenSeadragon viewer
var viewer = window.OpenSeadragon({...});
// add an ImagingHelper to the viewer
var imagingHelper = viewer.activateImagingHelper({...});
// Example 2 - Attach a new ImagingHelper to an existing OpenSeadragon.Viewer
var imagingHelper = new window.OpenSeadragonImaging.ImagingHelper({viewer: existingviewer});
```
**Example importing as a module**
```
npm install openseadragon --save
npm install @openseadragon-imaging/openseadragon-imaginghelper --save
```
```javascript
import OpenSeadragon from 'openseadragon';
import OpenSeadragonImagingHelper from '@openseadragon-imaging/openseadragon-imaginghelper';
// Example 1 - Use the Viewer.activateImagingHelper() method to create an ImagingHelper
// create an OpenSeadragon viewer
var viewer = OpenSeadragon({...});

@@ -41,3 +76,3 @@ // add an ImagingHelper to the viewer

var imagingHelper = new OpenSeadragonImaging.ImagingHelper({viewer: existingviewer});
var imagingHelper = new OpenSeadragonImagingHelper({viewer: existingviewer});
```

@@ -44,0 +79,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc