diff --git a/src/displays/ijulia.jl b/src/displays/ijulia.jl index 409aa79f..5bc8e4e2 100644 --- a/src/displays/ijulia.jl +++ b/src/displays/ijulia.jl @@ -24,23 +24,44 @@ js_loaded(::JupyterDisplay) = _jupyter_js_loaded[1] js_loaded(::Type{JupyterDisplay}) = _jupyter_js_loaded[1] function html_body(p::JupyterPlot) + lowered = JSON.lower(p.plot) + suffix = split(string(p.plot.divid, "-"), "-")[1] + unpack_json = """ + var data_$(suffix) = $(lowered[:data]); + var layout_$(suffix) = $(lowered[:layout]); + """ + + plot_code = """ + Plotly.newPlot('$(p.plot.divid)', + data_$(suffix), layout_$(suffix), + {showLink: false} + ); + """ + """
""" end