Comparing version 1.2.11 to 1.2.12
@@ -98,2 +98,5 @@ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; | ||
}, | ||
beforeDestroy: function beforeDestroy() { | ||
delete this.gauge; | ||
}, | ||
watch: { | ||
@@ -264,7 +267,7 @@ value: function(newVal) { | ||
if (!inject) { return } | ||
inject("data-v-72870b86_0", { source: ".gauge-title span[data-v-72870b86]{display:inline;text-align:center}", map: undefined, media: undefined }); | ||
inject("data-v-1e740546_0", { source: ".gauge-title span[data-v-1e740546]{display:inline;text-align:center}", map: undefined, media: undefined }); | ||
}; | ||
/* scoped */ | ||
var __vue_scope_id__ = "data-v-72870b86"; | ||
var __vue_scope_id__ = "data-v-1e740546"; | ||
/* module identifier */ | ||
@@ -271,0 +274,0 @@ var __vue_module_identifier__ = undefined; |
@@ -1,1 +0,1 @@ | ||
var VGauge=function(t){"use strict";function i(t,i,e,s,n,o,a,r,h,l){"boolean"!=typeof a&&(h=r,r=a,a=!1);var u="function"==typeof e?e.options:e;t&&t.render&&(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,n&&(u.functional=!0)),s&&(u._scopeId=s);var p;if(o?(p=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,h(t)),t&&t._registeredComponents&&t._registeredComponents.add(o)},u._ssrRegister=p):i&&(p=a?function(){i.call(this,l(this.$root.$options.shadowRoot))}:function(t){i.call(this,r(t))}),p)if(u.functional){var c=u.render;u.render=function(t,i){return p.call(i),c(t,i)}}else{var d=u.beforeCreate;u.beforeCreate=d?[].concat(d,p):[p]}return e}function e(t){return function(t,i){return s(t,i)}}function s(t,i){var e=p?i.media||"default":t,s=d[e]||(d[e]={ids:new Set,styles:[]});if(!s.ids.has(t)){s.ids.add(t);var n=i.source;if(i.map&&(n+="\n/*# sourceURL="+i.map.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i.map))))+" */"),s.element||(s.element=document.createElement("style"),s.element.type="text/css",i.media&&s.element.setAttribute("media",i.media),c.appendChild(s.element)),"styleSheet"in s.element)s.styles.push(n),s.element.styleSheet.cssText=s.styles.filter(Boolean).join("\n");else{var o=s.ids.size-1,a=document.createTextNode(n),r=s.element.childNodes;r[o]&&s.element.removeChild(r[o]),r.length?s.element.insertBefore(a,r[o]):s.element.appendChild(a)}}}function n(t){n.installed||(n.installed=!0,t.component("VGauge",g))}var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},a=function(t,i){return i={exports:{}},t(i,i.exports),i.exports}(function(t){(function(){var i,e,s,n,o,a,r,h,l,u,p,c,d=[].slice,g={}.hasOwnProperty,f=function(t,i){function e(){this.constructor=t}for(var s in i)g.call(i,s)&&(t[s]=i[s]);return e.prototype=i.prototype,t.prototype=new e,t.__super__=i.prototype,t};!function(){var t,i,e,s,n,o,a;for(e=0,n=(a=["ms","moz","webkit","o"]).length;e<n&&(o=a[e],!window.requestAnimationFrame);e++)window.requestAnimationFrame=window[o+"RequestAnimationFrame"],window.cancelAnimationFrame=window[o+"CancelAnimationFrame"]||window[o+"CancelRequestAnimationFrame"];t=null,s=0,i={},requestAnimationFrame?window.cancelAnimationFrame||(t=window.requestAnimationFrame,window.requestAnimationFrame=function(e,n){var o;return o=++s,t(function(){if(!i[o])return e()},n),o},window.cancelAnimationFrame=function(t){return i[t]=!0}):(window.requestAnimationFrame=function(t,i){var e,s,n,o;return e=(new Date).getTime(),o=Math.max(0,16-(e-n)),s=window.setTimeout(function(){return t(e+o)},o),n=e+o,s},window.cancelAnimationFrame=function(t){return clearTimeout(t)})}(),c=function(t){var i,e;for(t-=3600*(i=Math.floor(t/3600))+60*(e=Math.floor((t-3600*i)/60)),t+="",e+="";e.length<2;)e="0"+e;for(;t.length<2;)t="0"+t;return(i=i?i+":":"")+e+":"+t},u=function(){var t,i,e;return i=1<=arguments.length?d.call(arguments,0):[],e=i[0],t=i[1],h(e.toFixed(t))},p=function(t,i){var e,s,n;s={};for(e in t)g.call(t,e)&&(n=t[e],s[e]=n);for(e in i)g.call(i,e)&&(n=i[e],s[e]=n);return s},h=function(t){var i,e,s,n;for(s=(e=(t+="").split("."))[0],n="",e.length>1&&(n="."+e[1]),i=/(\d+)(\d{3})/;i.test(s);)s=s.replace(i,"$1,$2");return s+n},l=function(t){return"#"===t.charAt(0)?t.substring(1,7):t},e=function(t){function i(){return i.__super__.constructor.apply(this,arguments)}return f(i,t),i.prototype.displayScale=1,i.prototype.forceUpdate=!0,i.prototype.setTextField=function(t,i){return this.textField=t instanceof a?t:new a(t,i)},i.prototype.setMinValue=function(t,i){var e,s,n,o,a;if(this.minValue=t,null==i&&(i=!0),i){for(this.displayedValue=this.minValue,a=[],s=0,n=(o=this.gp||[]).length;s<n;s++)e=o[s],a.push(e.displayedValue=this.minValue);return a}},i.prototype.setOptions=function(t){return null==t&&(t=null),this.options=p(this.options,t),this.textField&&(this.textField.el.style.fontSize=t.fontSize+"px"),this.options.angle>.5&&(this.options.angle=.5),this.configDisplayScale(),this},i.prototype.configDisplayScale=function(){var t,i,e,s,n;return s=this.displayScale,!1===this.options.highDpiSupport?delete this.displayScale:(i=window.devicePixelRatio||1,t=this.ctx.webkitBackingStorePixelRatio||this.ctx.mozBackingStorePixelRatio||this.ctx.msBackingStorePixelRatio||this.ctx.oBackingStorePixelRatio||this.ctx.backingStorePixelRatio||1,this.displayScale=i/t),this.displayScale!==s&&(n=this.canvas.G__width||this.canvas.width,e=this.canvas.G__height||this.canvas.height,this.canvas.width=n*this.displayScale,this.canvas.height=e*this.displayScale,this.canvas.style.width=n+"px",this.canvas.style.height=e+"px",this.canvas.G__width=n,this.canvas.G__height=e),this},i.prototype.parseValue=function(t){return t=parseFloat(t)||Number(t),isFinite(t)?t:0},i}(r=function(){function t(t,i){null==t&&(t=!0),this.clear=null==i||i,t&&AnimationUpdater.add(this)}return t.prototype.animationSpeed=32,t.prototype.update=function(t){var i;return null==t&&(t=!1),!(!t&&this.displayedValue===this.value||(this.ctx&&this.clear&&this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),i=this.value-this.displayedValue,Math.abs(i/this.animationSpeed)<=.001?this.displayedValue=this.value:this.displayedValue=this.displayedValue+i/this.animationSpeed,this.render(),0))},t}()),a=function(){function t(t,i){this.el=t,this.fractionDigits=i}return t.prototype.render=function(t){return this.el.innerHTML=u(t.displayedValue,this.fractionDigits)},t}(),function(t){function i(t,e){if(this.elem=t,this.text=null!=e&&e,i.__super__.constructor.call(this),void 0===this.elem)throw new Error("The element isn't defined.");this.value=1*this.elem.innerHTML,this.text&&(this.value=0)}f(i,t),i.prototype.displayedValue=0,i.prototype.value=0,i.prototype.setVal=function(t){return this.value=1*t},i.prototype.render=function(){var t;return t=this.text?c(this.displayedValue.toFixed(0)):h(u(this.displayedValue)),this.elem.innerHTML=t}}(r),o=function(t){function i(t){if(this.gauge=t,void 0===this.gauge)throw new Error("The element isn't defined.");this.ctx=this.gauge.ctx,this.canvas=this.gauge.canvas,i.__super__.constructor.call(this,!1,!1),this.setOptions()}return f(i,t),i.prototype.displayedValue=0,i.prototype.value=0,i.prototype.options={strokeWidth:.035,length:.1,color:"#000000",iconPath:null,iconScale:1,iconAngle:0},i.prototype.img=null,i.prototype.setOptions=function(t){if(null==t&&(t=null),this.options=p(this.options,t),this.length=2*this.gauge.radius*this.gauge.options.radiusScale*this.options.length,this.strokeWidth=this.canvas.height*this.options.strokeWidth,this.maxValue=this.gauge.maxValue,this.minValue=this.gauge.minValue,this.animationSpeed=this.gauge.animationSpeed,this.options.angle=this.gauge.options.angle,this.options.iconPath)return this.img=new Image,this.img.src=this.options.iconPath},i.prototype.render=function(){var t,i,e,s,n,o,a,r,h;if(t=this.gauge.getAngle.call(this,this.displayedValue),r=Math.round(this.length*Math.cos(t)),h=Math.round(this.length*Math.sin(t)),o=Math.round(this.strokeWidth*Math.cos(t-Math.PI/2)),a=Math.round(this.strokeWidth*Math.sin(t-Math.PI/2)),i=Math.round(this.strokeWidth*Math.cos(t+Math.PI/2)),e=Math.round(this.strokeWidth*Math.sin(t+Math.PI/2)),this.ctx.beginPath(),this.ctx.fillStyle=this.options.color,this.ctx.arc(0,0,this.strokeWidth,0,2*Math.PI,!1),this.ctx.fill(),this.ctx.beginPath(),this.ctx.moveTo(o,a),this.ctx.lineTo(r,h),this.ctx.lineTo(i,e),this.ctx.fill(),this.img)return s=Math.round(this.img.width*this.options.iconScale),n=Math.round(this.img.height*this.options.iconScale),this.ctx.save(),this.ctx.translate(r,h),this.ctx.rotate(t+Math.PI/180*(90+this.options.iconAngle)),this.ctx.drawImage(this.img,-s/2,-n/2,s,n),this.ctx.restore()},i}(r),n=function(t){function i(t){var e,s;this.canvas=t,i.__super__.constructor.call(this),this.percentColors=null,"undefined"!=typeof G_vmlCanvasManager&&(this.canvas=window.G_vmlCanvasManager.initElement(this.canvas)),this.ctx=this.canvas.getContext("2d"),e=this.canvas.clientHeight,s=this.canvas.clientWidth,this.canvas.height=e,this.canvas.width=s,this.gp=[new o(this)],this.setOptions()}return f(i,t),i.prototype.elem=null,i.prototype.value=[20],i.prototype.maxValue=80,i.prototype.minValue=0,i.prototype.displayedAngle=0,i.prototype.displayedValue=0,i.prototype.lineWidth=40,i.prototype.paddingTop=.1,i.prototype.paddingBottom=.1,i.prototype.percentColors=null,i.prototype.options={colorStart:"#6fadcf",colorStop:void 0,gradientType:0,strokeColor:"#e0e0e0",pointer:{length:.8,strokeWidth:.035,iconScale:1},angle:.15,lineWidth:.44,radiusScale:1,fontSize:40,limitMax:!1,limitMin:!1},i.prototype.setOptions=function(t){var e,s,n,o,a;for(null==t&&(t=null),i.__super__.setOptions.call(this,t),this.configPercentColors(),this.extraPadding=0,this.options.angle<0&&(o=Math.PI*(1+this.options.angle),this.extraPadding=Math.sin(o)),this.availableHeight=this.canvas.height*(1-this.paddingTop-this.paddingBottom),this.lineWidth=this.availableHeight*this.options.lineWidth,this.radius=(this.availableHeight-this.lineWidth/2)/(1+this.extraPadding),this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),s=0,n=(a=this.gp).length;s<n;s++)(e=a[s]).setOptions(this.options.pointer),e.render();return this.render(),this},i.prototype.configPercentColors=function(){var t,i,e,s,n,o,a;if(this.percentColors=null,void 0!==this.options.percentColors){for(this.percentColors=new Array,o=[],e=s=0,n=this.options.percentColors.length-1;0<=n?s<=n:s>=n;e=0<=n?++s:--s)a=parseInt(l(this.options.percentColors[e][1]).substring(0,2),16),i=parseInt(l(this.options.percentColors[e][1]).substring(2,4),16),t=parseInt(l(this.options.percentColors[e][1]).substring(4,6),16),o.push(this.percentColors[e]={pct:this.options.percentColors[e][0],color:{r:a,g:i,b:t}});return o}},i.prototype.set=function(t){var i,e,s,n,a,r,h,l,u;for(t instanceof Array||(t=[t]),e=s=0,h=t.length-1;0<=h?s<=h:s>=h;e=0<=h?++s:--s)t[e]=this.parseValue(t[e]);if(t.length>this.gp.length)for(e=n=0,l=t.length-this.gp.length;0<=l?n<l:n>l;e=0<=l?++n:--n)(i=new o(this)).setOptions(this.options.pointer),this.gp.push(i);else t.length<this.gp.length&&(this.gp=this.gp.slice(this.gp.length-t.length));for(e=0,a=0,r=t.length;a<r;a++)(u=t[a])>this.maxValue?this.options.limitMax?u=this.maxValue:this.maxValue=u+1:u<this.minValue&&(this.options.limitMin?u=this.minValue:this.minValue=u-1),this.gp[e].value=u,this.gp[e++].setOptions({minValue:this.minValue,maxValue:this.maxValue,angle:this.options.angle});return this.value=Math.max(Math.min(t[t.length-1],this.maxValue),this.minValue),AnimationUpdater.run(this.forceUpdate),this.forceUpdate=!1},i.prototype.getAngle=function(t){return(1+this.options.angle)*Math.PI+(t-this.minValue)/(this.maxValue-this.minValue)*(1-2*this.options.angle)*Math.PI},i.prototype.getColorForPercentage=function(t,i){var e,s,n,o,a,r,h;if(0===t)e=this.percentColors[0].color;else for(e=this.percentColors[this.percentColors.length-1].color,n=o=0,r=this.percentColors.length-1;0<=r?o<=r:o>=r;n=0<=r?++o:--o)if(t<=this.percentColors[n].pct){!0===i?(h=this.percentColors[n-1]||this.percentColors[0],s=this.percentColors[n],a=(t-h.pct)/(s.pct-h.pct),e={r:Math.floor(h.color.r*(1-a)+s.color.r*a),g:Math.floor(h.color.g*(1-a)+s.color.g*a),b:Math.floor(h.color.b*(1-a)+s.color.b*a)}):e=this.percentColors[n].color;break}return"rgb("+[e.r,e.g,e.b].join(",")+")"},i.prototype.getColorForValue=function(t,i){var e;return e=(t-this.minValue)/(this.maxValue-this.minValue),this.getColorForPercentage(e,i)},i.prototype.renderStaticLabels=function(t,i,e,s){var n,o,a,r,h,l,p,c,d,g;for(this.ctx.save(),this.ctx.translate(i,e),l=/\d+\.?\d?/,h=(n=t.font||"10px Times").match(l)[0],c=n.slice(h.length),o=parseFloat(h)*this.displayScale,this.ctx.font=o+c,this.ctx.fillStyle=t.color||"#000000",this.ctx.textBaseline="bottom",this.ctx.textAlign="center",a=0,r=(p=t.labels).length;a<r;a++)void 0!==(g=p[a]).label?(!this.options.limitMin||g>=this.minValue)&&(!this.options.limitMax||g<=this.maxValue)&&(n=g.font||t.font,h=n.match(l)[0],c=n.slice(h.length),o=parseFloat(h)*this.displayScale,this.ctx.font=o+c,d=this.getAngle(g.label)-3*Math.PI/2,this.ctx.rotate(d),this.ctx.fillText(u(g.label,t.fractionDigits),0,-s-this.lineWidth/2),this.ctx.rotate(-d)):(!this.options.limitMin||g>=this.minValue)&&(!this.options.limitMax||g<=this.maxValue)&&(d=this.getAngle(g)-3*Math.PI/2,this.ctx.rotate(d),this.ctx.fillText(u(g,t.fractionDigits),0,-s-this.lineWidth/2),this.ctx.rotate(-d));return this.ctx.restore()},i.prototype.renderTicks=function(t,i,e,s){var n,o,a,r,h,l,u,p,c,d,g,f,m,x,v,y,w,V,S,_,C;if(t!=={}){for(l=t.divisions||0,S=t.subDivisions||0,a=t.divColor||"#fff",v=t.subColor||"#fff",r=t.divLength||.7,w=t.subLength||.2,c=parseFloat(this.maxValue)-parseFloat(this.minValue),d=parseFloat(c)/parseFloat(t.divisions),y=parseFloat(d)/parseFloat(t.subDivisions),n=parseFloat(this.minValue),o=0+y,h=(p=c/400)*(t.divWidth||1),V=p*(t.subWidth||1),f=[],_=u=0,g=l+1;u<g;_=u+=1)this.ctx.lineWidth=this.lineWidth*r,m=this.lineWidth/2*(1-r),C=this.radius*this.options.radiusScale+m,this.ctx.strokeStyle=a,this.ctx.beginPath(),this.ctx.arc(0,0,C,this.getAngle(n-h),this.getAngle(n+h),!1),this.ctx.stroke(),o=n+y,n+=d,_!==t.divisions&&S>0?f.push(function(){var t,i,e;for(e=[],x=t=0,i=S-1;t<i;x=t+=1)this.ctx.lineWidth=this.lineWidth*w,m=this.lineWidth/2*(1-w),C=this.radius*this.options.radiusScale+m,this.ctx.strokeStyle=v,this.ctx.beginPath(),this.ctx.arc(0,0,C,this.getAngle(o-V),this.getAngle(o+V),!1),this.ctx.stroke(),e.push(o+=y);return e}.call(this)):f.push(void 0);return f}},i.prototype.render=function(){var t,i,e,s,n,o,a,r,h,l,u,p,c,d,g,f;if(g=this.canvas.width/2,e=this.canvas.height*this.paddingTop+this.availableHeight-(this.radius+this.lineWidth/2)*this.extraPadding,t=this.getAngle(this.displayedValue),this.textField&&this.textField.render(this),this.ctx.lineCap="butt",l=this.radius*this.options.radiusScale,this.options.staticLabels&&this.renderStaticLabels(this.options.staticLabels,g,e,l),this.options.staticZones)for(this.ctx.save(),this.ctx.translate(g,e),this.ctx.lineWidth=this.lineWidth,s=0,o=(u=this.options.staticZones).length;s<o;s++)h=(f=u[s]).min,this.options.limitMin&&h<this.minValue&&(h=this.minValue),r=f.max,this.options.limitMax&&r>this.maxValue&&(r=this.maxValue),d=this.radius*this.options.radiusScale,f.height&&(this.ctx.lineWidth=this.lineWidth*f.height,c=this.lineWidth/2*(f.offset||1-f.height),d=this.radius*this.options.radiusScale+c),this.ctx.strokeStyle=f.strokeStyle,this.ctx.beginPath(),this.ctx.arc(0,0,d,this.getAngle(h),this.getAngle(r),!1),this.ctx.stroke();else void 0!==this.options.customFillStyle?i=this.options.customFillStyle(this):null!==this.percentColors?i=this.getColorForValue(this.displayedValue,this.options.generateGradient):void 0!==this.options.colorStop?((i=0===this.options.gradientType?this.ctx.createRadialGradient(g,e,9,g,e,70):this.ctx.createLinearGradient(0,0,g,0)).addColorStop(0,this.options.colorStart),i.addColorStop(1,this.options.colorStop)):i=this.options.colorStart,this.ctx.strokeStyle=i,this.ctx.beginPath(),this.ctx.arc(g,e,l,(1+this.options.angle)*Math.PI,t,!1),this.ctx.lineWidth=this.lineWidth,this.ctx.stroke(),this.ctx.strokeStyle=this.options.strokeColor,this.ctx.beginPath(),this.ctx.arc(g,e,l,t,(2-this.options.angle)*Math.PI,!1),this.ctx.stroke(),this.ctx.save(),this.ctx.translate(g,e);for(this.options.renderTicks&&this.renderTicks(this.options.renderTicks,g,e,l),this.ctx.restore(),this.ctx.translate(g,e),n=0,a=(p=this.gp).length;n<a;n++)p[n].update(!0);return this.ctx.translate(-g,-e)},i}(e),i=function(t){function i(t){this.canvas=t,i.__super__.constructor.call(this),"undefined"!=typeof G_vmlCanvasManager&&(this.canvas=window.G_vmlCanvasManager.initElement(this.canvas)),this.ctx=this.canvas.getContext("2d"),this.setOptions(),this.render()}return f(i,t),i.prototype.lineWidth=15,i.prototype.displayedValue=0,i.prototype.value=33,i.prototype.maxValue=80,i.prototype.minValue=0,i.prototype.options={lineWidth:.1,colorStart:"#6f6ea0",colorStop:"#c0c0db",strokeColor:"#eeeeee",shadowColor:"#d5d5d5",angle:.35,radiusScale:1},i.prototype.getAngle=function(t){return(1-this.options.angle)*Math.PI+(t-this.minValue)/(this.maxValue-this.minValue)*(2+this.options.angle-(1-this.options.angle))*Math.PI},i.prototype.setOptions=function(t){return null==t&&(t=null),i.__super__.setOptions.call(this,t),this.lineWidth=this.canvas.height*this.options.lineWidth,this.radius=this.options.radiusScale*(this.canvas.height/2-this.lineWidth/2),this},i.prototype.set=function(t){return this.value=this.parseValue(t),this.value>this.maxValue?this.options.limitMax?this.value=this.maxValue:this.maxValue=this.value:this.value<this.minValue&&(this.options.limitMin?this.value=this.minValue:this.minValue=this.value),AnimationUpdater.run(this.forceUpdate),this.forceUpdate=!1},i.prototype.render=function(){var t,i,e,s;return t=this.getAngle(this.displayedValue),s=this.canvas.width/2,e=this.canvas.height/2,this.textField&&this.textField.render(this),(i=this.ctx.createRadialGradient(s,e,39,s,e,70)).addColorStop(0,this.options.colorStart),i.addColorStop(1,this.options.colorStop),this.radius,this.lineWidth,this.radius,this.lineWidth,this.ctx.strokeStyle=this.options.strokeColor,this.ctx.beginPath(),this.ctx.arc(s,e,this.radius,(1-this.options.angle)*Math.PI,(2+this.options.angle)*Math.PI,!1),this.ctx.lineWidth=this.lineWidth,this.ctx.lineCap="round",this.ctx.stroke(),this.ctx.strokeStyle=i,this.ctx.beginPath(),this.ctx.arc(s,e,this.radius,(1-this.options.angle)*Math.PI,t,!1),this.ctx.stroke()},i}(e),s=function(t){function i(){return i.__super__.constructor.apply(this,arguments)}return f(i,t),i.prototype.strokeGradient=function(t,i,e,s){var n;return(n=this.ctx.createRadialGradient(t,i,e,t,i,s)).addColorStop(0,this.options.shadowColor),n.addColorStop(.12,this.options._orgStrokeColor),n.addColorStop(.88,this.options._orgStrokeColor),n.addColorStop(1,this.options.shadowColor),n},i.prototype.setOptions=function(t){var e,s,n,o;return null==t&&(t=null),i.__super__.setOptions.call(this,t),o=this.canvas.width/2,e=this.canvas.height/2,s=this.radius-this.lineWidth/2,n=this.radius+this.lineWidth/2,this.options._orgStrokeColor=this.options.strokeColor,this.options.strokeColor=this.strokeGradient(o,e,s,n),this},i}(i),window.AnimationUpdater={elements:[],animId:null,addAll:function(t){var i,e,s,n;for(n=[],e=0,s=t.length;e<s;e++)i=t[e],n.push(AnimationUpdater.elements.push(i));return n},add:function(t){return AnimationUpdater.elements.push(t)},run:function(t){var i,e,s,n;if(null==t&&(t=!1),isFinite(parseFloat(t))||!0===t){for(i=!0,e=0,s=(n=AnimationUpdater.elements).length;e<s;e++)n[e].update(!0===t)&&(i=!1);return AnimationUpdater.animId=i?null:requestAnimationFrame(AnimationUpdater.run)}if(!1===t)return!0===AnimationUpdater.animId&&cancelAnimationFrame(AnimationUpdater.animId),AnimationUpdater.animId=requestAnimationFrame(AnimationUpdater.run)}},"function"==typeof window.define&&null!=window.define.amd?(void 0)(function(){return{Gauge:n,Donut:s,BaseDonut:i,TextRenderer:a}}):null!=t.exports?t.exports={Gauge:n,Donut:s,BaseDonut:i,TextRenderer:a}:(window.Gauge=n,window.Donut=s,window.BaseDonut=i,window.TextRenderer=a)}).call(o)}),r=a.Gauge,h=a.Donut,l=(a.BaseDonut,a.TextRenderer,{name:"VGauge",props:{unit:{type:String,default:""},height:{type:String,default:"200px"},width:{type:String,default:"200px"},decimalPlace:{type:Number,default:0},gaugeValueClass:{type:String,default:""},top:{type:Boolean,default:!1},maxValue:{type:Number,default:100},minValue:{type:Number,default:0},options:{type:Object,default:function(){return{angle:.15,lineWidth:.44,radiusScale:1,pointer:{length:.6,strokeWidth:.035,color:"#000000"},limitMax:!1,limitMin:!1,colorStart:"#6FADCF",colorStop:"#8FC0DA",strokeColor:"#E0E0E0",generateGradient:!0,highDpiSupport:!0}}},animationSpeed:{type:Number,default:10},initialValue:{type:Number,default:0},value:{type:Number,default:50},donut:{type:Boolean,default:!1}},data:function(){return{gauge:null}},mounted:function(){this.initializeGauge()},watch:{value:function(t){this.gauge.set(t)}},methods:{initializeGauge:function(){this.gauge=this.donut?new h(this.$refs.gauge):new r(this.$refs.gauge),this.gauge.maxValue=this.maxValue,this.gauge.setMinValue(this.minValue),this.gauge.animationSpeed=this.animationSpeed,this.gauge.setOptions(this.options),this.gauge.setTextField(this.$refs["gauge-value"],this.decimalPlace),this.gauge.set(this.value)}}}),u=i,p="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase()),c=document.head||document.getElementsByTagName("head")[0],d={},g=u({render:function(){var t=this,i=t.$createElement,e=t._self._c||i;return e("div",[e("div",{staticClass:"gauge-title"},[t.top?e("span",{ref:"gauge-value",class:t.gaugeValueClass}):t._e(),t._v(" "),t.top?e("span",{class:t.gaugeValueClass},[t._v(t._s(t.unit))]):t._e()]),t._v(" "),e("canvas",{ref:"gauge",attrs:{height:t.height,width:t.width}}),t._v(" "),e("div",{staticClass:"gauge-title"},[t.top?t._e():e("span",{ref:"gauge-value",class:t.gaugeValueClass}),t._v(" "),t.top?t._e():e("span",{class:t.gaugeValueClass},[t._v(t._s(t.unit))])])])},staticRenderFns:[]},function(t){t&&t("data-v-72870b86_0",{source:".gauge-title span[data-v-72870b86]{display:inline;text-align:center}",map:void 0,media:void 0})},l,"data-v-72870b86",!1,void 0,e,void 0),f={install:n},m=null;return"undefined"!=typeof window?m=window.Vue:"undefined"!=typeof global&&(m=global.Vue),m&&m.use(f),g.install=n,t.default=g,t}({}); | ||
var VGauge=function(t){"use strict";function i(t,i,e,s,n,o,a,r,h,l){"boolean"!=typeof a&&(h=r,r=a,a=!1);var u="function"==typeof e?e.options:e;t&&t.render&&(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,n&&(u.functional=!0)),s&&(u._scopeId=s);var p;if(o?(p=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,h(t)),t&&t._registeredComponents&&t._registeredComponents.add(o)},u._ssrRegister=p):i&&(p=a?function(){i.call(this,l(this.$root.$options.shadowRoot))}:function(t){i.call(this,r(t))}),p)if(u.functional){var c=u.render;u.render=function(t,i){return p.call(i),c(t,i)}}else{var d=u.beforeCreate;u.beforeCreate=d?[].concat(d,p):[p]}return e}function e(t){return function(t,i){return s(t,i)}}function s(t,i){var e=p?i.media||"default":t,s=d[e]||(d[e]={ids:new Set,styles:[]});if(!s.ids.has(t)){s.ids.add(t);var n=i.source;if(i.map&&(n+="\n/*# sourceURL="+i.map.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i.map))))+" */"),s.element||(s.element=document.createElement("style"),s.element.type="text/css",i.media&&s.element.setAttribute("media",i.media),c.appendChild(s.element)),"styleSheet"in s.element)s.styles.push(n),s.element.styleSheet.cssText=s.styles.filter(Boolean).join("\n");else{var o=s.ids.size-1,a=document.createTextNode(n),r=s.element.childNodes;r[o]&&s.element.removeChild(r[o]),r.length?s.element.insertBefore(a,r[o]):s.element.appendChild(a)}}}function n(t){n.installed||(n.installed=!0,t.component("VGauge",g))}var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},a=function(t,i){return i={exports:{}},t(i,i.exports),i.exports}(function(t){(function(){var i,e,s,n,o,a,r,h,l,u,p,c,d=[].slice,g={}.hasOwnProperty,f=function(t,i){function e(){this.constructor=t}for(var s in i)g.call(i,s)&&(t[s]=i[s]);return e.prototype=i.prototype,t.prototype=new e,t.__super__=i.prototype,t};!function(){var t,i,e,s,n,o,a;for(e=0,n=(a=["ms","moz","webkit","o"]).length;e<n&&(o=a[e],!window.requestAnimationFrame);e++)window.requestAnimationFrame=window[o+"RequestAnimationFrame"],window.cancelAnimationFrame=window[o+"CancelAnimationFrame"]||window[o+"CancelRequestAnimationFrame"];t=null,s=0,i={},requestAnimationFrame?window.cancelAnimationFrame||(t=window.requestAnimationFrame,window.requestAnimationFrame=function(e,n){var o;return o=++s,t(function(){if(!i[o])return e()},n),o},window.cancelAnimationFrame=function(t){return i[t]=!0}):(window.requestAnimationFrame=function(t,i){var e,s,n,o;return e=(new Date).getTime(),o=Math.max(0,16-(e-n)),s=window.setTimeout(function(){return t(e+o)},o),n=e+o,s},window.cancelAnimationFrame=function(t){return clearTimeout(t)})}(),c=function(t){var i,e;for(t-=3600*(i=Math.floor(t/3600))+60*(e=Math.floor((t-3600*i)/60)),t+="",e+="";e.length<2;)e="0"+e;for(;t.length<2;)t="0"+t;return(i=i?i+":":"")+e+":"+t},u=function(){var t,i,e;return i=1<=arguments.length?d.call(arguments,0):[],e=i[0],t=i[1],h(e.toFixed(t))},p=function(t,i){var e,s,n;s={};for(e in t)g.call(t,e)&&(n=t[e],s[e]=n);for(e in i)g.call(i,e)&&(n=i[e],s[e]=n);return s},h=function(t){var i,e,s,n;for(s=(e=(t+="").split("."))[0],n="",e.length>1&&(n="."+e[1]),i=/(\d+)(\d{3})/;i.test(s);)s=s.replace(i,"$1,$2");return s+n},l=function(t){return"#"===t.charAt(0)?t.substring(1,7):t},e=function(t){function i(){return i.__super__.constructor.apply(this,arguments)}return f(i,t),i.prototype.displayScale=1,i.prototype.forceUpdate=!0,i.prototype.setTextField=function(t,i){return this.textField=t instanceof a?t:new a(t,i)},i.prototype.setMinValue=function(t,i){var e,s,n,o,a;if(this.minValue=t,null==i&&(i=!0),i){for(this.displayedValue=this.minValue,a=[],s=0,n=(o=this.gp||[]).length;s<n;s++)e=o[s],a.push(e.displayedValue=this.minValue);return a}},i.prototype.setOptions=function(t){return null==t&&(t=null),this.options=p(this.options,t),this.textField&&(this.textField.el.style.fontSize=t.fontSize+"px"),this.options.angle>.5&&(this.options.angle=.5),this.configDisplayScale(),this},i.prototype.configDisplayScale=function(){var t,i,e,s,n;return s=this.displayScale,!1===this.options.highDpiSupport?delete this.displayScale:(i=window.devicePixelRatio||1,t=this.ctx.webkitBackingStorePixelRatio||this.ctx.mozBackingStorePixelRatio||this.ctx.msBackingStorePixelRatio||this.ctx.oBackingStorePixelRatio||this.ctx.backingStorePixelRatio||1,this.displayScale=i/t),this.displayScale!==s&&(n=this.canvas.G__width||this.canvas.width,e=this.canvas.G__height||this.canvas.height,this.canvas.width=n*this.displayScale,this.canvas.height=e*this.displayScale,this.canvas.style.width=n+"px",this.canvas.style.height=e+"px",this.canvas.G__width=n,this.canvas.G__height=e),this},i.prototype.parseValue=function(t){return t=parseFloat(t)||Number(t),isFinite(t)?t:0},i}(r=function(){function t(t,i){null==t&&(t=!0),this.clear=null==i||i,t&&AnimationUpdater.add(this)}return t.prototype.animationSpeed=32,t.prototype.update=function(t){var i;return null==t&&(t=!1),!(!t&&this.displayedValue===this.value||(this.ctx&&this.clear&&this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),i=this.value-this.displayedValue,Math.abs(i/this.animationSpeed)<=.001?this.displayedValue=this.value:this.displayedValue=this.displayedValue+i/this.animationSpeed,this.render(),0))},t}()),a=function(){function t(t,i){this.el=t,this.fractionDigits=i}return t.prototype.render=function(t){return this.el.innerHTML=u(t.displayedValue,this.fractionDigits)},t}(),function(t){function i(t,e){if(this.elem=t,this.text=null!=e&&e,i.__super__.constructor.call(this),void 0===this.elem)throw new Error("The element isn't defined.");this.value=1*this.elem.innerHTML,this.text&&(this.value=0)}f(i,t),i.prototype.displayedValue=0,i.prototype.value=0,i.prototype.setVal=function(t){return this.value=1*t},i.prototype.render=function(){var t;return t=this.text?c(this.displayedValue.toFixed(0)):h(u(this.displayedValue)),this.elem.innerHTML=t}}(r),o=function(t){function i(t){if(this.gauge=t,void 0===this.gauge)throw new Error("The element isn't defined.");this.ctx=this.gauge.ctx,this.canvas=this.gauge.canvas,i.__super__.constructor.call(this,!1,!1),this.setOptions()}return f(i,t),i.prototype.displayedValue=0,i.prototype.value=0,i.prototype.options={strokeWidth:.035,length:.1,color:"#000000",iconPath:null,iconScale:1,iconAngle:0},i.prototype.img=null,i.prototype.setOptions=function(t){if(null==t&&(t=null),this.options=p(this.options,t),this.length=2*this.gauge.radius*this.gauge.options.radiusScale*this.options.length,this.strokeWidth=this.canvas.height*this.options.strokeWidth,this.maxValue=this.gauge.maxValue,this.minValue=this.gauge.minValue,this.animationSpeed=this.gauge.animationSpeed,this.options.angle=this.gauge.options.angle,this.options.iconPath)return this.img=new Image,this.img.src=this.options.iconPath},i.prototype.render=function(){var t,i,e,s,n,o,a,r,h;if(t=this.gauge.getAngle.call(this,this.displayedValue),r=Math.round(this.length*Math.cos(t)),h=Math.round(this.length*Math.sin(t)),o=Math.round(this.strokeWidth*Math.cos(t-Math.PI/2)),a=Math.round(this.strokeWidth*Math.sin(t-Math.PI/2)),i=Math.round(this.strokeWidth*Math.cos(t+Math.PI/2)),e=Math.round(this.strokeWidth*Math.sin(t+Math.PI/2)),this.ctx.beginPath(),this.ctx.fillStyle=this.options.color,this.ctx.arc(0,0,this.strokeWidth,0,2*Math.PI,!1),this.ctx.fill(),this.ctx.beginPath(),this.ctx.moveTo(o,a),this.ctx.lineTo(r,h),this.ctx.lineTo(i,e),this.ctx.fill(),this.img)return s=Math.round(this.img.width*this.options.iconScale),n=Math.round(this.img.height*this.options.iconScale),this.ctx.save(),this.ctx.translate(r,h),this.ctx.rotate(t+Math.PI/180*(90+this.options.iconAngle)),this.ctx.drawImage(this.img,-s/2,-n/2,s,n),this.ctx.restore()},i}(r),n=function(t){function i(t){var e,s;this.canvas=t,i.__super__.constructor.call(this),this.percentColors=null,"undefined"!=typeof G_vmlCanvasManager&&(this.canvas=window.G_vmlCanvasManager.initElement(this.canvas)),this.ctx=this.canvas.getContext("2d"),e=this.canvas.clientHeight,s=this.canvas.clientWidth,this.canvas.height=e,this.canvas.width=s,this.gp=[new o(this)],this.setOptions()}return f(i,t),i.prototype.elem=null,i.prototype.value=[20],i.prototype.maxValue=80,i.prototype.minValue=0,i.prototype.displayedAngle=0,i.prototype.displayedValue=0,i.prototype.lineWidth=40,i.prototype.paddingTop=.1,i.prototype.paddingBottom=.1,i.prototype.percentColors=null,i.prototype.options={colorStart:"#6fadcf",colorStop:void 0,gradientType:0,strokeColor:"#e0e0e0",pointer:{length:.8,strokeWidth:.035,iconScale:1},angle:.15,lineWidth:.44,radiusScale:1,fontSize:40,limitMax:!1,limitMin:!1},i.prototype.setOptions=function(t){var e,s,n,o,a;for(null==t&&(t=null),i.__super__.setOptions.call(this,t),this.configPercentColors(),this.extraPadding=0,this.options.angle<0&&(o=Math.PI*(1+this.options.angle),this.extraPadding=Math.sin(o)),this.availableHeight=this.canvas.height*(1-this.paddingTop-this.paddingBottom),this.lineWidth=this.availableHeight*this.options.lineWidth,this.radius=(this.availableHeight-this.lineWidth/2)/(1+this.extraPadding),this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),s=0,n=(a=this.gp).length;s<n;s++)(e=a[s]).setOptions(this.options.pointer),e.render();return this.render(),this},i.prototype.configPercentColors=function(){var t,i,e,s,n,o,a;if(this.percentColors=null,void 0!==this.options.percentColors){for(this.percentColors=new Array,o=[],e=s=0,n=this.options.percentColors.length-1;0<=n?s<=n:s>=n;e=0<=n?++s:--s)a=parseInt(l(this.options.percentColors[e][1]).substring(0,2),16),i=parseInt(l(this.options.percentColors[e][1]).substring(2,4),16),t=parseInt(l(this.options.percentColors[e][1]).substring(4,6),16),o.push(this.percentColors[e]={pct:this.options.percentColors[e][0],color:{r:a,g:i,b:t}});return o}},i.prototype.set=function(t){var i,e,s,n,a,r,h,l,u;for(t instanceof Array||(t=[t]),e=s=0,h=t.length-1;0<=h?s<=h:s>=h;e=0<=h?++s:--s)t[e]=this.parseValue(t[e]);if(t.length>this.gp.length)for(e=n=0,l=t.length-this.gp.length;0<=l?n<l:n>l;e=0<=l?++n:--n)(i=new o(this)).setOptions(this.options.pointer),this.gp.push(i);else t.length<this.gp.length&&(this.gp=this.gp.slice(this.gp.length-t.length));for(e=0,a=0,r=t.length;a<r;a++)(u=t[a])>this.maxValue?this.options.limitMax?u=this.maxValue:this.maxValue=u+1:u<this.minValue&&(this.options.limitMin?u=this.minValue:this.minValue=u-1),this.gp[e].value=u,this.gp[e++].setOptions({minValue:this.minValue,maxValue:this.maxValue,angle:this.options.angle});return this.value=Math.max(Math.min(t[t.length-1],this.maxValue),this.minValue),AnimationUpdater.run(this.forceUpdate),this.forceUpdate=!1},i.prototype.getAngle=function(t){return(1+this.options.angle)*Math.PI+(t-this.minValue)/(this.maxValue-this.minValue)*(1-2*this.options.angle)*Math.PI},i.prototype.getColorForPercentage=function(t,i){var e,s,n,o,a,r,h;if(0===t)e=this.percentColors[0].color;else for(e=this.percentColors[this.percentColors.length-1].color,n=o=0,r=this.percentColors.length-1;0<=r?o<=r:o>=r;n=0<=r?++o:--o)if(t<=this.percentColors[n].pct){!0===i?(h=this.percentColors[n-1]||this.percentColors[0],s=this.percentColors[n],a=(t-h.pct)/(s.pct-h.pct),e={r:Math.floor(h.color.r*(1-a)+s.color.r*a),g:Math.floor(h.color.g*(1-a)+s.color.g*a),b:Math.floor(h.color.b*(1-a)+s.color.b*a)}):e=this.percentColors[n].color;break}return"rgb("+[e.r,e.g,e.b].join(",")+")"},i.prototype.getColorForValue=function(t,i){var e;return e=(t-this.minValue)/(this.maxValue-this.minValue),this.getColorForPercentage(e,i)},i.prototype.renderStaticLabels=function(t,i,e,s){var n,o,a,r,h,l,p,c,d,g;for(this.ctx.save(),this.ctx.translate(i,e),l=/\d+\.?\d?/,h=(n=t.font||"10px Times").match(l)[0],c=n.slice(h.length),o=parseFloat(h)*this.displayScale,this.ctx.font=o+c,this.ctx.fillStyle=t.color||"#000000",this.ctx.textBaseline="bottom",this.ctx.textAlign="center",a=0,r=(p=t.labels).length;a<r;a++)void 0!==(g=p[a]).label?(!this.options.limitMin||g>=this.minValue)&&(!this.options.limitMax||g<=this.maxValue)&&(n=g.font||t.font,h=n.match(l)[0],c=n.slice(h.length),o=parseFloat(h)*this.displayScale,this.ctx.font=o+c,d=this.getAngle(g.label)-3*Math.PI/2,this.ctx.rotate(d),this.ctx.fillText(u(g.label,t.fractionDigits),0,-s-this.lineWidth/2),this.ctx.rotate(-d)):(!this.options.limitMin||g>=this.minValue)&&(!this.options.limitMax||g<=this.maxValue)&&(d=this.getAngle(g)-3*Math.PI/2,this.ctx.rotate(d),this.ctx.fillText(u(g,t.fractionDigits),0,-s-this.lineWidth/2),this.ctx.rotate(-d));return this.ctx.restore()},i.prototype.renderTicks=function(t,i,e,s){var n,o,a,r,h,l,u,p,c,d,g,f,m,x,v,y,w,V,S,_,C;if(t!=={}){for(l=t.divisions||0,S=t.subDivisions||0,a=t.divColor||"#fff",v=t.subColor||"#fff",r=t.divLength||.7,w=t.subLength||.2,c=parseFloat(this.maxValue)-parseFloat(this.minValue),d=parseFloat(c)/parseFloat(t.divisions),y=parseFloat(d)/parseFloat(t.subDivisions),n=parseFloat(this.minValue),o=0+y,h=(p=c/400)*(t.divWidth||1),V=p*(t.subWidth||1),f=[],_=u=0,g=l+1;u<g;_=u+=1)this.ctx.lineWidth=this.lineWidth*r,m=this.lineWidth/2*(1-r),C=this.radius*this.options.radiusScale+m,this.ctx.strokeStyle=a,this.ctx.beginPath(),this.ctx.arc(0,0,C,this.getAngle(n-h),this.getAngle(n+h),!1),this.ctx.stroke(),o=n+y,n+=d,_!==t.divisions&&S>0?f.push(function(){var t,i,e;for(e=[],x=t=0,i=S-1;t<i;x=t+=1)this.ctx.lineWidth=this.lineWidth*w,m=this.lineWidth/2*(1-w),C=this.radius*this.options.radiusScale+m,this.ctx.strokeStyle=v,this.ctx.beginPath(),this.ctx.arc(0,0,C,this.getAngle(o-V),this.getAngle(o+V),!1),this.ctx.stroke(),e.push(o+=y);return e}.call(this)):f.push(void 0);return f}},i.prototype.render=function(){var t,i,e,s,n,o,a,r,h,l,u,p,c,d,g,f;if(g=this.canvas.width/2,e=this.canvas.height*this.paddingTop+this.availableHeight-(this.radius+this.lineWidth/2)*this.extraPadding,t=this.getAngle(this.displayedValue),this.textField&&this.textField.render(this),this.ctx.lineCap="butt",l=this.radius*this.options.radiusScale,this.options.staticLabels&&this.renderStaticLabels(this.options.staticLabels,g,e,l),this.options.staticZones)for(this.ctx.save(),this.ctx.translate(g,e),this.ctx.lineWidth=this.lineWidth,s=0,o=(u=this.options.staticZones).length;s<o;s++)h=(f=u[s]).min,this.options.limitMin&&h<this.minValue&&(h=this.minValue),r=f.max,this.options.limitMax&&r>this.maxValue&&(r=this.maxValue),d=this.radius*this.options.radiusScale,f.height&&(this.ctx.lineWidth=this.lineWidth*f.height,c=this.lineWidth/2*(f.offset||1-f.height),d=this.radius*this.options.radiusScale+c),this.ctx.strokeStyle=f.strokeStyle,this.ctx.beginPath(),this.ctx.arc(0,0,d,this.getAngle(h),this.getAngle(r),!1),this.ctx.stroke();else void 0!==this.options.customFillStyle?i=this.options.customFillStyle(this):null!==this.percentColors?i=this.getColorForValue(this.displayedValue,this.options.generateGradient):void 0!==this.options.colorStop?((i=0===this.options.gradientType?this.ctx.createRadialGradient(g,e,9,g,e,70):this.ctx.createLinearGradient(0,0,g,0)).addColorStop(0,this.options.colorStart),i.addColorStop(1,this.options.colorStop)):i=this.options.colorStart,this.ctx.strokeStyle=i,this.ctx.beginPath(),this.ctx.arc(g,e,l,(1+this.options.angle)*Math.PI,t,!1),this.ctx.lineWidth=this.lineWidth,this.ctx.stroke(),this.ctx.strokeStyle=this.options.strokeColor,this.ctx.beginPath(),this.ctx.arc(g,e,l,t,(2-this.options.angle)*Math.PI,!1),this.ctx.stroke(),this.ctx.save(),this.ctx.translate(g,e);for(this.options.renderTicks&&this.renderTicks(this.options.renderTicks,g,e,l),this.ctx.restore(),this.ctx.translate(g,e),n=0,a=(p=this.gp).length;n<a;n++)p[n].update(!0);return this.ctx.translate(-g,-e)},i}(e),i=function(t){function i(t){this.canvas=t,i.__super__.constructor.call(this),"undefined"!=typeof G_vmlCanvasManager&&(this.canvas=window.G_vmlCanvasManager.initElement(this.canvas)),this.ctx=this.canvas.getContext("2d"),this.setOptions(),this.render()}return f(i,t),i.prototype.lineWidth=15,i.prototype.displayedValue=0,i.prototype.value=33,i.prototype.maxValue=80,i.prototype.minValue=0,i.prototype.options={lineWidth:.1,colorStart:"#6f6ea0",colorStop:"#c0c0db",strokeColor:"#eeeeee",shadowColor:"#d5d5d5",angle:.35,radiusScale:1},i.prototype.getAngle=function(t){return(1-this.options.angle)*Math.PI+(t-this.minValue)/(this.maxValue-this.minValue)*(2+this.options.angle-(1-this.options.angle))*Math.PI},i.prototype.setOptions=function(t){return null==t&&(t=null),i.__super__.setOptions.call(this,t),this.lineWidth=this.canvas.height*this.options.lineWidth,this.radius=this.options.radiusScale*(this.canvas.height/2-this.lineWidth/2),this},i.prototype.set=function(t){return this.value=this.parseValue(t),this.value>this.maxValue?this.options.limitMax?this.value=this.maxValue:this.maxValue=this.value:this.value<this.minValue&&(this.options.limitMin?this.value=this.minValue:this.minValue=this.value),AnimationUpdater.run(this.forceUpdate),this.forceUpdate=!1},i.prototype.render=function(){var t,i,e,s;return t=this.getAngle(this.displayedValue),s=this.canvas.width/2,e=this.canvas.height/2,this.textField&&this.textField.render(this),(i=this.ctx.createRadialGradient(s,e,39,s,e,70)).addColorStop(0,this.options.colorStart),i.addColorStop(1,this.options.colorStop),this.radius,this.lineWidth,this.radius,this.lineWidth,this.ctx.strokeStyle=this.options.strokeColor,this.ctx.beginPath(),this.ctx.arc(s,e,this.radius,(1-this.options.angle)*Math.PI,(2+this.options.angle)*Math.PI,!1),this.ctx.lineWidth=this.lineWidth,this.ctx.lineCap="round",this.ctx.stroke(),this.ctx.strokeStyle=i,this.ctx.beginPath(),this.ctx.arc(s,e,this.radius,(1-this.options.angle)*Math.PI,t,!1),this.ctx.stroke()},i}(e),s=function(t){function i(){return i.__super__.constructor.apply(this,arguments)}return f(i,t),i.prototype.strokeGradient=function(t,i,e,s){var n;return(n=this.ctx.createRadialGradient(t,i,e,t,i,s)).addColorStop(0,this.options.shadowColor),n.addColorStop(.12,this.options._orgStrokeColor),n.addColorStop(.88,this.options._orgStrokeColor),n.addColorStop(1,this.options.shadowColor),n},i.prototype.setOptions=function(t){var e,s,n,o;return null==t&&(t=null),i.__super__.setOptions.call(this,t),o=this.canvas.width/2,e=this.canvas.height/2,s=this.radius-this.lineWidth/2,n=this.radius+this.lineWidth/2,this.options._orgStrokeColor=this.options.strokeColor,this.options.strokeColor=this.strokeGradient(o,e,s,n),this},i}(i),window.AnimationUpdater={elements:[],animId:null,addAll:function(t){var i,e,s,n;for(n=[],e=0,s=t.length;e<s;e++)i=t[e],n.push(AnimationUpdater.elements.push(i));return n},add:function(t){return AnimationUpdater.elements.push(t)},run:function(t){var i,e,s,n;if(null==t&&(t=!1),isFinite(parseFloat(t))||!0===t){for(i=!0,e=0,s=(n=AnimationUpdater.elements).length;e<s;e++)n[e].update(!0===t)&&(i=!1);return AnimationUpdater.animId=i?null:requestAnimationFrame(AnimationUpdater.run)}if(!1===t)return!0===AnimationUpdater.animId&&cancelAnimationFrame(AnimationUpdater.animId),AnimationUpdater.animId=requestAnimationFrame(AnimationUpdater.run)}},"function"==typeof window.define&&null!=window.define.amd?(void 0)(function(){return{Gauge:n,Donut:s,BaseDonut:i,TextRenderer:a}}):null!=t.exports?t.exports={Gauge:n,Donut:s,BaseDonut:i,TextRenderer:a}:(window.Gauge=n,window.Donut=s,window.BaseDonut=i,window.TextRenderer=a)}).call(o)}),r=a.Gauge,h=a.Donut,l=(a.BaseDonut,a.TextRenderer,{name:"VGauge",props:{unit:{type:String,default:""},height:{type:String,default:"200px"},width:{type:String,default:"200px"},decimalPlace:{type:Number,default:0},gaugeValueClass:{type:String,default:""},top:{type:Boolean,default:!1},maxValue:{type:Number,default:100},minValue:{type:Number,default:0},options:{type:Object,default:function(){return{angle:.15,lineWidth:.44,radiusScale:1,pointer:{length:.6,strokeWidth:.035,color:"#000000"},limitMax:!1,limitMin:!1,colorStart:"#6FADCF",colorStop:"#8FC0DA",strokeColor:"#E0E0E0",generateGradient:!0,highDpiSupport:!0}}},animationSpeed:{type:Number,default:10},initialValue:{type:Number,default:0},value:{type:Number,default:50},donut:{type:Boolean,default:!1}},data:function(){return{gauge:null}},mounted:function(){this.initializeGauge()},beforeDestroy:function(){delete this.gauge},watch:{value:function(t){this.gauge.set(t)}},methods:{initializeGauge:function(){this.gauge=this.donut?new h(this.$refs.gauge):new r(this.$refs.gauge),this.gauge.maxValue=this.maxValue,this.gauge.setMinValue(this.minValue),this.gauge.animationSpeed=this.animationSpeed,this.gauge.setOptions(this.options),this.gauge.setTextField(this.$refs["gauge-value"],this.decimalPlace),this.gauge.set(this.value)}}}),u=i,p="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase()),c=document.head||document.getElementsByTagName("head")[0],d={},g=u({render:function(){var t=this,i=t.$createElement,e=t._self._c||i;return e("div",[e("div",{staticClass:"gauge-title"},[t.top?e("span",{ref:"gauge-value",class:t.gaugeValueClass}):t._e(),t._v(" "),t.top?e("span",{class:t.gaugeValueClass},[t._v(t._s(t.unit))]):t._e()]),t._v(" "),e("canvas",{ref:"gauge",attrs:{height:t.height,width:t.width}}),t._v(" "),e("div",{staticClass:"gauge-title"},[t.top?t._e():e("span",{ref:"gauge-value",class:t.gaugeValueClass}),t._v(" "),t.top?t._e():e("span",{class:t.gaugeValueClass},[t._v(t._s(t.unit))])])])},staticRenderFns:[]},function(t){t&&t("data-v-1e740546_0",{source:".gauge-title span[data-v-1e740546]{display:inline;text-align:center}",map:void 0,media:void 0})},l,"data-v-1e740546",!1,void 0,e,void 0),f={install:n},m=null;return"undefined"!=typeof window?m=window.Vue:"undefined"!=typeof global&&(m=global.Vue),m&&m.use(f),g.install=n,t.default=g,t}({}); |
@@ -104,2 +104,5 @@ (function (global, factory) { | ||
}, | ||
beforeDestroy: function beforeDestroy() { | ||
delete this.gauge; | ||
}, | ||
watch: { | ||
@@ -270,7 +273,7 @@ value: function(newVal) { | ||
if (!inject) { return } | ||
inject("data-v-72870b86_0", { source: ".gauge-title span[data-v-72870b86]{display:inline;text-align:center}", map: undefined, media: undefined }); | ||
inject("data-v-1e740546_0", { source: ".gauge-title span[data-v-1e740546]{display:inline;text-align:center}", map: undefined, media: undefined }); | ||
}; | ||
/* scoped */ | ||
var __vue_scope_id__ = "data-v-72870b86"; | ||
var __vue_scope_id__ = "data-v-1e740546"; | ||
/* module identifier */ | ||
@@ -277,0 +280,0 @@ var __vue_module_identifier__ = undefined; |
{ | ||
"name": "vgauge", | ||
"version": "1.2.11", | ||
"version": "1.2.12", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/VGauge.umd.js", |
Sorry, the diff of this file is not supported yet
88982
884