UNPKG

vue3-svg-gauge

Version:

Customizable gauge component with gradients and animations for Vue 3

2 lines (1 loc) 20.8 kB
(function(s,f){typeof exports=="object"&&typeof module<"u"?module.exports=f(require("vue")):typeof define=="function"&&define.amd?define(["vue"],f):(s=typeof globalThis<"u"?globalThis:s||self,s.VueSvgGauge=f(s.Vue))})(this,function(s){"use strict";var f=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function P(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var j={exports:{}};(function(e,n){var i=function(){this._tweens={},this._tweensAddedDuringUpdate={}};i.prototype={getAll:function(){return Object.keys(this._tweens).map((function(t){return this._tweens[t]}).bind(this))},removeAll:function(){this._tweens={}},add:function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},remove:function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},update:function(t,r){var a=Object.keys(this._tweens);if(a.length===0)return!1;for(t=t!==void 0?t:o.now();a.length>0;){this._tweensAddedDuringUpdate={};for(var l=0;l<a.length;l++){var u=this._tweens[a[l]];u&&u.update(t)===!1&&(u._isPlaying=!1,r||delete this._tweens[a[l]])}a=Object.keys(this._tweensAddedDuringUpdate)}return!0}};var o=new i;o.Group=i,o._nextId=0,o.nextId=function(){return o._nextId++},typeof window>"u"&&typeof process<"u"&&process.hrtime?o.now=function(){var t=process.hrtime();return t[0]*1e3+t[1]/1e6}:typeof window<"u"&&window.performance!==void 0&&window.performance.now!==void 0?o.now=window.performance.now.bind(window.performance):Date.now!==void 0?o.now=Date.now:o.now=function(){return new Date().getTime()},o.Tween=function(t,r){this._object=t,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._repeat=0,this._repeatDelayTime=void 0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=null,this._easingFunction=o.Easing.Linear.None,this._interpolationFunction=o.Interpolation.Linear,this._chainedTweens=[],this._onStartCallback=null,this._onStartCallbackFired=!1,this._onUpdateCallback=null,this._onCompleteCallback=null,this._onStopCallback=null,this._group=r||o,this._id=o.nextId()},o.Tween.prototype={getId:function(){return this._id},isPlaying:function(){return this._isPlaying},to:function(r,a){return this._valuesEnd=r,a!==void 0&&(this._duration=a),this},start:function(r){this._group.add(this),this._isPlaying=!0,this._onStartCallbackFired=!1,this._startTime=r!==void 0?typeof r=="string"?o.now()+parseFloat(r):r:o.now(),this._startTime+=this._delayTime;for(var a in this._valuesEnd){if(this._valuesEnd[a]instanceof Array){if(this._valuesEnd[a].length===0)continue;this._valuesEnd[a]=[this._object[a]].concat(this._valuesEnd[a])}this._object[a]!==void 0&&(this._valuesStart[a]=this._object[a],this._valuesStart[a]instanceof Array||(this._valuesStart[a]*=1),this._valuesStartRepeat[a]=this._valuesStart[a]||0)}return this},stop:function(){return this._isPlaying?(this._group.remove(this),this._isPlaying=!1,this._onStopCallback!==null&&this._onStopCallback(this._object),this.stopChainedTweens(),this):this},end:function(){return this.update(this._startTime+this._duration),this},stopChainedTweens:function(){for(var r=0,a=this._chainedTweens.length;r<a;r++)this._chainedTweens[r].stop()},group:function(t){return this._group=t,this},delay:function(r){return this._delayTime=r,this},repeat:function(r){return this._repeat=r,this},repeatDelay:function(r){return this._repeatDelayTime=r,this},yoyo:function(r){return this._yoyo=r,this},easing:function(r){return this._easingFunction=r,this},interpolation:function(r){return this._interpolationFunction=r,this},chain:function(){return this._chainedTweens=arguments,this},onStart:function(r){return this._onStartCallback=r,this},onUpdate:function(r){return this._onUpdateCallback=r,this},onComplete:function(r){return this._onCompleteCallback=r,this},onStop:function(r){return this._onStopCallback=r,this},update:function(r){var a,l,u;if(r<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback!==null&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),l=(r-this._startTime)/this._duration,l=this._duration===0||l>1?1:l,u=this._easingFunction(l);for(a in this._valuesEnd)if(this._valuesStart[a]!==void 0){var c=this._valuesStart[a]||0,h=this._valuesEnd[a];h instanceof Array?this._object[a]=this._interpolationFunction(h,u):(typeof h=="string"&&(h.charAt(0)==="+"||h.charAt(0)==="-"?h=c+parseFloat(h):h=parseFloat(h)),typeof h=="number"&&(this._object[a]=c+(h-c)*u))}if(this._onUpdateCallback!==null&&this._onUpdateCallback(this._object),l===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(a in this._valuesStartRepeat){if(typeof this._valuesEnd[a]=="string"&&(this._valuesStartRepeat[a]=this._valuesStartRepeat[a]+parseFloat(this._valuesEnd[a])),this._yoyo){var E=this._valuesStartRepeat[a];this._valuesStartRepeat[a]=this._valuesEnd[a],this._valuesEnd[a]=E}this._valuesStart[a]=this._valuesStartRepeat[a]}return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=r+this._repeatDelayTime:this._startTime=r+this._delayTime,!0}else{this._onCompleteCallback!==null&&this._onCompleteCallback(this._object);for(var v=0,qr=this._chainedTweens.length;v<qr;v++)this._chainedTweens[v].start(this._startTime+this._duration);return!1}return!0}},o.Easing={Linear:{None:function(t){return t}},Quadratic:{In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},Cubic:{In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},Quartic:{In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},Quintic:{In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},Sinusoidal:{In:function(t){return 1-Math.cos(t*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return .5*(1-Math.cos(Math.PI*t))}},Exponential:{In:function(t){return t===0?0:Math.pow(1024,t-1)},Out:function(t){return t===1?1:1-Math.pow(2,-10*t)},InOut:function(t){return t===0?0:t===1?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(-Math.pow(2,-10*(t-1))+2)}},Circular:{In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},Elastic:{In:function(t){return t===0?0:t===1?1:-Math.pow(2,10*(t-1))*Math.sin((t-1.1)*5*Math.PI)},Out:function(t){return t===0?0:t===1?1:Math.pow(2,-10*t)*Math.sin((t-.1)*5*Math.PI)+1},InOut:function(t){return t===0?0:t===1?1:(t*=2,t<1?-.5*Math.pow(2,10*(t-1))*Math.sin((t-1.1)*5*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin((t-1.1)*5*Math.PI)+1)}},Back:{In:function(t){var r=1.70158;return t*t*((r+1)*t-r)},Out:function(t){var r=1.70158;return--t*t*((r+1)*t+r)+1},InOut:function(t){var r=2.5949095;return(t*=2)<1?.5*(t*t*((r+1)*t-r)):.5*((t-=2)*t*((r+1)*t+r)+2)}},Bounce:{In:function(t){return 1-o.Easing.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?o.Easing.Bounce.In(t*2)*.5:o.Easing.Bounce.Out(t*2-1)*.5+.5}}},o.Interpolation={Linear:function(t,r){var a=t.length-1,l=a*r,u=Math.floor(l),c=o.Interpolation.Utils.Linear;return r<0?c(t[0],t[1],l):r>1?c(t[a],t[a-1],a-l):c(t[u],t[u+1>a?a:u+1],l-u)},Bezier:function(t,r){for(var a=0,l=t.length-1,u=Math.pow,c=o.Interpolation.Utils.Bernstein,h=0;h<=l;h++)a+=u(1-r,l-h)*u(r,h)*t[h]*c(l,h);return a},CatmullRom:function(t,r){var a=t.length-1,l=a*r,u=Math.floor(l),c=o.Interpolation.Utils.CatmullRom;return t[0]===t[a]?(r<0&&(u=Math.floor(l=a*(1+r))),c(t[(u-1+a)%a],t[u],t[(u+1)%a],t[(u+2)%a],l-u)):r<0?t[0]-(c(t[0],t[0],t[1],t[1],-l)-t[0]):r>1?t[a]-(c(t[a],t[a],t[a-1],t[a-1],l-a)-t[a]):c(t[u?u-1:0],t[u],t[a<u+1?a:u+1],t[a<u+2?a:u+2],l-u)},Utils:{Linear:function(t,r,a){return(r-t)*a+t},Bernstein:function(t,r){var a=o.Interpolation.Utils.Factorial;return a(t)/a(r)/a(t-r)},Factorial:function(){var t=[1];return function(r){var a=1;if(t[r])return t[r];for(var l=r;l>1;l--)a*=l;return t[r]=a,a}}(),CatmullRom:function(t,r,a,l,u){var c=(a-t)*.5,h=(l-r)*.5,E=u*u,v=u*E;return(2*r-2*a+c+h)*v+(-3*r+3*a-2*c-h)*E+c*u+r}}},function(t){e.exports=o}()})(j);var W=j.exports;const T=P(W);var Z=Array.isArray,I=Z,k=typeof f=="object"&&f&&f.Object===Object&&f,tt=k,et=tt,nt=typeof self=="object"&&self&&self.Object===Object&&self,rt=et||nt||Function("return this")(),O=rt,at=O,it=at.Symbol,$=it,R=$,G=Object.prototype,ot=G.hasOwnProperty,st=G.toString,m=R?R.toStringTag:void 0;function lt(e){var n=ot.call(e,m),i=e[m];try{e[m]=void 0;var o=!0}catch{}var t=st.call(e);return o&&(n?e[m]=i:delete e[m]),t}var ut=lt,ct=Object.prototype,ht=ct.toString;function ft(e){return ht.call(e)}var dt=ft,B=$,_t=ut,pt=dt,gt="[object Null]",yt="[object Undefined]",F=B?B.toStringTag:void 0;function mt(e){return e==null?e===void 0?yt:gt:F&&F in Object(e)?_t(e):pt(e)}var V=mt;function vt(e){return e!=null&&typeof e=="object"}var bt=vt,Ct=V,wt=bt,St="[object Symbol]";function Et(e){return typeof e=="symbol"||wt(e)&&Ct(e)==St}var M=Et,Tt=I,It=M,Ot=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$t=/^\w*$/;function Mt(e,n){if(Tt(e))return!1;var i=typeof e;return i=="number"||i=="symbol"||i=="boolean"||e==null||It(e)?!0:$t.test(e)||!Ot.test(e)||n!=null&&e in Object(n)}var xt=Mt;function At(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}var U=At,Dt=V,Nt=U,Pt="[object AsyncFunction]",jt="[object Function]",Rt="[object GeneratorFunction]",Gt="[object Proxy]";function Bt(e){if(!Nt(e))return!1;var n=Dt(e);return n==jt||n==Rt||n==Pt||n==Gt}var Ft=Bt,Vt=O,Ut=Vt["__core-js_shared__"],zt=Ut,x=zt,z=function(){var e=/[^.]+$/.exec(x&&x.keys&&x.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Lt(e){return!!z&&z in e}var Ht=Lt,Kt=Function.prototype,qt=Kt.toString;function Xt(e){if(e!=null){try{return qt.call(e)}catch{}try{return e+""}catch{}}return""}var Yt=Xt,Jt=Ft,Qt=Ht,Wt=U,Zt=Yt,kt=/[\\^$.*+?()[\]{}|]/g,te=/^\[object .+?Constructor\]$/,ee=Function.prototype,ne=Object.prototype,re=ee.toString,ae=ne.hasOwnProperty,ie=RegExp("^"+re.call(ae).replace(kt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function oe(e){if(!Wt(e)||Qt(e))return!1;var n=Jt(e)?ie:te;return n.test(Zt(e))}var se=oe;function le(e,n){return e==null?void 0:e[n]}var ue=le,ce=se,he=ue;function fe(e,n){var i=he(e,n);return ce(i)?i:void 0}var L=fe,de=L,_e=de(Object,"create"),b=_e,H=b;function pe(){this.__data__=H?H(null):{},this.size=0}var ge=pe;function ye(e){var n=this.has(e)&&delete this.__data__[e];return this.size-=n?1:0,n}var me=ye,ve=b,be="__lodash_hash_undefined__",Ce=Object.prototype,we=Ce.hasOwnProperty;function Se(e){var n=this.__data__;if(ve){var i=n[e];return i===be?void 0:i}return we.call(n,e)?n[e]:void 0}var Ee=Se,Te=b,Ie=Object.prototype,Oe=Ie.hasOwnProperty;function $e(e){var n=this.__data__;return Te?n[e]!==void 0:Oe.call(n,e)}var Me=$e,xe=b,Ae="__lodash_hash_undefined__";function De(e,n){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=xe&&n===void 0?Ae:n,this}var Ne=De,Pe=ge,je=me,Re=Ee,Ge=Me,Be=Ne;function _(e){var n=-1,i=e==null?0:e.length;for(this.clear();++n<i;){var o=e[n];this.set(o[0],o[1])}}_.prototype.clear=Pe,_.prototype.delete=je,_.prototype.get=Re,_.prototype.has=Ge,_.prototype.set=Be;var Fe=_;function Ve(){this.__data__=[],this.size=0}var Ue=Ve;function ze(e,n){return e===n||e!==e&&n!==n}var Le=ze,He=Le;function Ke(e,n){for(var i=e.length;i--;)if(He(e[i][0],n))return i;return-1}var C=Ke,qe=C,Xe=Array.prototype,Ye=Xe.splice;function Je(e){var n=this.__data__,i=qe(n,e);if(i<0)return!1;var o=n.length-1;return i==o?n.pop():Ye.call(n,i,1),--this.size,!0}var Qe=Je,We=C;function Ze(e){var n=this.__data__,i=We(n,e);return i<0?void 0:n[i][1]}var ke=Ze,tn=C;function en(e){return tn(this.__data__,e)>-1}var nn=en,rn=C;function an(e,n){var i=this.__data__,o=rn(i,e);return o<0?(++this.size,i.push([e,n])):i[o][1]=n,this}var on=an,sn=Ue,ln=Qe,un=ke,cn=nn,hn=on;function p(e){var n=-1,i=e==null?0:e.length;for(this.clear();++n<i;){var o=e[n];this.set(o[0],o[1])}}p.prototype.clear=sn,p.prototype.delete=ln,p.prototype.get=un,p.prototype.has=cn,p.prototype.set=hn;var fn=p,dn=L,_n=O,pn=dn(_n,"Map"),gn=pn,K=Fe,yn=fn,mn=gn;function vn(){this.size=0,this.__data__={hash:new K,map:new(mn||yn),string:new K}}var bn=vn;function Cn(e){var n=typeof e;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?e!=="__proto__":e===null}var wn=Cn,Sn=wn;function En(e,n){var i=e.__data__;return Sn(n)?i[typeof n=="string"?"string":"hash"]:i.map}var w=En,Tn=w;function In(e){var n=Tn(this,e).delete(e);return this.size-=n?1:0,n}var On=In,$n=w;function Mn(e){return $n(this,e).get(e)}var xn=Mn,An=w;function Dn(e){return An(this,e).has(e)}var Nn=Dn,Pn=w;function jn(e,n){var i=Pn(this,e),o=i.size;return i.set(e,n),this.size+=i.size==o?0:1,this}var Rn=jn,Gn=bn,Bn=On,Fn=xn,Vn=Nn,Un=Rn;function g(e){var n=-1,i=e==null?0:e.length;for(this.clear();++n<i;){var o=e[n];this.set(o[0],o[1])}}g.prototype.clear=Gn,g.prototype.delete=Bn,g.prototype.get=Fn,g.prototype.has=Vn,g.prototype.set=Un;var zn=g,q=zn,Ln="Expected a function";function A(e,n){if(typeof e!="function"||n!=null&&typeof n!="function")throw new TypeError(Ln);var i=function(){var o=arguments,t=n?n.apply(this,o):o[0],r=i.cache;if(r.has(t))return r.get(t);var a=e.apply(this,o);return i.cache=r.set(t,a)||r,a};return i.cache=new(A.Cache||q),i}A.Cache=q;var Hn=A,Kn=Hn,qn=500;function Xn(e){var n=Kn(e,function(o){return i.size===qn&&i.clear(),o}),i=n.cache;return n}var Yn=Xn,Jn=Yn,Qn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Wn=/\\(\\)?/g,Zn=Jn(function(e){var n=[];return e.charCodeAt(0)===46&&n.push(""),e.replace(Qn,function(i,o,t,r){n.push(t?r.replace(Wn,"$1"):o||i)}),n}),kn=Zn;function tr(e,n){for(var i=-1,o=e==null?0:e.length,t=Array(o);++i<o;)t[i]=n(e[i],i,e);return t}var er=tr,X=$,nr=er,rr=I,ar=M,Y=X?X.prototype:void 0,J=Y?Y.toString:void 0;function Q(e){if(typeof e=="string")return e;if(rr(e))return nr(e,Q)+"";if(ar(e))return J?J.call(e):"";var n=e+"";return n=="0"&&1/e==-1/0?"-0":n}var ir=Q,or=ir;function sr(e){return e==null?"":or(e)}var lr=sr,ur=I,cr=xt,hr=kn,fr=lr;function dr(e,n){return ur(e)?e:cr(e,n)?[e]:hr(fr(e))}var _r=dr,pr=M;function gr(e){if(typeof e=="string"||pr(e))return e;var n=e+"";return n=="0"&&1/e==-1/0?"-0":n}var yr=gr,mr=_r,vr=yr;function br(e,n){n=mr(n,e);for(var i=0,o=n.length;e!=null&&i<o;)e=e[vr(n[i++])];return i&&i==o?e:void 0}var Cr=br,wr=Cr;function Sr(e,n,i){var o=e==null?void 0:wr(e,n);return o===void 0?i:o}var Er=Sr;const Tr=P(Er),Ir=(e,n)=>{const i=e.__vccOpts||e;for(const[o,t]of n)i[o]=t;return i},d=100,D=100,S=100;function y(e,n){const i=(n-90)*Math.PI/180;return{x:D+e*Math.cos(i),y:S+e*Math.sin(i)}}function N(e,n,i){const o=y(e,i),t=y(e,n),r=i-n<=180?"0":"1";return["M",o.x,o.y,"A",e,e,0,r,0,t.x,t.y,"L",D,S].join(" ")}const Or={name:"Gauge",setup(){const{uid:e}=s.getCurrentInstance();return{uid:e}},props:{value:{type:Number,default:70},min:{type:Number,default:0},max:{type:Number,default:100},startAngle:{type:Number,default:-90,validator:e=>((e<-360||e>360)&&console.warn('GaugeChart - props "startAngle" must be between -360 and 360'),!0)},endAngle:{type:Number,default:90,validator:e=>((e<-360||e>360)&&console.warn('GaugeChart - props "endAngle" must be between -360 and 360'),!0)},innerRadius:{type:Number,default:60,validator:e=>((e<0||e>100)&&console.warn(`GaugeChart - props "innerRadius" must be between 0 and ${d}`),!0)},separatorStep:{type:Number,default:10,validator:e=>(e!==null&&e<0&&console.warn('GaugeChart - props "separatorStep" must be null or >= 0'),!0)},separatorThickness:{type:Number,default:4},gaugeColor:{type:[Array,String],default:()=>[{offset:0,color:"#347AB0"},{offset:100,color:"#8CDFAD"}]},baseColor:{type:String,default:"#DDDDDD"},easing:{type:String,default:"Circular.Out"},scaleInterval:{type:Number,default:5,validator:e=>(e!==null&&e<0&&console.warn('GaugeChart - props "scaleInterval" must be null or >= 0'),!0)},transitionDuration:{type:Number,default:1500}},data(){return{X_CENTER:D,Y_CENTER:S,RADIUS:d,tweenedValue:this.min}},computed:{height(){const{endAngle:e,startAngle:n}=this,{y:i}=y(d,n),{y:o}=y(d,e);return Math.abs(e)<=180&&Math.abs(n)<=180?Math.max(S,i,o):d*2},basePath(){const{startAngle:e,endAngle:n}=this;return N(d,e,n)},gaugePath(){const{endAngle:e,getAngle:n,tweenedValue:i}=this;return N(d,n(i),e)},totalAngle(){const{startAngle:e,endAngle:n}=this;return Math.abs(n-e)},isCircle(){return Math.abs(this.totalAngle)===360},hasGradient(){return Array.isArray(this.gaugeColor)},separatorPaths(){const{separatorStep:e,getAngle:n,min:i,max:o,separatorThickness:t,isCircle:r}=this;if(e>0){const a=[];let l=r?i:i+e;for(l;l<o;l+=e){const u=n(l),c=t/2;a.push(N(d+2,u-c,u+c))}return a}return null},scaleLines(){const{scaleInterval:e,isCircle:n,min:i,max:o,getAngle:t,innerRadius:r}=this;if(e>0){const a=[];let l=n?i+e:i;for(l;l<o+e;l+=e){const u=t(l),c=y(r-4,u),h=y(r-8,u);a.push({xS:c.x,yS:c.y,xE:h.x,yE:h.y})}return a}return null}},watch:{value:{immediate:!0,handler(e){const{easing:n,tweenedValue:i,min:o,max:t,transitionDuration:r}=this;let a=e;e<o&&(a=o),e>t&&(a=t);function l(){T.update()&&requestAnimationFrame(l)}new T.Tween({tweeningValue:i}).to({tweeningValue:a},r).easing(Tr(T.Easing,n)).onUpdate(u=>{this.tweenedValue=u.tweeningValue}).start(),l()}}},methods:{getAngle(e){const{min:n,max:i,startAngle:o,totalAngle:t}=this,r=i-n||1;return e*t/r+o}}},$r={class:"gauge"},Mr=["viewBox"],xr=["id"],Ar=[s.createElementVNode("feFlood",{"flood-color":"#c7c6c6"},null,-1),s.createElementVNode("feComposite",{in2:"SourceAlpha",operator:"out"},null,-1),s.createElementVNode("feGaussianBlur",{stdDeviation:"2",result:"blur"},null,-1),s.createElementVNode("feComposite",{operator:"atop",in2:"SourceGraphic"},null,-1)],Dr=["id"],Nr=["offset","stop-color"],Pr=["id"],jr=["r","cx","cy"],Rr=["r","cx","cy"],Gr=["d"],Br=["mask"],Fr=["r","cx","cy","fill"],Vr=["d","fill"],Ur=["r","cx","cy","fill"],zr=["d","fill","filter"],Lr=["x1","y1","x2","y2","stroke"],Hr=["height"];function Kr(e,n,i,o,t,r){return s.openBlock(),s.createElementBlock("div",$r,[r.height?(s.openBlock(),s.createElementBlock("svg",{key:0,viewBox:`0 0 ${t.RADIUS*2} ${r.height}`,height:"100%",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[s.createElementVNode("defs",null,[s.createElementVNode("filter",{id:`innershadow-${o.uid}`},Ar,8,xr),r.hasGradient?(s.openBlock(),s.createElementBlock("linearGradient",{key:0,id:`gaugeGradient-${o.uid}`},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.gaugeColor,(a,l)=>(s.openBlock(),s.createElementBlock("stop",{key:`${a.color}-${l}`,offset:`${a.offset}%`,"stop-color":a.color},null,8,Nr))),128))],8,Dr)):s.createCommentVNode("",!0),s.createElementVNode("mask",{id:`innerCircle-${o.uid}`},[s.createElementVNode("circle",{r:t.RADIUS-.5,cx:t.X_CENTER,cy:t.Y_CENTER,fill:"white"},null,8,jr),s.createElementVNode("circle",{r:i.innerRadius,cx:t.X_CENTER,cy:t.Y_CENTER,fill:"black"},null,8,Rr),r.separatorPaths?(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:0},s.renderList(r.separatorPaths,(a,l)=>(s.openBlock(),s.createElementBlock("path",{key:l,d:a,fill:"black"},null,8,Gr))),128)):s.createCommentVNode("",!0)],8,Pr)]),s.createElementVNode("g",{mask:`url(#innerCircle-${o.uid})`},[r.isCircle?(s.openBlock(),s.createElementBlock("circle",{key:0,r:t.RADIUS,cx:t.X_CENTER,cy:t.Y_CENTER,fill:r.hasGradient?`url(#gaugeGradient-${o.uid})`:i.gaugeColor},null,8,Fr)):(s.openBlock(),s.createElementBlock("path",{key:1,d:r.basePath,fill:r.hasGradient?`url(#gaugeGradient-${o.uid})`:i.gaugeColor},null,8,Vr)),i.value===i.min&&r.isCircle?(s.openBlock(),s.createElementBlock("circle",{key:2,r:t.RADIUS,cx:t.X_CENTER,cy:t.Y_CENTER,fill:i.baseColor},null,8,Ur)):(s.openBlock(),s.createElementBlock("path",{key:3,d:r.gaugePath,fill:i.baseColor,filter:`url(#innershadow-${o.uid})`},null,8,zr))],8,Br),r.scaleLines?(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:0},s.renderList(r.scaleLines,(a,l)=>(s.openBlock(),s.createElementBlock("line",{key:`${a.xE}-${l}`,x1:a.xS,y1:a.yS,x2:a.xE,y2:a.yE,"stroke-width":"1",stroke:i.baseColor},null,8,Lr))),128)):s.createCommentVNode("",!0),(s.openBlock(),s.createElementBlock("foreignObject",{x:"0",y:"0",width:"100%",height:r.height},[s.renderSlot(e.$slots,"default")],8,Hr))],8,Mr)):s.createCommentVNode("",!0)])}return Ir(Or,[["render",Kr]])});