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

template.js.flot.jquery.flot.navigate.min.js Maven / Gradle / Ivy

'use strict';(function(m){function D(b,E){function D(a,c,e){var d=x.getPageXY(a);a=b.offset();a.left=d.X-a.left;a.top=d.Y-a.top;var f=b.getPlaceholder().offset();f.left=d.X-f.left;f.top=d.Y-f.top;d=b.getXAxes().concat(b.getYAxes()).filter(function(a){a=a.box;if(void 0!==a)return f.left>a.left&&f.lefta.top&&f.top=Math.abs(a.originalEvent.deltaY)?
1+Math.abs(a.originalEvent.deltaY)/50:null;w&&y(a);if(b.getOptions().zoom.active)return a.preventDefault(),D(a,0>c,e),!1}function I(a){F=!0}function J(a){F=!1}function K(a){if(!F||0!==a.button)return!1;w=!0;a=x.getPageXY(a);var c=b.getPlaceholder().offset();c.left=a.X-c.left;c.top=a.Y-c.top;l=b.getXAxes().concat(b.getYAxes()).filter(function(a){a=a.box;if(void 0!==a)return c.left>a.left&&c.lefta.top&&c.topf)var l=k,k=f,f=l;if(e.zoomRange){if(f-ke.zoomRange[1])continue}k=m.plot.saturated.saturate(g.below-(d.min-k));d=m.plot.saturated.saturate(g.above-(d.max-f));e.offset={below:k,above:d}}b.setupGrid(!0);b.draw();a.preventEvent||b.getPlaceholder().trigger("plotzoom",
[b,a])};b.pan=function(a){var c={x:+a.left,y:+a.top};isNaN(c.x)&&(c.x=0);isNaN(c.y)&&(c.y=0);m.each(a.axes||b.getAxes(),function(b,d){b=d.options;var e=c[d.direction];if((b.axisPan||!a.axes)&&(b.plotPan||a.axes)){var t=d.p2c(b.panRange[0])-d.p2c(d.min),g=d.p2c(b.panRange[1])-d.p2c(d.max);void 0!==b.panRange[0]&&e>=g&&(e=g);void 0!==b.panRange[1]&&e<=t&&(e=t);0!==e&&(t=v.saturate(d.c2p(d.p2c(d.min)+e)-d.c2p(d.p2c(d.min))),d=v.saturate(d.c2p(d.p2c(d.max)+e)-d.c2p(d.p2c(d.max))),isFinite(t)||(t=0),isFinite(d)||
(d=0),b.offset={below:v.saturate(t+(b.offset.below||0)),above:v.saturate(d+(b.offset.above||0))})}});b.setupGrid(!0);b.draw();a.preventEvent||b.getPlaceholder().trigger("plotpan",[b,a])};b.recenter=function(a){m.each(a.axes||b.getAxes(),function(c,b){a.axes?"x"===this.direction?b.options.offset={below:0}:"y"===this.direction&&(b.options.offset={above:0}):b.options.offset={below:0,above:0}});b.setupGrid(!0);b.draw()};var C=null,P=function(a){!C&&Math.max(Math.abs(a.x),Math.abs(a.y))>=u&&(C=Math.abs(a.x)<
Math.abs(a.y)?"y":"x");switch(C){case "x":return{x:a.x,y:0};case "y":return{x:0,y:a.y};default:return{x:0,y:0}}},Q=function(a,c,b){var d;Object.keys(a).forEach(function(e){d=a[e];0===b[d.direction]&&(d.options.offset.below=c[e].navigationOffset.below,d.options.offset.above=c[e].navigationOffset.above)})},G={x:0,y:0};b.smartPan=function(a,c,e,d,f){var g=f?!0:Math.abs(a.y)=u||Math.abs(a.x)=u,l=b.getAxes(),k;f=f?P(a):Math.abs(a.x)=u?{x:0,y:a.y}:Math.abs(a.y)<
u&&Math.abs(a.x)>=u?{x:a.x,y:0}:a;a=f;f=0=b&&(n=b);void 0!==k.panRange[1]&&n<=c&&(n=c);0!==n&&(c=v.saturate(h.c2p(h.p2c(m)-(q-n))-h.c2p(h.p2c(m))),b=v.saturate(h.c2p(h.p2c(p)-(q-n))-h.c2p(h.p2c(p))),isFinite(c)||(c=0),isFinite(b)||(b=0),h.options.offset.below=
v.saturate(c+(h.options.offset.below||0)),h.options.offset.above=v.saturate(b+(h.options.offset.above||0)))}});G=a;b.setupGrid(!0);b.draw();d||b.getPlaceholder().trigger("plotpan",[b,a,e,c])};b.smartPan.end=function(){C=r=null;G={x:0,y:0};b.triggerRedrawOverlay()};b.getTouchedAxis=function(a,c){var e=b.getPlaceholder().offset();e.left=a-e.left;e.top=c-e.top;return b.getXAxes().concat(b.getYAxes()).filter(function(a){a=a.box;if(void 0!==a)return e.left>a.left&&e.lefta.top&&e.top<
a.top+a.height})};b.hooks.drawOverlay.push(function(a,c){if(r){c.strokeStyle="rgba(96, 160, 208, 0.7)";c.lineWidth=2;c.lineJoin="round";a=Math.round(r.start.x);var b=Math.round(r.start.y),d,f;l?"x"===l[0].direction?(f=Math.round(r.start.y),d=Math.round(r.end.x)):"y"===l[0].direction&&(d=Math.round(r.start.x),f=Math.round(r.end.y)):(d=Math.round(r.end.x),f=Math.round(r.end.y));c.beginPath();if(!1===r.end)c.moveTo(a,b-p),c.lineTo(a,b+p),c.moveTo(a+p,b),c.lineTo(a-p,b);else{var g=b===f;c.moveTo(a-(g?
0:p),b-(g?p:0));c.lineTo(a+(g?0:p),b+(g?p:0));c.moveTo(a,b);c.lineTo(d,f);c.moveTo(d-(g?0:p),f-(g?p:0));c.lineTo(d+(g?0:p),f+(g?p:0))}c.stroke()}});b.hooks.bindEvents.push(function(a,b){var c=a.getOptions();c.zoom.interactive&&b.mousewheel(H);c.pan.interactive&&(a.addEventHandler("dragstart",K,b,0),a.addEventHandler("drag",M,b,0),a.addEventHandler("dragend",y,b,0),b.bind("mousedown",I),b.bind("mouseup",J));b.dblclick(N);b.click(O)});b.hooks.shutdown.push(function(a,b){b.unbind("mousewheel",H);b.unbind("mousedown",
I);b.unbind("mouseup",J);b.unbind("dragstart",K);b.unbind("drag",M);b.unbind("dragend",y);b.unbind("dblclick",N);b.unbind("click",O);n&&clearTimeout(n)})}var v=m.plot.saturated,x=m.plot.browser,u=m.plot.uiConstants.SNAPPING_CONSTANT,p=m.plot.uiConstants.PANHINT_LENGTH_CONSTANT;m.plot.plugins.push({init:function(b){b.hooks.processOptions.push(D)},options:{zoom:{interactive:!1,active:!1,amount:1.5},pan:{interactive:!1,active:!1,cursor:"move",frameRate:60,mode:"smart"},recenter:{interactive:!0},xaxis:{axisZoom:!0,
plotZoom:!0,axisPan:!0,plotPan:!0,panRange:[void 0,void 0],zoomRange:[void 0,void 0]},yaxis:{axisZoom:!0,plotZoom:!0,axisPan:!0,plotPan:!0,panRange:[void 0,void 0],zoomRange:[void 0,void 0]}},name:"navigate",version:"1.3"})})(jQuery);




© 2015 - 2025 Weber Informatics LLC | Privacy Policy