Skip to content

Commit 98b71fc

Browse files
committed
Merge branch 'dev' of https://github.com/plotly/Dash.jl into dev
2 parents d982b95 + 45411e5 commit 98b71fc

File tree

6 files changed

+34
-7
lines changed

6 files changed

+34
-7
lines changed

Project.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "Dash"
22
uuid = "1b08a953-4be3-4667-9a23-3db579824955"
33
authors = ["Chris Parmer <[email protected]>", "Alexandr Romanenko <[email protected]>"]
4-
version = "1.1.1"
4+
version = "1.1.2"
55

66
[deps]
77
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
@@ -17,6 +17,7 @@ JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
1717
MD5 = "6ac74813-4b46-53a4-afec-0b5dc9d7885c"
1818
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
1919
PlotlyBase = "a03496cd-edff-5a9b-9e67-9cda94a718b5"
20+
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
2021
Sockets = "6462fe0b-24de-5631-8697-dd941f90decc"
2122
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
2223
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

README.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,7 @@ pkg> add Dash DashCoreComponents DashHtmlComponents DashTable
2525
To install the latest (stable) development version instead:
2626

2727
```julia
28-
using Pkg
29-
Pkg.add(PackageSpec(url="https://github.com/plotly/DashBase.jl.git"))
30-
Pkg.add(PackageSpec(url="https://github.com/plotly/dash-html-components.git", rev="master"))
31-
Pkg.add(PackageSpec(url="https://github.com/plotly/dash-core-components.git", rev="master"))
32-
Pkg.add(PackageSpec(url="https://github.com/plotly/dash-table.git", rev="master"))
33-
Pkg.add(PackageSpec(url="https://github.com/plotly/Dash.jl.git", rev="dev"))
28+
pkg> add Dash#dev
3429
```
3530

3631
## Usage

src/Dash.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ using DashBase
33
import HTTP, JSON3, CodecZlib, MD5
44
using Sockets
55
using Pkg.Artifacts
6+
using Requires
67

78
const ROOT_PATH = realpath(joinpath(@__DIR__, ".."))
89
#const RESOURCE_PATH = realpath(joinpath(ROOT_PATH, "resources"))
@@ -107,6 +108,7 @@ const _metadata = load_all_metadata()
107108
function __init__()
108109
setup_renderer_resources()
109110
setup_dash_resources()
111+
@require PlotlyJS="f0f68f2c-4968-5e81-91da-67840de0976a" include("plotly_js.jl")
110112
end
111113

112114

src/plotly_js.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import JSON
2+
3+
function DashBase.to_dash(p::PlotlyJS.SyncPlot)
4+
data = JSON.lower(p.plot)
5+
pop!(data, :config, nothing)
6+
return data
7+
end
8+

test/ci_prepare.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Pkg.update()
33
Pkg.develop(path = ".")
44
Pkg.add("DashBase")
55
Pkg.add("PlotlyBase")
6+
Pkg.add("PlotlyJS")
67
Pkg.add("HTTP")
78
Pkg.instantiate()
89
Pkg.build("Dash")
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using Dash
2+
using PlotlyJS
3+
app = dash()
4+
app.layout = html_div() do
5+
dcc_graph(id = "graph",
6+
figure = plot(scatter(x=1:10, y = 1:20))
7+
),
8+
html_button("draw", id = "draw"),
9+
html_div("", id = "status")
10+
end
11+
12+
callback!(app, Output("graph", "figure"), Output("status", "children"), Input("draw", "n_clicks")) do nclicks
13+
p = isnothing(nclicks) ?
14+
no_update() :
15+
plot([scatter(x=1:10, y = 1:10), scatter(x=1:10, y = 1:2:20)])
16+
status = isnothing(nclicks) ? "first" : "second"
17+
return (p, status)
18+
end
19+
20+
run_server(app)

0 commit comments

Comments
 (0)