Basic to surgery about pancreatics
| Complication | Key Points |
|---|---|
| Pancreatic fistula/POPF | Most common major complication; soft gland texture and small duct are risk factors |
| Delayed gastric emptying | Lower with antecolic gastrojejunostomy; treat with prokinetics (erythromycin or metoclopramide) |
| Postpancreatectomy hemorrhage | Early = technical failure; Late (POD 7-14) = pseudoaneurysm (often from pancreatic fistula); treat with interventional radiology embolization |
| Bile leak | Hepaticojejunostomy failure |
Diagnostic laparoscopy before laparotomy is recommended - approximately 10% of patients will have small metastatic deposits not seen on preoperative imaging.
| Type | Definition | Risk of invasive carcinoma |
|---|---|---|
| Main duct (MD-IPMN) | Main duct dilation >5 mm | Up to 64% |
| Branch duct (BD-IPMN) | Cysts >5 mm communicating with main duct | ≤18% |
| Mixed type | Both features present | Intermediate |
In mind map approach
mkdir -p /home/daytona/workspace/pancreas-mindmap && ls /home/daytona/workspace/pancreas-mindmap
~/pancreas-mindmap/mindmap.js
const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_WIDE"; // 13.3" x 7.5"
pres.title = "Surgery of the Pancreas - Mind Map";
// ─── COLOUR PALETTE ──────────────────────────────────────────────────────────
const C = {
bg: "0D1B2A", // deep navy (dominant)
center: "E8A838", // amber – central node
branch1: "2FB5B5", // teal – Anatomy
branch2: "E05C5C", // coral – Operations
branch3: "7EC8A4", // mint – Pathology
branch4: "9B7FD4", // lavender – Complications
branch5: "F4A25A", // orange – Trauma
branch6: "5BA4CF", // sky – Post-op
leaf: "FFFFFF",
dim: "B0C4D8",
white: "FFFFFF",
dark: "0D1B2A",
};
// ─── HELPER FUNCTIONS ─────────────────────────────────────────────────────────
function hexOpacity(hex, opacity) { return hex; } // opacity handled via fill
// Draw a rounded rectangle node
function node(slide, x, y, w, h, text, fillColor, textColor, opts = {}) {
slide.addShape(pres.ShapeType.roundRect, {
x, y, w, h,
fill: { color: fillColor },
line: { color: fillColor },
rectRadius: 0.12,
shadow: { type: "outer", color: "000000", blur: 8, offset: 3, angle: 135, opacity: 0.4 },
});
slide.addText(text, {
x, y, w, h,
fontSize: opts.fontSize || 11,
bold: opts.bold || false,
color: textColor,
align: "center",
valign: "middle",
fontFace: "Calibri",
margin: 4,
wrap: true,
});
}
// Draw a connector line from (x1,y1) to (x2,y2) as a thin rectangle approximation
function line(slide, x1, y1, x2, y2, color, thickness) {
slide.addShape(pres.ShapeType.line, {
x: x1, y: y1, w: x2 - x1, h: y2 - y1,
line: { color, width: thickness || 1.5, dashType: "solid" },
});
}
// ─── SLIDE 1: MASTER MIND MAP ─────────────────────────────────────────────────
{
const s = pres.addSlide();
s.background = { color: C.bg };
// Title bar
s.addText("SURGERY OF THE PANCREAS", {
x: 0, y: 0, w: 13.3, h: 0.45,
fontSize: 18, bold: true, color: C.center,
align: "center", valign: "middle",
fontFace: "Calibri",
fill: { color: "162535" },
charSpacing: 4,
});
// Subtitle
s.addText("Basic Surgical Principles — Mind Map Overview", {
x: 0, y: 0.44, w: 13.3, h: 0.28,
fontSize: 9.5, color: C.dim, align: "center", valign: "middle",
fontFace: "Calibri",
});
// ── CENTRAL NODE ──
const cx = 5.9, cy = 3.3, cw = 1.7, ch = 0.65;
node(s, cx, cy, cw, ch, "PANCREAS\nSURGERY", C.center, C.dark, { fontSize: 12, bold: true });
// ── BRANCHES (6 topics radiating outward) ──
// Each branch: label box + connector + sub-leaf boxes
// 1. ANATOMY (top-left)
const a = { x: 1.0, y: 1.0, w: 1.9, h: 0.55, color: C.branch1 };
line(s, cx + cw/2, cy + ch/2, a.x + a.w/2, a.y + a.h/2, C.branch1, 1.8);
node(s, a.x, a.y, a.w, a.h, "ANATOMY", C.branch1, C.dark, { fontSize: 11, bold: true });
const aLeafs = [
{ x: 0.1, y: 1.75, t: "Head · Neck\nBody · Tail" },
{ x: 0.1, y: 2.45, t: "Portal v., SMV\nSMA relations" },
{ x: 0.1, y: 3.15, t: "Ampulla of Vater\nMain & accessory\npancreatic duct" },
];
aLeafs.forEach(l => {
line(s, a.x + a.w/2, a.y + a.h, l.x + 0.9, l.y + 0.3, C.branch1, 1);
node(s, l.x, l.y, 1.8, 0.6, l.t, "162535", C.branch1, { fontSize: 8.5 });
});
// 2. SURGICAL EXPOSURE (top)
const e = { x: 4.7, y: 0.85, w: 2.1, h: 0.55, color: C.branch6 };
line(s, cx + cw/2, cy, e.x + e.w/2, e.y + e.h, C.branch6, 1.8);
node(s, e.x, e.y, e.w, e.h, "EXPOSURE", C.branch6, C.dark, { fontSize: 11, bold: true });
const eLeafs = [
{ x: 3.75, y: 1.55, t: "Anterior: Lesser sac\nGastrocolic lig." },
{ x: 5.95, y: 1.55, t: "Posterior: Kocher\nmaneuver" },
{ x: 3.75, y: 2.25, t: "Body/Tail: Medial\nrotation of spleen" },
{ x: 5.95, y: 2.25, t: "Duct check:\nMRCP / direct" },
];
eLeafs.forEach(l => {
line(s, e.x + e.w/2, e.y + e.h, l.x + 0.95, l.y + 0.3, C.branch6, 1);
node(s, l.x, l.y, 1.9, 0.58, l.t, "162535", C.branch6, { fontSize: 8 });
});
// 3. OPERATIONS (right)
const o = { x: 10.6, y: 2.5, w: 2.0, h: 0.55, color: C.branch2 };
line(s, cx + cw, cy + ch/2, o.x, o.y + o.h/2, C.branch2, 1.8);
node(s, o.x, o.y, o.w, o.h, "OPERATIONS", C.branch2, C.white, { fontSize: 11, bold: true });
const oLeafs = [
{ x: 10.5, y: 1.55, t: "Whipple (PD)\nHead tumors" },
{ x: 10.5, y: 2.25, t: "Distal\nPancreatectomy" },
{ x: 10.5, y: 3.35, t: "Total\nPancreatectomy" },
{ x: 10.5, y: 4.05, t: "Enucleation\n(small PNETs)" },
];
oLeafs.forEach(l => {
line(s, o.x, o.y + o.h/2, l.x + 1.0, l.y + 0.3, C.branch2, 1);
node(s, l.x, l.y, 2.0, 0.58, l.t, "162535", C.branch2, { fontSize: 8.5 });
});
// 4. PATHOLOGY (bottom-right)
const p = { x: 9.5, y: 5.8, w: 2.0, h: 0.55, color: C.branch3 };
line(s, cx + cw, cy + ch, p.x, p.y, C.branch3, 1.8);
node(s, p.x, p.y, p.w, p.h, "PATHOLOGY", C.branch3, C.dark, { fontSize: 11, bold: true });
const pLeafs = [
{ x: 10.8, y: 4.75, t: "PDAC\n5-yr survival 10%" },
{ x: 10.8, y: 5.45, t: "IPMN\nMD vs BD duct" },
{ x: 8.6, y: 5.8, t: "MCN\n(women, body/tail)" },
{ x: 8.6, y: 5.1, t: "PNETs\nfunctional/non-fxn" },
];
pLeafs.forEach(l => {
line(s, p.x + p.w/2, p.y, l.x + 0.95, l.y + 0.3, C.branch3, 1);
node(s, l.x, l.y, 1.9, 0.58, l.t, "162535", C.branch3, { fontSize: 8.5 });
});
// 5. TRAUMA (bottom-left)
const tr = { x: 1.3, y: 5.5, w: 2.0, h: 0.55, color: C.branch5 };
line(s, cx, cy + ch, tr.x + tr.w/2, tr.y, C.branch5, 1.8);
node(s, tr.x, tr.y, tr.w, tr.h, "TRAUMA", C.branch5, C.dark, { fontSize: 11, bold: true });
const trLeafs = [
{ x: 0.1, y: 4.65, t: "Grade I–II\nDrain only" },
{ x: 0.1, y: 5.35, t: "Grade III\nDistal Px-ectomy" },
{ x: 2.1, y: 5.55, t: "Grade IV–V\nTrauma Whipple" },
{ x: 2.1, y: 4.85, t: "Damage control\nDelayed recon." },
];
trLeafs.forEach(l => {
line(s, tr.x + tr.w/2, tr.y + tr.h/2, l.x + 0.95, l.y + 0.3, C.branch5, 1);
node(s, l.x, l.y, 1.9, 0.58, l.t, "162535", C.branch5, { fontSize: 8.5 });
});
// 6. COMPLICATIONS (bottom-center)
const cm = { x: 4.8, y: 6.1, w: 2.0, h: 0.55, color: C.branch4 };
line(s, cx + cw/2, cy + ch, cm.x + cm.w/2, cm.y, C.branch4, 1.8);
node(s, cm.x, cm.y, cm.w, cm.h, "COMPLICATIONS", C.branch4, C.white, { fontSize: 10, bold: true });
const cmLeafs = [
{ x: 3.5, y: 5.35, t: "POPF\nGrade A/B/C" },
{ x: 5.7, y: 5.35, t: "Delayed gastric\nemptying (DGE)" },
{ x: 3.5, y: 4.65, t: "Post-px hemorrhage\nEarly vs Late" },
{ x: 5.7, y: 4.65, t: "Bile leak\nHepatic insuff." },
];
cmLeafs.forEach(l => {
line(s, cm.x + cm.w/2, cm.y, l.x + 0.95, l.y + 0.3, C.branch4, 1);
node(s, l.x, l.y, 1.9, 0.58, l.t, "162535", C.branch4, { fontSize: 8.5 });
});
// Footer
s.addText("Source: Current Surgical Therapy 14e | Sabiston Textbook of Surgery | Mulholland & Greenfield's Surgery 7e", {
x: 0, y: 7.3, w: 13.3, h: 0.22,
fontSize: 7, color: "4A6278", align: "center", fontFace: "Calibri",
});
}
// ─── SLIDE 2: WHIPPLE PROCEDURE DETAIL ────────────────────────────────────────
{
const s = pres.addSlide();
s.background = { color: C.bg };
s.addText("PANCREATICODUODENECTOMY (WHIPPLE) — STEP BY STEP", {
x: 0, y: 0, w: 13.3, h: 0.45,
fontSize: 16, bold: true, color: C.branch2,
align: "center", valign: "middle",
fontFace: "Calibri", charSpacing: 2,
fill: { color: "162535" },
});
const steps = [
{ n: "1", title: "Infrapancreatic SMV", body: "Enter lesser sac → expose SMV below pancreatic neck\nIdentify middle colic vein junction" },
{ n: "2", title: "Kocher Maneuver", body: "Mobilise duodenum & pancreatic head medially\nExpose IVC, left renal vein, aorta" },
{ n: "3", title: "Portal Dissection", body: "Identify common hepatic artery\nTop-down cholecystectomy\nDivide CHD above cystic duct" },
{ n: "4", title: "Divide Stomach/Duodenum", body: "Standard: divide antrum\nPylorus-preserving (PPPD): 2 cm distal to pylorus" },
{ n: "5", title: "Divide Pancreatic Neck", body: "Tunnel posterior to neck over SMV/portal vein\nDivide with electrocautery or stapler" },
{ n: "6", title: "Uncinate Process / SMA", body: "SMA-first approach\nSMA margin is most common site of positive margin" },
];
steps.forEach((st, i) => {
const col = i % 3;
const row = Math.floor(i / 3);
const x = 0.35 + col * 4.3;
const y = 0.65 + row * 2.9;
// Step circle
s.addShape(pres.ShapeType.ellipse, {
x: x, y: y + 0.08, w: 0.52, h: 0.52,
fill: { color: C.branch2 },
line: { color: C.branch2 },
});
s.addText(st.n, { x, y: y + 0.08, w: 0.52, h: 0.52, fontSize: 14, bold: true, color: C.dark, align: "center", valign: "middle" });
// Step card
s.addShape(pres.ShapeType.roundRect, {
x: x + 0.6, y, w: 3.5, h: 2.5,
fill: { color: "162535" },
line: { color: C.branch2, width: 1.5 },
rectRadius: 0.1,
});
s.addText(st.title, { x: x + 0.65, y: y + 0.08, w: 3.4, h: 0.45, fontSize: 11, bold: true, color: C.branch2, fontFace: "Calibri" });
s.addText(st.body, { x: x + 0.65, y: y + 0.55, w: 3.35, h: 1.85, fontSize: 9.5, color: C.white, fontFace: "Calibri", valign: "top", wrap: true });
});
// Reconstruction box
s.addShape(pres.ShapeType.roundRect, {
x: 0.35, y: 6.5, w: 12.6, h: 0.8,
fill: { color: "1E2E40" },
line: { color: C.branch2, width: 1.5 },
rectRadius: 0.1,
});
s.addText("RECONSTRUCTION: Pancreaticojejunostomy → Hepaticojejunostomy → Gastrojejunostomy (antecolic preferred)", {
x: 0.4, y: 6.52, w: 12.5, h: 0.76,
fontSize: 10, bold: true, color: C.center, align: "center", valign: "middle", fontFace: "Calibri",
});
}
// ─── SLIDE 3: PATHOLOGY MIND MAP ──────────────────────────────────────────────
{
const s = pres.addSlide();
s.background = { color: C.bg };
s.addText("PANCREATIC PATHOLOGY — SURGICAL DECISION TREE", {
x: 0, y: 0, w: 13.3, h: 0.45,
fontSize: 16, bold: true, color: C.branch3,
align: "center", valign: "middle",
fontFace: "Calibri", charSpacing: 2,
fill: { color: "162535" },
});
const diseases = [
{
name: "PDAC", color: C.branch2,
x: 0.2, y: 0.6,
facts: ["5-yr survival ~10%", "CA 19-9 (sens/spec ~80%)", "FOLFIRINOX or Gem + nab-PTX", "Resectable / Borderline / Locally adv.", "SMA margin most critical", "Germline testing (BRCA1/2)"],
},
{
name: "IPMN", color: C.branch6,
x: 3.55, y: 0.6,
facts: ["Most common resected cyst", "Main duct: up to 64% malignant", "Branch duct: ≤18% malignant", "Fukuoka 2017 guidelines", "High-risk: MPD >10mm, jaundice, nodule", "Surgery vs surveillance"],
},
{
name: "MCN", color: C.branch3,
x: 6.9, y: 0.6,
facts: ["Almost exclusively women", "Body / tail location", "Ovarian stroma histology", "No duct communication", "ALL should be resected", "Distal pancreatectomy"],
},
{
name: "PNETs", color: C.branch5,
x: 10.25, y: 0.6,
facts: ["3% of pancreatic malignancies", "Functional vs non-functional", "Chromogranin-A biomarker", "WHO grade: Ki-67 + mitotic rate", "MEN1, VHL syndromes", "Enucleation or resection"],
},
{
name: "Autoimmune\nPancreatitis", color: C.branch4,
x: 0.2, y: 4.2,
facts: ["Mimics PDAC clinically", "Type I: IgG4 elevated (LPSP)", "Type II: IgG4 normal (IDCP)", "Steroid trial confirms diagnosis", "Prednisolone 40 mg × 2 wk", "Avoid unnecessary Whipple"],
},
{
name: "Serous Cystadenoma", color: "7BB3CC",
x: 3.55, y: 4.2,
facts: ["Benign - no malignant potential", "Honeycomb / microcystic pattern", "VHL mutation associated", "Often no surgery needed", "Observe unless symptomatic", "Central scar on CT (classic)"],
},
{
name: "Solid Pseudopapillary\nNeoplasm (SPN)", color: "B08AC9",
x: 6.9, y: 4.2,
facts: ["Young women predominantly", "CTNNB1 mutation (beta-catenin)", "Low malignant potential", "Resection is curative", "Good prognosis even if large", "Distal Px-ectomy or Whipple"],
},
{
name: "Chronic\nPancreatitis", color: "D4A96A",
x: 10.25, y: 4.2,
facts: ["Pain is main indication", "Frey or Beger procedure", "Lateral pancreaticojejunostomy", "Puestow procedure (historic)", "Ductal dilation >7 mm favors drainage", "Total Px for refractory pain"],
},
];
diseases.forEach(d => {
// Header
s.addShape(pres.ShapeType.roundRect, {
x: d.x, y: d.y, w: 3.1, h: 0.5,
fill: { color: d.color },
line: { color: d.color },
rectRadius: 0.1,
});
s.addText(d.name, { x: d.x, y: d.y, w: 3.1, h: 0.5, fontSize: 10.5, bold: true, color: C.dark, align: "center", valign: "middle", fontFace: "Calibri" });
// Fact box
s.addShape(pres.ShapeType.roundRect, {
x: d.x, y: d.y + 0.52, w: 3.1, h: 3.3,
fill: { color: "162535" },
line: { color: d.color, width: 1.2 },
rectRadius: 0.08,
});
d.facts.forEach((f, i) => {
s.addShape(pres.ShapeType.ellipse, {
x: d.x + 0.12, y: d.y + 0.7 + i * 0.5, w: 0.12, h: 0.12,
fill: { color: d.color }, line: { color: d.color },
});
s.addText(f, {
x: d.x + 0.3, y: d.y + 0.62 + i * 0.5, w: 2.75, h: 0.45,
fontSize: 8.5, color: C.white, fontFace: "Calibri", valign: "middle",
});
});
});
}
// ─── SLIDE 4: COMPLICATIONS ───────────────────────────────────────────────────
{
const s = pres.addSlide();
s.background = { color: C.bg };
s.addText("POST-PANCREATECTOMY COMPLICATIONS", {
x: 0, y: 0, w: 13.3, h: 0.45,
fontSize: 16, bold: true, color: C.branch4,
align: "center", valign: "middle",
fontFace: "Calibri", charSpacing: 2,
fill: { color: "162535" },
});
const comps = [
{
title: "PANCREATIC FISTULA (POPF)",
color: C.branch4,
x: 0.3, y: 0.6,
items: [
"Definition: drain amylase >3× ULN on POD 3",
"Grade A (Biochemical leak) — no clinical impact",
"Grade B — change in management required",
"Grade C — life-threatening, needs re-op",
"Risk: soft gland, small duct (<3mm), high BMI",
"Pasireotide shown to reduce POPF (N Engl J Med 2014)",
],
},
{
title: "DELAYED GASTRIC EMPTYING (DGE)",
color: C.branch6,
x: 4.65, y: 0.6,
items: [
"Most common non-surgical complication",
"Lower with antecolic gastrojejunostomy",
"Rule out subclinical POPF or abscess (CT scan)",
"Upper GI series to assess gastric emptying",
"Treatment: NG tube + prokinetics",
"Erythromycin or metoclopramide; usually self-limiting",
],
},
{
title: "POSTPANCREATECTOMY HEMORRHAGE",
color: C.branch2,
x: 9.0, y: 0.6,
items: [
"Early (<24 h): technical failure → re-operation",
"Late (POD 7–14): pseudoaneurysm or GJ ulcer",
"Often triggered by adjacent pancreatic fistula",
"Presents as herald bleed in drain or GI bleed",
"Treatment: IR embolization or stenting",
"Mortality 10–16%; risk of hepatic abscess",
],
},
{
title: "BILE LEAK",
color: C.branch3,
x: 0.3, y: 4.1,
items: [
"Hepaticojejunostomy failure",
"Often managed with percutaneous drainage",
"ERCP + stenting if accessible anastomosis",
"Grade A/B: non-operative management",
"Grade C: reoperation required",
],
},
{
title: "ENDOCRINE INSUFFICIENCY",
color: C.center,
x: 4.65, y: 4.1,
items: [
"Follows total pancreatectomy",
"Brittle diabetes (no glucagon counter-regulation)",
"Hypoglycaemia risk is severe",
"Long-acting insulin + CGM monitoring",
"Pancreatic islet autotransplantation option",
],
},
{
title: "EXOCRINE INSUFFICIENCY",
color: C.branch5,
x: 9.0, y: 4.1,
items: [
"After extensive pancreatectomy",
"Steatorrhoea, fat malabsorption, weight loss",
"Pancreatic enzyme replacement therapy (PERT)",
"Take enzymes with meals and snacks",
"Fat-soluble vitamin supplementation",
],
},
];
comps.forEach(c => {
// Header
s.addShape(pres.ShapeType.roundRect, {
x: c.x, y: c.y, w: 4.0, h: 0.48,
fill: { color: c.color },
line: { color: c.color },
rectRadius: 0.1,
});
s.addText(c.title, { x: c.x, y: c.y, w: 4.0, h: 0.48, fontSize: 9.5, bold: true, color: C.dark, align: "center", valign: "middle", fontFace: "Calibri" });
// Body box
s.addShape(pres.ShapeType.roundRect, {
x: c.x, y: c.y + 0.5, w: 4.0, h: 2.8,
fill: { color: "162535" },
line: { color: c.color, width: 1.2 },
rectRadius: 0.08,
});
c.items.forEach((item, i) => {
s.addShape(pres.ShapeType.ellipse, {
x: c.x + 0.12, y: c.y + 0.72 + i * 0.42, w: 0.1, h: 0.1,
fill: { color: c.color }, line: { color: c.color },
});
s.addText(item, {
x: c.x + 0.28, y: c.y + 0.65 + i * 0.42, w: 3.65, h: 0.4,
fontSize: 8.5, color: C.white, fontFace: "Calibri", valign: "middle",
});
});
});
}
// ─── SLIDE 5: TRAUMA MIND MAP ─────────────────────────────────────────────────
{
const s = pres.addSlide();
s.background = { color: C.bg };
s.addText("PANCREATIC TRAUMA — MANAGEMENT ALGORITHM", {
x: 0, y: 0, w: 13.3, h: 0.45,
fontSize: 16, bold: true, color: C.branch5,
align: "center", valign: "middle",
fontFace: "Calibri", charSpacing: 2,
fill: { color: "162535" },
});
// Central question
s.addShape(pres.ShapeType.roundRect, {
x: 4.65, y: 0.65, w: 3.6, h: 0.6,
fill: { color: C.branch5 },
line: { color: C.branch5 },
rectRadius: 0.1,
});
s.addText("PANCREATIC INJURY IDENTIFIED", {
x: 4.65, y: 0.65, w: 3.6, h: 0.6,
fontSize: 11, bold: true, color: C.dark, align: "center", valign: "middle", fontFace: "Calibri",
});
// Duct assessment box
s.addShape(pres.ShapeType.roundRect, {
x: 4.65, y: 1.45, w: 3.6, h: 0.6,
fill: { color: "162535" },
line: { color: C.branch5, width: 1.5 },
rectRadius: 0.1,
});
s.addText("Ductal integrity? → MRCP / intraop fluoroscopy", {
x: 4.65, y: 1.45, w: 3.6, h: 0.6,
fontSize: 9, color: C.branch5, align: "center", valign: "middle", fontFace: "Calibri",
});
// Grade boxes
const grades = [
{ grade: "Grade I–II", sub: "No duct injury", action: "Closed suction drain\nObservation\nNo resection needed", color: "7EC8A4", x: 0.4, y: 2.5 },
{ grade: "Grade III", sub: "Distal duct injury", action: "Distal pancreatectomy\n± Splenectomy\nOversew stump", color: C.branch5, x: 3.35, y: 2.5 },
{ grade: "Grade IV", sub: "Proximal duct injury", action: "Assess ampulla & CBD\nDamage control first\nDelayed reconstruction", color: C.branch2, x: 6.3, y: 2.5 },
{ grade: "Grade V", sub: "Massive head disruption", action: "Trauma Whipple\nDamage control → ICU\nReconstruct at re-look", color: "C0392B", x: 9.25, y: 2.5 },
];
grades.forEach(g => {
s.addShape(pres.ShapeType.roundRect, {
x: g.x, y: g.y, w: 2.7, h: 0.5,
fill: { color: g.color }, line: { color: g.color }, rectRadius: 0.1,
});
s.addText(g.grade, { x: g.x, y: g.y, w: 2.7, h: 0.5, fontSize: 11, bold: true, color: C.dark, align: "center", valign: "middle", fontFace: "Calibri" });
s.addShape(pres.ShapeType.roundRect, {
x: g.x, y: g.y + 0.52, w: 2.7, h: 0.38,
fill: { color: "1A2D40" }, line: { color: g.color, width: 1 }, rectRadius: 0.06,
});
s.addText(g.sub, { x: g.x, y: g.y + 0.52, w: 2.7, h: 0.38, fontSize: 8.5, color: g.color, align: "center", valign: "middle", fontFace: "Calibri", italic: true });
s.addShape(pres.ShapeType.roundRect, {
x: g.x, y: g.y + 0.94, w: 2.7, h: 1.4,
fill: { color: "162535" }, line: { color: g.color, width: 1.2 }, rectRadius: 0.08,
});
s.addText(g.action, { x: g.x, y: g.y + 0.94, w: 2.7, h: 1.4, fontSize: 9, color: C.white, align: "center", valign: "middle", fontFace: "Calibri", wrap: true });
});
// Damage control principles
s.addShape(pres.ShapeType.roundRect, {
x: 0.3, y: 5.35, w: 12.7, h: 1.65,
fill: { color: "1A2D40" }, line: { color: C.branch5, width: 1.5 }, rectRadius: 0.1,
});
s.addText("DAMAGE CONTROL PRINCIPLES", {
x: 0.4, y: 5.38, w: 4.5, h: 0.35, fontSize: 10, bold: true, color: C.branch5, fontFace: "Calibri",
});
const dcItems = [
"Haemorrhage control first — pack and leave",
"GI contamination control — staple, don't anastomose",
"Temporary abdominal closure",
"Resuscitate in ICU: correct coagulopathy, hypothermia, acidosis",
"Return for formal reconstruction at 24–48 h",
"Pancreatic duct drainage: cannulate for external drainage if possible",
"Whipple reconstruction delayed — ask HPB colleagues for assistance",
];
dcItems.forEach((item, i) => {
const col = i < 4 ? 0 : 1;
const row = i < 4 ? i : i - 4;
s.addShape(pres.ShapeType.ellipse, {
x: 0.45 + col * 6.4, y: 5.78 + row * 0.38, w: 0.1, h: 0.1,
fill: { color: C.branch5 }, line: { color: C.branch5 },
});
s.addText(item, {
x: 0.62 + col * 6.4, y: 5.72 + row * 0.38, w: 5.8, h: 0.35,
fontSize: 8.5, color: C.white, fontFace: "Calibri",
});
});
}
// ─── WRITE FILE ────────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/pancreas-mindmap/Pancreas_Surgery_MindMap.pptx" })
.then(() => console.log("Done: Pancreas_Surgery_MindMap.pptx"))
.catch(err => console.error("Error:", err));
cd /home/daytona/workspace/pancreas-mindmap && node mindmap.js
ls -lh /home/daytona/workspace/pancreas-mindmap/Pancreas_Surgery_MindMap.pptx