Open langley opened 5 years ago
Found out that if I add this to a cell plotly renders!
kernel.publish.html("""
<script src="/static/components/requirejs/require.js"></script>
<script>
requirejs.config({
paths: {
base: '/static/base',
plotly: 'https://cdn.plot.ly/plotly-latest.min.js?noext',
},
});
</script>""")
Now... on to figuring out how to make this easy or automatic!
This SO article talks about registering pre_run_cell logic for the python solution to the problem.
IPython.get_ipython().events.register('pre_run_cell', configure_plotly_browser_state)
The almond module actually does something similar to inject plotly.js into Jupyter classic:
If we're able to detect that we're running on colab somehow, we could adapt that logic.
I tried uploading the plotly-scala.ipynb from almond.sh examples to colaboratory.
I got it to run but I don't get any plots in the browser.
I've seen some comments about something similar for python in SO.