Thank you, that definitely got me further. I added a dictionary of values and keys called all_options , and referenced the string values in the dropdown and pass those into the callback.
My function in the callback now looks like:
def update_graph(input_value):
return {
'data': [
go.Scatter(
x = all_options[input_value]['x'],
y = all_options[input_value]['y'],
mode='lines',
name= all_options[input_value]['name'],
marker = all_options[input_value]['marker']
)
],
'layout': go.Layout(
dragmode='pan',
)
}
When I start the app, I get the dropdown to show up as well as the first plot with no errors, though when I try to edit the graph in any way from the dropdown, then I get:
TypeError: unhashable type: ‘list’
Traceback (most recent call last)
File “/home/jsgart/VSCode/Macro Indicator/app.py”, line 58, in update_graph
x = all_options[input_value][‘x’],
TypeError: unhashable type: ‘list’
Traceback (most recent call last):
File “/home/jsgart/VSCode/Macro Indicator/app.py”, line 58, in update_graph
x = all_options[input_value][‘x’],
TypeError: unhashable type: ‘list’
Upon inspection it looks like even though I have one initial value set, that all the values of the dropdown are trying to get passed in at once? I am guessing this is normal behavior and that I now need to process these values in a for loop?