also add plotly json mime to PlotlyBackend

This commit is contained in:
SimonDanisch 2019-03-12 12:59:19 +01:00
parent 581f3797bc
commit 56525ced92

View File

@ -853,11 +853,16 @@ end
# ---------------------------------------------------------------- # ----------------------------------------------------------------
function _show(io::IO, ::MIME"application/vnd.plotly.v1+json", plot::Plot{PlotlyBackend})
function _show(io::IO, ::MIME"text/html", plt::Plot{PlotlyBackend}) data = []
write(io, html_head(plt) * html_body(plt)) for series in plot.series_list
append!(data, plotly_series(plot, series))
end
layout = plotly_layout(plot)
JSON.print(io, Dict(:data => data, :layout => layout))
end end
function _display(plt::Plot{PlotlyBackend}) function _display(plt::Plot{PlotlyBackend})
standalone_html_window(plt) standalone_html_window(plt)
end end