malisimo / IPlot

.NET charting library based on the wonderful XPlot
MIT License
16 stars 1 forks source link

Inconsistencies in Chart.Show in .NET Interactive (HighCharts) #4

Open houstonhaynes opened 3 years ago

houstonhaynes commented 3 years ago

Some code snippets render inside the .ipynb as expected. This occurs both with a closing "Chart.Show" and without. Still there are others that only render to the external page - and only with Chart.Show piped in as the last command in the chain. There doesn't seem to be any rhyme or reason. image

image

I'm using the examples from your site to get a feel for things with notebooks. I'm an "old hand" with highcharter (R wrapper) so HighCharts is my go-to. Haven't done too much other spelunking beyond the basics so far. Just thought I'd put this here as a placeholder. Thanks - amazing work!!

houstonhaynes commented 3 years ago

image

image

houstonhaynes commented 3 years ago

https://github.com/houstonhaynes/dotnet-interactive

Also seeing this in Binder/Notebooks - only the spline chart renders.

Screenshot 2021-07-05 134340

malisimo commented 2 years ago

Thanks very much for your comprehensive post @houstonhaynes and apologies for the delay. I'll try to take a look this week but does look puzzling - the interactive stuff was the last addition and there have been lots of developments over that time. Hopefully I can reproduce. Really appreciate your time! Matt

houstonhaynes commented 2 years ago

Thanks for letting me sound off - somewhat half-baked in my approach. I'd love to know enough to actually contribute so I hope to contribute more than issues at some point.

malisimo commented 2 years ago

This is occurring due to the sunburst module (and others) not being included in the RequireJs code that's used by .NET Interactive, although Chart.Show generates the relevant script includes to allow it to function in the browser. Should be a simple fix if the module is compatible.

As you discovered, you should never need to call Chart.Show in the notebook - this would circumvent the rendering in the cell output by not returning the chart object (all other Chart functions return the chart object).