Skip to content

Commit

Permalink
juno display
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeInnes committed Sep 21, 2016
1 parent 99aaa76 commit 4728bf7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions REQUIRE
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ KernelDensity
Loess
Showoff 0.0.3
StatsBase
Juno
16 changes: 15 additions & 1 deletion src/Gadfly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ Creates layers based on elements
### Args
* data_source: The data source as a dataframe
* elements: The elements
* elements: The elements
* mapping: mapping
### Returns
Expand Down Expand Up @@ -1105,6 +1105,20 @@ function display(d::REPLDisplay, ::MIME"application/pdf", p::Plot)
open_file(filename)
end

# Display in Juno

using Juno

@render Juno.PlotPane p::Plot begin
x, y = Juno.plotsize()
set_default_plot_size(x*Gadfly.px, y*Gadfly.px)
div(d(:style=>"background: white"),
HTML(stringmime("text/html", p)))
end

@render Juno.Editor p::Gadfly.Plot begin
Juno.icon("graph")
end

include("scale.jl")
include("coord.jl")
Expand Down

0 comments on commit 4728bf7

Please sign in to comment.