vizro icon indicating copy to clipboard operation
vizro copied to clipboard

File browser widget

Open LiShaoyu5 opened this issue 1 year ago • 4 comments

Which package?

vizro

What's the problem this feature will solve?

The widget contains an interactive file browser and returns its state(current path, etc.) and events like clicking a file in it. Other libraries I tried(like Gradio and Streamlit) only provide the feature of uploading and downloading files. But for data visualization, a lot of times I need to deal with directories.

Describe the solution you'd like

The third-party addon streamlit-file-browser of Streamlit shows a nice way of implementing it: image The widget connects to a local directory or a file server and returns a dict showing its current state, including the path and whether the user clicks a folder or a file.

Code of Conduct

LiShaoyu5 avatar Jul 22 '24 08:07 LiShaoyu5

Hello @LiShaoyu5 and thank you for raising the issue. It's an interesting idea and not one we've heard before. #473 and #281 are about uploading files but don't contain the file browser like you describe here.

For there to be any chance of us implementing this in Vizro it would first of all need to exist in Dash. Do you know of any such functionality @AnnMarieW?

antonymilne avatar Jul 22 '24 10:07 antonymilne

Hey @LiShaoyu5,

I came across a Dash user-created component that might be what you're looking for: File Explorer Tree Generator for Local Files. Seems like @AnnMarieW has contributed to this one! 😄

As @antonymilne mentioned, if it works in Dash, we can definitely get it working in Vizro too. Just a quick note, the solution in the forum is user-generated, so it might not be fully tested. If you need something quick, you could give the code snippet they provided a try. If you’ve tried it out and want to embed it into Vizro, you can follow our guide on creating custom components. If you have any questions there, let us know!

This component isn’t on our roadmap right now. For us to consider adding a fully tested and styled version to our repository, we’d need to see more interest from other users. So I'll keep this issue open to see if others are interested too 👍

I hope this helps! 🤞

huong-li-nguyen avatar Jul 22 '24 21:07 huong-li-nguyen

Hello @huong-li-nguyen thanks for your detailed reply! I think this will work for me and I will try it out.

LiShaoyu5 avatar Jul 23 '24 02:07 LiShaoyu5

@antonymilne @huong-li-nguyen fyi, I came across this repo yesterday, which looks quite advanced and up-to-date: https://github.com/fohrloop/dash-uploader

lingyielia avatar Jul 26 '24 05:07 lingyielia