0

I have an application that uses Holoviews to generate a heatmap plot that is rendered using Bokeh. I upgraded from a Python 2.7 to 3.7 environment and the saved .html plots no longer support the ability to pan, zoom, or reset. I had previously saved versions of the .html files and performed a file diff between and found a few lines that were no longer present in the .html file. I copied those lines from the previous version into the new version and see that the interactive functions now work again. After editing for version, the lines below are what I copied from the old version to the new version to get things working.

link rel="stylesheet" href="https://cdn.pydata.org/bokeh/release/bokeh-1.3.4.min.css"

link rel="stylesheet" href="https://cdn.pydata.org/bokeh/release/bokeh-widgets-1.3.4.min.css"

link rel="stylesheet" href="https://cdn.pydata.org/bokeh/release/bokeh-tables-1.3.4.min.css"

These appear to be related to BokehJS, but I have not been able to figure out what might be missing for them to start being included again. This a server app, and these functions work while the server is running. However, it used to continue to work after closing the server and when opening the saved .html file.

bigreddot
  • 33,642
  • 5
  • 69
  • 122
joltman
  • 41
  • 2
  • I made some progress here and I can now save the html file and have the interactive tools continue to work. I was using hv.save(plot, 'file_name.html', backend=bokeh). I did not see other examples using the backend parameter so tried removing it. That seemed to work for the saved .html file. However, the server application is used to automatically open a browser window and display the plot from a python application. When the python application stops the server, the interactive elements for things like box_zoom used to continue to work, but no longer do. – joltman Dec 20 '19 at 17:13

1 Answers1

1

It's never been expected that Bokeh Server app pages could be saved as functioning static HTML, and if that was ever the case in any sense it was unintended and undefined behavior.

Whenever anything like panning or zooming happens, a Bokeh server app page is going to try to communicate those changes to the running Bokeh server (so that any callbacks can run, that's the purpose of a Bokeh server). But if you just "save" the app page, then all these communication attempts cannot succeed because there is no longer a server process for the page to communicate with. I expect if you look at the browser JS console log you will see very many error messages about failed connections, protocol errors, etc.

bigreddot
  • 33,642
  • 5
  • 69
  • 122
  • I agree that is the case for a Holoviews DynamicMap. In this case I have not implemented any streams or callbacks and am not using it as a DynamicMap application. For the nominal case, my understanding is that the html gets created with embedded JavaScript to support a number of the interactive features of the plot that don't rely on new data. – joltman Dec 20 '19 at 17:05
  • The HV angle is definitely not something I know much about, I would suggest aksing the HV devs directly on their new Discourse: https://discourse.holoviz.org/ – bigreddot Dec 20 '19 at 19:50