Skip to content

Commit 963c334

Browse files
committed
let users opt into Tab vs. Page
1 parent 649874a commit 963c334

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "PlotlyLight"
22
uuid = "ca7969ec-10b3-423e-8d99-40f33abb42bf"
33
authors = ["joshday <[email protected]>"]
4-
version = "0.7.4"
4+
version = "0.7.5"
55

66
[deps]
77
Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"

src/PlotlyLight.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ Base.@kwdef mutable struct Settings
104104
layout::Config = Config()
105105
config::Config = Config()
106106
iframe::Union{Nothing, Cobweb.IFrame} = nothing
107+
display_object::Union{Type{Cobweb.Page}, Type{Cobweb.Tab}} = Cobweb.Page
107108
end
108109
function Base.show(io::IO, o::Settings)
109110
println(io, "PlotlyLight.Settings:")
@@ -121,6 +122,8 @@ function Base.show(io::IO, o::Settings)
121122
printstyled(io, " Config with keys: $(join(repr.(keys(o.config)), ", "))", '\n', color=:light_black)
122123
printstyled(io, " • iframe: \n", color=:light_cyan)
123124
printstyled(io, " ", repr(o.iframe), '\n', color=:light_black)
125+
printstyled(io, " • display_object: \n", color=:light_cyan)
126+
printstyled(io, " ", repr(o.display_object), '\n', color=:light_black)
124127
end
125128

126129
const SETTINGS = Settings()
@@ -237,7 +240,7 @@ Base.:(==)(a::Plot, b::Plot) = a.data == b.data && a.layout == b.layout && a.con
237240

238241
#-----------------------------------------------------------------------------# Display
239242
function page(o::Plot; remove_margins=false)
240-
return Cobweb.Page(h.html(
243+
return SETTINGS.display_object(h.html(
241244
h.head(
242245
h.meta(charset="utf-8"),
243246
h.meta(name="viewport", content="width=device-width, initial-scale=1"),

0 commit comments

Comments
 (0)