Skip to content

Commit 76b4dfb

Browse files
authored
Merge pull request #55 from tlyon3/dash-getting-started
DASH getting-started
2 parents c5ee3fc + 848739c commit 76b4dfb

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

dash/getting-started.jl

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using Dash
2+
using DashCoreComponents
3+
using DashHtmlComponents
4+
using PlotlyJS
5+
6+
app = dash(external_stylesheets=["https://codepen.io/chriddyp/pen/bWLwgP.css"])
7+
8+
app.layout = html_div() do
9+
html_p("Color:"),
10+
dcc_dropdown(
11+
id="dropdown",
12+
options=[(label = x, value = x) for x in ["Gold", "MediumTurquoise", "LightGreen"]],
13+
value="Gold",
14+
clearable=false
15+
),
16+
dcc_graph(id="graph")
17+
end
18+
19+
callback!(app, Output("graph", "figure"), Input("dropdown", "value")) do val
20+
fig = plot(
21+
bar(
22+
x=[0,1,2],
23+
y=[2,3,1],
24+
marker_color=val
25+
)
26+
)
27+
return fig
28+
end
29+
30+
run_server(app, "0.0.0.0", 8080)

0 commit comments

Comments
 (0)