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