Can't Save Bokeh Plot with Panel from PyViz Example

让人想犯罪 __ 提交于 2021-01-28 05:03:57

问题


I have been working through the tutorials on pyviz.org. specifically the dashboard one

If I setup the example here: http://pyviz.org/tutorial/A2_Dashboard_Workflow.html

The save icon in the bokeh plot appears to be disabled. If I click area zoom, wheel zoom,or the reset icon they behave as expected. But the save button does nothing.

Is this intentional, able to be reset, or a bug on my side?

Ben


回答1:


This is a fundamental limitation of browsers, the issue is that the map tiles in the background are making cross-origin requests to download the tiles. Browsers consider this a security issue and therefore mark the canvas as tainted. If you look at the browser console you'll see this error message when hitting save:

Uncaught DOMException: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported.

In recent versions of GeoViews we therefore automatically disable the save tool if a tile source is present, but the website was built using an older version.

TL;DR: It's a browser security issue and cannot be resolved afaik.



来源:https://stackoverflow.com/questions/54330583/cant-save-bokeh-plot-with-panel-from-pyviz-example

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!