Skip to content

Have a 2nd look at DashBasePlotsExt #15

Description

@etpinard

specifically its ::Plots.Plot{Plots.PlotlyBackend} dispatch

function DashBase.to_dash(p::Plots.Plot{Plots.PlotlyBackend})
return if haskey(Base.loaded_modules, Base.PkgId(Base.UUID("a03496cd-edff-5a9b-9e67-9cda94a718b5"), "PlotlyBase")) &&
haskey(Base.loaded_modules, Base.PkgId(Base.UUID("f2990250-8cf9-495f-b13a-cce12b45703c"), "PlotlyKaleido"))
# Note: technically it would be sufficient if PlotlyBase is loaded, but thats how it is currently handled by Plots.jl
sp = Plots.plotlybase_syncplot(p)
DashBase.to_dash(sp)
else
Dict(:data => Plots.plotly_series(p), :layout => Plots.plotly_layout(p))
end
end

which looks up if PlotlyKaleido is loaded to determine if DashBase.to_dash can use Plots.plotlybase_syncplot.


After a quick over in https://github.com/JuliaPlots/Plots.jl, I couldn't find haskey(Base.loaded_modules, #= =#) signatures mentioned in the comment of the above DashBasePlotsExt snippet.

Maybe the pattern in Plots.jl has changed since the DashBase v1 release (back in August 2023) ? 🤔

Having PlotlyKaleido in the DashBase [compat] list may cause issues with Julia 1.10 (ref JuliaPlots/PlotlyKaleido.jl#6)

We should take a 2nd look at this.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions