Data viz 2025

From curiositech/windags-skills · View interactive version

Data viz 2025 is an AI agent skill from the GitHub repository curiositech/windags-skills. State-of-the-art data visualization for React/Next.js/TypeScript with Tailwind CSS. Creates compelling, tested, and accessible visualizations following Tufte principles and NYT Graphics standards. Activate on "data viz", "chart", "graph", "visualization", "dashboard", "plot", "Recharts", "Nivo", "D3

How to use this skill

Skill file

Data Visualization 2025: The Art & Science of Visual Communication

Create visualizations that marry NYT Graphics rigor with modern web performance and accessibility standards.

DECISION POINTS

Primary Library Selection Tree

What type of chart are you building?
├─ Exploratory analysis / rapid prototyping
│  ├─ Data size < 5K points → Observable Plot
│  └─ Data size > 5K points → D3.js with sampling
│
├─ Standard business charts (bars, lines, areas)
│  ├─ Need it fast & simple → Recharts
│  ├─ Premium aesthetics required → Nivo
│  └─ Custom interactions needed → Visx
│
├─ Complex/novel visualizations
│  ├─ React component structure preferred → Visx
│  └─ Maximum control needed → D3.js
│
└─ Dashboard with many charts
   ├─ Tailwind design system → Tremor
   └─ Consistent theming → Nivo

Performance Optimization Branch

How many data points?
├─ < 1K points
│  ├─ Need crisp scaling → SVG rendering
│  └─ Need interactivity → SVG with event handlers
│
├─ 1K - 10K points
│  ├─ Simple shapes → SVG (acceptable)
│  ├─ Complex animations → Canvas
│  └─ Mobile performance critical → Canvas
│
└─ > 10K points
   ├─ Static display → Canvas with aggregation
   ├─ Interactive exploration → WebGL (via deck.gl)
   └─ Real-time updates → Canvas with data sampling

Accessibility Decision Matrix

Is this for production use?
├─ Yes → Must implement ALL accessibility features
│  ├─ Keyboard navigation for all interactive elements
│  ├─ Screen reader support with data tables
│  ├─ Color-blind safe palettes (test with simulators)
│  └─ Respect prefers-reduced-motion
│
└─ Internal tool/prototype → Implement core features
   ├─ Alt text for chart images
   ├─ Sufficient color contrast (4.5:1 minimum)
   └─ Keyboard access for primary interactions

Mobile Responsiveness Strategy

What's the screen breakpoint?
├─ Mobile (< 640px)
│  ├─ Many data points → Aggregate to top 5-7 items
│  ├─ Time series → Show last 30 days, add "View All" button
│  ├─ Multi-series → Use small multiples instead of overlays
│  └─ Complex legends → Replace with direct labels
│
├─ Tablet (640px - 1024px)
│  ├─ Reduce axis labels by 50%
│  ├─ Simplify gridlines (remove minor ticks)
│  └─ Increase touch targets to 44px minimum
│
└─ Desktop (> 1024px)
   └─ Show full detail, all interactions enabled

FAILURE MODES

1. "Rainbow Vomit" (Visual Overload)

Symptom: Chart has 8+ colors, tiny legend, impossible to distinguish series

Diagnosis: Trying to show too many categories simultaneously

Fix:

2. "Misleading Scale" (Graphical Dishonesty)

Symptom: Bar chart with Y-axis starting at 95 instead of 0, making 2% difference look like 200%

Diagnosis: Truncated axes exaggerating small differences

Fix:

3. "Mobile Pancake" (Responsiveness Failure)

Symptom: Desktop chart squished to mobile width, text unreadable, interactions broken

Diagnosis: No responsive design strategy, one-size-fits-all approach

Fix:

4. "Loading Desert" (Poor Loading States)

Symptom: White screen for 3+ seconds, then chart appears suddenly

Diagnosis: No skeleton loading, blocking data fetch

Fix:

5. "Accessibility Afterthought" (Exclusion by Design)

Symptom: Screen reader announces "image" with no context, keyboard navigation broken

Diagnosis: Visual-only design, no programmatic access to data

Fix:

WORKED EXAMPLES

Example 1: Multi-Series Mobile Chart

Scenario: Executive dashboard showing revenue by 8 product lines over 12 months, needs to work on mobile.

Decision Process:

  1. Data Analysis: 8 series × 12 months = 96 data points, acceptable for SVG
  2. Mobile Strategy: 8 series too many for mobile width
  3. Library Choice: Recharts for quick implementation, good mobile support

Desktop Implementation:

<LineChart data={monthlyData} width="100%" height={400}>
  <XAxis dataKey="month" />
  <YAxis />
  <Tooltip />
  <Legend />
  {products.map((product, index) => (
    <Line 
      key={product} 
      dataKey={product} 
      stroke={colors[index]}
      strokeWidth={2}
    />
  ))}
</LineChart>

Mobile Adaptation:

const isMobile = useMediaQuery('(max-width: 640px)');
const topProducts = isMobile 
  ? products.slice(0, 3) // Show only top 3
  : products;

<ResponsiveContainer height={isMobile ? 250 : 400}>
  <LineChart data={monthlyData}>
    <XAxis 
      dataKey="month" 
      interval={isMobile ? 2 : 0} // Every 3rd month on mobile
      tick={{ fontSize: isMobile ? 10 : 12 }}
    />
    <YAxis tick={isMobile ? false : true} />
    <Tooltip />
    {!isMobile && <Legend />}
    {topProducts.map((product, index) => (
      <Line 
        key={product} 
        dataKey={product} 
        stroke={colors[index]}
        strokeWidth={isMobile ? 3 : 2} // Thicker lines for mobile
      />
    ))}
  </LineChart>
</ResponsiveContainer>

Key Decisions Made:

Example 2: Performance-Critical Sankey Diagram

Scenario: User journey flow with 50K user sessions, 12 touchpoints, needs real-time updates.

Decision Process:

  1. Data Size: 50K sessions × 12 steps = 600K transitions, too much for SVG
  2. Performance Requirement: Real-time updates every 30 seconds
  3. Library Choice: D3.js with Canvas rendering for performance

Implementation Strategy:

// Data aggregation first - group similar paths
const aggregatedFlows = useMemo(() => {
  return rawUserJourney
    .reduce((acc, session) => {
      const pathKey = session.path.join('→');
      acc[pathKey] = (acc[pathKey] || 0) + session.count;
      return acc;
    }, {})
    // Keep only paths with 100+ users
    .filter(([path, count]) => count >= 100);
}, [rawUserJourney]);

// Canvas rendering for performance
useEffect(() => {
  const canvas = canvasRef.current;
  const ctx = canvas.getContext('2d');
  
  // Clear and render
  ctx.clearRect(0, 0, width, height);
  
  // Use Web Workers for heavy calculations
  const worker = new Worker('/sankeyWorker.js');
  worker.postMessage({ flows: aggregatedFlows, dimensions: { width, height } });
  
  worker.onmessage = (e) => {
    const { nodes, links } = e.data;
    drawSankey(ctx, nodes, links);
  };
}, [aggregatedFlows]);

Performance Optimizations Applied:

QUALITY GATES

Before shipping any data visualization, verify ALL conditions:

NOT-FOR BOUNDARIES

This skill should NOT be used for:

When to delegate to other skills:

Library-specific boundaries:

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.