ijulia, plotly, and gr display fixes
This commit is contained in:
parent
9a544b0ff3
commit
ed1cce86ef
36
src/Plots.jl
36
src/Plots.jl
@ -223,38 +223,16 @@ yaxis!(plt::Plot, args...; kw...) = plot!(pl
|
||||
|
||||
# ---------------------------------------------------------
|
||||
|
||||
|
||||
# try
|
||||
# import DataFrames
|
||||
# dataframes()
|
||||
# end
|
||||
|
||||
# const CURRENT_BACKEND = pickDefaultBackend()
|
||||
|
||||
# for be in backends()
|
||||
# try
|
||||
# backend(be)
|
||||
# backend()
|
||||
# catch err
|
||||
# @show err
|
||||
# end
|
||||
# end
|
||||
|
||||
const CURRENT_BACKEND = CurrentBackend(:none)
|
||||
|
||||
# function __init__()
|
||||
# # global const CURRENT_BACKEND = pickDefaultBackend()
|
||||
# # global const CURRENT_BACKEND = CurrentBackend(:none)
|
||||
function __init__()
|
||||
|
||||
# # global CURRENT_BACKEND
|
||||
# # println("[Plots.jl] Default backend: ", CURRENT_BACKEND.sym)
|
||||
|
||||
# # # auto init dataframes if the import statement doesn't error out
|
||||
# # try
|
||||
# # @eval import DataFrames
|
||||
# # dataframes()
|
||||
# # end
|
||||
# end
|
||||
# override IJulia inline display
|
||||
if isijulia()
|
||||
@eval import IJulia
|
||||
IJulia.display_dict(plt::PlottingObject) = Dict{ASCIIString, ByteString}("text/html" => sprint(writemime, "text/html", plt))
|
||||
end
|
||||
end
|
||||
|
||||
# ---------------------------------------------------------
|
||||
|
||||
|
||||
@ -701,6 +701,10 @@ function Base.writemime(io::IO, m::MIME"image/svg+xml", plt::PlottingObject{GRPa
|
||||
write(io, readall("gks.svg"))
|
||||
end
|
||||
|
||||
function Base.writemime(io::IO, m::MIME"text/html", plt::PlottingObject{GRPackage})
|
||||
writemime(io, MIME("image/svg+xml"), plt)
|
||||
end
|
||||
|
||||
function Base.writemime(io::IO, m::MIME"application/pdf", plt::PlottingObject{GRPackage})
|
||||
GR.emergencyclosegks()
|
||||
ENV["GKS_WSTYPE"] = "pdf"
|
||||
@ -722,5 +726,6 @@ function Base.display(::PlotsDisplay, plt::Plot{GRPackage})
|
||||
end
|
||||
|
||||
function Base.display(::PlotsDisplay, plt::Subplot{GRPackage})
|
||||
gr_display(plt)
|
||||
true
|
||||
end
|
||||
|
||||
@ -457,11 +457,8 @@ end
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
|
||||
|
||||
function Base.writemime(io::IO, ::MIME"image/png", plt::PlottingObject{PlotlyPackage})
|
||||
isijulia() && return
|
||||
# TODO: write a png to io
|
||||
println("todo: png")
|
||||
warn("todo: png")
|
||||
end
|
||||
|
||||
function Base.writemime(io::IO, ::MIME"text/html", plt::PlottingObject{PlotlyPackage})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user