{#- Cluster alignment ladder, driven by `criteria.cluster_fit` in data/criteria.yaml. One row per research area advertised for the nominated Cluster: the area name (quoted from the advertisement), a three-segment strength meter, and the evidence from the applicant's record. Row heights, the meter and the overall canvas are all computed from the data — add / remove / reorder areas freely and never touch the SVG. `level` is 1–3 and keys into `levels` for the fill colour and legend wording. -#} {%- set cf = criteria.cluster_fit -%} {%- set X0 = 15 -%}{%- set X1 = 705 -%} {%- set LABEL_WRAP = cf.label_wrap | default(38) -%} {%- set EV_WRAP = cf.evidence_wrap | default(60) -%} {%- set PIP_X = 316 -%}{%- set PIP_W = 17 -%}{%- set PIP_GAP = 4 -%} {%- set EV_X = 392 -%} {%- set LINE_H = 11 -%} {%- set ROW_PAD = 11 -%} {%- set HEAD_Y = 12 -%} {%- set levels = cf.levels | default({ 3: {'fill': '#0f3f73', 'label': 'core expertise'}, 2: {'fill': '#4a86c8', 'label': 'strong, demonstrated'}, 1: {'fill': '#aac6e4', 'label': 'emerging / building'}}) -%} {%- set empty_fill = '#eaeff6' -%} {#- lay out the rows top→bottom, growing each to fit its wrapped text -#} {%- set ns = namespace(y=22, rows=[]) -%} {%- for a in cf.areas -%} {%- set llines = (a.area | wordwrap(LABEL_WRAP, break_long_words=False)).split('\n') -%} {%- set elines = (a.evidence | wordwrap(EV_WRAP, break_long_words=False)).split('\n') -%} {%- set nlines = [llines | length, elines | length] | max -%} {%- set h = nlines * LINE_H + ROW_PAD -%} {%- set _ = ns.rows.append({'a': a, 'y': ns.y, 'h': h, 'll': llines, 'el': elines}) -%} {%- set ns.y = ns.y + h -%} {%- endfor -%} {%- set legend_y = ns.y + 16 -%} {%- set height = legend_y + 8 -%}
{{ cf.caption }}