Skip to content

Commit

Permalink
Don't load any html in the notebook when no logo is required (#5216)
Browse files Browse the repository at this point in the history
  • Loading branch information
maximlt committed Mar 31, 2022
1 parent 514f08c commit 1f112eb
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions holoviews/ipython/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ def __call__(self, *args, **params):
"hv-extension-comm")

# Create a message for the logo (if shown)
if not same_cell_execution:
self.load_hvjs(logo=p.logo,
if not same_cell_execution and p.logo:
self.load_logo(logo=p.logo,
bokeh_logo= p.logo and ('bokeh' in resources),
mpl_logo= p.logo and (('matplotlib' in resources)
or resources==['holoviews']),
Expand Down Expand Up @@ -247,10 +247,9 @@ def _get_resources(self, args, params):
return resources

@classmethod
def load_hvjs(cls, logo=False, bokeh_logo=False, mpl_logo=False, plotly_logo=False,
JS=True, message='HoloViewsJS successfully loaded.'):
def load_logo(cls, logo=False, bokeh_logo=False, mpl_logo=False, plotly_logo=False):
"""
Displays javascript and CSS to initialize HoloViews widgets.
Allow to display Holoviews' logo and the plotting extensions' logo.
"""
import jinja2

Expand All @@ -260,8 +259,7 @@ def load_hvjs(cls, logo=False, bokeh_logo=False, mpl_logo=False, plotly_logo=Fal
html = template.render({'logo': logo,
'bokeh_logo': bokeh_logo,
'mpl_logo': mpl_logo,
'plotly_logo': plotly_logo,
'message': message})
'plotly_logo': plotly_logo})
publish_display_data(data={'text/html': html})


Expand Down

0 comments on commit 1f112eb

Please sign in to comment.