sparkles: render_embed for page class -> multiple-chart html can be now embedded
@@ -13,11 +13,14 @@ class Page(object):
def render(self, path="render.html"):
template_name = "multicharts.html"
- chart_content = ""
- for chart in self.__charts:
- chart_content += chart.render_embed()
-
+ chart_content = self.render_embed()
tmp = template.JINJA2_ENV.get_template(template_name)
html = tmp.render(multi_chart_content=chart_content)
html = template.freeze_js(html)
template.write_utf8_html_file(path, html)
+
+ def render_embed(self):
+ chart_content = ""
+ for chart in self.__charts:
+ chart_content += chart.render_embed()
+ return chart_content
