Skip to content

Commit

Permalink
Merge pull request #1485 from ioam/bokeh_0.12.6_compat
Browse files Browse the repository at this point in the history
Compatibility fixes for bokeh 0.12.6 release
  • Loading branch information
philippjfr committed May 25, 2017
2 parents 9863e02 + d60bff7 commit adfd176
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
12 changes: 8 additions & 4 deletions holoviews/plotting/bokeh/chart.py
Expand Up @@ -2,10 +2,6 @@

import numpy as np
import param
try:
from bokeh.charts import BoxPlot as BokehBoxPlot
except:
BokehBoxPlot = None, None
from bokeh.models import (GlyphRenderer, ColumnDataSource, DataRange1d,
Range1d, CategoricalColorMapper, CustomJS,
HoverTool)
Expand All @@ -24,6 +20,14 @@
from .path import PathPlot, PolygonPlot
from .util import update_plot, bokeh_version, expand_batched_style, categorize_array

try:
if bokeh_version > '0.12.5':
from bkcharts import BoxPlot as BokehBoxPlot
else:
from bokeh.charts import BoxPlot as BokehBoxPlot
except:
BokehBoxPlot = None, None


class PointPlot(LegendPlot, ColorbarPlot):

Expand Down
10 changes: 9 additions & 1 deletion holoviews/plotting/bokeh/renderer.py
Expand Up @@ -5,7 +5,6 @@

from bokeh.application.handlers import FunctionHandler
from bokeh.application import Application
from bokeh.charts import Chart
from bokeh.document import Document
from bokeh.embed import notebook_div, autoload_server
from bokeh.io import load_notebook, curdoc, show as bkshow
Expand All @@ -22,6 +21,13 @@
from .widgets import BokehScrubberWidget, BokehSelectionWidget, BokehServerWidgets
from .util import compute_static_patch, serialize_json, attach_periodic, bokeh_version

try:
if bokeh_version > '0.12.5':
from bkcharts import Chart
else:
from bokeh.charts import Chart
except:
Chart = None


class BokehRenderer(Renderer):
Expand Down Expand Up @@ -259,3 +265,5 @@ def load_nb(cls, inline=True):
"""
kwargs = {'notebook_type': 'jupyter'} if bokeh_version > '0.12.5' else {}
load_notebook(hide_banner=True, resources=INLINE if inline else CDN, **kwargs)
from bokeh.io import _state
_state.output_notebook()

0 comments on commit adfd176

Please sign in to comment.