{% import "macros.html" as ui %} {# CODE › Diagrams: architecture, classes and calls as tabs of one page, each at its own URL. Every tab has the same header and the same bar: its options on the left, the language filter shown, the legend on the right; then the drawing, with its own bar (highlight, zoom, fit). #} {% set texts = { "architecture": "How the project is organized: modules inside their packages, and which module imports which (the importer above, the arrow pointing to what it imports). Imports that form a cycle are red.", "classes": "UML class diagram: each class, interface, struct, enum or trait of any language with its attributes and methods; inheritance, implementation, composition (an attribute holds another class), use (a method calls another class) and reference (named as a type).", "calls": "How a function works: what it calls and what calls it, a few calls away, or the calls that lead from it to another. Only calls that can be read from the code are shown.", } %} {# The levels both architecture and classes are drawn by: what each frame is, the closed boxes, the UNCONNECTED groups, and the lines that stand for relations inside closed boxes. #} {% macro levels_legend(relations) -%} project member package subpackage unconnected 3 ▸closed (click to open) {{ relations }} inside closed boxes {%- endmacro %} {# The filters architecture and classes share: a project, a focus and how far from it. #} {% macro filters(url, targets, placeholder) -%}
{%- endmacro %}{{ texts[view] }}
{% if view == "architecture" %} {# The filters of every tab on one line; a field with no room left goes, whole, to the next line. #} {% set bar_filters %} {% endset %}{{ params.focus }}{% endif %}{% endset %}
{% call ui.view_canvas("calls", data_url if params.focus else "", params.focus, layouts=true, filters=bar_filters, filters_open=true, details=true,
caption=caption | trim,
empty="" if params.focus else "Choose a function, method or class in Focus to see its calls; Direction: what it calls, what calls it, or both.") %}
focus
called by the focus
calls the focus
{# Each kind of relation: a click turns its lines off or on. #}
{{ ui.relation_kinds(("calls", "refers", "template", "css-class", "route")) }}
{% endcall %}
{% endif %}