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

Improved BokehRenderer.app API #1444

Merged
merged 3 commits into from May 16, 2017
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+16 −2
Diff settings

Always

Just for now

Added doc argument to BokehRenderer.get_plot

  • Loading branch information...
Philipp Rudiger Philipp Rudiger
Philipp Rudiger authored and Philipp Rudiger committed May 16, 2017
commit c121eca525629960df49f277f16a2d8ca7044083
@@ -84,10 +84,24 @@ def __call__(self, obj, fmt=None, doc=None):
elif fmt == 'json':
return self.diff(plot), info


@bothmethod
def get_plot(self_or_cls, obj, doc=None, renderer=None):
"""
Given a HoloViews Viewable return a corresponding plot instance.
Allows supplying a document attach the plot to, useful when
combining the bokeh model with another plot.
"""
plot = super(BokehRenderer, self_or_cls).get_plot(obj, renderer)
if doc is not None:
plot.document = doc
return plot


@bothmethod
def get_widget(self_or_cls, plot, widget_type, **kwargs):
def get_widget(self_or_cls, plot, widget_type, doc=None, **kwargs):
if not isinstance(plot, Plot):
plot = self_or_cls.get_plot(plot)
plot = self_or_cls.get_plot(plot, doc)
if self_or_cls.mode == 'server':
return BokehServerWidgets(plot, renderer=self_or_cls.instance(), **kwargs)
else:
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.