无法使用PyViz示例中的面板保存散景图 [英] Can't Save Bokeh Plot with Panel from PyViz Example

查看:65
本文介绍了无法使用PyViz示例中的面板保存散景图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在研究pyviz.org上的教程.特别是仪表板一个

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

如果我在此处设置示例: http://pyviz.org/tutorial/A2_Dashboard_Workflow.html

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?

推荐答案

这是浏览器的基本限制,问题在于后台的地图图块发出跨域请求以下载图块.浏览器认为这是一个安全问题,因此将画布标记为已污染.如果您查看浏览器控制台,则在单击保存时会看到以下错误消息:

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.

因此,在最新版本的GeoViews中,如果存在图块源,则我们会自动禁用保存工具,但网站是使用较旧版本构建的.

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:这是浏览器的安全问题,无法通过afaik解决.

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

这篇关于无法使用PyViz示例中的面板保存散景图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆