Geoviews/Bokeh slider disappers in Streamlit

Hi @tdhopper

I am not sure you will be able to use a dynamic map.

I think you cannot convert a dynamic map to a bokeh model. A dynamic map needs a live kernel and a different architecture/ communication channels than what Streamlit provides. You will need something like Jupyter, Panel or Voila for that. Maybe Dash as they recently added support for HoloViews. See Working with Plot and Renderers β€” HoloViews 1.14.1 documentation

What you can do is to use a Holomap. It generates all the plots up front. You still cannot convert that to a bokeh model. But according to the link above you can convert this to html. Then you can embed that html in Streamlit.

The below works

import streamlit as st
import streamlit.components.v1 as components
import numpy as np
import holoviews as hv

frequencies = [0.5, 0.75, 1.0, 1.25]


def sine_curve(phase, freq):
    xvals = [0.1 * i for i in range(100)]
    return hv.Curve((xvals, [np.sin(phase + freq * x) for x in xvals]))

def get_plots():
    plots = {}
    for i in range(10):
        for j in range(10):
            phase = 0.5+float(i)*0.05
            frequency = 0.5+float(j)+0.075
            plots[(phase, frequency)] = sine_curve(phase, frequency)
    return plots

@st.cache
def get_html():
    plots = get_plots()
    hmap = hv.HoloMap(plots, kdims=["phase", "frequency"])
    renderer=hv.renderer('bokeh')
    html=renderer.static_html(hmap)
    return html

html = get_html()
components.html(html, height=600)