Skip to content

Commit

Permalink
fix parsing for Plot, add parsing for Layout and GenericTrace
Browse files Browse the repository at this point in the history
  • Loading branch information
Helmut Hänsel committed May 27, 2024
1 parent f7f6c38 commit 01f776f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion ext/StipplePlotlyPlotlyBaseExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module StipplePlotlyPlotlyBaseExt
using StipplePlotly
using StipplePlotly.Stipple
using StipplePlotly.Charts
import Stipple.stipple_parse

isdefined(Base, :get_extension) ? (using PlotlyBase) : (using ..PlotlyBase)

Expand All @@ -25,8 +26,16 @@ function PlotlyBase.Plot(d::AbstractDict)
PlotlyBase.Plot(data, layout, frames; config)
end

function stipple_parse(::Type{PlotlyBase.Plot}, d::AbstractDict)
function Stipple.stipple_parse(::Type{PlotlyBase.Plot}, d::AbstractDict)
PlotlyBase.Plot(d)
end

function Stipple.stipple_parse(::Type{T}, d::AbstractDict) where T <: PlotlyBase.AbstractTrace
T(d)
end

function Stipple.stipple_parse(::Type{PlotlyBase.Layout}, d::AbstractDict)
PlotlyBase.Layout(d)
end

end

0 comments on commit 01f776f

Please sign in to comment.