vizzu_animations
# Vizzu Animated Data Visualizations
What this skill does
# Vizzu Animated Data Visualizations
**Purpose:** Animated data visualizations for medical content using Vizzu-lib. Perfect for trial results, survival curves, and medical dashboards.
**Status:** ✅ Complete - Ready for use
**Priority:** P1 - Fills critical gap: animated data visualizations
---
## Quick Start
```python
from vizzu_animations.templates import (
create_animated_kaplan_meier,
create_animated_forest_plot,
create_animated_bar_comparison,
)
# Kaplan-Meier survival curves
treatment = [(0, 100), (6, 94), (12, 88), (18, 83), (24, 78)]
control = [(0, 100), (6, 91), (12, 83), (18, 76), (24, 69)]
create_animated_kaplan_meier(
treatment, control,
treatment_name="Dapagliflozin",
control_name="Placebo",
hr_text="HR 0.74 (95% CI 0.65-0.85)",
output="kaplan_meier.html"
)
```
---
## Why Vizzu?
| Feature | Benefit |
|---------|---------|
| **Seamless transitions** | Smooth chart morphing (perfect for trial results over time) |
| **Dependency-free JS** | No heavy frameworks, just HTML5 canvas |
| **Python bindings** | ipyvizzu for Jupyter, or direct HTML generation |
| **Apache 2.0 license** | Permissive, commercial-friendly |
| **Design token integration** | Uses visual-design-system colors automatically |
**Fills gap:** Manim does educational animations, Vizzu does data animations.
---
## Medical Use Cases
### 1. Animated Kaplan-Meier Curves
Show survival divergence unfolding over time.
```python
from vizzu_animations.templates import create_animated_kaplan_meier
treatment = [(0, 100), (6, 94), (12, 88), (18, 83), (24, 78)]
control = [(0, 100), (6, 91), (12, 83), (18, 76), (24, 69)]
create_animated_kaplan_meier(
treatment, control,
title="DAPA-HF: Event-Free Survival",
hr_text="HR 0.74 (95% CI 0.65-0.85)",
)
```
**Use for:** Trial results, survival analysis, event-free survival
### 2. Animated Forest Plots
Studies accumulating in meta-analysis.
```python
from vizzu_animations.templates import create_animated_forest_plot
studies = [
{"name": "DAPA-HF", "estimate": 0.74, "lower": 0.65, "upper": 0.85, "weight": 60},
{"name": "EMPEROR-Reduced", "estimate": 0.75, "lower": 0.65, "upper": 0.86, "weight": 50},
{"name": "SOLOIST-WHF", "estimate": 0.67, "lower": 0.52, "upper": 0.85, "weight": 30},
]
create_animated_forest_plot(
studies,
title="SGLT2 Inhibitors in Heart Failure",
show_pooled=True,
)
```
**Use for:** Meta-analyses, systematic reviews, pooled estimates
### 3. Animated Bar Comparisons
Before/after or treatment vs control.
```python
from vizzu_animations.templates import create_animated_bar_comparison
create_animated_bar_comparison(
categories=["Primary Endpoint", "CV Death", "HF Hospitalization"],
group1_values=[16.3, 11.6, 10.0],
group2_values=[21.2, 14.5, 15.6],
group1_name="Dapagliflozin",
group2_name="Placebo",
title="DAPA-HF Trial Results",
)
```
**Use for:** Treatment comparisons, before/after outcomes, subgroup analyses
### 4. Animated Trend Lines
Outcomes progressing over time.
```python
from vizzu_animations.templates import create_animated_trend_line
data = {
"2010-2015": [(2010, 28.5), (2012, 26.2), (2015, 23.8)],
"2015-2020": [(2015, 23.8), (2017, 21.5), (2020, 19.2)],
}
create_animated_trend_line(
data,
title="Heart Failure Mortality Trends",
x_label="Year",
y_label="Mortality Rate (per 100,000)",
)
```
**Use for:** Epidemiological trends, longitudinal outcomes, temporal patterns
### 5. Animated Trial Enrollment
Patient recruitment dashboard.
```python
from vizzu_animations.templates import create_animated_trial_enrollment
enrollment = [
("Month 1", 142),
("Month 3", 456),
("Month 6", 1024),
("Month 12", 3456),
("Month 18", 4744),
]
create_animated_trial_enrollment(
enrollment,
target=4744,
title="DAPA-HF Enrollment Progress",
)
```
**Use for:** Trial dashboards, recruitment tracking, site performance
---
## CLI Usage
```bash
cd skills/cardiology/visual-design-system/vizzu_animations
# List available templates
python vizzu_cli.py list
# Generate all demos
python vizzu_cli.py demo --template all
# Generate specific demo
python vizzu_cli.py demo --template kaplan-meier --output km.html
# Create from custom data
python vizzu_cli.py create \
--template bar \
--data trial_results.csv \
--x Treatment \
--y EventRate \
--title "Trial Results"
# Export HTML to video
python vizzu_cli.py export animation.html --format mp4
python vizzu_cli.py export animation.html --format gif --fps 15
python vizzu_cli.py export animation.html --format webm
```
---
## Python API
### Using Templates (Recommended)
```python
from vizzu_animations.templates import (
create_animated_kaplan_meier,
create_animated_forest_plot,
create_animated_bar_comparison,
create_animated_trend_line,
create_animated_trial_enrollment,
)
# Each template returns Path to HTML file
output_path = create_animated_kaplan_meier(...)
print(f"Animation saved to: {output_path}")
```
### Using Low-Level API
```python
from vizzu_animations import VizzuAnimator
import pandas as pd
animator = VizzuAnimator()
# Prepare data
df = pd.DataFrame({
'Study': ['DAPA-HF', 'EMPEROR-Reduced', 'DELIVER'],
'HR': [0.74, 0.75, 0.82],
'Treatment': ['Dapagliflozin', 'Empagliflozin', 'Dapagliflozin']
})
# Create animated bar chart
animator.create_animated_bar(
df,
x_col='Study',
y_col='HR',
color_col='Treatment',
title='SGLT2i Heart Failure Trials',
output='trials.html',
duration=3000, # 3 seconds
)
```
### Available Methods
| Method | Description |
|--------|-------------|
| `create_animated_bar()` | Animated bar chart |
| `create_animated_line()` | Animated line chart |
| `create_animated_scatter()` | Animated scatter plot |
| `create_animated_area()` | Animated area chart |
---
## Export to Video
### MP4 (Best for YouTube, presentations)
```python
from vizzu_animations.export_utils import export_to_mp4
export_to_mp4(
'animation.html',
'animation.mp4',
duration=5000, # 5 seconds
fps=30,
width=1920,
height=1080,
)
```
### GIF (Best for Twitter, social media)
```python
from vizzu_animations.export_utils import export_to_gif
export_to_gif(
'animation.html',
'animation.gif',
duration=5000,
fps=15, # Lower FPS for smaller file
width=800,
height=600,
optimize=True,
)
```
### WebM (Best for web embedding)
```python
from vizzu_animations.export_utils import export_to_webm
export_to_webm(
'animation.html',
'animation.webm',
duration=5000,
fps=30,
)
```
**Requirements:**
- Playwright: `pip install playwright && playwright install chromium`
- ffmpeg: `apt-get install ffmpeg` or `brew install ffmpeg`
- Optional: `gifsicle` for GIF optimization
---
## Integration with Visual Router
Vizzu is automatically routed when you request animated data visualizations:
**Keywords that route to Vizzu:**
- "animated data"
- "animated chart"
- "animated forest plot"
- "animated survival curve"
- "animated enrollment"
- "chart transition"
- "morphing chart"
**Example:**
```
User: "Create an animated Kaplan-Meier curve showing treatment vs control"
→ Routes to: vizzu_animations/templates/kaplan_meier.py
```
---
## Design Token Integration
Vizzu automatically uses colors from the visual-design-system:
| Token | Color | Usage |
|-------|-------|-------|
| `primary` | #2d6a9f | Main data series |
| `secondary` | #48a9a6 | Secondary series |
| `success` | #2e7d32 | Positive outcomes |
| `danger` | #c62828 | Adverse events |
| `treatment` | #0077bb | Treatment arm |
| `control` | #ee7733 | Control arm |
All visualizations are:
- ✅ Colorblind-safe (Paul Tol palette)
- ✅ WCAG AA compliant (4.5:1 contrast minimum)
- ✅ Publication-grade (Helvetica, proper spacing)
---
## Directory Structure
```
vizzu_animations/
├── SKILL.md # This file
├── __init__.py # Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.