Can't manage to make the drag n drop generate new options or graphs


I’ve tried lots of things, and non seem to work

the app has lots of pages and tabs, and in one tab, I’ve made a drag’n drop that loads the data, but the first loading data stays in the controls option dropdown and the graphs dont show…

this is the last thing I’ve tried (the script goes in this order):

1st the callbacks for the drag n drop
2nd a callback that has an if and else to return a df
3rd the controls (dropdown)
4th the pages that are displayed by a callback

I manage to see the graphs with the loading data, I manage to see the droped data in a raw table, but the graphs after that don’t update the controls or th graph (graph doesn’t show anything), and the dropdowns should take the columns from the dragndrop (and they don’t)

What do I have to do to solve this?

Edited: I’ve found this in stackoverflow, and whant to make it, how?:

the basic idea is to set up a callback that will update the options prop of your dcc.Dropdown . You can have that callback triggered (Input ) by the upload, make it read in the dataframe, obtain the columns, and then output the properly formatted list of dictionaries.


When you input the new file from the drag and drop, (and the old file), you have a secondary return from the function that builds the layout. This will return the options for the dropdown that you want.

def buildLayout(data):
     return makeLayout(data), data.columns
1 Like

thanks! I’m gonna try this today