I would like to populate a list with values from a database and then select (multiple) values of that list to generate graphs.
Looking through the help of html.Select, I could not figure out how to access the selected values. The only property containing data that dash seems to provide access to is the ‘children’, but this has no info on whether a value is selected or not. I tried accessing various properties of both the html.Select as well as the parent html.Form object in all permutations I could think of.
It would be really great if someone can point me in the right direction. I understand that the html components probably don’t have as high a priority in documentation and features compared to the core components. Sorry if this is a trivial issue, but I don’t know whether to look for a solution in Dash or html. I’m running the dash app in a Flask server instance (to later implement several dash apps), so one option would probably be to generate the form in a flask template, but I was hoping to do it from within Dash.
Below is a snippet of how I generate the select list and want to use it in a callback.
app.layout = html.Div( children=[ html.H1(children='title'), dcc.Graph(id='plot', figure=fig), html.Form( html.Select(html.Option([i for i in wafers.WaferID.values[:10]]), size='10', multiple='multiple',name='wafer_list', id='wafer_list') , name='wafer_form', id='wafer_form', method='POST') ]) @app.callback( Output(component_id='plot', component_property='figure'), [Input(component_id='wafer_form', component_property='children')], events=[Event('wafer_list','click')], state=[State('wafer_list','children')]) def update_plot(WaferID, state): # use selected values from callback of 'wafer_list' or 'wafer_form' to update Graph