I have a dcc.dropdown that determines how what data should populate a dcc.graph. However i also want to use the same returned value from the dropdown @callback to also display an image in addition to the dcc.graph if its the correct @callback value. Fundamentally should this all be occuring in the def update_output(value) function? My knowledge of how the callback and return from the function works might be making this more confusing! Happy to elaborate on what is is iām trying to accomplish!
thanks,
Eric
hi @tangedahl
Good question. You can definitely use the callback to listen to the dropdown value and return an image to an empty div or html.Img()
, based on the value chosen. You can even do this and the graph update in the same callback. Just make sure that the callback has two Outputs: the figure
of the dcc.Graph and the src
of the html.Img().
Here is a great tutorial post on embedding images into a Dash app.
@adamschroeder thank you! Yes with multiple Output Callbacks I was able to change the visibility of multiple components on the page.
1 Like