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
2
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.1 to 2.2.0

4

dist/openseadragon-imaginghelper.js

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

/*! @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}));
/*! @openseadragon-imaging/openseadragon-imaginghelper 2.2.0 25fbe98 (clean) @license MIT */
!function(e,i){"object"==typeof exports&&"object"==typeof module?module.exports=i(require("openseadragon")):"function"==typeof define&&define.amd?define(["openseadragon"],i):"object"==typeof exports?exports["openseadragon-imaginghelper"]=i(require("openseadragon")):e["openseadragon-imaginghelper"]=i(e.openseadragon)}(window,(function(e){return function(e){function i(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,i),n.l=!0,n.exports}var t={};return i.m=e,i.c=t,i.d=function(e,t,o){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(i.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(o,n,function(i){return e[i]}.bind(null,n));return o},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,i){return Object.prototype.hasOwnProperty.call(e,i)},i.p="",i(i.s=1)}([function(i){i.exports=e},function(e,i,t){"use strict";t.r(i);var o=t(0),n=t.n(o);i.default=function(e,i){if(!e.version||2>e.version.major)throw new Error("OpenSeadragonImagingHelper requires OpenSeadragon version 2.0.0+");return e.Viewer.prototype.activateImagingHelper=function(e){return this.imagingHelper||((e=e||{}).viewer=this,this.imagingHelper=new i.ImagingHelper(e)),this.imagingHelper},i.ImagingHelper=function(i){if(e.EventSource.call(this),!(i=i||{}).viewer)throw new Error("A viewer must be specified.");if(i.viewer.imagingHelper)throw new Error("Viewer already has an ImagingHelper.");this._viewer=i.viewer,this._worldIndex="number"==typeof i.worldIndex?i.worldIndex:0,this._viewer.imagingHelper=this,this.options=i,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),this._onOpen=e.delegate(this,this.onOpen),this._onClose=e.delegate(this,this.onClose),this._onAnimation=e.delegate(this,this.onAnimation),this._onAnimationFinish=e.delegate(this,this.onAnimationFinish),this._onResize=e.delegate(this,this.onResize),this._onFullPage=e.delegate(this,this.onFullPage),this._onFullScreen=e.delegate(this,this.onFullScreen),this._onWorldAddItem=e.delegate(this,this.onWorldAddItem),this._onWorldRemoveItem=e.delegate(this,this.onWorldRemoveItem),this._onWorldItemIndexChange=e.delegate(this,this.onWorldItemIndexChange),this._onWorldMetricsChange=e.delegate(this,this.onWorldMetricsChange),i.onImageViewChanged&&this.addHandler("image-view-changed",i.onImageViewChanged),this._viewer.addHandler("open",this._onOpen),this._viewer.addHandler("close",this._onClose),this._viewer.addHandler("animation",this._onAnimation),this._viewer.addHandler("animation-finish",this._onAnimationFinish),this._viewer.addHandler("resize",this._onResize),this._viewer.addHandler("full-page",this._onFullPage),this._viewer.addHandler("full-screen",this._onFullScreen)},i.ImagingHelper.prototype=Object.create(e.EventSource.prototype),i.ImagingHelper.version={versionStr:"2.2.0",major:2,minor:2,revision:0},Object.defineProperty(i.ImagingHelper.prototype,"constructor",{enumerable:!1,value:i.ImagingHelper}),i.ImagingHelper.prototype.destroy=function(){this.options.onImageViewChanged&&this.removeHandler("image-view-changed",this.options.onImageViewChanged),this._viewer.removeHandler("open",this._onOpen),this._viewer.removeHandler("close",this._onClose),this._viewer.removeHandler("animation",this._onAnimation),this._viewer.removeHandler("animation-finish",this._onAnimationFinish),this._viewer.removeHandler("resize",this._onResize),this._viewer.removeHandler("full-page",this._onFullPage),this._viewer.removeHandler("full-screen",this._onFullScreen),this._viewer.imagingHelper=null,this._viewer.destroy(),this._viewer=null,this.options.viewer=null},i.ImagingHelper.prototype._raiseImageViewChanged=function(){this.raiseEvent("image-view-changed",{viewportWidth:this._viewportWidth,viewportHeight:this._viewportHeight,viewportOrigin:this._viewportOrigin,viewportCenter:this._viewportCenter,zoomFactor:this._zoomFactor})},i.ImagingHelper.prototype._trackZoomPan=function(){var e=this._viewer.viewport.getBounds(!0);this._viewportOrigin.x=e.x,this._viewportOrigin.y=e.y*this.imgAspectRatio,this._viewportWidth=e.width,this._viewportHeight=e.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()},i.ImagingHelper.prototype.getViewerContainerSize=function(){var i=this._viewer.container;return new e.Point(i.clientWidth,i.clientHeight)},i.ImagingHelper.prototype.notifyResize=function(){var e,i,t;this._haveImage&&(!(e=this.getViewerContainerSize()).equals(this._viewerSize)&&(this._viewerSize=e,i=new n.a.Point(this._viewportCenter.x,this._viewportCenter.y/this.imgAspectRatio),t=this._zoomFactor,this._viewer.viewport.resize(e,!1),this._viewer.viewport.zoomTo(t*this.imgWidth/e.x,null,!0),this._viewer.viewport.panTo(i,!0),this._raiseImageViewChanged()))},i.ImagingHelper.prototype.getMinZoom=function(){return this._minZoom},i.ImagingHelper.prototype.setMinZoom=function(e){this._minZoom=e,this._viewer.minZoomLevel=e*this.imgWidth/this.getViewerContainerSize().x},i.ImagingHelper.prototype.getMaxZoom=function(){return this._maxZoom},i.ImagingHelper.prototype.setMaxZoom=function(e){this._maxZoom=e,this._viewer.maxZoomLevel=e*this.imgWidth/this.getViewerContainerSize().x},i.ImagingHelper.prototype.getZoomStepPercent=function(){return this._zoomStepPercent},i.ImagingHelper.prototype.setZoomStepPercent=function(e){this._zoomStepPercent=e},i.ImagingHelper.prototype.setView=function(e,i,t,o){this._haveImage&&((this._viewportWidth!==e||this._viewportHeight!==i)&&this._viewer.viewport.zoomTo(1/e,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))},i.ImagingHelper.prototype.getZoomFactor=function(){return this._zoomFactor},i.ImagingHelper.prototype.setZoomFactor=function(e,i){this._haveImage&&e!==this._zoomFactor&&0<e&&this._viewer.viewport.zoomTo(e*this.imgWidth/this.getViewerContainerSize().x,new n.a.Point(this._viewportCenter.x,this._viewportCenter.y/this.imgAspectRatio),i)},i.ImagingHelper.prototype.zoomIn=function(e){var i=this._zoomFactor;(i*=1+this._zoomStepPercent/100)>this._maxZoom&&(i=this._maxZoom),this.setZoomFactor(i,e)},i.ImagingHelper.prototype.zoomOut=function(e){var i=this._zoomFactor;(i/=1+this._zoomStepPercent/100)<this._minZoom&&(i=this._minZoom),this.setZoomFactor(i,e)},i.ImagingHelper.prototype.zoomAboutLogicalPoint=function(e,i,t){this._haveImage&&e!==this._zoomFactor&&0<e&&this._viewer.viewport.zoomTo(e*this.imgWidth/this.getViewerContainerSize().x,new n.a.Point(i.x,i.y/this.imgAspectRatio),t)},i.ImagingHelper.prototype.zoomInAboutLogicalPoint=function(e,i){var t=this._zoomFactor;(t*=1+this._zoomStepPercent/100)>this._maxZoom&&(t=this._maxZoom),this.zoomAboutLogicalPoint(t,e,i)},i.ImagingHelper.prototype.zoomOutAboutLogicalPoint=function(e,i){var t=this._zoomFactor;(t/=1+this._zoomStepPercent/100)<this._minZoom&&(t=this._minZoom),this.zoomAboutLogicalPoint(t,e,i)},i.ImagingHelper.prototype.centerAboutLogicalPoint=function(e,i){this._haveImage&&(this._viewportCenter.x!==e.x||this._viewportCenter.y!==e.y)&&this._viewer.viewport.panTo(new n.a.Point(e.x,e.y/this.imgAspectRatio),i)},i.ImagingHelper.prototype.physicalToLogicalPoint=function(e){return new n.a.Point(this.physicalToLogicalX(e.x),this.physicalToLogicalY(e.y))},i.ImagingHelper.prototype.logicalToPhysicalPoint=function(e){return new n.a.Point(this.logicalToPhysicalX(e.x),this.logicalToPhysicalY(e.y))},i.ImagingHelper.prototype.physicalToLogicalX=function(e){return this._haveImage?this._viewportOrigin.x+e/this.getViewerContainerSize().x*this._viewportWidth:0},i.ImagingHelper.prototype.physicalToLogicalY=function(e){return this._haveImage?this._viewportOrigin.y+e/this.getViewerContainerSize().y*this._viewportHeight:0},i.ImagingHelper.prototype.logicalToPhysicalX=function(e){return this._haveImage?(e-this._viewportOrigin.x)/this._viewportWidth*this.getViewerContainerSize().x:0},i.ImagingHelper.prototype.logicalToPhysicalY=function(e){return this._haveImage?(e-this._viewportOrigin.y)/this._viewportHeight*this.getViewerContainerSize().y:0},i.ImagingHelper.prototype.physicalToLogicalDistance=function(e){return this._haveImage?e/this.getViewerContainerSize().x*this._viewportWidth:0},i.ImagingHelper.prototype.logicalToPhysicalDistance=function(e){return this._haveImage?e/this._viewportWidth*this.getViewerContainerSize().x:0},i.ImagingHelper.prototype.logicalToDataPoint=function(e){return new n.a.Point(this.logicalToDataX(e.x),this.logicalToDataY(e.y))},i.ImagingHelper.prototype.dataToLogicalPoint=function(e){return new n.a.Point(this.dataToLogicalX(e.x),this.dataToLogicalY(e.y))},i.ImagingHelper.prototype.physicalToDataPoint=function(e){return 1===this._viewer.world.getItemCount()?new n.a.Point(this.physicalToDataX(e.x),this.physicalToDataY(e.y)):this._viewer.world.getItemAt(this._worldIndex).viewerElementToImageCoordinates(e)},i.ImagingHelper.prototype.dataToPhysicalPoint=function(e){return new n.a.Point(this.dataToPhysicalX(e.x),this.dataToPhysicalY(e.y))},i.ImagingHelper.prototype.logicalToDataX=function(e){return this._haveImage?e*this.imgWidth:0},i.ImagingHelper.prototype.logicalToDataY=function(e){return this._haveImage?e*this.imgHeight:0},i.ImagingHelper.prototype.dataToLogicalX=function(e){return this._haveImage&&0<this.imgWidth?e/this.imgWidth:0},i.ImagingHelper.prototype.dataToLogicalY=function(e){return this._haveImage&&0<this.imgHeight?e/this.imgHeight:0},i.ImagingHelper.prototype.physicalToDataX=function(e){return 1===this._viewer.world.getItemCount()?this._haveImage&&0<this.getViewerContainerSize().x?(this._viewportOrigin.x+e/this.getViewerContainerSize().x*this._viewportWidth)*this.imgWidth:0:this._viewer.world.getItemAt(this._worldIndex).viewerElementToImageCoordinates(new n.a.Point(e,0)).x},i.ImagingHelper.prototype.physicalToDataY=function(e){return 1===this._viewer.world.getItemCount()?this._haveImage&&0<this.getViewerContainerSize().y?(this._viewportOrigin.y+e/this.getViewerContainerSize().y*this._viewportHeight)*this.imgHeight:0:this._viewer.world.getItemAt(this._worldIndex).viewerElementToImageCoordinates(new n.a.Point(0,e)).y},i.ImagingHelper.prototype.dataToPhysicalX=function(e){return this._haveImage&&0<this.imgWidth?(e/this.imgWidth-this._viewportOrigin.x)/this._viewportWidth*this.getViewerContainerSize().x:0},i.ImagingHelper.prototype.dataToPhysicalY=function(e){return this._haveImage&&0<this.imgHeight?(e/this.imgHeight-this._viewportOrigin.y)/this._viewportHeight*this.getViewerContainerSize().y:0},i.ImagingHelper.prototype.onOpen=function(){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()},i.ImagingHelper.prototype.onClose=function(){this._haveImage=!1,this.imgWidth=0,this.imgHeight=0,this.imgAspectRatio=0},i.ImagingHelper.prototype.onAnimation=function(){this._trackZoomPan()},i.ImagingHelper.prototype.onAnimationFinish=function(){this._trackZoomPan()},i.ImagingHelper.prototype.onResize=function(){this._viewer.autoResize&&this._trackZoomPan()},i.ImagingHelper.prototype.onFullPage=function(){this._trackZoomPan()},i.ImagingHelper.prototype.onFullScreen=function(){this._trackZoomPan()},i.ImagingHelper}(n.a||window.OpenSeadragon,window.OpenSeadragonImaging=window.OpenSeadragonImaging||{})}]).default}));
//# sourceMappingURL=openseadragon-imaginghelper.js.map
{
"name": "@openseadragon-imaging/openseadragon-imaginghelper",
"version": "2.1.1",
"publishConfig": {
"access": "public"
},
"description": "OpenSeadragon plugin which adds helper properties/methods for imaging applications.",
"license": "MIT",
"private": false,
"author": {
"name": "Mark Salsbery",
"email": "msalsbery@hotmail.com"
},
"contributors": [],
"main": "dist/openseadragon-imaginghelper.js",
"homepage": "https://github.com/openseadragon-imaging/openseadragon-imaginghelper",
"repository": {
"type": "git",
"url": "https://github.com/openseadragon-imaging/openseadragon-imaginghelper.git"
},
"bugs": "https://github.com/openseadragon-imaging/openseadragon-imaginghelper/issues",
"keywords": [
"openseadragon",
"openseadragonimaging",
"openseadragon plugin"
],
"engines": {
"node": ">= 10.0.0",
"npm": ">= 6.0.0"
},
"dependencies": {},
"devDependencies": {
"@babel/cli": "^7.6.4",
"@babel/core": "^7.6.4",
"@babel/preset-env": "^7.6.3",
"@babel/preset-react": "^7.6.3",
"babel-loader": "^8.0.6",
"babel-minify-webpack-plugin": "^0.3.1",
"clean-webpack-plugin": "^3.0.0",
"core-js": "3.3.5",
"css-loader": "^3.2.0",
"eslint": "^6.6.0",
"eslint-loader": "^3.0.2",
"fibers": "4.0.2",
"jsdoc": "^3.6.3",
"node-sass": "^4.13.0",
"regenerator-runtime": "0.13.3",
"sass": "^1.23.3",
"sass-loader": "^8.0.0",
"string-replace-loader": "^2.2.0",
"style-loader": "^1.0.0",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.9",
"webpack-merge": "^4.2.2"
},
"peerDependencies": {
"openseadragon": "2.x"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "webpack --config webpack.dev.js",
"build": "webpack --config webpack.prod.js",
"doc": ".\\node_modules\\.bin\\jsdoc -c doc-conf.json"
}
"name": "@openseadragon-imaging/openseadragon-imaginghelper",
"version": "2.2.0",
"publishConfig": {
"access": "public"
},
"description": "OpenSeadragon plugin which adds helper properties/methods for imaging applications.",
"license": "MIT",
"private": false,
"author": {
"name": "Mark Salsbery",
"email": "msalsbery@hotmail.com",
"url": "https://github.com/msalsbery"
},
"contributors": [
{
"name": "Ryan Birmingham"
},
{
"name": "Ian Gilman"
},
{
"name": "Dima Savchenko"
}
],
"main": "dist/openseadragon-imaginghelper.js",
"homepage": "https://github.com/openseadragon-imaging/openseadragon-imaginghelper#readme",
"repository": {
"type": "git",
"url": "https://github.com/openseadragon-imaging/openseadragon-imaginghelper.git"
},
"bugs": "https://github.com/openseadragon-imaging/openseadragon-imaginghelper/issues",
"keywords": [
"openseadragon",
"openseadragonimaging",
"deep",
"zoom",
"dzi",
"plugin"
],
"engines": {
"node": ">= 10.0.0",
"npm": ">= 6.0.0"
},
"dependencies": {},
"devDependencies": {
"@babel/cli": "^7.10.4",
"@babel/core": "^7.10.4",
"@babel/preset-env": "^7.10.4",
"@babel/preset-react": "^7.10.4",
"babel-loader": "^8.1.0",
"babel-minify-webpack-plugin": "^0.3.1",
"clean-webpack-plugin": "^3.0.0",
"core-js": "3.6.5",
"css-loader": "^3.6.0",
"eslint": "^7.3.1",
"eslint-config-prettier": "^6.11.0",
"eslint-loader": "^4.0.2",
"eslint-plugin-compat": "^3.8.0",
"eslint-plugin-prettier": "^3.1.4",
"execa": "^4.0.2",
"fibers": "5.0.0",
"jsdoc": "^3.6.4",
"node-sass": "^4.14.1",
"prettier": "2.0.5",
"regenerator-runtime": "0.13.5",
"sass": "^1.26.9",
"sass-loader": "^8.0.2",
"string-replace-loader": "^2.3.0",
"style-loader": "^1.2.1",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.12",
"webpack-merge": "^4.2.2"
},
"peerDependencies": {
"openseadragon": "2.x"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "webpack --config webpack.dev.js",
"build": "webpack --config webpack.prod.js",
"watch": "webpack --watch --config webpack.dev.js --info-verbosity verbose",
"doc": "npm run dev && jsdoc -c doc-conf.json",
"lint": "eslint **/*",
"lint-fix": "eslint --fix **/*",
"prettier": "prettier --check \"**/*\"",
"prettier-fix": "prettier --write \"**/*\""
}
}
## OpenSeadragonImagingHelper
[![Gitter](https://badges.gitter.im/Join_Chat.svg)](https://gitter.im/msalsbery/OpenSeadragonImaging?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Gitter](https://badges.gitter.im/openseadragon-imaging/community.svg)](https://gitter.im/openseadragon-imaging/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
OpenSeadragonImagingHelper is a plugin for [OpenSeadragon](https://github.com/openseadragon/openseadragon)

@@ -20,2 +21,3 @@ which implements some properties and methods helpful in

2. npm
```

@@ -29,3 +31,2 @@ npm install @openseadragon-imaging/openseadragon-imaginghelper

1. Call the activateImagingHelper method on the viewer

@@ -38,6 +39,14 @@ 2. Create a new ImagingHelper object, passing a viewer reference in the options parameter

**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>
<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

@@ -58,2 +67,3 @@ // Example 1 - Use the Viewer.activateImagingHelper() method to create an ImagingHelper

**Example importing as a module**
```

@@ -63,2 +73,3 @@ npm install openseadragon --save

```
```javascript

@@ -91,6 +102,5 @@ import OpenSeadragon from 'openseadragon';

1. **physical:** Device pixel coordinates relative to the SeaDragon viewer
2. **logical:** 0.0 to 1.0 relative to the image's native dimensions
3. **data:** Pixel coordinates relative to the image's native dimensions
2. **logical:** 0.0 to 1.0 relative to the image's native dimensions
3. **data:** Pixel coordinates relative to the image's native dimensions

@@ -147,3 +157,2 @@ Methods are provided to zoom and/or pan using these conventions, as well as to convert

1) Better multi-image support
1. Better multi-image support

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