From 01f776f6087627ef0a07e598902e7b3f63461bef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Helmut=20H=C3=A4nsel?= Date: Mon, 27 May 2024 16:47:47 +0200 Subject: [PATCH] fix parsing for Plot, add parsing for Layout and GenericTrace --- ext/StipplePlotlyPlotlyBaseExt.jl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ext/StipplePlotlyPlotlyBaseExt.jl b/ext/StipplePlotlyPlotlyBaseExt.jl index dc2fe95..7a7f339 100644 --- a/ext/StipplePlotlyPlotlyBaseExt.jl +++ b/ext/StipplePlotlyPlotlyBaseExt.jl @@ -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) @@ -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 \ No newline at end of file