--- import { getMessages } from '../../i18n/messages.ts'; interface Props { locale: string; /** Unique per diagram on the page; prefixes ids inside the SVG. */ uid: string; } const { locale, uid } = Astro.props; const t = getMessages(locale); const arrow = `${uid}-aaa-arrow`; const sacClip = `${uid}-aaa-sac`; // Long labels do not fit their free space on one line: split them in two at a word boundary. function twoLines(label: string): [string, string] { const words = label.split(' '); const split = Math.ceil(words.length / 2); return [words.slice(0, split).join(' '), words.slice(split).join(' ')]; } const renalLines = twoLines(t['diagram.label.renal-arteries']); const iliacLines = twoLines(t['diagram.label.iliac-arteries']); // The abdominal aorta runs down the middle. The renal arteries leave it at the sides, and at the // bottom it divides into the two iliac arteries. Vessels are wide strokes: the wall, then the // lumen on top of it. const aorta = 'M200,0 L200,288'; const renal = 'M120,80 L280,80'; const iliacs = 'M140,372 L200,284 L260,372'; // Aneurysm: the segment below the renal arteries widens all round (fusiform). Outer edge of the // wall, then the lumen 4 units inside it. const sacWall = 'M183,112 C183,140 155,155 155,190 C155,225 183,240 183,268 L217,268 C217,240 245,225 245,190 C245,155 217,140 217,112 Z'; const sacLumen = 'M187,112 C187,142 159,157 159,190 C159,223 187,238 187,268 L213,268 C213,238 241,223 241,190 C241,157 213,142 213,112 Z'; // Thrombus lining the inside of the sac on both sides, leaving a channel for the blood. Its outer // edge reaches past the wall and is clipped to the lumen, so it lies flat against the wall. const thrombusLeft = 'M178,138 C160,150 150,165 150,190 C150,215 160,230 178,242 C176,225 176,210 176,190 C176,170 176,155 178,138 Z'; const thrombusRight = 'M222,138 C240,150 250,165 250,190 C250,215 240,230 222,242 C224,225 224,210 224,190 C224,170 224,155 222,138 Z'; const flow = { main: 'M200,14 L200,272', renalLeft: 'M190,80 L128,80', renalRight: 'M210,80 L272,80', iliacLeft: 'M196,296 L152,358', iliacRight: 'M204,296 L248,358', }; const flowPaths = Object.values(flow); --- {flowPaths.map((d) => ( ))} {flowPaths.map((d) => ( ))} {t['diagram.label.aorta']} {renalLines[0]} {renalLines[1]} {iliacLines[0]} {iliacLines[1]} {t['diagram.label.aorta-normal-diameter']} {t['diagram.label.aneurysm-diameter']} {t['diagram.label.aneurysm']} {t['diagram.label.clot']}