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

Uploading files in Vizro apps #281

Open
1 task done
bcichowlas opened this issue Jan 24, 2024 · 2 comments
Open
1 task done

Uploading files in Vizro apps #281

bcichowlas opened this issue Jan 24, 2024 · 2 comments
Assignees
Labels
Community Issue/PR opened by the open-source community Issue: Feature Request 🤓 Issue/PR contains a feature request or is based on a feature request

Comments

@bcichowlas
Copy link

Which package?

vizro

What's the problem this feature will solve?

Perhaps there is a way already to do it, but I want the user to be able to select a file on the local computer and use it for analysis. I was hoping that there was a "vizro" object to do uploads, but I can't find one. Lacking that, can one somehow include a dcc object, such as Upload, into a "vizro" app? I saw one place that said one vizro object was "a thin wrapper" on a dcc object, but I don't know if there is someway for me to do that. Also lacking that, could I make a multipage app where I could have a dcc Update on a separate page or perhaps as a dropdown? If not, I think you really should have an "Upload" object or some object that includes that functionality.

Describe the solution you'd like

I described ideally want to do Upload in a vizro object in the "What's the problem" section above.

Alternative Solutions

I described alternative solutions in the "What's the problem" section above.

Additional context

Is there a vizro forum for discussing this sort of issue? I looked at the "dash" forum, but it only seemed to mention vizro in one post.

Code of Conduct

@bcichowlas bcichowlas added Issue: Feature Request 🤓 Issue/PR contains a feature request or is based on a feature request Status: Needs triage 🔍 Issue/PR needs triaging labels Jan 24, 2024
@antonymilne
Copy link
Contributor

Hello @bcichowlas and thanks very much for raising this very good issue.

Is there a vizro forum for discussing this sort of issue? I looked at the "dash" forum, but it only seemed to mention vizro in one post.

At the moment there's no dedicated forum for vizro - the best place to ask questions is here in Github issues or on the plotly forums. Feel free to respond to the post I made there about vizro or make a new topic, and I'm sure that @Coding-with-Adam will make sure we see it.


You ask a very good question. The basic answer is that there's not yet a native way to do this built into vizro, but depending on your exact requirements it's probably possible to get something working. And maybe in the future there will be a native way to do it. This is actually the first time I've heard this user request on vizro, but it's a very reasonable one I think. So I'd be very interested in hearing whether other users would find this useful also. At the moment we're reworking how the data manager works and will definitely take this into consideration.

It's definitely possible to make a new vizro component that wraps dcc.Upload. This should be pretty easy but let me know if you can't get it working.

The main challenge you'll face willbe: what do you want to do with the output? And here the right solution depends heavily on your exact requirements, e.g.

  • what vizro components should change dependent on the uploaded file? Some graphs I imagine?
  • do you want to persist the uploaded data to disk or just keep in memory? How big are the files you're uploading? (e.g. https://github.com/fohrloop/dash-uploader might be more suitable than dcc.Upload)
  • does this need to be production ready or just for your personal development purposes? Are you concerned about security of the solution?
  • will you have multiple users? Do they need to have independent user sessions? Should one user be able to see the results from another user's uploaded files?

So if you could explain exactly what you're looking for then I can try to offer some more suggestions.

@antonymilne antonymilne self-assigned this Jan 25, 2024
@antonymilne antonymilne removed the Status: Needs triage 🔍 Issue/PR needs triaging label Jan 25, 2024
@bcichowlas
Copy link
Author

bcichowlas commented Jan 25, 2024

Thanks for your reply. As a temporary solution, I put copies of all the files I might be interested in within one directory and am using a dropdown, but that's definitely an interim thing.

I didn't know how to wrap a component, but I will take a look at it.

This is for an early startup, so it's very much prototype informal, though eventually some of what you mention will be a concern. I'm intending, for the time being, that people use local files on their computer, not even necessarily connected to the internet, so that mitigates some of the security. The csv files are not updated, so if somebody wanted to try the same file as another, they'd probably email the file or share it on Google drive or similar.

The files have few columns (1 or a very sparsely populated 9) but can be quite long, even 100,000 entries or more. It's time-oriented data so mostly the users want to zero in on a particular part of the file, but sometimes they look at the overview to spot sections of interest. And, yes, sometimes users would want to look at one file after another,

I'm new to dash, plotly and Vizro, though I've done similar sorts of things on iOS using SwiftUI and other tools.

Thanks, Bruce

@maxschulz-COL maxschulz-COL added the Community Issue/PR opened by the open-source community label Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community Issue/PR opened by the open-source community Issue: Feature Request 🤓 Issue/PR contains a feature request or is based on a feature request
Projects
None yet
Development

No branches or pull requests

3 participants