Craeye a mind map that cannot be forgeteb for antiadrenergic drugs

Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Running Command

ls -la /home/daytona/workspace/ 2>/dev/null && mkdir -p /home/daytona/workspace/antiadrenergic-mindmap

Writing File

~/antiadrenergic-mindmap/build.js

const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_WIDE"; // 13.3" x 7.5"
pres.title = "Antiadrenergic Drugs Mind Map";

// ─── COLOUR PALETTE ───────────────────────────────────────────────────────────
const C = {
  bg:        "0D1117",   // near-black background
  bgCard:    "161B22",   // card background
  accent:    "58A6FF",   // vivid blue – central hub
  alpha:     "FF7B72",   // coral-red – alpha blockers
  beta:      "3FB950",   // green – beta blockers
  central:   "D2A8FF",   // lavender – centrally acting
  pregang:   "FFA657",   // amber – ganglionic / presynaptic
  text:      "E6EDF3",   // light text
  textDim:   "8B949E",   // dim secondary text
  gold:      "F8E45C",   // mnemonic highlights
  white:     "FFFFFF",
};

// ─── HELPER ───────────────────────────────────────────────────────────────────
function pill(slide, txt, x, y, w, h, fillColor, textColor, fontSize = 9, bold = false) {
  slide.addShape(pres.ShapeType.roundRect, {
    x, y, w, h,
    fill: { color: fillColor },
    line: { color: fillColor },
    rectRadius: 0.08,
  });
  slide.addText(txt, {
    x, y, w, h,
    fontSize, color: textColor, bold,
    align: "center", valign: "middle", margin: 4,
  });
}

function connector(slide, x1, y1, x2, y2, color = "4D5662") {
  slide.addShape(pres.ShapeType.line, {
    x: x1, y: y1, w: x2 - x1, h: y2 - y1,
    line: { color, width: 1.2, dashType: "solid" },
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 1 β€” MASTER OVERVIEW MIND MAP
// ══════════════════════════════════════════════════════════════════════════════
{
  const slide = pres.addSlide();

  // ── Background ──────────────────────────────────────────────────────────────
  slide.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: 13.3, h: 7.5,
    fill: { color: C.bg },
    line: { color: C.bg },
  });

  // ── Title banner ────────────────────────────────────────────────────────────
  slide.addShape(pres.ShapeType.rect, {
    x: 3.5, y: 0.08, w: 6.3, h: 0.6,
    fill: { color: "161B22" },
    line: { color: C.accent, width: 1.5 },
  });
  slide.addText("ANTIADRENERGIC DRUGS  β€”  MASTER MIND MAP", {
    x: 3.5, y: 0.08, w: 6.3, h: 0.6,
    fontSize: 13, color: C.accent, bold: true,
    align: "center", valign: "middle",
  });

  // ── Centre hub ──────────────────────────────────────────────────────────────
  const cx = 6.65, cy = 3.75;
  slide.addShape(pres.ShapeType.ellipse, {
    x: cx - 0.85, y: cy - 0.42, w: 1.7, h: 0.84,
    fill: { color: C.accent },
    line: { color: C.white, width: 1.5 },
  });
  slide.addText("ANTI-\nADRENERGIC", {
    x: cx - 0.85, y: cy - 0.42, w: 1.7, h: 0.84,
    fontSize: 10, color: C.bg, bold: true,
    align: "center", valign: "middle",
  });

  // ─────────────────────────────────────────────────────────────────────────
  // BRANCH 1 β€” Ξ± BLOCKERS  (top-left)
  // ─────────────────────────────────────────────────────────────────────────
  pill(slide, "Ξ±-BLOCKERS", 0.25, 0.78, 2.0, 0.45, C.alpha, C.white, 11, true);
  connector(slide, 2.25, 1.0, cx - 0.85, cy - 0.1, C.alpha);

  // Non-selective
  pill(slide, "Non-Selective  Ξ±1+Ξ±2", 0.15, 1.42, 2.2, 0.36, "3D1A19", C.alpha, 8.5, true);
  slide.addText([
    { text: "Phentolamine", options: { breakLine: true } },
    { text: "Phenoxybenzamine (irreversible)", options: { breakLine: true } },
  ], { x: 0.2, y: 1.84, w: 2.1, h: 0.55, fontSize: 8, color: C.text });

  // Selective Ξ±1
  pill(slide, "Selective  Ξ±1  Blockers", 0.15, 2.46, 2.2, 0.36, "3D1A19", C.alpha, 8.5, true);
  slide.addText([
    { text: "Prazosin  (prototype, 1st gen)", options: { breakLine: true } },
    { text: "Terazosin, Doxazosin (long-acting)", options: { breakLine: true } },
    { text: "Tamsulosin, Alfuzosin (uroselective)", options: { breakLine: true } },
    { text: "Silodosin (most uroselective)", options: {} },
  ], { x: 0.2, y: 2.88, w: 2.1, h: 0.72, fontSize: 7.8, color: C.text });

  // Uses
  pill(slide, "Uses", 0.15, 3.68, 1.1, 0.3, "2A1717", C.gold, 8, true);
  slide.addText("HTN β€’ BPH β€’ Pheochromocytoma\nRaynaud β€’ PTSD (prazosin)", {
    x: 1.32, y: 3.68, w: 1.1, h: 0.42, fontSize: 7.5, color: C.textDim,
  });

  // ADRs
  pill(slide, "ADRs", 0.15, 4.18, 1.1, 0.3, "2A1717", C.gold, 8, true);
  slide.addText("1st-dose syncope β€’ Reflex tachycardia\nNasal congestion β€’ Sexual dysfunction", {
    x: 1.32, y: 4.18, w: 1.1, h: 0.42, fontSize: 7.5, color: C.textDim,
  });

  // ─────────────────────────────────────────────────────────────────────────
  // BRANCH 2 β€” Ξ² BLOCKERS  (top-right)
  // ─────────────────────────────────────────────────────────────────────────
  pill(slide, "Ξ²-BLOCKERS", 11.1, 0.78, 2.0, 0.45, C.beta, C.white, 11, true);
  connector(slide, 11.1, 1.0, cx + 0.85, cy - 0.1, C.beta);

  // Non-selective
  pill(slide, "Non-Selective  Ξ²1+Ξ²2", 11.0, 1.42, 2.2, 0.36, "162618", C.beta, 8.5, true);
  slide.addText("Propranolol, Nadolol, Timolol\nPindolol (+ ISA)", {
    x: 11.05, y: 1.84, w: 2.15, h: 0.42, fontSize: 8, color: C.text,
  });

  // Cardioselective
  pill(slide, "Cardioselective  Ξ²1", 11.0, 2.34, 2.2, 0.36, "162618", C.beta, 8.5, true);
  slide.addText("Metoprolol, Atenolol\nBisoprolol, Esmolol (IV, ultra-short)\nBetaxolol", {
    x: 11.05, y: 2.76, w: 2.15, h: 0.5, fontSize: 8, color: C.text,
  });

  // Mixed Ξ±+Ξ²
  pill(slide, "Mixed Ξ±+Ξ²  Blockers", 11.0, 3.34, 2.2, 0.36, "162618", C.beta, 8.5, true);
  slide.addText("Labetalol (IV in HTN emergency)\nCarvedilol (HF, anti-oxidant)", {
    x: 11.05, y: 3.76, w: 2.15, h: 0.4, fontSize: 8, color: C.text,
  });

  // Uses
  pill(slide, "Uses", 11.0, 4.24, 1.1, 0.3, "0E1F0E", C.gold, 8, true);
  slide.addText("HTN β€’ Angina β€’ MI (mortality ↓)\nHF β€’ Arrhythmia β€’ Glaucoma\nHyperthyroidism β€’ Migraine prophylaxis", {
    x: 12.15, y: 4.24, w: 1.0, h: 0.55, fontSize: 7.5, color: C.textDim,
  });

  // ADRs
  pill(slide, "ADRs", 11.0, 4.88, 1.1, 0.3, "0E1F0E", C.gold, 8, true);
  slide.addText("Bronchoconstriction (Ξ²2)\nMask hypoglycaemia\nFatigue β€’ Cold extremities\nAbrupt withdrawal β†’ rebound", {
    x: 12.15, y: 4.88, w: 1.0, h: 0.55, fontSize: 7.5, color: C.textDim,
  });

  // ─────────────────────────────────────────────────────────────────────────
  // BRANCH 3 β€” CENTRALLY ACTING  (bottom-left)
  // ─────────────────────────────────────────────────────────────────────────
  pill(slide, "CENTRALLY ACTING", 0.2, 5.65, 2.4, 0.45, C.central, C.bg, 10, true);
  connector(slide, 2.6, 5.88, cx - 0.85, cy + 0.42, C.central);

  slide.addText([
    { text: "Clonidine", options: { bold: true, color: C.central, breakLine: true } },
    { text: "Ξ±2 agonist ↓ central sympathetic outflow", options: { breakLine: true } },
    { text: "Uses: HTN, opioid withdrawal, ADHD", options: { breakLine: true } },
    { text: "ADR: Rebound HTN on withdrawal", options: { breakLine: true, color: "FF6B6B" } },
  ], { x: 0.2, y: 6.16, w: 2.5, h: 0.9, fontSize: 7.8, color: C.textDim });

  slide.addText([
    { text: "Methyldopa", options: { bold: true, color: C.central, breakLine: true } },
    { text: "β†’ Ξ±-methylnorepinephrine (false TX)", options: { breakLine: true } },
    { text: "Drug of choice: Pregnancy HTN", options: { breakLine: true } },
    { text: "ADR: Haemolytic anaemia, sedation", options: { color: "FF6B6B" } },
  ], { x: 2.85, y: 6.16, w: 2.4, h: 0.9, fontSize: 7.8, color: C.textDim });

  // ─────────────────────────────────────────────────────────────────────────
  // BRANCH 4 β€” GANGLIONIC + PRESYNAPTIC  (bottom-right)
  // ─────────────────────────────────────────────────────────────────────────
  pill(slide, "GANGLIONIC / PRESYNAPTIC", 10.4, 5.65, 2.8, 0.45, C.pregang, C.bg, 10, true);
  connector(slide, 10.4, 5.88, cx + 0.85, cy + 0.42, C.pregang);

  slide.addText([
    { text: "Reserpine", options: { bold: true, color: C.pregang, breakLine: true } },
    { text: "Depletes NE/DA/5-HT from vesicles", options: { breakLine: true } },
    { text: "ADR: Depression, Parkinsonism, Sedation", options: { breakLine: true, color: "FF6B6B" } },
  ], { x: 10.4, y: 6.16, w: 2.4, h: 0.75, fontSize: 7.8, color: C.textDim });

  slide.addText([
    { text: "Guanethidine", options: { bold: true, color: C.pregang, breakLine: true } },
    { text: "Blocks NE release from sympathetic terminals", options: { breakLine: true } },
    { text: "ADR: Orthostatic hypotension, diarrhoea", options: { color: "FF6B6B" } },
  ], { x: 10.4, y: 6.92, w: 2.7, h: 0.52, fontSize: 7.8, color: C.textDim });

  // ─────────────────────────────────────────────────────────────────────────
  // MNEMONIC STRIP (centre-bottom)
  // ─────────────────────────────────────────────────────────────────────────
  slide.addShape(pres.ShapeType.rect, {
    x: 3.5, y: 6.86, w: 6.3, h: 0.55,
    fill: { color: "1C2130" },
    line: { color: C.gold, width: 1 },
  });
  slide.addText([
    { text: "✦ MNEMONIC  ", options: { bold: true, color: C.gold } },
    { text: '"A', options: { bold: true, color: C.alpha } },
    { text: "lpha blocks β†’ ", options: { color: C.text } },
    { text: "A", options: { bold: true, color: C.gold } },
    { text: "ction on vessels (vasoD) | ", options: { color: C.text } },
    { text: "B", options: { bold: true, color: C.beta } },
    { text: "eta blocks β†’ ", options: { color: C.text } },
    { text: "B", options: { bold: true, color: C.gold } },
    { text: 'eat & BP ↓"', options: { color: C.text } },
  ], {
    x: 3.5, y: 6.86, w: 6.3, h: 0.55,
    fontSize: 9, align: "center", valign: "middle",
  });

  // ─────────────────────────────────────────────────────────────────────────
  // Legend dots
  // ─────────────────────────────────────────────────────────────────────────
  const legend = [
    [C.alpha, "Ξ±-Blockers"],
    [C.beta, "Ξ²-Blockers"],
    [C.central, "Centrally Acting"],
    [C.pregang, "Ganglionic/Presynaptic"],
  ];
  legend.forEach(([col, lbl], i) => {
    const lx = 3.6 + i * 1.58;
    slide.addShape(pres.ShapeType.ellipse, { x: lx, y: 0.83, w: 0.15, h: 0.15, fill: { color: col }, line: { color: col } });
    slide.addText(lbl, { x: lx + 0.2, y: 0.8, w: 1.35, h: 0.22, fontSize: 7.5, color: C.textDim });
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 2 β€” Ξ²-BLOCKERS  DEEP-DIVE
// ══════════════════════════════════════════════════════════════════════════════
{
  const slide = pres.addSlide();
  slide.addShape(pres.ShapeType.rect, { x:0, y:0, w:13.3, h:7.5, fill:{color:C.bg}, line:{color:C.bg} });

  // Header
  slide.addShape(pres.ShapeType.rect, { x:0, y:0, w:13.3, h:0.72, fill:{color:C.beta}, line:{color:C.beta} });
  slide.addText("Ξ²-BLOCKERS  β€”  DEEP DIVE", {
    x:0, y:0, w:13.3, h:0.72, fontSize:18, color:C.bg, bold:true, align:"center", valign:"middle",
  });

  // ── Column helper ──────────────────────────────────────────────────────────
  function col(slide, title, x, w, items, titleColor) {
    slide.addShape(pres.ShapeType.rect, { x, y:0.82, w, h:0.38, fill:{color:"1F2933"}, line:{color:titleColor, width:1} });
    slide.addText(title, { x, y:0.82, w, h:0.38, fontSize:9.5, color:titleColor, bold:true, align:"center", valign:"middle" });
    items.forEach(([label, val, accent], idx) => {
      const iy = 1.32 + idx * 0.52;
      slide.addShape(pres.ShapeType.rect, { x, y:iy, w, h:0.46, fill:{color:"161B22"}, line:{color:"2D333B"} });
      slide.addText([
        { text: label + "  ", options: { bold: true, color: accent || titleColor } },
        { text: val, options: { color: C.text } },
      ], { x:x+0.08, y:iy+0.04, w:w-0.16, h:0.38, fontSize:8, valign:"top" });
    });
  }

  col(slide, "NON-SELECTIVE (Ξ²1+Ξ²2)", 0.2, 3.9, [
    ["Propranolol", "Prototype β€’ Lipophilic (crosses BBB)\nMetabolism: Hepatic (high first-pass)", C.beta],
    ["Nadolol", "Long-acting β€’ Hydrophilic\nRenal excretion", C.beta],
    ["Timolol", "Glaucoma (topical) β€’ Used post-MI", C.beta],
    ["Pindolol", "Has ISA (intrinsic sympathomimetic activity)\n→ Less bradycardia", C.beta],
    ["Sotalol", "Class II + III antiarrhythmic\nProlongs QT interval", C.beta],
    ["Carteolol", "Has ISA β€’ Topical glaucoma", C.beta],
  ], C.beta);

  col(slide, "CARDIOSELECTIVE (Ξ²1)", 4.3, 3.9, [
    ["Metoprolol", "Most used β€’ Tartrate (IR) / Succinate (XL)\nFor HF: Succinate only (MERIT-HF trial)", C.beta],
    ["Atenolol", "Hydrophilic β€’ Renal excretion\nNo CNS effects", C.beta],
    ["Bisoprolol", "Highly selective Ξ²1\nFor HF (CIBIS-II trial)", C.beta],
    ["Esmolol", "IV only β€’ Ultra-short tΒ½ 9 min\nIntra-op HTN, SVT", C.beta],
    ["Nebivolol", "Highest β1 selectivity + NO release\n→ Vasodilation", C.beta],
    ["Betaxolol", "Selective Ξ²1 β€’ Topical (glaucoma)", C.beta],
  ], C.beta);

  col(slide, "MIXED Ξ±+Ξ²", 8.4, 2.3, [
    ["Labetalol", "Ξ±1:Ξ² ratio 1:3 (oral) / 1:7 (IV)\nHypertensive emergency in pregnancy", C.beta],
    ["Carvedilol", "Ξ±1+Ξ²1+Ξ²2 + antioxidant\nHF (COPERNICUS trial)", C.beta],
  ], C.beta);

  // Selectivity spectrum
  slide.addShape(pres.ShapeType.rect, { x:8.4, y:2.9, w:2.3, h:0.35, fill:{color:"1C2130"}, line:{color:C.beta, width:1} });
  slide.addText("Ξ²1 SELECTIVITY SPECTRUM", { x:8.4, y:2.9, w:2.3, h:0.35, fontSize:8, color:C.gold, bold:true, align:"center", valign:"middle" });
  slide.addText("Less selective ←→ More selective\nPropranolol < Metoprolol < Bisoprolol < Nebivolol", {
    x:8.4, y:3.3, w:4.7, h:0.55, fontSize:8, color:C.textDim, align:"center",
  });

  // Properties table
  const propX = 0.2, propY = 5.05, propW = 12.9, propH = 0.32;
  slide.addShape(pres.ShapeType.rect, { x:propX, y:propY, w:propW, h:propH, fill:{color:"1F2933"}, line:{color:C.beta} });
  slide.addText("KEY PROPERTIES TO REMEMBER", { x:propX, y:propY, w:propW, h:propH, fontSize:9, color:C.beta, bold:true, align:"center", valign:"middle" });

  const props = [
    ["Lipophilic (CNS effects)", "Propranolol, Metoprolol, Carvedilol, Labetalol"],
    ["Hydrophilic (no CNS)", "Atenolol, Nadolol, Esmolol"],
    ["Has ISA", "Pindolol, Acebutolol, Carteolol"],
    ["Class III also", "Sotalol (↑ QT β†’ torsades risk)"],
    ["Ultra-short tΒ½", "Esmolol (IV, 9 min)"],
    ["Vasodilating Ξ²-blockers", "Nebivolol (NO↑), Carvedilol (Ξ±1 block)"],
  ];
  props.forEach(([k, v], i) => {
    const row = Math.floor(i / 3), colIdx = i % 3;
    const rx = propX + colIdx * 4.3, ry = propY + propH + 0.05 + row * 0.55;
    slide.addShape(pres.ShapeType.rect, { x:rx, y:ry, w:4.25, h:0.48, fill:{color:"161B22"}, line:{color:"2D333B"} });
    slide.addText([
      { text: k + ": ", options: { bold:true, color:C.gold } },
      { text: v, options: { color:C.text } },
    ], { x:rx+0.08, y:ry+0.06, w:4.1, h:0.36, fontSize:8, valign:"middle" });
  });

  // CI / ADR strip
  slide.addShape(pres.ShapeType.rect, { x:0.2, y:7.0, w:12.9, h:0.42, fill:{color:"2D1B1B"}, line:{color:"FF6B6B"} });
  slide.addText([
    { text: "⚠ CONTRAINDICATIONS: ", options:{ bold:true, color:"FF6B6B" } },
    { text: "Asthma/COPD (Ξ²2 block)  β€’  2nd/3rd degree AV block  β€’  Severe bradycardia  β€’  Severe peripheral arterial disease  |  ", options:{ color:C.text } },
    { text: "NEVER stop abruptly!", options:{ bold:true, color:"FF6B6B" } },
  ], { x:0.2, y:7.0, w:12.9, h:0.42, fontSize:8.5, align:"center", valign:"middle" });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 3 β€” Ξ±-BLOCKERS  DEEP-DIVE
// ══════════════════════════════════════════════════════════════════════════════
{
  const slide = pres.addSlide();
  slide.addShape(pres.ShapeType.rect, { x:0, y:0, w:13.3, h:7.5, fill:{color:C.bg}, line:{color:C.bg} });

  // Header
  slide.addShape(pres.ShapeType.rect, { x:0, y:0, w:13.3, h:0.72, fill:{color:C.alpha}, line:{color:C.alpha} });
  slide.addText("Ξ±-BLOCKERS  β€”  DEEP DIVE", {
    x:0, y:0, w:13.3, h:0.72, fontSize:18, color:C.white, bold:true, align:"center", valign:"middle",
  });

  // ── Non-selective panel ────────────────────────────────────────────────────
  slide.addShape(pres.ShapeType.rect, { x:0.2, y:0.82, w:4.0, h:0.38, fill:{color:"2A1717"}, line:{color:C.alpha, width:1} });
  slide.addText("NON-SELECTIVE  Ξ±1 + Ξ±2", { x:0.2, y:0.82, w:4.0, h:0.38, fontSize:10, color:C.alpha, bold:true, align:"center", valign:"middle" });

  const nsData = [
    ["Phentolamine", "Competitive reversible block β€’ Short-acting IV\nDx: Pheochromocytoma (phentolamine test)\nTx: Hypertensive crisis in pheo\nNote: Reflex tachycardia (Ξ±2 block β†’ NE↑)"],
    ["Phenoxybenzamine", "NON-COMPETITIVE (covalent, irreversible)\nLong-acting oral β€’ Pre-op pheo preparation\nNote: Full receptor recovery needs new receptors"],
  ];
  nsData.forEach(([name, desc], i) => {
    const iy = 1.32 + i * 1.45;
    slide.addShape(pres.ShapeType.rect, { x:0.2, y:iy, w:4.0, h:1.35, fill:{color:"1A0F0F"}, line:{color:"4D2020"} });
    slide.addText([
      { text: name + "\n", options: { bold:true, color:C.alpha } },
      { text: desc, options: { color:C.text } },
    ], { x:0.3, y:iy+0.1, w:3.8, h:1.15, fontSize:8.2, valign:"top" });
  });

  // ── Selective Ξ±1 panel ─────────────────────────────────────────────────────
  slide.addShape(pres.ShapeType.rect, { x:4.4, y:0.82, w:5.0, h:0.38, fill:{color:"2A1717"}, line:{color:C.alpha, width:1} });
  slide.addText("SELECTIVE  Ξ±1  BLOCKERS", { x:4.4, y:0.82, w:5.0, h:0.38, fontSize:10, color:C.alpha, bold:true, align:"center", valign:"middle" });

  const selData = [
    ["Prazosin", "1st gen β€’ Prototype\nShort tΒ½ (BID-TID)\nFirst-dose phenomenon (orthostatic hypotension)\nUses: HTN, BPH, Raynaud, PTSD nightmares\nNote: No reflex tachycardia (Ξ±2 intact)"],
    ["Terazosin", "2nd gen β€’ Longer tΒ½ (once daily)\nUses: HTN + BPH"],
    ["Doxazosin", "2nd gen β€’ Longest tΒ½ (once daily)\nAllhat trial: less favoured for HTN alone"],
    ["Tamsulosin", "Highly uroselective (Ξ±1A/Ξ±1D > Ξ±1B)\nBPH first-line (little BP effect)\nComplication: Floppy iris syndrome (cataract surgery!)"],
    ["Alfuzosin", "Uroselective Ξ±1A\nBPH β€’ Less BP drop than prazosin"],
    ["Silodosin", "MOST uroselective Ξ±1A\nBPH β€’ Retrograde ejaculation common"],
  ];
  selData.forEach(([name, desc], i) => {
    const row = Math.floor(i / 2), col2 = i % 2;
    const sx = 4.4 + col2 * 2.5, sy = 1.32 + row * 1.55;
    slide.addShape(pres.ShapeType.rect, { x:sx, y:sy, w:2.4, h:1.45, fill:{color:"1A0F0F"}, line:{color:"4D2020"} });
    slide.addText([
      { text: name + "\n", options: { bold:true, color:C.alpha } },
      { text: desc, options: { color:C.text } },
    ], { x:sx+0.08, y:sy+0.08, w:2.24, h:1.28, fontSize:7.5, valign:"top" });
  });

  // ── Receptor pharmacology panel ────────────────────────────────────────────
  slide.addShape(pres.ShapeType.rect, { x:9.6, y:0.82, w:3.5, h:0.38, fill:{color:"2A1717"}, line:{color:C.alpha, width:1} });
  slide.addText("Ξ±-RECEPTOR PHARMACOLOGY", { x:9.6, y:0.82, w:3.5, h:0.38, fontSize:9, color:C.alpha, bold:true, align:"center", valign:"middle" });

  const recData = [
    ["Ξ±1 (postsynaptic)", "Vasoconstriction (skin, GIT, renal)\nMydriasis β€’ Urethral sphincter contraction"],
    ["Ξ±2 (presynaptic)", "↓ NE release (autoreceptor)\nInhibit insulin release\nPlatelet aggregation"],
    ["Ξ±1 blockade β†’", "Vasodilation (↓ SVR, ↓ BP)\nNasal congestion β€’ Ejaculatory dysfunction"],
    ["Ξ±2 blockade β†’", "↑ NE release β†’ reflex tachycardia\n(Why non-selectives cause more tachycardia)"],
  ];
  recData.forEach(([k, v], i) => {
    const ry = 1.32 + i * 1.15;
    slide.addShape(pres.ShapeType.rect, { x:9.6, y:ry, w:3.5, h:1.05, fill:{color:"1A0F0F"}, line:{color:"4D2020"} });
    slide.addText([
      { text: k + "\n", options: { bold:true, color:C.gold } },
      { text: v, options: { color:C.text } },
    ], { x:9.7, y:ry+0.06, w:3.3, h:0.93, fontSize:7.8, valign:"top" });
  });

  // ── Uses summary ───────────────────────────────────────────────────────────
  slide.addShape(pres.ShapeType.rect, { x:0.2, y:5.62, w:13.1, h:0.3, fill:{color:"1F2933"}, line:{color:C.alpha} });
  slide.addText("CLINICAL USES SUMMARY", { x:0.2, y:5.62, w:13.1, h:0.3, fontSize:9, color:C.alpha, bold:true, align:"center", valign:"middle" });

  const uses = [
    ["Hypertension", "Prazosin, Terazosin, Doxazosin\n(not first-line per JNC)"],
    ["BPH", "Tamsulosin, Alfuzosin,\nSilodosin (uroselective)"],
    ["Pheo crisis", "Phentolamine IV\n(then phenoxybenzamine pre-op)"],
    ["Raynaud's", "Prazosin (off-label)"],
    ["PTSD nightmares", "Prazosin (blocks Ξ±1 in brain)"],
  ];
  uses.forEach(([title2, desc], i) => {
    const ux = 0.2 + i * 2.62, uy = 5.98;
    slide.addShape(pres.ShapeType.rect, { x:ux, y:uy, w:2.55, h:1.4, fill:{color:"1A0F0F"}, line:{color:"4D2020"} });
    slide.addText([
      { text: title2 + "\n", options: { bold:true, color:C.alpha } },
      { text: desc, options: { color:C.text } },
    ], { x:ux+0.08, y:uy+0.08, w:2.39, h:1.24, fontSize:8, valign:"top", align:"center" });
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 4 β€” CENTRALLY ACTING + PRESYNAPTIC
// ══════════════════════════════════════════════════════════════════════════════
{
  const slide = pres.addSlide();
  slide.addShape(pres.ShapeType.rect, { x:0, y:0, w:13.3, h:7.5, fill:{color:C.bg}, line:{color:C.bg} });

  // Split header
  slide.addShape(pres.ShapeType.rect, { x:0, y:0, w:6.65, h:0.72, fill:{color:C.central}, line:{color:C.central} });
  slide.addText("CENTRALLY ACTING  ANTIADRENERGICS", { x:0, y:0, w:6.65, h:0.72, fontSize:13, color:C.bg, bold:true, align:"center", valign:"middle" });
  slide.addShape(pres.ShapeType.rect, { x:6.65, y:0, w:6.65, h:0.72, fill:{color:C.pregang}, line:{color:C.pregang} });
  slide.addText("PRESYNAPTIC / GANGLIONIC", { x:6.65, y:0, w:6.65, h:0.72, fontSize:13, color:C.bg, bold:true, align:"center", valign:"middle" });

  // ── Centrally acting drugs ──────────────────────────────────────────────────
  const centralDrugs = [
    {
      name: "Clonidine",
      moa: "Ξ±2 agonist in brainstem (locus coeruleus)\nβ†’ ↓ sympathetic outflow β†’ ↓ NE release",
      uses: "Hypertension (2nd line)\nOpioid/alcohol withdrawal\nADHD (off-label)\nMigraine prophylaxis\nMenopausal flushing",
      adr: "Sedation, dry mouth\nConstipation\nRebound HTN (abrupt stop)\nBradycardia",
      pk: "Both oral & transdermal patch\nExcreted renally",
      color: C.central,
    },
    {
      name: "Methyldopa",
      moa: "Prodrug → α-methyldopamine\n→ α-methylnorepinephrine (false TX)\n→ α2 agonist in CNS",
      uses: "HTN in PREGNANCY (drug of choice)\nHypertensive emergencies (IV)\nHypertension (older patients)",
      adr: "Sedation, depression\nPositive Coombs test (20%)\nHaemolytic anaemia (0.5%)\nHepatotoxicity β€’ Drug fever\nSodium retention",
      pk: "Oral; crosses placenta safely\nProbe of choice in pregnancy",
      color: C.central,
    },
    {
      name: "Moxonidine",
      moa: "Imidazoline I1-receptor agonist\n(+ weak Ξ±2 agonist)\nβ†’ ↓ central sympathetic tone",
      uses: "Mild-moderate HTN\nFewer CNS side effects than clonidine",
      adr: "Dry mouth, dizziness\nLess sedation than clonidine",
      pk: "Oral, once daily\nImidazoline selectivity = less sedation",
      color: C.central,
    },
    {
      name: "Rilmenidine",
      moa: "Selective imidazoline I1 agonist\nMinimal Ξ±2 activity",
      uses: "Hypertension\nMetabolic neutral (no lipid/glucose effect)",
      adr: "Well tolerated β€’ Dry mouth",
      pk: "Oral, once daily",
      color: C.central,
    },
  ];

  centralDrugs.forEach((d, i) => {
    const col2 = i % 2, row = Math.floor(i / 2);
    const dx = 0.2 + col2 * 3.25, dy = 0.9 + row * 3.0;
    slide.addShape(pres.ShapeType.rect, { x:dx, y:dy, w:3.15, h:2.75, fill:{color:"1A1A2E"}, line:{color:d.color, width:1.2} });
    slide.addText(d.name, { x:dx, y:dy, w:3.15, h:0.35, fontSize:10, color:d.color, bold:true, align:"center", valign:"middle" });
    const rows2 = [
      { label: "MOA: ", val: d.moa },
      { label: "Uses: ", val: d.uses },
      { label: "ADRs: ", val: d.adr },
      { label: "PK: ", val: d.pk },
    ];
    rows2.forEach((r, ri) => {
      slide.addText([
        { text: r.label, options: { bold:true, color:C.gold } },
        { text: r.val, options: { color:C.text } },
      ], { x:dx+0.1, y:dy + 0.38 + ri * 0.57, w:2.95, h:0.52, fontSize:7.5, valign:"top" });
    });
  });

  // ── Presynaptic / ganglionic ────────────────────────────────────────────────
  const preDrugs = [
    {
      name: "Reserpine",
      moa: "Inhibits VMAT (vesicular monoamine transporter)\n→ Depletes NE, DA, 5-HT from storage vesicles\n→ Long-lasting effect (days-weeks)",
      uses: "Rarely used (historical)\nSevere HTN in combination\nAntipsychotic (old)",
      adr: "DEPRESSION (↓ monoamines)\nParkinsonism (↓ DA)\nSedation, nasal congestion\nPeptic ulcer (↑ ACh effect)\nDiarrhoea",
      pk: "Long-acting (irreversible)\nReserves deplete slowly",
      color: C.pregang,
    },
    {
      name: "Guanethidine",
      moa: "Enters sympathetic terminals via NE transporter\n→ Displaces NE from vesicles\n→ Blocks exocytosis of NE",
      uses: "Severe HTN (rarely used now)\nTopical: Glaucoma",
      adr: "Severe orthostatic hypotension\nRetrograde ejaculation\nDiarrhoea (unopposed PNS)\nNasal congestion\nFluid retention",
      pk: "Poor CNS penetration (does NOT cross BBB)\nBlocked by TCAs (uptake competition)",
      color: C.pregang,
    },
    {
      name: "Bretylium",
      moa: "Blocks NE release from adrenergic neurons\nAccumulates in nerve terminal",
      uses: "Ventricular fibrillation (refractory)\nVentricular tachycardia (historical use)",
      adr: "Orthostatic hypotension\nNausea, vomiting\nTransient HTN (initial NE release)",
      pk: "IV only β€’ Renally excreted\nLargely replaced by amiodarone",
      color: C.pregang,
    },
    {
      name: "Ganglionic Blockers",
      moa: "Block nicotinic ACh receptors\n(N_N) at autonomic ganglia\n→ Block both SNS and PNS",
      uses: "Trimethaphan: Hypertensive crisis,\naortic dissection (historical)\nMecamylamine: Smoking cessation",
      adr: "Orthostatic hypotension\nConstipation, urinary retention\nDry mouth, sexual dysfunction\n(Block all ganglia indiscriminately)",
      pk: "Trimethaphan: IV infusion\nMecamylamine: Oral",
      color: C.pregang,
    },
  ];

  preDrugs.forEach((d, i) => {
    const col2 = i % 2, row = Math.floor(i / 2);
    const dx = 6.85 + col2 * 3.2, dy = 0.9 + row * 3.0;
    slide.addShape(pres.ShapeType.rect, { x:dx, y:dy, w:3.1, h:2.75, fill:{color:"1A1710"}, line:{color:d.color, width:1.2} });
    slide.addText(d.name, { x:dx, y:dy, w:3.1, h:0.35, fontSize:10, color:d.color, bold:true, align:"center", valign:"middle" });
    const rows2 = [
      { label: "MOA: ", val: d.moa },
      { label: "Uses: ", val: d.uses },
      { label: "ADRs: ", val: d.adr },
      { label: "PK: ", val: d.pk },
    ];
    rows2.forEach((r, ri) => {
      slide.addText([
        { text: r.label, options: { bold:true, color:C.gold } },
        { text: r.val, options: { color:C.text } },
      ], { x:dx+0.1, y:dy + 0.38 + ri * 0.57, w:2.9, h:0.52, fontSize:7.5, valign:"top" });
    });
  });

  // Divider line
  slide.addShape(pres.ShapeType.line, { x:6.65, y:0.72, w:0, h:6.78, line:{color:"4D5662", width:1.5, dashType:"dash"} });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 5 β€” CLINICAL PEARLS, MNEMONICS & COMPARISON TABLE
// ══════════════════════════════════════════════════════════════════════════════
{
  const slide = pres.addSlide();
  slide.addShape(pres.ShapeType.rect, { x:0, y:0, w:13.3, h:7.5, fill:{color:C.bg}, line:{color:C.bg} });

  // Header
  slide.addShape(pres.ShapeType.rect, { x:0, y:0, w:13.3, h:0.65, fill:{color:"1C2130"}, line:{color:C.gold, width:2} });
  slide.addText("⚑ CLINICAL PEARLS, MNEMONICS & MUST-KNOW COMPARISONS", {
    x:0, y:0, w:13.3, h:0.65, fontSize:15, color:C.gold, bold:true, align:"center", valign:"middle",
  });

  // ── Mnemonic boxes ─────────────────────────────────────────────────────────
  const mnemonics = [
    {
      title: "Ξ²-blocker ABCDEs",
      color: C.beta,
      content: "A β€” Angina / After MI / Arrhythmias\nB β€” Blood pressure (HTN)\nC β€” Cardiac failure (bisoprolol, carvedilol, metoprolol)\nD β€” Dissection (labetalol)\nE β€” Extra: glaucoma, migraine, tremor",
    },
    {
      title: "Ξ±-blocker BLAST",
      color: C.alpha,
      content: "B β€” BPH (tamsulosin, silodosin)\nL β€” Lower BP (prazosin, doxazosin)\nA β€” Alpha pheo (phentolamine, phenoxybenzamine)\nS β€” Syncope first-dose (warn patients!)\nT β€” Tamsulosin β†’ floppy iris (tell ophthalmologist!)",
    },
    {
      title: "Centrally Acting CMM",
      color: C.central,
      content: "C β€” Clonidine β†’ rebound if stopped abruptly\nM β€” Methyldopa β†’ Mums (pregnancy safe)\nM β€” Moxonidine β†’ Mild, less sedation (imidazoline)",
    },
    {
      title: "Presynaptic DRAG",
      color: C.pregang,
      content: "D β€” Depletes monoamines (Reserpine β†’ Depression!)\nR β€” Releases NE initially then blocks (Bretylium)\nA β€” Autonomic ganglion blockers (block everything)\nG β€” Guanethidine β†’ Gut effects + orthostatic hypotension",
    },
  ];
  mnemonics.forEach((m, i) => {
    const col2 = i % 2, row = Math.floor(i / 2);
    const mx = 0.2 + col2 * 6.5, my = 0.78 + row * 2.05;
    slide.addShape(pres.ShapeType.rect, { x:mx, y:my, w:6.35, h:1.9, fill:{color:"161B22"}, line:{color:m.color, width:1.5} });
    slide.addShape(pres.ShapeType.rect, { x:mx, y:my, w:6.35, h:0.35, fill:{color:m.color}, line:{color:m.color} });
    slide.addText(m.title, { x:mx, y:my, w:6.35, h:0.35, fontSize:10, color:C.bg, bold:true, align:"center", valign:"middle" });
    slide.addText(m.content, { x:mx+0.15, y:my+0.42, w:6.05, h:1.4, fontSize:8.5, color:C.text, valign:"top" });
  });

  // ── Comparison table ────────────────────────────────────────────────────────
  const tableY = 4.95;
  slide.addShape(pres.ShapeType.rect, { x:0.2, y:tableY, w:12.9, h:0.35, fill:{color:"1F2933"}, line:{color:"4D5662"} });
  slide.addText("QUICK COMPARISON", { x:0.2, y:tableY, w:12.9, h:0.35, fontSize:10, color:C.text, bold:true, align:"center", valign:"middle" });

  const headers = ["Drug Class", "Site of Action", "Main Uses", "Key ADR", "Contraindication"];
  const rows = [
    [C.alpha,   "Ξ±1 Blockers",        "Post-synaptic Ξ±1",        "HTN, BPH, Pheo",         "1st-dose syncope",             "Caution in HF"],
    [C.beta,    "Ξ² Blockers (non-sel)","Ξ²1 + Ξ²2 receptors",       "HTN, angina, arrhythmia", "Bronchoconstriction",          "Asthma, COPD"],
    [C.beta,    "Ξ² Blockers (cardio)", "Ξ²1 > Ξ²2",                 "HTN, HF, post-MI",        "Bradycardia, fatigue",         "2nd/3rd AV block"],
    [C.central, "Clonidine",           "CNS Ξ±2 agonist",          "HTN, withdrawal",         "Rebound HTN (stop abruptly)",  "Must taper off"],
    [C.central, "Methyldopa",          "CNS β†’ false TX",          "Pregnancy HTN",           "Haemolytic anaemia",           "Pheochromocytoma"],
    [C.pregang, "Reserpine",           "VMAT inhibitor",          "Severe HTN (historical)",  "Depression, Parkinsonism",     "History of depression"],
    [C.pregang, "Guanethidine",        "Nerve terminal",          "Severe HTN (historical)",  "Orthostatic hypotension",      "TCAs block its uptake"],
  ];

  const colWidths = [1.8, 2.0, 1.9, 2.3, 2.3, 2.4];
  const colX = [0.2, 2.0, 4.0, 5.9, 8.2, 10.5];

  // Header row
  headers.forEach((h, ci) => {
    slide.addShape(pres.ShapeType.rect, { x:colX[ci], y:tableY+0.35, w:colWidths[ci], h:0.32, fill:{color:"2D333B"}, line:{color:"4D5662"} });
    slide.addText(h, { x:colX[ci]+0.05, y:tableY+0.35, w:colWidths[ci]-0.1, h:0.32, fontSize:7.8, color:C.gold, bold:true, valign:"middle" });
  });

  rows.forEach(([rowColor, ...cells], ri) => {
    const ry = tableY + 0.67 + ri * 0.32;
    cells.forEach((cell, ci) => {
      slide.addShape(pres.ShapeType.rect, { x:colX[ci], y:ry, w:colWidths[ci], h:0.3, fill:{color: ri%2===0 ? "161B22" : "111318"}, line:{color:"2D333B"} });
      slide.addText(cell, { x:colX[ci]+0.05, y:ry+0.02, w:colWidths[ci]-0.1, h:0.26, fontSize:7.5, color: ci===0 ? rowColor : C.text, bold: ci===0, valign:"middle" });
    });
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// WRITE FILE
// ══════════════════════════════════════════════════════════════════════════════
pres.writeFile({ fileName: "/home/daytona/workspace/antiadrenergic-mindmap/Antiadrenergic_Drugs_MindMap.pptx" })
  .then(() => console.log("βœ…  Done: /home/daytona/workspace/antiadrenergic-mindmap/Antiadrenergic_Drugs_MindMap.pptx"))
  .catch(e => { console.error("❌ Error:", e); process.exit(1); });
Running Command

cd /home/daytona/workspace/antiadrenergic-mindmap && node build.js 2>&1

Your mind map is ready! Here's what's inside:

Antiadrenergic Drugs MindMap

Presentation Β· PPTX


What's in the 5-Slide Mind Map

The presentation uses a dark theme (near-black background) with color-coded branches so each drug class is instantly recognizable:
ColorClass
πŸ”΅ BlueCentral Hub
πŸ”΄ Coral-RedΞ±-Blockers
🟒 Greenβ-Blockers
🟣 LavenderCentrally Acting
🟠 AmberGanglionic / Presynaptic

Slide 1 - Master Overview Mind Map

A radial mind map with the central hub branching into all 4 classes, each showing key drugs, uses, and ADRs at a glance. Includes a bottom mnemonic strip.

Slide 2 - Ξ²-Blockers Deep Dive

Three columns: Non-Selective, Cardioselective, Mixed Ξ±+Ξ². Includes a selectivity spectrum (Propranolol β†’ Metoprolol β†’ Bisoprolol β†’ Nebivolol), lipophilicity table, ISA drugs, and a red contraindications strip at the bottom.

Slide 3 - Ξ±-Blockers Deep Dive

Non-selective (Phentolamine vs Phenoxybenzamine - reversible vs irreversible highlighted), all 6 selective Ξ±1 blockers with their quirks (Tamsulosin floppy iris!, Silodosin retrograde ejaculation), receptor pharmacology panel, and 5 clinical use cards.

Slide 4 - Centrally Acting + Presynaptic

Side-by-side: Clonidine, Methyldopa, Moxonidine, Rilmenidine vs Reserpine, Guanethidine, Bretylium, Ganglionic Blockers - each with MOA, Uses, ADRs, PK.

Slide 5 - Pearls, Mnemonics & Comparison Table

Four mnemonic boxes:
  • Ξ²-blocker ABCDEs (Angina, BP, Cardiac failure, Dissection, Extras)
  • Ξ±-blocker BLAST (BPH, Lower BP, Alpha pheo, Syncope, Tamsulosin iris)
  • Centrally Acting CMM
  • Presynaptic DRAG
Plus a full comparison table across all classes.

Create a quick-reference PDF cheat sheet for exam prep

Reading File
Writing File

~/antiadrenergic-mindmap/cheatsheet.py

"""
Antiadrenergic Drugs β€” Exam Prep Cheat Sheet
2-page A4 PDF using ReportLab
"""
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import mm, cm
from reportlab.lib.styles import ParagraphStyle
from reportlab.platypus import (
    SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
    HRFlowable, KeepTogether
)
from reportlab.platypus.flowables import BalancedColumns
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_RIGHT
from reportlab.pdfbase.ttfonts import TTFont
from reportlab.pdfbase import pdfmetrics
import os

OUT = "/home/daytona/workspace/antiadrenergic-mindmap/Antiadrenergic_CheatSheet.pdf"

# ── Colour palette ────────────────────────────────────────────────────────────
BG       = colors.HexColor("#0D1117")
PANEL    = colors.HexColor("#161B22")
BORDER   = colors.HexColor("#2D333B")
ACCENT   = colors.HexColor("#58A6FF")   # blue – headers
ALPHA_C  = colors.HexColor("#FF7B72")   # coral – alpha
BETA_C   = colors.HexColor("#3FB950")   # green – beta
CENT_C   = colors.HexColor("#D2A8FF")   # lavender – central
PRE_C    = colors.HexColor("#FFA657")   # amber – presynaptic
GOLD     = colors.HexColor("#F8E45C")
WHITE    = colors.white
DIM      = colors.HexColor("#8B949E")
TEXT     = colors.HexColor("#E6EDF3")
RED      = colors.HexColor("#FF6B6B")

# ── Doc setup ─────────────────────────────────────────────────────────────────
doc = SimpleDocTemplate(
    OUT,
    pagesize=A4,
    leftMargin=10*mm, rightMargin=10*mm,
    topMargin=8*mm, bottomMargin=8*mm,
    title="Antiadrenergic Drugs Cheat Sheet",
    author="Orris Medical"
)
W, H = A4
CW = W - 20*mm   # content width

story = []

# ── Style helpers ─────────────────────────────────────────────────────────────
def S(name, base=None, **kw):
    s = ParagraphStyle(name, **kw)
    return s

BODY = S("body", fontSize=7, textColor=TEXT, leading=9.5, fontName="Helvetica")
BODY_BOLD = S("body_bold", fontSize=7, textColor=TEXT, leading=9.5, fontName="Helvetica-Bold")
TINY  = S("tiny", fontSize=6, textColor=DIM, leading=8, fontName="Helvetica")
LABEL = S("label", fontSize=7, textColor=GOLD, leading=9, fontName="Helvetica-Bold")
HEAD  = S("head", fontSize=7.5, textColor=WHITE, leading=9, fontName="Helvetica-Bold", alignment=TA_CENTER)
RED_S = S("red_s", fontSize=6.5, textColor=RED, leading=8.5, fontName="Helvetica")
ALPHA_S = S("alpha_s", fontSize=7, textColor=ALPHA_C, leading=9, fontName="Helvetica-Bold")
BETA_S  = S("beta_s",  fontSize=7, textColor=BETA_C,  leading=9, fontName="Helvetica-Bold")
CENT_S  = S("cent_s",  fontSize=7, textColor=CENT_C,  leading=9, fontName="Helvetica-Bold")
PRE_S   = S("pre_s",   fontSize=7, textColor=PRE_C,   leading=9, fontName="Helvetica-Bold")

def p(txt, style=None): return Paragraph(txt, style or BODY)
def pb(txt): return Paragraph(f"<b>{txt}</b>", BODY)

def hr(col=BORDER, thick=0.5): return HRFlowable(width="100%", thickness=thick, color=col, spaceAfter=1, spaceBefore=1)

# ─────────────────────────────────────────────────────────────────────────────
# PAGE BACKGROUND  (drawn via canvas callback)
# ─────────────────────────────────────────────────────────────────────────────
def bg_canvas(canvas, doc):
    canvas.saveState()
    canvas.setFillColor(BG)
    canvas.rect(0, 0, W, H, fill=1, stroke=0)
    canvas.restoreState()

# ─────────────────────────────────────────────────────────────────────────────
# TITLE BANNER
# ─────────────────────────────────────────────────────────────────────────────
title_data = [[
    Paragraph(
        '<font color="#58A6FF"><b>ANTIADRENERGIC DRUGS</b></font>  '
        '<font color="#8B949E">|  Exam Quick-Reference Cheat Sheet</font>',
        S("t", fontSize=13, textColor=WHITE, leading=16, fontName="Helvetica-Bold")
    )
]]
title_tbl = Table(title_data, colWidths=[CW])
title_tbl.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,-1), PANEL),
    ("BOX",        (0,0), (-1,-1), 1, ACCENT),
    ("TOPPADDING", (0,0), (-1,-1), 5),
    ("BOTTOMPADDING",(0,0),(-1,-1),5),
    ("LEFTPADDING",(0,0),(-1,-1),8),
]))
story.append(title_tbl)
story.append(Spacer(1, 3*mm))

# ─────────────────────────────────────────────────────────────────────────────
# HELPER: section header
# ─────────────────────────────────────────────────────────────────────────────
def section_hdr(txt, col):
    tbl = Table([[Paragraph(f"<b>{txt}</b>", S("sh", fontSize=9, textColor=colors.HexColor("#0D1117"), leading=11, fontName="Helvetica-Bold", alignment=TA_CENTER))]],
                colWidths=[CW])
    tbl.setStyle(TableStyle([
        ("BACKGROUND", (0,0),(-1,-1), col),
        ("TOPPADDING",    (0,0),(-1,-1), 3),
        ("BOTTOMPADDING", (0,0),(-1,-1), 3),
    ]))
    return tbl

# ─────────────────────────────────────────────────────────────────────────────
# HELPER: drug card row  [name, moa, uses, adr, note]
# ─────────────────────────────────────────────────────────────────────────────
def drug_table(rows, col_color, col_widths=None):
    if col_widths is None:
        col_widths = [28*mm, 40*mm, 42*mm, 42*mm, 35*mm]
    header = [
        Paragraph("<b>Drug</b>",              S("h", fontSize=7, textColor=col_color, leading=9, fontName="Helvetica-Bold")),
        Paragraph("<b>Mechanism</b>",         S("h", fontSize=7, textColor=col_color, leading=9, fontName="Helvetica-Bold")),
        Paragraph("<b>Uses</b>",              S("h", fontSize=7, textColor=col_color, leading=9, fontName="Helvetica-Bold")),
        Paragraph("<b>Key ADRs</b>",          S("h", fontSize=7, textColor=GOLD,      leading=9, fontName="Helvetica-Bold")),
        Paragraph("<b>Pearl / Note</b>",      S("h", fontSize=7, textColor=GOLD,      leading=9, fontName="Helvetica-Bold")),
    ]
    data = [header]
    for r in rows:
        data.append([p(c) for c in r])
    tbl = Table(data, colWidths=col_widths, repeatRows=1)
    tbl.setStyle(TableStyle([
        ("BACKGROUND",  (0,0), (-1,0),  colors.HexColor("#1F2933")),
        ("BACKGROUND",  (0,1), (-1,-1), PANEL),
        ("ROWBACKGROUNDS",(0,1),(-1,-1),[PANEL, colors.HexColor("#111318")]),
        ("GRID",        (0,0), (-1,-1), 0.4, BORDER),
        ("TOPPADDING",  (0,0), (-1,-1), 2),
        ("BOTTOMPADDING",(0,0),(-1,-1),2),
        ("LEFTPADDING", (0,0), (-1,-1), 3),
        ("RIGHTPADDING",(0,0), (-1,-1), 3),
        ("VALIGN",      (0,0), (-1,-1), "TOP"),
    ]))
    return tbl

# ─────────────────────────────────────────────────────────────────────────────
# β‘  Ξ±-BLOCKERS
# ─────────────────────────────────────────────────────────────────────────────
story.append(section_hdr("β‘  Ξ±-BLOCKERS", ALPHA_C))
story.append(Spacer(1, 1*mm))

alpha_rows = [
    # Drug | MOA | Uses | ADRs | Pearl
    ["Phentolamine",
     "Competitive reversible Ξ±1+Ξ±2 block",
     "Pheo hypertensive crisis\nDx: phentolamine test",
     "Reflex tachycardia (Ξ±2 blockβ†’NE↑)\nOrtho hypotension",
     "IV only; short-acting\nReversal: norepinephrine"],
    ["Phenoxybenzamine",
     "Non-competitive IRREVERSIBLE Ξ±1+Ξ±2 block",
     "Pre-op pheo prep\nPheo long-term",
     "Reflex tachycardia\nNasal stuffiness\nEjaculatory dysfunction",
     "Covalent bond β†’ effect lasts days\nPre-op: start 1-2 wks before surgery"],
    ["Prazosin",
     "Selective Ξ±1 block (post-synaptic)\nΞ±2 intact β†’ less tachycardia",
     "HTN β€’ BPH\nRaynaud β€’ PTSD nightmares",
     "1st-dose syncope!\nOrthostatic hypotension\nPalpitations",
     "PROTOTYPE Ξ±1 blocker\nTake 1st dose at bedtime!"],
    ["Terazosin",
     "Selective Ξ±1 block",
     "HTN + BPH",
     "Orthostatic hypotension\nDizziness",
     "Longer tΒ½ than prazosin\nOnce daily"],
    ["Doxazosin",
     "Selective Ξ±1 block",
     "HTN + BPH",
     "Orthostatic hypotension\nPeripheral edema",
     "Longest tΒ½ in class\nALLHAT trial: avoid for HTN alone"],
    ["Tamsulosin",
     "Uroselective Ξ±1A > Ξ±1B block",
     "BPH (1st line)\nKidney stone passage",
     "Retrograde ejaculation\nOrthostasis (less)",
     "⚠ FLOPPY IRIS syndrome\n(tell ophthalmologist before cataract sx!)"],
    ["Alfuzosin",
     "Uroselective Ξ±1A block",
     "BPH",
     "Dizziness, GI upset",
     "Less BP effect than prazosin"],
    ["Silodosin",
     "MOST uroselective Ξ±1A",
     "BPH",
     "Retrograde ejaculation (most common)\nDiarrhea",
     "Highest uroselectivity in class"],
]
story.append(drug_table(alpha_rows, ALPHA_C, [30*mm, 38*mm, 35*mm, 42*mm, 42*mm]))
story.append(Spacer(1, 2*mm))

# ─────────────────────────────────────────────────────────────────────────────
# β‘‘ Ξ²-BLOCKERS
# ─────────────────────────────────────────────────────────────────────────────
story.append(section_hdr("β‘‘ Ξ²-BLOCKERS", BETA_C))
story.append(Spacer(1, 1*mm))

beta_rows = [
    ["Propranolol",
     "Non-selective Ξ²1+Ξ²2 block\nLipophilic (crosses BBB)",
     "HTN β€’ Angina β€’ MI prophylaxis\nArrhythmias β€’ Hyperthyroidism\nMigraine prophylaxis β€’ Tremor\nPortal HTN (varices)\nGlaucoma (topical timolol)",
     "Bronchoconstriction (Ξ²2↓)\nMasks hypoglycemia sx\nCold extremities\nFatigue, depression",
     "PROTOTYPE Ξ²-blocker\nHighest first-pass metabolism\nDo NOT stop abruptly!"],
    ["Metoprolol",
     "Cardioselective Ξ²1 > Ξ²2\nLipophilic",
     "HTN β€’ Angina β€’ HF (succinate XL)\nMI β€’ Arrhythmia",
     "Bradycardia β€’ Fatigue\nWorse glucose tolerance",
     "Tartrate (IR) vs Succinate (XL)\nFor HF: SUCCINATE only (MERIT-HF)\nMost widely used Ξ²-blocker"],
    ["Atenolol",
     "Cardioselective Ξ²1\nHydrophilic (no CNS effects)",
     "HTN β€’ Angina β€’ Post-MI",
     "Bradycardia\nRenal excretion (dose-adjust in CKD)",
     "No CNS ADRs (hydrophilic)\nOld standard for HTN"],
    ["Bisoprolol",
     "Highly selective Ξ²1 (most selective after nebivolol)",
     "HTN β€’ HF (CIBIS-II trial)\nAngina",
     "Bradycardia β€’ Fatigue",
     "One of three Ξ²-blockers proven for HF mortality\n(bisoprolol, carvedilol, metoprolol succinate)"],
    ["Esmolol",
     "Ultra-short acting Ξ²1 selective\nHydrophilic; IV only",
     "Intra-op HTN & tachycardia\nSVT (acute control)\nAortic dissection",
     "Bradycardia β€’ Hypotension",
     "tΒ½ = 9 MIN (metabolized by plasma esterases)\nTitrated by infusion"],
    ["Nebivolol",
     "Highest β1 selectivity + releases NO\n→ vasodilation (unique!)",
     "HTN β€’ HF (adjunct)",
     "Headache (vasodilation)\nBradycardia",
     "VASODILATING Ξ²-blocker via NO\nBest metabolic profile"],
    ["Pindolol",
     "Non-selective Ξ²1+Ξ²2 + ISA\n(partial agonist)",
     "HTN",
     "Less bradycardia than propranolol\nCan worsen angina",
     "ISA = intrinsic sympathomimetic activity\nLess bradycardia at rest"],
    ["Sotalol",
     "Non-selective Ξ²-block + K+ channel block\n(Class II + III antiarrhythmic)",
     "Ventricular arrhythmias\nAtrial fibrillation",
     "QT prolongation β†’ Torsades de Pointes!\nBradycardia",
     "Monitor QTc carefully\nHydrophilic; renally cleared"],
    ["Labetalol",
     "Ξ±1 + Ξ²1 + Ξ²2 block\nΞ±1:Ξ² ratio 1:3 (oral) / 1:7 (IV)",
     "HTN emergency in pregnancy\nHypertensive urgency/emergency\nAortic dissection",
     "Orthostatic hypotension\nBronchospasm (Ξ²2 block)",
     "Drug of choice: Hypertensive\nemergency in PREGNANCY\n(Methyldopa = chronic; Labetalol = acute)"],
    ["Carvedilol",
     "Ξ±1 + Ξ²1 + Ξ²2 block + antioxidant\nNon-selective",
     "HF (COPERNICUS trial)\nPost-MI LV dysfunction\nHTN",
     "Dizziness β€’ Hypotension\nWeight gain",
     "One of 3 mortality-reducing Ξ²-blockers in HF\nAntioxidant property: unique"],
    ["Timolol",
     "Non-selective Ξ²1+Ξ²2 block",
     "Glaucoma (topical)\nPost-MI β€’ Migraine prophylaxis",
     "Bronchoconstriction (topical absorption!)\nBradycardia",
     "Topical: systemic absorption still occurs\nWarn asthmatic patients!"],
]
story.append(drug_table(beta_rows, BETA_C, [28*mm, 42*mm, 35*mm, 40*mm, 42*mm]))
story.append(Spacer(1, 2*mm))

# ─────────────────────────────────────────────────────────────────────────────
# β‘’ CENTRALLY ACTING
# ─────────────────────────────────────────────────────────────────────────────
story.append(section_hdr("β‘’ CENTRALLY ACTING ANTIADRENERGICS", CENT_C))
story.append(Spacer(1, 1*mm))

central_rows = [
    ["Clonidine",
     "Ξ±2 agonist in brainstem (NTS + locus coeruleus)\nβ†’ ↓ sympathetic outflow β†’ ↓NE, ↓HR, ↓BP",
     "Hypertension (2nd line)\nOpioid withdrawal\nAlcohol withdrawal\nADHD (off-label)\nMigraine prophylaxis\nMenopausal flushing",
     "Sedation β€’ Dry mouth\nConstipation β€’ Bradycardia\n⚠ Rebound HTN (abrupt stop)\nSexual dysfunction",
     "Available oral + transdermal patch\nNEVER stop abruptly (rebound HTN crisis)\nOpioid withdrawal: clonidine covers autonomic sx\nbut not craving/pain"],
    ["Methyldopa",
     "Prodrug β†’ Ξ±-methyldopamine\nβ†’ Ξ±-methylnorepinephrine (false TX)\nβ†’ Stimulates Ξ±2 in CNS β†’ ↓ sympathetic outflow",
     "HTN in PREGNANCY (drug of choice!)\nHypertensive emergencies (IV)\nGeneral HTN (older patients)",
     "Sedation, depression\n+ve Coombs test (20%)\nHaemolytic anaemia (0.5%)\nHepatotoxicity β€’ Drug fever\nSodium/water retention",
     "DOC for chronic HTN in PREGNANCY\nFalse TX concept: competes with DOPA\nIV form available for HTN emergency"],
    ["Moxonidine",
     "Selective imidazoline I1 receptor agonist\n(+ weak Ξ±2 agonist)\nβ†’ ↓ central sympathetic tone",
     "Mild-moderate hypertension",
     "Dry mouth β€’ Dizziness\nLess sedation than clonidine",
     "Imidazoline selectivity = fewer CNS ADRs\nMetabolic neutral (no lipid/glucose effects)"],
    ["Rilmenidine",
     "Selective imidazoline I1 agonist\nMinimal Ξ±2 activity",
     "Hypertension",
     "Well tolerated β€’ Dry mouth",
     "Best tolerated centrally acting drug\nOnce daily dosing"],
]
story.append(drug_table(central_rows, CENT_C, [25*mm, 42*mm, 35*mm, 40*mm, 45*mm]))
story.append(Spacer(1, 2*mm))

# ─────────────────────────────────────────────────────────────────────────────
# β‘£ PRESYNAPTIC / GANGLIONIC
# ─────────────────────────────────────────────────────────────────────────────
story.append(section_hdr("β‘£ PRESYNAPTIC & GANGLIONIC BLOCKERS", PRE_C))
story.append(Spacer(1, 1*mm))

pre_rows = [
    ["Reserpine",
     "Irreversibly inhibits VMAT-2\n→ Depletes NE, DA, 5-HT\nfrom storage vesicles (presynaptic)",
     "Severe HTN (combination; historical)\nRarely used now",
     "⚠ DEPRESSION (monoamine depletion)\nParkinsonism (↓ DA)\nSedation β€’ Nasal congestion\nPeptic ulcer (↑ ACh relative)\nDiarrhea",
     "Effect lasts days-weeks (irreversible)\nHistorically important for understanding NE storage\nCI: History of depression or Parkinson's"],
    ["Guanethidine",
     "Enters via NET → taken up into nerve terminal\n→ Displaces NE from vesicles\n→ Blocks exocytosis of NE",
     "Severe hypertension (historical)\nGlaucoma (topical)",
     "Severe orthostatic hypotension\nRetrograde ejaculation\nDiarrhea (↑ GI motility)\nNasal congestion",
     "Does NOT cross BBB (no CNS effects)\n⚠ Blocked by TCAs (competes for NET)\nGuanadrel: similar drug, faster onset"],
    ["Bretylium",
     "Accumulates in adrenergic nerve terminals\n→ Initial NE release (transient HTN)\n→ Then blocks NE release",
     "Refractory VF / VT (historical)\n(largely replaced by amiodarone)",
     "Orthostatic hypotension\nTransient HTN (initial NE release)\nNausea",
     "IV only; renally excreted\nBiphasic response: HTN first, then hypotension"],
    ["Trimethaphan\n(Ganglionic blocker)",
     "Blocks nAChR (NN) at autonomic ganglia\n→ Blocks BOTH SNS and PNS",
     "Hypertensive crisis (historical)\nControlled hypotension in surgery\nAortic dissection (historical)",
     "Orthostatic hypotension\nConstipation, urinary retention\nDry mouth, blurred vision\nSexual dysfunction",
     "Non-selective: blocks all ganglia\nHistorical; largely replaced by nitroprusside\nMecamylamine (oral): smoking cessation"],
]
story.append(drug_table(pre_rows, PRE_C, [28*mm, 42*mm, 32*mm, 42*mm, 43*mm]))
story.append(Spacer(1, 3*mm))

# ─────────────────────────────────────────────────────────────────────────────
# MNEMONICS + CONTRAST BOXES  (side by side)
# ─────────────────────────────────────────────────────────────────────────────
story.append(section_hdr("⚑ MNEMONICS, PEARLS & HIGH-YIELD CONTRASTS", GOLD))
story.append(Spacer(1, 1.5*mm))

MN_W = (CW - 4*mm) / 2

def mnemonic_card(title, col, lines):
    content = []
    for l in lines:
        content.append(Paragraph(l, S("mn", fontSize=7, textColor=TEXT, leading=9.5, fontName="Helvetica")))
    hdr = Paragraph(f"<b>{title}</b>", S("mnh", fontSize=8, textColor=colors.HexColor("#0D1117"), leading=10, fontName="Helvetica-Bold", alignment=TA_CENTER))
    inner = Table([[hdr]] + [[c] for c in content], colWidths=[MN_W - 4*mm])
    inner.setStyle(TableStyle([
        ("BACKGROUND",  (0,0),(0,0), col),
        ("BACKGROUND",  (0,1),(-1,-1), PANEL),
        ("TOPPADDING",  (0,0),(-1,-1), 2),
        ("BOTTOMPADDING",(0,0),(-1,-1), 2),
        ("LEFTPADDING", (0,0),(-1,-1), 4),
        ("BOX",         (0,0),(-1,-1), 0.8, col),
    ]))
    return inner

mn1 = mnemonic_card("Ξ²-blockers: ABCDE Mnemonic", BETA_C, [
    "A β€” Angina / After MI / Arrhythmias",
    "B β€” Blood Pressure (HTN)",
    "C β€” Cardiac failure (carvedilol, bisoprolol, metoprolol-XL)",
    "D β€” Dissection / aortic (labetalol IV)",
    "E β€” Extras: glaucoma, migraine, tremor, hyperthyroidism",
])
mn2 = mnemonic_card("Ξ±-blockers: BLAST Mnemonic", ALPHA_C, [
    "B β€” BPH (tamsulosin, silodosin β€” uroselective)",
    "L β€” Lower BP (prazosin, doxazosin)",
    "A β€” Alpha pheo (phentolamine IV; phenoxybenzamine pre-op)",
    "S β€” Syncope 1st dose β†’ take at BEDTIME",
    "T β€” Tamsulosin β†’ floppy iris (warn ophthalmologist!)",
])
mn3 = mnemonic_card("Centrally Acting: CMR", CENT_C, [
    "C β€” Clonidine β†’ Can't stop (rebound HTN) β†’ taper slowly",
    "M β€” Methyldopa β†’ Mums (pregnancy DOC) β†’ +ve Coombs",
    "R β€” Rebound risk with clonidine: NEVER abrupt stop",
    "Extra: Moxonidine = imidazoline selectivity = less sedation",
])
mn4 = mnemonic_card("Presynaptic: DRAG Mnemonic", PRE_C, [
    "D β€” Depletes monoamines (Reserpine) β†’ Depression!",
    "R β€” Releases NE first, then blocks (Bretylium)",
    "A β€” Autonomic ganglion blockers (trimethaphan β€” blocks all)",
    "G β€” Guanethidine: blocked by TCAs; causes Orthostatic ↓BP",
])

mnem_tbl = Table([[mn1, mn2], [mn3, mn4]],
                 colWidths=[MN_W, MN_W],
                 spaceBefore=0, spaceAfter=0)
mnem_tbl.setStyle(TableStyle([
    ("BACKGROUND", (0,0),(-1,-1), BG),
    ("TOPPADDING",    (0,0),(-1,-1), 2),
    ("BOTTOMPADDING", (0,0),(-1,-1), 2),
    ("LEFTPADDING",   (0,0),(-1,-1), 0),
    ("RIGHTPADDING",  (0,0),(-1,-1), 2),
    ("VALIGN", (0,0),(-1,-1), "TOP"),
]))
story.append(mnem_tbl)
story.append(Spacer(1, 3*mm))

# ─────────────────────────────────────────────────────────────────────────────
# HIGH-YIELD COMPARISON TABLE
# ─────────────────────────────────────────────────────────────────────────────
story.append(section_hdr("HIGH-YIELD COMPARISONS β€” FREQUENTLY TESTED CONTRASTS", ACCENT))
story.append(Spacer(1, 1*mm))

contrast_data = [
    # Header
    [Paragraph("<b>Question</b>", S("q", fontSize=7.5, textColor=ACCENT, leading=9, fontName="Helvetica-Bold")),
     Paragraph("<b>Answer</b>",   S("a", fontSize=7.5, textColor=ACCENT, leading=9, fontName="Helvetica-Bold"))],
    # rows
    ["DOC: Pregnancy HTN (chronic)",           "Methyldopa (safe; also labetalol, nifedipine)"],
    ["DOC: Hypertensive emergency in pregnancy","Labetalol IV (or hydralazine IV)"],
    ["DOC: Pre-op pheo prep",                  "Phenoxybenzamine (irreversible Ξ±-block, 1-2 wks before surgery)"],
    ["DOC: Pheo hypertensive crisis",          "Phentolamine IV (reversible, short-acting)"],
    ["Ξ²-blocker for HF (3 proven)",            "Bisoprolol, Carvedilol, Metoprolol succinate (all ↓ mortality)"],
    ["Ξ²-blocker with ISA",                     "Pindolol, Acebutolol, Carteolol β†’ less resting bradycardia"],
    ["Ultra-short Ξ²-blocker",                  "Esmolol (tΒ½ 9 min; IV infusion; plasma esterases)"],
    ["Most uroselective Ξ±1-blocker",           "Silodosin (Ξ±1A >> Ξ±1B) β†’ for BPH, causes retrograde ejaculation"],
    ["Ξ±1-blocker that causes floppy iris",     "Tamsulosin ⚠ β€” must inform ophthalmologist before cataract surgery"],
    ["IRREVERSIBLE Ξ±-blocker",                 "Phenoxybenzamine (covalent bond to receptor)"],
    ["Ξ²-blocker CI in asthma?",                "All Ξ²-blockers worsen asthma; even cardioselective ones at high dose"],
    ["Rebound HTN risk",                       "Clonidine (central Ξ±2 agonist) β€” NEVER stop abruptly; taper over 1-2 wks"],
    ["Drug causing haemolytic anaemia",        "Methyldopa (positive Coombs test in 20%; actual haemolysis in 0.5%)"],
    ["Drug causing depression",                "Reserpine (depletes monoamines β€” NE, DA, 5-HT)"],
    ["Ξ²-blocker + QT prolongation",            "Sotalol (Class II + III) β€” risk of Torsades de Pointes"],
    ["Vasodilating Ξ²-blocker mechanism",       "Nebivolol (NO release) vs Carvedilol / Labetalol (Ξ±1 blockade)"],
    ["Ξ²-blocker blocked by TCAs",              "Guanethidine β€” TCAs block its uptake into nerve terminal β†’ no effect"],
    ["Drug for opioid withdrawal (autonomic)","Clonidine (Ξ±2 agonist) β€” covers sweating, tachycardia, HTN, anxiety"],
    ["Ξ±-blocker for PTSD nightmares",         "Prazosin (blocks Ξ±1 receptors in brain during REM sleep)"],
    ["Betablocker for glaucoma (topical)",    "Timolol (non-selective) and Betaxolol (selective Ξ²1)"],
    ["Ξ²-blocker safe in peripheral arterial disease","Nebivolol or Bisoprolol (highly cardioselective + vasodilating)"],
]

def alt_row(data):
    tbl = Table(data, colWidths=[70*mm, CW - 70*mm - 0.4*mm])
    style = [
        ("BACKGROUND",    (0,0), (-1,0),  colors.HexColor("#1F2933")),
        ("ROWBACKGROUNDS",(0,1), (-1,-1), [PANEL, colors.HexColor("#111318")]),
        ("GRID",          (0,0), (-1,-1), 0.4, BORDER),
        ("TOPPADDING",    (0,0), (-1,-1), 2),
        ("BOTTOMPADDING", (0,0), (-1,-1), 2),
        ("LEFTPADDING",   (0,0), (-1,-1), 4),
        ("RIGHTPADDING",  (0,0), (-1,-1), 4),
        ("VALIGN",        (0,0), (-1,-1), "MIDDLE"),
        ("FONTNAME",      (0,0), (-1,-1), "Helvetica"),
        ("FONTSIZE",      (0,0), (-1,-1), 7),
        ("TEXTCOLOR",     (0,1), (0,-1),  GOLD),
        ("TEXTCOLOR",     (1,1), (1,-1),  TEXT),
    ]
    tbl.setStyle(TableStyle(style))
    return tbl

story.append(alt_row(contrast_data))
story.append(Spacer(1, 3*mm))

# ─────────────────────────────────────────────────────────────────────────────
# RECEPTOR PHARMACOLOGY QUICK-REF
# ─────────────────────────────────────────────────────────────────────────────
story.append(section_hdr("RECEPTOR PHARMACOLOGY QUICK-REFERENCE", ACCENT))
story.append(Spacer(1, 1*mm))

rec_data = [
    [Paragraph("<b>Receptor</b>", S("rh", fontSize=7.5, textColor=ACCENT, leading=9, fontName="Helvetica-Bold")),
     Paragraph("<b>Location</b>", S("rh", fontSize=7.5, textColor=ACCENT, leading=9, fontName="Helvetica-Bold")),
     Paragraph("<b>Effect when stimulated</b>", S("rh", fontSize=7.5, textColor=ACCENT, leading=9, fontName="Helvetica-Bold")),
     Paragraph("<b>Effect when BLOCKED</b>", S("rh", fontSize=7.5, textColor=GOLD, leading=9, fontName="Helvetica-Bold"))],
    ["Ξ±1 (Gq)", "Vascular smooth muscle, iris dilator, urethra, GIT",
     "Vasoconstriction, mydriasis, urinary retention",
     "Vasodilation, miosis, urinary relaxation (BPH relief)"],
    ["Ξ±2 (Gi)", "Presynaptic (autoreceptor), platelets, CNS",
     "↓ NE release, platelet aggregation, ↓ insulin",
     "↑ NE release β†’ reflex tachycardia (non-selective blockers)"],
    ["Ξ²1 (Gs)", "Heart, kidney (JG cells)",
     "↑ HR, ↑ contractility, ↑ renin",
     "↓ HR, ↓ contractility, ↓ renin (β†’ ↓ BP)"],
    ["Ξ²2 (Gs)", "Bronchi, uterus, vascular SM, liver",
     "Bronchodilation, uterine relaxation, glycogenolysis",
     "Bronchoconstriction, masks hypoglycemia, uterine contraction"],
    ["Ξ²3 (Gs)", "Adipose tissue, bladder detrusor",
     "Lipolysis, bladder relaxation",
     "Rarely targeted clinically (mirabegron activates Ξ²3)"],
    ["I1 (imidazoline)", "Brainstem (RVLM)",
     "↓ Sympathetic outflow β†’ ↓ BP",
     "N/A (moxonidine/rilmenidine AGONISTS at I1)"],
]

rec_tbl = Table(rec_data, colWidths=[30*mm, 42*mm, 60*mm, 55*mm])
rec_tbl.setStyle(TableStyle([
    ("BACKGROUND",    (0,0), (-1,0),  colors.HexColor("#1F2933")),
    ("ROWBACKGROUNDS",(0,1),(-1,-1), [PANEL, colors.HexColor("#111318")]),
    ("GRID",          (0,0),(-1,-1), 0.4, BORDER),
    ("TOPPADDING",    (0,0),(-1,-1), 2),
    ("BOTTOMPADDING", (0,0),(-1,-1), 2),
    ("LEFTPADDING",   (0,0),(-1,-1), 4),
    ("RIGHTPADDING",  (0,0),(-1,-1), 4),
    ("VALIGN",        (0,0),(-1,-1), "MIDDLE"),
    ("FONTNAME",      (0,1),(-1,-1), "Helvetica"),
    ("FONTSIZE",      (0,0),(-1,-1), 7),
    ("TEXTCOLOR",     (0,1),(0,-1),  GOLD),
    ("TEXTCOLOR",     (1,1),(-1,-1), TEXT),
]))
story.append(rec_tbl)
story.append(Spacer(1, 3*mm))

# ─────────────────────────────────────────────────────────────────────────────
# CONTRAINDICATIONS STRIP
# ─────────────────────────────────────────────────────────────────────────────
ci_data = [[
    Paragraph("<b>⚠ KEY CONTRAINDICATIONS</b>", S("ci", fontSize=8, textColor=RED, leading=10, fontName="Helvetica-Bold")),
    Paragraph(
        "Ξ²-blockers: Asthma/COPD β€’ 2Β°/3Β° AV block β€’ Sick sinus syndrome β€’ Severe bradycardia β€’ Severe PAD  "
        "| Ξ±-blockers: 1st-dose hypotension (warn pt!) β€’ Caution in HF with reduced EF  "
        "| Clonidine: NEVER stop abruptly  "
        "| Methyldopa: Avoid in active hepatic disease, pheo  "
        "| Reserpine: History of depression, Parkinsonism, ulcers  "
        "| Guanethidine: TCAs block uptake β†’ renders drug ineffective",
        S("ci2", fontSize=7, textColor=TEXT, leading=9, fontName="Helvetica")
    )
]]
ci_tbl = Table(ci_data, colWidths=[38*mm, CW - 38*mm])
ci_tbl.setStyle(TableStyle([
    ("BACKGROUND", (0,0),(-1,-1), colors.HexColor("#2D1B1B")),
    ("BOX",        (0,0),(-1,-1), 1, RED),
    ("TOPPADDING",    (0,0),(-1,-1), 4),
    ("BOTTOMPADDING", (0,0),(-1,-1), 4),
    ("LEFTPADDING",   (0,0),(-1,-1), 5),
    ("RIGHTPADDING",  (0,0),(-1,-1), 5),
    ("VALIGN",        (0,0),(-1,-1), "MIDDLE"),
]))
story.append(ci_tbl)
story.append(Spacer(1, 2*mm))

# ─────────────────────────────────────────────────────────────────────────────
# Ξ²-BLOCKER SELECTIVITY SPECTRUM
# ─────────────────────────────────────────────────────────────────────────────
spec_data = [[
    Paragraph("<b>Ξ²1 Selectivity Spectrum</b>", S("sp", fontSize=7.5, textColor=BETA_C, leading=9, fontName="Helvetica-Bold")),
    Paragraph(
        "<font color='#FF7B72'>Non-selective:</font> Propranolol = Nadolol = Timolol = Sotalol = Pindolol (ISA)  "
        "<font color='#8B949E'>β†’</font>  "
        "<font color='#3FB950'>Cardioselective Ξ²1:</font> Atenolol < Metoprolol < Bisoprolol < <b>Nebivolol</b> (+ NO vasodilation)  "
        "<font color='#8B949E'>β†’</font>  "
        "<font color='#FFA657'>Mixed Ξ±+Ξ²:</font> Labetalol (Ξ±1:Ξ² = 1:3 oral, 1:7 IV)  β€’  Carvedilol (Ξ±1+Ξ²1+Ξ²2+antioxidant)",
        S("spec2", fontSize=7, textColor=TEXT, leading=9, fontName="Helvetica")
    )
]]
spec_tbl = Table(spec_data, colWidths=[35*mm, CW - 35*mm])
spec_tbl.setStyle(TableStyle([
    ("BACKGROUND", (0,0),(-1,-1), colors.HexColor("#0E1F0E")),
    ("BOX",        (0,0),(-1,-1), 1, BETA_C),
    ("TOPPADDING",    (0,0),(-1,-1), 4),
    ("BOTTOMPADDING", (0,0),(-1,-1), 4),
    ("LEFTPADDING",   (0,0),(-1,-1), 5),
    ("RIGHTPADDING",  (0,0),(-1,-1), 5),
    ("VALIGN",        (0,0),(-1,-1), "MIDDLE"),
]))
story.append(spec_tbl)
story.append(Spacer(1, 2*mm))

# ─────────────────────────────────────────────────────────────────────────────
# FOOTER
# ─────────────────────────────────────────────────────────────────────────────
footer_data = [[
    Paragraph(
        '<font color="#58A6FF"><b>Orris Medical  |  Antiadrenergic Drugs Cheat Sheet</b></font>'
        '<font color="#8B949E">  β€”  For exam preparation only. Verify all clinical decisions against current guidelines.</font>',
        S("ft", fontSize=6.5, textColor=DIM, leading=8.5, fontName="Helvetica", alignment=TA_CENTER)
    )
]]
ft_tbl = Table(footer_data, colWidths=[CW])
ft_tbl.setStyle(TableStyle([
    ("BACKGROUND", (0,0),(-1,-1), PANEL),
    ("BOX",        (0,0),(-1,-1), 0.5, BORDER),
    ("TOPPADDING",    (0,0),(-1,-1), 3),
    ("BOTTOMPADDING", (0,0),(-1,-1), 3),
    ("LEFTPADDING",   (0,0),(-1,-1), 5),
]))
story.append(footer_data[0][0])

# ─────────────────────────────────────────────────────────────────────────────
# BUILD
# ─────────────────────────────────────────────────────────────────────────────
doc.build(story, onFirstPage=bg_canvas, onLaterPages=bg_canvas)
print(f"βœ… PDF saved: {OUT}")
Running Command

cd /home/daytona/workspace/antiadrenergic-mindmap && python cheatsheet.py 2>&1

Your cheat sheet is ready:

Antiadrenergic CheatSheet

PDF Document Β· PDF


What's on the Cheat Sheet

Dark-background, color-coded A4 PDF - same palette as the mind map for instant visual association.
β‘  Ξ±-Blockers table - 8 drugs (Phentolamine, Phenoxybenzamine, Prazosin, Terazosin, Doxazosin, Tamsulosin, Alfuzosin, Silodosin) with MOA / Uses / ADRs / Key Pearl per row
β‘‘ Ξ²-Blockers table - 11 drugs (Propranolol, Metoprolol, Atenolol, Bisoprolol, Esmolol, Nebivolol, Pindolol, Sotalol, Labetalol, Carvedilol, Timolol) - the full spectrum from non-selective to mixed
β‘’ Centrally Acting table - Clonidine, Methyldopa, Moxonidine, Rilmenidine
β‘£ Presynaptic/Ganglionic table - Reserpine, Guanethidine, Bretylium, Trimethaphan
Mnemonic boxes (2x2 grid):
  • Ξ²-blocker ABCDEs
  • Ξ±-blocker BLAST
  • Centrally acting CMR
  • Presynaptic DRAG
High-Yield Contrasts table - 20 "Q β†’ A" pairs covering the most commonly tested exam questions (pregnancy DOC, pheo management, HF Ξ²-blockers, floppy iris, rebound HTN, etc.)
Receptor pharmacology quick-ref - Ξ±1/Ξ±2/Ξ²1/Ξ²2/Ξ²3/I1 with location, effect when stimulated, and effect when blocked
Contraindications strip and Ξ²1 selectivity spectrum at the bottom.
This is a shared conversation. Sign in to Orris to start your own chat.