diff --git a/folium/elements.py b/folium/elements.py index aa1dbd8846..198a20794c 100644 --- a/folium/elements.py +++ b/folium/elements.py @@ -1,12 +1,18 @@ from typing import List, Tuple -from branca.element import CssLink, Element, Figure, JavascriptLink, MacroElement +from branca.element import ( + CssLink, + Element, # NoQA: F401 needed as a reexport + Figure, + JavascriptLink, + MacroElement, +) from folium.template import Template from folium.utilities import JsCode -class JSCSSMixin(Element): +class JSCSSMixin(MacroElement): """Render links to external Javascript and CSS resources.""" default_js: List[Tuple[str, str]] = [] diff --git a/folium/features.py b/folium/features.py index cba87e8eff..d3d96caca3 100644 --- a/folium/features.py +++ b/folium/features.py @@ -101,7 +101,7 @@ def __init__( ) -class Vega(JSCSSMixin, Element): +class Vega(JSCSSMixin): """ Creates a Vega chart element. @@ -224,7 +224,7 @@ def render(self, **kwargs) -> None: ) -class VegaLite(Element): +class VegaLite(MacroElement): """ Creates a Vega-Lite chart element. diff --git a/folium/map.py b/folium/map.py index 3c5302b8a6..201a89942f 100644 --- a/folium/map.py +++ b/folium/map.py @@ -409,7 +409,7 @@ def render(self) -> None: super().render() -class Popup(Element): +class Popup(MacroElement): """Create a Popup instance that can be linked to a Layer. Parameters