"use strict";(globalThis.webpackChunksuperset=globalThis.webpackChunksuperset||[]).push([[2580],{62580:(e,t,r)=>{r.r(t),r.d(t,{default:()=>s});var n=r(263475),c=r(135944);function s(e){const{height:t,width:r,echartOptions:s,refs:u,onLegendStateChanged:h}=e,i={legendselectchanged:e=>{null==h||h(e.selected)},legendselectall:e=>{null==h||h(e.selected)},legendinverseselect:e=>{null==h||h(e.selected)}};return(0,c.tZ)(n.Z,{refs:u,height:t,width:r,echartOptions:s,eventHandlers:i})}},263475:(e,t,r)=>{r.d(t,{Z:()=>S});var n=r(667294),c=r(751995),s=r(768023),u=r(281615),h=r(967021),i=r(358062),l=r(781836),d=r(873463),a=r(216026),o=r(259048),f=r(15746),N=r(126947),g=r(302907),p=r(516049),w=r(541969),v=r(938198),b=r(548785),E=r(557494),O=r(570012),k=r(730322),Z=r(655958),y=r(603174),R=r(731281),C=r(210680),H=r(347106),I=r(693450),j=r(499326),T=r(617813),m=r(129167),x=r(787164),z=r(135944);const A=c.iK.div`
  height: ${({height:e})=>e};
  width: ${({width:e})=>e};
`;function L({width:e,height:t,echartOptions:r,eventHandlers:c,zrEventHandlers:s,selectedValues:h={},refs:i},l){const d=(0,n.useRef)(null);i&&(i.divRef=d);const a=(0,n.useRef)(),o=(0,n.useMemo)((()=>Object.keys(h)||[]),[h]),f=(0,n.useRef)([]);(0,n.useImperativeHandle)(l,(()=>({getEchartInstance:()=>a.current}))),(0,n.useEffect)((()=>{d.current&&(a.current||(a.current=(0,u.S1)(d.current)),Object.entries(c||{}).forEach((([e,t])=>{var r,n;null==(r=a.current)||r.off(e),null==(n=a.current)||n.on(e,t)})),Object.entries(s||{}).forEach((([e,t])=>{var r,n;null==(r=a.current)||r.getZr().off(e),null==(n=a.current)||n.getZr().on(e,t)})),a.current.setOption(r,!0))}),[r,c,s]),(0,n.useEffect)((()=>{a.current&&(a.current.dispatchAction({type:"downplay",dataIndex:f.current.filter((e=>!o.includes(e)))}),o.length&&a.current.dispatchAction({type:"highlight",dataIndex:o}),f.current=o)}),[o]);const N=(0,n.useCallback)((({width:e,height:t})=>{a.current&&a.current.resize({width:e,height:t})}),[]);return(0,n.useEffect)((()=>(N({width:e,height:t}),()=>{var e;return null==(e=a.current)?void 0:e.dispose()})),[]),(0,n.useLayoutEffect)((()=>{N({width:e,height:t})}),[e,t,N]),(0,z.tZ)(A,{ref:d,height:t,width:e})}(0,s.D)([O.N,h.N,i.N,l.N,d.N,a.N,o.N,f.N,N.N,g.N,p.N,w.N,v.N,b.N,E.N,k.N,Z.N,y.N,R.N,C.N,H.N,I.N,j.N,T.N,m.N,x.T]);const S=(0,n.forwardRef)(L)}}]);
//# sourceMappingURL=b01f4e3ac6bb3153ced7.chunk.js.map