agentleFS
kensauruskensaurus/cursor-kenji/skills/data-visualization/SKILL.md

data-visualization

Skill9 starsChanged 42 days agoMITView on GitHub

Build interactive, accessible charts and dashboards with Recharts, D3, or Victory. Use when "chart", "graph", "data visualization", "analytics dashboard", "metrics display", "time-series", "D3", or "Recharts".

48 other projects use a version of this, 1 of them edited.

Adopted by

Most recently taken up by

Used with

Projects with it also use case-study-writing, loading-states and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • CAPP-FinancialsSkill

    case-study-writing

    Client case study with challenge-approach-solution-impact structure and quantified outcomes

    Also in 3 projects that use this

  • soilmassSkill

    loading-states

    Animation patterns for loading, progress, and waiting states. Use for skeleton screens, progress indicators, optimistic UI, and content placeholder transitions. Keeps users informed and engaged during async operations.

    Also in 3 projects that use this

  • nddqSkill

    dashboard-design

    Also in 4 projects that use this

  • launchapp-devSkill

    interview-script

    Create a structured user interview script with warm-up, core exploration, and wrap-up sections. Use when preparing for user research interviews to ensure consistent, insightful conversations.

    Also in 3 projects that use this

  • nandanosqlSkill

    swot-analysis

    Conduct a structured SWOT analysis — Strengths, Weaknesses, Opportunities, Threats — that connects internal capabilities to external forces for strategic decision-making.

    Also in 3 projects that use this

  • abinauvSkill

    change-management

    Comprehensive change management consulting toolkit — stakeholder mapping, ADKAR framework, Kotter's 8-Step Model, communication planning, resistance analysis, cultural assessment, readiness assessment, training needs analysis, impact assessment, and transition planning.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 41 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Create beautiful, accessible, and interactive data visualizations for dashboards and reports.

    line 36
  2. Distinctive:

    Why: Use existing chart library and styling conventions.

    line 62
  3. Very specific:

    Place it in a w-20 slot beside the stat value, never as its own card.

    line 96

“Common” is measured: kept by at least 6 in 10 of the 41 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Data Visualization Skill

Degree of freedom: MIXED. Chart type and encoding [HIGH freedom]; existing-library/token probes and a11y fallback [LOW freedom — run exactly].

How to reason

  1. Observe — existing chart library, tokens, data shape
  2. Interpret — reuse a component vs new chart type
  3. Classify — line / bar / area / donut / sparkline / table-fallback
  4. Severity — inaccessible or empty-state-less chart outranks a missing gradient

Worked example

Observe: package.json has recharts; no src/components/charts; tokens define --primary. Interpret: reuse Recharts + tokens, not D3. Classify: ResponsiveContainer line chart + sr-only table; skeleton while loading. Verify: resizes; screen-reader table present; no second chart library.

Self-critique before reporting

  • Existing lib — grepped package.json; did not add a second chart library
  • Accessible — sr-only table or text alternative present
  • States — loading + empty handled
  • Right owner — event taxonomy → audit-analytics; empty/loading frames → audit-ui-states

Create beautiful, accessible, and interactive data visualizations for dashboards and reports.

Product-event coverage ("are we tracking the right events?") is audit-analytics, not this skill. Empty/loading chart frames are audit-ui-states.

Check existing first [LOW freedom — run exactly]

Before creating ANY visualization, verify:

  1. Check for existing chart libraries:
cat package.json | grep -i "recharts\|chart\|d3\|visx\|nivo\|tremor"
rg "LineChart|BarChart|PieChart" --type tsx -l | head -10
  1. Check for existing chart components:
ls -la src/components/charts/ src/components/dashboard/ 2>/dev/null
rg "ResponsiveContainer|Chart" --type tsx | head -10
  1. Check for design tokens:
cat tailwind.config.* | grep -A10 "chart\|colors"

Why: Use existing chart library and styling conventions.

Recharts (Recommended for React) [HIGH freedom]

  • Wrap every chart in ResponsiveContainer width="100%"; set a fixed height.
  • Style through tokens: hsl(var(--primary)), fill-muted-foreground, stroke-muted; no hard-coded hex.
  • Hide axis lines and tick lines (tickLine={false} axisLine={false}); format Y ticks ($, %).
  • Custom Tooltip content uses bg-background border rounded-lg so it matches the theme.
  • Chart types: line (trend over time), bar (radius={[4,4,0,0]}, highlight the latest Cell), area (gradient <defs> fill), donut (innerRadius/outerRadius + center Label for the total).
'use client'
import { LineChart, Line, XAxis, YAxis, Tooltip, ResponsiveContainer } from 'recharts'

export function RevenueChart({ data }: { data: { month: string; revenue: number }[] }) {
  return (
    <ResponsiveContainer width="100%" height={350}>
      <LineChart data={data}>
        <XAxis dataKey="month" tickLine={false} axisLine={false} className="text-xs fill-muted-foreground" />
        <YAxis tickLine={false} axisLine={false} tickFormatter={(v) => `$${v}`} />
        <Tooltip cursor={{ stroke: 'hsl(var(--muted))' }} />
        <Line type="monotone" dataKey="revenue" stroke="hsl(var(--primary))" strokeWidth={2} activeDot={{ r: 6 }} />
      </LineChart>
    </ResponsiveContainer>
  )
}

Full line chart with custom tooltip, bar, area-gradient and donut components: references/recharts.md §Line chart, §Bar chart, §Area chart, §Pie/Donut chart.

Sparklines (Mini Charts) [HIGH freedom]

  • A LineChart with one Line, dot={false}, strokeWidth={1.5}, no axes, height ~40.
  • Map a number[] to { index, value } inside the component so callers pass plain arrays.
  • Place it in a w-20 slot beside the stat value, never as its own card.

Sparkline component and stats-card usage: references/recharts.md §Sparklines.

Stat Cards with Trends [HIGH freedom]

  • rounded-xl border bg-card p-6; title in text-muted-foreground, value text-3xl font-semibold.
  • Trend arrow + Math.abs(change)%; green for up, red for down; pass the same color to the sparkline.
  • sparklineData is optional; render the sparkline only when present.

StatCard component: references/recharts.md §Stat cards with trends.

Real-time Data Updates [HIGH freedom]

  • Append in setData(prev => [...prev, point].slice(-N)); keep a bounded window (about 20 points).
  • isAnimationActive={false} and a fixed YAxis domain so the chart does not jump per tick.
  • Clear the interval or socket subscription in the effect cleanup.

RealtimeChart component: references/recharts.md §Real-time data updates.

D3.js for Custom Visualizations [HIGH freedom]

  • Reach for D3 only when Recharts cannot express the mark; never add it beside an existing chart library.
  • Render into a ref'd <svg> from useEffect; svg.selectAll('*').remove() before redrawing on data change.
  • scaleBand for categories, scaleLinear().nice() for values; size from clientWidth/clientHeight, with margins.
  • Animate with .transition().duration(750) from the baseline; color with the same hsl(var(--primary)) tokens.

Full D3 bar chart component: references/d3-and-accessibility.md §D3.js custom bar chart.

Accessibility [LOW freedom — run exactly]

  • Wrap the chart in <div role="img" aria-label="..."> that states what the chart shows and its range.
  • Mark the SVG chart aria-hidden="true"; provide the data as an sr-only <table> with a <caption>.
  • Color is never the only encoding: pair it with labels, markers, or a legend.
<div role="img" aria-label="Revenue chart showing monthly data from January to December">
  <ResponsiveContainer><LineChart data={data} aria-hidden="true">{/* ... */}</LineChart></ResponsiveContainer>
  <table className="sr-only">
    <caption>Monthly Revenue Data</caption>
    <thead><tr><th>Month</th><th>Revenue</th></tr></thead>
    <tbody>{data.map((d) => <tr key={d.month}><td>{d.month}</td><td>${d.revenue}</td></tr>)}</tbody>
  </table>
</div>

Full accessibility block: references/d3-and-accessibility.md §Accessibility.

Validation [LOW freedom — do not skip]

After creating visualizations:

  1. Responsive → Charts resize properly on all screens
  2. Accessible → Screen reader alternatives provided
  3. Performance → Large datasets use virtualization/sampling
  4. Loading states → Skeleton shown while data loads
  5. Empty states → Meaningful message when no data
  6. Color contrast → Meets WCAG guidelines
  7. Tooltips → Provide detailed data on hover

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.