ECharts works perfectly fine, pyecharts works as well if I use .render_embed() and than use the string with a panel HTML pane, but when I’m trying to use a pyecharts object with a panel ECharts pane I get an error saying the pane doesn’t take pyecharts… objects.
There are some nice Liquid indicators in pyecharts not available in JS ECharts, hence I’m looking for a solution as the .render_embed() way doesn’t work out as expected.
Anyone seen a working pyecharts example? I couldn’t find any…
I was about to submit the issue at GitHub, when I realised that pyecharts does work with a clean Panel app with no template, no Classes or callbacks, etc.
I need to play around with this to see what’s the issue with the original app. Happy days!
I ran into this same issue. Only in simple cases does the pane work with an echart object. All examples use JSON/dict style definition of echart and not a pyecharts object. So I end up resorting to grabbing the JSON out of the echart object itself. Its hacky (and I think missing coverage in Panel), but it seems to work just fine:
Wow, thanks for quick fix Marc. I tried diving into the echart module and couldn’t figure the fix out. I just don’t have a good grasp on Panel’s internal workings. Is there any high level material that describes the code base (for more community PRs) or does one just have to read the entire library code or any tips on how to build a mental model of how panel internals work?
I don’t know of any documentation that can really help. But starting out small, reaching out on the gitter Channel for developer help, reading some code and debugging some code is the way to go.
@jbogaardt, In case you’re struggling… As I’ve briefly described in the original post, if you use .render_embed() with your pyecharts object and pass it on to a pn.pane.HTML, then you will have full functionality. This method works with params too and I’ve also tested it with periodic callbacks. It works like a charm with the more complex pyecharts objects too like tabs, pages, etc.