forked from plotly/dash-recipes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdash-hidden-graph.py
39 lines (33 loc) · 885 Bytes
/
dash-hidden-graph.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import dash
from dash.dependencies import Input, Output, Event
import dash_html_components as html
import dash_core_components as dcc
app = dash.Dash()
app.layout = html.Div([
html.Button('plot', id='button'),
html.Div(id='p_section'),
# html.Div(dcc.Graph(id='hidden-graph', figure={'data': []}), style={'display': 'none'})
])
@app.callback(Output('p_section', 'children'), events=[Event('button', 'click')])
def update_output():
fig = dcc.Graph(
id='example',
figure={
'data': [{
'y': [1, 5, 3],
'type': 'bar'
}]
}
)
fig2 = dcc.Graph(
id='example-1',
figure={
'data': [{
'y': [1, 5, 3],
'type': 'bar'
}]
}
)
return [fig, fig2]
if __name__ == '__main__':
app.run_server(debug=True)