{#- Five-year research-program roadmap, driven by `criteria.program` in data/criteria.yaml. One track per research stream; each track tiles `total_years` left→right in `phases`, whose widths are their `years` span, so you can rebalance a stream without touching the SVG. The year axis, gridlines, row positions and canvas height are all computed. The chip row underneath lists the target outcomes; chip widths follow their text. -#} {%- set pg = criteria.program -%} {%- set LX = 15 -%}{%- set LABEL_W = 167 -%} {%- set X0 = LX + LABEL_W + 12 -%}{%- set X1 = 706 -%}{%- set W = X1 - X0 -%} {%- set total = pg.total_years | default(5) -%} {%- set gap = pg.phase_gap | default(3) -%} {%- set fills = pg.fills or ['#dbe7f4', '#7ba3d0', '#0f3f73'] -%} {%- set text_fills = pg.text_fills or ['#1c1f23', '#ffffff', '#ffffff'] -%} {%- set TOP = 22 -%}{%- set ROW_H = 46 -%}{%- set BAR_H = 22 -%}{%- set BAR_DY = 6 -%} {%- set nrows = pg.streams | length -%} {%- set tracks_bottom = TOP + (nrows - 1) * ROW_H + BAR_DY + BAR_H -%} {%- set chips_y = tracks_bottom + 18 -%} {%- set CHIP_H = 17 -%} {%- set height = chips_y + CHIP_H + 6 -%} {%- macro edge(year) -%}{{ (X0 + (year / total) * W) | round(1) }}{%- endmacro -%}

{{ pg.caption }}

{%- for y in range(1, total + 1) %} {{ ('Year ' ~ y) if y == 1 else y }} {%- endfor %} {%- for y in range(1, total) %} {%- endfor %} {%- for st in pg.streams %} {%- set row_y = TOP + loop.index0 * ROW_H %} {%- set bar_y = row_y + BAR_DY %} {{ st.name }} {{ st.partners }} {%- set ns = namespace(cum=0) %} {%- for p in st.phases %} {%- set s0 = X0 + (ns.cum / total) * W %} {%- set ns.cum = ns.cum + p.years %} {%- set s1 = X0 + (ns.cum / total) * W %} {%- set w = (s1 - s0) - (0 if loop.last else gap) %} {%- set fi = loop.index0 % (fills | length) %} {{ p.title or p.label }} {{ p.label }} {%- endfor %} {%- endfor %} {%- if pg.outcomes %} {{ pg.outcomes_label | default('BY YEAR 5') }} {%- set ns3 = namespace(x=LX + 62) %} {%- for o in pg.outcomes %} {%- set cw = (o | length) * 4.75 + 18 %} {{ o }} {%- set ns3.x = ns3.x + cw + 7 %} {%- endfor %} {%- endif %}