cione-comp-lib
Version:
`$ yarn add cione-comp-lib` 或者 `$ npm i cione-comp-lib -S`
2 lines (1 loc) • 1.36 kB
JavaScript
;Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),require("../../echarts/lib/echarts.js");var e=require("../../echarts/lib/util/graphic.js").extendShape({type:"ec-liquid-fill",shape:{waveLength:0,radius:0,radiusY:0,cx:0,cy:0,waterLevel:0,amplitude:0,phase:0,inverse:!1},buildPath:function(e,t){null==t.radiusY&&(t.radiusY=t.radius);for(var r=Math.max(2*Math.ceil(2*t.radius/t.waveLength*4),8);t.phase<2*-Math.PI;)t.phase+=2*Math.PI;for(;t.phase>0;)t.phase-=2*Math.PI;var i=t.phase/Math.PI/2*t.waveLength,h=t.cx-t.radius+i-2*t.radius;e.moveTo(h,t.waterLevel);for(var s=0,l=0;l<r;++l){var u=l%4,v=a(l*t.waveLength/4,u,t.waveLength,t.amplitude);e.bezierCurveTo(v[0][0]+h,-v[0][1]+t.waterLevel,v[1][0]+h,-v[1][1]+t.waterLevel,v[2][0]+h,-v[2][1]+t.waterLevel),l===r-1&&(s=v[2][0])}t.inverse?(e.lineTo(s+h,t.cy-t.radiusY),e.lineTo(h,t.cy-t.radiusY),e.lineTo(h,t.waterLevel)):(e.lineTo(s+h,t.cy+t.radiusY),e.lineTo(h,t.cy+t.radiusY),e.lineTo(h,t.waterLevel)),e.closePath()}});function a(e,a,t,r){return 0===a?[[e+.5*t/Math.PI/2,r/2],[e+.5*t/Math.PI,r],[e+t/4,r]]:1===a?[[e+.5*t/Math.PI/2*(Math.PI-2),r],[e+.5*t/Math.PI/2*(Math.PI-1),r/2],[e+t/4,0]]:2===a?[[e+.5*t/Math.PI/2,-r/2],[e+.5*t/Math.PI,-r],[e+t/4,-r]]:[[e+.5*t/Math.PI/2*(Math.PI-2),-r],[e+.5*t/Math.PI/2*(Math.PI-1),-r/2],[e+t/4,0]]}exports.default=e;