widgetti / solara

A Pure Python, React-style Framework for Scaling Your Jupyter and Web Apps
https://solara.dev
MIT License
1.9k stars 140 forks source link

[Bug] Solara `FigurePlotly` seems to be broken #66

Open Ben-Epstein opened 1 year ago

Ben-Epstein commented 1 year ago

This code used to work, but now it hangs forever

Version info

solara 1.10.0 plotly 5.9.0

code

import pandas as pd
import solara as sl
import plotly.express as px

@sl.component
def Page():
    df = pd.read_csv("conv_intent.csv")
    df["text_length"] = df.text.str.len()
    df["id"] = list(range(len(df)))
    df["hovertext"] = df.text.str.wrap(30).str.replace("\n", "<br>")
    fig = px.scatter(
        df,
        x="x",
        y="y",
        custom_data=[df["id"]],
        hover_data=["hovertext"],
    )
    fig.update_layout(showlegend=False)
    fig.update_xaxes(visible=False)
    fig.update_yaxes(visible=False)
    fig.update_traces(marker_size=2)

    sl.FigurePlotly(fig)

Page()

The code outside of a component (plotly only) works

I've attached the file below conv_intent.csv

Ben-Epstein commented 1 year ago

Upgrading to the latest plotly 5.14.1 causes the cell to complete, but no output plot is created