@@ -2,9 +2,7 @@ module PlotlyLight
2
2
3
3
using Artifacts: @artifact_str
4
4
using Downloads: download
5
- using Random: randstring
6
5
using Dates
7
- using REPL: REPLDisplay
8
6
9
7
using JSON3: JSON3
10
8
using EasyConfig: Config
@@ -71,7 +69,7 @@ mutable struct Plot
71
69
data:: Vector{Config}
72
70
layout:: Config
73
71
config:: Config
74
- Plot (data:: AbstractVector , layout = Config (), config = Config ()) = new (Config .(data), Config (layout), Config (config))
72
+ Plot (data:: AbstractVector = Config[] , layout = Config (), config = Config ()) = new (Config .(data), Config (layout), Config (config))
75
73
Plot (data, layout = Config (), config = Config ()) = new ([Config (data)], Config (layout), Config (config))
76
74
end
77
75
@@ -84,11 +82,6 @@ save(file::AbstractString, p::Plot) = save(p, file)
84
82
(p:: Plot )(data:: Config ) = (push! (p. data, data); return p)
85
83
(p:: Plot )(p2:: Plot ) = merge! (p, p2)
86
84
87
- function Plot (; kw... )
88
- Base. depwarn (" `Plot(; kw...)` is deprecated. Use `plot(; kw...)` instead." , :Plot , force= true )
89
- plot (; kw... )
90
- end
91
-
92
85
Base. getproperty (p:: Plot , x:: Symbol ) = x in fieldnames (Plot) ? getfield (p, x) : (; kw... ) -> p (plot (; type= x, kw... ))
93
86
Base. propertynames (p:: Plot ) = vcat (fieldnames (Plot)... , keys (plotly. schema. traces)... )
94
87
@@ -156,8 +149,11 @@ function Base.show(io::IO, ::MIME"text/html", o::Plot)
156
149
show (io, MIME (" text/html" ), html_div (o))
157
150
end
158
151
Base. show (io:: IO , :: MIME"juliavscode/html" , o:: Plot ) = show (io, MIME (" text/html" ), o)
152
+ Base. show (io:: IO , :: MIME"text/plain" , o:: Plot ) = Cobweb. preview (html_page (o), reuse= settings. reuse_preview)
153
+
154
+ # Base.display(::REPLDisplay, o::Plot) = Cobweb.preview(html_page(o), reuse=settings.reuse_preview)
155
+ # Base.display(::REPLDisplay, ::MIME"text/plain", o::Plot) = Cobweb.preview(html_page(o), reuse=settings.reuse_preview)
159
156
160
- Base. display (:: REPLDisplay , o:: Plot ) = Cobweb. preview (html_page (o), reuse= settings. reuse_preview)
161
157
162
158
163
159
# -----------------------------------------------------------------------------# preset
0 commit comments