gr.lineplot (maybe besides other plots) do work with gr.render, but then report error "Uncaught (in promise) TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'", and the components on the page become no response.
Have you searched existing issues? 🔎
[X] I have searched and found no existing issues
Reproduction
import pandas as pd
from random import randint, random
import gradio as gr
with gr.Blocks() as line_plots:
button = gr.Button("Generate Data")
@gr.render(button, triggers=[button.click])
def generate_data(button):
temp_sensor_data = pd.DataFrame(
{
"time": pd.date_range("2021-01-01", end="2021-01-05", periods=100),
"temperature": [randint(50 + 10 * (i % 2), 65 + 15 * (i % 2)) for i in range(100)],
"humidity": [randint(50 + 10 * (i % 2), 65 + 15 * (i % 2)) for i in range(100)],
"location": ["indoor", "outdoor"] * 50,
}
)
temp_by_time = gr.LinePlot(
temp_sensor_data,
x="time",
y="temperature",
)
# gr.Textbox(str(temp_sensor_data))
if __name__ == "__main__":
line_plots.launch()
Screenshot
click the button and no response after the first time.
Logs
"Uncaught (in promise) TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'
Describe the bug
gr.lineplot (maybe besides other plots) do work with gr.render, but then report error "Uncaught (in promise) TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'", and the components on the page become no response.
Have you searched existing issues? 🔎
Reproduction
Screenshot
click the button and no response after the first time.
Logs
System Info
Severity
I can work around it