From b8166218b9f58e3f885dc97c13c552ab0e62e015 Mon Sep 17 00:00:00 2001 From: Doxa Maps Date: Tue, 29 Sep 2026 02:08:01 +0000 Subject: [PATCH] The country map's live poster prints its legend: it read rows the legend composable never had countries-map's print path set the poster's legend from legend.rows, but useLegendData returns items, never rows, so the renderer got an empty list and page 1's live map printed with no legend. It now takes the items, with their child tiers flattened in, as research-map's poster does since A1. check:legend-data-contract FAILED on this file and PASSES now; it goes into gates:pre with this round. --- plugin-designs/country-posters/countries-map.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugin-designs/country-posters/countries-map.vue b/plugin-designs/country-posters/countries-map.vue index d4bf4ce10..698bfd772 100644 --- a/plugin-designs/country-posters/countries-map.vue +++ b/plugin-designs/country-posters/countries-map.vue @@ -1332,7 +1332,14 @@ async function openPacket() { // separate document and an object URL created here would be revoked out from under it. const spec = defaultPosterSpec({ widthIn: 8.27, heightIn: 11.69, dpi: 150, orientation: 'portrait' }) spec.slots.title = { ...spec.slots.title, text: legendTitle.value || 'Doxa Map' } - spec.slots.legend = { ...spec.slots.legend, rows: legend?.rows?.value || [] } + // ★ useLegendData returns `items`, not `rows`: `legend.rows` was undefined, so `|| []` handed the + // renderer an empty list and this page printed its live map with no legend. Child tiers flattened in, + // as research-map's poster does, so the printed legend names every band the map draws. + const legendRows = (legend?.items?.value || []) + .flatMap((it) => [it, ...(it.children || [])]) + .map((r) => ({ label: r.label, color: r.color })) + .filter((r) => r.label) + spec.slots.legend = { ...spec.slots.legend, rows: legendRows } let mapSvg = '' try { const mapBlob = await useMapPoster(() => map.value).render(spec, 'png')