在bokeh选项卡中包括叶 [英] Include folium in bokeh tabs

查看:87
本文介绍了在bokeh选项卡中包括叶的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在bokeh选项卡上添加一个叶子贴图.有可能吗?

I would like to add a folium map to a bokeh tab. Is it possible?

当我尝试时,我遇到一个错误:预期为LayoutDOM类型的实例,得到了类型为map的叶片.

When I try i have an error like: expected an instance of type LayoutDOM, got folium of type map.

否则,还有另一种方法可以在带地图的python中制作图表并将其包含在选项卡中吗?

Otherwise is there another way to do chart in python with map and include it in tab?

谢谢:)

推荐答案

Bokeh有自己的一组对象来表示它可以显示的内置窗口小部件.只有这些Bokeh对象可以进入选项卡窗格之类的Bokeh布局中.但是,可用的小部件之一是 Div ,它使您可以将具有任意内容的HTML div放在Bokeh布局中,例如

Bokeh has its own set of objects to represent the built-in widgets that it can display. Only these Bokeh objects can go inside Bokeh layouts like tab panes. However, one of the available widgets is Div, which let you put an HTML div with arbitrary content inside a Bokeh layout e.g.

div = Div(text="whatever HTML code you want")

layout = column(plot, div)

因此,您可以将地图的原始HTML用作这些 Div 对象之一的内容.

So you could put the raw HTML for a map as the content for one of these Div objects.

这篇关于在bokeh选项卡中包括叶的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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