You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
1.4 KiB
2 lines
1.4 KiB
var M=Object.defineProperty;var k=Object.getOwnPropertySymbols;var b=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable;var D=(r,t,n)=>t in r?M(r,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[t]=n,O=(r,t)=>{for(var n in t||(t={}))b.call(t,n)&&D(r,n,t[n]);if(k)for(var n of k(t))x.call(t,n)&&D(r,n,t[n]);return r};import{aD as y,f as z,r as H,O as R,C as S,u,ap as v,J as T,ax as h,b0 as B,au as J}from"./index-f4658ae7.js";import w from"./echarts-107e9b6c.js";import"./install-2bcffee5.js";function A(r,t="default"){const{getDarkMode:n}=y(),o=z(()=>t==="default"?n.value:t);let e=null,l=d;const a=H({});let m=()=>{};l=J(d,200);const g=z(()=>o.value!=="dark"?a.value:O({backgroundColor:"transparent"},a.value));function p(i=t){const s=u(r);if(!s||!u(s))return;e=w.init(s,i);const{removeEvent:f}=h({el:window,name:"resize",listener:l});m=f;const{widthRef:E,screenEnum:F}=B();(u(E)<=F.MD||s.offsetHeight===0)&&v(()=>{l()},30)}function c(i,s=!0){var f;if(a.value=i,((f=u(r))==null?void 0:f.offsetHeight)===0){v(()=>{c(u(g))},30);return}T(()=>{v(()=>{!e&&(p(o.value),!e)||(s&&(e==null||e.clear()),e==null||e.setOption(u(g)))},30)})}function d(){e==null||e.resize()}R(()=>o.value,i=>{e&&(e.dispose(),p(i),c(a.value))}),S(()=>{e&&(m(),e.dispose(),e=null)});function C(){return e||p(o.value),e}return{setOptions:c,resize:d,echarts:w,getInstance:C}}export{A as useECharts};
|