Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add possibility to show copy button to gr.Dataframe #6981

Open
1 task done
mireiarmirapeix opened this issue Jan 9, 2024 · 2 comments
Open
1 task done

Add possibility to show copy button to gr.Dataframe #6981

mireiarmirapeix opened this issue Jan 9, 2024 · 2 comments
Labels
💾 Dataframe enhancement New feature or request needs designing The proposed feature needs to be discussed and designed before being implemented

Comments

@mireiarmirapeix
Copy link

  • I have searched to see if a similar issue already exists.
    #2585 Add copy to clipboard button to other input types - added show_copy_button to gr.Textbox()
    #6086 Copying cell values from dataframe output - discusses copying individual cells but not entire dataframe

Is your feature request related to a problem? Please describe.
I am building an app that returns tabular data. I am able to display the output as a gr.Dataframe() but there's no way to add a copy button to it (nor to easily select and copy the data manually). I have tried displaying the data as gr.Markdown() which allows me to select and copy manually, but it doesn't allow for a copy button either.

Describe the solution you'd like
The possibility to add a copy button to Dataframes and Markdowns.

Additional context
Add any other context or screenshots about the feature request here.

@pngwn
Copy link
Member

pngwn commented Feb 20, 2024

We need to figure out where to put buttons like these. I think we need to adjust the design of the dataframe in order to add a small 'toolbar' or icon bar. This would solve a number of issues and offer a clearer path forwards for some of the other feature requests we have had.

@pngwn pngwn added the needs designing The proposed feature needs to be discussed and designed before being implemented label Feb 20, 2024
@mberco-quandl
Copy link

mberco-quandl commented Apr 24, 2024

@abidlabs +1 Stumbled on this thread while looking for a workaround to the lack of ability to write dataframes into Gradio's file handling system as a csv #8098 (comment). Currently I write the dataframe to my working directory as a temp file, then I pass the full path of the temp file into the Gradio File object, then use an upload event handler to delete the temp file in the working directory. In this way I can rely on delete_cache to semi-safely manage storage, however there is a risk of my working directory getting polluted if a tempfile is not deleted. If a user could copy-paste an entire Gradio Dataframe's contents into memory they could simply paste it into an open spreadsheet. Even better would be a button triggering something like Flask's send_file that would trigger a download directly from Dataframe in server memory to client as csv.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💾 Dataframe enhancement New feature or request needs designing The proposed feature needs to be discussed and designed before being implemented
Projects
None yet
Development

No branches or pull requests

4 participants