I want to make presentation on principle of haemodynamic based on guyton and gk pal look like mbbs 1st year student make thisss
mkdir -p /home/daytona/workspace/haemodynamics-pptx && ls /home/daytona/workspace/haemodynamics-pptx
~/haemodynamics-pptx/build.js
const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Principles of Haemodynamics";
pres.author = "MBBS 1st Year";
// βββ COLOUR PALETTE ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
const C = {
dark: "0D1B2A", // deep navy (backgrounds)
mid: "1B3A5C", // medium navy
accent: "E63946", // vivid red (highlights)
gold: "F4A261", // warm gold (sub-headings)
light: "E9F1FA", // near-white (body text on dark)
white: "FFFFFF",
teal: "2EC4B6", // teal (formula boxes)
yellow: "FFD166", // yellow (key fact boxes)
};
// βββ HELPERS βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
function titleSlide(title, subtitle, bgColor) {
const s = pres.addSlide();
// Gradient-like effect with two rectangles
s.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: "100%", h: "100%",
fill: { color: bgColor || C.dark }
});
s.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: "100%", h: 0.08,
fill: { color: C.accent }
});
s.addShape(pres.ShapeType.rect, {
x: 0, y: 5.545, w: "100%", h: 0.08,
fill: { color: C.gold }
});
s.addText(title, {
x: 0.5, y: 1.6, w: 9, h: 1.4,
fontSize: 40, bold: true, color: C.white,
align: "center", fontFace: "Calibri",
glow: { size: 8, opacity: 0.3, color: C.accent }
});
if (subtitle) {
s.addText(subtitle, {
x: 0.5, y: 3.1, w: 9, h: 0.9,
fontSize: 20, color: C.gold, align: "center",
italic: true, fontFace: "Calibri"
});
}
// decorative diamond
s.addShape(pres.ShapeType.diamond, {
x: 4.7, y: 4.3, w: 0.5, h: 0.5,
fill: { color: C.accent }, line: { color: C.accent }
});
return s;
}
function sectionHeader(title, icon) {
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: "100%", h: "100%",
fill: { color: C.mid }
});
s.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: 0.12, h: "100%",
fill: { color: C.accent }
});
s.addText((icon || "") + " " + title, {
x: 0.4, y: 1.8, w: 9.2, h: 2,
fontSize: 38, bold: true, color: C.white,
align: "left", fontFace: "Calibri"
});
return s;
}
function contentSlide(title, bullets, imgUrl, note) {
const s = pres.addSlide();
// Background
s.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: "100%", h: "100%",
fill: { color: "F7F9FC" }
});
// Title bar
s.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: "100%", h: 0.7,
fill: { color: C.dark }
});
s.addShape(pres.ShapeType.rect, {
x: 0, y: 0.7, w: "100%", h: 0.05,
fill: { color: C.accent }
});
s.addText(title, {
x: 0.2, y: 0.06, w: 9.6, h: 0.58,
fontSize: 22, bold: true, color: C.white,
fontFace: "Calibri", valign: "middle", margin: 0
});
// Guyton badge
s.addShape(pres.ShapeType.roundRect, {
x: 7.8, y: 0.08, w: 2, h: 0.52,
fill: { color: C.accent }, line: { color: C.accent },
rectRadius: 0.1
});
s.addText("Guyton & Hall", {
x: 7.8, y: 0.08, w: 2, h: 0.52,
fontSize: 10, bold: true, color: C.white,
align: "center", valign: "middle", fontFace: "Calibri", margin: 0
});
const contentW = imgUrl ? 5.6 : 9.4;
const items = bullets.map((b, i) => {
if (b.startsWith("##")) {
return { text: b.replace("##", "").trim(), options: { bold: true, color: C.mid, fontSize: 15, breakLine: true, bullet: false } };
}
return { text: b, options: { bullet: { type: "bullet", indent: 15 }, fontSize: 13, color: "1A1A2E", breakLine: true } };
});
s.addText(items, {
x: 0.3, y: 0.85, w: contentW, h: 4.6,
fontFace: "Calibri", valign: "top", lineSpacingMultiple: 1.25
});
if (imgUrl) {
s.addImage({ path: imgUrl, x: 6.1, y: 0.9, w: 3.6, h: 4.5, sizing: { type: "contain", w: 3.6, h: 4.5 } });
}
if (note) {
s.addShape(pres.ShapeType.roundRect, {
x: 0.3, y: 5.05, w: 9.4, h: 0.46,
fill: { color: "FFF3CD" }, line: { color: C.gold },
rectRadius: 0.07
});
s.addText("π " + note, {
x: 0.35, y: 5.05, w: 9.3, h: 0.46,
fontSize: 11, color: "5C4A00", fontFace: "Calibri", valign: "middle"
});
}
return s;
}
function formulaSlide(title, formulaLines, explanation) {
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: "100%", h: "100%",
fill: { color: "F0F4F8" }
});
s.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: "100%", h: 0.7,
fill: { color: C.dark }
});
s.addShape(pres.ShapeType.rect, {
x: 0, y: 0.7, w: "100%", h: 0.05,
fill: { color: C.teal }
});
s.addText(title, {
x: 0.2, y: 0.06, w: 9.6, h: 0.58,
fontSize: 22, bold: true, color: C.white,
fontFace: "Calibri", valign: "middle", margin: 0
});
// Formula box
s.addShape(pres.ShapeType.roundRect, {
x: 1.5, y: 1.0, w: 7, h: formulaLines.length * 0.65 + 0.5,
fill: { color: C.dark }, line: { color: C.teal, w: 2 },
rectRadius: 0.15
});
const fItems = formulaLines.map((f, i) => ({
text: f,
options: { fontSize: 22, bold: true, color: C.teal, breakLine: i < formulaLines.length - 1, align: "center" }
}));
const fH = formulaLines.length * 0.65 + 0.5;
s.addText(fItems, {
x: 1.5, y: 1.0, w: 7, h: fH,
align: "center", valign: "middle", fontFace: "Courier New"
});
// Explanation
const expItems = explanation.map(e => {
if (e.startsWith("##")) {
return { text: e.replace("##", "").trim(), options: { bold: true, color: C.mid, fontSize: 15, breakLine: true, bullet: false } };
}
return { text: e, options: { bullet: { type: "bullet" }, fontSize: 13, color: "1A1A2E", breakLine: true } };
});
s.addText(expItems, {
x: 0.5, y: 1.0 + fH + 0.2, w: 9, h: 5.625 - (1.0 + fH + 0.3),
fontFace: "Calibri", valign: "top", lineSpacingMultiple: 1.25
});
return s;
}
function tableSlide(title, headers, rows) {
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: "100%", h: "100%",
fill: { color: "F7F9FC" }
});
s.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: "100%", h: 0.7,
fill: { color: C.dark }
});
s.addShape(pres.ShapeType.rect, {
x: 0, y: 0.7, w: "100%", h: 0.05,
fill: { color: C.gold }
});
s.addText(title, {
x: 0.2, y: 0.06, w: 9.6, h: 0.58,
fontSize: 22, bold: true, color: C.white,
fontFace: "Calibri", valign: "middle", margin: 0
});
const colW = 9.4 / headers.length;
const tableData = [
headers.map(h => ({ text: h, options: { bold: true, color: C.white, fill: C.mid, align: "center", fontSize: 13 } })),
...rows.map((row, ri) =>
row.map(cell => ({ text: cell, options: { color: "1A1A2E", fill: ri % 2 === 0 ? "EBF4FF" : C.white, fontSize: 12, align: "center" } }))
)
];
s.addTable(tableData, {
x: 0.3, y: 0.85, w: 9.4, h: 4.5,
border: { pt: 1, color: "CCDDEE" },
fontFace: "Calibri",
autoPage: false
});
return s;
}
// βββ SLIDE 1 β TITLE βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
{
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color: C.dark} });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:0.1, fill:{color: C.accent} });
s.addShape(pres.ShapeType.rect, { x:0, y:5.525, w:"100%", h:0.1, fill:{color: C.gold} });
// Large circle decoration
s.addShape(pres.ShapeType.ellipse, { x:7.2, y:-0.8, w:4, h:4, fill:{color: "1B3A5C"}, line:{color:"1B3A5C"} });
s.addShape(pres.ShapeType.ellipse, { x:7.6, y:-0.4, w:3, h:3, fill:{color: "2A4E6E"}, line:{color:"2A4E6E"} });
s.addText("PRINCIPLES OF", {
x:0.5, y:0.9, w:8, h:0.7,
fontSize:18, color: C.gold, bold:true, charSpacing:8,
fontFace:"Calibri", align:"left"
});
s.addText("HAEMODYNAMICS", {
x:0.5, y:1.5, w:8, h:1.5,
fontSize:52, bold:true, color: C.white,
fontFace:"Calibri", align:"left"
});
s.addShape(pres.ShapeType.rect, { x:0.5, y:3.1, w:2.8, h:0.06, fill:{color: C.accent} });
s.addText("Based on Guyton & Hall | GK Pal", {
x:0.5, y:3.3, w:7, h:0.5,
fontSize:16, color: C.light, italic:true, fontFace:"Calibri"
});
s.addText("MBBS 1st Year β’ Physiology", {
x:0.5, y:3.9, w:7, h:0.45,
fontSize:14, color: C.gold, fontFace:"Calibri"
});
s.addText("Unit: Cardiovascular Physiology", {
x:0.5, y:4.5, w:7, h:0.5,
fontSize:13, color: C.light, fontFace:"Calibri", italic:true
});
}
// βββ SLIDE 2 β OVERVIEW ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
contentSlide(
"What is Haemodynamics?",
[
"## Definition",
"Study of the physical principles governing blood flow through the cardiovascular system",
"From Greek: haima (blood) + dynamis (force/power)",
"## Why it matters for MBBS?",
"Foundation for understanding all cardiovascular diseases",
"Explains hypertension, shock, heart failure & more",
"## Key Variables",
"Blood Flow (Q) β volume/unit time (mL/min or L/min)",
"Blood Pressure (P) β force exerted per unit area (mmHg)",
"Vascular Resistance (R) β opposition to blood flow",
"## Normal Cardiac Output",
"~5β6 L/min at rest in a 70 kg adult",
"= Stroke Volume Γ Heart Rate",
],
null,
"Guyton: 'Blood flow through the circulation can be likened to water flow through pipes' β Ch.14"
);
// βββ SLIDE 3 β SECTION HEADER βββββββββββββββββββββββββββββββββββββββββββββββββ
sectionHeader("1. Blood Flow", "π©Έ");
// βββ SLIDE 4 β BLOOD FLOW ββββββββββββββββββββββββββββββββββββββββββββββββββββ
contentSlide(
"Blood Flow β Definition & Types",
[
"## Definition (Guyton Ch.14)",
"Quantity of blood passing a point in the circulation per unit time",
"Expressed as mL/min or L/min",
"## Normal Values",
"Total body (cardiac output): 5000β6000 mL/min at rest",
"~10β20% greater in men vs women (larger body mass)",
"## Types of Flow",
"Laminar Flow β concentric rings of blood; outermost layer slowest",
"Turbulent Flow β chaotic; occurs at high velocity, sharp bends, narrowing",
"## Clinical Significance",
"Turbulence β Bruits (abnormal sounds heard on auscultation)",
"Turbulence β β energy expenditure β cardiac strain",
],
null,
"GK Pal: Laminar flow is silent; Turbulent flow produces audible bruits (bruit = French for 'noise')"
);
// βββ SLIDE 5 β POISEUILLE'S LAW ββββββββββββββββββββββββββββββββββββββββββββββ
formulaSlide(
"Poiseuille's Law β Most Important Equation",
[
"F = (Ο Γ ΞP Γ rβ΄) / (8 Γ Ξ· Γ l)",
"",
"CO = MAP / TPR"
],
[
"## Variables",
"F = Blood flow rate | ΞP = Pressure difference",
"r = Radius of vessel | Ξ· = Viscosity of blood",
"l = Length of vessel | CO = Cardiac Output",
"MAP = Mean Arterial Pressure | TPR = Total Peripheral Resistance",
"## Key Insight (Guyton Ch.14)",
"Flow β rβ΄ β RADIUS IS THE MOST IMPORTANT FACTOR",
"Doubling radius β 16Γ increase in flow (2β΄ = 16)",
"4-fold β in radius β 256-fold β in flow (4β΄ = 256)",
]
);
// βββ SLIDE 6 β RESISTANCE ββββββββββββββββββββββββββββββββββββββββββββββββββββ
sectionHeader("2. Vascular Resistance", "βοΈ");
contentSlide(
"Vascular Resistance",
[
"## Definition",
"Impediment to blood flow; CANNOT be measured directly",
"Calculated from pressure difference and blood flow",
"## Unit: PRU (Peripheral Resistance Unit)",
"1 PRU = pressure diff. of 1 mmHg when flow = 1 mL/sec",
"## Normal Values (Guyton)",
"Total Peripheral Resistance (TPR): ~1 PRU",
"Strong vasoconstriction: up to 4 PRU",
"Maximal vasodilation: as low as 0.2 PRU",
"Pulmonary Vascular Resistance: ~0.14 PRU (1/7th of systemic)",
"## Conductance = 1 / Resistance",
"Conductance β Diameterβ΄ β key vasoregulatory principle",
"Arterioles contribute ~2/3 of total systemic resistance",
],
null,
"Remember: Arterioles are the 'resistance vessels' β their diameter changes regulate organ blood flow"
);
// βββ SLIDE 7 β SERIES & PARALLEL βββββββββββββββββββββββββββββββββββββββββββββ
contentSlide(
"Series & Parallel Resistance in Circulation",
[
"## Vessels in SERIES (e.g., Arteries β Arterioles β Capillaries)",
"Flow is the SAME through each vessel",
"R_total = Rβ + Rβ + Rβ + ... (resistances ADD UP)",
"## Vessels in PARALLEL (e.g., Different organs)",
"Pressure is the SAME across each vessel",
"1/R_total = 1/Rβ + 1/Rβ + 1/Rβ (resistances DECREASE)",
"Adding more parallel vessels β REDUCES total resistance",
"## Importance",
"Each organ gets its own blood supply independently",
"One organ's vasoconstriction doesn't starve others",
"Brain (~15%), Kidneys (~20%), Liver/GIT (~25%) simultaneously",
"## Arteriolar Control",
"Diameter changes of 4-fold β 256-fold change in flow",
"Range of 100-fold flow change between max constriction & dilation",
],
null,
"MBBS Exam Tip: In series β resistances add; In parallel β reciprocals add (total R decreases)"
);
// βββ SLIDE 8 β BLOOD PRESSURE ββββββββββββββββββββββββββββββββββββββββββββββββ
sectionHeader("3. Blood Pressure", "π");
contentSlide(
"Blood Pressure β Types & Normal Values",
[
"## Systolic BP (SBP)",
"Peak pressure during ventricular systole",
"Normal: 120 mmHg",
"## Diastolic BP (DBP)",
"Minimum pressure during ventricular diastole",
"Normal: 80 mmHg (written as 120/80 mmHg)",
"## Mean Arterial Pressure (MAP)",
"MAP = DBP + 1/3 (SBP β DBP) OR MAP = DBP + Pulse Pressure/3",
"Normal MAP: ~93 mmHg",
"MAP = Cardiac Output Γ Total Peripheral Resistance",
"## Pulse Pressure",
"Pulse Pressure = SBP β DBP = 40 mmHg (normal)",
"β in aortic regurgitation, atherosclerosis, exercise",
"β in aortic stenosis, hypovolaemic shock",
],
null,
"GK Pal: MAP is the true driving pressure for tissue perfusion β memorise MAP = CO Γ TPR"
);
// βββ SLIDE 9 β OHMS LAW ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
formulaSlide(
"Ohm's Law Applied to Circulation",
[
"Q = ΞP / R",
"",
"CO = MAP / TPR",
"",
"MAP = CO Γ TPR"
],
[
"## Analogy with Electrical Circuit (Guyton Ch.14)",
"Blood Flow (Q) β Electric Current (I)",
"Blood Pressure (ΞP) β Voltage (V)",
"Vascular Resistance (R) β Electrical Resistance (R)",
"## Clinical Applications",
"β TPR (vasoconstriction) β β MAP (hypertension)",
"β CO (heart failure) β β MAP (hypotension, shock)",
"Vasodilator drugs β β TPR β β MAP β β afterload",
"## Remember for Exams",
"MAP is maintained by balance of CO and TPR",
"Baroreceptor reflex uses this equation to stabilise BP",
]
);
// βββ SLIDE 10 β CARDIAC OUTPUT βββββββββββββββββββββββββββββββββββββββββββββββ
sectionHeader("4. Cardiac Output", "β€οΈ");
contentSlide(
"Cardiac Output β Definition & Determinants",
[
"## Definition (Guyton Ch.20)",
"Volume of blood pumped by the heart per minute",
"CO = Stroke Volume (SV) Γ Heart Rate (HR)",
"## Normal Values",
"CO at rest: 5 L/min | Cardiac Index: 3.2 L/min/mΒ²",
"SV: ~70 mL/beat | HR: ~72 bpm",
"## Determinants of Stroke Volume",
"Preload β ventricular filling (β preload β β SV: Frank-Starling law)",
"Afterload β resistance against which heart pumps (β afterload β β SV)",
"Contractility (Inotropy) β intrinsic myocardial strength",
"## Determinants of Heart Rate",
"Autonomic NS: SNS β HR; PNS β HR",
"Hormones: Adrenaline β HR; Hypothyroidism β HR",
],
null,
"Guyton: CO is the SUM of all local tissue blood flows β tissue metabolism is the primary regulator"
);
// βββ SLIDE 11 β FRANK-STARLING βββββββββββββββββββββββββββββββββββββββββββββββ
contentSlide(
"Frank-Starling Law of the Heart",
[
"## Principle",
"Force of cardiac contraction β initial length of myocardial fibres",
"= The more the heart is filled, the more forcefully it contracts",
"## Mechanism",
"β Venous Return β β EDV (End-Diastolic Volume)",
"β EDV β β Sarcomere stretch β β Overlap of actin-myosin",
"β β Cross-bridge formation β β Force β β SV",
"## Clinical Importance",
"Explains why both ventricles pump equal volumes",
"Explains compensation in early heart failure",
"β IV fluids β β Preload β β CO (fluid resuscitation in shock)",
"## Limits",
"Over-stretching beyond optimal length β β contractility",
"Seen in decompensated heart failure (dilated cardiomyopathy)",
],
null,
"GK Pal: 'The heart pumps all the blood that comes to it' β Starling's Law ensures output = venous return"
);
// βββ SLIDE 12 β VENOUS RETURN βββββββββββββββββββββββββββββββββββββββββββββββββ
contentSlide(
"Venous Return & Mean Systemic Filling Pressure",
[
"## Venous Return (VR)",
"Volume of blood flowing from peripheral veins into right atrium per minute",
"Under steady state: VR = CO (exactly equal)",
"## Mean Systemic Filling Pressure (MSFP)",
"Pressure in circulation when heart stops = ~7 mmHg",
"Determined by blood volume and venous compliance",
"## Venous Return Curve",
"VR = (MSFP β Right Atrial Pressure) / Venous Resistance",
"## Factors Increasing VR",
"β Blood volume (fluid loading)",
"β Sympathetic tone β β Venous tone β β MSFP",
"Muscle pump (exercise)",
"Respiratory pump (inspiration creates negative intrathoracic pressure)",
"Gravity (leg elevation in shock)",
],
null,
"Guyton Ch.20: Right atrial pressure is the pivot around which CO and VR curves intersect"
);
// βββ SLIDE 13 β BLOOD VISCOSITY ββββββββββββββββββββββββββββββββββββββββββββββ
sectionHeader("5. Blood Viscosity & Vessel Wall", "π¬");
contentSlide(
"Blood Viscosity",
[
"## Definition",
"Resistance to flow due to internal friction between blood layers",
"## Normal Viscosity",
"Blood: 3β4Γ that of water",
"Plasma: ~1.5Γ that of water",
"## Factors Affecting Viscosity",
"Haematocrit (MOST IMPORTANT): β RBC β β viscosity",
"Normal haematocrit: 40β45%",
"Temperature: Cold β β viscosity",
"Plasma proteins: β fibrinogen β β viscosity",
"## Fahraeus-Lindqvist Effect",
"In vessels < 1 mm: viscosity DECREASES (axial streaming of RBCs)",
"Explained by RBC deformation and plasma sleeve at vessel wall",
"## Clinical",
"Polycythaemia: ββ viscosity β ββ resistance β strain on heart",
"Anaemia: β viscosity β β resistance β β CO (high-output failure)",
],
null,
"GK Pal: Viscosity is the Ξ· (eta) in Poiseuille's law β doubled viscosity halves blood flow"
);
// βββ SLIDE 14 β AUTOREGULATION ββββββββββββββββββββββββββββββββββββββββββββββββ
contentSlide(
"Autoregulation of Blood Flow",
[
"## Definition (Guyton Ch.14)",
"Ability of tissue to maintain constant blood flow despite changes in arterial pressure",
"Operates between MAP 70β175 mmHg",
"## Mechanism β Two Theories",
"Myogenic theory: β stretch β smooth muscle contracts β β flow",
"Metabolic theory: β Oβ / β COβ, HβΊ, adenosine β vasodilation β β flow",
"## Organs with Strong Autoregulation",
"Brain (must maintain ~750 mL/min)",
"Kidneys (GFR protection)",
"Heart (maintains coronary flow)",
"## Sympathetic Override",
"Noradrenaline, Angiotensin II, Vasopressin β vasoconstriction",
"But autoregulation overcomes these within a few hours",
"Critical closing pressure β below this, vessels collapse completely",
],
null,
"Guyton: 'Each tissue controls its own blood flow in proportion to its metabolic needs'"
);
// βββ SLIDE 15 β CAPILLARY & STARLING βββββββββββββββββββββββββββββββββββββββββ
sectionHeader("6. Capillary Exchange & Starling Forces", "π§");
contentSlide(
"Starling Forces β Capillary Fluid Exchange",
[
"## Starling's Law of Capillaries",
"Net Filtration Pressure = (Pc + Οi) β (Pi + Οc)",
"Pc = capillary hydrostatic pressure",
"Pi = interstitial fluid hydrostatic pressure",
"Οc = plasma oncotic pressure (main force retaining fluid)",
"Οi = interstitial oncotic pressure",
"## Normal Values (Guyton)",
"Arterial end Pc: ~32 mmHg | Venous end Pc: ~15 mmHg",
"Plasma oncotic (Οc): ~28 mmHg",
"Net: Filtration at arterial end; Absorption at venous end",
"## Causes of Oedema (β filtration)",
"β Pc (heart failure, venous obstruction)",
"β Οc (hypoalbuminaemia, malnutrition, liver disease)",
"β Capillary permeability (inflammation, sepsis)",
"Lymphatic obstruction (filariasis β elephantiasis)",
],
null,
"MBBS Must Know: Hypoalbuminaemia β β oncotic pressure β oedema (nephrotic syndrome, cirrhosis)"
);
// βββ SLIDE 16 β TABLE NORMAL VALUES ββββββββββββββββββββββββββββββββββββββββββ
tableSlide(
"Normal Haemodynamic Values β Quick Reference",
["Parameter", "Normal Value", "Unit", "Clinical Note"],
[
["Cardiac Output (CO)", "5 β 6", "L/min", "β in exercise, fever, anaemia"],
["Cardiac Index (CI)", "3.2", "L/min/mΒ²", "Better than CO β corrects for BSA"],
["Stroke Volume (SV)", "70", "mL/beat", "CO = SV Γ HR"],
["Heart Rate (HR)", "60 β 100", "beats/min", "SNS β, PNS β"],
["Systolic BP", "120", "mmHg", "< 90 = hypotension"],
["Diastolic BP", "80", "mmHg", "> 90 = hypertension (Stage 1)"],
["Mean Arterial Pressure", "93", "mmHg", "DBP + 1/3 Pulse Pressure"],
["Total Peripheral Resistance", "~1", "PRU", "Arterioles control it"],
["Blood Viscosity", "3 β 4Γ", "water = 1", "β in polycythaemia"],
["Pulm. Vasc. Resistance", "~0.14", "PRU", "1/7th of systemic"],
]
);
// βββ SLIDE 17 β CLINICAL APPLICATIONS βββββββββββββββββββββββββββββββββββββββ
sectionHeader("7. Clinical Applications", "π₯");
contentSlide(
"Haemodynamics in Clinical Medicine",
[
"## Hypertension",
"β TPR (mainly arteriolar) β β MAP β β afterload β LVH",
"Treatment: ACE inhibitors, CaΒ²βΊ channel blockers β β TPR",
"## Cardiogenic Shock",
"ββ CO β β MAP β inadequate tissue perfusion",
"Signs: cold extremities, β BP, β HR, β urine output",
"## Heart Failure",
"β SV β Frank-Starling compensation β oedema when fails",
"## Anaemia & Polycythaemia",
"Anaemia: β viscosity β β CO β high-output heart failure if severe",
"Polycythaemia: β viscosity β β resistance β β cardiac work",
"## Haemorrhage",
"β Blood vol. β β VR β β CO β Baroreceptor reflex β β HR + β TPR",
],
null,
"GK Pal: Understanding Ohm's Law (MAP = CO Γ TPR) unlocks treatment of every cardiovascular disease"
);
// βββ SLIDE 18 β MNEMONICS ββββββββββββββββββββββββββββββββββββββββββββββββββββ
{
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color: C.dark} });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:0.7, fill:{color: C.mid} });
s.addShape(pres.ShapeType.rect, { x:0, y:0.7, w:"100%", h:0.05, fill:{color: C.accent} });
s.addText("Mnemonics & Exam Tips", {
x:0.2, y:0.06, w:9.6, h:0.58,
fontSize:22, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0
});
const boxes = [
{ x:0.2, y:0.9, text:"MAP Formula\nMAP = DBP + β
(PP)\nOR\nCO Γ TPR", color: C.accent },
{ x:3.4, y:0.9, text:"Poiseuille Key\nFlow β rβ΄\nDouble radius\nβ 16Γ flow", color: C.teal },
{ x:6.6, y:0.9, text:"Ohm's Law\nQ = ΞP / R\nCO = MAP / TPR\nMAP = CO Γ TPR", color: C.gold },
{ x:0.2, y:2.9, text:"Frank-Starling\nMore FILL\nβ More FORCE\nβ More FLOW", color: "8338EC" },
{ x:3.4, y:2.9, text:"Viscosity Rule\nβ HCT = β Viscosity\nβ Viscosity = β R\nβ R = β Flow", color: "FF6B6B" },
{ x:6.6, y:2.9, text:"Starling Forces\nOedema = βPc OR\nβAlbumin OR\nβPermeability", color: "06D6A0" },
];
boxes.forEach(b => {
s.addShape(pres.ShapeType.roundRect, {
x:b.x, y:b.y, w:3, h:1.7,
fill:{color: b.color}, line:{color:b.color},
rectRadius:0.15
});
s.addText(b.text, {
x:b.x+0.1, y:b.y+0.05, w:2.8, h:1.6,
fontSize:13, bold:true, color:C.white,
fontFace:"Calibri", align:"center", valign:"middle"
});
});
s.addText("All formulas based on Guyton & Hall, Textbook of Medical Physiology + GK Pal Textbook of Medical Physiology", {
x:0.2, y:5.1, w:9.6, h:0.4,
fontSize:10, color: C.gold, italic:true, fontFace:"Calibri", align:"center"
});
}
// βββ SLIDE 19 β SUMMARY ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
{
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color: "F0F4F8"} });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:0.7, fill:{color: C.dark} });
s.addShape(pres.ShapeType.rect, { x:0, y:0.7, w:"100%", h:0.05, fill:{color: C.accent} });
s.addText("Summary β Take Home Messages", {
x:0.2, y:0.06, w:9.6, h:0.58,
fontSize:22, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0
});
const summary = [
"1. Blood flow = Cardiac Output = ~5 L/min at rest",
"2. Poiseuille's Law: Flow β rβ΄ β vessel radius is the master regulator",
"3. Ohm's Law: MAP = CO Γ TPR β the central haemodynamic equation",
"4. Resistance in series ADDS; in parallel DECREASES total resistance",
"5. Frank-Starling: More venous return β more cardiac output (within limits)",
"6. Autoregulation maintains organ perfusion between MAP 70β175 mmHg",
"7. Starling Forces: Oedema occurs when filtration exceeds lymphatic drainage",
"8. Arterioles are the 'resistance vessels' β key targets for antihypertensives",
"9. Blood viscosity β Haematocrit β impacts vascular resistance",
"10. All cardiovascular pharmacology is based on manipulating CO and TPR",
];
s.addText(summary.join("\n"), {
x:0.4, y:0.9, w:9.2, h:4.5,
fontSize:13.5, color:"1A1A2E", fontFace:"Calibri",
lineSpacingMultiple:1.35, valign:"top"
});
}
// βββ SLIDE 20 β THANK YOU ββββββββββββββββββββββββββββββββββββββββββββββββββββ
{
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color: C.dark} });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:0.08, fill:{color: C.accent} });
s.addShape(pres.ShapeType.rect, { x:0, y:5.545, w:"100%", h:0.08, fill:{color: C.gold} });
s.addShape(pres.ShapeType.ellipse, { x:-1, y:3, w:5, h:5, fill:{color:"1B3A5C"}, line:{color:"1B3A5C"} });
s.addText("Thank You!", {
x:1, y:1.3, w:8, h:1.2,
fontSize:52, bold:true, color:C.white,
fontFace:"Calibri", align:"center"
});
s.addText("Questions & Discussion", {
x:1, y:2.7, w:8, h:0.6,
fontSize:22, color:C.gold, italic:true,
fontFace:"Calibri", align:"center"
});
s.addShape(pres.ShapeType.rect, { x:3, y:3.5, w:4, h:0.05, fill:{color:C.accent} });
s.addText("References", {
x:1, y:3.7, w:8, h:0.4,
fontSize:14, bold:true, color:C.light, fontFace:"Calibri", align:"center"
});
s.addText(
"Guyton AC, Hall JE. Textbook of Medical Physiology, 14th Ed. Elsevier.\n" +
"Pal GK, Pal P. Textbook of Medical Physiology, 3rd Ed. Orient Blackswan.",
{
x:1, y:4.1, w:8, h:0.9,
fontSize:12, color:C.light, italic:true,
fontFace:"Calibri", align:"center", lineSpacingMultiple:1.4
}
);
}
// βββ WRITE FILE ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
pres.writeFile({ fileName: "/home/daytona/workspace/haemodynamics-pptx/Principles_of_Haemodynamics.pptx" })
.then(() => console.log("β
Saved: Principles_of_Haemodynamics.pptx"))
.catch(e => { console.error("β Error:", e); process.exit(1); });
cd /home/daytona/workspace/haemodynamics-pptx && node build.js 2>&1
ls -lh /home/daytona/workspace/haemodynamics-pptx/
Principles of Haemodynamics
Presentation Β· PPTX
| # | Slide | Content |
|---|---|---|
| 1 | Title | Dark navy + red accent, "MBBS 1st Year β’ Physiology" |
| 2 | What is Haemodynamics? | Definition, key variables, normal CO |
| 3 | Section header | Blood Flow |
| 4 | Blood Flow | Laminar vs turbulent, normal values, bruits |
| 5 | Poiseuille's Law | Full formula box, rβ΄ rule explained |
| 6 | Section header | Vascular Resistance |
| 7 | Resistance | PRU, conductance, arteriolar control |
| 8 | Series & Parallel circuits | How organs share circulation |
| 9 | Section header | Blood Pressure |
| 10 | Blood Pressure types | SBP/DBP/MAP/Pulse Pressure + normal values |
| 11 | Ohm's Law | Q=ΞP/R, MAP=COΓTPR formula slides |
| 12 | Section header | Cardiac Output |
| 13 | Cardiac Output | SVΓHR, preload/afterload/contractility |
| 14 | Frank-Starling Law | Mechanism, clinical uses |
| 15 | Venous Return | MSFP, factors, CO-VR equality |
| 16 | Blood Viscosity | Fahraeus-Lindqvist, polycythaemia/anaemia |
| 17 | Autoregulation | 70β175 mmHg, myogenic + metabolic theories |
| 18 | Starling Capillary Forces | Oedema causes, normal values |
| 19 | Normal Values Table | CO, SV, HR, MAP, TPR, PVR β all in one table |
| 20 | Clinical Applications | HTN, shock, heart failure, anaemia |
| 21 | Mnemonics | 6 colourful boxes for exam revision |
| 22 | Summary | 10 take-home messages |
| 23 | Thank You + References | Guyton 14th Ed + GK Pal 3rd Ed |
Try again
~/haemodynamics-pptx/build2.js
const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Principles of Haemodynamics";
// ββ PALETTE ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
const P = {
bg: "FFFFFF",
navy: "1A3C5E",
blue: "2563EB",
lblue: "DBEAFE",
red: "DC2626",
lred: "FEE2E2",
green: "059669",
lgreen: "D1FAE5",
orange: "EA580C",
lorange: "FFEDD5",
purple: "7C3AED",
lpurple: "EDE9FE",
yellow: "F59E0B",
lyellow: "FEF3C7",
gray: "374151",
lgray: "F3F4F6",
white: "FFFFFF",
dark: "111827",
};
// ββ REUSABLE HELPERS βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
function bg(s) {
s.addShape(pres.ShapeType.rect, { x:0,y:0,w:"100%",h:"100%", fill:{color:P.bg} });
}
function titleBar(s, title, subtitle) {
// Full-width coloured header band
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:1.15, fill:{color:P.navy} });
s.addShape(pres.ShapeType.rect, { x:0, y:1.15, w:"100%", h:0.07, fill:{color:P.blue} });
s.addText(title, {
x:0.25, y:0.05, w:9.5, h:0.72,
fontSize:25, bold:true, color:P.white, fontFace:"Calibri", valign:"bottom", margin:0
});
if (subtitle) {
s.addText(subtitle, {
x:0.25, y:0.77, w:9.5, h:0.32,
fontSize:13, color:"93C5FD", fontFace:"Calibri", italic:true, valign:"top", margin:0
});
}
}
function pill(s, x, y, w, h, text, bg, fg) {
s.addShape(pres.ShapeType.roundRect, { x,y,w,h, fill:{color:bg}, line:{color:bg}, rectRadius:0.12 });
s.addText(text, { x,y,w,h, fontSize:11, bold:true, color:fg||P.white, align:"center", valign:"middle", fontFace:"Calibri", margin:0 });
}
function infoBox(s, x, y, w, h, label, value, accent) {
s.addShape(pres.ShapeType.roundRect, { x,y,w,h, fill:{color:accent+"22"||P.lblue}, line:{color:accent, pt:1.5}, rectRadius:0.1 });
s.addText(label, { x:x+0.1, y:y+0.08, w:w-0.2, h:0.28, fontSize:10, bold:true, color:accent, fontFace:"Calibri", margin:0 });
s.addText(value, { x:x+0.1, y:y+0.32, w:w-0.2, h:h-0.42, fontSize:13, bold:true, color:P.dark, fontFace:"Calibri", valign:"middle", margin:0 });
}
function formulaBox(s, x, y, w, h, formula, accent) {
s.addShape(pres.ShapeType.roundRect, { x,y,w,h, fill:{color:accent}, line:{color:accent}, rectRadius:0.15 });
s.addText(formula, { x:x+0.15,y,w:w-0.3,h, fontSize:20, bold:true, color:P.white, align:"center", valign:"middle", fontFace:"Courier New", margin:0 });
}
function sectionDivider(title, subtitle, color) {
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0,y:0,w:"100%",h:"100%", fill:{color:color} });
s.addShape(pres.ShapeType.rect, { x:0,y:0,w:0.15,h:"100%", fill:{color:P.white+"33"} });
// Large circle decoration
s.addShape(pres.ShapeType.ellipse, { x:6.5, y:-1.5, w:5.5, h:5.5, fill:{color:P.white+"18"}, line:{color:P.white+"18"} });
s.addShape(pres.ShapeType.ellipse, { x:7.2, y:-0.8, w:4, h:4, fill:{color:P.white+"18"}, line:{color:P.white+"18"} });
s.addText(subtitle || "", { x:0.5, y:1.6, w:7, h:0.5, fontSize:16, color:P.white+"BB", fontFace:"Calibri", bold:false, italic:true });
s.addText(title, { x:0.5, y:2.1, w:7.5, h:1.6, fontSize:44, bold:true, color:P.white, fontFace:"Calibri" });
return s;
}
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// SLIDE 1 β COVER
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
{
const s = pres.addSlide();
// Left half navy, right half gradient effect
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:P.navy} });
s.addShape(pres.ShapeType.rect, { x:5.8, y:0, w:4.2, h:"100%", fill:{color:"0F2845"} });
// Decorative circles
s.addShape(pres.ShapeType.ellipse, { x:6.2, y:-0.5, w:4.5, h:4.5, fill:{color:P.blue+"33"}, line:{color:P.blue+"33"} });
s.addShape(pres.ShapeType.ellipse, { x:7.0, y:2.0, w:3.5, h:3.5, fill:{color:P.blue+"22"}, line:{color:P.blue+"22"} });
s.addShape(pres.ShapeType.ellipse, { x:5.5, y:1.5, w:1.2, h:1.2, fill:{color:P.red}, line:{color:P.red} });
// Bottom accent bar
s.addShape(pres.ShapeType.rect, { x:0, y:5.3, w:"100%", h:0.325, fill:{color:P.blue} });
s.addText("PRINCIPLES OF", {
x:0.5, y:0.7, w:7, h:0.55,
fontSize:17, bold:true, color:"93C5FD", charSpacing:7, fontFace:"Calibri"
});
s.addText("HAEMODYNAMICS", {
x:0.5, y:1.2, w:7.5, h:1.8,
fontSize:54, bold:true, color:P.white, fontFace:"Calibri"
});
s.addShape(pres.ShapeType.rect, { x:0.5, y:3.1, w:3.2, h:0.07, fill:{color:P.red} });
s.addText("Guyton & Hall Β· GK Pal", {
x:0.5, y:3.25, w:7, h:0.48,
fontSize:17, color:"93C5FD", italic:true, fontFace:"Calibri"
});
s.addText("MBBS 1st Year | Physiology | Cardiovascular System", {
x:0.5, y:3.85, w:7, h:0.4,
fontSize:13, color:P.white+"AA", fontFace:"Calibri"
});
// Stats boxes bottom
const stats = [
{x:0.5, label:"Cardiac Output", val:"5 L/min"},
{x:2.9, label:"Normal BP", val:"120/80"},
{x:5.3, label:"Heart Rate", val:"72 bpm"},
];
stats.forEach(st => {
s.addShape(pres.ShapeType.roundRect, { x:st.x, y:4.6, w:2.0, h:0.58, fill:{color:P.blue+"55"}, line:{color:P.blue}, rectRadius:0.08 });
s.addText(st.label + "\n" + st.val, {
x:st.x+0.05, y:4.6, w:1.9, h:0.58,
fontSize:11, bold:true, color:P.white, align:"center", valign:"middle", fontFace:"Calibri", margin:0
});
});
}
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// SLIDE 2 β LEARNING OBJECTIVES
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
{
const s = pres.addSlide();
bg(s);
titleBar(s, "Learning Objectives", "By the end of this session, you should be able to:");
const objs = [
{ num:"01", text:"Define blood flow, pressure & vascular resistance", color:P.blue },
{ num:"02", text:"Apply Poiseuille's Law & Ohm's Law to circulation", color:P.red },
{ num:"03", text:"Explain cardiac output and its regulation", color:P.green },
{ num:"04", text:"Describe Frank-Starling mechanism", color:P.orange },
{ num:"05", text:"Understand capillary exchange (Starling Forces)", color:P.purple },
{ num:"06", text:"Correlate haemodynamics with clinical conditions", color:P.yellow },
];
objs.forEach((obj, i) => {
const x = i < 3 ? 0.3 : 5.2;
const y = 1.4 + (i % 3) * 1.3;
s.addShape(pres.ShapeType.roundRect, { x, y, w:4.5, h:1.1, fill:{color:obj.color+"11"}, line:{color:obj.color, pt:1.5}, rectRadius:0.12 });
s.addShape(pres.ShapeType.roundRect, { x:x+0.12, y:y+0.2, w:0.5, h:0.5, fill:{color:obj.color}, line:{color:obj.color}, rectRadius:0.06 });
s.addText(obj.num, { x:x+0.12, y:y+0.2, w:0.5, h:0.5, fontSize:15, bold:true, color:P.white, align:"center", valign:"middle", fontFace:"Calibri", margin:0 });
s.addText(obj.text, { x:x+0.75, y:y+0.12, w:3.65, h:0.78, fontSize:13, color:P.dark, fontFace:"Calibri", valign:"middle" });
});
}
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// SLIDE 3 β SECTION: BLOOD FLOW
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
sectionDivider("Blood Flow", "Topic 1 Β· Guyton & Hall Ch. 14", P.blue);
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// SLIDE 4 β BLOOD FLOW BASICS
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
{
const s = pres.addSlide();
bg(s);
titleBar(s, "Blood Flow", "Guyton Ch.14 β Definition, Types & Measurement");
// Left column β content
const items = [
["Definition", "Volume of blood passing a given point per unit time", P.blue],
["Unit", "mL/min or L/min", P.blue],
["Normal (adult)", "5,000β6,000 mL/min = Cardiac Output", P.green],
["Men vs Women", "CO ~10β20% higher in men (larger body mass)", P.green],
];
items.forEach(([label,val,col], i) => {
infoBox(s, 0.3, 1.35 + i*0.95, 5.5, 0.82, label, val, col);
});
// Right column β Flow types visual
s.addShape(pres.ShapeType.roundRect, { x:6.1, y:1.35, w:3.6, h:4.1, fill:{color:P.lgray}, line:{color:"D1D5DB"}, rectRadius:0.15 });
s.addText("TYPES OF FLOW", { x:6.1, y:1.4, w:3.6, h:0.4, fontSize:13, bold:true, color:P.navy, align:"center", fontFace:"Calibri", margin:0 });
// Laminar
s.addShape(pres.ShapeType.rect, { x:6.3, y:1.9, w:3.2, h:0.07, fill:{color:P.blue+"44"} });
s.addShape(pres.ShapeType.rect, { x:6.3, y:2.0, w:3.2, h:0.07, fill:{color:P.blue+"77"} });
s.addShape(pres.ShapeType.rect, { x:6.3, y:2.1, w:3.2, h:0.07, fill:{color:P.blue+"AA"} });
s.addShape(pres.ShapeType.rect, { x:6.3, y:2.2, w:3.2, h:0.07, fill:{color:P.blue} });
s.addShape(pres.ShapeType.rect, { x:6.3, y:2.3, w:3.2, h:0.07, fill:{color:P.blue+"AA"} });
s.addShape(pres.ShapeType.rect, { x:6.3, y:2.4, w:3.2, h:0.07, fill:{color:P.blue+"77"} });
s.addShape(pres.ShapeType.rect, { x:6.3, y:2.5, w:3.2, h:0.07, fill:{color:P.blue+"44"} });
s.addText("LAMINAR (silent, normal)", { x:6.1, y:2.62, w:3.6, h:0.32, fontSize:11, color:P.blue, bold:true, align:"center", fontFace:"Calibri", margin:0 });
s.addText("Concentric rings; centre fastest", { x:6.1, y:2.9, w:3.6, h:0.25, fontSize:10, color:P.gray, align:"center", fontFace:"Calibri", italic:true, margin:0 });
// Turbulent
s.addShape(pres.ShapeType.roundRect, { x:6.3, y:3.3, w:3.2, h:0.7, fill:{color:P.red+"22"}, line:{color:P.red}, rectRadius:0.1 });
s.addText("ββ TURBULENT ββ\n(chaotic β bruits)", { x:6.3, y:3.3, w:3.2, h:0.7, fontSize:12, bold:true, color:P.red, align:"center", valign:"middle", fontFace:"Calibri", margin:0 });
s.addText("High velocity, bifurcations, stenosis", { x:6.1, y:4.1, w:3.6, h:0.25, fontSize:10, color:P.gray, align:"center", fontFace:"Calibri", italic:true, margin:0 });
// Reynolds number
pill(s, 6.3, 4.42, 3.2, 0.4, "Reynolds No. > 2000 β Turbulence", P.orange, P.white);
// Bottom bar
s.addShape(pres.ShapeType.rect, { x:0, y:5.32, w:"100%", h:0.305, fill:{color:P.lgray} });
s.addText("GK Pal: Turbulent flow = Bruits on auscultation | Laminar flow = Silent | Guyton Ch.14", {
x:0.2, y:5.33, w:9.6, h:0.28, fontSize:10, color:P.gray, italic:true, fontFace:"Calibri", margin:0
});
}
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// SLIDE 5 β POISEUILLE'S LAW
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
{
const s = pres.addSlide();
bg(s);
titleBar(s, "Poiseuille's Law", "The most important equation in haemodynamics");
// Central formula
s.addShape(pres.ShapeType.roundRect, { x:0.5, y:1.35, w:9, h:1.2, fill:{color:P.navy}, line:{color:P.navy}, rectRadius:0.15 });
s.addText("F = Ο Γ ΞP Γ rβ΄ / 8 Γ Ξ· Γ l", {
x:0.5, y:1.35, w:9, h:1.2,
fontSize:30, bold:true, color:P.white, align:"center", valign:"middle", fontFace:"Courier New", margin:0
});
// Variables grid
const vars = [
{sym:"F", meaning:"Flow rate", unit:"mL/min", col:P.blue},
{sym:"ΞP", meaning:"Pressure difference", unit:"mmHg", col:P.red},
{sym:"r", meaning:"Radius of vessel β", unit:"cm", col:P.orange},
{sym:"Ξ·", meaning:"Blood viscosity", unit:"poise", col:P.purple},
{sym:"l", meaning:"Length of vessel", unit:"cm", col:P.green},
{sym:"Ο/8", meaning:"Mathematical constant", unit:"β", col:P.gray},
];
vars.forEach((v, i) => {
const x = 0.3 + (i % 3) * 3.2;
const y = 2.75 + Math.floor(i / 3) * 0.85;
s.addShape(pres.ShapeType.roundRect, { x, y, w:3.1, h:0.72, fill:{color:v.col+"18"}, line:{color:v.col, pt:1.5}, rectRadius:0.1 });
s.addShape(pres.ShapeType.roundRect, { x:x+0.1, y:y+0.12, w:0.5, h:0.48, fill:{color:v.col}, line:{color:v.col}, rectRadius:0.07 });
s.addText(v.sym, { x:x+0.1, y:y+0.12, w:0.5, h:0.48, fontSize:13, bold:true, color:P.white, align:"center", valign:"middle", fontFace:"Courier New", margin:0 });
s.addText(v.meaning, { x:x+0.68, y:y+0.06, w:2.35, h:0.33, fontSize:11, bold:true, color:P.dark, fontFace:"Calibri", margin:0 });
s.addText(v.unit, { x:x+0.68, y:y+0.37, w:2.35, h:0.25, fontSize:10, color:P.gray, fontFace:"Calibri", italic:true, margin:0 });
});
// Key insight banner
s.addShape(pres.ShapeType.rect, { x:0, y:5.28, w:"100%", h:0.345, fill:{color:P.orange} });
s.addText("β KEY: Flow β rβ΄ | Double radius β 16Γ flow | 4Γ radius β 256Γ flow | Arterioles are the master regulators!", {
x:0.2, y:5.28, w:9.6, h:0.34, fontSize:12, bold:true, color:P.white, align:"center", fontFace:"Calibri", valign:"middle", margin:0
});
}
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// SLIDE 6 β SECTION: VASCULAR RESISTANCE
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
sectionDivider("Vascular Resistance", "Topic 2 Β· Guyton & Hall Ch. 14", P.red);
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// SLIDE 7 β RESISTANCE & OHM'S LAW
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
{
const s = pres.addSlide();
bg(s);
titleBar(s, "Vascular Resistance & Ohm's Law", "Guyton Ch.14 β The governing principle of circulation");
// Ohm's analogy β two column layout
s.addShape(pres.ShapeType.roundRect, { x:0.3, y:1.3, w:4.4, h:4.1, fill:{color:P.lblue}, line:{color:P.blue, pt:1.5}, rectRadius:0.15 });
s.addText("β‘ ELECTRICAL", { x:0.3, y:1.35, w:4.4, h:0.45, fontSize:14, bold:true, color:P.blue, align:"center", fontFace:"Calibri", margin:0 });
const elec = ["Current (I)", "Voltage (V)", "Resistance (R)", "I = V / R"];
elec.forEach((t, i) => {
s.addText((i < 3 ? "βΈ " : "β€ ") + t, {
x:0.5, y:1.85 + i*0.45, w:4.0, h:0.4,
fontSize: i === 3 ? 18 : 14, bold: i===3, color: i===3 ? P.blue : P.dark,
fontFace: i===3 ? "Courier New" : "Calibri", margin:0
});
});
s.addShape(pres.ShapeType.roundRect, { x:5.3, y:1.3, w:4.4, h:4.1, fill:{color:P.lred}, line:{color:P.red, pt:1.5}, rectRadius:0.15 });
s.addText("π©Έ CIRCULATION", { x:5.3, y:1.35, w:4.4, h:0.45, fontSize:14, bold:true, color:P.red, align:"center", fontFace:"Calibri", margin:0 });
const circ = ["Blood Flow (Q)", "Pressure (ΞP)", "Resistance (R)", "Q = ΞP / R"];
circ.forEach((t, i) => {
s.addText((i < 3 ? "βΈ " : "β€ ") + t, {
x:5.5, y:1.85 + i*0.45, w:4.0, h:0.4,
fontSize: i === 3 ? 18 : 14, bold: i===3, color: i===3 ? P.red : P.dark,
fontFace: i===3 ? "Courier New" : "Calibri", margin:0
});
});
// Equals arrow between
s.addShape(pres.ShapeType.rect, { x:4.72, y:2.9, w:0.56, h:0.07, fill:{color:P.gray} });
s.addText("=", { x:4.7, y:2.72, w:0.6, h:0.5, fontSize:28, bold:true, color:P.gray, align:"center", fontFace:"Calibri", margin:0 });
// Normal resistance values
const rvals = [
["TPR (normal)", "~1 PRU", P.navy],
["Strong vasoconstriction", "4 PRU", P.red],
["Max vasodilation", "0.2 PRU", P.green],
["Pulmonary VR", "~0.14 PRU", P.blue],
];
rvals.forEach((rv, i) => {
const x = 0.3 + (i % 2) * 4.7;
const y = 3.5 + Math.floor(i / 2) * 0.55;
s.addShape(pres.ShapeType.roundRect, { x, y, w:4.3, h:0.44, fill:{color:rv[2]+"18"}, line:{color:rv[2]}, rectRadius:0.08 });
s.addText(rv[0] + " β " + rv[1], { x:x+0.1, y, w:4.1, h:0.44, fontSize:12, bold:true, color:rv[2], fontFace:"Calibri", valign:"middle", margin:0 });
});
s.addShape(pres.ShapeType.rect, { x:0, y:5.28, w:"100%", h:0.345, fill:{color:P.lgray} });
s.addText("PRU = Peripheral Resistance Unit | 1 PRU = 1 mmHg / 1 mLΒ·secβ»ΒΉ | Arterioles contribute ~2/3 of TPR", {
x:0.2, y:5.3, w:9.6, h:0.3, fontSize:10, color:P.gray, italic:true, fontFace:"Calibri", margin:0
});
}
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// SLIDE 8 β SERIES & PARALLEL
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
{
const s = pres.addSlide();
bg(s);
titleBar(s, "Series & Parallel Vascular Circuits", "Guyton Ch.14 β How organs share the circulation");
// Series box
s.addShape(pres.ShapeType.roundRect, { x:0.3, y:1.3, w:4.4, h:3.8, fill:{color:P.lyellow}, line:{color:P.yellow, pt:2}, rectRadius:0.15 });
s.addText("IN SERIES", { x:0.3, y:1.35, w:4.4, h:0.5, fontSize:18, bold:true, color:P.orange, align:"center", fontFace:"Calibri", margin:0 });
s.addText("Arteries β Arterioles β Capillaries β Venules β Veins", {
x:0.45, y:1.88, w:4.1, h:0.4, fontSize:10, color:P.gray, italic:true, fontFace:"Calibri", margin:0
});
// Series resistor diagram
["Rβ", "Rβ", "Rβ"].forEach((r, i) => {
s.addShape(pres.ShapeType.rect, { x:0.6 + i*1.3, y:2.45, w:0.9, h:0.45, fill:{color:P.orange}, line:{color:P.orange}, rectRadius:0 });
s.addText(r, { x:0.6 + i*1.3, y:2.45, w:0.9, h:0.45, fontSize:13, bold:true, color:P.white, align:"center", valign:"middle", fontFace:"Courier New", margin:0 });
if (i < 2) s.addShape(pres.ShapeType.rect, { x:1.5 + i*1.3, y:2.63, w:0.4, h:0.07, fill:{color:P.orange} });
});
s.addText("R_total = Rβ + Rβ + Rβ + ...", {
x:0.45, y:3.1, w:4.1, h:0.5, fontSize:14, bold:true, color:P.orange, align:"center", fontFace:"Courier New", margin:0
});
const sFacts = ["Flow is SAME through each segment", "Total resistance is SUM of all", "Analogy: Single road, multiple checkpoints"];
sFacts.forEach((f, i) => {
s.addText("β " + f, { x:0.45, y:3.75 + i*0.38, w:4.1, h:0.35, fontSize:11, color:P.dark, fontFace:"Calibri", margin:0 });
});
// Parallel box
s.addShape(pres.ShapeType.roundRect, { x:5.3, y:1.3, w:4.4, h:3.8, fill:{color:P.lgreen}, line:{color:P.green, pt:2}, rectRadius:0.15 });
s.addText("IN PARALLEL", { x:5.3, y:1.35, w:4.4, h:0.5, fontSize:18, bold:true, color:P.green, align:"center", fontFace:"Calibri", margin:0 });
s.addText("Brain, Heart, Kidneys, Liver, Muscle β all simultaneously", {
x:5.45, y:1.88, w:4.1, h:0.4, fontSize:10, color:P.gray, italic:true, fontFace:"Calibri", margin:0
});
// Parallel resistor diagram
["Rβ", "Rβ", "Rβ"].forEach((r, i) => {
s.addShape(pres.ShapeType.rect, { x:6.5, y:2.35 + i*0.32, w:0.9, h:0.25, fill:{color:P.green}, line:{color:P.green} });
s.addText(r, { x:6.5, y:2.35 + i*0.32, w:0.9, h:0.25, fontSize:10, bold:true, color:P.white, align:"center", valign:"middle", fontFace:"Courier New", margin:0 });
s.addShape(pres.ShapeType.rect, { x:6.1, y:2.44 + i*0.32, w:0.4, h:0.07, fill:{color:P.green} });
s.addShape(pres.ShapeType.rect, { x:7.4, y:2.44 + i*0.32, w:0.4, h:0.07, fill:{color:P.green} });
});
s.addText("1/R_total = 1/Rβ + 1/Rβ + 1/Rβ", {
x:5.45, y:3.38, w:4.1, h:0.5, fontSize:13, bold:true, color:P.green, align:"center", fontFace:"Courier New", margin:0
});
const pFacts = ["Pressure is SAME across each organ", "Adding organs DECREASES total resistance", "Analogy: Multiple lanes on a highway"];
pFacts.forEach((f, i) => {
s.addText("β " + f, { x:5.45, y:3.98 + i*0.36, w:4.1, h:0.33, fontSize:11, color:P.dark, fontFace:"Calibri", margin:0 });
});
s.addShape(pres.ShapeType.rect, { x:0, y:5.28, w:"100%", h:0.345, fill:{color:P.lgray} });
s.addText("EXAM TIP: Arteriesβcapillaries = Series (R adds) | Brain, kidney, liver = Parallel (R decreases) | Guyton Ch.14", {
x:0.2, y:5.3, w:9.6, h:0.3, fontSize:10, color:P.gray, italic:true, fontFace:"Calibri", margin:0
});
}
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// SLIDE 9 β SECTION: BLOOD PRESSURE
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
sectionDivider("Blood Pressure", "Topic 3 Β· Guyton & Hall Ch. 15", P.green);
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// SLIDE 10 β BLOOD PRESSURE TYPES
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
{
const s = pres.addSlide();
bg(s);
titleBar(s, "Blood Pressure β Types & Formulae", "Guyton Ch.15 β Normal values you MUST memorise");
// BP gauge visual β left side
s.addShape(pres.ShapeType.ellipse, { x:0.3, y:1.45, w:3.5, h:3.5, fill:{color:P.lgray}, line:{color:"D1D5DB", pt:2} });
// SBP arc
s.addShape(pres.ShapeType.roundRect, { x:0.6, y:1.7, w:3.0, h:0.6, fill:{color:P.red}, line:{color:P.red}, rectRadius:0.08 });
s.addText("SYSTOLIC 120 mmHg", { x:0.6, y:1.7, w:3.0, h:0.6, fontSize:14, bold:true, color:P.white, align:"center", valign:"middle", fontFace:"Calibri", margin:0 });
// MAP bar
s.addShape(pres.ShapeType.roundRect, { x:0.6, y:2.5, w:3.0, h:0.55, fill:{color:P.orange}, line:{color:P.orange}, rectRadius:0.08 });
s.addText("MAP ~93 mmHg", { x:0.6, y:2.5, w:3.0, h:0.55, fontSize:14, bold:true, color:P.white, align:"center", valign:"middle", fontFace:"Calibri", margin:0 });
// DBP bar
s.addShape(pres.ShapeType.roundRect, { x:0.6, y:3.25, w:3.0, h:0.55, fill:{color:P.blue}, line:{color:P.blue}, rectRadius:0.08 });
s.addText("DIASTOLIC 80 mmHg", { x:0.6, y:3.25, w:3.0, h:0.55, fontSize:14, bold:true, color:P.white, align:"center", valign:"middle", fontFace:"Calibri", margin:0 });
// Pulse pressure
s.addShape(pres.ShapeType.roundRect, { x:0.6, y:4.0, w:3.0, h:0.55, fill:{color:P.purple}, line:{color:P.purple}, rectRadius:0.08 });
s.addText("PULSE PRESSURE 40 mmHg", { x:0.6, y:4.0, w:3.0, h:0.55, fontSize:13, bold:true, color:P.white, align:"center", valign:"middle", fontFace:"Calibri", margin:0 });
// Right side β formulae
const formulas = [
{ f:"MAP = DBP + ΒΉββ(SBPβDBP)", c:P.orange, label:"Mean Arterial Pressure" },
{ f:"PP = SBP β DBP = 40", c:P.purple, label:"Pulse Pressure" },
{ f:"MAP = CO Γ TPR", c:P.red, label:"Haemodynamic equation" },
];
formulas.forEach((fm, i) => {
s.addShape(pres.ShapeType.roundRect, { x:4.05, y:1.45 + i*1.35, w:5.7, h:1.15, fill:{color:fm.c+"15"}, line:{color:fm.c, pt:1.5}, rectRadius:0.12 });
s.addText(fm.label, { x:4.2, y:1.5 + i*1.35, w:5.4, h:0.3, fontSize:11, bold:true, color:fm.c, fontFace:"Calibri", margin:0 });
s.addText(fm.f, { x:4.2, y:1.78 + i*1.35, w:5.4, h:0.65, fontSize:18, bold:true, color:P.dark, fontFace:"Courier New", valign:"middle", margin:0 });
});
s.addShape(pres.ShapeType.rect, { x:0, y:5.28, w:"100%", h:0.345, fill:{color:P.lgray} });
s.addText("β PP in: aortic regurgitation, atherosclerosis | β PP in: aortic stenosis, cardiogenic shock | GK Pal", {
x:0.2, y:5.3, w:9.6, h:0.3, fontSize:10, color:P.gray, italic:true, fontFace:"Calibri", margin:0
});
}
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// SLIDE 11 β SECTION: CARDIAC OUTPUT
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
sectionDivider("Cardiac Output", "Topic 4 Β· Guyton & Hall Ch. 20", P.orange);
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// SLIDE 12 β CARDIAC OUTPUT DETERMINANTS
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
{
const s = pres.addSlide();
bg(s);
titleBar(s, "Cardiac Output β Definition & Determinants", "Guyton Ch.20 β CO = SV Γ HR = ~5 L/min at rest");
// Central formula big box
s.addShape(pres.ShapeType.roundRect, { x:2.5, y:1.3, w:5, h:0.9, fill:{color:P.navy}, line:{color:P.navy}, rectRadius:0.15 });
s.addText("CO = SV Γ HR", { x:2.5, y:1.3, w:5, h:0.9, fontSize:26, bold:true, color:P.white, align:"center", valign:"middle", fontFace:"Courier New", margin:0 });
// Three determinants of SV
const svDets = [
{ title:"PRELOAD", icon:"β¬", desc:"Ventricular filling\n(EDV)", detail:"β Preload β β SV\n(Frank-Starling Law)", col:P.blue },
{ title:"AFTERLOAD", icon:"β¬", desc:"Resistance to ejection\n(Aortic pressure)", detail:"β Afterload β β SV\n(β BP β harder pumping)", col:P.red },
{ title:"CONTRACTILITY", icon:"πͺ", desc:"Intrinsic myocardial\nstrength (inotropy)", detail:"β Inotropy β β SV\n(Adrenaline, digoxin)", col:P.green },
];
svDets.forEach((d, i) => {
const x = 0.3 + i * 3.25;
s.addShape(pres.ShapeType.roundRect, { x, y:2.4, w:3.1, h:2.8, fill:{color:d.col+"15"}, line:{color:d.col, pt:2}, rectRadius:0.15 });
s.addShape(pres.ShapeType.ellipse, { x:x+1.1, y:2.38, w:0.9, h:0.65, fill:{color:d.col}, line:{color:d.col} });
s.addText(d.icon, { x:x+1.1, y:2.38, w:0.9, h:0.65, fontSize:13, align:"center", valign:"middle", fontFace:"Calibri", margin:0 });
s.addText(d.title, { x:x+0.1, y:3.08, w:2.9, h:0.42, fontSize:14, bold:true, color:d.col, align:"center", fontFace:"Calibri", margin:0 });
s.addText(d.desc, { x:x+0.1, y:3.52, w:2.9, h:0.6, fontSize:11, color:P.dark, align:"center", fontFace:"Calibri", italic:true, margin:0 });
s.addShape(pres.ShapeType.rect, { x:x+0.3, y:4.15, w:2.5, h:0.04, fill:{color:d.col+"77"} });
s.addText(d.detail, { x:x+0.1, y:4.22, w:2.9, h:0.72, fontSize:11, color:d.col, align:"center", fontFace:"Calibri", bold:true, margin:0 });
});
// Normal values strip
s.addShape(pres.ShapeType.rect, { x:0, y:5.28, w:"100%", h:0.345, fill:{color:P.orange+"EE"} });
s.addText("CO=5 L/min | CI=3.2 L/min/mΒ² | SV=70 mL | HR=72 bpm | EDV=120 mL | ESV=50 mL | EF=60%", {
x:0.2, y:5.28, w:9.6, h:0.345, fontSize:12, bold:true, color:P.white, align:"center", valign:"middle", fontFace:"Calibri", margin:0
});
}
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// SLIDE 13 β FRANK-STARLING
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
{
const s = pres.addSlide();
bg(s);
titleBar(s, "Frank-Starling Law of the Heart", "Guyton Ch.20 β 'The more you fill, the more it pumps'");
// Law statement box
s.addShape(pres.ShapeType.roundRect, { x:0.3, y:1.3, w:9.4, h:0.65, fill:{color:P.blue}, line:{color:P.blue}, rectRadius:0.1 });
s.addText("Force of contraction β Initial fibre length (within physiological limits)", {
x:0.3, y:1.3, w:9.4, h:0.65, fontSize:16, bold:true, color:P.white, align:"center", valign:"middle", fontFace:"Calibri", margin:0
});
// Step-by-step chain
const steps = [
{ label:"β Venous Return", col:P.blue },
{ label:"β EDV (Preload)", col:P.blue },
{ label:"β Sarcomere Stretch", col:P.orange },
{ label:"β Actin-Myosin Overlap", col:P.orange },
{ label:"β Crossbridge Formation", col:P.red },
{ label:"β Stroke Volume", col:P.green },
];
steps.forEach((st, i) => {
const x = 0.3 + (i % 3) * 3.2;
const y = 2.2 + Math.floor(i / 3) * 1.4;
s.addShape(pres.ShapeType.roundRect, { x, y, w:3.0, h:0.72, fill:{color:st.col}, line:{color:st.col}, rectRadius:0.1 });
s.addText(st.label, { x, y, w:3.0, h:0.72, fontSize:14, bold:true, color:P.white, align:"center", valign:"middle", fontFace:"Calibri", margin:0 });
// Arrow
if (i % 3 < 2) {
s.addShape(pres.ShapeType.rect, { x:x+3.0, y:y+0.3, w:0.2, h:0.1, fill:{color:P.gray} });
}
});
// Clinical box
s.addShape(pres.ShapeType.roundRect, { x:0.3, y:4.75, w:9.4, h:0.42, fill:{color:P.lgreen}, line:{color:P.green, pt:1.5}, rectRadius:0.08 });
s.addText("Clinical: IV fluids in shock β β preload β β CO | Decompensated HF: over-stretching β β contractility (descending limb)", {
x:0.4, y:4.75, w:9.2, h:0.42, fontSize:11, color:P.green, bold:true, fontFace:"Calibri", valign:"middle", margin:0
});
s.addShape(pres.ShapeType.rect, { x:0, y:5.28, w:"100%", h:0.345, fill:{color:P.lgray} });
s.addText("GK Pal: 'The heart pumps all the blood that comes to it' | Both ventricles pump equal volumes via Frank-Starling", {
x:0.2, y:5.3, w:9.6, h:0.3, fontSize:10, color:P.gray, italic:true, fontFace:"Calibri", margin:0
});
}
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// SLIDE 14 β SECTION: REGULATION
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
sectionDivider("Autoregulation & Venous Return", "Topic 5 Β· Guyton & Hall Ch. 17, 20", P.purple);
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// SLIDE 15 β AUTOREGULATION
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
{
const s = pres.addSlide();
bg(s);
titleBar(s, "Autoregulation of Blood Flow", "Guyton Ch.17 β Each tissue controls its own blood supply");
s.addShape(pres.ShapeType.roundRect, { x:0.3, y:1.3, w:9.4, h:0.65, fill:{color:P.purple}, line:{color:P.purple}, rectRadius:0.1 });
s.addText("Autoregulation: Maintain CONSTANT flow despite changes in arterial pressure (70β175 mmHg)", {
x:0.3, y:1.3, w:9.4, h:0.65, fontSize:14, bold:true, color:P.white, align:"center", valign:"middle", fontFace:"Calibri", margin:0
});
// Two mechanisms
s.addShape(pres.ShapeType.roundRect, { x:0.3, y:2.1, w:4.5, h:2.5, fill:{color:P.lpurple}, line:{color:P.purple, pt:1.5}, rectRadius:0.12 });
s.addText("MYOGENIC THEORY", { x:0.3, y:2.15, w:4.5, h:0.4, fontSize:14, bold:true, color:P.purple, align:"center", fontFace:"Calibri", margin:0 });
const myoSteps = ["β Arterial pressure", "β β Wall stretch", "β Smooth muscle contracts", "β Vasoconstriction", "β β Flow back to normal"];
myoSteps.forEach((st, i) => {
s.addText((i===0?"":" ") + st, { x:0.45, y:2.62 + i*0.37, w:4.2, h:0.34, fontSize:12, color:P.dark, fontFace:"Calibri", margin:0 });
});
s.addShape(pres.ShapeType.roundRect, { x:5.2, y:2.1, w:4.5, h:2.5, fill:{color:P.lyellow}, line:{color:P.yellow, pt:1.5}, rectRadius:0.12 });
s.addText("METABOLIC THEORY", { x:5.2, y:2.15, w:4.5, h:0.4, fontSize:14, bold:true, color:P.orange, align:"center", fontFace:"Calibri", margin:0 });
const metSteps = ["β Tissue metabolism", "β β Oβ, β COβ, β HβΊ, β Adenosine", "β Local vasodilators released", "β Vasodilation", "β β Flow to meet demand"];
metSteps.forEach((st, i) => {
s.addText((i===0?"":" ") + st, { x:5.35, y:2.62 + i*0.37, w:4.2, h:0.34, fontSize:12, color:P.dark, fontFace:"Calibri", margin:0 });
});
// Organs
pill(s, 0.3, 4.75, 1.8, 0.4, "π§ Brain", P.purple, P.white);
pill(s, 2.2, 4.75, 1.8, 0.4, "β€οΈ Heart", P.red, P.white);
pill(s, 4.1, 4.75, 1.8, 0.4, "π« Kidney", P.blue, P.white);
pill(s, 6.0, 4.75, 1.8, 0.4, "πͺ Muscle", P.green, P.white);
pill(s, 7.9, 4.75, 1.8, 0.4, "β Strong", P.orange, P.white);
s.addShape(pres.ShapeType.rect, { x:0, y:5.28, w:"100%", h:0.345, fill:{color:P.lgray} });
s.addText("Critical closing pressure: below this, vessels collapse | Sympathetic vasoconstrictors overridden by autoregulation within hours", {
x:0.2, y:5.3, w:9.6, h:0.3, fontSize:10, color:P.gray, italic:true, fontFace:"Calibri", margin:0
});
}
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// SLIDE 16 β SECTION: CAPILLARY EXCHANGE
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
sectionDivider("Capillary Exchange & Starling Forces", "Topic 6 Β· Guyton & Hall Ch. 16", "059669");
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// SLIDE 17 β STARLING FORCES
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
{
const s = pres.addSlide();
bg(s);
titleBar(s, "Starling Forces β Capillary Exchange", "Guyton Ch.16 β Filtration vs Absorption at the capillary");
// Formula
s.addShape(pres.ShapeType.roundRect, { x:0.3, y:1.3, w:9.4, h:0.8, fill:{color:P.green+"CC"}, line:{color:P.green}, rectRadius:0.12 });
s.addText("Net Filtration = (Pc + Οi) β (Pi + Οc)", {
x:0.3, y:1.3, w:9.4, h:0.8, fontSize:22, bold:true, color:P.white, align:"center", valign:"middle", fontFace:"Courier New", margin:0
});
// Four forces grid
const forces = [
{ name:"Pc", full:"Capillary Hydrostatic Pressure", val:"Arterial end: 32 mmHg\nVenous end: 15 mmHg", dir:"FAVOURS FILTRATION", col:P.red },
{ name:"Οc", full:"Plasma Oncotic Pressure", val:"~28 mmHg\n(Albumin is key)", dir:"OPPOSES FILTRATION", col:P.blue },
{ name:"Pi", full:"Interstitial Hydrostatic Pressure", val:"~β3 mmHg\n(slightly negative)", dir:"FAVOURS FILTRATION", col:P.orange },
{ name:"Οi", full:"Interstitial Oncotic Pressure", val:"~8 mmHg\n(lymph proteins)", dir:"OPPOSES FILTRATION", col:P.purple },
];
forces.forEach((f, i) => {
const x = 0.3 + (i % 2) * 4.7;
const y = 2.3 + Math.floor(i / 2) * 1.35;
s.addShape(pres.ShapeType.roundRect, { x, y, w:4.4, h:1.15, fill:{color:f.col+"18"}, line:{color:f.col, pt:1.5}, rectRadius:0.1 });
s.addShape(pres.ShapeType.roundRect, { x:x+0.1, y:y+0.12, w:0.5, h:0.85, fill:{color:f.col}, line:{color:f.col}, rectRadius:0.07 });
s.addText(f.name, { x:x+0.1, y:y+0.12, w:0.5, h:0.85, fontSize:16, bold:true, color:P.white, align:"center", valign:"middle", fontFace:"Courier New", margin:0 });
s.addText(f.full, { x:x+0.7, y:y+0.08, w:3.6, h:0.3, fontSize:11, bold:true, color:f.col, fontFace:"Calibri", margin:0 });
s.addText(f.val, { x:x+0.7, y:y+0.38, w:3.6, h:0.45, fontSize:11, color:P.dark, fontFace:"Calibri", margin:0 });
pill(s, x+0.7, y+0.84, 3.4, 0.24, f.dir, f.col, P.white);
});
s.addShape(pres.ShapeType.rect, { x:0, y:5.28, w:"100%", h:0.345, fill:{color:P.lgray} });
s.addText("Oedema causes: βPc (heart failure) | βΟc (nephrotic syndrome, cirrhosis) | β Permeability (sepsis) | Lymph block (filariasis)", {
x:0.2, y:5.3, w:9.6, h:0.3, fontSize:10, color:P.gray, italic:true, fontFace:"Calibri", margin:0
});
}
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// SLIDE 18 β NORMAL VALUES TABLE
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
{
const s = pres.addSlide();
bg(s);
titleBar(s, "Normal Haemodynamic Values β Quick Reference", "Memorise these for MBBS theory & viva examinations");
const headers = [
{ text:"Parameter", options:{bold:true, color:P.white, fill:P.navy, fontSize:13, align:"center"} },
{ text:"Normal Value", options:{bold:true, color:P.white, fill:P.navy, fontSize:13, align:"center"} },
{ text:"Unit", options:{bold:true, color:P.white, fill:P.navy, fontSize:13, align:"center"} },
{ text:"Clinical Note", options:{bold:true, color:P.white, fill:P.navy, fontSize:13, align:"center"} },
];
const rows = [
["Cardiac Output (CO)", "5β6", "L/min", "β exercise, fever, anaemia"],
["Cardiac Index (CI)", "3.2", "L/min/mΒ²", "Corrects CO for body size"],
["Stroke Volume (SV)", "70", "mL/beat", "CO = SV Γ HR"],
["Heart Rate (HR)", "60β100", "beats/min", "SNS β HR; PNS β HR"],
["Systolic BP", "120", "mmHg", "< 90 = hypotension"],
["Diastolic BP", "80", "mmHg", "> 90 = HTN Stage 1"],
["MAP", "~93", "mmHg", "DBP + β
Pulse Pressure"],
["TPR (Total Peripheral R)", "~1", "PRU", "Arterioles are the key"],
["Pulmonary VR", "~0.14", "PRU", "1/7th of systemic"],
["Blood Viscosity", "3β4Γ", "(relative to water)", "β in polycythaemia"],
];
const rowColors = ["EBF5FF", "F0FFF4", "FFF7ED", "F5F3FF", "FEF9C3",
"EBF5FF", "F0FFF4", "FFF7ED", "F5F3FF", "FEF9C3"];
const tableData = [
headers.map(h => h),
...rows.map((row, ri) =>
row.map((cell, ci) => ({
text: cell,
options: {
color: P.dark, fill: rowColors[ri], fontSize: 11.5, align: ci === 0 ? "left" : "center",
bold: ci === 1
}
}))
)
];
s.addTable(tableData, {
x:0.3, y:1.3, w:9.4, h:4.1,
border:{pt:0.5, color:"D1D5DB"},
fontFace:"Calibri",
});
s.addShape(pres.ShapeType.rect, { x:0, y:5.28, w:"100%", h:0.345, fill:{color:P.lgray} });
s.addText("PRU = Peripheral Resistance Unit | Values from Guyton & Hall, Textbook of Medical Physiology 14th Ed.", {
x:0.2, y:5.3, w:9.6, h:0.3, fontSize:10, color:P.gray, italic:true, fontFace:"Calibri", margin:0
});
}
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// SLIDE 19 β CLINICAL CORRELATIONS
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
sectionDivider("Clinical Correlations", "Topic 7 Β· Applying Haemodynamics", "DC2626");
{
const s = pres.addSlide();
bg(s);
titleBar(s, "Haemodynamics in Clinical Practice", "MAP = CO Γ TPR β the equation behind every cardiovascular disease");
const cases = [
{ title:"Hypertension", icon:"π", problem:"β TPR (arteriolar constriction)", consequence:"β MAP β LV hypertrophy β HF", rx:"ACE inhibitors, CCBs β β TPR", col:P.red },
{ title:"Cardiogenic Shock", icon:"π", problem:"ββ CO (pump failure)", consequence:"β MAP β end-organ damage", rx:"Inotropes, fluid resus, IABP", col:P.orange },
{ title:"Anaemia", icon:"π©Έ", problem:"β viscosity, β Oβ carrying", consequence:"β CO (compensatory high-output)", rx:"Treat cause; transfusion if severe", col:P.blue },
{ title:"Haemorrhage", icon:"β‘", problem:"β Blood volume β β VR β β CO", consequence:"β MAP β Baroreceptor reflex β β HR + β TPR", rx:"IV fluids, blood transfusion", col:P.purple },
{ title:"Heart Failure", icon:"π", problem:"β SV β Frank-Starling fails", consequence:"β LVEDP β pulmonary oedema", rx:"Diuretics (β preload), ACEi (β afterload)", col:P.green },
{ title:"Polycythaemia", icon:"π¬", problem:"β Haematocrit β β viscosity", consequence:"β TPR β β cardiac work", rx:"Venesection; hydroxycarbamide", col:P.yellow },
];
cases.forEach((c, i) => {
const x = 0.3 + (i % 3) * 3.25;
const y = 1.3 + Math.floor(i / 3) * 2.0;
s.addShape(pres.ShapeType.roundRect, { x, y, w:3.1, h:1.7, fill:{color:c.col+"12"}, line:{color:c.col, pt:1.5}, rectRadius:0.12 });
s.addText(c.icon + " " + c.title, { x:x+0.1, y:y+0.06, w:2.9, h:0.38, fontSize:14, bold:true, color:c.col, fontFace:"Calibri", margin:0 });
s.addText("Problem: " + c.problem, { x:x+0.12, y:y+0.44, w:2.86, h:0.3, fontSize:10, color:P.dark, fontFace:"Calibri", margin:0 });
s.addText("Effect: " + c.consequence, { x:x+0.12, y:y+0.74, w:2.86, h:0.35, fontSize:10, color:P.dark, fontFace:"Calibri", margin:0 });
s.addText("Rx: " + c.rx, { x:x+0.12, y:y+1.08, w:2.86, h:0.5, fontSize:10, bold:true, color:c.col, fontFace:"Calibri", margin:0 });
});
s.addShape(pres.ShapeType.rect, { x:0, y:5.28, w:"100%", h:0.345, fill:{color:P.lgray} });
s.addText("GK Pal: 'Understanding Ohm's Law (MAP = CO Γ TPR) is the key to cardiovascular pharmacology'", {
x:0.2, y:5.3, w:9.6, h:0.3, fontSize:10, color:P.gray, italic:true, fontFace:"Calibri", margin:0
});
}
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// SLIDE 20 β MNEMONICS BOARD
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
{
const s = pres.addSlide();
bg(s);
titleBar(s, "Mnemonics & Exam Revision Board", "Memorise these before your MBBS viva and theory papers");
const mnems = [
{ title:"Poiseuille rβ΄ Rule", body:"Double r β 16Γ flow\n4Γ r β 256Γ flow\nFlow β rβ΄", col:P.orange },
{ title:"Ohm's Law", body:"MAP = CO Γ TPR\nCO = MAP Γ· TPR\nQ = ΞP Γ· R", col:P.blue },
{ title:"MAP Formula", body:"MAP = DBP + β
PP\nPP = SBP β DBP\nNormal MAP β 93", col:P.red },
{ title:"Frank-Starling", body:"More FILL\nβ More FORCE\nβ More FLOW", col:P.green },
{ title:"Series vs Parallel", body:"Series β R adds up\nParallel β R decreases\nOrgans = Parallel", col:P.purple },
{ title:"Oedema Causes", body:"β Pc (HF)\nβ Οc (Nephrotic)\nβ Perm (Sepsis)", col:"059669" },
];
mnems.forEach((m, i) => {
const x = 0.3 + (i % 3) * 3.25;
const y = 1.3 + Math.floor(i / 3) * 2.05;
s.addShape(pres.ShapeType.roundRect, { x, y, w:3.1, h:1.85, fill:{color:m.col}, line:{color:m.col}, rectRadius:0.18 });
s.addShape(pres.ShapeType.roundRect, { x:x+0.1, y:y+0.08, w:2.9, h:0.45, fill:{color:P.white+"33"}, line:{color:P.white+"00"}, rectRadius:0.08 });
s.addText(m.title, { x:x+0.1, y:y+0.08, w:2.9, h:0.45, fontSize:14, bold:true, color:P.white, align:"center", valign:"middle", fontFace:"Calibri", margin:0 });
s.addText(m.body, { x:x+0.12, y:y+0.62, w:2.86, h:1.1, fontSize:13, bold:true, color:P.white, align:"center", valign:"top", fontFace:"Courier New", margin:0 });
});
}
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// SLIDE 21 β SUMMARY
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
{
const s = pres.addSlide();
bg(s);
titleBar(s, "Summary β 10 Things You Must Know", "Guyton & Hall Β· GK Pal Β· MBBS 1st Year Physiology");
const pts = [
["1", "Blood flow = ~5 L/min = Cardiac Output at rest", P.blue],
["2", "Poiseuille's Law: Flow β rβ΄ β vessel radius is the most important factor", P.red],
["3", "Ohm's Law of circulation: MAP = CO Γ TPR", P.orange],
["4", "Arterioles contribute ~β
of total peripheral resistance", P.purple],
["5", "Laminar flow is silent; Turbulent flow creates bruits", P.green],
["6", "Frank-Starling: β preload β β SV (within limits)", P.blue],
["7", "Series resistance ADDS; parallel resistance DECREASES total R", P.red],
["8", "Autoregulation maintains organ flow between MAP 70β175 mmHg", P.purple],
["9", "Starling forces: oedema when filtration > lymphatic drainage", P.green],
["10","Haematocrit β viscosity β TPR β polycythaemia strains the heart", P.orange],
];
pts.forEach((pt, i) => {
const x = 0.3 + (i < 5 ? 0 : 4.9);
const y = 1.3 + (i % 5) * 0.8;
s.addShape(pres.ShapeType.roundRect, { x, y, w:0.45, h:0.6, fill:{color:pt[2]}, line:{color:pt[2]}, rectRadius:0.07 });
s.addText(pt[0], { x, y, w:0.45, h:0.6, fontSize:14, bold:true, color:P.white, align:"center", valign:"middle", fontFace:"Calibri", margin:0 });
s.addText(pt[1], { x:x+0.55, y:y+0.05, w:4.1, h:0.52, fontSize:12, color:P.dark, fontFace:"Calibri", valign:"middle" });
});
s.addShape(pres.ShapeType.rect, { x:0, y:5.28, w:"100%", h:0.345, fill:{color:P.navy} });
s.addText("Guyton AC, Hall JE. Textbook of Medical Physiology 14th Ed. | Pal GK, Pal P. Textbook of Medical Physiology 3rd Ed.", {
x:0.2, y:5.3, w:9.6, h:0.3, fontSize:10, color:"93C5FD", italic:true, fontFace:"Calibri", margin:0, align:"center"
});
}
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// SLIDE 22 β THANK YOU
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
{
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:P.navy} });
s.addShape(pres.ShapeType.ellipse, { x:6, y:-2, w:7, h:7, fill:{color:P.blue+"33"}, line:{color:P.blue+"33"} });
s.addShape(pres.ShapeType.ellipse, { x:7.5, y:2, w:4, h:4, fill:{color:P.blue+"22"}, line:{color:P.blue+"22"} });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:0.1, fill:{color:P.blue} });
s.addShape(pres.ShapeType.rect, { x:0, y:5.525, w:"100%", h:0.1, fill:{color:P.green} });
s.addText("Thank You!", {
x:0.5, y:1.0, w:8, h:1.5, fontSize:56, bold:true, color:P.white, align:"center", fontFace:"Calibri"
});
s.addText("Questions & Discussion Welcome", {
x:0.5, y:2.6, w:9, h:0.6, fontSize:22, color:"93C5FD", italic:true, align:"center", fontFace:"Calibri"
});
s.addShape(pres.ShapeType.rect, { x:3.0, y:3.35, w:4, h:0.07, fill:{color:P.green} });
s.addText("References", {
x:0.5, y:3.55, w:9, h:0.38, fontSize:14, bold:true, color:P.white, align:"center", fontFace:"Calibri"
});
s.addText(
"1. Guyton AC, Hall JE. Textbook of Medical Physiology. 14th Ed. Elsevier, 2021.\n" +
"2. Pal GK, Pal P. Textbook of Medical Physiology. 3rd Ed. Orient Blackswan.\n" +
"3. Costanzo LS. Physiology. 7th Ed. Elsevier.",
{
x:0.5, y:4.0, w:9, h:1.1, fontSize:12, color:"D1D5DB", italic:true,
fontFace:"Calibri", align:"center", lineSpacingMultiple:1.4
}
);
}
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// WRITE
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
pres.writeFile({ fileName: "/home/daytona/workspace/haemodynamics-pptx/Haemodynamics_v2.pptx" })
.then(() => console.log("β
Done: Haemodynamics_v2.pptx"))
.catch(e => { console.error("β", e); process.exit(1); });
Not make a presentation just give me content in written form