Skip to content

Commit

Permalink
ENH: persistent plots when connected to internet
Browse files Browse the repository at this point in the history
  • Loading branch information
sglyon committed Feb 5, 2018
1 parent 8ffccf9 commit 9e0b2d8
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/displays/ijulia.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,19 @@ function html_body(p::JupyterPlot)
<div id="$(p.view.divid)" class="plotly-graph-div"></div>
<script>
window.PLOTLYENV=window.PLOTLYENV || {};
window.PLOTLYENV.BASE_URL="https://plot.ly";
require(['plotly'], function(Plotly) {
if (window.Plotly == undefined) {
requirejs.config({
paths: {
'plotly2': ['https://cdn.plot.ly/plotly-latest.min']
},
});
require(['plotly2'], function(Plotly) {
$(script_content(p.plot))
});
} else {
$(script_content(p.plot))
});
}
</script>
"""
end
Expand Down

0 comments on commit 9e0b2d8

Please sign in to comment.