{% from "html/macros/layout.html" import row_key %} {% macro figure(model, anchor_nodes=false) -%}
{{ model.title }} {{ model.summary }}
{% set show_paths = model.nodes | selectattr("paths") | first is defined %} {% set show_detail = model.nodes | selectattr("detail") | first is defined %} {% if show_detail %}{% endif %}{% if show_paths %}{% endif %} {% for node in model.nodes %} {{ row_key(pairs=[(t('macros.layout.id'), node.id), (t('macros.layout.name'), node.label), (t('macros.layout.kind'), node.note)]) }}{% if show_detail %}{% endif %}{% if show_paths %}{% endif %} {% endfor %}
{{ t('macros.visualizations.component') }}{{ t('macros.visualizations.what-it-does') }}{{ t('macros.visualizations.paths') }}
{{ node.detail | inline_code }}{% for path in node.paths %}{{ path }}{% if not loop.last %} {% endif %}{% endfor %}
{% if model.edges %} {% for edge in model.edges %} {% endfor %}
{{ t('macros.visualizations.from') }}{{ t('macros.visualizations.to') }}{{ t('macros.visualizations.relation') }}
{{ edge.source | inline_code }}{{ edge.target | inline_code }}{{ edge.label | inline_code }}
{% endif %}
{%- endmacro %}