
























Gradio’s gr.Dataframe component is one of our most popular components, we've seen it used in a variety of awesome apps, like leaderboards, dashboards, and interactive visualisations. Although we hadn't made any changes to the dataframe in quite some time, our backlog of issues had been growing, and some improvements had been in demand for a while.
Well — we’re now super excited to release a host of new updates to Gradio’s dataframe component. Over the last 6 weeks, we’ve closed over 70 dataframe issues - including bugs, improvements and enhancements.
You can select multiple cells at once! Copy or delete values across your selection with ease.
Add row number columns and keep critical columns in view while navigating wide datasets using the pinned_columns parameter. No more losing track of what you're looking at!
Easily copy cell values into a comma-separated format with our new copy button. Need a better view? The full screen button gives you interactivity without distractions and can be enabled with the show_full_screen parameter.
Look at all that data! Now we can just scroll to the top.
Improved keyboard navigation makes gr.Dataframe more accessible than ever. You can also take control of your dataframe’s look with a dedicated styler parameter and enhance the user experience of your app.
Access entire row data in select events for more intuitive interactivity and data manipulation.
Customise the interactivity of your dataframe by specifying non-editable columns using the static_columns parameter.
Quickly find the data you need with our powerful search feature by setting the show_search parameter to "search".
Narrow down your dataset to focus on exactly what you need with flexible filtering options with show_search set to "filter".
Experience smoother, more intuitive cell selection that behaves the way you expect.
With over 70 issues closed, we’ve made huge improvements, but there’s always more for us to work on. Looking ahead, we still have more ideas to implement and we’re excited to keep refining accessibility, performance, and integration. Look out for some cool demos on our socials using the dataframe on Gradio’s X.
The updated dataframe is live in the latest Gradio release. Update your installation with pip install --upgrade gradio.
import gradio as gr
df_headers = ["Name", "Population", "Size (min cm)", "Size (max cm)", "Weight (min kg)", "Weight (max kg)", "Lifespan (min years)", "Lifespan (max years)"]
df_data = [
["Irish Red Fox", 185000, 48, 92, 4.2, 6.8, 3, 5],
["Irish Badger", 95000, 62, 88, 8.5, 13.5, 6, 8],
["Irish Otter", 13500, 58, 98, 5.5, 11.5, 9, 13]
]
with gr.Blocks() as demo:
df = gr.Dataframe(
label="Irish Wildlife",
value=df_data,
headers=df_headers,
interactive=True,
show_search="search",
show_copy_button=True,
show_fullscreen_button=True,
show_row_numbers=True,
pinned_columns=1,
static_columns=[0],
column_widths=["300px"]
)
demo.launch()
Check out the Gradio documentation for examples and tutorials to get started with these new features. We’re eager to see what you create! Got thoughts or suggestions? Share them by raising an issue in our GitHub repo.
Happy building!
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。