src/pyams_skin/resources/js/ext/flot/jquery.flot.hover.min.js
changeset 557 bca7a7e058a3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/flot/jquery.flot.hover.min.js	Thu Feb 13 11:43:31 2020 +0100
@@ -0,0 +1,1 @@
+!function(e){"use strict";var t=e.plot.browser,i={click:"click",hover:"hover"};e.plot.plugins.push({init:function(o){function r(e){var t=o.getOptions(),r=new CustomEvent("mouseevent");return r.pageX=e.detail.changedTouches[0].pageX,r.pageY=e.detail.changedTouches[0].pageY,r.clientX=e.detail.changedTouches[0].clientX,r.clientY=e.detail.changedTouches[0].clientY,t.grid.hoverable&&a(r,i.hover,30),!1}function a(e,t,i){var r=o.getData();if(void 0!==e&&r.length>0&&void 0!==r[0].xaxis.c2p&&void 0!==r[0].yaxis.c2p){var a=t+"able";h("plot"+t,e,function(e){return!1!==r[e][a]},i)}}function n(e){y=e,o.getPlaceholder()[0].lastMouseMoveEvent=e,a(e,i.hover)}function s(e){y=void 0,o.getPlaceholder()[0].lastMouseMoveEvent=void 0,h("plothover",e,function(e){return!1})}function l(e){a(e,i.click)}function c(){o.unhighlight(),o.getPlaceholder().trigger("plothovercleanup")}function h(e,i,r,a){var n=o.getOptions(),s=o.offset(),l=t.getPageXY(i),c=l.X-s.left,h=l.Y-s.top,g=o.c2p({left:c,top:h}),d=void 0!==a?a:n.grid.mouseActiveRadius;g.pageX=l.X,g.pageY=l.Y;var v=o.findNearbyItem(c,h,r,d);if(v&&(v.pageX=parseInt(v.series.xaxis.p2c(v.datapoint[0])+s.left,10),v.pageY=parseInt(v.series.yaxis.p2c(v.datapoint[1])+s.top,10)),n.grid.autoHighlight){for(var f=0;f<k.length;++f){var b=k[f];(b.auto!==e||v&&b.series===v.series&&b.point[0]===v.datapoint[0]&&b.point[1]===v.datapoint[1])&&v||u(b.series,b.point)}v&&p(v.series,v.datapoint,e)}o.getPlaceholder().trigger(e,[g,v])}function p(e,t,i){if("number"==typeof e&&(e=o.getData()[e]),"number"==typeof t){var r=e.datapoints.pointsize;t=e.datapoints.points.slice(r*t,r*(t+1))}var a=g(e,t);-1===a?(k.push({series:e,point:t,auto:i}),o.triggerRedrawOverlay()):i||(k[a].auto=!1)}function u(e,t){if(null==e&&null==t)return k=[],void o.triggerRedrawOverlay();if("number"==typeof e&&(e=o.getData()[e]),"number"==typeof t){var i=e.datapoints.pointsize;t=e.datapoints.points.slice(i*t,i*(t+1))}var r=g(e,t);-1!==r&&(k.splice(r,1),o.triggerRedrawOverlay())}function g(e,t){for(var i=0;i<k.length;++i){var o=k[i];if(o.series===e&&o.point[0]===t[0]&&o.point[1]===t[1])return i}return-1}function d(){c(),a(y,i.hover)}function v(){a(y,i.hover)}function f(e,t,i){var o,r,a=e.getPlotOffset();for(t.save(),t.translate(a.left,a.top),o=0;o<k.length;++o)(r=k[o]).series.bars.show?m(r.series,r.point,t):b(r.series,r.point,t,e);t.restore()}function b(t,i,o,r){var a=i[0],n=i[1],s=t.xaxis,l=t.yaxis,c="string"==typeof t.highlightColor?t.highlightColor:e.color.parse(t.color).scale("a",.5).toString();if(!(a<s.min||a>s.max||n<l.min||n>l.max)){var h=t.points.radius+t.points.lineWidth/2;o.lineWidth=h,o.strokeStyle=c;var p=1.5*h;a=s.p2c(a),n=l.p2c(n),o.beginPath();var u=t.points.symbol;"circle"===u?o.arc(a,n,p,0,2*Math.PI,!1):"string"==typeof u&&r.drawSymbol&&r.drawSymbol[u]&&r.drawSymbol[u](o,a,n,p,!1),o.closePath(),o.stroke()}}function m(t,i,o){var r,a="string"==typeof t.highlightColor?t.highlightColor:e.color.parse(t.color).scale("a",.5).toString(),n=a,s=t.bars.barWidth[0]||t.bars.barWidth;switch(t.bars.align){case"left":r=0;break;case"right":r=-s;break;default:r=-s/2}o.lineWidth=t.bars.lineWidth,o.strokeStyle=a;var l=t.bars.fillTowards||0,c=l>t.yaxis.min?Math.min(t.yaxis.max,l):t.yaxis.min;e.plot.drawSeries.drawBar(i[0],i[1],i[2]||c,r,r+s,function(){return n},t.xaxis,t.yaxis,o,t.bars.horizontal,t.bars.lineWidth)}var y,k=[];o.hooks.bindEvents.push(function(e,t){var i=e.getOptions();(i.grid.hoverable||i.grid.clickable)&&(t[0].addEventListener("touchevent",c,!1),t[0].addEventListener("tap",r,!1)),i.grid.clickable&&t.bind("click",l),i.grid.hoverable&&(t.bind("mousemove",n),t.bind("mouseleave",s))}),o.hooks.shutdown.push(function(e,t){t[0].removeEventListener("tap",r),t[0].removeEventListener("touchevent",c),t.unbind("mousemove",n),t.unbind("mouseleave",s),t.unbind("click",l),k=[]}),o.hooks.processOptions.push(function(e,t){e.highlight=p,e.unhighlight=u,(t.grid.hoverable||t.grid.clickable)&&(e.hooks.drawOverlay.push(f),e.hooks.processDatapoints.push(d),e.hooks.setupGrid.push(v)),y=e.getPlaceholder()[0].lastMouseMoveEvent})},options:{grid:{hoverable:!1,clickable:!1}},name:"hover",version:"0.1"})}(jQuery);