Would something like this work?
@app.callback(Output('container', 'children'), [Input('tab', 'value')]):
def display_content(selected_tab):
return html.Div([
html.H1(selected_tab),
dcc.Graph(id='graph', figure=generate_figure(selected_tab))
])
def generate_figure(selected_tab):
return {'data': [{'x': [1, 2, 3]}], 'layout': {...} # fill in with your figure
app.callback(
Output('graph', 'figure'),
events=[Event('my-interval', 'interval')],
state=[State('tab', 'value')
)(generate_figure)