{#- Funding figure, driven by `criteria.funding` in data/criteria.yaml. Two panels in one canvas: • top — competitive funding already secured; one bar per scheme, widths scaled to the largest `value`, with a role pill on each row. • bottom — the forward application pipeline, one card per year. Bar widths, pill widths, card heights and the canvas height are all computed from the data, so add / remove / reorder schemes and pipeline years freely and never edit the SVG. -#} {%- set fu = criteria.funding -%} {%- set LX = 15 -%}{%- set RX = 705 -%} {%- set PILL_R = 278 -%} {#- role pills are right-aligned to here -#} {%- set BX0 = 290 -%}{%- set BX1 = 630 -%}{%- set BW = BX1 - BX0 -%} {%- set ROW_H = 22 -%}{%- set BAR_H = 12 -%} {%- set max_value = fu.bars | map(attribute='value') | max -%} {%- set nbars = fu.bars | length -%} {%- set rows_top = 20 -%} {%- set rows_bottom = rows_top + nbars * ROW_H -%} {%- set note_y = rows_bottom + 11 if fu.note else rows_bottom -%} {%- set div_y = note_y + 9 -%} {%- set p2_label_y = div_y + 16 -%} {%- set cards_y = p2_label_y + 7 -%} {%- set CARD_GAP = 10 -%} {%- set ncards = fu.pipeline | length -%} {%- set CARD_W = ((RX - LX) - (ncards - 1) * CARD_GAP) / ncards -%} {%- set ITEM_WRAP = fu.item_wrap | default(42) -%} {%- set ITEM_LH = 10.5 -%} {#- tallest card sets the height for all of them -#} {%- set nsc = namespace(max_lines=1) -%} {%- for col in fu.pipeline -%} {%- set nsl = namespace(t=0) -%} {%- for it in col['items'] -%} {%- set nsl.t = nsl.t + ((it | wordwrap(ITEM_WRAP, break_long_words=False)).split('\n') | length) -%} {%- endfor -%} {%- if nsl.t > nsc.max_lines -%}{%- set nsc.max_lines = nsl.t -%}{%- endif -%} {%- endfor -%} {%- set CARD_H = 22 + nsc.max_lines * ITEM_LH + (fu.pipeline[0]['items'] | length) * 2.5 + 8 -%} {%- set height = cards_y + CARD_H + 6 -%}

{{ fu.caption }}

{{ fu.secured_label }} {%- for b in fu.bars %} {%- set cy = rows_top + loop.index0 * ROW_H + ROW_H / 2 %} {%- set w = (b.value / max_value * BW) %} {%- set pw = (b.role | length) * 4.3 + 12 %} {{ b.label }} {{ b.role }} {{ b.title }} {{ b.display }} {%- endfor %} {%- if fu.note %} {{ fu.note }} {%- endif %} {{ fu.pipeline_label }} {%- for col in fu.pipeline %} {%- set cx = LX + loop.index0 * (CARD_W + CARD_GAP) %} {{ col.year }} {%- set nsy = namespace(y=cards_y + 30) %} {%- for it in col['items'] %} {%- set lines = (it | wordwrap(ITEM_WRAP, break_long_words=False)).split('\n') %} {%- for line in lines %}{{ line }}{%- endfor %} {%- set nsy.y = nsy.y + (lines | length) * ITEM_LH + 2.5 %} {%- endfor %} {%- endfor %}