n-riesco / ijavascript

IJavascript is a javascript kernel for the Jupyter notebook
Other
2.19k stars 185 forks source link

Rendering Highcharts #114

Open 3goats opened 7 years ago

3goats commented 7 years ago

Hi,

How would I render Highcharts in Jupyter using iJavascript?

Regards,

Carl

n-riesco commented 7 years ago

I'm more familiar with Plotly, but I'll try to give you some pointers.

First of all, the answer to your question depends on the Jupyter client you're using. For example, both hydrogen and nteract accept Plotly's custom MIME type. This is the easiest case, as shown by ijavascript-plotly. To support Highcharts with this approach, instead of opening an issue here, you'd need to open the issue in the repository for your Jupyter client.

IJavascript is a kernel that runs Javascript on a Node.js session. If you are able to run Highcharts inside a Node session and render the chart as SVG, PNG, JPEG or HTML, then IJavascript provides some functionality to show this output in the notebook. See the documentation here for the details.

As an example of this second approach, see the answer I provided in Stack Overflow to render SVG using D3 and JSDOM. Unfortunately, JSDOM isn't a perfect replacement for a browser's DOM, and you may soon find missing functionality required by your charting library.


As I said above, I'm not familiar with Highcharts, but a quick search has thrown an interesting option.