Skip to content

Commit 421c2f4

Browse files
committed
add graph render test for DashBasePlotsExt
1 parent f003ddf commit 421c2f4

File tree

3 files changed

+50
-1
lines changed

3 files changed

+50
-1
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using Dash
2+
using Plots
3+
plotly()
4+
5+
app = dash()
6+
app.layout = html_div() do
7+
dcc_graph(id = "graph", figure = plot((1:10, 1:10))),
8+
html_button("draw", id = "draw"),
9+
html_div("", id = "status")
10+
end
11+
12+
callback!(app,
13+
Output("graph", "figure"),
14+
Output("status", "children"),
15+
Input("draw", "n_clicks")) do nclicks
16+
return if isnothing(nclicks)
17+
no_update(), "first"
18+
else
19+
plot([(1:10, 1:10), (1:10, 1:2:20)]), "second"
20+
end
21+
end
22+
23+
run_server(app)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using Dash
2+
using Plots
3+
plotlyjs()
4+
5+
app = dash()
6+
app.layout = html_div() do
7+
dcc_graph(id = "graph", figure = plot((1:10, 1:10))),
8+
html_button("draw", id = "draw"),
9+
html_div("", id = "status")
10+
end
11+
12+
callback!(app,
13+
Output("graph", "figure"),
14+
Output("status", "children"),
15+
Input("draw", "n_clicks")) do nclicks
16+
return if isnothing(nclicks)
17+
no_update(), "first"
18+
else
19+
plot([(1:10, 1:10), (1:10, 1:2:20)]), "second"
20+
end
21+
end
22+
23+
run_server(app)

test/integration/base/test_plotly_graph.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,8 @@ def test_jlpg001_plotly_graph(dashjl):
2727
def test_jlpg002_plotlyjs_graph(dashjl):
2828
_run_test(dashjl, "jlpg002_plotlyjs_graph.jl", "PlotlyJS")
2929

30+
def test_jlpg003_plots_plotly_graph(dashjl):
31+
_run_test(dashjl, "jlpg003_plots_plotly_graph.jl", "Plots plotly")
3032

31-
33+
def test_jlpg004_plots_plotlyjs_graph(dashjl):
34+
_run_test(dashjl, "jlpg004_plots_plotlyjs_graph.jl", "Plots plotlyjs")

0 commit comments

Comments
 (0)