Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility fixes for bokeh 0.12.6 release #1485

Merged
merged 1 commit into from
May 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions holoviews/plotting/bokeh/chart.py
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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()