{# ============================================================================ Pipeline Canvas — Reusable visual DAG component Usage: {% from "components/pipeline.html" import pipeline_assets, pipeline_canvas %} {% block head %}{{ pipeline_assets() }}{% endblock %} {% block content %} {{ pipeline_canvas(id="my-pipeline", height="400px") }} {% endblock %} {% block scripts %} {% endblock %} ============================================================================ #} {# Load pipeline dependencies (Dagre.js for layout) #} {% macro pipeline_assets() %} {% if use_cdn is defined and use_cdn %} {% else %} {% endif %} {% endmacro %} {# SVG canvas container with Alpine.js component #} {% macro pipeline_canvas(id, height="400px", toolbar=true, minimap=false, direction="LR") %}
{% if toolbar %} {{ pipeline_toolbar(id) }} {% endif %} {# Main SVG canvas — nodes/edges rendered imperatively by pipeline.js #} {# Arrow markers for edges #} {# Grid pattern #} {# Background grid #} {# Viewport group (panned + zoomed) #} {# Edges layer — populated by _renderEdges() #} {# Temp edge while dragging from port #} {# Nodes layer — populated by _renderNodes() #} {# Empty state #} Double-click to add a node, or use the toolbar {% if minimap %} {{ pipeline_minimap(id) }} {% endif %}
{% endmacro %} {# Toolbar with zoom, layout, and node actions #} {% macro pipeline_toolbar(canvas_id) %}
{# Zoom level + node count info (bottom-right) #}
nodes · edges
{% endmacro %} {# Minimap overview (optional) — nodes rendered imperatively by pipeline.js #} {% macro pipeline_minimap(canvas_id, width="140px") %}
{# Viewport indicator #}
{% endmacro %}