So tell me about SLE disease

Reading File
Finding Sources
Searching PubMed

"systemic lupus erythematosus"[MeSH Terms]

Finding Sources
Finding Sources
Searching PubMed

"lupus erythematosus, systemic"[MeSH Terms] AND treatment

Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Loading Image
Loading Image
Reading File
Reading File
Loading Image
Reading File
I now have comprehensive content from multiple textbooks. Let me compile the full, authoritative answer on SLE.

Systemic Lupus Erythematosus (SLE)

SLE is a chronic, remitting and relapsing, multisystem autoimmune disease. It is considered the classic human immune complex disease - autoantibodies form immune complexes that deposit throughout the body, causing widespread tissue injury. It predominantly affects women of childbearing age (female:male ratio ~10:1), with an incidence of ~1 in 700 women aged 20-60 in the US, and is significantly more common and severe in Black women (~1 in 250).

Pathogenesis

SLE results from a complex interplay of genetic susceptibility, environmental triggers, and failure of immune self-tolerance.

Genetic Factors

  • HLA associations: HLA-DR2 and HLA-DR3 confer an odds ratio of 2-3; both together raise it to ~5
  • Complement deficiencies: Inherited deficiencies of C1q, C2, or C4 occur in ~5% of patients and lead to defective clearance of immune complexes and apoptotic cells, and failure of B cell tolerance
  • FcγRIIB polymorphism: Impairs control of B cell activation and failure to attenuate inflammatory responses
  • PTPN22 and many other genes identified in genome-wide association studies
  • Deficiencies in DNases (e.g., TREX1) reduce clearance of nuclear material

Environmental Triggers

  • UV light induces apoptotic death of skin cells and release of nuclear antigens, explaining photosensitivity and flares

Key Immunological Mechanisms

IFN-α / Type I Interferon Signature: A hallmark of SLE is a striking "interferon gene signature" in blood cells, indicating exposure to IFN-α produced by plasmacytoid dendritic cells. Plasmacytoid DCs from SLE patients produce abnormally large amounts of IFN-α.
TLR Activation: Toll-like receptors that recognize self-nucleic acids (TLR9 for DNA, TLR7 for RNA) activate self-reactive B cells. When nuclear material from apoptotic cells is inadequately cleared, it activates these TLRs on autoreactive B and T lymphocytes.
Neutrophil Extracellular Traps (NETs): A major recent insight is the role of neutrophils - especially Low-Density Granulocytes (LDGs). These cells form NETs that carry modified self-antigens, activate plasmacytoid DCs via LL-37-DNA complexes to produce more Type I IFN, and cause direct tissue damage and vasculopathy.
The diagram below illustrates how NETs drive the pathogenesis of SLE and related autoimmune diseases:
Neutrophils/LDGs and NETs in SLE pathogenesis - showing how microbes, immune complexes, and cell damage products activate neutrophils to form NETs, which then drive Type I IFN production via dendritic cells, autoantibodies via B cells, and vasculopathy
The net result is a cycle: defective clearance of nuclear material → activation of self-reactive B and T cells → production of anti-nuclear autoantibodies → immune complex deposition → complement activation → tissue damage across multiple organs.

Clinical Manifestations

SLE can affect virtually every organ system. The disease course is one of flares and remissions.

Mucocutaneous (80% of patients - highest diagnostic value)

  • Malar (butterfly) rash: Erythema over cheeks and bridge of nose, characteristically sparing the nasolabial folds (unlike dermatomyositis). Represents acute cutaneous LE.
  • Discoid rash: Scarring, disk-shaped plaques; can occur without systemic disease
  • Photosensitivity: UV exposure triggers skin eruptions and systemic flares
  • Oral ulcers: 20-30% of patients; usually painless
  • Bullous lupus: Subepidermal vesicles/bullae, often on sun-exposed areas, with neutrophils at the dermal-epidermal junction - responds dramatically to dapsone
  • Non-scarring alopecia and "lupus hairs" (frontal short broken hairs)
  • Vascular lesions: Periungual telangiectasias, livedo reticularis (50% of patients)
Clinical photo - Bullous lupus erythematosus:
Bullous lupus erythematosus - tense bullae and vesicles on the arm

Musculoskeletal

  • Arthritis/arthralgia: One of the most common features; typically non-erosive, symmetric, involving small joints of the hands, wrists, and knees
  • Jaccoud arthropathy (non-erosive deformities) can occur

Renal (Lupus Nephritis)

This is the most serious manifestation and a major driver of morbidity and mortality.
WHO/ISN Classification by biopsy:
ClassDescription
IMinimal mesangial
IIMesangial proliferative (immune complex deposition with mesangial hypercellularity)
IIIFocal glomerulonephritis (<50% of glomeruli)
IVDiffuse glomerulonephritis (≥50% of glomeruli) - most severe
VMembranous lupus nephritis
VIAdvanced sclerotic
Renal evaluation includes urinalysis with microscopy (look for red cell casts indicating proliferative GN), spot urine protein:creatinine ratio, and serum creatinine. Renal biopsy guides management and prognosis.

Hematologic

  • Autoimmune hemolytic anemia: Direct Coombs positive, caused by anti-erythrocyte antibodies
  • Thrombocytopenia: Anti-platelet antibodies; can be severe
  • Leukopenia/lymphopenia: Common
  • Antiphospholipid syndrome (APS): Occurs in ~21% - causes arterial/venous thrombosis and recurrent pregnancy loss

Neuropsychiatric Lupus (NPSLE)

  • Seizures, psychosis, cognitive dysfunction, delirium, depression, transverse myelitis, stroke
  • MRI shows white matter lesions, cerebral infarction, venous sinus thrombosis in 19-70% of patients
  • Pathogenesis involves immune complex deposition, antiphospholipid antibody-related thrombosis, and direct neuronal injury

Cardiopulmonary

  • Pleuritis/pleural effusion (sterile, exudative)
  • Pericarditis/pericardial effusion
  • Libman-Sacks endocarditis: Non-infective verrucous lesions on cardiac valves
  • Accelerated atherosclerosis and coronary artery disease (related to chronic inflammation + LDG-driven vasculopathy)
  • Interstitial lung disease, pulmonary hypertension

Constitutional

  • Fever, fatigue, weight loss - common during flares

Autoantibodies in SLE

AutoantibodyFrequencyNotes
ANA (antinuclear antibodies)~99%Entry criterion for classification; sensitive but not specific
Anti-dsDNA~70%High specificity for SLE; titers correlate with disease activity, especially nephritis
Anti-Sm (Smith)~38%Highly specific for SLE
Anti-Ro (SSA)~49%Associated with neonatal lupus, photosensitivity
Anti-La (SSB)~35%Associated with Sjogren overlap
Anti-RNP (U1-RNP)~33%High titers associated with MCTD
Antiphospholipid (aCL, anti-β2GPI, lupus anticoagulant)~21%Thrombosis risk, pregnancy loss
Anti-ribosomal P~10%Associated with neuropsychiatric lupus

Classification / Diagnostic Criteria

The 2019 EULAR/ACR Classification Criteria are the current standard. ANA titer ≥1:80 is the entry criterion. Points are assigned across clinical and immunological domains, and a score ≥10 classifies SLE.
Diagnostic algorithm (EULAR/ACR 2019):
Diagnostic algorithm for SLE - EULAR/ACR 2019 criteria flowchart showing ANA testing, scoring, and classification thresholds
Key scoring points (within each domain, count only the highest):
FeaturePoints
Clinical
Acute cutaneous lupus6
Joint involvement6
Renal biopsy class III/IV nephritis10
Renal biopsy class II/V nephritis8
Proteinuria >0.5 g/24h4
Pleural/pericardial effusion5
Acute pericarditis6
Seizure5
Psychosis3
Autoimmune hemolysis4
Thrombocytopenia4
Leukopenia3
Immunological
Anti-dsDNA antibody6
Low C3 AND low C44
Low C3 OR low C43
Anticardiolipin/anti-β2GPI antibodies2
Classify as SLE if score ≥10 (with at least one clinical criterion).

Treatment

Management is tailored to disease severity and organ involvement.

Non-pharmacological

  • Avoid UV light exposure; use sunscreen consistently
  • Rest during flares; maintain cardiovascular health
  • Patient education about disease triggers and monitoring

Conventional Medical Therapy

1. NSAIDs - for mild symptoms, arthralgia, fever, serositis (use cautiously given renal disease risk)
2. Hydroxychloroquine (HCQ) - the cornerstone of SLE therapy
  • Dose: 200-400 mg/day (≤5 mg/kg actual body weight)
  • Reduces flares, damage accrual, and mortality
  • Safe in pregnancy; annual ophthalmology screening needed
3. Corticosteroids
  • Oral prednisone 5-30 mg/day for constitutional symptoms, arthritis, serositis, skin disease
  • High-dose IV methylprednisolone ("pulse") for severe flares and organ-threatening disease
  • Side effects: osteonecrosis, osteoporosis, cataracts, diabetes, hypertension - limit long-term use
4. Immunosuppressives
  • Mycophenolate mofetil (MMF): First-line for lupus nephritis (induction + maintenance)
  • Cyclophosphamide: IV pulses for severe proliferative nephritis or severe NPSLE
  • Azathioprine: Maintenance therapy, safe in pregnancy
  • Methotrexate (15-25 mg/week): Cutaneous and articular disease; not for pregnancy
  • Calcineurin inhibitors (tacrolimus, cyclosporine, voclosporin): Lupus nephritis, particularly membranous

Biologic Therapies

AgentMechanismIndication
BelimumabAnti-BAFF (blocks B-cell survival)Moderately active SLE; approved for lupus nephritis
AnifrolumabAnti-type I IFN receptorModerate-to-severe SLE on standard background therapy
RituximabAnti-CD20 (B cell depletion)Refractory nephritis/cytopenias (off-label)
ObinutuzumabAnti-CD20 (enhanced B cell depletion)Lupus nephritis (Phase III RCT, PMID 39927615, NEJM 2025 - showed efficacy and safety)
A 2025 Phase III RCT published in the New England Journal of Medicine found obinutuzumab effective and safe in active lupus nephritis, representing a significant advance in B cell-targeted therapy for this indication.

Adjunctive and Special Situations

  • Hypertension control: ACE inhibitors or ARBs (also reduce proteinuria)
  • Thrombosis prevention: Long-term anticoagulation (warfarin) for patients with APS and prior thrombosis
  • IVIG: For refractory disease or lupus-related TTP
  • Plasmapheresis: Life-threatening complications with clearly attributable pathogenic antibodies

Pregnancy in SLE

  • Increased risk of pre-eclampsia, fetal loss, preterm birth - especially with active disease or APS
  • Pregnancy should be planned during disease remission
  • Low-activity disease without antiphospholipid antibodies: combined oral contraceptives do not significantly increase flare risk
  • Moderate/severe disease: progestin-only contraception recommended
  • Neonatal lupus (anti-Ro/SSA mediated): neonatal heart block and transient skin rash

Prognosis & Monitoring

  • 10-year survival is now >90% in developed countries with modern therapy (vs. ~50% in the 1950s)
  • Major causes of death: infection (from immunosuppression), renal failure, cardiovascular disease (accelerated atherosclerosis), and disease flares
  • Disease activity monitoring: SLEDAI score, anti-dsDNA titers, complement levels (C3/C4 drop during active disease), urinalysis, CBC, renal function
  • Damage accrual (irreversible organ damage) measured by SLICC Damage Index

Sources:
  • Cellular and Molecular Immunology, 10e (Abbas & Lichtman), p. 1274-1275 - Pathogenesis
  • Firestein & Kelley's Textbook of Rheumatology, 2-Volume Set - Neutrophil/NET pathogenesis
  • GOLDMAN-CECIL MEDICINE, 2-Volume Set - Classification criteria, treatment
  • Andrews' Diseases of the Skin - Cutaneous manifestations
  • Obinutuzumab RCT: Furie RA et al., N Engl J Med, 2025 [PMID 39927615]
  • Su X et al., Mol Biomed 2024 - Pathogenesis and targeted therapy review [PMID 39472388]

Create a mind map for this

Running Command

ls /home/daytona/workspace/ 2>/dev/null || echo "workspace empty or not found"

Writing File

~/sle-mindmap/index.html

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SLE Mind Map</title>
<style>
  * { margin: 0; padding: 0; box-sizing: border-box; }
  body {
    background: #0f1117;
    font-family: 'Segoe UI', system-ui, sans-serif;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
  }
  #canvas-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    cursor: grab;
  }
  #canvas-wrapper:active { cursor: grabbing; }
  svg#mindmap {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
  }
  .controls {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 100;
  }
  .controls button {
    background: #1e2130;
    border: 1px solid #3a3f55;
    color: #cdd6f4;
    padding: 8px 18px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
  }
  .controls button:hover { background: #2a2f45; }
  .legend {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #1e2130cc;
    border: 1px solid #3a3f55;
    border-radius: 12px;
    padding: 14px 18px;
    color: #cdd6f4;
    font-size: 12px;
    z-index: 100;
  }
  .legend h4 { margin-bottom: 8px; color: #89b4fa; font-size: 13px; }
  .legend-item { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
  .legend-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
  .title-badge {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: white;
    padding: 8px 24px;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    z-index: 100;
    box-shadow: 0 4px 20px #7c3aed66;
  }
  .tooltip {
    position: fixed;
    background: #1e2130ee;
    border: 1px solid #4a4f6a;
    border-radius: 10px;
    padding: 10px 14px;
    color: #cdd6f4;
    font-size: 12.5px;
    max-width: 260px;
    line-height: 1.5;
    pointer-events: none;
    z-index: 200;
    display: none;
    box-shadow: 0 8px 24px #00000088;
  }
  .tooltip b { color: #89b4fa; display: block; margin-bottom: 4px; font-size: 13px; }
</style>
</head>
<body>

<div class="title-badge">🔬 Systemic Lupus Erythematosus (SLE)</div>

<div class="legend">
  <h4>Branches</h4>
  <div class="legend-item"><div class="legend-dot" style="background:#f38ba8"></div> Pathogenesis</div>
  <div class="legend-item"><div class="legend-dot" style="background:#fab387"></div> Clinical Features</div>
  <div class="legend-item"><div class="legend-dot" style="background:#a6e3a1"></div> Autoantibodies</div>
  <div class="legend-item"><div class="legend-dot" style="background:#89dceb"></div> Diagnosis</div>
  <div class="legend-item"><div class="legend-dot" style="background:#cba6f7"></div> Treatment</div>
  <div class="legend-item"><div class="legend-dot" style="background:#f9e2af"></div> Prognosis</div>
</div>

<div id="canvas-wrapper">
  <svg id="mindmap"></svg>
</div>

<div class="controls">
  <button onclick="zoomIn()">+ Zoom In</button>
  <button onclick="resetView()">⟳ Reset</button>
  <button onclick="zoomOut()">− Zoom Out</button>
</div>

<div class="tooltip" id="tooltip"></div>

<script>
const W = window.innerWidth;
const H = window.innerHeight;
const cx = W / 2;
const cy = H / 2;

// ── Data ──────────────────────────────────────────────────────────────────────
const mindmapData = {
  id: "root",
  label: "SLE",
  sublabel: "Systemic Lupus\nErythematosus",
  color: "#cba6f7",
  glow: "#7c3aed",
  children: [
    {
      id: "patho",
      label: "Pathogenesis",
      color: "#f38ba8",
      angle: -100,
      dist: 210,
      tooltip: "Complex interplay of genetic, environmental & immune factors leading to autoimmunity",
      children: [
        { id: "p1", label: "Type I IFN\nSignature", tooltip: "Plasmacytoid DCs produce excess IFN-α; striking interferon gene signature in blood cells" },
        { id: "p2", label: "TLR Activation\n(TLR7/TLR9)", tooltip: "Self-DNA/RNA activates TLR9/TLR7 on autoreactive B cells; requires defective nuclear clearance" },
        { id: "p3", label: "NETs & LDGs", tooltip: "Low-Density Granulocytes form NETs → release modified self-antigens → amplify type I IFN & vasculopathy" },
        { id: "p4", label: "Genetic Factors", tooltip: "HLA-DR2/DR3 (OR 2-5), C1q/C2/C4 deficiency, FcγRIIB polymorphism, PTPN22, TREX1" },
        { id: "p5", label: "UV Light\nTrigger", tooltip: "UV causes apoptosis of skin cells → nuclear antigen release → immune complex formation" },
        { id: "p6", label: "Immune Complex\nDeposition", tooltip: "Anti-nuclear antibodies form complexes that deposit in vessel walls, glomeruli → complement activation → tissue injury" },
      ]
    },
    {
      id: "clinical",
      label: "Clinical Features",
      color: "#fab387",
      angle: -30,
      dist: 220,
      tooltip: "Multisystem disease with remitting/relapsing course",
      children: [
        { id: "c1", label: "Mucocutaneous\n(80%)", tooltip: "Malar (butterfly) rash, discoid rash, photosensitivity, oral ulcers, alopecia, bullous lupus" },
        { id: "c2", label: "Musculoskeletal", tooltip: "Non-erosive symmetric arthritis/arthralgia; Jaccoud arthropathy; myositis" },
        { id: "c3", label: "Renal\n(Lupus Nephritis)", tooltip: "Class I-VI (ISN/RPS); Class IV diffuse GN most severe; red cell casts, proteinuria; major cause of morbidity" },
        { id: "c4", label: "Neuropsychiatric", tooltip: "Seizures, psychosis, cognitive dysfunction, stroke, transverse myelitis; MRI: white matter lesions, infarcts" },
        { id: "c5", label: "Cardiopulmonary", tooltip: "Pleuritis, pericarditis, Libman-Sacks endocarditis, accelerated atherosclerosis, pulmonary HTN" },
        { id: "c6", label: "Hematologic", tooltip: "AIHA (Coombs+), thrombocytopenia, leukopenia/lymphopenia, antiphospholipid syndrome (~21%)" },
        { id: "c7", label: "Constitutional", tooltip: "Fever, fatigue, weight loss – common during flares" },
      ]
    },
    {
      id: "antibodies",
      label: "Autoantibodies",
      color: "#a6e3a1",
      angle: 40,
      dist: 210,
      tooltip: "Multiple autoantibodies present; correlate with disease activity & organ involvement",
      children: [
        { id: "ab1", label: "ANA (~99%)", tooltip: "Antinuclear antibody – sensitive but not specific; entry criterion for EULAR/ACR classification" },
        { id: "ab2", label: "Anti-dsDNA\n(~70%)", tooltip: "High specificity for SLE; titers correlate with disease activity & nephritis flares" },
        { id: "ab3", label: "Anti-Sm\n(~38%)", tooltip: "Anti-Smith antibody – highly specific for SLE (low sensitivity)" },
        { id: "ab4", label: "Anti-Ro/La\n(49%/35%)", tooltip: "Anti-Ro (SSA) – neonatal lupus, photosensitivity; Anti-La (SSB) – Sjögren overlap" },
        { id: "ab5", label: "Antiphospholipid\n(~21%)", tooltip: "aCL, anti-β2GPI, lupus anticoagulant → thrombosis, recurrent pregnancy loss (APS)" },
        { id: "ab6", label: "Anti-RNP\n(~33%)", tooltip: "High titers → MCTD overlap; Anti-ribosomal P (~10%) → neuropsychiatric lupus" },
      ]
    },
    {
      id: "diagnosis",
      label: "Diagnosis",
      color: "#89dceb",
      angle: 110,
      dist: 215,
      tooltip: "Clinical diagnosis supported by lab findings; EULAR/ACR 2019 criteria are gold standard",
      children: [
        { id: "d1", label: "EULAR/ACR 2019\nCriteria", tooltip: "ANA ≥1:80 entry criterion; score ≥10 = SLE; weighted domains (clinical + immunological)" },
        { id: "d2", label: "Key Lab Tests", tooltip: "ANA, anti-dsDNA, anti-Sm, complement C3/C4, CBC, urinalysis with microscopy, creatinine" },
        { id: "d3", label: "Renal Biopsy", tooltip: "Guides management; identifies lupus nephritis class (I-VI); shows immune complex deposits, GN pattern" },
        { id: "d4", label: "Disease\nMonitoring", tooltip: "SLEDAI score, anti-dsDNA titers, complement levels (C3/C4 fall with active disease), urinalysis" },
        { id: "d5", label: "Imaging", tooltip: "MRI for NPSLE (white matter lesions, infarcts); echocardiography for cardiac involvement" },
      ]
    },
    {
      id: "treatment",
      label: "Treatment",
      color: "#cba6f7",
      angle: 170,
      dist: 220,
      tooltip: "Tailored to disease severity and organ involvement; aim for remission & damage prevention",
      children: [
        { id: "t1", label: "Hydroxychloroquine\n(Cornerstone)", tooltip: "200-400 mg/day (≤5 mg/kg); reduces flares, damage, mortality; safe in pregnancy; annual eye checks" },
        { id: "t2", label: "Corticosteroids", tooltip: "Prednisone 5-30 mg/day for moderate disease; IV methylprednisolone pulses for severe flares; limit long-term use" },
        { id: "t3", label: "Immunosuppressives", tooltip: "MMF (nephritis); Cyclophosphamide (severe nephritis/NPSLE); Azathioprine (maintenance/pregnancy); Methotrexate (skin/joints)" },
        { id: "t4", label: "Biologics", tooltip: "Belimumab (anti-BAFF); Anifrolumab (anti-IFN-R, approved 2021); Rituximab (refractory, off-label); Obinutuzumab (nephritis, NEJM 2025)" },
        { id: "t5", label: "Calcineurin\nInhibitors", tooltip: "Tacrolimus, cyclosporine, voclosporin (23.7 mg BID) – particularly for membranous lupus nephritis" },
        { id: "t6", label: "Adjuncts", tooltip: "ACE inhibitor/ARB for HTN + proteinuria; warfarin for APS thrombosis; IVIG for refractory/TTP; sunscreen" },
      ]
    },
    {
      id: "prognosis",
      label: "Prognosis",
      color: "#f9e2af",
      angle: -160,
      dist: 200,
      tooltip: "10-year survival >90% with modern therapy (was ~50% in 1950s)",
      children: [
        { id: "pr1", label: "Survival", tooltip: "10-year survival >90% with modern management; much improved vs historical outcomes" },
        { id: "pr2", label: "Causes of Death", tooltip: "Infection (immunosuppression), renal failure, cardiovascular disease (accelerated atherosclerosis), disease flares" },
        { id: "pr3", label: "Damage Accrual", tooltip: "Measured by SLICC Damage Index; irreversible organ damage accumulates over time" },
        { id: "pr4", label: "Pregnancy", tooltip: "Plan during remission; risk of pre-eclampsia, fetal loss; neonatal lupus if anti-Ro+; hydroxychloroquine continued" },
        { id: "pr5", label: "Epidemiology", tooltip: "F:M = 10:1; predominant in ages 20-60; higher incidence/severity in Black women (~1 in 250 vs 1 in 700 overall)" },
      ]
    }
  ]
};

// ── Layout ────────────────────────────────────────────────────────────────────
const svg = document.getElementById('mindmap');
const ns = 'http://www.w3.org/2000/svg';
let viewX = 0, viewY = 0, scale = 1;
let isDragging = false, dragStart = { x: 0, y: 0 }, viewStart = { x: 0, y: 0 };

function toRad(deg) { return deg * Math.PI / 180; }

function computePositions() {
  const nodes = [];
  const edges = [];
  const root = { id: 'root', x: cx, y: cy, label: mindmapData.sublabel, color: mindmapData.color, glow: mindmapData.glow, r: 54, isRoot: true, tooltip: 'Chronic multisystem autoimmune disease; classic immune complex disease; F:M = 10:1' };
  nodes.push(root);

  mindmapData.children.forEach((branch) => {
    const bAngle = toRad(branch.angle);
    const bx = cx + branch.dist * Math.cos(bAngle);
    const by = cy + branch.dist * Math.sin(bAngle);
    const bNode = { id: branch.id, x: bx, y: by, label: branch.label, color: branch.color, r: 38, isBranch: true, tooltip: branch.tooltip };
    nodes.push(bNode);
    edges.push({ from: root, to: bNode, color: branch.color, thick: true });

    const nKids = branch.children.length;
    branch.children.forEach((child, i) => {
      const spread = 70;
      const childAngle = bAngle + toRad(-spread/2 + (spread/(nKids-1||1))*i);
      const childDist = 150;
      const childX = bx + childDist * Math.cos(childAngle);
      const childY = by + childDist * Math.sin(childAngle);
      const cNode = { id: child.id, x: childX, y: childY, label: child.label, color: branch.color, r: 26, isLeaf: true, tooltip: child.tooltip };
      nodes.push(cNode);
      edges.push({ from: bNode, to: cNode, color: branch.color, thick: false });
    });
  });

  return { nodes, edges };
}

function getTransform() {
  return `translate(${viewX}, ${viewY}) scale(${scale})`;
}

function renderMindmap() {
  svg.innerHTML = '';

  // Defs
  const defs = document.createElementNS(ns, 'defs');

  // Radial gradient for root
  const rg = document.createElementNS(ns, 'radialGradient');
  rg.setAttribute('id', 'rootGrad');
  rg.innerHTML = `<stop offset="0%" stop-color="#9b59b6"/><stop offset="100%" stop-color="#6c3483"/>`;
  defs.appendChild(rg);

  // Glow filters
  ['f38ba8','fab387','a6e3a1','89dceb','cba6f7','f9e2af'].forEach((c, i) => {
    const f = document.createElementNS(ns, 'filter');
    f.setAttribute('id', `glow${i}`);
    f.setAttribute('x', '-50%'); f.setAttribute('y', '-50%');
    f.setAttribute('width', '200%'); f.setAttribute('height', '200%');
    f.innerHTML = `<feGaussianBlur stdDeviation="6" result="blur"/><feMerge><feMergeNode in="blur"/><feMergeNode in="SourceGraphic"/></feMerge>`;
    defs.appendChild(f);
  });

  // Root glow
  const rf = document.createElementNS(ns, 'filter');
  rf.setAttribute('id', 'rootGlow');
  rf.setAttribute('x', '-60%'); rf.setAttribute('y', '-60%');
  rf.setAttribute('width', '220%'); rf.setAttribute('height', '220%');
  rf.innerHTML = `<feGaussianBlur stdDeviation="12" result="blur"/><feMerge><feMergeNode in="blur"/><feMergeNode in="SourceGraphic"/></feMerge>`;
  defs.appendChild(rf);

  svg.appendChild(defs);

  const g = document.createElementNS(ns, 'g');
  g.setAttribute('id', 'main-group');
  g.setAttribute('transform', getTransform());
  svg.appendChild(g);

  const { nodes, edges } = computePositions();

  // Draw edges first
  edges.forEach(e => {
    const path = document.createElementNS(ns, 'path');
    const dx = e.to.x - e.from.x;
    const dy = e.to.y - e.from.y;
    const mx = e.from.x + dx * 0.5;
    const my = e.from.y + dy * 0.5;
    const d = `M ${e.from.x} ${e.from.y} Q ${mx} ${e.from.y} ${e.to.x} ${e.to.y}`;
    path.setAttribute('d', d);
    path.setAttribute('stroke', e.color);
    path.setAttribute('stroke-width', e.thick ? 3 : 1.8);
    path.setAttribute('fill', 'none');
    path.setAttribute('opacity', e.thick ? '0.7' : '0.5');
    path.setAttribute('stroke-linecap', 'round');
    g.appendChild(path);
  });

  // Draw nodes
  const colorGlowMap = {'#f38ba8':0,'#fab387':1,'#a6e3a1':2,'#89dceb':3,'#cba6f7':4,'#f9e2af':5};

  nodes.forEach(node => {
    const grp = document.createElementNS(ns, 'g');
    grp.setAttribute('cursor', 'pointer');
    grp.setAttribute('data-tooltip', node.tooltip || '');
    grp.setAttribute('data-label', node.label.replace(/\n/g, ' '));

    if (node.isRoot) {
      // Outer glow ring
      const glow = document.createElementNS(ns, 'circle');
      glow.setAttribute('cx', node.x); glow.setAttribute('cy', node.y);
      glow.setAttribute('r', node.r + 14);
      glow.setAttribute('fill', 'none');
      glow.setAttribute('stroke', '#a855f7');
      glow.setAttribute('stroke-width', '2');
      glow.setAttribute('opacity', '0.4');
      glow.setAttribute('filter', 'url(#rootGlow)');
      g.appendChild(glow);

      const circ = document.createElementNS(ns, 'circle');
      circ.setAttribute('cx', node.x); circ.setAttribute('cy', node.y);
      circ.setAttribute('r', node.r);
      circ.setAttribute('fill', 'url(#rootGrad)');
      circ.setAttribute('stroke', '#e0a3ff');
      circ.setAttribute('stroke-width', '2.5');
      circ.setAttribute('filter', 'url(#rootGlow)');
      grp.appendChild(circ);

      // Text lines
      const lines = node.label.split('\n');
      lines.forEach((line, i) => {
        const t = document.createElementNS(ns, 'text');
        t.setAttribute('x', node.x);
        t.setAttribute('y', node.y + (i - (lines.length-1)/2) * 16 + 1);
        t.setAttribute('text-anchor', 'middle');
        t.setAttribute('dominant-baseline', 'middle');
        t.setAttribute('fill', 'white');
        t.setAttribute('font-size', i === 0 ? '14' : '11');
        t.setAttribute('font-weight', i === 0 ? '800' : '500');
        t.setAttribute('pointer-events', 'none');
        t.textContent = line;
        grp.appendChild(t);
      });
    } else if (node.isBranch) {
      const glowIdx = colorGlowMap[node.color] || 0;
      const circ = document.createElementNS(ns, 'circle');
      circ.setAttribute('cx', node.x); circ.setAttribute('cy', node.y);
      circ.setAttribute('r', node.r);
      circ.setAttribute('fill', node.color + '33');
      circ.setAttribute('stroke', node.color);
      circ.setAttribute('stroke-width', '2.5');
      circ.setAttribute('filter', `url(#glow${glowIdx})`);
      grp.appendChild(circ);

      const lines = node.label.split('\n');
      lines.forEach((line, i) => {
        const t = document.createElementNS(ns, 'text');
        t.setAttribute('x', node.x);
        t.setAttribute('y', node.y + (i - (lines.length-1)/2) * 13 + 1);
        t.setAttribute('text-anchor', 'middle');
        t.setAttribute('dominant-baseline', 'middle');
        t.setAttribute('fill', node.color);
        t.setAttribute('font-size', '11.5');
        t.setAttribute('font-weight', '700');
        t.setAttribute('pointer-events', 'none');
        t.textContent = line;
        grp.appendChild(t);
      });
    } else {
      // Leaf - rounded rect
      const lines = node.label.split('\n');
      const rw = Math.max(...lines.map(l => l.length)) * 5.5 + 18;
      const rh = lines.length * 16 + 14;

      const rect = document.createElementNS(ns, 'rect');
      rect.setAttribute('x', node.x - rw/2);
      rect.setAttribute('y', node.y - rh/2);
      rect.setAttribute('width', rw);
      rect.setAttribute('height', rh);
      rect.setAttribute('rx', '10');
      rect.setAttribute('fill', node.color + '22');
      rect.setAttribute('stroke', node.color);
      rect.setAttribute('stroke-width', '1.5');
      grp.appendChild(rect);

      lines.forEach((line, i) => {
        const t = document.createElementNS(ns, 'text');
        t.setAttribute('x', node.x);
        t.setAttribute('y', node.y + (i - (lines.length-1)/2) * 14 + 1);
        t.setAttribute('text-anchor', 'middle');
        t.setAttribute('dominant-baseline', 'middle');
        t.setAttribute('fill', node.color);
        t.setAttribute('font-size', '10');
        t.setAttribute('font-weight', '600');
        t.setAttribute('pointer-events', 'none');
        t.textContent = line;
        grp.appendChild(t);
      });
    }

    // Hover tooltip
    grp.addEventListener('mouseenter', (e) => {
      const tt = document.getElementById('tooltip');
      const tip = grp.getAttribute('data-tooltip');
      const lbl = grp.getAttribute('data-label');
      if (!tip) return;
      tt.innerHTML = `<b>${lbl}</b>${tip}`;
      tt.style.display = 'block';
    });
    grp.addEventListener('mousemove', (e) => {
      const tt = document.getElementById('tooltip');
      tt.style.left = (e.clientX + 14) + 'px';
      tt.style.top = (e.clientY - 10) + 'px';
    });
    grp.addEventListener('mouseleave', () => {
      document.getElementById('tooltip').style.display = 'none';
    });

    g.appendChild(grp);
  });
}

// ── Pan & Zoom ────────────────────────────────────────────────────────────────
function applyTransform() {
  const g = document.getElementById('main-group');
  if (g) g.setAttribute('transform', getTransform());
}

function zoomIn() { scale = Math.min(scale * 1.25, 4); applyTransform(); }
function zoomOut() { scale = Math.max(scale * 0.8, 0.3); applyTransform(); }
function resetView() { viewX = 0; viewY = 0; scale = 1; applyTransform(); }

const wrapper = document.getElementById('canvas-wrapper');

wrapper.addEventListener('mousedown', e => {
  isDragging = true;
  dragStart = { x: e.clientX, y: e.clientY };
  viewStart = { x: viewX, y: viewY };
});
window.addEventListener('mousemove', e => {
  if (!isDragging) return;
  viewX = viewStart.x + (e.clientX - dragStart.x);
  viewY = viewStart.y + (e.clientY - dragStart.y);
  applyTransform();
});
window.addEventListener('mouseup', () => isDragging = false);

wrapper.addEventListener('wheel', e => {
  e.preventDefault();
  const delta = e.deltaY > 0 ? 0.9 : 1.1;
  const rect = svg.getBoundingClientRect();
  const mx = e.clientX - rect.left;
  const my = e.clientY - rect.top;
  viewX = mx - (mx - viewX) * delta;
  viewY = my - (my - viewY) * delta;
  scale = Math.max(0.3, Math.min(4, scale * delta));
  applyTransform();
}, { passive: false });

// Touch support
let lastTouchDist = null;
wrapper.addEventListener('touchstart', e => {
  if (e.touches.length === 1) {
    isDragging = true;
    dragStart = { x: e.touches[0].clientX, y: e.touches[0].clientY };
    viewStart = { x: viewX, y: viewY };
  }
});
wrapper.addEventListener('touchmove', e => {
  e.preventDefault();
  if (e.touches.length === 1 && isDragging) {
    viewX = viewStart.x + (e.touches[0].clientX - dragStart.x);
    viewY = viewStart.y + (e.touches[0].clientY - dragStart.y);
    applyTransform();
  } else if (e.touches.length === 2) {
    const dx = e.touches[0].clientX - e.touches[1].clientX;
    const dy = e.touches[0].clientY - e.touches[1].clientY;
    const dist = Math.sqrt(dx*dx + dy*dy);
    if (lastTouchDist) {
      scale = Math.max(0.3, Math.min(4, scale * (dist / lastTouchDist)));
      applyTransform();
    }
    lastTouchDist = dist;
  }
}, { passive: false });
wrapper.addEventListener('touchend', () => { isDragging = false; lastTouchDist = null; });

renderMindmap();
</script>
</body>
</html>
Running Command

ls -lh /home/daytona/workspace/sle-mindmap/

Your SLE mind map is ready! Download it here:

index

HTML File · HTML

What's included in the mind map:

The map has 6 color-coded branches radiating from the central SLE node:
ColorBranchKey leaf nodes
🔴 RedPathogenesisType I IFN, TLR activation, NETs/LDGs, Genetic factors, UV trigger, Immune complexes
🟠 OrangeClinical FeaturesMucocutaneous, Musculoskeletal, Renal, Neuropsychiatric, Cardiopulmonary, Hematologic, Constitutional
🟢 GreenAutoantibodiesANA, Anti-dsDNA, Anti-Sm, Anti-Ro/La, Antiphospholipid, Anti-RNP
🔵 CyanDiagnosisEULAR/ACR 2019, Key labs, Renal biopsy, Monitoring, Imaging
🟣 PurpleTreatmentHydroxychloroquine, Corticosteroids, Immunosuppressives, Biologics, Calcineurin inhibitors, Adjuncts
🟡 YellowPrognosisSurvival, Causes of death, Damage accrual, Pregnancy, Epidemiology

Interactive features:

  • Hover over any node to see a detailed tooltip with clinical facts
  • Drag to pan around the map
  • Scroll wheel / pinch to zoom in/out
  • Zoom In / Reset / Zoom Out buttons at the bottom
This is a shared conversation. Sign in to Orris to start your own chat.