import dash
import dash_core_components as dcc
import dash_html_components as html
import plotly.plotly as py
from plotly.graph_objs import *
from dash.dependencies import Input, Output, State
import numpy as np
import pandas as pd
import plotly.plotly as py
import plotly.graph_objs as go
import q
external_stylesheets = [‘https://codepen.io/chriddyp/pen/bWLwgP.css’,'https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css’]
app = dash.Dash(name, external_stylesheets=external_stylesheets)
app.layout=html.Div(children=[
dcc.Dropdown(id='my-dropdown-1',options=[{'label':"FUTIDX","value":"FUTIDX"},{'label':"FUTSTK","value":"FUTSTK"}]),
dcc.Dropdown(id=‘my-dropdown-2’,options=[{‘label’:“0”,“value”:“0”},{‘label’:“1”,“value”:“1”}]),
dcc.Dropdown(id=‘my-dropdown-3’,options=[{‘label’:“0”,“value”:“0”},{‘label’:“1”,“value”:“1”}]),
]
)
@app.callback(
Output(‘my-dropdown-2’,“value”),
[Input(‘my-dropdown-1’,‘value’)]
)
def update(v):
if v==“FUTIDX”:
return ‘1’
if name == ‘main’:
app.run_server(debug=True)
"""""
PROBLEM: WHEN I CHANGE VALUE OF “my-dropdown-1” all other dropdowns in layout are going to default values
’’’'