forked from plotly/dash-recipes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdash-interval-resets-dropdown-bug.py
More file actions
37 lines (30 loc) · 996 Bytes
/
dash-interval-resets-dropdown-bug.py
File metadata and controls
37 lines (30 loc) · 996 Bytes
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
# https://community.plot.ly/t/dash-interval-updates-issues/7015/8
import dash
import dash_core_components as dcc
from dash.dependencies import Input, Output, State
import dash_html_components as html
app = dash.Dash(__name__)
server = app.server
app.layout = html.Div([
dcc.RadioItems(
id='variable_selected',
options=[
{'label':'Choice 1','value': 'option-1'},
{'label':'Choice 2','value': 'option-2'},
{'label':'Choice 3','value': 'option-3'}
],
value='option-1'
),
dcc.Interval(id='update_interval', interval=2000, n_intervals=0),
html.Div(id='output_example')
])
@app.callback(
Output('output_example', 'children'),
[Input('update_interval', 'n_intervals'),
Input('variable_selected', 'value')])
def test(interval, value):
return "The interval number is {} and the value is {}".format(
interval, value
)
if __name__ == '__main__':
app.run_server(debug=True,port=8055)