--- 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 arrowV = `${uid}-pavsd-arrow-v`; const arrowA = `${uid}-pavsd-arrow-a`; const arrowMix = `${uid}-pavsd-arrow-mix`; const mixFill = `${uid}-pavsd-mix`; // Labels too long for one line are split in two. 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 thinPaLines = twoLines(t['diagram.label.thin-pulmonary-arteries']); const closedLines = twoLines(t['diagram.label.rv-outflow-closed']); const ductLines = twoLines(t['diagram.label.open-duct']); // The ventricles sit low with the septum at x 285; the pulmonary arteries run across at y 130 and // the aorta arches over them into the descending aorta on the right. Labels sit in the free // column on the left. Vessels are tubes: a wide stroke in the wall colour under a narrower one in // the blood colour, so branches join without seams. const vessel = { // Normal: a wide pulmonary trunk from the right ventricle dividing into two branches, and the // aorta from the left ventricle. trunk: 'M250,246 L250,130', branches: 'M160,130 L462,130', aorta: 'M315,250 L315,90 C315,58 350,46 395,46 C450,46 490,62 490,100 L490,396', // Pulmonary atresia with VSD (Минздрав 47_3, 1.1, 2.4; ESC 2020 ACHD 4.11.1): one variant with // a thin pulmonary trunk ending blindly over the right ventricle and thin (hypoplastic) branches. // The aorta sits over the defect, and the lungs get blood from it through the open duct and // collaterals from the descending aorta. stub: 'M250,232 L250,130', aortaOverriding: 'M290,254 L290,90 C290,58 330,46 385,46 C450,46 490,62 490,100 L490,396', duct: 'M452,62 C452,90 447,106 446,128', }; // Paths of the blood, shared by the arrows and the moving dashes on top of them. const flow = { toTrunk: 'M250,332 L250,140', toRightLung: 'M250,140 C250,133 244,130 236,130 L170,130', toLeftLung: 'M250,140 C250,133 256,130 264,130 L450,130', toAorta: 'M320,336 L316,250 L315,90 C315,58 350,46 395,46 C450,46 490,62 490,100 L490,382', // Disease: venous blood from the right ventricle and arterial blood from the left both enter the // aorta over the defect; mixed blood goes on to the body and, through the duct and the // collaterals, into the pulmonary arteries. fromRv: 'M270,334 L272,300 C274,280 280,268 283,256', fromLv: 'M318,336 C316,300 302,272 297,256', mixedAorta: 'M290,240 L290,90 C290,58 330,46 385,46 C450,46 490,62 490,100 L490,382', throughDuct: 'M452,72 C452,92 447,106 446,122', collateralUpper: 'M474,174 C456,174 462,154 448,152 C434,150 440,140 433,137', collateralLower: 'M474,206 C450,206 456,182 436,180 C414,178 420,152 410,137', mixedPa: 'M440,130 L170,130', }; --- {t['diagram.label.septum']} {t['diagram.label.defect']} {t['diagram.label.rv']} {t['diagram.label.rv']} {t['diagram.label.lv']} {t['diagram.label.aorta']} {t['diagram.label.overriding-aorta']} {ductLines[0]} {ductLines[1]} {t['diagram.label.collaterals']} {t['diagram.label.pulmonaryArtery']} {thinPaLines[0]} {thinPaLines[1]} {closedLines[0]} {closedLines[1]} {t['diagram.label.rv-hypertrophy']}