From cf3102b873c4e074817928847e568e810be7a2e4 Mon Sep 17 00:00:00 2001 From: Frank <33519926+Conengmo@users.noreply.github.com> Date: Wed, 3 Apr 2024 18:00:11 +0200 Subject: [PATCH] Restore Div and MacroElement --- branca/element.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/branca/element.py b/branca/element.py index e8520f7..9c87d2b 100644 --- a/branca/element.py +++ b/branca/element.py @@ -583,6 +583,9 @@ def render(self, **kwargs) -> str: "You cannot render this Element " "if it is not in a Figure." ) + for name, element in self._children.items(): + element.render(**kwargs) + for name, element in self.header._children.items(): figure.header.add_child(element, name=name) @@ -601,8 +604,6 @@ def render(self, **kwargs) -> str: if script is not None: figure.script.add_child(Element(script(self, kwargs)), name=self.get_name()) - return figure.render() - def _repr_html_(self, **kwargs) -> str: """Displays the Div in a Jupyter notebook.""" if self._parent is None: @@ -733,4 +734,5 @@ def render(self, **kwargs) -> str: if script is not None: figure.script.add_child(Element(script(self, kwargs)), name=self.get_name()) - return figure.render() + for name, element in self._children.items(): + element.render(**kwargs)