As with Bokeh 0.12.4, there are still open issues in Bokeh (features for development, as well as a few bugs and additional documentation support). What is currently supported is based on a type using an object Themethat can be set in the current document.
The object Themeaccepts a JSON block, general view:
{
'attrs: {
'SomeTypeName': { 'foo_property': default_foo },
'OtherTypeName': { 'bar_property': default_bar }
}
}
Or for a specific example:
from bokeh.io import curdoc
from bokeh.themes import Theme
curdoc().theme = Theme(json={'attrs': {
'Figure': {
'toolbar_location': None,
'outline_line_color': None,
'min_border_right': 10,
},
'Axis': {
'major_tick_in': None,
'minor_tick_out': None,
'minor_tick_in': None,
'axis_line_color': '#CAC6B6',
'major_tick_line_color': '#CAC6B6',
},
'Legend': {
'background_fill_alpha': 0.8,
}
}})
This JSON can also be read from a file using standard Python JSON tools.
If this also happens in the context of the Bokeh server application (directory style), you can also specify the theme as a file theme.yamlin the same directory as yours main.py. See, for example, Example Gapminder .
source
share