@quantpanda123 wrote:
Hello All,
I am new to dash and learning through the documentation. I want to customize every drop-down. Ex:- If drop-down ‘a’ is selected then the child of ‘a’ should have a slider and the child of ‘b’ should have another drop-down. I understand that I have to create html.div within each drop-down but do not know how. Please suggest the way forward. Also the code here (with the help of webbrowser and theading packages) opens the dash web page automatically and no need to open the localhost manually. I hope I contributed something too.
import dash
from dash.dependencies import Input, Output
import dash_html_components as html
import dash_core_components as dccapp = dash.Dash()
app.layout = html.Div([
dcc.Dropdown(
value=[‘a’],
options=[{‘label’: i, ‘value’: i} for i in [‘a’, ‘b’, ‘c’, ‘d’]],
multi=False,
id=‘dropdown’
),
html.H3(id=‘output’)
])@app.callback(Output(‘output’, ‘children’), [Input(‘dropdown’, ‘value’)])
def display_output(value):
return str(value)import webbrowser
from threading import Timerdef open_browser():
webbrowser.open_new(‘http://127.0.0.1:8050/’)if name == ‘main’:
Timer(1, open_browser).start(); app.run_server(port=8050)
Posts: 1
Participants: 1