@chriddyp I am working on the same, and I am facing similar issue. Here is my code. There is an excel file which gets filtered on inputting, and then that dataframe is used to create plots and graphs in Tab 1 and other plots in Tab2. I have put input button in 1st tab. Now I want that as I input something in 1st tab, the output of both the tabs are impacted (by only 1 input tab). - 1st we see the input button and then both the tabs come up withe plots.
df1=pd.read_excel("…")
app.layout = html.Div([dashboard,
html.Div(
dcc.Input(id=‘AgentID’, type=‘text’)),
html.Button(‘Submit’, id=‘button’),
dcc.Tabs(id=“tabs-example”, value=‘tab-1-example’,
children=[
dcc.Tab(label=‘Tab1’, value=‘tab-1’),
dcc.Tab(label=‘Tab2’, value=‘tab-2’)
],
],html.Div(id=‘output-tab’))
@app.callback(
dash.dependencies.Output(‘output-tab’, ‘children’),
[dash.dependencies.Input(‘button’, ‘n_clicks’)],
[dash.dependencies.State(‘AgentID’, ‘value’)])
@app.callback(Output(‘tabs-content-example’, ‘children’),
[Input(‘tabs-example’, ‘value’)])
def update(n_clicks, value):
if n_clicks == None:
df = df1.copy()
else:
df = df1[df1[‘ID’] == value]
#. . . defining variables to be used in making plots…#
def render_content(tab):
if tab == ‘tab-1’:
return html.Div(
className=“row”,
children= [
html.Div(
# …plotting the graphs…#
elif tab == 'tab-2':
return html.Div
if name == ‘main’:
app.run_server()
Please help me in the same.