Skip to content

Instantly share code, notes, and snippets.

@JaimeEnergy
Created April 14, 2017 08:11
Show Gist options
  • Save JaimeEnergy/1f72842d1fc0c168cebb59bfd6acb0fe to your computer and use it in GitHub Desktop.
Save JaimeEnergy/1f72842d1fc0c168cebb59bfd6acb0fe to your computer and use it in GitHub Desktop.
Bokeh Gantt Chart: Use CustomJS to prevent vertical scrolling
from bokeh.models.callbacks import CustomJS
jscode="""
range.set('start', parseInt(%s));
range.set('end', parseInt(%s));
"""
yrange = subplot.y_range
yrange.start, yrange.end = 0, plot_height
subplot.y_range.callback = CustomJS(
args = dict(range = yrange),
code = jscode % (yrange.start, yrange.end)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment