"use strict";(globalThis.webpackChunksuperset=globalThis.webpackChunksuperset||[]).push([[1116],{41116:(e,t,r)=>{r.r(t),r.d(t,{default:()=>c});var n=r(85867),a=r(2445);function c({echartOptions:e,height:t,refs:r,width:c}){return(0,a.Y)(n.A,{refs:r,height:t,width:c,echartOptions:e})}},85867:(e,t,r)=>{r.d(t,{A:()=>L});var n=r(96540),a=r(96453),c=r(3087),u=r(92351),h=r(42900),s=r(51719),i=r(74508),d=r(61030),l=r(45567),f=r(49714),o=r(11734),g=r(80491),p=r(25652),w=r(73900),v=r(32003),b=r(22329),E=r(31441),O=r(12458),k=r(39539),y=r(5553),I=r(45967),R=r(40830),A=r(45620),j=r(39838),C=r(42998),H=r(69380),T=r(25384),Y=r(29022),m=r(28540),x=r(35278),z=r(2445);const Z=a.I4.div`
  height: ${({height:e})=>e};
  width: ${({width:e})=>e};
`;function $({width:e,height:t,echartOptions:r,eventHandlers:a,zrEventHandlers:c,selectedValues:h={},refs:s},i){const d=(0,n.useRef)(null);s&&(s.divRef=d);const l=(0,n.useRef)(),f=(0,n.useMemo)((()=>Object.keys(h)||[]),[h]),o=(0,n.useRef)([]);(0,n.useImperativeHandle)(i,(()=>({getEchartInstance:()=>l.current}))),(0,n.useEffect)((()=>{d.current&&(l.current||(l.current=(0,u.Ts)(d.current)),Object.entries(a||{}).forEach((([e,t])=>{var r,n;null==(r=l.current)||r.off(e),null==(n=l.current)||n.on(e,t)})),Object.entries(c||{}).forEach((([e,t])=>{var r,n;null==(r=l.current)||r.getZr().off(e),null==(n=l.current)||n.getZr().on(e,t)})),l.current.setOption(r,!0))}),[r,a,c]),(0,n.useEffect)((()=>{l.current&&(l.current.dispatchAction({type:"downplay",dataIndex:o.current.filter((e=>!f.includes(e)))}),f.length&&l.current.dispatchAction({type:"highlight",dataIndex:f}),o.current=f)}),[f]);const g=(0,n.useCallback)((({width:e,height:t})=>{l.current&&l.current.resize({width:e,height:t})}),[]);return(0,n.useEffect)((()=>(g({width:e,height:t}),()=>{var e;return null==(e=l.current)?void 0:e.dispose()})),[]),(0,n.useLayoutEffect)((()=>{g({width:e,height:t})}),[e,t,g]),(0,z.Y)(Z,{ref:d,height:t,width:e})}(0,c.Y)([k.a,h.a,s.a,i.a,d.a,l.a,f.a,o.a,g.a,p.a,w.a,v.a,b.a,E.a,O.a,y.a,I.a,R.a,A.a,j.a,C.a,H.a,T.a,Y.a,m.a,x._]);const L=(0,n.forwardRef)($)}}]);