-
Notifications
You must be signed in to change notification settings - Fork 11
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
PlotPane #7
Comments
FYI... this works for me: using Atom, Plots
p = plot(rand(10))
Media.render(Atom.PlotPane(), Atom.div(Atom.d(), Atom.HTML(stringmime(MIME("text/html"), p)))) |
I think I figured it out on my own! function setup_atom()
@require Atom begin
import Atom, Media
# connects the render function
Media.media(Plot, Media.Plot)
# Atom.displaysize(::AbstractPlot) = (535, 379)
# Atom.displaytitle(plt::AbstractPlot) = "Plots.jl (backend: $(backend(plt)))"
# this is like "display"... sends an html div with the plot to the PlotPane
function Media.render(pane::Atom.PlotPane, plt::Plot)
Media.render(pane, Atom.div(Atom.d(), Atom.HTML(stringmime(MIME("text/html"), plt))))
end
end
end Any idea what the right methods are to set the size/title? |
Great stuff! As a tip, you shouldn't need to have that Size and title only apply to BlinkDisplay windows, and won't have an affect on Atom's PlotPane (although we could perhaps reuse |
I think that should be true, but it actually stopped working for me. I had code in Plots that required DataFrames, and it wasn't running unless I called it from init. I guess I need to open an issue in Requires.
|
Hi @MikeInnes. I just started using Atom yesterday, and I was attempting to get Plots working with the PlotPane. I made an attempt at it, calling this method from
Plots.__init__
:but I end up with this error:
Any thoughts to debug it? It seems like one of the Atom packages is messing with eval internals, but it's kinda incomprehensible to me.
Side note... comments in the code would be much appreciated!
The text was updated successfully, but these errors were encountered: