All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.modules.mouse-wheel-zoom.js Maven / Gradle / Ivy

The newest version!
!/**
 * Highcharts JS v11.4.8 (2024-08-29)
 *
 * Mousewheel zoom module
 *
 * (c) 2023 Askel Eirik Johansson
 *
 * License: www.highcharts.com/license
 */function(e){"object"==typeof module&&module.exports?(e.default=e,module.exports=e):"function"==typeof define&&define.amd?define("highcharts/modules/mouse-wheel-zoom",["highcharts"],function(t){return e(t),e.Highcharts=t,e}):e("undefined"!=typeof Highcharts?Highcharts:void 0)}(function(e){"use strict";var t=e?e._modules:{};function i(t,i,o,n){t.hasOwnProperty(i)||(t[i]=n.apply(null,o),"function"==typeof CustomEvent&&e.win.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:i,module:t[i]}})))}i(t,"Extensions/Annotations/NavigationBindingsUtilities.js",[t["Core/Utilities.js"]],function(e){let{defined:t,isNumber:i,pick:o}=e,n={backgroundColor:"string",borderColor:"string",borderRadius:"string",color:"string",fill:"string",fontSize:"string",labels:"string",name:"string",stroke:"string",title:"string"};return{annotationsFieldsTypes:n,getAssignedAxis:function(e){return e.filter(e=>{let t=e.axis.getExtremes(),n=t.min,s=t.max,r=o(e.axis.minPointOffset,0);return i(n)&&i(s)&&e.value>=n-r&&e.value<=s+r&&!e.axis.options.isInternal})[0]},getFieldType:function(e,i){let o=n[e],s=typeof i;return t(o)&&(s=o),({string:"text",number:"number",boolean:"checkbox"})[s]}}}),i(t,"Extensions/MouseWheelZoom/MouseWheelZoom.js",[t["Core/Utilities.js"],t["Extensions/Annotations/NavigationBindingsUtilities.js"]],function(e,t){let i;let{addEvent:o,isObject:n,pick:s,defined:r,merge:l}=e,{getAssignedAxis:a}=t,u=[],h={enabled:!0,sensitivity:1.1},m=e=>(n(e)||(e={enabled:e??!0}),l(h,e)),d=function(e,t,o,n,l,a,u){let h=s(u.type,e.zooming.type,""),m=[];"x"===h?m=o:"y"===h?m=n:"xy"===h&&(m=e.axes);let d=e.transform({axes:m,to:{x:l-5,y:a-5,width:10,height:10},from:{x:l-5*t,y:a-5*t,width:10*t,height:10*t},trigger:"mousewheel"});return d&&(r(i)&&clearTimeout(i),i=setTimeout(()=>{e.pointer?.drop()},400)),d};function c(){let e=m(this.zooming.mouseWheel);e.enabled&&o(this.container,"wheel",t=>{t=this.pointer?.normalize(t)||t;let{pointer:i}=this,o=i&&!i.inClass(t.target,"highcharts-no-mousewheel");if(this.isInsidePlot(t.chartX-this.plotLeft,t.chartY-this.plotTop)&&o){let o=e.sensitivity||1.1,n=t.detail||(t.deltaY||0)/120,s=a(i.getCoordinates(t).xAxis),r=a(i.getCoordinates(t).yAxis);d(this,Math.pow(o,n),s?[s.axis]:this.xAxis,r?[r.axis]:this.yAxis,t.chartX,t.chartY,e)&&t.preventDefault?.()}})}return{compose:function(e){-1===u.indexOf(e)&&(u.push(e),o(e,"afterGetContainer",c))}}}),i(t,"masters/modules/mouse-wheel-zoom.src.js",[t["Core/Globals.js"],t["Extensions/MouseWheelZoom/MouseWheelZoom.js"]],function(e,t){return e.MouseWheelZoom=e.MouseWheelZoom||t,e.MouseWheelZoom.compose(e.Chart),e})});




© 2015 - 2024 Weber Informatics LLC | Privacy Policy