使用 hv.save() 保存 Holoviews DynamicMap 时,仅渲染三帧

When saving Holoviews DynamicMap using hv.save() only three frames are rendered

我想导出我的 HoloViews DynamicMap,就像在 Jupyter 笔记本中查看的那样,但它只在生成的 HTML 文件中导出三个帧。我创建了以下示例代码来演示我遇到的问题,它是 https://holoviews.org/reference/containers/bokeh/DynamicMap.html

中示例的简化版本
import numpy as np
import holoviews as hv
hv.extension('bokeh')

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

dmap = hv.DynamicMap(sine_curve, kdims=['phase']).redim.range(phase=(0.,1.))

dmap # to render interactively in Jupyter notebook

hv.save(dmap, 'test.html')

如果我 运行 在 Jupyter notebook 中执行此操作,滑块将呈现 11 个不同的相图(每个相移 0.1)。但是,一旦我将其保存为 test.html,它只会渲染三个总相图 (0, 0.5, 1)。有没有办法渲染 HTML 文件中的所有帧?

解决方案是将 .redim.range(phase=(0.,1.)) 替换为 .redim.values(phase=full_set_of_values),其中 full_set_of_values = [0., 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.]。有关详细信息,请参阅 https://github.com/holoviz/holoviews/issues/5273