"use strict";(globalThis.webpackChunksuperset=globalThis.webpackChunksuperset||[]).push([[1130],{81130:(e,t,r)=>{r.r(t),r.d(t,{default:()=>c}),r(67294);var n=r(63475),u=r(11965);function c(e){let{echartOptions:t,height:r,refs:c,width:h}=e;return(0,u.tZ)(n.Z,{refs:c,height:r,width:h,echartOptions:t})}},63475:(e,t,r)=>{r.d(t,{Z:()=>l});var n=r(67294),u=r(51995),c=r(31431),h=r(11965);const i=u.iK.div`
  height: ${e=>{let{height:t}=e;return t}};
  width: ${e=>{let{width:t}=e;return t}};
`;function s(e,t){let{width:r,height:u,echartOptions:s,eventHandlers:l,zrEventHandlers:a,selectedValues:d={},refs:f}=e;const o=(0,n.useRef)(null);f&&(f.divRef=o);const g=(0,n.useRef)(),p=(0,n.useMemo)((()=>Object.keys(d)||[]),[d]),w=(0,n.useRef)([]);(0,n.useImperativeHandle)(t,(()=>({getEchartInstance:()=>g.current}))),(0,n.useEffect)((()=>{o.current&&(g.current||(g.current=(0,c.S1)(o.current)),Object.entries(l||{}).forEach((e=>{var t,r;let[n,u]=e;null==(t=g.current)||t.off(n),null==(r=g.current)||r.on(n,u)})),Object.entries(a||{}).forEach((e=>{var t,r;let[n,u]=e;null==(t=g.current)||t.getZr().off(n),null==(r=g.current)||r.getZr().on(n,u)})),g.current.setOption(s,!0))}),[s,l,a]),(0,n.useEffect)((()=>{g.current&&(g.current.dispatchAction({type:"downplay",dataIndex:w.current.filter((e=>!p.includes(e)))}),p.length&&g.current.dispatchAction({type:"highlight",dataIndex:p}),w.current=p)}),[p]);const v=(0,n.useCallback)((e=>{let{width:t,height:r}=e;g.current&&g.current.resize({width:t,height:r})}),[]);return(0,n.useEffect)((()=>(v({width:r,height:u}),()=>{var e;return null==(e=g.current)?void 0:e.dispose()})),[]),(0,n.useLayoutEffect)((()=>{v({width:r,height:u})}),[r,u,v]),(0,h.tZ)(i,{ref:o,height:u,width:r})}const l=(0,n.forwardRef)(s)}}]);
//# sourceMappingURL=a348224739c48b2428cd.chunk.js.map