Skip to content

Commit

Permalink
Allowed nesting of GridSpace types in bokeh LayoutPlot
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Feb 6, 2017
1 parent bf71bc3 commit 9036a53
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 3 additions & 5 deletions holoviews/plotting/bokeh/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@ def sync_tools(self, subplots):

def initialize_plot(self, ranges=None, plots=[]):
ranges = self.compute_ranges(self.layout, self.keys[-1], None)
plots = [[] for r in range(self.cols)]
passed_plots = list(plots)
plots = [[] for r in range(self.cols)]
for i, coord in enumerate(self.layout.keys(full_grid=True)):
r = i % self.cols
subplot = self.subplots.get(wrap_tuple(coord), None)
Expand Down Expand Up @@ -421,8 +421,6 @@ def _create_subplots(self, layout, positions, layout_dimensions, ranges, num=0):

subplot_opts = dict(adjoined=main_plot)
# Options common for any subplot
if type(element) in (NdLayout, Layout):
raise SkipRendering("Cannot plot nested Layouts.")
vtype = element.type if isinstance(element, HoloMap) else element.__class__
plot_type = Store.registry[self.renderer.backend].get(vtype, None)
plotopts = self.lookup_options(element, 'plot').options
Expand Down Expand Up @@ -468,10 +466,10 @@ def _create_subplots(self, layout, positions, layout_dimensions, ranges, num=0):
return subplots, adjoint_clone


def initialize_plot(self, ranges=None):
def initialize_plot(self, plots=None, ranges=None):
ranges = self.compute_ranges(self.layout, self.keys[-1], None)
passed_plots = [] if plots is None else plots
plots = [[] for _ in range(self.rows)]
passed_plots = []
tab_titles = {}
insert_rows, insert_cols = [], []
adjoined = False
Expand Down
4 changes: 2 additions & 2 deletions holoviews/plotting/bokeh/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ def update_plot(old, new):
old_r.data_source.data.update(emptied)


def pad_width(model):
def pad_width(model, table_padding=0.85, tabs_padding=1.2):
"""
Computes the width of a model and sets up appropriate padding
for Tabs and DataTable types.
Expand All @@ -372,7 +372,7 @@ def pad_width(model):
return width


def pad_plots(plots, table_padding=0.85, tabs_padding=1.2):
def pad_plots(plots):
"""
Accepts a grid of bokeh plots in form of a list of lists and
wraps any DataTable or Tabs in a WidgetBox with appropriate
Expand Down

0 comments on commit 9036a53

Please sign in to comment.