@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.