skills/data-visualization/SKILL.md
Data visualization and information design best practices. Use when creating charts, dashboards, graphs, or any visual representation of data.
npx skillsauth add igbuend/grimbard data-visualizationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Principles and best practices for effective data visualization.
Data-Ink Ratio: Maximize ink used for actual data
Lie Factor: Graphical representation must match data
Chart Junk: Remove non-data ink and redundant data-ink
| Practice | Rule | |----------|------| | Bar charts | Must start at zero | | Proportions | Size encodements reflect actual ratios | | 3D effects | Never use—distorts perception | | Pie charts | Maximum 3-4 slices |
| Principle | Application | |-----------|-------------| | Proximity | Cluster related data; space different categories | | Similarity | Consistent color/shape for categories | | Continuity | Connected line charts for trends | | Closure | Complete shapes, avoid unnecessary borders | | Figure/Ground | Data stands out against background | | Connection | Lines/links show relationships |
Processed in <200ms before conscious attention:
Hierarchy: Position > Color > Size > Shape > Orientation
| Attribute | Use Case | |-----------|----------| | Position (spatial) | Ranking, trends | | Color (hue) | Categorical distinction | | Size | Quantitative comparison | | Shape | Category distinction | | Intensity | Highlighting differences |
Sequential: Ordered data (low → high), single hue light to dark
Diverging: Data with meaningful midpoint, two hues meeting at neutral
Categorical: Nominal data, distinct equally-spaced hues (max 6-8)
~8% of men and 0.5% of women have color vision deficiency. Design for them by default.
Okabe-Ito Palette (recommended default):
#000000, Orange #E69F00, Sky Blue #56B4E9#009E73, Yellow #F0E442, Blue #0072B2#D55E00, Reddish Purple #CC79A7Other tested palettes: Viridis, Cividis, Paul Tol, ColorBrewer (colorblind filter)
| Type | Prevalence | Confusion | |------|-----------|-----------| | Deuteranomaly | 5% of men | Red-green (most common) | | Protanopia | 1% of men | Red-green | | Deuteranopia | 1.3% of men | Red-green | | Tritanopia | 0.0001% | Blue-yellow (rare) | | Achromatopsia | 0.003% | No color (greyscale) |
| Color | Western | China | Other | |-------|---------|-------|-------| | Red | Danger | Good luck | Death (some African) | | White | Purity | Death | | | Green | Environment | Infidelity | |
Never use color alone to encode data. Always combine with at least one other channel:
| Element | AA (minimum) | AAA (enhanced) | |---------|-------------|----------------| | Body text | 4.5:1 | 7:1 | | Large text (18pt+) | 3:1 | 4.5:1 | | Non-text (lines, bars, icons) | 3:1 | — | | Focus indicators | 3:1 | 3:1 + 2px space |
~253 million people globally have visual impairment.
Typography in charts:
Layout:
Dark mode:
Alt text for charts (follow the four-level model by Lundgard & Satyanarayan, 2021):
SVG accessibility:
<svg role="img" aria-labelledby="title desc">
<title id="title">2024 Sales by Region</title>
<desc id="desc">Bar chart. North America leads with 45% of revenue.</desc>
</svg>
Always provide: data table alternative or detailed description for complex charts.
Beyond visual, consider:
| Jurisdiction | Law/Standard | Requirement | |-------------|-------------|-------------| | US | Section 508, ADA | WCAG 2.0/2.1 AA (federal); courts use WCAG for ADA | | EU | European Accessibility Act (2025), EN 301 549 | WCAG 2.1 AA for public + private sectors | | UK | Equality Act 2010, PSBAR 2018 | WCAG 2.1 AA for public sector | | Japan | JIS X 8341-3:2016 | Aligned with WCAG, AA recommended | | Australia | Disability Discrimination Act 1992 | WCAG 2.1 AA benchmark | | Canada | Accessible Canada Act, AODA (Ontario) | WCAG 2.0 AA minimum, moving to 2.1 | | Singapore | Digital Service Standards | WCAG 2.1 AA for government | | China | GB/T 37668-2019 | Aligned with WCAG 2.0 | | South Korea | KWCAG 2.1 | Aligned with WCAG 2.1 |
Data type:
├─ Categorical comparison → Bar chart
├─ Part-to-whole → Treemap/stacked bar (avoid pie >4 slices)
├─ Time series → Line chart
├─ Distribution → Histogram, box plot, violin
├─ Correlation → Scatter plot
├─ Geographic → Choropleth, proportional symbol
└─ Network/flow → Network graph, Sankey
4 pie chart slices
| Use Case | Tool | |----------|------| | Custom web viz | D3.js, Plotly, Olli (accessible) | | BI dashboards | Tableau, Power BI, Apache ECharts | | Static reports | Matplotlib, Seaborn, ggplot2 | | Rapid prototyping | Flourish, Google Data Studio | | AI/ML integration | Python (Matplotlib, Plotly, Altair) |
| Purpose | Tool | |---------|------| | Color blind simulation | Coblis, ColorOracle, Chrome "Let Me Color" | | Contrast checking | WebAIM Contrast Checker, axe DevTools | | Screen reader testing | NVDA (free), JAWS, VoiceOver | | Accessibility audit | WAVE, Lighthouse, Accessibility Insights | | Accessible charts | Olli (MIT), Highcharts Sonification | | Color palette design | ColorBrewer, Paul Tol, Accessible Colors |
development
Security anti-pattern for Cross-Site Scripting vulnerabilities (CWE-79). Use when generating or reviewing code that renders HTML, handles user input in web pages, uses innerHTML/document.write, or builds dynamic web content. Covers Reflected, Stored, and DOM-based XSS. AI code has 86% XSS failure rate.
development
Security anti-pattern for XPath injection vulnerabilities (CWE-643). Use when generating or reviewing code that queries XML documents, constructs XPath expressions, or handles user input in XML operations. Detects unescaped quotes and special characters in XPath queries.
development
Security anti-pattern for weak password hashing (CWE-327, CWE-759). Use when generating or reviewing code that stores or verifies user passwords. Detects use of MD5, SHA1, SHA256 without salt, or missing password hashing entirely. Recommends bcrypt, Argon2, or scrypt.
development
Security anti-pattern for weak encryption (CWE-326, CWE-327). Use when generating or reviewing code that encrypts data, handles encryption keys, or uses cryptographic modes. Detects DES, ECB mode, static IVs, and custom crypto implementations.