Way to embed arbitrary html inside of Bokeh App layout?

I have a mutli-tab bokeh dashboard with lots of graphs for my companies data. I now want to get a google map in there and I’m finding the bokeh google map rendering/interaction not very satisfying. I much prefer folium. So I’m wondering if there is a way to generate a folium map in my applications python and the embed the html into the bokeh layout so it shows up where I want it? Below code generates a map and saves the html to a file for reference

import folium

m = folium.Map(

location=[45.5236, -122.6750],

tiles=‘Stamen Toner’,

zoom_start=13

)

f = open(‘test.html’,‘w’)

f.writelines(m.get_root().render())

It looks like someone accomplished something similar using an iframe in a Dash dashboard…
https://medium.com/@shachiakyaagba_41915/integrating-folium-with-dash-5338604e7c56

···

On Tuesday, May 21, 2019 at 2:39:18 PM UTC-7, Jason Ross wrote:

I have a mutli-tab bokeh dashboard with lots of graphs for my companies data. I now want to get a google map in there and I’m finding the bokeh google map rendering/interaction not very satisfying. I much prefer folium. So I’m wondering if there is a way to generate a folium map in my applications python and the embed the html into the bokeh layout so it shows up where I want it? Below code generates a map and saves the html to a file for reference

import folium

m = folium.Map(

location=[45.5236, -122.6750],

tiles=‘Stamen Toner’,

zoom_start=13

)

f = open(‘test.html’,‘w’)

f.writelines(m.get_root().render())

Well I figured this out. This test.html file needs to be put into a Div object using an iframe and if it’s going to be served in a a Bokeh app, the file must live in the “static” folder inside the app directory.

···

On Tuesday, May 21, 2019 at 2:39:18 PM UTC-7, Jason Ross wrote:

I have a mutli-tab bokeh dashboard with lots of graphs for my companies data. I now want to get a google map in there and I’m finding the bokeh google map rendering/interaction not very satisfying. I much prefer folium. So I’m wondering if there is a way to generate a folium map in my applications python and the embed the html into the bokeh layout so it shows up where I want it? Below code generates a map and saves the html to a file for reference

import folium

m = folium.Map(

location=[45.5236, -122.6750],

tiles=‘Stamen Toner’,

zoom_start=13

)

f = open(‘test.html’,‘w’)

f.writelines(m.get_root().render())

Hey Jason, I have been struggling for days on the same issue, can you please show your code on how to include html folium map in bokeh (tried the iframe but still not working)