Skip to content

Commit

Permalink
Restore Div and MacroElement
Browse files Browse the repository at this point in the history
  • Loading branch information
Conengmo committed Apr 3, 2024
1 parent dbdd374 commit cf3102b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions branca/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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:
Expand Down Expand Up @@ -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)

0 comments on commit cf3102b

Please sign in to comment.