import{aO as g,r as a,aP as p,u as f,aQ as x,aR as u,aS as i,R as E}from"./index-DH3zn7Tz.js";const L={type:"Plotly"},d=l=>{const s=g(l),y=a.useMemo(()=>p("Plotly-contents",{self:l.input}),[l.input]),o=a.useRef(null),r=f(y);return a.useEffect(()=>{if(r.loading)return;const c=JSON.parse(r.result);x.newPlot(o.current,c.data,c.layout,{responsive:!0}),o.current.on("plotly_click",e=>{console.log("PLOTLY CLICK",e)}),o.current.on("plotly_selected",e=>{if(console.log("PLOTLY SELECTED",e),e?.range?.geo!=null){const n=e.range.geo,t={xMin:n[0][0],xMax:n[0][1],yMin:n[1][0],yMax:n[1][1]};console.log("SELECTED",t),s(()=>({selected:u(i(t),t)}))}else if(e?.range!=null){const n={xMin:e.range.x[0],xMax:e.range.x[1],yMin:e.range.y[0],yMax:e.range.y[1]};s(t=>(console.log("PANEL PLOTLY CHANGE",t),{selected:u(i(n),n)}))}})},[r.result,s]),E.createElement("div",{"data-test-weave-id":"PanelPlotly",style:{width:"100%",height:"100%"},ref:o})};export{d as PanelPlotly,d as default,L as inputType};
//# sourceMappingURL=Component-n7P7cY4f.js.map
