Open mitanshu7 opened 1 month ago
I have found the same issue: when an long output Dataframe is rendered, scrolling through it is buggy: the height of the rendered Dataframe increases and decreases while scrolling.
I have tried passing several parameters without success: fill_height
to Block, height
and row_count
to Dataframe,...
See example: https://huggingface.co/spaces/albertvillanova/bug-gradio-dataframe-scrolling
If you look at the other tab, called "JSON", you have the same data rendered in JSON format: the entire height is rendered in this case
Hello!
I found a workaround for it.
I convert the pandas.DataFrame
to HTML using .to_html() method, and also modify the output gradio component to show HTML. This solved my issue of scrolling since now the ouput is a simple table.
Edit: @albertvillanova, I tried this on your HF Space and it worked fine. Code changes:
...
return pd.json_normalize([DATA]).iloc[0].rename_axis("Parameters").rename("Model-1").to_frame().reset_index().to_html(index=False)
...
with gr.Tab("Dataframe"):
dataframe = gr.HTML()
See screenshot below.
@mitanshu7 this workaround might fix the scrolling/"jumping" issue but the resulting table is no longer clickable (since it's raw html table) :/
Describe the bug
I have a dataframes where one row has many words in it than the other columns. please see video for the same.
https://github.com/user-attachments/assets/e866ad6a-e227-4a82-8ec4-88446cc60615
Have you searched existing issues? 🔎
Reproduction
Screenshot
No response
Logs
No response
System Info
Severity
Blocking usage of gradio