-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plots fail when used in Pluto notebooks #166
Comments
@beorostica I moved this to high priority, as I believe it is fundamental to be compatible with the language tools. This can be done creating a new struct that has the Plotly plot inside and define what the Like struct PlutoPlotlyPlot
plot::PlotlyJS.SyncPlot
end This should be a package extension so it will only be defined if you imported Pluto. using KomaMRIPlots
p = plot_seq(...) #p::PlotlyJS.SyncPlot and using KomaMRIPlots, Pluto
p = plot_seq(...) #p::KomaMRIPlots.PlutoPlotlyPlot The problem I see with this approach is that we could loose the subplotting functionality Base.hcat(sps::SyncPlot...) = SyncPlot(hcat(Plot[sp.plot for sp in sps]...))
Base.vcat(sps::SyncPlot...) = SyncPlot(vcat(Plot[sp.plot for sp in sps]...))
Base.hvcat(rows::Tuple{Vararg{Int}}, sps::SyncPlot...) =
SyncPlot(hvcat(rows, Plot[sp.plot for sp in sps]...)) So #Example with hcat
import Base.hcat
Base.hcat(ppps::PlutoPlotlyPlot...) = PlutoPlotlyPlot(hcat([ppp.plot for ppp in ppps]...)) |
Just realized that is even easier! someone already did the job for us. |
This is an example that seems to work, just need to do this automatically when in Pluto. |
I think I fixed it in Example: |
KomaMRIPlots Pluto compatibility #166
Apparently the plots need to be fixed in Pluto. Not sure if this is a problem with PlotlyJS and Pluto or if we can fix it somehow.
PlutoNotebook.zip
The text was updated successfully, but these errors were encountered: