Skip to content

Commit

Permalink
forgot to remowe comments
Browse files Browse the repository at this point in the history
  • Loading branch information
fredo-dedup committed Mar 12, 2017
1 parent 821d91a commit fea2f01
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions src/atom_integration.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,27 @@
end

# tests if wkhtmltoimage is in the path, if yes define rendering in plot pane
# try
# run(`wkhtmltoimage -V`)
#
# Media.media(VegaLiteVis, Media.Plot)
#
# Media.render(e::Atom.Editor, plt::VegaLiteVis) =
# Media.render(e, nothing)
#
# function Media.render(pane::Atom.PlotPane, plt::VegaLiteVis)
# # create a temporary file
# tmppath = string(tempname(), ".vegalite.html")
# open(tmppath, "w") do io
# writehtml(io, plt)
# end
#
# sz = (400,400)
# png_fn = string(tempname(), ".png")
# run(`wkhtmltoimage -f png -q --width $(sz[1]) --height $(sz[2]) $tmppath $png_fn`)
#
# Media.render(pane, Atom.div(Atom.img(src=png_fn)))
# end
# end
try
run(`wkhtmltoimage -V`)

Media.media(VegaLiteVis, Media.Plot)

Media.render(e::Atom.Editor, plt::VegaLiteVis) =
Media.render(e, nothing)

function Media.render(pane::Atom.PlotPane, plt::VegaLiteVis)
# create a temporary file
tmppath = string(tempname(), ".vegalite.html")
open(tmppath, "w") do io
writehtml(io, plt)
end

sz = (400,400)
png_fn = string(tempname(), ".png")
run(`wkhtmltoimage -f png -q --width $(sz[1]) --height $(sz[2]) $tmppath $png_fn`)

Media.render(pane, Atom.div(Atom.img(src=png_fn)))
end
end

end

0 comments on commit fea2f01

Please sign in to comment.