@idux/charts-core 0.8.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -2
- package/dist/components/Chart.d.ts +4 -3
- package/dist/components/index.d.ts +3 -1
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/useChart.d.ts +4 -4
- package/dist/composables/useReactiveAttrs.d.ts +2 -0
- package/dist/composables/useResizeObserver.d.ts +2 -2
- package/dist/composables/useStripe.d.ts +17 -8
- package/dist/index.js +1108 -957
- package/dist/index.umd.cjs +7 -7
- package/dist/types/index.d.ts +12 -5
- package/dist/utils/index.d.ts +3 -1
- package/dist/utils/withChartProps.d.ts +30 -0
- package/package.json +14 -8
package/dist/index.umd.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("echarts/components"),require("echarts/features"),require("echarts/renderers"),require("vue-demi"),require("echarts/charts"),require("echarts/core"),require("lodash-es")):typeof define==`function`&&define.amd?define([`exports`,`echarts/components`,`echarts/features`,`echarts/renderers`,`vue-demi`,`echarts/charts`,`echarts/core`,`lodash-es`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.IduxChartsCore={},e.echarts,e.echarts,e.echarts,e.VueDemi,e.echarts,e.echarts,e._))})(this,function(e,t,n,r,i,a,o,s){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function c(e,t,n){(0,i.watch)([e,t,n],([e,n,r],i,a)=>{if(!e||!n||!r)return;let o,s=()=>{o===void 0&&(o=requestAnimationFrame(()=>{o=void 0,t.value===n&&n.resize()}))};u(e,s),a(()=>{d(e,s),o!==void 0&&cancelAnimationFrame(o)})})}var l=new Map;function u(e,t,n){if(e&&t){if(l.has(e))l.get(e).listeners.push(t);else{let r=[t],i=new ResizeObserver(e=>{e.forEach(e=>r.forEach(t=>t(e)))});i.observe(e,n),l.set(e,{listeners:r,ro:i})}}}function d(e,t){if(!e||!t||!l.has(e))return;let{listeners:n,ro:r}=l.get(e),i=n.indexOf(t);i>-1&&(n.splice(i,1),n.length===0&&(r.disconnect(),l.delete(e)))}(0,o.use)([a.PictorialBarChart]);var f={text:`加载中...`};function p(e,t){let n=()=>typeof t==`function`?t():t,r=(0,i.shallowRef)(),a=(0,i.shallowRef)(),l=(0,i.shallowRef)(),u=(0,i.computed)(()=>(0,i.unref)(e).autoResize??!0),d=(0,i.computed)(()=>(0,i.unref)(e).group),p=(0,i.computed)(()=>(0,i.unref)(e).initOption),m=(0,i.computed)(()=>(0,i.unref)(e).loading),h=(0,i.computed)(()=>(0,i.unref)(e).setOptionOpts),_=(0,i.computed)(()=>(0,i.unref)(e).theme??`seer`),v=[],y=(e,t)=>{v=v.filter(n=>{let r=t.some(([e,t,r])=>e===n.name&&t===n.handler&&r===n.once);return r||e.off(n.name,n.wrapped),r}),t.forEach(([t,n,r])=>{if(v.some(e=>e.name===t&&e.handler===n&&e.once===r))return;let i=(...a)=>{r&&e.off(t,i),n(...a)};v.push({name:t,handler:n,once:r,wrapped:i}),e.on(t,i)})},b=()=>{let t=r.value;if(!t)return;let c=(0,o.init)(t,_.value,p.value),u=(0,i.unref)(e),{restOptions:d,events:f}=g(u,n(),!1);c.setOption(d,h.value),l.value=(0,s.cloneDeep)(d),y(c,f);let m=u.onReady||n()?.ready;m&&m(c),a.value=c},x=()=>{a.value&&(a.value.dispose(),a.value=void 0,v=[])};return(0,i.onMounted)(()=>b()),(0,i.onBeforeUnmount)(()=>x()),(0,i.onUpdated)(()=>{a.value&&y(a.value,g((0,i.unref)(e),n(),!1).events)}),(0,i.watch)(()=>(0,i.unref)(e),e=>{let t=a.value;if(!t)return;let{restOptions:r,events:i}=g(e,n(),!1);y(t,i),(0,s.isEqual)(r,l.value)||(t.setOption(r,h.value),l.value=(0,s.cloneDeep)(r))},{deep:!0}),(0,i.watch)([()=>(0,s.cloneDeep)(_.value),()=>(0,s.cloneDeep)(p.value)],([e,t],[n,r])=>{(0,s.isEqual)(e,n)&&(0,s.isEqual)(t,r)||(x(),b())}),(0,i.watchEffect)(()=>{let e=d.value;a.value&&(a.value.group=e??``)}),(0,i.watchEffect)(()=>{let e=a.value;if(!e)return;let t=m.value;t?e.showLoading((0,s.isBoolean)(t)?f:{...f,...t}):e.hideLoading()}),c(r,a,u),{containerRef:r,chartRef:a}}function m(e){return/^on[^a-z]/.test(e)}var h=[`class`,`style`,`autoResize`,`initOption`,`group`,`loading`,`setOptionOpts`,`theme`,`onReady`];function g(e,t={},n=!0){let r={},a=[];return Object.keys(e).forEach(t=>{if(!h.includes(t)){if(m(t)){if(n)return;let r=e[t];if(r){let e=t.endsWith(`Once`),n=e?t.length-4:void 0,i=t.charAt(2).toLowerCase()+t.substring(3,n);a.push([i,r,e])}}else r[t]=e[t]}}),i.isVue2&&!n&&Object.keys(t).forEach(e=>{if(e===`ready`||e===`~ready`)return;let n=t[e];if(n){let t=e.startsWith(`~`),r=+!!t,i=e.substring(r);a.push([i,n,t])}}),{restOptions:r,events:a}}function _(e,t){return`
|
|
2
2
|
<div class="charts-tooltips">
|
|
3
3
|
<div class="charts-tooltips-title">${e}</div>
|
|
4
|
-
${t.map(
|
|
4
|
+
${t.map(e=>`
|
|
5
5
|
<div class="charts-tooltips-item">
|
|
6
|
-
<span class="charts-tooltips-item-border" style="background: ${
|
|
7
|
-
<span class="charts-tooltips-item-name">${
|
|
8
|
-
<span class="charts-tooltips-item-value">${
|
|
9
|
-
</div>`).join(
|
|
10
|
-
</div>`}function j({data:e=[],color:t="",offset:r=[0,0],rotate:n=-20,size:a=[2,8]}){return{name:"",data:e,type:"pictorialBar",symbolRotate:n,silent:!0,itemStyle:{color:t,opacity:0},emphasis:{itemStyle:{opacity:1}},symbolRepeat:"fixed",symbolMargin:2,symbol:"rect",symbolClip:!0,symbolSize:a,symbolPosition:"start",symbolOffset:r,z:1,animationEasing:"elasticOut"}}function ot(e){return{axisPointer:{lineStyle:{opacity:.6}},formatter:function(t){if(!(t!=null&&t.length))return"";const r=t[0].name,n=t.filter(a=>!!a.seriesName).map(a=>({name:a.seriesName,value:`${a.value} ${e}`,color:a.color}));return W(r,n)}}}function ft({series:e,color:t,offset:r=[0,0],rotate:n,size:a}){return[{type:"bar",z:0,...e},j({data:e.data,offset:r,color:t,rotate:n,size:a})]}function ht(){return{aria:{enabled:!0,decal:{show:!0,decals:[{color:"white",dashArrayX:[1,0],dashArrayY:[6,0],symbolSize:.5,rotation:Math.PI/2}]}}}}const q=h.defineComponent({name:"IxChart",inheritAttrs:!1,setup(e,{attrs:t,listeners:r}){const{containerRef:n}=P(t,r);return{containerRef:n}},render(){const{class:e,style:t}=this.$attrs;return h.h("div",{ref:"containerRef",class:e,style:{width:"100%",height:"100%",...t}})}});function u(e,t){ct(e)&&(e="100%");var r=ut(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function w(e){return Math.min(1,Math.max(0,e))}function ct(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function ut(e){return typeof e=="string"&&e.indexOf("%")!==-1}function G(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function R(e){return e<=1?"".concat(Number(e)*100,"%"):e}function F(e){return e.length===1?"0"+e:String(e)}function lt(e,t,r){return{r:u(e,255)*255,g:u(t,255)*255,b:u(r,255)*255}}function $(e,t,r){e=u(e,255),t=u(t,255),r=u(r,255);var n=Math.max(e,t,r),a=Math.min(e,t,r),i=0,s=0,o=(n+a)/2;if(n===a)s=0,i=0;else{var c=n-a;switch(s=o>.5?c/(2-n-a):c/(n+a),n){case e:i=(t-r)/c+(t<r?6:0);break;case t:i=(r-e)/c+2;break;case r:i=(e-t)/c+4;break}i/=6}return{h:i,s,l:o}}function H(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*(6*r):r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function dt(e,t,r){var n,a,i;if(e=u(e,360),t=u(t,100),r=u(r,100),t===0)a=r,i=r,n=r;else{var s=r<.5?r*(1+t):r+t-r*t,o=2*r-s;n=H(o,s,e+1/3),a=H(o,s,e),i=H(o,s,e-1/3)}return{r:n*255,g:a*255,b:i*255}}function V(e,t,r){e=u(e,255),t=u(t,255),r=u(r,255);var n=Math.max(e,t,r),a=Math.min(e,t,r),i=0,s=n,o=n-a,c=n===0?0:o/n;if(n===a)i=0;else{switch(n){case e:i=(t-r)/o+(t<r?6:0);break;case t:i=(r-e)/o+2;break;case r:i=(e-t)/o+4;break}i/=6}return{h:i,s:c,v:s}}function gt(e,t,r){e=u(e,360)*6,t=u(t,100),r=u(r,100);var n=Math.floor(e),a=e-n,i=r*(1-t),s=r*(1-a*t),o=r*(1-(1-a)*t),c=n%6,m=[r,s,i,i,o,r][c],C=[o,r,r,s,i,i][c],k=[i,i,o,r,r,s][c];return{r:m*255,g:C*255,b:k*255}}function U(e,t,r,n){var a=[F(Math.round(e).toString(16)),F(Math.round(t).toString(16)),F(Math.round(r).toString(16))];return n&&a[0].startsWith(a[0].charAt(1))&&a[1].startsWith(a[1].charAt(1))&&a[2].startsWith(a[2].charAt(1))?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function pt(e,t,r,n,a){var i=[F(Math.round(e).toString(16)),F(Math.round(t).toString(16)),F(Math.round(r).toString(16)),F(bt(n))];return a&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))&&i[3].startsWith(i[3].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}function bt(e){return Math.round(parseFloat(e)*255).toString(16)}function _(e){return l(e)/255}function l(e){return parseInt(e,16)}function vt(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}var T={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function yt(e){var t={r:0,g:0,b:0},r=1,n=null,a=null,i=null,s=!1,o=!1;return typeof e=="string"&&(e=xt(e)),typeof e=="object"&&(v(e.r)&&v(e.g)&&v(e.b)?(t=lt(e.r,e.g,e.b),s=!0,o=String(e.r).substr(-1)==="%"?"prgb":"rgb"):v(e.h)&&v(e.s)&&v(e.v)?(n=R(e.s),a=R(e.v),t=gt(e.h,n,a),s=!0,o="hsv"):v(e.h)&&v(e.s)&&v(e.l)&&(n=R(e.s),i=R(e.l),t=dt(e.h,n,i),s=!0,o="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(r=e.a)),r=G(r),{ok:s,format:e.format||o,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:r}}var mt="[-\\+]?\\d+%?",Ft="[-\\+]?\\d*\\.\\d+%?",y="(?:".concat(Ft,")|(?:").concat(mt,")"),O="[\\s|\\(]+(".concat(y,")[,|\\s]+(").concat(y,")[,|\\s]+(").concat(y,")\\s*\\)?"),E="[\\s|\\(]+(".concat(y,")[,|\\s]+(").concat(y,")[,|\\s]+(").concat(y,")[,|\\s]+(").concat(y,")\\s*\\)?"),g={CSS_UNIT:new RegExp(y),rgb:new RegExp("rgb"+O),rgba:new RegExp("rgba"+E),hsl:new RegExp("hsl"+O),hsla:new RegExp("hsla"+E),hsv:new RegExp("hsv"+O),hsva:new RegExp("hsva"+E),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function xt(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(T[e])e=T[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r=g.rgb.exec(e);return r?{r:r[1],g:r[2],b:r[3]}:(r=g.rgba.exec(e),r?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=g.hsl.exec(e),r?{h:r[1],s:r[2],l:r[3]}:(r=g.hsla.exec(e),r?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=g.hsv.exec(e),r?{h:r[1],s:r[2],v:r[3]}:(r=g.hsva.exec(e),r?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=g.hex8.exec(e),r?{r:l(r[1]),g:l(r[2]),b:l(r[3]),a:_(r[4]),format:t?"name":"hex8"}:(r=g.hex6.exec(e),r?{r:l(r[1]),g:l(r[2]),b:l(r[3]),format:t?"name":"hex"}:(r=g.hex4.exec(e),r?{r:l(r[1]+r[1]),g:l(r[2]+r[2]),b:l(r[3]+r[3]),a:_(r[4]+r[4]),format:t?"name":"hex8"}:(r=g.hex3.exec(e),r?{r:l(r[1]+r[1]),g:l(r[2]+r[2]),b:l(r[3]+r[3]),format:t?"name":"hex"}:!1)))))))))}function v(e){return!!g.CSS_UNIT.exec(String(e))}var St=function(){function e(t,r){t===void 0&&(t=""),r===void 0&&(r={});var n;if(t instanceof e)return t;typeof t=="number"&&(t=vt(t)),this.originalInput=t;var a=yt(t);this.originalInput=t,this.r=a.r,this.g=a.g,this.b=a.b,this.a=a.a,this.roundA=Math.round(100*this.a)/100,this.format=(n=r.format)!==null&&n!==void 0?n:a.format,this.gradientType=r.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=a.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},e.prototype.getLuminance=function(){var t=this.toRgb(),r,n,a,i=t.r/255,s=t.g/255,o=t.b/255;return i<=.03928?r=i/12.92:r=Math.pow((i+.055)/1.055,2.4),s<=.03928?n=s/12.92:n=Math.pow((s+.055)/1.055,2.4),o<=.03928?a=o/12.92:a=Math.pow((o+.055)/1.055,2.4),.2126*r+.7152*n+.0722*a},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(t){return this.a=G(t),this.roundA=Math.round(100*this.a)/100,this},e.prototype.isMonochrome=function(){var t=this.toHsl().s;return t===0},e.prototype.toHsv=function(){var t=V(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}},e.prototype.toHsvString=function(){var t=V(this.r,this.g,this.b),r=Math.round(t.h*360),n=Math.round(t.s*100),a=Math.round(t.v*100);return this.a===1?"hsv(".concat(r,", ").concat(n,"%, ").concat(a,"%)"):"hsva(".concat(r,", ").concat(n,"%, ").concat(a,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var t=$(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}},e.prototype.toHslString=function(){var t=$(this.r,this.g,this.b),r=Math.round(t.h*360),n=Math.round(t.s*100),a=Math.round(t.l*100);return this.a===1?"hsl(".concat(r,", ").concat(n,"%, ").concat(a,"%)"):"hsla(".concat(r,", ").concat(n,"%, ").concat(a,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(t){return t===void 0&&(t=!1),U(this.r,this.g,this.b,t)},e.prototype.toHexString=function(t){return t===void 0&&(t=!1),"#"+this.toHex(t)},e.prototype.toHex8=function(t){return t===void 0&&(t=!1),pt(this.r,this.g,this.b,this.a,t)},e.prototype.toHex8String=function(t){return t===void 0&&(t=!1),"#"+this.toHex8(t)},e.prototype.toHexShortString=function(t){return t===void 0&&(t=!1),this.a===1?this.toHexString(t):this.toHex8String(t)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var t=Math.round(this.r),r=Math.round(this.g),n=Math.round(this.b);return this.a===1?"rgb(".concat(t,", ").concat(r,", ").concat(n,")"):"rgba(".concat(t,", ").concat(r,", ").concat(n,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var t=function(r){return"".concat(Math.round(u(r,255)*100),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var t=function(r){return Math.round(u(r,255)*100)};return this.a===1?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var t="#"+U(this.r,this.g,this.b,!1),r=0,n=Object.entries(T);r<n.length;r++){var a=n[r],i=a[0],s=a[1];if(t===s)return i}return!1},e.prototype.toString=function(t){var r=!!t;t=t??this.format;var n=!1,a=this.a<1&&this.a>=0,i=!r&&a&&(t.startsWith("hex")||t==="name");return i?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(n=this.toRgbString()),t==="prgb"&&(n=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(n=this.toHexString()),t==="hex3"&&(n=this.toHexString(!0)),t==="hex4"&&(n=this.toHex8String(!0)),t==="hex8"&&(n=this.toHex8String()),t==="name"&&(n=this.toName()),t==="hsl"&&(n=this.toHslString()),t==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.l+=t/100,r.l=w(r.l),new e(r)},e.prototype.brighten=function(t){t===void 0&&(t=10);var r=this.toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(t/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(t/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(t/100)))),new e(r)},e.prototype.darken=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.l-=t/100,r.l=w(r.l),new e(r)},e.prototype.tint=function(t){return t===void 0&&(t=10),this.mix("white",t)},e.prototype.shade=function(t){return t===void 0&&(t=10),this.mix("black",t)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.s-=t/100,r.s=w(r.s),new e(r)},e.prototype.saturate=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.s+=t/100,r.s=w(r.s),new e(r)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var r=this.toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,new e(r)},e.prototype.mix=function(t,r){r===void 0&&(r=50);var n=this.toRgb(),a=new e(t).toRgb(),i=r/100,s={r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a};return new e(s)},e.prototype.analogous=function(t,r){t===void 0&&(t=6),r===void 0&&(r=30);var n=this.toHsl(),a=360/r,i=[this];for(n.h=(n.h-(a*t>>1)+720)%360;--t;)n.h=(n.h+a)%360,i.push(new e(n));return i},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var r=this.toHsv(),n=r.h,a=r.s,i=r.v,s=[],o=1/t;t--;)s.push(new e({h:n,s:a,v:i})),i=(i+o)%1;return s},e.prototype.splitcomplement=function(){var t=this.toHsl(),r=t.h;return[this,new e({h:(r+72)%360,s:t.s,l:t.l}),new e({h:(r+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var r=this.toRgb(),n=new e(t).toRgb(),a=r.a+n.a*(1-r.a);return new e({r:(r.r*r.a+n.r*n.a*(1-r.a))/a,g:(r.g*r.a+n.g*n.a*(1-r.a))/a,b:(r.b*r.a+n.b*n.a*(1-r.a))/a,a})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var r=this.toHsl(),n=r.h,a=[this],i=360/t,s=1;s<t;s++)a.push(new e({h:(n+s*i)%360,s:r.s,l:r.l}));return a},e.prototype.equals=function(t){return this.toRgbString()===new e(t).toRgbString()},e}();const D=["#458FFF","#45D9A3","#FFC145","#F5654F","#6A6AFD","#6ED1FF","#008787","#FF9245","#F587B3","#8352CC","#65779B"],At=["#458FFF","#C8DEFF","#45D9A3","#C8F4E4","#FFC145","#FFEDC8","#F5654F","#FCD1CB","#6A6AFD","#D3D3FE","#6ED1FF","#D3D3FE","#008787","#B3DBDB","#FF9245","#FFDFC8","#F587B3","#FCDBE8","#8352CC","#FCDBE8","#65779B","#65779B"],Mt=["#8C1604","#DB4C35","#FF9245","#FFC145","#689FFF","#45D9A3","#99ACD1"],Z={color:D,textStyle:{color:"#6F7785",fontSize:"12px"},bar:{barGap:.2,barWidth:10,label:{color:"#6F7785",position:"top"}},line:{label:{color:"#6F7785",position:"top"}},pie:{avoidLabelOverlap:!1,radius:["70%","80%"],itemStyle:{borderWidth:1,borderColor:"#fff"},label:{show:!1,color:"#2F3540",formatter:"{c}",position:"inside"}},legend:{itemWidth:12,itemHeight:12,inactiveColor:"#BEC3CC",textStyle:{color:"#6F7785",fontSize:"12px"}},title:{itemGap:4,textStyle:{color:"#2F3540",fontSize:"12px",fontWeight:500},subtextStyle:{color:"#6F7785",fontSize:"12px"}},tooltip:{borderWidth:0,padding:12,textStyle:{color:"#2F3540"},axisPointer:{z:1,lineStyle:{type:"solid",color:"#E1E5EB"}}},categoryAxis:{axisLine:{show:!0,lineStyle:{color:"#EDF1F7"}},axisTick:{show:!0,alignWithLabel:!0,lineStyle:{color:"#EDF1F7"}},axisLabel:{color:"#6F7785"},splitLine:{show:!1},splitArea:{show:!1}},valueAxis:{axisLine:{show:!1},axisTick:{show:!1},axisLabel:{color:"#6F7785"},splitLine:{lineStyle:{color:"#EDF1F7"}},splitArea:{show:!1},nameTextStyle:{color:"#6F7785",padding:[0,30,-4,0]}},dataZoom:{height:16}};function wt(e){return!!(e&&e.xAxis&&e.xAxis.data)}function Rt(e,t){return h.isVue2?{attrs:{...e},on:{...t}}:{...e}}function Ct(e){return Object.entries(e).reduce((t,[r,n])=>(n!==void 0&&(t[r]=n),t),{})}function kt(e){return M.isNil(e)?[]:Array.isArray(e)?e:[e]}const Ht=(e,t)=>new St(e).setAlpha(t).toRgbString();function X(e,t){A.use(t),A.registerTheme("seer",Z);const r=n=>{n.component(e.name,e)};e.install=r}X(q,[b.DataZoomComponent,b.LegendComponent,b.GridComponent,b.TitleComponent,b.TooltipComponent,I.LabelLayout,I.UniversalTransition,et.SVGRenderer]);const Tt=q;f.IxChart=Tt,f.convertArray=kt,f.createInstall=X,f.filterEmptyProps=Ct,f.getAlphaColor=Ht,f.isVertical=wt,f.mergeAttrs=Rt,f.seerColors=D,f.seerColorsForMore=At,f.seerColorsForRisk=Mt,f.seerTheme=Z,f.useChart=P,f.useStripe=j,f.useStripeArea=ht,f.useStripeBarSeries=ft,f.useStripeBarTooltip=ot,f.useTooltipsFormatter=W,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
|
|
6
|
+
<span class="charts-tooltips-item-border" style="background: ${e.color}"></span>
|
|
7
|
+
<span class="charts-tooltips-item-name">${e.name}</span>
|
|
8
|
+
<span class="charts-tooltips-item-value">${e.value}</span>
|
|
9
|
+
</div>`).join(``)}
|
|
10
|
+
</div>`}function v({data:e=[],color:t=``,offset:n=[0,0],rotate:r=-20,size:i=[2,8]}){return{name:``,data:e,type:`pictorialBar`,symbolRotate:r,silent:!0,itemStyle:{color:t,opacity:0},emphasis:{itemStyle:{opacity:1}},symbolRepeat:`fixed`,symbolMargin:2,symbol:`rect`,symbolClip:!0,symbolSize:i,symbolPosition:`start`,symbolOffset:n,z:1,animationEasing:`elasticOut`}}function y(e){return{axisPointer:{lineStyle:{opacity:.6}},formatter:function(t){if(!t?.length)return``;let n=t[0].name;return _(n,t.filter(e=>!!e.seriesName).map(t=>({name:t.seriesName,value:`${t.value} ${e}`,color:t.color})))}}}function b({series:e,color:t,offset:n=[0,0],rotate:r,size:i}){return[{type:`bar`,z:0,...e},v({data:e.data,offset:n,color:t,rotate:r,size:i})]}function x(){return{aria:{enabled:!0,decal:{show:!0,decals:[{color:`white`,dashArrayX:[1,0],dashArrayY:[6,0],symbolSize:.5,rotation:Math.PI/2}]}}}}var S={"auto-resize":`autoResize`,"init-option":`initOption`,"set-option-opts":`setOptionOpts`};function C(e){let t=(0,i.getCurrentInstance)()?.proxy,n=()=>Object.fromEntries(Object.entries(i.isVue2&&t?t.$attrs:e).map(([e,t])=>[S[e]??e,t]));if(i.isVue2&&t)return(0,i.computed)(n);let r=(0,i.shallowRef)(n());return(0,i.onBeforeUpdate)(()=>{let e=n(),t=r.value;(Object.keys(t).length!==Object.keys(e).length||Object.keys(e).some(n=>!Object.is(t[n],e[n])))&&(r.value=e)}),r}function w(){return e=>e}var ee=w()((0,i.defineComponent)({name:`IxChart`,inheritAttrs:!1,setup(e,t){let{containerRef:n}=p(C(t.attrs),()=>t.listeners??{});return{containerRef:n}},render(){let{class:e,style:t}=this.$attrs;return(0,i.h)(`div`,{ref:`containerRef`,class:e,style:{width:`100%`,height:`100%`,...t}})}}));function T(e,t){D(e)&&(e=`100%`);let n=O(e);return e=t===360?parseFloat(e):Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(e=t===360?(e<0?e%t+t:e%t)/t:e%t/t,e)}function E(e){return Math.min(1,Math.max(0,e))}function D(e){return typeof e==`string`&&e.indexOf(`.`)!==-1&&!O(e)&&parseFloat(e)===1}function O(e){return typeof e==`string`&&e.indexOf(`%`)!==-1}function k(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function A(e){return Number(e)<=1?`${Number(e)*100}%`:e}function j(e){if(typeof e!=`number`||!(e<=1))return A(e);let t=Math.min(100,Math.max(0,e*100))*100;return(t>=1e-6?Math.trunc(t):parseInt(String(t),10))/100}function M(e){return e.length===1?`0`+e:String(e)}function te(e,t,n){return{r:T(e,255)*255,g:T(t,255)*255,b:T(n,255)*255}}function N(e,t,n){e=T(e,255),t=T(t,255),n=T(n,255);let r=Math.max(e,t,n),i=Math.min(e,t,n),a=0,o,s=(r+i)/2;if(r===i)o=0,a=0;else{let c=r-i;switch(o=s>.5?c/(2-r-i):c/(r+i),r){case e:a=(t-n)/c+(t<n?6:0);break;case t:a=(n-e)/c+2;break;case n:a=(e-t)/c+4}a/=6}return{h:a,s:o,l:s}}function P(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function ne(e,t,n){let r,i,a;if(e=T(e,360),t=T(t,100),n=T(n,100),t===0)i=n,a=n,r=n;else{let o=n<.5?n*(1+t):n+t-n*t,s=2*n-o;r=P(s,o,e+1/3),i=P(s,o,e),a=P(s,o,e-1/3)}return{r:r*255,g:i*255,b:a*255}}function F(e,t,n){e=T(e,255),t=T(t,255),n=T(n,255);let r=Math.max(e,t,n),i=Math.min(e,t,n),a=0,o=r,s=r-i,c=r===0?0:s/r;if(r===i)a=0;else{switch(r){case e:a=(t-n)/s+(t<n?6:0);break;case t:a=(n-e)/s+2;break;case n:a=(e-t)/s+4}a/=6}return{h:a,s:c,v:o}}function I(e,t,n){e=T(e,360)*6,t=T(t,100),n=T(n,100);let r=Math.floor(e),i=e-r,a=n*(1-t),o=n*(1-i*t),s=n*(1-(1-i)*t),c=r%6,l=[n,o,a,a,s,n][c],u=[s,n,n,o,a,a][c],d=[a,a,s,n,n,o][c];return{r:l*255,g:u*255,b:d*255}}function L(e){return e<10?48+e:87+e}function R(e){let t=Math.round(e);return t>=0&&t<=255?String.fromCharCode(L(t>>4),L(t&15)):M(t.toString(16))}function z(e){return R(parseFloat(e)*255)}function B(e,t,n,r){let i=R(e),a=R(t),o=R(n);return r&&i.startsWith(i.charAt(1))&&a.startsWith(a.charAt(1))&&o.startsWith(o.charAt(1))?i.charAt(0)+a.charAt(0)+o.charAt(0):i+a+o}function re(e,t,n,r,i){let a=R(e),o=R(t),s=R(n),c=z(r);return i&&a.startsWith(a.charAt(1))&&o.startsWith(o.charAt(1))&&s.startsWith(s.charAt(1))&&c.startsWith(c.charAt(1))?a.charAt(0)+o.charAt(0)+s.charAt(0)+c.charAt(0):a+o+s+c}function ie(e,t,n,r){let i=e/100,a=t/100,o=n/100,s=r/100;return{r:255*(1-i)*(1-s),g:255*(1-a)*(1-s),b:255*(1-o)*(1-s)}}function V(e,t,n){let r=1-e/255,i=1-t/255,a=1-n/255,o=Math.min(r,i,a);return o===1?(r=0,i=0,a=0):(r=(r-o)/(1-o)*100,i=(i-o)/(1-o)*100,a=(a-o)/(1-o)*100),o*=100,{c:Math.round(r),m:Math.round(i),y:Math.round(a),k:Math.round(o)}}function H(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}var U={aliceblue:`#f0f8ff`,antiquewhite:`#faebd7`,aqua:`#00ffff`,aquamarine:`#7fffd4`,azure:`#f0ffff`,beige:`#f5f5dc`,bisque:`#ffe4c4`,black:`#000000`,blanchedalmond:`#ffebcd`,blue:`#0000ff`,blueviolet:`#8a2be2`,brown:`#a52a2a`,burlywood:`#deb887`,cadetblue:`#5f9ea0`,chartreuse:`#7fff00`,chocolate:`#d2691e`,coral:`#ff7f50`,cornflowerblue:`#6495ed`,cornsilk:`#fff8dc`,crimson:`#dc143c`,cyan:`#00ffff`,darkblue:`#00008b`,darkcyan:`#008b8b`,darkgoldenrod:`#b8860b`,darkgray:`#a9a9a9`,darkgreen:`#006400`,darkgrey:`#a9a9a9`,darkkhaki:`#bdb76b`,darkmagenta:`#8b008b`,darkolivegreen:`#556b2f`,darkorange:`#ff8c00`,darkorchid:`#9932cc`,darkred:`#8b0000`,darksalmon:`#e9967a`,darkseagreen:`#8fbc8f`,darkslateblue:`#483d8b`,darkslategray:`#2f4f4f`,darkslategrey:`#2f4f4f`,darkturquoise:`#00ced1`,darkviolet:`#9400d3`,deeppink:`#ff1493`,deepskyblue:`#00bfff`,dimgray:`#696969`,dimgrey:`#696969`,dodgerblue:`#1e90ff`,firebrick:`#b22222`,floralwhite:`#fffaf0`,forestgreen:`#228b22`,fuchsia:`#ff00ff`,gainsboro:`#dcdcdc`,ghostwhite:`#f8f8ff`,goldenrod:`#daa520`,gold:`#ffd700`,gray:`#808080`,green:`#008000`,greenyellow:`#adff2f`,grey:`#808080`,honeydew:`#f0fff0`,hotpink:`#ff69b4`,indianred:`#cd5c5c`,indigo:`#4b0082`,ivory:`#fffff0`,khaki:`#f0e68c`,lavenderblush:`#fff0f5`,lavender:`#e6e6fa`,lawngreen:`#7cfc00`,lemonchiffon:`#fffacd`,lightblue:`#add8e6`,lightcoral:`#f08080`,lightcyan:`#e0ffff`,lightgoldenrodyellow:`#fafad2`,lightgray:`#d3d3d3`,lightgreen:`#90ee90`,lightgrey:`#d3d3d3`,lightpink:`#ffb6c1`,lightsalmon:`#ffa07a`,lightseagreen:`#20b2aa`,lightskyblue:`#87cefa`,lightslategray:`#778899`,lightslategrey:`#778899`,lightsteelblue:`#b0c4de`,lightyellow:`#ffffe0`,lime:`#00ff00`,limegreen:`#32cd32`,linen:`#faf0e6`,magenta:`#ff00ff`,maroon:`#800000`,mediumaquamarine:`#66cdaa`,mediumblue:`#0000cd`,mediumorchid:`#ba55d3`,mediumpurple:`#9370db`,mediumseagreen:`#3cb371`,mediumslateblue:`#7b68ee`,mediumspringgreen:`#00fa9a`,mediumturquoise:`#48d1cc`,mediumvioletred:`#c71585`,midnightblue:`#191970`,mintcream:`#f5fffa`,mistyrose:`#ffe4e1`,moccasin:`#ffe4b5`,navajowhite:`#ffdead`,navy:`#000080`,oldlace:`#fdf5e6`,olive:`#808000`,olivedrab:`#6b8e23`,orange:`#ffa500`,orangered:`#ff4500`,orchid:`#da70d6`,palegoldenrod:`#eee8aa`,palegreen:`#98fb98`,paleturquoise:`#afeeee`,palevioletred:`#db7093`,papayawhip:`#ffefd5`,peachpuff:`#ffdab9`,peru:`#cd853f`,pink:`#ffc0cb`,plum:`#dda0dd`,powderblue:`#b0e0e6`,purple:`#800080`,rebeccapurple:`#663399`,red:`#ff0000`,rosybrown:`#bc8f8f`,royalblue:`#4169e1`,saddlebrown:`#8b4513`,salmon:`#fa8072`,sandybrown:`#f4a460`,seagreen:`#2e8b57`,seashell:`#fff5ee`,sienna:`#a0522d`,silver:`#c0c0c0`,skyblue:`#87ceeb`,slateblue:`#6a5acd`,slategray:`#708090`,slategrey:`#708090`,snow:`#fffafa`,springgreen:`#00ff7f`,steelblue:`#4682b4`,tan:`#d2b48c`,teal:`#008080`,thistle:`#d8bfd8`,tomato:`#ff6347`,turquoise:`#40e0d0`,violet:`#ee82ee`,wheat:`#f5deb3`,white:`#ffffff`,whitesmoke:`#f5f5f5`,yellow:`#ffff00`,yellowgreen:`#9acd32`};function W(e){let t={r:0,g:0,b:0},n=1,r=!1,i=!1;if(typeof e==`string`&&(e=ae(e)),typeof e==`object`){if(X(e.r)&&X(e.g)&&X(e.b)){t=te(e.r,e.g,e.b),r=!0;let{r:n}=e;i=typeof n!=`number`&&String(n).endsWith(`%`)?`prgb`:`rgb`}else if(X(e.h)&&X(e.s)&&X(e.v)){let n=j(e.s),a=j(e.v);t=I(e.h,n,a),r=!0,i=`hsv`}else if(X(e.h)&&X(e.s)&&X(e.l)){let n=j(e.s),a=j(e.l);t=ne(e.h,n,a),r=!0,i=`hsl`}else X(e.c)&&X(e.m)&&X(e.y)&&X(e.k)&&(t=ie(e.c,e.m,e.y,e.k),r=!0,i=`cmyk`);Object.prototype.hasOwnProperty.call(e,`a`)&&(n=e.a)}return n=k(n),{ok:r,format:e.format||i,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var G=`(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)`,K=`[\\s|\\(]+(`+G+`)[,|\\s]+(`+G+`)[,|\\s]+(`+G+`)\\s*\\)?`,q=`[\\s|\\(]+(`+G+`)[,|\\s]+(`+G+`)[,|\\s]+(`+G+`)[,|\\s]+(`+G+`)\\s*\\)?`,J={CSS_UNIT:new RegExp(G),rgb:RegExp(`rgb`+K),rgba:RegExp(`rgba`+q),hsl:RegExp(`hsl`+K),hsla:RegExp(`hsla`+q),hsv:RegExp(`hsv`+K),hsva:RegExp(`hsva`+q),cmyk:RegExp(`cmyk`+q)};function ae(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;let t=!1;if(U[e])e=U[e],t=!0;else if(e===`transparent`)return{r:0,g:0,b:0,a:0,format:`name`};if(typeof e==`string`&&e.length<=9){let n=oe(e,t);if(n)return n}let n=J.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=J.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=J.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=J.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=J.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=J.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=J.cmyk.exec(e),n?{c:n[1],m:n[2],y:n[3],k:n[4]}:!1))))))}function oe(e,t){let n=+!!e.startsWith(`#`),r=e.length-n;if(r===6||r===8){let i=Y(e,n)*16+Y(e,n+1),a=Y(e,n+2)*16+Y(e,n+3),o=Y(e,n+4)*16+Y(e,n+5);if(r===6)return Number.isNaN(i+a+o)?void 0:{r:i,g:a,b:o,format:t?`name`:`hex`};let s=Y(e,n+6)*16+Y(e,n+7);return Number.isNaN(i+a+o+s)?void 0:{r:i,g:a,b:o,a:s/255,format:t?`name`:`hex8`}}if(r===3||r===4){let i=Y(e,n)*17,a=Y(e,n+1)*17,o=Y(e,n+2)*17;if(r===3)return Number.isNaN(i+a+o)?void 0:{r:i,g:a,b:o,format:t?`name`:`hex`};let s=Y(e,n+3)*17;return Number.isNaN(i+a+o+s)?void 0:{r:i,g:a,b:o,a:s/255,format:t?`name`:`hex8`}}}function Y(e,t){let n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=97&&n<=102?n-87:n>=65&&n<=70?n-55:NaN}function X(e){return typeof e==`number`?!Number.isNaN(e):e!==void 0&&J.CSS_UNIT.test(e)}var se=class e{constructor(t=``,n={}){if(t instanceof e)return t;typeof t==`number`&&(t=H(t)),this.originalInput=t;let r=W(t);this.originalInput=t,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=n.format??r.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}getBrightness(){let e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3}getLuminance(){let e=this.toRgb(),t,n,r,i=e.r/255,a=e.g/255,o=e.b/255;return t=i<=.03928?i/12.92:((i+.055)/1.055)**2.4,n=a<=.03928?a/12.92:((a+.055)/1.055)**2.4,r=o<=.03928?o/12.92:((o+.055)/1.055)**2.4,.2126*t+.7152*n+.0722*r}getAlpha(){return this.a}setAlpha(e){return this.a=k(e),this.roundA=Math.round(100*this.a)/100,this}isMonochrome(){let{s:e}=this.toHsl();return e===0}toHsv(){let e=F(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}}toHsvString(){let e=F(this.r,this.g,this.b),t=Math.round(e.h*360),n=Math.round(e.s*100),r=Math.round(e.v*100);return this.a===1?`hsv(${t}, ${n}%, ${r}%)`:`hsva(${t}, ${n}%, ${r}%, ${this.roundA})`}toHsl(){let e=N(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}}toHslString(){let e=N(this.r,this.g,this.b),t=Math.round(e.h*360),n=Math.round(e.s*100),r=Math.round(e.l*100);return this.a===1?`hsl(${t}, ${n}%, ${r}%)`:`hsla(${t}, ${n}%, ${r}%, ${this.roundA})`}toHex(e=!1){return B(this.r,this.g,this.b,e)}toHexString(e=!1){return`#`+this.toHex(e)}toHex8(e=!1){return re(this.r,this.g,this.b,this.a,e)}toHex8String(e=!1){return`#`+this.toHex8(e)}toHexShortString(e=!1){return this.a===1?this.toHexString(e):this.toHex8String(e)}toRgb(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}}toRgbString(){let e=Math.round(this.r),t=Math.round(this.g),n=Math.round(this.b);return this.a===1?`rgb(${e}, ${t}, ${n})`:`rgba(${e}, ${t}, ${n}, ${this.roundA})`}toPercentageRgb(){let e=e=>`${Math.round(T(e,255)*100)}%`;return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}}toPercentageRgbString(){let e=e=>Math.round(T(e,255)*100);return this.a===1?`rgb(${e(this.r)}%, ${e(this.g)}%, ${e(this.b)}%)`:`rgba(${e(this.r)}%, ${e(this.g)}%, ${e(this.b)}%, ${this.roundA})`}toCmyk(){return{...V(this.r,this.g,this.b)}}toCmykString(){let{c:e,m:t,y:n,k:r}=V(this.r,this.g,this.b);return`cmyk(${e}, ${t}, ${n}, ${r})`}toName(){if(this.a===0)return`transparent`;if(this.a<1)return!1;let e=`#`+B(this.r,this.g,this.b,!1),t=U;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&t[n]===e)return n;return!1}toString(e){let t=!!e;e??=this.format;let n=!1,r=this.a<1&&this.a>=0;return!t&&r&&(e.startsWith(`hex`)||e===`name`)?e===`name`&&this.a===0?this.toName():this.toRgbString():(e===`rgb`&&(n=this.toRgbString()),e===`prgb`&&(n=this.toPercentageRgbString()),(e===`hex`||e===`hex6`)&&(n=this.toHexString()),e===`hex3`&&(n=this.toHexString(!0)),e===`hex4`&&(n=this.toHex8String(!0)),e===`hex8`&&(n=this.toHex8String()),e===`name`&&(n=this.toName()),e===`hsl`&&(n=this.toHslString()),e===`hsv`&&(n=this.toHsvString()),e===`cmyk`&&(n=this.toCmykString()),n||this.toHexString())}toNumber(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)}clone(){return new e(this.toString())}lighten(t=10){let n=this.toHsl();return n.l+=t/100,n.l=E(n.l),new e(n)}brighten(t=10){let n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new e(n)}darken(t=10){let n=this.toHsl();return n.l-=t/100,n.l=E(n.l),new e(n)}tint(e=10){return this.mix(`white`,e)}shade(e=10){return this.mix(`black`,e)}desaturate(t=10){let n=this.toHsl();return n.s-=t/100,n.s=E(n.s),new e(n)}saturate(t=10){let n=this.toHsl();return n.s+=t/100,n.s=E(n.s),new e(n)}greyscale(){return this.desaturate(100)}spin(t){let n=this.toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,new e(n)}mix(t,n=50){let r=this.toRgb(),i=new e(t).toRgb(),a=n/100,o={r:(i.r-r.r)*a+r.r,g:(i.g-r.g)*a+r.g,b:(i.b-r.b)*a+r.b,a:(i.a-r.a)*a+r.a};return new e(o)}analogous(t=6,n=30){let r=this.toHsl(),i=360/n,a=[this];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,a.push(new e(r));return a}complement(){let t=this.toHsl();return t.h=(t.h+180)%360,new e(t)}monochromatic(t=6){let n=this.toHsv(),{h:r}=n,{s:i}=n,{v:a}=n,o=[],s=1/t;for(;t--;)o.push(new e({h:r,s:i,v:a})),a=(a+s)%1;return o}splitcomplement(){let t=this.toHsl(),{h:n}=t;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]}onBackground(t){let n=this.toRgb(),r=new e(t).toRgb(),i=n.a+r.a*(1-n.a);return new e({r:(n.r*n.a+r.r*r.a*(1-n.a))/i,g:(n.g*n.a+r.g*r.a*(1-n.a))/i,b:(n.b*n.a+r.b*r.a*(1-n.a))/i,a:i})}triad(){return this.polyad(3)}tetrad(){return this.polyad(4)}polyad(t){let n=this.toHsl(),{h:r}=n,i=[this],a=360/t;for(let o=1;o<t;o++)i.push(new e({h:(r+o*a)%360,s:n.s,l:n.l}));return i}equals(t){let n=new e(t);return this.format===`cmyk`||n.format===`cmyk`?this.toCmykString()===n.toCmykString():this.toRgbString()===n.toRgbString()}},Z=[`#458FFF`,`#45D9A3`,`#FFC145`,`#F5654F`,`#6A6AFD`,`#6ED1FF`,`#008787`,`#FF9245`,`#F587B3`,`#8352CC`,`#65779B`],ce=[`#458FFF`,`#C8DEFF`,`#45D9A3`,`#C8F4E4`,`#FFC145`,`#FFEDC8`,`#F5654F`,`#FCD1CB`,`#6A6AFD`,`#D3D3FE`,`#6ED1FF`,`#D3D3FE`,`#008787`,`#B3DBDB`,`#FF9245`,`#FFDFC8`,`#F587B3`,`#FCDBE8`,`#8352CC`,`#FCDBE8`,`#65779B`,`#65779B`],le=[`#8C1604`,`#DB4C35`,`#FF9245`,`#FFC145`,`#689FFF`,`#45D9A3`,`#99ACD1`],Q={color:Z,textStyle:{color:`#6F7785`,fontSize:`12px`},bar:{barGap:.2,barWidth:10,label:{color:`#6F7785`,position:`top`}},line:{label:{color:`#6F7785`,position:`top`}},pie:{avoidLabelOverlap:!1,radius:[`70%`,`80%`],itemStyle:{borderWidth:1,borderColor:`#fff`},label:{show:!1,color:`#2F3540`,formatter:`{c}`,position:`inside`}},legend:{itemWidth:12,itemHeight:12,inactiveColor:`#BEC3CC`,textStyle:{color:`#6F7785`,fontSize:`12px`}},title:{itemGap:4,textStyle:{color:`#2F3540`,fontSize:`12px`,fontWeight:500},subtextStyle:{color:`#6F7785`,fontSize:`12px`}},tooltip:{borderWidth:0,padding:12,textStyle:{color:`#2F3540`},axisPointer:{z:1,lineStyle:{type:`solid`,color:`#E1E5EB`}}},categoryAxis:{axisLine:{show:!0,lineStyle:{color:`#EDF1F7`}},axisTick:{show:!0,alignWithLabel:!0,lineStyle:{color:`#EDF1F7`}},axisLabel:{color:`#6F7785`},splitLine:{show:!1},splitArea:{show:!1}},valueAxis:{axisLine:{show:!1},axisTick:{show:!1},axisLabel:{color:`#6F7785`},splitLine:{lineStyle:{color:`#EDF1F7`}},splitArea:{show:!1},nameTextStyle:{color:`#6F7785`,padding:[0,30,-4,0]}},dataZoom:{height:16}};function ue(e){return!!(e&&e.xAxis&&e.xAxis.data)}function de(e,t){return i.isVue2?{attrs:{...e},on:{...t}}:{...e}}function fe(e){return Object.entries(e).reduce((e,[t,n])=>(n!==void 0&&(e[t]=n),e),{})}function pe(e){return(0,s.isNil)(e)?[]:Array.isArray(e)?e:[e]}var me=(e,t)=>new se(e).setAlpha(t).toRgbString();function $(e,t){return(0,o.use)(t),(0,o.registerTheme)(`seer`,Q),e.install=t=>{t.component(e.name,e)},e}e.IxChart=$(ee,[t.DataZoomComponent,t.LegendComponent,t.GridComponent,t.TitleComponent,t.TooltipComponent,n.LabelLayout,n.UniversalTransition,r.SVGRenderer]),e.convertArray=pe,e.createInstall=$,e.filterEmptyProps=fe,e.getAlphaColor=me,e.isVertical=ue,e.mergeAttrs=de,e.seerColors=Z,e.seerColorsForMore=ce,e.seerColorsForRisk=le,e.seerTheme=Q,e.useChart=p,e.useReactiveAttrs=C,e.useStripe=v,e.useStripeArea=x,e.useStripeBarSeries=b,e.useStripeBarTooltip=y,e.useTooltipsFormatter=_,e.withChartProps=w});
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { BarSeriesOption, LineSeriesOption, PieSeriesOption, RadarSeriesOption, GaugeSeriesOption, CustomSeriesOption } from 'echarts/charts';
|
|
2
|
+
import { RadarComponentOption, GraphicComponentOption, DatasetComponentOption, DataZoomComponentOption, GridComponentOption, LegendComponentOption, TitleComponentOption, TooltipComponentOption } from 'echarts/components';
|
|
3
|
+
import { ComposeOption, EChartsType, init, SetOptionOpts } from 'echarts/core';
|
|
4
4
|
export type ChartInitParameters = Parameters<typeof init>;
|
|
5
5
|
export type ChartTheme = NonNullable<ChartInitParameters[1]>;
|
|
6
6
|
export type ChartInitOption = NonNullable<ChartInitParameters[2]>;
|
|
7
|
+
/** Retain declared properties and their modifiers without broad index signatures. */
|
|
8
|
+
export type KnownProps<Props> = {
|
|
9
|
+
[Key in keyof Props as string extends Key ? never : number extends Key ? never : Key]: Props[Key];
|
|
10
|
+
};
|
|
7
11
|
export interface AdditionalChartOption<T extends EChartsType = EChartsType> {
|
|
8
12
|
/**
|
|
9
13
|
* 是否开启自动 resize
|
|
@@ -43,8 +47,11 @@ interface ComponentOption {
|
|
|
43
47
|
z?: number;
|
|
44
48
|
zlevel?: number;
|
|
45
49
|
}
|
|
46
|
-
|
|
47
|
-
export type
|
|
50
|
+
type CommonComponentOption = GraphicComponentOption | DatasetComponentOption | DataZoomComponentOption | GridComponentOption | LegendComponentOption | TitleComponentOption | TooltipComponentOption;
|
|
51
|
+
export type BaseChartOption<T extends ComponentOption> = ComposeOption<CommonComponentOption | T>;
|
|
52
|
+
export type ChartOption = BaseChartOption<RadarComponentOption | RadarSeriesOption | GaugeSeriesOption | CustomSeriesOption | BarSeriesOption | PieSeriesOption | LineSeriesOption>;
|
|
48
53
|
export interface ChartProps extends ChartOption, AdditionalChartOption {
|
|
49
54
|
}
|
|
55
|
+
/** Named caller-facing props for component declarations; defaults are not resolved. */
|
|
56
|
+
export type ChartPublicProps = KnownProps<ChartProps>;
|
|
50
57
|
export {};
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { use } from 'echarts/core';
|
|
2
|
+
export { withChartProps } from './withChartProps';
|
|
3
|
+
export type { ChartComponent } from './withChartProps';
|
|
2
4
|
export type Writeable<T> = {
|
|
3
5
|
-readonly [P in keyof T]: T[P];
|
|
4
6
|
};
|
|
@@ -8,4 +10,4 @@ export declare function filterEmptyProps<T extends object>(props: T): T;
|
|
|
8
10
|
export declare function convertArray<T>(value: T | undefined | null | Array<T | undefined | null>): T[];
|
|
9
11
|
export declare function convertArray<T>(value: T | readonly T[]): readonly T[];
|
|
10
12
|
export declare const getAlphaColor: (baseColor: string, alpha: number) => string;
|
|
11
|
-
export declare function createInstall(Chart:
|
|
13
|
+
export declare function createInstall<Component>(Chart: Component, ext: Parameters<typeof use>[0]): Component;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { VNode } from 'vue-demi';
|
|
2
|
+
type ComponentConstructor = new (...args: any[]) => {
|
|
3
|
+
$props: object;
|
|
4
|
+
};
|
|
5
|
+
type SlotFunctions<Slots> = {
|
|
6
|
+
[Name in keyof Slots]: NonNullable<Slots[Name]> extends (...args: any[]) => any ? NonNullable<Slots[Name]> : (props: Slots[Name]) => VNode[];
|
|
7
|
+
};
|
|
8
|
+
type ChartInstance<Props, Component extends ComponentConstructor, Slots> = [
|
|
9
|
+
Slots
|
|
10
|
+
] extends [
|
|
11
|
+
never
|
|
12
|
+
] ? InstanceType<Component> & {
|
|
13
|
+
$props: Readonly<Props>;
|
|
14
|
+
} : Omit<InstanceType<Component>, '$props' | '$slots' | '$scopedSlots'> & {
|
|
15
|
+
$props: InstanceType<Component>['$props'] & Readonly<Props>;
|
|
16
|
+
} & (InstanceType<Component> extends {
|
|
17
|
+
$scopedSlots: object;
|
|
18
|
+
} ? {
|
|
19
|
+
$slots: {
|
|
20
|
+
[Name in keyof Slots]: VNode[] | undefined;
|
|
21
|
+
};
|
|
22
|
+
$scopedSlots: SlotFunctions<Slots>;
|
|
23
|
+
} : {
|
|
24
|
+
$slots: SlotFunctions<Slots>;
|
|
25
|
+
});
|
|
26
|
+
export type ChartComponent<Props, Component extends ComponentConstructor, Slots = never> = Component & {
|
|
27
|
+
new (...args: ConstructorParameters<Component>): ChartInstance<Props, Component, Slots>;
|
|
28
|
+
};
|
|
29
|
+
export declare function withChartProps<Props>(): <Component extends ComponentConstructor>(component: Component) => ChartComponent<Props, Component>;
|
|
30
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@idux/charts-core",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "A
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "A chart component library for Vue 2 & 3",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vue",
|
|
7
|
+
"vue2",
|
|
7
8
|
"vue3",
|
|
8
|
-
"vue 3.x",
|
|
9
9
|
"chart",
|
|
10
10
|
"charts"
|
|
11
11
|
],
|
|
@@ -31,15 +31,18 @@
|
|
|
31
31
|
"*.md",
|
|
32
32
|
"*.d.ts"
|
|
33
33
|
],
|
|
34
|
-
"sideEffects":
|
|
34
|
+
"sideEffects": [
|
|
35
|
+
"./dist/index.js",
|
|
36
|
+
"./dist/index.umd.cjs"
|
|
37
|
+
],
|
|
35
38
|
"dependencies": {
|
|
36
|
-
"
|
|
39
|
+
"@ctrl/tinycolor": "^4.2.2",
|
|
37
40
|
"lodash-es": "^4.17.0",
|
|
38
|
-
"vue-demi": "^0.
|
|
39
|
-
"@ctrl/tinycolor": "^3.6.0"
|
|
41
|
+
"vue-demi": "^0.14.10"
|
|
40
42
|
},
|
|
41
43
|
"peerDependencies": {
|
|
42
|
-
"@vue/composition-api": "
|
|
44
|
+
"@vue/composition-api": ">=1.6.2",
|
|
45
|
+
"echarts": "^5.4.3 || ^6.0.0",
|
|
43
46
|
"vue": "^2.6.0 || ^3.2.5"
|
|
44
47
|
},
|
|
45
48
|
"peerDependenciesMeta": {
|
|
@@ -47,6 +50,9 @@
|
|
|
47
50
|
"optional": true
|
|
48
51
|
}
|
|
49
52
|
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"echarts": "^6.1.0"
|
|
55
|
+
},
|
|
50
56
|
"scripts": {
|
|
51
57
|
"clean": "rimraf dist node_modules",
|
|
52
58
|
"build": "rimraf dist && vite build"
|