down votefavorite
<python - Bokeh: Model `Slider' does not exist. This could be due to a widget or a custom model not being registered before first usage - Stack Overflow>
I am trying to execute the Gapminder example app using Bokeh:
https://github.com/georgetown-analytics/XBUS-506-01.Visual_Analytics/blob/master/bokeh/gapminder.ipyn
<XBUS-506-01.Visual_Analytics/gapminder.ipynb at master · georgetown-analytics/XBUS-506-01.Visual_Analytics · GitHub>
b
# Add the slider
code = """
var year = slider.get('value'),
sources = %s,
new_source_data = sources[year].get('data');
renderer_source.set('data', new_source_data);
text_source.set('data', {'year': [String(year)]});
""" % js_source_array
callback = CustomJS(args=sources, code=code)
slider = Slider(start=years[0], end=years[-1], value=1, step=1, title="Year", callback=callback)
callback.args["renderer_source"] = renderer_source
callback.args["slider"] = slider
callback.args["text_source"] = text_source
And I get an error while executing the code to show output as HTML file:
output_file("six.html")
show(plot)
Bokeh: Model `Slider' does not exist. This could be due to a widget or a
custom model not being registered before first usage
<python - Bokeh: Model `Slider' does not exist. This could be due to a widget or a custom model not being registered before first usage - Stack Overflow>
Even for 'Select' widget, it shows the same error.