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