UNPKG

highcharts

Version:
13 lines 3.33 kB
!/** * Highcharts JS v13.0.1 (2026-08-17) * @module highcharts/modules/mouse-wheel-zoom * @requires highcharts * * Mousewheel zoom module * * (c) 2023-2026 Highsoft AS * Author: Askel Eirik Johansson * * A commercial license may be required depending on use, * see www.highcharts.com/license */function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(e._Highcharts):"function"==typeof define&&define.amd?define("highcharts/modules/mouse-wheel-zoom",["highcharts/highcharts"],function(e){return t(e)}):"object"==typeof exports?exports["highcharts/modules/mouse-wheel-zoom"]=t(e._Highcharts):e.Highcharts=t(e.Highcharts)}("u"<typeof window?this:window,e=>(()=>{"use strict";let t;var o={944(t){t.exports=e}};let r={};function i(e){let t=r[e];if(void 0!==t)return t.exports;let n=r[e]={exports:{}};return o[e](n,n.exports,i),n.exports}i.n=e=>{let t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{if(Array.isArray(t))for(var o=0;o<t.length;){var r=t[o++],n=t[o++];i.o(e,r)?0===n&&o++:0===n?Object.defineProperty(e,r,{enumerable:!0,value:t[o++]}):Object.defineProperty(e,r,{enumerable:!0,get:n})}else for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);let n={};i.d(n,{default:()=>m});var s=i(944),l=i.n(s);let a={backgroundColor:"color",backgroundColors:"color",borderColor:"color",borderRadius:"string",color:"color",fill:"color",fontSize:"string",labels:"string",name:"string",stroke:"color",title:"string"},{getAssignedAxis:h}={annotationsFieldsTypes:a,getAssignedAxis:function(e){return e.filter(e=>{let t=e.axis.getExtremes(),o=t.min,r=t.max,i=(0,s.pick)(e.axis.minPointOffset,0);return(0,s.isNumber)(o)&&(0,s.isNumber)(r)&&e.value>=o-i&&e.value<=r+i&&!e.axis.options.isInternal})[0]},getAxisFromOptions:function(e,t,o){return(0,s.isNumber)(o)?e[t][o]:(0,s.defined)(o)?(0,s.find)(e[t],e=>e.options.id===o):void 0},getFieldType:function(e,t){let o=a[e],r=typeof t;return(0,s.defined)(o)&&(r=o),({string:"text",number:"number",boolean:"checkbox",color:"color"})[r]}},u=[],d={enabled:!0,sensitivity:1.1,showResetButton:!1},c=function(e,o,r,i,n,l,a){let h=(0,s.pick)(a.type,e.zooming.type,""),u=[];"x"===h?u=r:"y"===h?u=i:"xy"===h&&(u=e.axes);let d=e.transform({axes:u,to:{x:n-5,y:l-5,width:10,height:10},from:{x:n-5*o,y:l-5*o,width:10*o,height:10*o},trigger:"mousewheel",allowResetButton:a.showResetButton});return d&&((0,s.defined)(t)&&(0,s.internalClearTimeout)(t),t=setTimeout(()=>{e.pointer?.drop()},400)),d};function f(){var e;let t=(e=this.zooming.mouseWheel,(0,s.isObject)(e)||(e={enabled:e??!0}),(0,s.merge)(d,e));t.enabled&&(0,s.addEvent)(this.container,"wheel",e=>{e=this.pointer?.normalize(e)||e;let{pointer:o}=this,r=o&&!o.inClass(e.target,"highcharts-no-mousewheel");if(this.isInsidePlot(e.chartX-this.plotLeft,e.chartY-this.plotTop)&&r){let r=t.sensitivity||1.1,i=e.detail||(e.deltaY||0)/120,n=h(o.getCoordinates(e).xAxis),s=h(o.getCoordinates(e).yAxis);c(this,Math.pow(r,i),n?[n.axis]:this.xAxis,s?[s.axis]:this.yAxis,e.chartX,e.chartY,t)&&e.preventDefault?.()}})}let p=l();p.MouseWheelZoom=p.MouseWheelZoom||{compose:function(e){-1===u.indexOf(e)&&(u.push(e),(0,s.addEvent)(e,"afterGetContainer",f))}},p.MouseWheelZoom.compose(p.Chart);let m=l();return n.default})());