• | Name | Status | URL |
---|---|---|---|
Spaces | Spaces preview | ||
Website | ![]() |
||
Storybook | Storybook preview | ||
🦄 | Changes | Details |
Install Gradio from this PR
pip install https://gradio-pypi-previews.s3.amazonaws.com/435757b2341628a816dc6fd694ed300f4c7cf585/gradio-5.12.0-py3-none-any.whl
Install Gradio Python Client from this PR
pip install "gradio-client @ git+https://github.com/gradio-app/gradio@435757b2341628a816dc6fd694ed300f4c7cf585#subdirectory=client/python"
Install Gradio JS Client from this PR
npm install https://gradio-npm-previews.s3.amazonaws.com/435757b2341628a816dc6fd694ed300f4c7cf585/gradio-client-1.10.0.tgz
Use Lite from this PR
<script type="module" src="https://gradio-lite-previews.s3.amazonaws.com/435757b2341628a816dc6fd694ed300f4c7cf585/dist/lite.js""></script>
Package | Version |
---|---|
@gradio/dataframe |
minor |
gradio |
minor |
Add toolbar with fullscreen button to
gr.Dataframe
Maintainers or the PR author can modify the PR title to modify this entry.
@hannahblair does this PR add the copy button or not? I see the full screen button but not the copy values button:
import numpy as np
import gradio as gr
def transpose(matrix):
return matrix.T
demo = gr.Interface(
transpose,
gr.Dataframe(type="numpy", datatype="number", row_count=5, col_count=3, show_fullscreen_button=True),
"numpy",
examples=[
[np.zeros((3, 3)).tolist()],
[np.ones((2, 2)).tolist()],
[np.random.randint(0, 10, (3, 10)).tolist()],
[np.random.randint(0, 10, (10, 3)).tolist()],
[np.random.randint(0, 10, (10, 10)).tolist()],
],
cache_examples=False
)
if __name__ == "__main__":
demo.launch()
Also I would have expected the full screen icon to be at the same level as the label but its appearing a bit below it^
actually do we think it makes sense to add this show_fullscreen_button
param to a new toolbar_options
dict so it's less cluttered down the line?
actually do we think it makes sense to add this show_fullscreen_button param to a new toolbar_options dict so it's less cluttered down the line?
I was thinking the same, although it'd be inconsistent with other components (e.g. Image
has show_download_button
and show_fullscreen_button
). My thinking is that we have individual parameters for now, but we can refactor this across all of our components in 6.0 with a cleaner api.
I was thinking the same, although it'd be inconsistent with other components (e.g. Image has show_download_button and show_fullscreen_button). My thinking is that we have individual parameters for now, but we can refactor this across all of our components in 6.0 with a cleaner api.
oki sounds good!
does this PR add the copy button or not? I see the full screen button but not the copy values button:
oop i should've updated the description - i wanted to move the copy button to a new PR
oop i should've updated the description - i wanted to move the copy button to a new PR
sounds good. maybe we should even consider replacing the copy button with a download-as-csv button and instead support much nicer copying of any range of cells directly using cmd-c or through the context menu
I pushed a change to fix the style tweak as @hannahblair is ooo. I think everything looks good now, but perhaps @pngwn or @aliabid94 can give the fe changes a lookover:
lgtm! Although I feel like the show_fullscreen_button
flag should be True by default
Thanks @dawoodkhan82! I considered that but since the button takes up vertical space above the component, that could displace the layouts of Gradio apps that have a dataframe without a label. We could make this change in 6.0 though
Login to write a write a comment.
Description
Closes: #7423
🎯 PRs Should Target Issues
Before your create a PR, please check to see if there is an existing issue for this change. If not, please create an issue before you create this PR, unless the fix is very small.
Not adhering to this guideline will result in the PR being closed.
Testing and Formatting Your Code
PRs will only be merged if tests pass on CI. We recommend at least running the backend tests locally, please set up your Gradio environment locally and run the backed tests:
bash scripts/run_backend_tests.sh
Please run these bash scripts to automatically format your code:
bash scripts/format_backend.sh
, and (if you made any changes to non-Python files)bash scripts/format_frontend.sh