Include folium in bokeh tabs

試著忘記壹切 提交于 2020-12-15 09:07:51

问题


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

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

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

Thank you :)


回答1:


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)

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



来源:https://stackoverflow.com/questions/56809038/include-folium-in-bokeh-tabs

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