Data viz

From AltimateAI/altimate-code · View interactive version

Data viz is an AI agent skill from the GitHub repository AltimateAI/altimate-code. Build modern, interactive data visualizations and dashboards using code-based component libraries (shadcn/ui, Recharts, Tremor, Nivo, D3, Victory, visx). Use this skill whenever the user asks to visualize data, build dashboards, create analytics views, chart metrics, tell a data story, build a repor

How to use this skill

Skill file

AI-First Data Visualization

Philosophy

Build production-quality interactive data interfaces with modern component libraries — no vendor lock-in, embeddable anywhere. When no tool is specified, build code-first. When the user explicitly names a BI tool, use it — only suggest code-first if they ask for options or hit a technical blocker.

Technology Stack

Full API patterns & code: references/component-guide.md

Framework Priority

  1. React + Tailwind — Default when JSX/TSX supported
  2. HTML + CSS + Vanilla JS — Fallback (use D3 or Chart.js)
  3. Python (Plotly/Dash) — Python-only environments only

Library Selection

| Library | Best For |

|---------|----------|

| shadcn/ui charts | Default first choice — general dashboards, most chart types |

| Recharts | Line, bar, area, composed, radar — fine-grained control |

| Tremor | KPI cards, metric displays, full dashboard layouts |

| Nivo | Heatmaps, treemaps, choropleth, calendar, Sankey, funnel |

| visx | Bespoke custom viz — D3-level control with React |

| D3.js | Force-directed graphs, DAGs, maps — maximum flexibility |

| Victory | When animation quality matters most |

Supporting: Tailwind CSS · Radix UI · Framer Motion · Lucide React · date-fns · Papaparse · lodash

Building a Visualization

Step 1: Understand the Data Story

Before code, identify: What question does the data answer? Who is the audience (exec → KPIs only, analyst → drill-down, public → narrative)? What's the ONE key insight? Design around it.

Step 2: Choose Chart Type

| Data Relationship | Chart Type | Library |

|---|---|---|

| Trend over time | Line, Area | shadcn/Recharts |

| Category comparison | Bar (horizontal if many) | shadcn/Recharts |

| Part of whole | Donut, Treemap | shadcn/Nivo |

| Distribution | Histogram, Box, Violin | Nivo/visx |

| Correlation | Scatter, Bubble | Recharts/visx |

| Geographic | Choropleth, Dot map | Nivo/D3 |

| Hierarchical | Treemap, Sunburst | Nivo |

| Flow / Process | Sankey, Funnel | Nivo/D3 |

| Single KPI | Metric card, Gauge, Sparkline | Tremor/shadcn |

| Multi-metric overview | Dashboard grid of cards | Tremor + shadcn |

| Ranking | Horizontal bar, Bar list | Tremor |

| Column/model lineage | Force-directed DAG | D3 |

| Pipeline dependencies | Hierarchical tree, DAG | D3/Nivo |

| Multi-dimensional quality | Radar/Spider | Recharts |

| Activity density over time | Calendar heatmap | Nivo |

| Incremental change breakdown | Waterfall | Recharts (custom) |

Step 3: Build the Interface

Start from this layout — remove what the data doesn't need:

┌─────────────────────────────────────────┐
│ Header: Title + Description + Date Range│
├─────────────────────────────────────────┤
│ KPI Row: 3-5 metric cards + sparklines  │
├─────────────────────────────────────────┤
│ Primary Visualization (largest chart)   │
├──────────────────┬──────────────────────┤
│ Secondary Chart  │ Supporting Chart/Tbl │
├──────────────────┴──────────────────────┤
│ Detail Table (sortable, filterable)     │
└─────────────────────────────────────────┘

A single insight might just be one chart with a headline and annotation. Scale complexity to audience.

Step 4: Design Principles

Step 5: Interactivity & Annotations

Priority: Tooltips (every chart) → Filtering → Sorting → Drill-down → Cross-filtering → Export → Annotations

Annotations turn charts into stories. Mark: inflection points, threshold crossings (amber), external events (indigo/red), anomalies (red), achievements (green). Limit 3 per chart. Implementation: references/component-guide.md → Annotation Patterns.

Step 6: Tell the Story

Environment-Specific Guidance

| Environment | Approach |

|---|---|

| Claude Artifacts | React (JSX), single file, default export. Available: recharts, lodash, d3, lucide-react, shadcn via @/components/ui/*, Tailwind |

| Claude Code / Terminal | Vite + React + Tailwind. Add shadcn/ui + Recharts. Structure: src/components/charts/, src/components/cards/, src/data/ |

| Python / Jupyter | Plotly for charts, Plotly Dash for dashboards |

| Cursor / Bolt / other IDEs | Match existing framework. Prefer shadcn/ui if present |

Anti-Patterns

Pre-Delivery Checklist

Before marking a dashboard complete:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.