mckinsey / vizro

Vizro is a toolkit for creating modular data visualization applications.
https://vizro.readthedocs.io/en/stable/
Apache License 2.0
2.69k stars 142 forks source link

Uploading files in Vizro apps #281

Open bcichowlas opened 9 months ago

bcichowlas commented 9 months ago

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

antonymilne commented 9 months ago

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.

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

bcichowlas commented 9 months ago

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