
Cardiology Visual System
- 40 installs
- 5 repo stars
- Updated June 18, 2026
- drshailesh88/integrated_content_os
Route cardiology visual requests to the right tool: Fal.ai for imagery, Gemini for infographics, Mermaid for diagrams, Marp for slides, Plotly for charts.
About
This meta-skill routes cardiology visual-content requests to the optimal tool, from Fal.ai imagery and Gemini infographics to Mermaid diagrams, Marp slides, and Plotly charts. Cardiology content creators use it to handle all visual needs within Claude Code.
- Automatic routing by request keywords to the best visual tool
- Covers images, infographics, flowcharts, slides, and data visualization
Cardiology Visual System by the numbers
- 40 all-time installs (skills.sh)
- Ranked #929 of 1,337 Generative Media skills by installs in the Skillselion catalog
- Data as of Jul 29, 2026 (Skillselion catalog sync)
npx skills add https://github.com/drshailesh88/integrated_content_os --skill cardiology-visual-systemAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 40 |
|---|---|
| repo stars | ★ 5 |
| Last updated | June 18, 2026 |
| Repository | drshailesh88/integrated_content_os ↗ |
What it does
Route cardiology visual requests to the right tool: Fal.ai for imagery, Gemini for infographics, Mermaid for diagrams, Marp for slides, Plotly for charts.
Files
Cardiology Visual System
A unified meta-skill that intelligently routes visual content requests to the optimal tool. No more switching between Napkin.ai, NotebookLM, or other subscriptions—everything happens in Claude Code.
Quick Reference: What Tool Does What
| You Ask For | Tool Used | Output |
|---|---|---|
| Blog header, lifestyle photo, patient scenario | Fal.ai | PNG image |
| Infographic, explainer graphic, medical illustration | Gemini | PNG/JPG image |
| Flowchart, treatment algorithm, clinical pathway | Mermaid | SVG/PNG diagram |
| Slide deck, presentation | Marp | PPTX/PDF/HTML slides |
| Data chart, trial results, trends over time | Plotly | Interactive HTML or PNG |
| Interactive explainer, dashboard | React Artifact | Interactive HTML |
| Quick visualization prototype, exploratory data viz | LIDA ⚠️ | PNG + Code (prototype only) |
Automatic Routing Logic
When you ask for visuals, I determine the best tool by analyzing your request:
→ Route to Fal.ai (Stock/Human Imagery)
Keywords: blog image, header, hero image, lifestyle, patient photo, stock, person, family, emotional, scenario
Best for:
- Blog post headers
- Patient experience illustrations
- Lifestyle/wellness imagery
- Emotional/human-centered scenes
- Recovery and hope imagery
NOT for: Medical devices, ECGs, diagrams, data, or text-heavy content
→ Route to Gemini (Infographics & Medical Illustrations)
Keywords: infographic, explainer, illustration, visual summary, concept diagram, icons, steps, process visual, simplified, educational graphic
Best for:
- Infographics (like Napkin.ai produces)
- Medical concept illustrations
- Simplified explainer graphics
- Educational visuals with icons
- Text-in-image content
- Visual summaries of articles
→ Route to Mermaid (Diagrams & Flowcharts)
Keywords: flowchart, algorithm, pathway, decision tree, sequence, timeline, process flow, treatment algorithm, diagnostic pathway, workflow
Best for:
- Clinical decision trees
- Treatment algorithms
- Diagnostic pathways
- Process workflows
- Organizational charts
- Sequence diagrams
- Gantt charts for timelines
→ Route to Marp (Slide Decks)
Keywords: slides, presentation, deck, powerpoint, lecture, talk, keynote
Best for:
- Conference presentations
- Educational lectures
- Patient education slides
- Grand rounds presentations
- CME content
→ Route to Plotly (Data Visualization)
Keywords: chart, graph, plot, data, statistics, trial results, forest plot, trends, comparison, survival curve, Kaplan-Meier, bar chart, line graph, scatter
Best for:
- Clinical trial results
- Statistical comparisons
- Trends over time
- Forest plots
- Survival curves
- Before/after data
- Multi-study comparisons
→ Route to React Artifact (Interactive)
Keywords: interactive, dashboard, calculator, tool, widget, animated, explorable
Best for:
- Risk calculators
- Interactive explainers
- Animated diagrams
- Patient education tools
- Explorable explanations
→ Route to LIDA (Quick Prototyping) ⚠️ PROTOTYPING ONLY
Keywords: quick, prototype, exploratory, rough draft, multiple options, try, experiment, brainstorm visualization
⚠️ CRITICAL LIMITATIONS:
- PROTOTYPING ONLY - NOT for publication or patient-facing materials
- Quality varies - ALWAYS review for medical accuracy
- Works best with ≤10 data columns
- No specialized medical charts (true forest plots, Kaplan-Meier)
- Requires manual validation before ANY use
Best for:
- Quick exploratory data visualization ("what does this data show?")
- Generating multiple visualization candidates
- Brainstorming chart types for new data
- Internal research review only
NOT for:
- Publication-ready charts → Use Plotly instead
- Patient-facing materials → Use production tools
- Regulatory submissions → Never
- Final blog posts → Use Plotly or Gemini
When in doubt, use Plotly for data visualization instead of LIDA.
---
Tool 1: Fal.ai (Blog Imagery)
Setup
export FAL_KEY="your-fal-api-key"
# Get key from: https://fal.ai/dashboard/keysUsage
python scripts/fal_image.py "A 55-year-old man experiencing chest pain at work" --output hero.pngModels
| Model | Cost | Best For |
|---|---|---|
fal-ai/recraft-v3 | $0.04 | Default - Best quality |
fal-ai/flux-pro/v1.1 | $0.04 | Photorealism |
fal-ai/flux/schnell | $0.003 | Fast/cheap drafts |
What to Generate vs Not Generate
✅ GENERATE:
- Patient symptoms/experiences (chest pain, shortness of breath)
- Lifestyle scenes (exercise, healthy cooking)
- Doctor-patient conversations
- Family support moments
- Recovery celebrations
❌ DO NOT GENERATE:
- Medical devices (pacemakers, stents, valves)
- Clinical imagery (ECGs, angiograms, OR scenes)
- Anatomical diagrams
- Medications
---
Tool 2: Gemini (Infographics)
Setup
export GEMINI_API_KEY="your-gemini-api-key"Usage
python scripts/gemini_infographic.py \
--topic "Heart Failure Stages" \
--style "minimalist medical" \
--output hf_stages.jpgPrompting for Medical Infographics
Structure your prompt:
Create a [STYLE] infographic showing [TOPIC].
Include:
- [Key point 1]
- [Key point 2]
- [Key point 3]
Style: [clean/minimalist/modern medical], use icons, clear hierarchy,
professional color palette (blues, teals for medical), easy to read textExample prompts:
1. Disease Progression:
"Create a minimalist medical infographic showing the 4 stages of heart failure (A, B, C, D). Use icons for each stage, show progression with arrows, include brief descriptions. Clean layout, medical blue color scheme."
2. Treatment Comparison:
"Create an infographic comparing medication vs intervention for AFib. Two columns, icons for each approach, bullet points for pros/cons. Modern medical style."
3. Risk Factor Summary:
"Create a visual summary of 7 modifiable risk factors for heart disease. Icon for each factor, clean grid layout, actionable tips. Professional medical illustration style."
---
Tool 3: Mermaid (Diagrams)
You have Mermaid Chart MCP connected. Use it for structured diagrams.
Common Cardiology Diagram Types
1. Treatment Algorithm:
flowchart TD
A[Acute Chest Pain] --> B{STEMI?}
B -->|Yes| C[Primary PCI < 90 min]
B -->|No| D{High-risk NSTEMI?}
D -->|Yes| E[Early invasive < 24h]
D -->|No| F[Ischemia-guided strategy]2. Clinical Pathway:
flowchart LR
A[Diagnosis] --> B[Risk Stratification]
B --> C[Treatment Selection]
C --> D[Follow-up Protocol]3. Diagnostic Decision Tree:
flowchart TD
A[Dyspnea] --> B{BNP elevated?}
B -->|Yes| C{Echo findings?}
B -->|No| D[Consider other causes]
C -->|HFrEF| E[GDMT initiation]
C -->|HFpEF| F[Diuretics + address comorbidities]4. Timeline (Gantt):
gantt
title Post-MI Care Timeline
dateFormat YYYY-MM-DD
section Acute
Hospital stay :a1, 2024-01-01, 5d
section Recovery
Cardiac rehab :a2, after a1, 12w
section Long-term
Medication titration :a3, after a1, 6m---
Tool 4: Marp (Slides)
Setup
npm install -g @marp-team/marp-cliUsage
1. I write Markdown with Marp syntax 2. Save as presentation.md 3. Convert:
marp presentation.md --pptx # PowerPoint
marp presentation.md --pdf # PDF
marp presentation.md -o slides.html # HTMLMarp Template for Medical Slides
---
marp: true
theme: default
paginate: true
backgroundColor: #ffffff
color: #333333
---
# Heart Failure Management
## Modern Approaches in 2024
Dr. [Your Name]
Interventional Cardiology
---
# Agenda
1. Current Guidelines
2. New Therapies
3. Case Discussion
---
# Key Statistics
- 6.7 million Americans with HF
- 50% mortality at 5 years
- $30.7 billion annual cost

---
# Treatment Algorithm
flowchart TD A[HFrEF Diagnosis] --> B[GDMT Initiation] B --> C[Titrate to target doses]
---
# Take-Home Points
1. Early initiation matters
2. Quadruple therapy is standard
3. Device therapy in appropriate patients
---
# Questions?
Contact: your@email.com---
Tool 5: Plotly (Data Visualization)
Setup
pip install plotly kaleido pandas --break-system-packagesCommon Medical Visualizations
1. Bar Chart (Trial Results):
import plotly.express as px
data = {
'Treatment': ['Drug A', 'Drug B', 'Placebo'],
'Event Rate (%)': [12.3, 15.1, 18.7]
}
fig = px.bar(data, x='Treatment', y='Event Rate (%)',
title='Primary Endpoint: Major Cardiovascular Events',
color='Treatment')
fig.write_html('trial_results.html')
fig.write_image('trial_results.png')2. Forest Plot Style:
import plotly.graph_objects as go
studies = ['PARADIGM-HF', 'DAPA-HF', 'EMPEROR-Reduced']
hr = [0.80, 0.74, 0.75]
lower = [0.73, 0.65, 0.65]
upper = [0.87, 0.85, 0.86]
fig = go.Figure()
for i, study in enumerate(studies):
fig.add_trace(go.Scatter(
x=[lower[i], upper[i]], y=[study, study],
mode='lines', line=dict(color='gray', width=2)
))
fig.add_trace(go.Scatter(
x=[hr[i]], y=[study],
mode='markers', marker=dict(size=12, color='navy')
))
fig.add_vline(x=1.0, line_dash="dash", line_color="red")
fig.update_layout(title='Hazard Ratios for Heart Failure Trials',
xaxis_title='Hazard Ratio (95% CI)')3. Trend Over Time:
import plotly.express as px
fig = px.line(df, x='Year', y='Mortality Rate',
color='Treatment Era',
title='Heart Failure Mortality Trends 1990-2024')
fig.write_html('trends.html')---
Tool 6: LIDA (Quick Prototyping) ⚠️ PROTOTYPING ONLY
⚠️ Critical Warning
LIDA is a PROTOTYPING TOOL ONLY. Do NOT use for:
- Publication-ready visualizations
- Patient-facing materials
- Regulatory submissions
- Final blog posts or social media
For production visualizations, use:
- Plotly (data charts)
- Gemini (infographics)
- Fal.ai (images)
Setup
# Install LIDA
pip install lida llmx openai --break-system-packages
# Set API key (choose one)
export OPENAI_API_KEY="your-key" # Recommended
export GOOGLE_API_KEY="your-key" # Free tier (Gemini)
export ANTHROPIC_API_KEY="your-key" # ClaudeWhat LIDA Does
LIDA (Automatic Visualization Generation) uses LLMs to: 1. Analyze your data structure 2. Generate visualization code from natural language 3. Create multiple visualization candidates 4. Support multiple libraries (Plotly, Matplotlib, Seaborn, Altair)
Published: ACL 2023 (Microsoft Research)
Limitations
1. ≤10 columns recommended - LLM context constraints 2. Quality varies - AI-generated, needs review 3. No specialized medical charts - No true forest plots, Kaplan-Meier 4. Error rate: <3.5% reported, but ALWAYS verify medical accuracy 5. Not production-ready - Use for exploration only
Usage
Basic Usage:
python scripts/lida_quick_viz.py "Show mortality by treatment group" trial_data.csvMultiple Candidates:
python scripts/lida_quick_viz.py "Compare outcomes" data.csv --candidates 3Use Medical Template:
python scripts/lida_quick_viz.py "Trial results" data.csv --template trial_comparisonSpecify Library:
python scripts/lida_quick_viz.py "Trends over time" data.csv --library plotlyInteractive Mode:
python scripts/lida_quick_viz.py --interactive data.csvList Templates:
python scripts/lida_quick_viz.py --list-templatesMedical Templates
| Template | Description | Use Case |
|---|---|---|
trial_comparison | Compare treatment arms | Primary endpoint results |
patient_demographics | Baseline characteristics | Patient population summary |
outcome_comparison | Primary/secondary endpoints | Multiple outcomes comparison |
trend_analysis | Trends over time | Longitudinal data |
survival_curve | Time-to-event (simplified) | Event-free survival (NOT true KM) |
Example Workflow
1. Exploratory Analysis (LIDA):
# Quick exploration of new trial data
python scripts/lida_quick_viz.py \
"Show primary endpoint by treatment arm with confidence intervals" \
trial_results.csv \
--template trial_comparison \
--candidates 32. Review Candidates:
- Check medical accuracy
- Verify data interpretation
- Select best approach
3. Production Version (Plotly):
# Recreate selected visualization in production quality
python scripts/plotly_charts.py bar --data trial_results.csv --output final_chart.pngQuality Validation Checklist
Every LIDA output includes this checklist:
⚠️ QUALITY VALIDATION CHECKLIST - REVIEW BEFORE USE
Medical Accuracy:
[ ] Data interpretation is correct
[ ] Statistical measures are appropriate
[ ] Confidence intervals/error bars are correct
[ ] P-values and significance are accurate
[ ] Sample sizes are represented correctly
Visual Design:
[ ] Chart type is appropriate
[ ] Color scheme is professional
[ ] Labels are clear and complete
[ ] Legend is accurate
[ ] Title describes the content
Medical Standards:
[ ] Follows publication standards
[ ] No misleading visualizations
[ ] Appropriate precision
[ ] Context is provided
[ ] Source attribution if neededWhen to Use LIDA vs Plotly
| Scenario | Tool | Reason |
|---|---|---|
| "What's the best way to show this data?" | LIDA | Exploration, multiple options |
| "Show me trial results quickly" | LIDA | Speed over perfection |
| "Generate 3 chart options" | LIDA | Multiple candidates |
| "Publication-ready chart" | Plotly | Production quality |
| "Blog post visualization" | Plotly | Final output |
| "Patient education" | Plotly | Accuracy critical |
| "Regulatory submission" | Plotly | Never use LIDA |
Cost
| Model | Cost | Speed | Quality |
|---|---|---|---|
| OpenAI (GPT-4o-mini) | $0.60/M tokens | Fast | Good |
| Gemini (Free tier) | FREE | Fast | Good |
| Claude (Sonnet) | Variable | Medium | Excellent |
Typical cost per visualization: $0.01-0.05 (negligible)
Example: Interactive Session
python scripts/lida_quick_viz.py --interactive trial_data.csv
# In interactive mode:
> list # Show templates
> template trial_comparison # Set template
> library plotly # Set library
> viz Show mortality by treatment # Generate viz
> viz Compare age distribution # Another viz
> quitOutput Structure
lida_output/
├── candidate_1_code.py # Generated Python code
├── candidate_1.png # Rendered visualization
├── candidate_2_code.py
├── candidate_2.png
└── ...---
Integrated Workflow Example
Scenario: You're writing a blog post about heart failure medications.
Step 1: Hero Image (Fal.ai)
python scripts/fal_image.py \
"Elderly patient having hopeful conversation with cardiologist about new treatment options" \
--output images/hero.pngStep 2: Treatment Algorithm (Mermaid)
Create a Mermaid flowchart showing HFrEF GDMT initiation:
- Start with diagnosis
- Branch to ARNI/ACEi + Beta-blocker
- Add SGLT2i + MRA
- Device considerationStep 3: Trial Data (Plotly)
# Compare mortality reduction across trials
trials_df = pd.DataFrame({
'Trial': ['PARADIGM-HF', 'DAPA-HF', 'EMPEROR-Reduced'],
'Mortality Reduction': [20, 17, 14]
})
fig = px.bar(trials_df, x='Trial', y='Mortality Reduction',
title='Mortality Reduction in Landmark HF Trials (%)')Step 4: Key Concepts Infographic (Gemini)
Create a clean medical infographic summarizing the "4 Pillars of HFrEF Therapy":
1. ARNI/ACEi - heart icon
2. Beta-blocker - heart rate icon
3. MRA - kidney/electrolyte icon
4. SGLT2i - glucose/kidney icon
Style: modern medical, blue color scheme, minimal text, icon-focused---
API Key Checklist
Before using this system, ensure these are set:
# Fal.ai (blog images)
export FAL_KEY="your-key"
# Gemini (infographics)
export GEMINI_API_KEY="your-key"
# LIDA (prototyping) - choose one
export OPENAI_API_KEY="your-key" # Recommended
export GOOGLE_API_KEY="your-key" # FREE (Gemini)
export ANTHROPIC_API_KEY="your-key" # Claude
# Mermaid - uses MCP, no key needed
# Plotly - local, no key needed
# Marp - local, no key needed---
Cost Summary
| Tool | Cost | Typical Use |
|---|---|---|
| Fal.ai (Recraft) | $0.04/image | 3-4 per blog = $0.16 |
| Gemini | Free tier available | Infographics |
| LIDA (prototyping) | $0.01-0.05/viz | Quick exploration (optional) |
| Mermaid | Free (MCP) | Diagrams |
| Plotly | Free | Data viz |
| Marp | Free | Slides |
Total per blog post: ~$0.16-0.25 (vs separate subscriptions)
Note: LIDA is optional - use FREE Gemini model for zero-cost prototyping
---
Files in This Skill
cardiology-visual-system/
├── SKILL.md # This file
├── scripts/
│ ├── fal_image.py # Fal.ai image generation
│ ├── gemini_infographic.py # Gemini infographic generation
│ ├── plotly_charts.py # Common chart templates
│ ├── lida_quick_viz.py # LIDA prototyping (⚠️ prototype only)
│ └── convert_slides.sh # Marp conversion helper
├── templates/
│ ├── marp_medical.md # Medical slide template
│ └── plotly_medical.py # Medical chart templates
└── references/
└── prompt_examples.md # Curated prompts for each toolLIDA Integration Report
Microsoft LIDA for AI-Driven Quick Visualization Prototyping
Integration Date: 2026-01-01 Version: 1.0 Priority: P2 (Prototyping tool) Status: ✅ Complete
---
Executive Summary
Successfully integrated Microsoft LIDA (Automatic Generation of Visualizations and Infographics using Large Language Models) into the cardiology visual system as a prototyping-only tool. LIDA enables rapid exploration of data visualization options through natural language prompts, generating multiple visualization candidates across different libraries (Plotly, Matplotlib, Seaborn, Altair).
⚠️ CRITICAL: LIDA is for PROTOTYPING ONLY. All production visualizations must use dedicated tools (Plotly for charts, Gemini for infographics).
---
What Was Integrated
1. Core Components
| Component | Location | Purpose |
|---|---|---|
| LIDA Wrapper | scripts/lida_quick_viz.py | Python CLI for visualization generation |
| Medical Templates | Embedded in wrapper | 5 cardiology-specific templates |
| Quality Checklist | Embedded in wrapper | Validation checklist for all outputs |
| Routing Logic | SKILL.md | Integration with visual router |
| Test Data | test_data/ | Sample trial and demographic data |
| Documentation | SKILL.md + this file | Complete usage guide |
2. Medical Templates
Purpose: Enhance LIDA outputs with medical context and standards.
| Template | Use Case | Suggested Data |
|---|---|---|
trial_comparison | Clinical trial results | Treatment groups, outcomes, CIs, p-values |
patient_demographics | Baseline characteristics | Age, gender, comorbidities, counts |
outcome_comparison | Multi-endpoint analysis | Primary/secondary endpoints by treatment |
trend_analysis | Longitudinal data | Time series, metrics over time |
survival_curve | Time-to-event (simplified) | Time, survival probability (NOT true KM) |
Note: Templates inject medical context into prompts to improve visualization quality, but outputs still require expert review.
3. Quality Validation System
Every LIDA output includes a mandatory checklist covering:
Medical Accuracy:
- Data interpretation correctness
- Appropriate statistical measures
- Accurate confidence intervals and p-values
- Correct sample size representation
Visual Design:
- Appropriate chart type selection
- Professional color schemes
- Complete and clear labels
- Accurate legends
Medical Standards:
- Publication standards compliance (Nature/JACC/NEJM style)
- No misleading visualizations
- Appropriate precision
- Proper context and attribution
---
Technical Architecture
Installation
# Core dependencies
pip install lida llmx openai pandas --break-system-packages
# Fix cryptography conflict (Linux/Docker environments)
pip install --ignore-installed cffi cryptography --break-system-packagesDependencies
| Package | Version | Purpose |
|---|---|---|
lida | 0.0.14 | Core visualization generation |
llmx | 0.0.21a0 | LLM provider abstraction |
openai | 2.14.0 | OpenAI API client (recommended) |
pandas | 2.3.3 | Data manipulation |
Optional LLM Providers:
- Google Gemini (FREE tier available)
- Anthropic Claude
- OpenAI GPT models
Workflow
User Prompt
↓
Enhanced with Medical Template (optional)
↓
LIDA Manager → LLM Analysis
↓
Data Summarization
↓
Goal Generation
↓
Visualization Code Generation (Plotly/Matplotlib/Seaborn/Altair)
↓
Code Execution + Rendering
↓
PNG Image + Python Code Output
↓
Quality Validation Checklist Display---
Limitations & Constraints
1. Data Size Constraints
Problem: LLM context window limitations Impact: Works best with ≤10 data columns Workaround: Pre-filter data to relevant columns before visualization
Example:
# Bad: 25 columns
full_data.csv # Too many features
# Good: 5 relevant columns
filtered_data = df[['treatment', 'outcome', 'ci_lower', 'ci_upper', 'p_value']]
filtered_data.to_csv('clean_data.csv')2. Quality Variability
Problem: AI-generated code quality varies Impact:
- Chart type may not be optimal
- Statistical representations may be incorrect
- Color schemes may not be colorblind-safe
- Labels may be unclear
Mitigation:
- Generate multiple candidates (
--candidates 3) - Always review outputs with medical expertise
- Use quality validation checklist
- Recreate in Plotly for final use
3. Medical Chart Limitations
Problem: LIDA lacks medical domain knowledge Impact: Cannot generate specialized medical visualizations:
- True Kaplan-Meier curves (use
lifelinesinstead) - Forest plots with heterogeneity (use
plotly_charts.pytemplate) - Bland-Altman plots
- ROC curves with AUC statistics
- Funnel plots for publication bias
Solution: Use LIDA for exploration, then create production version in Plotly with medical-specific libraries.
4. Code Execution Risk
Problem: LIDA executes AI-generated code Impact: Potential security risk if used with untrusted data Mitigation:
- Only use in sandboxed environments
- Review generated code before execution
- Never use with sensitive patient data
- Production systems must not auto-execute LIDA code
5. Reproducibility Issues
Problem: LLM outputs are non-deterministic Impact: Same prompt may generate different visualizations across runs Mitigation:
- Save generated code for reproducibility
- Use saved code for final visualizations
- Document all LIDA-assisted outputs
---
Use Cases & Decision Matrix
✅ When to Use LIDA
| Scenario | Reasoning |
|---|---|
| "What's the best way to visualize this new dataset?" | Exploration, multiple options |
| "Generate 3 different chart types for this data" | Quick prototyping |
| "Show me how this trial data looks" | Internal review, speed over perfection |
| "I need visualization ideas for my presentation" | Brainstorming |
| "Quick check: does this data show a trend?" | Exploratory analysis |
❌ When NOT to Use LIDA
| Scenario | Use Instead |
|---|---|
| Publication-ready charts | plotly_charts.py |
| Blog post visualizations | Plotly or Gemini |
| Patient education materials | Plotly (accuracy critical) |
| Regulatory submissions | Never use LIDA |
| Social media graphics | Gemini or Fal.ai |
| Specialized medical charts (KM, forest plots) | Dedicated libraries + Plotly |
Decision Flowchart
Need a visualization?
↓
Is this for final publication/patient use?
├─ YES → Use Plotly or Gemini (NOT LIDA)
└─ NO → Continue
↓
Do you know what chart type you need?
├─ YES → Use Plotly directly
└─ NO → Use LIDA for exploration
↓
Review candidates → Select best approach
↓
Recreate in Plotly for final version---
Integration with Visual Router
Routing Keywords
LIDA is triggered by keywords indicating prototyping intent:
"quick", "prototype", "exploratory", "rough draft",
"multiple options", "try", "experiment", "brainstorm visualization"Priority Hierarchy
1. Plotly - Default for data visualization 2. Gemini - Default for infographics 3. LIDA - Only when explicitly prototyping
Example Routing:
"Show trial results" → Plotly (production-ready)
"Quick prototype of trial results" → LIDA (exploration)
"Generate 3 options for trial viz" → LIDA (multiple candidates)Routing Logic in SKILL.md
### → Route to LIDA (Quick Prototyping) ⚠️ PROTOTYPING ONLY
Keywords: `quick`, `prototype`, `exploratory`, `rough draft`,
`multiple options`, `try`, `experiment`
**Best for:**
- Quick exploratory data visualization
- Generating multiple visualization candidates
- Brainstorming chart types
**NOT for:**
- Publication-ready charts → Use Plotly
- Patient-facing materials → Use production tools---
Usage Examples
Example 1: Basic Trial Visualization
python scripts/lida_quick_viz.py \
"Show mortality rates by treatment group" \
test_data/trial_results.csvOutput:
lida_output/candidate_1_code.py- Generated Python codelida_output/candidate_1.png- Rendered visualization- Quality validation checklist in terminal
Example 2: Multiple Candidates with Template
python scripts/lida_quick_viz.py \
"Compare primary endpoint across treatment arms with confidence intervals" \
test_data/trial_results.csv \
--template trial_comparison \
--candidates 3 \
--library plotlyOutput:
- 3 different visualization approaches
- All using Plotly library
- Enhanced with medical template context
- Quality checklist for each
Example 3: Interactive Mode
python scripts/lida_quick_viz.py --interactive test_data/trial_results.csv
# Interactive session:
> list # Show templates
> template trial_comparison # Set template
> library plotly # Set library
> viz Show mortality with error bars # Generate viz
> viz Compare age distribution # Another viz
> quitExample 4: Using FREE Gemini Model
export GOOGLE_API_KEY="your-gemini-key"
python scripts/lida_quick_viz.py \
"Visualize patient demographics" \
test_data/patient_demographics.csv \
--template patient_demographics \
--model geminiCost: FREE (Gemini API free tier)
---
Test Results
Test Dataset 1: Trial Results
File: test_data/trial_results.csv Columns: treatment_group, primary_endpoint_rate, ci_lower, ci_upper, sample_size, p_value Rows: 3 (Drug A, Drug B, Placebo)
Test Command:
python scripts/lida_quick_viz.py --list-templatesResult: ✅ Success - All 5 templates listed correctly
Validation:
- Templates loaded successfully
- Descriptions accurate
- Suggested columns appropriate for cardiology use
Test Dataset 2: Patient Demographics
File: test_data/patient_demographics.csv Columns: age_group, count, percentage, gender Rows: 8 (age groups × gender)
Expected Use:
python scripts/lida_quick_viz.py \
"Show age distribution by gender" \
test_data/patient_demographics.csv \
--template patient_demographicsNote: Full visualization testing requires API key (not configured in test environment). Integration structure is complete and validated.
---
API Keys & Configuration
Required Environment Variables
Option 1: OpenAI (Recommended)
export OPENAI_API_KEY="sk-..."- Cost: $0.60/M tokens (GPT-4o-mini) or $10/M (GPT-4o)
- Quality: Excellent
- Speed: Fast
Option 2: Gemini (FREE)
export GOOGLE_API_KEY="..."- Cost: FREE (within limits)
- Quality: Good
- Speed: Fast
Option 3: Anthropic Claude
export ANTHROPIC_API_KEY="sk-ant-..."- Cost: Variable by model
- Quality: Excellent
- Speed: Medium
Cost Analysis
Typical visualization generation:
- Token usage: 500-2000 tokens
- Cost with GPT-4o-mini: $0.001-0.005 per viz
- Cost with Gemini: FREE
Monthly usage estimate (50 prototypes):
- OpenAI: $0.05-0.25/month
- Gemini: FREE
Recommendation: Use Gemini for zero-cost prototyping.
---
Quality Assurance
Validation Checklist (Embedded in Tool)
Every LIDA output displays:
⚠️ QUALITY VALIDATION CHECKLIST - REVIEW BEFORE USE
Medical Accuracy:
[ ] Data interpretation is correct
[ ] Statistical measures are appropriate
[ ] Confidence intervals/error bars are correct
[ ] P-values and significance are accurate
[ ] Sample sizes are represented correctly
Visual Design:
[ ] Chart type is appropriate
[ ] Color scheme is professional
[ ] Labels are clear and complete
[ ] Legend is accurate
[ ] Title describes the content
Medical Standards:
[ ] Follows publication standards
[ ] No misleading visualizations
[ ] Appropriate precision
[ ] Context is provided
[ ] Source attribution if neededReview Process
Step 1: Automated Checks
- LIDA generates code and visualization
- Script validates code execution
- Renders image if successful
Step 2: Manual Review (REQUIRED)
- Review generated code for errors
- Check data interpretation accuracy
- Verify statistical representations
- Validate visual design choices
- Complete quality checklist
Step 3: Production Recreation
- Select best LIDA candidate
- Recreate in Plotly using
plotly_charts.py - Apply publication standards
- Final expert review
---
Comparison: LIDA vs Plotly vs Gemini
| Feature | LIDA | Plotly | Gemini |
|---|---|---|---|
| Purpose | Prototyping | Data viz (production) | Infographics |
| Input | Natural language + CSV | Python code | Text prompt |
| Output Quality | Variable (AI) | Publication-grade | Good |
| Speed | Fast (LLM) | Medium (manual code) | Fast |
| Cost | $0.01-0.05 or FREE | FREE | FREE |
| Medical Charts | Basic only | Full support | Illustrations only |
| Customization | Limited | Full control | Limited |
| Reproducibility | Non-deterministic | Deterministic | Non-deterministic |
| Use Case | "What should I visualize?" | "Create this chart" | "Explain this concept" |
Example Scenarios:
1. Exploring new dataset:
- LIDA: "Try 3 different ways to show this data" → 3 options in 30 sec
- Plotly: Write code for each option → 30 min
- Winner: LIDA
2. Publication figure:
- LIDA: Quick draft → needs refinement
- Plotly: Direct to publication quality
- Winner: Plotly
3. Blog infographic:
- LIDA: Basic chart only
- Gemini: Full infographic with icons
- Winner: Gemini
---
Known Issues & Workarounds
Issue 1: Module Not Found Error (_cffi_backend)
Problem: LIDA dependencies conflict with system-installed cryptography
Error:
ModuleNotFoundError: No module named '_cffi_backend'Solution:
pip install --ignore-installed cffi cryptography --break-system-packagesIssue 2: >10 Columns Warning
Problem: LLM context limits affect large datasets
Warning:
⚠️ Warning: Dataset has 15 columns
LIDA works best with ≤10 columnsSolution:
# Pre-filter to relevant columns
relevant_cols = ['treatment', 'outcome', 'ci_lower', 'ci_upper', 'p_value']
df_filtered = df[relevant_cols]
df_filtered.to_csv('filtered_data.csv')Issue 3: No Specialized Medical Charts
Problem: LIDA doesn't have templates for forest plots, Kaplan-Meier, etc.
Workaround: 1. Use LIDA to explore general chart types 2. For specialized charts, use dedicated libraries:
- Kaplan-Meier:
lifelines+ Plotly - Forest plots:
plotly_charts.pytemplate - ROC curves:
scikit-learn+ Plotly
Issue 4: Non-Deterministic Outputs
Problem: Same prompt generates different results across runs
Workaround:
- Generate multiple candidates in single run
- Save best generated code
- Use saved code for reproducibility
---
Future Enhancements
Potential Improvements (Not Implemented Yet)
1. Medical Chart Templates in LIDA:
- Add forest plot generation logic
- Kaplan-Meier curve approximations
- Bland-Altman plot templates
- Effort: 1-2 weeks
- Priority: P2
2. Automatic Plotly Recreation:
- LIDA generates concept → Auto-convert to Plotly code
- Preserve best aspects, apply publication standards
- Effort: 3-5 days
- Priority: P3
3. Medical Style Enforcement:
- Force colorblind-safe palettes
- Auto-apply Nature/JACC/NEJM standards
- Medical typography (Helvetica, proper sizes)
- Effort: 2-3 days
- Priority: P2
4. Batch Processing:
- Process multiple datasets in parallel
- Generate comparison visualizations
- Effort: 1-2 days
- Priority: P3
5. Integration with PubMed MCP:
- Fetch trial data from PubMed
- Auto-visualize published results
- Effort: 1 week
- Priority: P2
---
Documentation Added
1. SKILL.md Updates
Sections Added:
- Quick Reference table (row for LIDA)
- Routing logic for LIDA
- Complete Tool 6: LIDA section with:
- Setup instructions
- Medical templates
- Usage examples
- Quality checklist
- When to use vs Plotly
- Cost analysis
- Interactive mode guide
Location: Lines 20, 93-574 in SKILL.md
2. API Key Checklist
Added:
# LIDA (prototyping) - choose one
export OPENAI_API_KEY="your-key" # Recommended
export GOOGLE_API_KEY="your-key" # FREE (Gemini)
export ANTHROPIC_API_KEY="your-key" # Claude3. Cost Summary Table
Updated:
| LIDA (prototyping) | $0.01-0.05/viz | Quick exploration (optional) |4. Files Section
Added: lida_quick_viz.py to file listing
---
CLAUDE.md Updates Needed
Add to "What You Can Do" table:
| **Prototype Visualizations** | LIDA quick viz | `lida_quick_viz.py` |Add to "QUICK REFERENCE: COMMON TASKS":
### "Prototype a visualization for [data]"
→ Use `lida_quick_viz.py` for quick exploration
→ Example: "Show me 3 ways to visualize trial results"
→ ⚠️ Prototyping only - recreate in Plotly for productionAdd to "VISUAL CONTENT SYSTEM" table:
| Quick prototype, explore data viz | **LIDA** | PNG + Code (prototype) |---
Testing Checklist
- [x] LIDA installed successfully
- [x] Core dependencies resolved (cffi/cryptography conflict fixed)
- [x] Import test passes
- [x] CLI help works
- [x] Template listing works
- [x] Test data created (trial_results.csv, patient_demographics.csv)
- [x] Medical templates defined (5 templates)
- [x] Quality validation checklist embedded
- [x] SKILL.md routing logic added
- [x] SKILL.md full section added
- [x] Documentation complete
- [ ] Live API test (requires API key) - Deferred
- [ ] Sample visualization generation - Deferred
- [ ] Multi-candidate test - Deferred
- [ ] Interactive mode test - Deferred
Note: Live visualization testing deferred due to missing API keys in test environment. Integration structure is complete and validated.
---
Deliverables Summary
✅ Completed
1. Working LIDA Integration
- File:
scripts/lida_quick_viz.py(770 lines) - Features: CLI, templates, validation, interactive mode
2. Medical Prompt Templates
- 5 cardiology-specific templates
- Enhanced prompting for medical context
3. Quality Validation Wrapper
- Embedded checklist in all outputs
- Medical accuracy focus
4. Sample Visualizations
- Test data created (trial_results.csv, patient_demographics.csv)
- Ready for visualization generation (requires API key)
5. Clear Documentation
- This integration report (comprehensive)
- SKILL.md updates (full section)
- Usage examples and decision matrix
6. Visual Router Integration
- Routing keywords defined
- Priority hierarchy established
- Clear "prototyping only" warnings
📋 Expected Output Location
skills/cardiology/cardiology-visual-system/
├── scripts/
│ └── lida_quick_viz.py ✅ Created (770 lines)
├── test_data/
│ ├── trial_results.csv ✅ Created
│ └── patient_demographics.csv ✅ Created
├── SKILL.md ✅ Updated
├── LIDA_INTEGRATION.md ✅ Created (this file)
└── lida_output/ 📁 Generated at runtime---
Conclusion
Microsoft LIDA has been successfully integrated as a P2 prototyping tool with clear limitations and use cases. The integration includes:
- ✅ Complete Python wrapper with medical templates
- ✅ Quality validation system
- ✅ Visual router integration
- ✅ Comprehensive documentation
- ✅ Test datasets
Key Takeaway: LIDA accelerates exploratory data visualization but must NEVER replace production tools (Plotly) for final outputs. Use LIDA to answer "What should I visualize?" then recreate in Plotly for "Create this visualization."
Integration Status: COMPLETE and READY FOR USE
---
Report Generated: 2026-01-01 Integration Version: 1.0 Next Review: 2026-06-01 (or after 100 LIDA prototypes)
<html>
<head><meta charset="utf-8" /></head>
<body>
<div> <script type="text/javascript">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>
<script charset="utf-8" src="https://cdn.plot.ly/plotly-3.3.0.min.js" integrity="sha256-bO3dS6yCpk9aK4gUpNELtCiDeSYvGYnK7jFI58NQnHI=" crossorigin="anonymous"></script> <div id="8065af46-7baf-4d93-b628-621d160e76a6" class="plotly-graph-div" style="height:100%; width:100%;"></div> <script type="text/javascript"> window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById("8065af46-7baf-4d93-b628-621d160e76a6")) { Plotly.newPlot( "8065af46-7baf-4d93-b628-621d160e76a6", [{"hoverinfo":"skip","line":{"color":"#546e7a","width":2},"mode":"lines","showlegend":false,"x":[0.73,0.87],"y":["PARADIGM-HF","PARADIGM-HF"],"type":"scatter"},{"hoverinfo":"skip","line":{"color":"#546e7a","width":2},"mode":"lines","showlegend":false,"x":[0.65,0.85],"y":["DAPA-HF","DAPA-HF"],"type":"scatter"},{"hoverinfo":"skip","line":{"color":"#546e7a","width":2},"mode":"lines","showlegend":false,"x":[0.65,0.86],"y":["EMPEROR-Reduced","EMPEROR-Reduced"],"type":"scatter"},{"hoverinfo":"skip","line":{"color":"#546e7a","width":2},"mode":"lines","showlegend":false,"x":[0.82,0.98],"y":["VICTORIA","VICTORIA"],"type":"scatter"},{"hoverinfo":"skip","line":{"color":"#546e7a","width":2},"mode":"lines","showlegend":false,"x":[0.86,0.99],"y":["GALACTIC-HF","GALACTIC-HF"],"type":"scatter"},{"hovertemplate":"%{y}\u003cbr\u003eHR: %{x:.2f}\u003cextra\u003e\u003c\u002fextra\u003e","marker":{"color":"#1e3a5f","size":12,"symbol":"diamond"},"mode":"markers","name":"Point Estimate","x":[0.8,0.74,0.75,0.9,0.92],"y":["PARADIGM-HF","DAPA-HF","EMPEROR-Reduced","VICTORIA","GALACTIC-HF"],"type":"scatter"}], {"template":{"data":{"histogram2dcontour":[{"type":"histogram2dcontour","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"choropleth":[{"type":"choropleth","colorbar":{"outlinewidth":0,"ticks":""}}],"histogram2d":[{"type":"histogram2d","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"heatmap":[{"type":"heatmap","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"contourcarpet":[{"type":"contourcarpet","colorbar":{"outlinewidth":0,"ticks":""}}],"contour":[{"type":"contour","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"surface":[{"type":"surface","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"mesh3d":[{"type":"mesh3d","colorbar":{"outlinewidth":0,"ticks":""}}],"scatter":[{"fillpattern":{"fillmode":"overlay","size":10,"solidity":0.2},"type":"scatter"}],"parcoords":[{"type":"parcoords","line":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterpolargl":[{"type":"scatterpolargl","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"bar":[{"error_x":{"color":"#2a3f5f"},"error_y":{"color":"#2a3f5f"},"marker":{"line":{"color":"#E5ECF6","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"bar"}],"scattergeo":[{"type":"scattergeo","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterpolar":[{"type":"scatterpolar","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"histogram":[{"marker":{"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"histogram"}],"scattergl":[{"type":"scattergl","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatter3d":[{"type":"scatter3d","line":{"colorbar":{"outlinewidth":0,"ticks":""}},"marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scattermap":[{"type":"scattermap","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scattermapbox":[{"type":"scattermapbox","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterternary":[{"type":"scatterternary","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scattercarpet":[{"type":"scattercarpet","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"carpet":[{"aaxis":{"endlinecolor":"#2a3f5f","gridcolor":"white","linecolor":"white","minorgridcolor":"white","startlinecolor":"#2a3f5f"},"baxis":{"endlinecolor":"#2a3f5f","gridcolor":"white","linecolor":"white","minorgridcolor":"white","startlinecolor":"#2a3f5f"},"type":"carpet"}],"table":[{"cells":{"fill":{"color":"#EBF0F8"},"line":{"color":"white"}},"header":{"fill":{"color":"#C8D4E3"},"line":{"color":"white"}},"type":"table"}],"barpolar":[{"marker":{"line":{"color":"#E5ECF6","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"barpolar"}],"pie":[{"automargin":true,"type":"pie"}]},"layout":{"autotypenumbers":"strict","colorway":["#636efa","#EF553B","#00cc96","#ab63fa","#FFA15A","#19d3f3","#FF6692","#B6E880","#FF97FF","#FECB52"],"font":{"color":"#2a3f5f"},"hovermode":"closest","hoverlabel":{"align":"left"},"paper_bgcolor":"white","plot_bgcolor":"#E5ECF6","polar":{"bgcolor":"#E5ECF6","angularaxis":{"gridcolor":"white","linecolor":"white","ticks":""},"radialaxis":{"gridcolor":"white","linecolor":"white","ticks":""}},"ternary":{"bgcolor":"#E5ECF6","aaxis":{"gridcolor":"white","linecolor":"white","ticks":""},"baxis":{"gridcolor":"white","linecolor":"white","ticks":""},"caxis":{"gridcolor":"white","linecolor":"white","ticks":""}},"coloraxis":{"colorbar":{"outlinewidth":0,"ticks":""}},"colorscale":{"sequential":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"sequentialminus":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"diverging":[[0,"#8e0152"],[0.1,"#c51b7d"],[0.2,"#de77ae"],[0.3,"#f1b6da"],[0.4,"#fde0ef"],[0.5,"#f7f7f7"],[0.6,"#e6f5d0"],[0.7,"#b8e186"],[0.8,"#7fbc41"],[0.9,"#4d9221"],[1,"#276419"]]},"xaxis":{"gridcolor":"white","linecolor":"white","ticks":"","title":{"standoff":15},"zerolinecolor":"white","automargin":true,"zerolinewidth":2},"yaxis":{"gridcolor":"white","linecolor":"white","ticks":"","title":{"standoff":15},"zerolinecolor":"white","automargin":true,"zerolinewidth":2},"scene":{"xaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2},"yaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2},"zaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2}},"shapedefaults":{"line":{"color":"#2a3f5f"}},"annotationdefaults":{"arrowcolor":"#2a3f5f","arrowhead":0,"arrowwidth":1},"geo":{"bgcolor":"white","landcolor":"#E5ECF6","subunitcolor":"white","showland":true,"showlakes":true,"lakecolor":"white"},"title":{"x":0.05},"mapbox":{"style":"light"}}},"shapes":[{"line":{"color":"#c62828","dash":"dash"},"type":"line","x0":1.0,"x1":1.0,"xref":"x","y0":0,"y1":1,"yref":"y domain"}],"annotations":[{"showarrow":false,"text":"Null (1.0)","x":1.0,"xanchor":"left","xref":"x","y":1,"yanchor":"top","yref":"y domain"}],"xaxis":{"title":{"text":"Hazard Ratio (95% CI)","font":{"size":10}},"type":"log","tickfont":{"size":8},"gridcolor":"#e9ecef","linecolor":"#495057","showgrid":true,"gridwidth":0.5,"linewidth":0.8},"yaxis":{"title":{"text":"","font":{"size":10}},"tickfont":{"size":8},"gridcolor":"#e9ecef","linecolor":"#495057","showgrid":true,"gridwidth":0.5,"linewidth":0.8},"font":{"family":"Helvetica, Arial, sans-serif","size":10,"color":"#212529"},"title":{"font":{"size":14,"color":"#212529","family":"Helvetica, Arial, sans-serif"},"text":"Heart Failure Trials: Hazard Ratios for Primary Endpoint","x":0.5,"xanchor":"center"},"legend":{"font":{"size":9},"bgcolor":"rgba(255,255,255,0.8)","orientation":"h","yanchor":"bottom","y":-0.2,"xanchor":"center","x":0.5},"paper_bgcolor":"#ffffff","plot_bgcolor":"#ffffff","colorway":["#4477AA","#66CCEE","#228833","#CCBB44","#EE6677","#AA3377","#BBBBBB"],"margin":{"l":60,"r":40,"t":80,"b":60}}, {"responsive": true} ) }; </script> </div>
</body>
</html><html>
<head><meta charset="utf-8" /></head>
<body>
<div> <script type="text/javascript">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>
<script charset="utf-8" src="https://cdn.plot.ly/plotly-3.3.0.min.js" integrity="sha256-bO3dS6yCpk9aK4gUpNELtCiDeSYvGYnK7jFI58NQnHI=" crossorigin="anonymous"></script> <div id="207f7003-ec08-431c-af2e-bb369c2d87eb" class="plotly-graph-div" style="height:100%; width:100%;"></div> <script type="text/javascript"> window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById("207f7003-ec08-431c-af2e-bb369c2d87eb")) { Plotly.newPlot( "207f7003-ec08-431c-af2e-bb369c2d87eb", [{"hovertemplate":"Year=%{x}\u003cbr\u003eMortality=%{y}\u003cextra\u003e\u003c\u002fextra\u003e","legendgroup":"","line":{"color":"#4477AA","dash":"solid"},"marker":{"symbol":"circle"},"mode":"lines+markers","name":"","orientation":"v","showlegend":false,"x":{"dtype":"i2","bdata":"0AfRB9IH0wfUB9UH1gfXB9gH2QfaB9sH3AfdB94H3wfgB+EH4gfjB+QH5QfmB+cH"},"xaxis":"x","y":{"dtype":"i1","bdata":"HhwbGRgXFRQTEhEQDw4NDAsKCgkICAcH"},"yaxis":"y","type":"scatter"}], {"template":{"data":{"histogram2dcontour":[{"type":"histogram2dcontour","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"choropleth":[{"type":"choropleth","colorbar":{"outlinewidth":0,"ticks":""}}],"histogram2d":[{"type":"histogram2d","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"heatmap":[{"type":"heatmap","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"contourcarpet":[{"type":"contourcarpet","colorbar":{"outlinewidth":0,"ticks":""}}],"contour":[{"type":"contour","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"surface":[{"type":"surface","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"mesh3d":[{"type":"mesh3d","colorbar":{"outlinewidth":0,"ticks":""}}],"scatter":[{"fillpattern":{"fillmode":"overlay","size":10,"solidity":0.2},"type":"scatter"}],"parcoords":[{"type":"parcoords","line":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterpolargl":[{"type":"scatterpolargl","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"bar":[{"error_x":{"color":"#2a3f5f"},"error_y":{"color":"#2a3f5f"},"marker":{"line":{"color":"#E5ECF6","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"bar"}],"scattergeo":[{"type":"scattergeo","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterpolar":[{"type":"scatterpolar","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"histogram":[{"marker":{"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"histogram"}],"scattergl":[{"type":"scattergl","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatter3d":[{"type":"scatter3d","line":{"colorbar":{"outlinewidth":0,"ticks":""}},"marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scattermap":[{"type":"scattermap","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scattermapbox":[{"type":"scattermapbox","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterternary":[{"type":"scatterternary","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scattercarpet":[{"type":"scattercarpet","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"carpet":[{"aaxis":{"endlinecolor":"#2a3f5f","gridcolor":"white","linecolor":"white","minorgridcolor":"white","startlinecolor":"#2a3f5f"},"baxis":{"endlinecolor":"#2a3f5f","gridcolor":"white","linecolor":"white","minorgridcolor":"white","startlinecolor":"#2a3f5f"},"type":"carpet"}],"table":[{"cells":{"fill":{"color":"#EBF0F8"},"line":{"color":"white"}},"header":{"fill":{"color":"#C8D4E3"},"line":{"color":"white"}},"type":"table"}],"barpolar":[{"marker":{"line":{"color":"#E5ECF6","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"barpolar"}],"pie":[{"automargin":true,"type":"pie"}]},"layout":{"autotypenumbers":"strict","colorway":["#636efa","#EF553B","#00cc96","#ab63fa","#FFA15A","#19d3f3","#FF6692","#B6E880","#FF97FF","#FECB52"],"font":{"color":"#2a3f5f"},"hovermode":"closest","hoverlabel":{"align":"left"},"paper_bgcolor":"white","plot_bgcolor":"#E5ECF6","polar":{"bgcolor":"#E5ECF6","angularaxis":{"gridcolor":"white","linecolor":"white","ticks":""},"radialaxis":{"gridcolor":"white","linecolor":"white","ticks":""}},"ternary":{"bgcolor":"#E5ECF6","aaxis":{"gridcolor":"white","linecolor":"white","ticks":""},"baxis":{"gridcolor":"white","linecolor":"white","ticks":""},"caxis":{"gridcolor":"white","linecolor":"white","ticks":""}},"coloraxis":{"colorbar":{"outlinewidth":0,"ticks":""}},"colorscale":{"sequential":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"sequentialminus":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"diverging":[[0,"#8e0152"],[0.1,"#c51b7d"],[0.2,"#de77ae"],[0.3,"#f1b6da"],[0.4,"#fde0ef"],[0.5,"#f7f7f7"],[0.6,"#e6f5d0"],[0.7,"#b8e186"],[0.8,"#7fbc41"],[0.9,"#4d9221"],[1,"#276419"]]},"xaxis":{"gridcolor":"white","linecolor":"white","ticks":"","title":{"standoff":15},"zerolinecolor":"white","automargin":true,"zerolinewidth":2},"yaxis":{"gridcolor":"white","linecolor":"white","ticks":"","title":{"standoff":15},"zerolinecolor":"white","automargin":true,"zerolinewidth":2},"scene":{"xaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2},"yaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2},"zaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2}},"shapedefaults":{"line":{"color":"#2a3f5f"}},"annotationdefaults":{"arrowcolor":"#2a3f5f","arrowhead":0,"arrowwidth":1},"geo":{"bgcolor":"white","landcolor":"#E5ECF6","subunitcolor":"white","showland":true,"showlakes":true,"lakecolor":"white"},"title":{"x":0.05},"mapbox":{"style":"light"}}},"xaxis":{"anchor":"y","domain":[0.0,1.0],"title":{"text":"Year","font":{"size":10}},"rangeslider":{"visible":true},"tickfont":{"size":8},"gridcolor":"#e9ecef","linecolor":"#495057","showgrid":true,"gridwidth":0.5,"linewidth":0.8},"yaxis":{"anchor":"x","domain":[0.0,1.0],"title":{"text":"Mortality","font":{"size":10}},"tickfont":{"size":8},"gridcolor":"#e9ecef","linecolor":"#495057","showgrid":true,"gridwidth":0.5,"linewidth":0.8},"legend":{"tracegroupgap":0,"font":{"size":9},"bgcolor":"rgba(255,255,255,0.8)","orientation":"h","yanchor":"bottom","y":-0.2,"xanchor":"center","x":0.5},"margin":{"t":80,"l":60,"r":40,"b":60},"font":{"family":"Helvetica, Arial, sans-serif","size":10,"color":"#212529"},"title":{"font":{"size":14,"color":"#212529","family":"Helvetica, Arial, sans-serif"},"text":"Heart Failure In-Hospital Mortality Trends (%)","x":0.5,"xanchor":"center"},"paper_bgcolor":"#ffffff","plot_bgcolor":"#ffffff","colorway":["#4477AA","#66CCEE","#228833","#CCBB44","#EE6677","#AA3377","#BBBBBB"]}, {"responsive": true} ) }; </script> </div>
</body>
</html><html>
<head><meta charset="utf-8" /></head>
<body>
<div> <script type="text/javascript">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>
<script charset="utf-8" src="https://cdn.plot.ly/plotly-3.3.0.min.js" integrity="sha256-bO3dS6yCpk9aK4gUpNELtCiDeSYvGYnK7jFI58NQnHI=" crossorigin="anonymous"></script> <div id="dc4e75b7-6b9a-4a4d-8777-3c17bee1833a" class="plotly-graph-div" style="height:100%; width:100%;"></div> <script type="text/javascript"> window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById("dc4e75b7-6b9a-4a4d-8777-3c17bee1833a")) { Plotly.newPlot( "dc4e75b7-6b9a-4a4d-8777-3c17bee1833a", [{"marker":{"color":"#0077bb"},"name":"Treatment","x":["Primary Endpoint","Secondary Endpoint","Safety Event"],"y":{"dtype":"f8","bdata":"mpmZmZmZKEAAAAAAAAAhQJqZmZmZmQlA"},"type":"bar"},{"marker":{"color":"#ee7733"},"name":"Placebo","x":["Primary Endpoint","Secondary Endpoint","Safety Event"],"y":{"dtype":"f8","bdata":"MzMzMzOzMkBmZmZmZmYsQGZmZmZmZgZA"},"type":"bar"}], {"template":{"data":{"histogram2dcontour":[{"type":"histogram2dcontour","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"choropleth":[{"type":"choropleth","colorbar":{"outlinewidth":0,"ticks":""}}],"histogram2d":[{"type":"histogram2d","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"heatmap":[{"type":"heatmap","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"contourcarpet":[{"type":"contourcarpet","colorbar":{"outlinewidth":0,"ticks":""}}],"contour":[{"type":"contour","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"surface":[{"type":"surface","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"mesh3d":[{"type":"mesh3d","colorbar":{"outlinewidth":0,"ticks":""}}],"scatter":[{"fillpattern":{"fillmode":"overlay","size":10,"solidity":0.2},"type":"scatter"}],"parcoords":[{"type":"parcoords","line":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterpolargl":[{"type":"scatterpolargl","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"bar":[{"error_x":{"color":"#2a3f5f"},"error_y":{"color":"#2a3f5f"},"marker":{"line":{"color":"#E5ECF6","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"bar"}],"scattergeo":[{"type":"scattergeo","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterpolar":[{"type":"scatterpolar","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"histogram":[{"marker":{"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"histogram"}],"scattergl":[{"type":"scattergl","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatter3d":[{"type":"scatter3d","line":{"colorbar":{"outlinewidth":0,"ticks":""}},"marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scattermap":[{"type":"scattermap","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scattermapbox":[{"type":"scattermapbox","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterternary":[{"type":"scatterternary","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scattercarpet":[{"type":"scattercarpet","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"carpet":[{"aaxis":{"endlinecolor":"#2a3f5f","gridcolor":"white","linecolor":"white","minorgridcolor":"white","startlinecolor":"#2a3f5f"},"baxis":{"endlinecolor":"#2a3f5f","gridcolor":"white","linecolor":"white","minorgridcolor":"white","startlinecolor":"#2a3f5f"},"type":"carpet"}],"table":[{"cells":{"fill":{"color":"#EBF0F8"},"line":{"color":"white"}},"header":{"fill":{"color":"#C8D4E3"},"line":{"color":"white"}},"type":"table"}],"barpolar":[{"marker":{"line":{"color":"#E5ECF6","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"barpolar"}],"pie":[{"automargin":true,"type":"pie"}]},"layout":{"autotypenumbers":"strict","colorway":["#636efa","#EF553B","#00cc96","#ab63fa","#FFA15A","#19d3f3","#FF6692","#B6E880","#FF97FF","#FECB52"],"font":{"color":"#2a3f5f"},"hovermode":"closest","hoverlabel":{"align":"left"},"paper_bgcolor":"white","plot_bgcolor":"#E5ECF6","polar":{"bgcolor":"#E5ECF6","angularaxis":{"gridcolor":"white","linecolor":"white","ticks":""},"radialaxis":{"gridcolor":"white","linecolor":"white","ticks":""}},"ternary":{"bgcolor":"#E5ECF6","aaxis":{"gridcolor":"white","linecolor":"white","ticks":""},"baxis":{"gridcolor":"white","linecolor":"white","ticks":""},"caxis":{"gridcolor":"white","linecolor":"white","ticks":""}},"coloraxis":{"colorbar":{"outlinewidth":0,"ticks":""}},"colorscale":{"sequential":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"sequentialminus":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"diverging":[[0,"#8e0152"],[0.1,"#c51b7d"],[0.2,"#de77ae"],[0.3,"#f1b6da"],[0.4,"#fde0ef"],[0.5,"#f7f7f7"],[0.6,"#e6f5d0"],[0.7,"#b8e186"],[0.8,"#7fbc41"],[0.9,"#4d9221"],[1,"#276419"]]},"xaxis":{"gridcolor":"white","linecolor":"white","ticks":"","title":{"standoff":15},"zerolinecolor":"white","automargin":true,"zerolinewidth":2},"yaxis":{"gridcolor":"white","linecolor":"white","ticks":"","title":{"standoff":15},"zerolinecolor":"white","automargin":true,"zerolinewidth":2},"scene":{"xaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2},"yaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2},"zaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2}},"shapedefaults":{"line":{"color":"#2a3f5f"}},"annotationdefaults":{"arrowcolor":"#2a3f5f","arrowhead":0,"arrowwidth":1},"geo":{"bgcolor":"white","landcolor":"#E5ECF6","subunitcolor":"white","showland":true,"showlakes":true,"lakecolor":"white"},"title":{"x":0.05},"mapbox":{"style":"light"}}},"barmode":"group","yaxis":{"title":{"text":"Event Rate (%)","font":{"size":10}},"tickfont":{"size":8},"gridcolor":"#e9ecef","linecolor":"#495057","showgrid":true,"gridwidth":0.5,"linewidth":0.8},"font":{"family":"Helvetica, Arial, sans-serif","size":10,"color":"#212529"},"title":{"font":{"size":14,"color":"#212529","family":"Helvetica, Arial, sans-serif"},"text":"Clinical Trial Results","x":0.5,"xanchor":"center"},"xaxis":{"tickfont":{"size":8},"title":{"font":{"size":10}},"gridcolor":"#e9ecef","linecolor":"#495057","showgrid":true,"gridwidth":0.5,"linewidth":0.8},"legend":{"font":{"size":9},"bgcolor":"rgba(255,255,255,0.8)","orientation":"h","yanchor":"bottom","y":-0.2,"xanchor":"center","x":0.5},"paper_bgcolor":"#ffffff","plot_bgcolor":"#ffffff","colorway":["#4477AA","#66CCEE","#228833","#CCBB44","#EE6677","#AA3377","#BBBBBB"],"margin":{"l":60,"r":40,"t":80,"b":60}}, {"responsive": true} ) }; </script> </div>
</body>
</html>Visual Content Prompt Examples
Quick reference for generating different types of visual content for cardiology thought leadership.
---
Fal.ai: Blog Imagery
Hero Images (Emotional Hook)
"A 55-year-old man at his office desk, suddenly clutching his chest with a worried expression, realistic photography"
"Elderly woman sitting on a park bench, looking contemplative, golden hour lighting, hopeful mood"
"Young professional woman checking her smartwatch for heart rate, modern urban setting"Patient Experience
"Person experiencing shortness of breath at the top of stairs, realistic home setting, empathetic portrayal"
"Middle-aged man looking fatigued after minimal exertion, seated on couch, natural lighting"
"Woman with hand on chest feeling palpitations, concerned but composed expression"Recovery & Hope
"Smiling patient shaking hands with cardiologist, good news moment, bright medical office"
"Grandparent playing with grandchildren in backyard, recovery celebration, warm colors"
"Person completing cardiac rehabilitation exercise, determined expression, supportive trainer"Lifestyle & Prevention
"Diverse group of seniors in outdoor yoga class, heart healthy lifestyle, morning light"
"Family cooking Mediterranean meal together in modern kitchen, healthy eating"
"Couple walking hand in hand on beach at sunrise, active retirement lifestyle"Medical Encounters (Human Side)
"Patient and doctor having compassionate conversation, medical office, trust and care"
"Family members in hospital waiting room, supporting each other, emotional but hopeful"
"Nurse holding elderly patient's hand, comfort and reassurance"---
Gemini: Infographics
Disease Progression
Create a minimalist medical infographic showing the 4 stages of heart failure (A through D).
Include:
- Risk factors only (Stage A)
- Structural changes, no symptoms (Stage B)
- Symptomatic heart failure (Stage C)
- Advanced/refractory (Stage D)
Style: Clean icons, blue medical color palette, arrows showing progression, brief text labelsRisk Factors
Create an educational infographic about 7 modifiable cardiovascular risk factors.
Include:
- Hypertension (blood pressure gauge icon)
- Diabetes (glucose icon)
- Smoking (cigarette with X icon)
- Obesity (scale icon)
- Physical inactivity (sedentary icon)
- Unhealthy diet (food icon)
- High cholesterol (blood vessel icon)
Style: Grid layout, icons with brief labels, color-coded by modifiabilityTreatment Comparison
Create an infographic comparing treatment approaches for atrial fibrillation.
Two columns:
1. Rate Control - medications, goal heart rate, when to use
2. Rhythm Control - medications, ablation, when to prefer
Style: Side-by-side layout, clean icons, medical blue/teal colorsSymptom Guide
Create a patient-friendly infographic showing warning signs of heart attack.
Include:
- Chest pain/pressure (most common)
- Arm pain (often left)
- Jaw pain
- Shortness of breath
- Nausea
- Cold sweats
- Note: Women may have atypical symptoms
Style: Human figure outline, symptom labels pointing to areas, urgent color accents for "call 911"Statistics Summary
Create a data infographic about heart disease in America.
Key stats:
- #1 cause of death
- 697,000 deaths/year
- 1 in 5 deaths
- $229 billion annual cost
- 80% preventable with lifestyle
Style: Large bold numbers, supporting icons, source attribution, clean layout---
Mermaid: Diagrams & Flowcharts
Treatment Algorithm
flowchart TD
A[HFrEF Diagnosis<br>LVEF ≤40%] --> B[Initiate GDMT]
B --> C[ACEi/ARB/ARNI]
B --> D[Beta-blocker]
B --> E[SGLT2 inhibitor]
B --> F[MRA]
C --> G{Tolerating?}
D --> G
E --> G
F --> G
G -->|Yes| H[Titrate to target doses]
G -->|No| I[Address barriers]
H --> J{LVEF still ≤35%?}
J -->|Yes| K[Consider ICD/CRT]
J -->|No| L[Continue therapy]Diagnostic Pathway
flowchart TD
A[Suspected Heart Failure] --> B{BNP/NT-proBNP}
B -->|Elevated| C[Echocardiogram]
B -->|Normal| D[HF unlikely<br>Consider alternatives]
C --> E{LVEF?}
E -->|≤40%| F[HFrEF]
E -->|41-49%| G[HFmrEF]
E -->|≥50%| H[HFpEF]
F --> I[Start GDMT]
G --> J[Consider GDMT]
H --> K[Treat comorbidities]Decision Tree
flowchart TD
A[Acute Chest Pain] --> B{STEMI on ECG?}
B -->|Yes| C[Activate Cath Lab<br>Door-to-balloon <90 min]
B -->|No| D{Troponin elevated?}
D -->|Yes| E{High-risk features?}
D -->|No| F[Serial troponins<br>Observation]
E -->|Yes| G[Early invasive<br><24 hours]
E -->|No| H[Ischemia-guided<br>strategy]Timeline/Gantt
gantt
title Post-ACS Care Timeline
dateFormat YYYY-MM-DD
section Acute Phase
Hospital stay :a1, 2024-01-01, 4d
Cath/intervention :a2, 2024-01-02, 1d
section Early Recovery
Cardiac rehabilitation :a3, 2024-01-05, 84d
DAPT therapy :a4, 2024-01-01, 365d
section Long-term
Lifestyle modification :a5, 2024-01-01, 365d
Statin therapy :a6, 2024-01-01, 365dSequence Diagram (Patient Journey)
sequenceDiagram
participant P as Patient
participant ER as Emergency
participant Card as Cardiology
participant Rehab as Cardiac Rehab
P->>ER: Presents with chest pain
ER->>ER: ECG, troponin, vitals
ER->>Card: STEMI alert
Card->>Card: Cath lab activation
Card->>P: PCI performed
Card->>Rehab: Referral
Rehab->>P: 12-week program
P->>Card: Follow-up visits---
Plotly: Data Visualization
Trial Results Bar Chart
import plotly.express as px
data = {
'Trial': ['PARADIGM-HF', 'DAPA-HF', 'EMPEROR-Reduced'],
'Mortality Reduction (%)': [20, 17, 14]
}
fig = px.bar(data, x='Trial', y='Mortality Reduction (%)',
title='Heart Failure Trials: Mortality Reduction',
color='Trial')Forest Plot
# Use create_forest_plot() from plotly_charts.py
fig = create_forest_plot(
studies=['PARADIGM-HF', 'DAPA-HF', 'EMPEROR-Reduced', 'VICTORIA'],
estimates=[0.80, 0.74, 0.75, 0.90],
lower_ci=[0.73, 0.65, 0.65, 0.82],
upper_ci=[0.87, 0.85, 0.86, 0.98],
title='HF Trials: Hazard Ratios'
)Trends Over Time
import pandas as pd
import plotly.express as px
df = pd.DataFrame({
'Year': list(range(2000, 2024)),
'HF Mortality (%)': [...], # Your data
'Era': ['Pre-GDMT', 'GDMT', 'GDMT+SGLT2i'] # Color coding
})
fig = px.line(df, x='Year', y='HF Mortality (%)', color='Era',
title='Heart Failure Mortality: Treatment Era Comparison')Comparison Grouped Bars
fig = create_comparison_bars(
categories=['30-day mortality', '1-year mortality', 'Readmission'],
group1_values=[8.2, 22.5, 18.3],
group2_values=[5.1, 17.2, 12.8],
group1_name='Pre-intervention',
group2_name='Post-intervention',
title='Quality Improvement Outcomes'
)---
React Artifacts: Interactive Content
Risk Calculator
// Use for building interactive ASCVD risk calculator,
// CHA2DS2-VASc score calculator, etc.
// React component with input fields and calculated outputInteractive Treatment Algorithm
// Flowchart that highlights the path based on user inputs
// "Click the patient's LVEF to see recommendations"Explorable Explanation
// Animation showing how heart failure develops
// User controls progression speed, can explore each stage---
Routing Cheat Sheet
| If user says... | Use this tool |
|---|---|
| "blog image", "hero", "lifestyle photo" | Fal.ai |
| "infographic", "visual summary", "explainer" | Gemini |
| "flowchart", "algorithm", "pathway", "decision tree" | Mermaid |
| "slides", "presentation", "deck", "lecture" | Marp |
| "chart", "graph", "data", "trial results", "trends" | Plotly |
| "interactive", "calculator", "animated" | React |
#!/bin/bash
# Marp Slide Conversion Helper
# Converts Markdown slides to PPTX, PDF, or HTML
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
INPUT="${1:-presentation.md}"
FORMAT="${2:-pptx}"
OUTPUT="${3:-}"
# Check if marp-cli is installed
if ! command -v marp &> /dev/null; then
echo "❌ Marp CLI not found!"
echo ""
echo "Install with:"
echo " npm install -g @marp-team/marp-cli"
echo ""
echo "Or use npx:"
echo " npx @marp-team/marp-cli $INPUT --pptx"
exit 1
fi
# Check if input file exists
if [ ! -f "$INPUT" ]; then
echo "❌ Input file not found: $INPUT"
echo ""
echo "Usage: ./convert_slides.sh <input.md> [format] [output]"
echo ""
echo "Formats: pptx, pdf, html"
exit 1
fi
# Set output filename if not provided
if [ -z "$OUTPUT" ]; then
BASENAME="${INPUT%.*}"
OUTPUT="${BASENAME}.${FORMAT}"
fi
echo "📄 Input: $INPUT"
echo "📦 Format: $FORMAT"
echo "💾 Output: $OUTPUT"
echo ""
case $FORMAT in
pptx)
marp "$INPUT" --pptx -o "$OUTPUT"
;;
pdf)
marp "$INPUT" --pdf -o "$OUTPUT"
;;
html)
marp "$INPUT" -o "$OUTPUT"
;;
*)
echo "❌ Unknown format: $FORMAT"
echo " Use: pptx, pdf, or html"
exit 1
;;
esac
echo ""
echo "✅ Created: $OUTPUT"
# Show file size
if [ -f "$OUTPUT" ]; then
SIZE=$(ls -lh "$OUTPUT" | awk '{print $5}')
echo "📊 Size: $SIZE"
fi
#!/usr/bin/env python3
"""
Fal.ai Image Generation for Medical Blogs
Generates contextually appropriate images for cardiology content.
Focuses on human experiences, not medical devices.
Usage:
python fal_image.py "Patient experiencing chest pain" --output hero.png
"""
import os
import sys
import json
import argparse
from pathlib import Path
from typing import Optional, Tuple
# ============================================================================
# CONTENT GUIDELINES
# ============================================================================
BLOCKED_TERMS = [
# Devices
"pacemaker", "icd", "defibrillator", "stent", "balloon", "catheter",
"valve", "lvad", "heart pump", "holter", "monitor device", "implant",
"lead", "generator", "watchman", "occluder", "clip", "mitraclip",
# Clinical imagery
"ecg", "ekg", "electrocardiogram", "angiogram", "fluoroscopy",
"ct scan", "mri", "echo", "echocardiogram", "x-ray", "xray",
"ultrasound", "doppler", "cardiac catheterization", "cath lab",
# Procedures
"surgery", "operation", "incision", "operating room", "surgical",
"ablation", "cardioversion", "bypass", "cabg", "tavr", "tavi",
"pci", "angioplasty", "thrombectomy",
# Anatomical
"cross-section", "cross section", "diagram", "schematic", "anatomy",
"artery illustration", "heart diagram", "blood vessel diagram",
# Medications
"pill", "tablet", "medication bottle", "syringe", "injection",
"iv drip", "infusion"
]
STYLE_PRESETS = {
"photo": "realistic photography, natural lighting, editorial quality, professional photo",
"illustration": "clean digital illustration, modern medical communication style, warm colors",
"editorial": "editorial photography style, magazine quality, storytelling composition"
}
MEDICAL_CONTEXT_ENHANCERS = {
"chest pain": "concerned expression, hand on chest, realistic indoor or office setting",
"shortness of breath": "person catching breath, slight fatigue visible, empathetic portrayal",
"palpitations": "hand on heart, worried but composed expression, home environment",
"fatigue": "tired but resilient expression, natural lighting, relatable setting",
"dizziness": "person steadying themselves, concerned expression, indoor setting",
"swelling": "person noticing discomfort, seated position, caring atmosphere",
"heart attack": "sudden distress, clutching chest, urgent but dignified portrayal",
"anxiety": "worried expression, tense posture, empathetic lighting",
"recovery": "hopeful expression, signs of improvement, warm lighting",
"exercise": "active movement, healthy lifestyle, outdoor or gym setting",
"diet": "healthy food, family or individual meal setting, warm atmosphere",
"doctor": "compassionate healthcare provider, reassuring conversation, professional setting",
"family": "supportive loved ones, caring expressions, home or hospital waiting area",
"elderly": "dignified older adult, wise expression, respectful portrayal",
"caregiver": "supportive person, gentle interaction, caring atmosphere"
}
def check_blocked_content(prompt: str) -> Tuple[bool, Optional[str]]:
"""Check if prompt requests blocked medical content."""
prompt_lower = prompt.lower()
for term in BLOCKED_TERMS:
if term in prompt_lower:
return True, term
return False, None
def enhance_prompt(prompt: str, style: str = "photo") -> str:
"""Enhance prompt for medical blog appropriateness."""
enhanced = prompt
# Add context-specific enhancements
prompt_lower = prompt.lower()
for context, enhancement in MEDICAL_CONTEXT_ENHANCERS.items():
if context in prompt_lower:
if enhancement not in enhanced.lower():
enhanced = f"{enhanced}, {enhancement}"
break
# Add style preset
style_suffix = STYLE_PRESETS.get(style, STYLE_PRESETS["photo"])
enhanced = f"{enhanced}, {style_suffix}"
# Add general quality modifiers
if "high quality" not in enhanced.lower():
enhanced = f"{enhanced}, high quality, detailed, professional"
return enhanced
def suggest_alternative(blocked_term: str) -> str:
"""Suggest a human-centered alternative."""
alternatives = {
"pacemaker": "a patient discussing heart rhythm treatment with their doctor, hopeful expression",
"stent": "a patient learning about their treatment options, engaged conversation with cardiologist",
"ecg": "a person being reassured by a healthcare provider, calm medical setting",
"ekg": "a patient receiving good news about their heart health, relieved expression",
"angiogram": "a patient preparing for a procedure, supported by caring medical staff",
"surgery": "a family supporting a loved one before a medical procedure, hospital waiting area",
"catheter": "a patient in recovery, peaceful expression, supportive environment",
"bypass": "a patient discussing treatment options with surgeon, thoughtful conversation",
"defibrillator": "a person learning about heart health, educational setting",
"valve": "a patient and doctor reviewing treatment plan together",
}
for key, alt in alternatives.items():
if key in blocked_term.lower():
return alt
return "a patient having a supportive conversation with their healthcare provider, warm lighting, professional medical setting"
def get_api_key() -> Optional[str]:
"""Check for Fal.ai API key."""
api_key = os.environ.get("FAL_KEY")
if api_key:
return api_key
# Check .env files
for parent in [Path.cwd()] + list(Path.cwd().parents):
env_file = parent / ".env"
if env_file.exists():
with open(env_file, 'r') as f:
for line in f:
line = line.strip()
if line.startswith('FAL_KEY='):
return line.split('=', 1)[1].strip().strip('"').strip("'")
return None
def generate_image(
prompt: str,
model: str = "fal-ai/recraft-v3",
output_path: str = "medical_blog_image.png",
style: str = "photo",
aspect_ratio: str = "16:9"
) -> dict:
"""Generate image using Fal.ai API."""
try:
import requests
except ImportError:
print("❌ Install requests: pip install requests --break-system-packages")
sys.exit(1)
api_key = get_api_key()
if not api_key:
print("❌ FAL_KEY not found!")
print("Set with: export FAL_KEY=your-api-key")
print("Get key from: https://fal.ai/dashboard/keys")
sys.exit(1)
# Check for blocked content
is_blocked, blocked_term = check_blocked_content(prompt)
if is_blocked:
print(f"⚠️ Medical device/procedure detected: '{blocked_term}'")
alternative = suggest_alternative(blocked_term)
print(f" Using alternative: {alternative}")
prompt = alternative
# Enhance prompt
enhanced_prompt = enhance_prompt(prompt, style)
print(f"📝 Prompt: {enhanced_prompt[:100]}...")
# API endpoints
model_endpoints = {
"fal-ai/recraft-v3": "https://fal.run/fal-ai/recraft-v3",
"fal-ai/flux-pro/v1.1": "https://fal.run/fal-ai/flux-pro/v1.1",
"fal-ai/flux-pro": "https://fal.run/fal-ai/flux-pro",
"fal-ai/flux/schnell": "https://fal.run/fal-ai/flux/schnell",
"fal-ai/ideogram/v3": "https://fal.run/fal-ai/ideogram/v3",
}
endpoint = model_endpoints.get(model, f"https://fal.run/{model}")
# Prepare payload
payload = {"prompt": enhanced_prompt}
if "recraft" in model.lower():
size_map = {
"16:9": {"width": 1920, "height": 1080},
"4:3": {"width": 1440, "height": 1080},
"1:1": {"width": 1024, "height": 1024},
"3:4": {"width": 1080, "height": 1440},
"9:16": {"width": 1080, "height": 1920},
}
payload["image_size"] = size_map.get(aspect_ratio, size_map["16:9"])
payload["style"] = "realistic_image" if style == "photo" else "digital_illustration"
elif "flux" in model.lower():
payload["image_size"] = aspect_ratio
elif "ideogram" in model.lower():
payload["aspect_ratio"] = aspect_ratio
print(f"🚀 Generating with {model}...")
headers = {
"Authorization": f"Key {api_key}",
"Content-Type": "application/json"
}
try:
response = requests.post(endpoint, headers=headers, json=payload, timeout=120)
if response.status_code != 200:
print(f"❌ API Error ({response.status_code})")
print(f" {response.text[:500]}")
sys.exit(1)
result = response.json()
# Extract image URL
image_url = None
if "images" in result and result["images"]:
img = result["images"][0]
image_url = img.get("url") if isinstance(img, dict) else img
elif "image" in result:
img = result["image"]
image_url = img.get("url") if isinstance(img, dict) else img
elif "output" in result:
out = result["output"]
image_url = out[0] if isinstance(out, list) else out
if not image_url:
print(f"⚠️ No image URL in response: {list(result.keys())}")
sys.exit(1)
# Download and save
print(f"📥 Downloading...")
img_response = requests.get(image_url, timeout=60)
with open(output_path, 'wb') as f:
f.write(img_response.content)
print(f"✅ Saved: {output_path}")
# Cost estimate
costs = {"recraft": 0.04, "flux-pro": 0.04, "flux/schnell": 0.003, "ideogram": 0.08}
for key, cost in costs.items():
if key in model.lower():
print(f"💰 Cost: ~${cost:.3f}")
break
return {"success": True, "output_path": output_path, "prompt_used": enhanced_prompt}
except requests.exceptions.Timeout:
print("❌ Timeout. Try fal-ai/flux/schnell for faster generation.")
sys.exit(1)
except requests.exceptions.RequestException as e:
print(f"❌ Network error: {e}")
sys.exit(1)
def main():
parser = argparse.ArgumentParser(description="Generate medical blog images via Fal.ai")
parser.add_argument("prompt", help="Image description")
parser.add_argument("--output", "-o", default="medical_blog_image.png", help="Output path")
parser.add_argument("--model", "-m", default="fal-ai/recraft-v3", help="Fal.ai model")
parser.add_argument("--style", "-s", choices=["photo", "illustration", "editorial"], default="photo")
parser.add_argument("--aspect", "-a", default="16:9", help="Aspect ratio")
args = parser.parse_args()
generate_image(
prompt=args.prompt,
model=args.model,
output_path=args.output,
style=args.style,
aspect_ratio=args.aspect
)
if __name__ == "__main__":
main()
#!/usr/bin/env python3
"""
Gemini Infographic Generation for Medical Content
Creates infographics, medical illustrations, and educational visuals
using Google's Gemini API.
Usage:
python gemini_infographic.py --topic "Heart Failure Stages" --output hf_stages.jpg
python gemini_infographic.py --prompt "Create an infographic showing..." --output output.jpg
"""
import os
import sys
import argparse
from pathlib import Path
from typing import Optional
def get_api_key() -> Optional[str]:
"""Get Gemini API key from environment or .env file."""
api_key = os.environ.get("GEMINI_API_KEY")
if api_key:
return api_key
for parent in [Path.cwd()] + list(Path.cwd().parents):
env_file = parent / ".env"
if env_file.exists():
with open(env_file, 'r') as f:
for line in f:
line = line.strip()
if line.startswith('GEMINI_API_KEY='):
return line.split('=', 1)[1].strip().strip('"').strip("'")
return None
# Medical infographic prompt templates
INFOGRAPHIC_TEMPLATES = {
"stages": """Create a clean, professional medical infographic showing the stages/progression of {topic}.
Requirements:
- Clear visual hierarchy with numbered or lettered stages
- Use icons or simple illustrations for each stage
- Brief, readable text descriptions
- Arrows or flow indicators showing progression
- Professional medical color scheme (blues, teals, whites)
- Modern, clean design suitable for patient education
- No cluttered elements
- Easy to read at a glance""",
"comparison": """Create a professional medical infographic comparing {topic}.
Requirements:
- Side-by-side or column comparison layout
- Clear headers for each option
- Icons representing key points
- Pros/cons or key differences highlighted
- Professional medical color scheme
- Clean, modern design
- Easy to scan and understand""",
"process": """Create a clear medical infographic showing the process/workflow for {topic}.
Requirements:
- Step-by-step visual flow
- Numbered steps with icons
- Brief text for each step
- Arrows connecting the steps
- Professional, clean design
- Medical color palette (blues, greens, teals)
- Suitable for patient or professional education""",
"risk_factors": """Create an educational medical infographic about risk factors for {topic}.
Requirements:
- Visual icons for each risk factor
- Grid or radial layout
- Brief descriptions
- Color coding (modifiable vs non-modifiable if applicable)
- Professional medical styling
- Clear hierarchy and readability""",
"statistics": """Create a data-focused medical infographic presenting statistics about {topic}.
Requirements:
- Key numbers prominently displayed
- Visual representations (icons, simple charts)
- Source attribution space
- Professional layout
- Medical color scheme
- Easy to understand at a glance""",
"symptoms": """Create a patient-friendly infographic showing symptoms of {topic}.
Requirements:
- Body-related icons or human figure if appropriate
- Clear symptom labels
- Grouped by severity or type if applicable
- When to seek care highlighted
- Warm but professional colors
- Accessible, non-scary presentation""",
"treatment": """Create a medical infographic summarizing treatment options for {topic}.
Requirements:
- Treatment categories clearly organized
- Icons for each treatment type
- Brief descriptions of each approach
- Professional medical design
- Clear visual hierarchy
- Suitable for patient education""",
"custom": """{prompt}
Style requirements:
- Professional medical infographic style
- Clean, modern design
- Medical color palette (blues, teals, professional tones)
- Clear visual hierarchy
- Easy to read text
- Icons or illustrations where appropriate
- Suitable for medical education content"""
}
def build_infographic_prompt(
topic: Optional[str] = None,
template: str = "custom",
custom_prompt: Optional[str] = None,
style: str = "minimalist medical",
additional_instructions: str = ""
) -> str:
"""Build a complete infographic prompt."""
if custom_prompt:
base = INFOGRAPHIC_TEMPLATES["custom"].format(prompt=custom_prompt)
elif topic and template in INFOGRAPHIC_TEMPLATES:
base = INFOGRAPHIC_TEMPLATES[template].format(topic=topic)
else:
raise ValueError("Provide either --topic with --template, or --prompt")
# Add style modifier
style_addition = f"\n\nVisual style: {style}, high quality, publication ready"
# Add any additional instructions
if additional_instructions:
style_addition += f"\n\nAdditional requirements: {additional_instructions}"
return base + style_addition
def generate_infographic(
prompt: str,
output_path: str = "infographic.jpg",
aspect_ratio: str = "3:4",
resolution: str = "2K"
) -> dict:
"""Generate infographic using Gemini API."""
try:
from google import genai
from google.genai import types
except ImportError:
print("❌ Install google-genai:")
print(" pip install google-genai --break-system-packages")
sys.exit(1)
api_key = get_api_key()
if not api_key:
print("❌ GEMINI_API_KEY not found!")
print("Set with: export GEMINI_API_KEY=your-key")
sys.exit(1)
client = genai.Client(api_key=api_key)
print(f"📝 Prompt: {prompt[:150]}...")
print(f"🚀 Generating infographic ({aspect_ratio}, {resolution})...")
try:
response = client.models.generate_content(
model="gemini-2.0-flash-exp-image-generation",
contents=[prompt],
config=types.GenerateContentConfig(
response_modalities=['IMAGE', 'TEXT'],
image_config=types.ImageConfig(
aspect_ratio=aspect_ratio,
)
)
)
# Process response
for part in response.parts:
if hasattr(part, 'inline_data') and part.inline_data:
# Save image - Gemini returns JPEG by default
image = part.as_image()
# Ensure .jpg extension for JPEG data
if not output_path.lower().endswith(('.jpg', '.jpeg')):
output_path = output_path.rsplit('.', 1)[0] + '.jpg'
image.save(output_path)
print(f"✅ Saved: {output_path}")
return {
"success": True,
"output_path": output_path,
"prompt_used": prompt
}
elif hasattr(part, 'text') and part.text:
print(f"📄 Model response: {part.text[:200]}...")
print("⚠️ No image generated. The model may have declined.")
return {"success": False, "error": "No image in response"}
except Exception as e:
print(f"❌ Generation error: {e}")
sys.exit(1)
def main():
parser = argparse.ArgumentParser(
description="Generate medical infographics with Gemini",
formatter_class=argparse.RawDescriptionHelpFormatter,
epilog="""
Examples:
# Using a template
python gemini_infographic.py --topic "Heart Failure" --template stages --output hf_stages.jpg
# Custom prompt
python gemini_infographic.py --prompt "Create an infographic showing 5 warning signs of stroke" --output stroke.jpg
# With style options
python gemini_infographic.py --topic "AFib Risk Factors" --template risk_factors --style "modern minimal" --aspect 1:1
Templates available: stages, comparison, process, risk_factors, statistics, symptoms, treatment
"""
)
parser.add_argument("--topic", "-t", help="Topic for template-based generation")
parser.add_argument("--template", choices=list(INFOGRAPHIC_TEMPLATES.keys()),
default="custom", help="Infographic template type")
parser.add_argument("--prompt", "-p", help="Custom prompt (overrides template)")
parser.add_argument("--output", "-o", default="infographic.jpg", help="Output path")
parser.add_argument("--style", "-s", default="minimalist medical",
help="Visual style description")
parser.add_argument("--aspect", "-a", default="3:4",
help="Aspect ratio: 1:1, 3:4, 4:3, 16:9, 9:16")
parser.add_argument("--resolution", "-r", default="2K",
choices=["1K", "2K", "4K"], help="Image resolution")
parser.add_argument("--instructions", "-i", default="",
help="Additional instructions")
args = parser.parse_args()
# Validate input
if not args.prompt and not args.topic:
parser.error("Provide either --prompt or --topic with --template")
# Build prompt
prompt = build_infographic_prompt(
topic=args.topic,
template=args.template,
custom_prompt=args.prompt,
style=args.style,
additional_instructions=args.instructions
)
# Generate
generate_infographic(
prompt=prompt,
output_path=args.output,
aspect_ratio=args.aspect,
resolution=args.resolution
)
if __name__ == "__main__":
main()
#!/usr/bin/env python3
"""
LIDA Quick Visualization - AI-Driven Prototyping Tool
=====================================================
⚠️ **PROTOTYPING ONLY - NOT FOR PRODUCTION USE**
Microsoft LIDA integration for rapid visualization prototyping from natural language.
Automatically generates visualization code using LLMs (OpenAI, Gemini, Claude, etc.).
**Limitations:**
- Works best with ≤10 columns (LLM context constraints)
- Quality varies - ALWAYS review for medical accuracy
- No specialized medical charts documented (forest plots, Kaplan-Meier)
- Requires manual validation before any publication
**Use Cases:**
✅ Quick exploration ("Show me mortality rates by treatment arm")
✅ Multiple visualization candidates for exploratory analysis
✅ Content research (visualize PubMed search results)
✅ Automated reporting for internal review
❌ NOT for publication-ready charts (use plotly_charts.py instead)
❌ NOT for patient-facing materials without expert review
❌ NOT for regulatory submissions
Usage:
# Basic usage
python lida_quick_viz.py "Show mortality by treatment group" trial_data.csv
# Generate multiple candidates
python lida_quick_viz.py "Compare outcomes" data.csv --candidates 3
# Specify visualization library
python lida_quick_viz.py "Line chart of trends" data.csv --library plotly
# Use medical template
python lida_quick_viz.py "Trial results" data.csv --template trial_comparison
# Interactive mode
python lida_quick_viz.py --interactive data.csv
Medical Templates:
trial_comparison - Compare treatment arms (bar/forest plot style)
patient_demographics - Age, gender, comorbidities (pie/bar charts)
outcome_comparison - Primary/secondary endpoints (grouped bars)
trend_analysis - Trends over time (line charts)
survival_curve - Time-to-event data (line chart, NOT true Kaplan-Meier)
Dependencies:
pip install lida llmx openai pandas --break-system-packages
Environment Variables:
OPENAI_API_KEY - Required for OpenAI models
ANTHROPIC_API_KEY - For Claude models
GOOGLE_API_KEY - For Gemini models (FREE tier available)
Author: Dr. Shailesh Singh
Version: 1.0
Priority: P2 (prototyping tool)
"""
import argparse
import sys
import os
import json
import warnings
from pathlib import Path
from typing import Optional, List, Dict, Any
from datetime import datetime
# Suppress warnings
warnings.filterwarnings('ignore')
try:
from lida import Manager, TextGenerationConfig, llm
import pandas as pd
except ImportError:
print("❌ Install dependencies:")
print(" pip install lida llmx openai pandas --break-system-packages")
sys.exit(1)
# Medical prompt templates for common cardiology visualizations
MEDICAL_TEMPLATES = {
"trial_comparison": {
"description": "Compare treatment arms in clinical trial",
"prompt_template": """
Create a publication-quality visualization comparing {metric} across treatment groups.
Data columns: {columns}
Requirements:
- Clear group labels (Treatment A, B, Placebo)
- Error bars or confidence intervals if available
- Statistical significance indicators (p-values)
- Professional medical color scheme
- Legend and axis labels
- Title: {metric} by Treatment Group
Use bar chart or forest plot style. Keep it clean and publication-ready.
""",
"suggested_columns": ["treatment_group", "outcome", "ci_lower", "ci_upper", "p_value"]
},
"patient_demographics": {
"description": "Visualize patient baseline characteristics",
"prompt_template": """
Create a clean visualization of patient demographics.
Data columns: {columns}
Requirements:
- Show distribution of age, gender, comorbidities
- Use appropriate chart types (pie for categorical, histogram for continuous)
- Professional medical styling
- Clear labels and percentages
- Title: Patient Demographics and Baseline Characteristics
Keep it simple and informative for a medical audience.
""",
"suggested_columns": ["age", "gender", "comorbidity", "count", "percentage"]
},
"outcome_comparison": {
"description": "Compare primary and secondary endpoints",
"prompt_template": """
Create a grouped bar chart comparing outcomes across endpoints.
Data columns: {columns}
Requirements:
- Group by endpoint type (primary, secondary)
- Show treatment vs control
- Include confidence intervals or standard errors
- Professional color scheme (blues/teals for medical)
- Clear legend and axis labels
- Title: Clinical Outcomes Comparison
Make it suitable for a medical presentation or publication.
""",
"suggested_columns": ["endpoint", "treatment", "outcome_rate", "ci_lower", "ci_upper"]
},
"trend_analysis": {
"description": "Show trends over time",
"prompt_template": """
Create a line chart showing {metric} trends over time.
Data columns: {columns}
Requirements:
- Time on x-axis, metric on y-axis
- Multiple lines for different groups/treatments if applicable
- Smooth lines with data points
- Professional medical styling
- Clear legend
- Title: {metric} Trends Over Time
Use a clean, publication-ready style.
""",
"suggested_columns": ["time_point", "metric", "group", "value"]
},
"survival_curve": {
"description": "Time-to-event visualization (simplified, NOT true Kaplan-Meier)",
"prompt_template": """
Create a survival-style curve showing time-to-event data.
⚠️ NOTE: This is a simplified visualization, NOT a true Kaplan-Meier curve.
For publication, use proper survival analysis tools (lifelines, statsmodels).
Data columns: {columns}
Requirements:
- Time on x-axis (days/months/years)
- Survival probability or event-free probability on y-axis (0-100%)
- Multiple curves for different treatment groups
- Step function if possible
- At-risk numbers if available
- Professional medical styling
- Title: Event-Free Survival by Treatment Group
This is for EXPLORATION ONLY. Use proper survival analysis for final results.
""",
"suggested_columns": ["time", "survival_probability", "group", "at_risk"]
}
}
# Quality validation checklist
QUALITY_CHECKLIST = """
⚠️ QUALITY VALIDATION CHECKLIST - REVIEW BEFORE USE
Medical Accuracy:
[ ] Data interpretation is correct (no flipped axes, wrong scales)
[ ] Statistical measures are appropriate (means vs medians, etc.)
[ ] Confidence intervals/error bars are correct
[ ] P-values and significance are accurate
[ ] Sample sizes are represented correctly
Visual Design:
[ ] Chart type is appropriate for the data
[ ] Color scheme is professional and accessible
[ ] Labels are clear and complete
[ ] Legend is present and accurate
[ ] Title accurately describes the content
Medical Standards:
[ ] Follows publication standards (Nature/JACC/NEJM style)
[ ] No misleading visualizations (truncated axes, etc.)
[ ] Appropriate precision (no false precision)
[ ] Context is provided (N, time period, etc.)
[ ] Source attribution if needed
Limitations:
[ ] Aware this is AI-generated and needs review
[ ] Not using for patient-facing materials without expert review
[ ] Not using for regulatory submissions
[ ] Will recreate in production tools (Plotly) if publishing
"""
class LIDAQuickViz:
"""Wrapper for LIDA visualization generation with medical context."""
def __init__(self, model: str = "openai", api_key: Optional[str] = None):
"""
Initialize LIDA manager.
Args:
model: LLM provider ("openai", "gemini", "anthropic")
api_key: API key (if not in environment)
"""
self.model = model
# Set API key if provided
if api_key:
if model == "openai":
os.environ["OPENAI_API_KEY"] = api_key
elif model == "anthropic":
os.environ["ANTHROPIC_API_KEY"] = api_key
elif model == "gemini":
os.environ["GOOGLE_API_KEY"] = api_key
# Check for API key
key_mapping = {
"openai": "OPENAI_API_KEY",
"anthropic": "ANTHROPIC_API_KEY",
"gemini": "GOOGLE_API_KEY"
}
required_key = key_mapping.get(model)
if required_key and not os.getenv(required_key):
print(f"⚠️ Warning: {required_key} not found in environment")
print(f" Set it with: export {required_key}=your_key")
print(f" Or use --api-key flag")
try:
# Initialize LIDA manager
self.lida = Manager(text_gen=llm(model))
print(f"✅ LIDA initialized with {model} model")
except Exception as e:
print(f"❌ Failed to initialize LIDA: {e}")
sys.exit(1)
def load_data(self, data_path: str) -> pd.DataFrame:
"""Load data from CSV or JSON."""
path = Path(data_path)
if not path.exists():
raise FileNotFoundError(f"Data file not found: {data_path}")
# Check column count
if path.suffix == '.csv':
df = pd.read_csv(data_path)
elif path.suffix == '.json':
df = pd.read_json(data_path)
else:
raise ValueError(f"Unsupported file format: {path.suffix}. Use .csv or .json")
# Warn if too many columns
if len(df.columns) > 10:
print(f"⚠️ Warning: Dataset has {len(df.columns)} columns")
print(" LIDA works best with ≤10 columns due to LLM context limits")
print(" Consider selecting relevant columns only")
print(f"📊 Loaded data: {len(df)} rows × {len(df.columns)} columns")
print(f" Columns: {', '.join(df.columns)}")
return df
def generate_prompt(self,
user_prompt: str,
template: Optional[str] = None,
columns: Optional[List[str]] = None) -> str:
"""
Generate enhanced prompt with medical context.
Args:
user_prompt: User's natural language description
template: Medical template name (from MEDICAL_TEMPLATES)
columns: Available data columns
Returns:
Enhanced prompt with medical context
"""
if template and template in MEDICAL_TEMPLATES:
template_config = MEDICAL_TEMPLATES[template]
prompt = template_config["prompt_template"].format(
metric=user_prompt,
columns=", ".join(columns) if columns else "unknown"
)
# Add suggested columns note
suggested = template_config.get("suggested_columns", [])
if suggested:
prompt += f"\n\nSuggested column mapping: {', '.join(suggested)}"
return prompt
else:
# Basic prompt with medical context
base_prompt = f"""
Create a professional medical visualization: {user_prompt}
Available data columns: {', '.join(columns) if columns else 'unknown'}
Requirements:
- Publication-quality styling
- Clear labels and legend
- Professional medical color scheme (blues, teals, grays)
- Appropriate chart type for the data
- Clean and informative
Target audience: Medical professionals and researchers.
"""
return base_prompt
def visualize(self,
data_path: str,
prompt: str,
template: Optional[str] = None,
library: str = "plotly",
n_candidates: int = 1,
output_dir: str = "lida_output") -> List[Dict[str, Any]]:
"""
Generate visualizations using LIDA.
Args:
data_path: Path to CSV/JSON data
prompt: Natural language description of desired viz
template: Medical template name (optional)
library: Viz library ("plotly", "matplotlib", "seaborn", "altair")
n_candidates: Number of visualization candidates to generate
output_dir: Output directory for generated visualizations
Returns:
List of generated visualization metadata
"""
print("\n" + "="*70)
print("🚀 LIDA QUICK VISUALIZATION - PROTOTYPING TOOL")
print("="*70)
print("\n⚠️ REMINDER: This is for PROTOTYPING ONLY")
print(" - Review all outputs for medical accuracy")
print(" - NOT for publication without expert review")
print(" - Use plotly_charts.py for production visualizations\n")
# Load data
df = self.load_data(data_path)
# Generate data summary
print("\n📋 Generating data summary...")
summary = self.lida.summarize(data_path)
# Generate enhanced prompt
enhanced_prompt = self.generate_prompt(
user_prompt=prompt,
template=template,
columns=df.columns.tolist()
)
print(f"\n🎯 Enhanced Prompt:\n{enhanced_prompt}\n")
# Generate visualization goals
print(f"🎨 Generating {n_candidates} visualization candidate(s)...")
goals = self.lida.goals(summary, n=n_candidates, persona="medical researcher")
# Generate visualizations
results = []
output_path = Path(output_dir)
output_path.mkdir(exist_ok=True, parents=True)
for i, goal in enumerate(goals):
print(f"\n📊 Candidate {i+1}/{len(goals)}: {goal.question}")
print(f" Rationale: {goal.rationale}")
try:
# Generate visualization code
charts = self.lida.visualize(
summary=summary,
goal=goal,
library=library
)
if charts:
chart = charts[0] # Take first chart
# Save code
code_file = output_path / f"candidate_{i+1}_code.py"
with open(code_file, 'w') as f:
f.write(chart.code)
# Save chart (base64 or raster)
chart_file = output_path / f"candidate_{i+1}.png"
# Execute and save (if possible)
try:
# LIDA returns base64 image in chart.raster
if hasattr(chart, 'raster') and chart.raster:
import base64
img_data = base64.b64decode(chart.raster)
with open(chart_file, 'wb') as f:
f.write(img_data)
print(f" ✅ Saved: {chart_file}")
else:
print(f" ⚠️ No raster image generated, code saved only")
except Exception as e:
print(f" ⚠️ Could not save image: {e}")
results.append({
"candidate": i + 1,
"goal": goal.question,
"rationale": goal.rationale,
"code_file": str(code_file),
"chart_file": str(chart_file) if chart_file.exists() else None,
"library": library
})
except Exception as e:
print(f" ❌ Error generating candidate {i+1}: {e}")
# Print summary
print("\n" + "="*70)
print(f"✅ Generated {len(results)} visualization(s)")
print(f"📁 Output directory: {output_path.absolute()}")
print("="*70)
# Print quality checklist
print(QUALITY_CHECKLIST)
return results
def interactive_mode(self, data_path: str):
"""Interactive mode for iterative visualization creation."""
print("\n" + "="*70)
print("🔄 LIDA INTERACTIVE MODE")
print("="*70)
print("\nCommands:")
print(" viz <prompt> - Generate visualization")
print(" template <name> - Use medical template")
print(" list - List available templates")
print(" library <name> - Switch visualization library")
print(" quit - Exit")
print("="*70 + "\n")
# Load data once
df = self.load_data(data_path)
summary = self.lida.summarize(data_path)
current_library = "plotly"
current_template = None
while True:
try:
cmd = input("\n> ").strip()
if not cmd:
continue
if cmd.lower() in ['quit', 'exit', 'q']:
print("👋 Goodbye!")
break
elif cmd.lower() == 'list':
print("\n📋 Available Medical Templates:")
for name, config in MEDICAL_TEMPLATES.items():
print(f" {name:20s} - {config['description']}")
elif cmd.lower().startswith('template '):
template_name = cmd.split(' ', 1)[1].strip()
if template_name in MEDICAL_TEMPLATES:
current_template = template_name
print(f"✅ Template set to: {template_name}")
else:
print(f"❌ Unknown template: {template_name}")
print(" Use 'list' to see available templates")
elif cmd.lower().startswith('library '):
lib_name = cmd.split(' ', 1)[1].strip()
if lib_name in ['plotly', 'matplotlib', 'seaborn', 'altair']:
current_library = lib_name
print(f"✅ Library set to: {lib_name}")
else:
print(f"❌ Unsupported library: {lib_name}")
print(" Supported: plotly, matplotlib, seaborn, altair")
elif cmd.lower().startswith('viz '):
prompt = cmd.split(' ', 1)[1].strip()
self.visualize(
data_path=data_path,
prompt=prompt,
template=current_template,
library=current_library,
n_candidates=1
)
else:
# Assume it's a visualization prompt
self.visualize(
data_path=data_path,
prompt=cmd,
template=current_template,
library=current_library,
n_candidates=1
)
except KeyboardInterrupt:
print("\n\n👋 Goodbye!")
break
except Exception as e:
print(f"❌ Error: {e}")
def main():
"""CLI entry point."""
parser = argparse.ArgumentParser(
description="LIDA Quick Visualization - AI-Driven Prototyping (⚠️ PROTOTYPING ONLY)",
formatter_class=argparse.RawDescriptionHelpFormatter,
epilog="""
Examples:
# Basic usage
%(prog)s "Show mortality by treatment" trial_data.csv
# Multiple candidates
%(prog)s "Compare outcomes" data.csv --candidates 3
# Use medical template
%(prog)s "Trial results" data.csv --template trial_comparison
# Specify library
%(prog)s "Line chart of trends" data.csv --library matplotlib
# Interactive mode
%(prog)s --interactive data.csv
Medical Templates:
trial_comparison - Compare treatment arms
patient_demographics - Baseline characteristics
outcome_comparison - Primary/secondary endpoints
trend_analysis - Trends over time
survival_curve - Time-to-event (simplified)
⚠️ LIMITATIONS:
- Works best with ≤10 columns
- Quality varies - ALWAYS review outputs
- NOT for publication without expert review
- Use plotly_charts.py for production
"""
)
parser.add_argument("prompt", nargs="?", help="Natural language visualization description")
parser.add_argument("data", nargs="?", help="Path to CSV or JSON data file")
parser.add_argument("-t", "--template",
choices=list(MEDICAL_TEMPLATES.keys()),
help="Medical template to use")
parser.add_argument("-l", "--library",
default="plotly",
choices=["plotly", "matplotlib", "seaborn", "altair"],
help="Visualization library (default: plotly)")
parser.add_argument("-n", "--candidates",
type=int,
default=1,
help="Number of visualization candidates (default: 1)")
parser.add_argument("-o", "--output",
default="lida_output",
help="Output directory (default: lida_output)")
parser.add_argument("-m", "--model",
default="openai",
choices=["openai", "gemini", "anthropic"],
help="LLM model to use (default: openai)")
parser.add_argument("--api-key",
help="API key (if not in environment)")
parser.add_argument("-i", "--interactive",
action="store_true",
help="Interactive mode")
parser.add_argument("--list-templates",
action="store_true",
help="List available medical templates")
args = parser.parse_args()
# List templates
if args.list_templates:
print("\n📋 Medical Templates:\n")
for name, config in MEDICAL_TEMPLATES.items():
print(f"{name}")
print(f" Description: {config['description']}")
print(f" Suggested columns: {', '.join(config['suggested_columns'])}")
print()
return
# Initialize LIDA
viz = LIDAQuickViz(model=args.model, api_key=args.api_key)
# Interactive mode
if args.interactive:
if not args.data:
print("❌ Error: Data file required for interactive mode")
print(" Usage: lida_quick_viz.py --interactive data.csv")
sys.exit(1)
viz.interactive_mode(args.data)
return
# Standard mode
if not args.prompt or not args.data:
parser.print_help()
print("\n❌ Error: Both prompt and data file are required")
print(" Usage: lida_quick_viz.py 'your prompt' data.csv")
sys.exit(1)
# Generate visualizations
results = viz.visualize(
data_path=args.data,
prompt=args.prompt,
template=args.template,
library=args.library,
n_candidates=args.candidates,
output_dir=args.output
)
# Print results summary
print("\n📊 Results Summary:")
for result in results:
print(f"\nCandidate {result['candidate']}:")
print(f" Goal: {result['goal']}")
print(f" Code: {result['code_file']}")
if result['chart_file']:
print(f" Chart: {result['chart_file']}")
if __name__ == "__main__":
main()
<!-- _class: lead --> <!-- _backgroundColor: #1e3a5f --> <!-- _color: white -->
Presentation Title
Subtitle or Topic
Your Name, MD Institution | Department
Date
---
Disclosures
<!-- Modify as needed -->
- No relevant financial relationships to disclose
- OR list your disclosures here
---
Learning Objectives
After this presentation, participants will be able to:
1. Objective one - describe key concept 2. Objective two - explain mechanism 3. Objective three - apply knowledge clinically
---
Outline
1. Background & Epidemiology 2. Pathophysiology 3. Diagnosis 4. Management 5. Case Discussion 6. Take-Home Points
---
Key Statistics
<div class="columns"> <div>
Prevalence
- 6.7 million Americans affected
- Rising with aging population
- 50% mortality at 5 years
</div> <div>
Cost
- $30.7 billion annually
- Leading cause of hospitalization
- Significant caregiver burden
</div> </div>
---
Pathophysiology
!bg right:40% fit
<!-- Replace with actual image path -->
- Neurohormonal activation
- Cardiac remodeling
- Fluid retention
- Progressive dysfunction
---
Diagnostic Algorithm
<!-- Use a flowchart here if available -->
Clinical Suspicion
↓
BNP/NT-proBNP
↓
Echocardiogram
↓
Classify HFrEF vs HFpEF
↓
Risk Stratification---
Treatment Overview
| Class | Examples | Key Evidence |
|---|---|---|
| ACEi/ARB/ARNI | Enalapril, Sacubitril/Valsartan | PARADIGM-HF |
| Beta-blockers | Carvedilol, Metoprolol | MERIT-HF |
| MRA | Spironolactone, Eplerenone | RALES, EMPHASIS |
| SGLT2i | Dapagliflozin, Empagliflozin | DAPA-HF, EMPEROR |
---
Landmark Trial Results
!bg right:50% fit
<!-- Replace with actual chart -->
PARADIGM-HF
- 20% reduction in mortality
- NNT = 21 over 27 months
- Changed standard of care
---
Clinical Pearl
<div class="highlight">
Start low, go slow, but GO!
Uptitration of GDMT to target doses is associated with improved outcomes, but many patients remain on suboptimal doses.
</div>
---
Case Presentation
68-year-old male
- Chief complaint: Progressive dyspnea
- PMH: HTN, T2DM, prior MI
- Exam: JVD, S3, peripheral edema
- Labs: BNP 1,200 pg/mL
- Echo: LVEF 30%, moderate MR
What is your approach?
---
Case Discussion
<div class="columns"> <div>
Initial Management
- IV diuretics
- Optimize volume status
- Start GDMT
</div> <div>
Long-term Plan
- Titrate medications
- Cardiac rehabilitation
- Device evaluation
- Follow-up in 2 weeks
</div> </div>
---
Take-Home Points
1. ✅ Early diagnosis improves outcomes 2. ✅ Quadruple therapy is now standard 3. ✅ Titrate to target doses when tolerated 4. ✅ Consider devices in appropriate patients 5. ✅ Multidisciplinary care reduces readmissions
---
Questions?
<br>
Contact Information your.email@institution.edu
<br>
Slides Available [Link to slides or QR code]
---
References
1. Author et al. Journal. Year;Volume:Pages. 2. Author et al. Journal. Year;Volume:Pages. 3. Author et al. Journal. Year;Volume:Pages.
<br>
Full reference list available upon request
---
<!-- _class: lead --> <!-- _backgroundColor: #1e3a5f --> <!-- _color: white -->
Thank You
Questions and Discussion
age_group,count,percentage,gender
<50,150,15.0,Male
50-60,280,28.0,Male
60-70,320,32.0,Male
>70,250,25.0,Male
<50,120,12.0,Female
50-60,240,24.0,Female
60-70,290,29.0,Female
>70,350,35.0,Female
treatment_group,primary_endpoint_rate,ci_lower,ci_upper,sample_size,p_value
Drug A,12.3,10.5,14.1,1500,0.002
Drug B,15.1,13.2,17.0,1450,0.045
Placebo,18.7,16.5,20.9,1475,NA