{# Single source of truth for rendering a PanelOutput dict (figure/table/ markdown/html/grid, incl. nested grid items). Shared by run.html, study.html, and kept in lockstep with analysis/report.py's _render_output and the watch JS renderPanel(). Any output type must render on all surfaces or none. #} {% macro render_output(output, grid_class='stat-grid') -%} {%- if output.type == 'figure' -%}
{%- elif output.type == 'table' -%} {# Mapping cells are references: {"text", "href"} renders a link (Studio's run-link resolution emits these); {"text"} alone renders muted text (the reference did not resolve to a link on this surface) — so the same panel output stays portable on link-less surfaces (static reports). #}| {{ column if column is string else column.name }} | {% endfor %}
|---|
| {% if cell is mapping %}{% if cell.href %}{{ cell.text }}{% else %}{{ cell.text }}{% endif %}{% else %}{{ cell }}{% endif %} | {% endfor %}
{{ output.text }}
{%- elif output.type == 'html' -%} {{ output.html|safe }} {%- elif output.type == 'grid' -%} {% set rich = output['items']|rejectattr('type', 'equalto', 'markdown')|list %}