support plotly mime type
This commit is contained in:
parent
19243b741a
commit
2c8d51988b
@ -55,6 +55,11 @@ _show(io::IO, ::MIME"image/png", plt::Plot{PlotlyJSBackend}) = PlotlyJS.savefig(
|
|||||||
_show(io::IO, ::MIME"application/pdf", plt::Plot{PlotlyJSBackend}) = PlotlyJS.savefig(io, plt.o, format="pdf")
|
_show(io::IO, ::MIME"application/pdf", plt::Plot{PlotlyJSBackend}) = PlotlyJS.savefig(io, plt.o, format="pdf")
|
||||||
_show(io::IO, ::MIME"image/eps", plt::Plot{PlotlyJSBackend}) = PlotlyJS.savefig(io, plt.o, format="eps")
|
_show(io::IO, ::MIME"image/eps", plt::Plot{PlotlyJSBackend}) = PlotlyJS.savefig(io, plt.o, format="eps")
|
||||||
|
|
||||||
|
function _show(io::IO, m::MIME"application/vnd.plotly.v1+json", plt::Plot{PlotlyJSBackend})
|
||||||
|
show(io, m, plt.o)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
function write_temp_html(plt::Plot{PlotlyJSBackend})
|
function write_temp_html(plt::Plot{PlotlyJSBackend})
|
||||||
filename = string(tempname(), ".html")
|
filename = string(tempname(), ".html")
|
||||||
savefig(plt, filename)
|
savefig(plt, filename)
|
||||||
|
|||||||
@ -189,7 +189,7 @@ end
|
|||||||
# for writing to io streams... first prepare, then callback
|
# for writing to io streams... first prepare, then callback
|
||||||
for mime in ("text/plain", "text/html", "image/png", "image/eps", "image/svg+xml",
|
for mime in ("text/plain", "text/html", "image/png", "image/eps", "image/svg+xml",
|
||||||
"application/eps", "application/pdf", "application/postscript",
|
"application/eps", "application/pdf", "application/postscript",
|
||||||
"application/x-tex")
|
"application/x-tex", "application/vnd.plotly.v1+json")
|
||||||
@eval function Base.show(io::IO, m::MIME{Symbol($mime)}, plt::Plot)
|
@eval function Base.show(io::IO, m::MIME{Symbol($mime)}, plt::Plot)
|
||||||
if haskey(io, :juno_plotsize)
|
if haskey(io, :juno_plotsize)
|
||||||
showjuno(io, m, plt)
|
showjuno(io, m, plt)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user