fix change in checking if plotly_blink window is active
This commit is contained in:
parent
1562c96d4c
commit
c62d8d6753
@ -7,7 +7,8 @@ function _create_plot(pkg::PlotlyPackage; kw...)
|
|||||||
d = Dict(kw)
|
d = Dict(kw)
|
||||||
# TODO: create the window/canvas/context that is the plot within the backend (call it `o`)
|
# TODO: create the window/canvas/context that is the plot within the backend (call it `o`)
|
||||||
# TODO: initialize the plot... title, xlabel, bgcolor, etc
|
# TODO: initialize the plot... title, xlabel, bgcolor, etc
|
||||||
o = PlotlyJS.Plot()
|
o = PlotlyJS.Plot(PlotlyJS.GenericTrace[], PlotlyJS.Layout(),
|
||||||
|
Base.Random.uuid4(), PlotlyJS.ElectronDisplay())
|
||||||
|
|
||||||
Plot(o, pkg, 0, d, Dict[])
|
Plot(o, pkg, 0, d, Dict[])
|
||||||
end
|
end
|
||||||
@ -21,7 +22,7 @@ function _add_series(::PlotlyPackage, plt::Plot; kw...)
|
|||||||
typ = pop!(pdict, :type)
|
typ = pop!(pdict, :type)
|
||||||
gt = PlotlyJS.GenericTrace(typ; pdict...)
|
gt = PlotlyJS.GenericTrace(typ; pdict...)
|
||||||
push!(plt.o.data, gt)
|
push!(plt.o.data, gt)
|
||||||
if !isnull(plt.o.window)
|
if PlotlyJS.isactive(plt.o._display)
|
||||||
PlotlyJS.addtraces!(plt.o, gt)
|
PlotlyJS.addtraces!(plt.o, gt)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -33,7 +34,7 @@ end
|
|||||||
function _update_plot(plt::Plot{PlotlyPackage}, d::Dict)
|
function _update_plot(plt::Plot{PlotlyPackage}, d::Dict)
|
||||||
pdict = plotly_layout(d)
|
pdict = plotly_layout(d)
|
||||||
plt.o.layout = PlotlyJS.Layout(pdict)
|
plt.o.layout = PlotlyJS.Layout(pdict)
|
||||||
if !isnull(plt.o.window)
|
if PlotlyJS.isactive(plt.o._display)
|
||||||
PlotlyJS.relayout!(plt.o; pdict...)
|
PlotlyJS.relayout!(plt.o; pdict...)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user