This might make things as clear as mud…but picture a page that has two rows. First row, 3 divs: data table/rangeslider, barchart, map.
Second Row, full width scatter plot.
setup
Initiate and slice various dfs for later use. These dfs are copied and resliced as appropriate on callbacks. Individual divs from #above rerendered.
…
app.layout = html.Div([
# First Row
html.Div(children = [
# Data Table
html.Div(id='summary_table',children = [
html.H1('Boston',style={...}),
dash_table.DataTable(id='table',
columns=[{"name": i, "id": i} for i in table_df.columns],
data=table_df.to_dict('records'),
style_cell={...},
style_as_list_view=True,
style_cell_conditional=[
{},
{},
{}
]),
html.Div(children=[dcc.RangeSlider(id='range_slider',
...
updatemode='mouseup')],
style={}), #End Div 1
html.Div(id='bar-graph',children = [\
dcc.Graph(figure=,
config={'modeBarButtonsToRemove': ['toggleSpikelines',
...]},
style={}), #End Div 2
html.Div(children = [an Iframe]),
# set the sizing of the first row parent div
style = {'display': 'inline-block',
}),#<--End Div3 and First Row
html.Hr(),
#4 Readings per year
html.Div(id='yearly-scatter',children = [
dcc.Graph(figure=...,
config={'modeBarButtonsToRemove': ['toggleSpikelines',
"select2d", "lasso2d","hoverCompareCartesian"]},
style={})])#End second Row
])
@app.callback(Output(‘summary_table’,‘children’),
[Input(‘range_slider’,‘value’)])
def update_value(slider_range):
....
table_df=func.make_summary_table(all_days_df,bf_slope)
child=[
html.H1('Boston',style={...}),
dash_table.DataTable(id='table',
columns=[{"name": i, "id": i} for i in table_df.columns],
data=table_df.to_dict('records'),
style_cell={...},
style_as_list_view=True,
style_cell_conditional=[
{},
{},
{}
])
html.Div(children=[dcc.RangeSlider(id='range_slider',
min=xnew, max=ynew, step=10,
marks={i: i for i in range()},
updatemode='mouseup',
value=[slider_range[0],slider_range[1]])],
style={'margin-top':'15px','vertical-align':'bottom'}),
]
return child
@app.callback(Output(‘bar-graph’,‘children’),
[Input(‘range_slider’, ‘value’)])#,
#[State(‘range_slider’,‘value’)])
def update_bar(slider_range):
.etc
if name == ‘main’:
app.run_server()