Quansight / lsst_dashboard

LSST Dashboard https://quansight.github.io/lsst_dashboard/
BSD 3-Clause "New" or "Revised" License
8 stars 3 forks source link

Dashboard: Convert to using Jinja2 Template instead of current panel() layout #19

Closed brendancol closed 5 years ago

brendancol commented 5 years ago

Example Template: https://panel.pyviz.org/user_guide/Templates.html

brendancol commented 5 years ago
from jinja2 import Environment, FileSystemLoader

env = Environment(loader=FileSystemLoader('.'))
jinja_template = env.get_template('sample_template.html')

tmpl = pn.Template(jinja_template)

tmpl.add_panel('A', hv.Curve([1, 2, 3]))
tmpl.add_panel('B', hv.Curve([1, 2, 3]))
chbrandt commented 5 years ago

If we put the whole page inside a template we can do it. The idea of having only certain parts of the layout organized by Jinja is cool but not doable (afaiu), panel.Template objects do not render from inside other layout objects (Row, Column) (in fact, they are a completely different kind of object).