Skip to content

Commit 289fe1f

Browse files
authored
Merge pull request #401 from JuliaPlots/json23
enh add support for json2 and json3
2 parents eac4ec3 + a3ba71d commit 289fe1f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/PlotlyJS.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,12 @@ function __init__()
130130
insert!(Base.Multimedia.displays, findlast(x -> x isa REPL.REPLDisplay, Base.Multimedia.displays) + 1, PlotlyJSDisplay())
131131
end)
132132

133+
@require JSON2 = "2535ab7d-5cd8-5a07-80ac-9b1792aadce3" JSON2.write(io::IO, p::SyncPlot) = JSON.print(io, p)
134+
@require JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" begin
135+
JSON3.write(io::IO, p::SyncPlot) = JSON.print(io, p.plot)
136+
JSON3.write(p::SyncPlot) = JSON.json(p.plot)
137+
end
138+
133139
@require IJulia = "7073ff75-c697-5162-941a-fcdaad2a7d2a" begin
134140

135141
function IJulia.display_dict(p::SyncPlot)

0 commit comments

Comments
 (0)