src/pyams_skin/resources/js/ext/flot/jquery.flot.axislabels.min.js
changeset 566 a1707c607eec
parent 565 318533413200
child 567 bca1726b1d85
--- a/src/pyams_skin/resources/js/ext/flot/jquery.flot.axislabels.min.js	Sun Jul 19 02:02:20 2020 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-!function(t){"use strict";function i(t,i,e,s,a,h){this.axisName=t,this.position=i,this.padding=e,this.placeholder=s,this.axisLabel=a,this.surface=h,this.width=0,this.height=0,this.elem=null}i.prototype.calculateSize=function(){var t=this.axisName+"Label",i=t+"Layer",e=t+" axisLabels",s=this.surface.getTextInfo(i,this.axisLabel,e);this.labelWidth=s.width,this.labelHeight=s.height,"left"===this.position||"right"===this.position?(this.width=this.labelHeight+this.padding,this.height=0):(this.width=0,this.height=this.labelHeight+this.padding)},i.prototype.transforms=function(t,i,e,s){var a,h,o=[];if(0===i&&0===e||((a=s.createSVGTransform()).setTranslate(i,e),o.push(a)),0!==t){h=s.createSVGTransform();var n=Math.round(this.labelWidth/2);h.setRotate(t,n,0),o.push(h)}return o},i.prototype.calculateOffsets=function(t){var i={x:0,y:0,degrees:0};return"bottom"===this.position?(i.x=t.left+t.width/2-this.labelWidth/2,i.y=t.top+t.height-this.labelHeight):"top"===this.position?(i.x=t.left+t.width/2-this.labelWidth/2,i.y=t.top):"left"===this.position?(i.degrees=-90,i.x=t.left-this.labelWidth/2,i.y=t.height/2+t.top):"right"===this.position&&(i.degrees=90,i.x=t.left+t.width-this.labelWidth/2,i.y=t.height/2+t.top),i.x=Math.round(i.x),i.y=Math.round(i.y),i},i.prototype.cleanup=function(){var t=this.axisName+"Label",i=t+"Layer",e=t+" axisLabels";this.surface.removeText(i,0,0,this.axisLabel,e)},i.prototype.draw=function(t){var i=this.axisName+"Label",e=i+"Layer",s=i+" axisLabels",a=this.calculateOffsets(t),h={position:"absolute",bottom:"",right:"",display:"inline-block","white-space":"nowrap"},o=this.surface.getSVGLayer(e),n=this.transforms(a.degrees,a.x,a.y,o.parentNode);this.surface.addText(e,0,0,this.axisLabel,s,void 0,void 0,void 0,void 0,n),this.surface.render(),Object.keys(h).forEach(function(t){o.style[t]=h[t]})},t.plot.plugins.push({init:function(e){e.hooks.processOptions.push(function(e,s){if(s.axisLabels.show){var a={};e.hooks.axisReserveSpace.push(function(t,e){var s=e.options,h=e.direction+e.n;if(e.labelHeight+=e.boxPosition.centerY,e.labelWidth+=e.boxPosition.centerX,s&&s.axisLabel&&e.show){var o=void 0===s.axisLabelPadding?2:s.axisLabelPadding,n=a[h];n||(n=new i(h,s.position,o,t.getPlaceholder()[0],s.axisLabel,t.getSurface()),a[h]=n),n.calculateSize(),e.labelHeight+=n.height,e.labelWidth+=n.width}}),e.hooks.draw.push(function(i,e){t.each(i.getAxes(),function(t,i){var e=i.options;if(e&&e.axisLabel&&i.show){var s=i.direction+i.n;a[s].draw(i.box)}})}),e.hooks.shutdown.push(function(t,i){for(var e in a)a[e].cleanup()})}})},options:{axisLabels:{show:!0}},name:"axisLabels",version:"3.0"})}(jQuery);