I’m new to Dash and plot.ly and I am enthusiastic about using them in an open source project](GitHub - entropy-lab/entropy) that I’m working on.
An important requirement for me is to be able to embed Bokeh plots in the Dash app but I’m having a hard time finding clear instructions on how to get this done and/or a working example.
I’ve taken some time to try and figure out what might be the root cause of the breakage in the demo. The most promising lead I’ve found is this warning in the browser developer tools console:
I’ve tried upgrading the npm dependency on bokehjs 1.2.0 to @bokehjs/bokejhs 2.4.0 both in the main package.json and in the one in the dash_alternative_viz folder and running npm install but that did not impact the warning.
Would love to dig deeper into this if anyone can suggest pointers on how to proceed. Tx
Following your advice I’ve created a new dash component using cookiecutter to educate myself and I’ve gone over the README and applied the instructions to my fork of dash_alternative_viz.
Having switched the dependency from bokkehjs to @bokeh/bokehjs I also needed to fix the require() in BokehJSON.react.js. Now npm run build:all fails with multiple instances of:
ERROR in ./node_modules/@bokeh/bokehjs/build/js/lib/core/layout/grid.js 118:72
Module parse failed: Unexpected token (118:72)
You may need an appropriate loader to handle this file type.
Do I need to get into webpack configuration (which I am not familiar with)? Or did I maybe go the wrong path here?
I haven’t had time to try this, but Dash supports HoloViews
One of the major design principles of HoloViews is that the declaration of data is completely independent from the plotting implementation. Bokeh provides a powerful platform to generate interactive plots using HTML5 canvas and WebGL, and is ideally suited towards interactive exploration of data. By combining the ease of generating interactive, high-dimensional visualizations with the interactive widgets and fast rendering provided by Bokeh, HoloViews becomes even more powerful.
I’ve taken a look at HoloViews as an abstraction over matplotlib, bokeh and plot.ly. It looks promising but I’m missing one thing that I’d like to offer my end users: Create a plot in either of the 3 libraries and have it shown in my Dash dashboard.
HoloViews doesn’t appear to work this way if I understand correctly. Rather, HoloViews lets me or my users define the plot using its API and then render it using either of the 3 libraries as “backends”.
If I do end up using HoloViews inside Dash I promise to share what I’ve learned online and to post a link here.