Skip to content
Open
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
18 changes: 15 additions & 3 deletions src/bokeh/embed/bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
from __future__ import annotations

import logging # isort:skip
from bokeh.core.has_props import HasProps
from bokeh.core.templates import CSS_RESOURCES, JS_RESOURCES
from bokeh.document.document import Document
from bokeh.embed.util import contains_tex_string
from bokeh.resources import Hashes, Resources
from bokeh.settings import settings
from bokeh.util.compiler import bundle_models

log = logging.getLogger(__name__)

#-----------------------------------------------------------------------------
Expand Down Expand Up @@ -448,17 +456,21 @@ def _use_mathjax(all_objs: set[HasProps]) -> bool:
return _any(all_objs, lambda obj: isinstance(obj, (MathTextGlyph, MathText)) or _model_requires_mathjax(obj)) or _ext_use_mathjax(all_objs)

def _use_gl(all_objs: set[HasProps]) -> bool:
''' Whether a collection of Bokeh objects contains a plot requesting WebGL
""" Whether a collection of Bokeh objects contains a plot requesting WebGL

Args:
objs (seq[HasProps or Document]) :

Returns:
bool

'''
"""
# Inline the lambda and hoist the import for efficiency
from ..models.plots import Plot
return _any(all_objs, lambda obj: isinstance(obj, Plot) and obj.output_backend == "webgl")
for obj in all_objs:
if isinstance(obj, Plot) and obj.output_backend == "webgl":
return True
return False

def _ext_use_tables(all_objs: set[HasProps]) -> bool:
from ..models.widgets import TableWidget
Expand Down