{#- Shared macros for the HTML displays of EyeData and SegmentedEyeData. -#} {#- (label, value) pairs that wrap like text. -#} {% macro overview_grid(items) %}
{% for label, value in items %}
{{ label }} {{ value }}
{% endfor %}
{% endmacro %} {#- Boxes of (label, value) pairs that go side by side and wrap: a list of (title, items). -#} {% macro overview_boxes(groups) %}
{% for title, items in groups if items %} {#- boxes with more text get more of the width -#} {% set n = items|map(attribute=1)|map("string")|map("length")|sum %}
{{ title }}
{% for label, value in items %} {% endfor %}
{{ label }} {{ value }}
{% endfor %}
{% endmacro %} {#- Collapsible grid of sparklines (dicts with "label" and "image", a data URI or None). -#} {% macro sparkline_grid(title, items, min_width=150, height=32, open=True) %} {% if items %}
{{ title }}
{% for item in items %}
{{ item.label }}
{% if item.image %} {{ item.label }} sparkline {% endif %}
{% endfor %}
{% endif %} {% endmacro %}