Shantala commited on
Commit
3721dde
·
verified ·
1 Parent(s): 1a04b42

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +28 -0
app.py ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from dash import Dash, Input, Output, callback, dcc, html
2
+
3
+ app = Dash(__name__)
4
+ md = """
5
+ # Dash demo
6
+
7
+ See [The dash examples index](https://dash-example-index.herokuapp.com/) for more examples.
8
+ """
9
+
10
+ app.layout = html.Div(
11
+ children=[
12
+ dcc.Markdown(children=md, link_target="_blank"),
13
+ dcc.Dropdown(id="dropdown", options=["red", "green", "blue", "orange"]),
14
+ dcc.Markdown(id="markdown", children=["## Hello World"]),
15
+ ]
16
+ )
17
+
18
+
19
+ @callback(
20
+ Output("markdown", "style"),
21
+ Input("dropdown", "value"),
22
+ )
23
+ def update_markdown_style(color):
24
+ return {"color": color}
25
+
26
+ if __name__ == '__main__':
27
+ app.run_server(host='0.0.0.0', port=8050, debug=False)
28
+