askill
data-visualization

data-visualizationSafety 90Repository

Visualization is communication. Chart selection, encoding hierarchy, accessibility, rendering performance. Use established algorithms - these problems are solved.

1 stars
1.2k downloads
Updated 1/15/2026

Package Files

Loading files...
SKILL.md

Data Visualization

Visualization is communication. Every visual element must serve understanding.

Core Principle

Choose encodings by perceptual accuracy. Use established algorithms. Never rely on color alone.

Critical Rules

RuleEnforcement
Use established algorithmsCheck dagre, d3-force, ELK.js before custom
Perceptual accuracyPosition beats length beats angle beats area beats color
Never color alone8% of men are colorblind - use shape, pattern, labels
Match rendering to scaleSVG <1000, Canvas 1000-10000, WebGL >10000

Visual Encoding Hierarchy

Cleveland & McGill (1984) - ranked by perceptual accuracy:

  1. Position along common scale (most accurate)
  2. Position on non-aligned scales
  3. Length
  4. Angle/slope
  5. Area
  6. Volume
  7. Color saturation/hue (least accurate)

Implication: Bar charts (position) > pie charts (angle) > bubble charts (area)

Chart Selection

By Question Type

QuestionChartWhy
How do values compare?Bar chartPosition encoding most accurate
How has this changed over time?Line chartShows trends, handles many points
What's the distribution?Histogram, box plotShows spread, outliers, shape
What's the relationship?Scatter plotReveals correlation, clusters
What's the part-to-whole?Stacked bar, treemapShows composition
What are the connections?Network graph, SankeyShows relationships, flows
What's the hierarchy?Tree, treemapShows parent-child structure

By Data Volume

VolumeApproach
<20 pointsSimple charts, direct labeling
20-500Standard visualization
500-5000Consider aggregation
5000+Aggregation mandatory, or Canvas/WebGL

Design Anti-Patterns

Anti-PatternWhy WrongFix
Pie chart >5 slicesHard to compareUse bar chart
3D chartsDistorts perceptionUse 2D
Dual unrelated axesMisleading correlationSeparate charts
Non-zero baselineExaggerates differencesStart at zero
Rainbow colormapPerceptually unevenUse viridis
Color-only encodingExcludes colorblindAdd shape/pattern

Color

Palette Types

TypeUse CaseExamples
SequentialLow to high valuesBlues, viridis
DivergingDiverge from midpointRdBu, BrBG
CategoricalDistinct categoriesSet2, Tableau10

Colorblind Safety

  • Never rely on color alone - use shape, pattern, labels
  • Safe sequential: viridis, cividis, plasma
  • Test with: Coblis, Chrome DevTools color blindness simulator
  • 8% of men, 0.5% of women affected

Contrast Requirements

ElementRatio
Normal text4.5:1 (WCAG AA)
Large text3:1
UI components3:1

Rendering Technology

<1000 elements    → SVG
                    - DOM events work naturally
                    - Accessibility (ARIA) supported
                    - CSS styling

1000-10000        → Canvas
                    - Batch rendering
                    - Manual hit testing required
                    - requestAnimationFrame for animation

>10000            → WebGL
                    - GPU acceleration
                    - Sigma.js, deck.gl, regl

Layout Algorithms → Libraries

These problems are solved. Never implement from scratch.

ProblemAlgorithmLibrary
Layered/DAG graphsSugiyamadagre, ELK.js
Force-directed networksFruchterman-Reingoldd3-force
Tree layoutsReingold-Tilfordd3-hierarchy
TreemapsSquarifiedd3-hierarchy
Sankey diagramsd3-sankey
Large graphs (10k+)WebGL + spatialSigma.js, G6

Performance Patterns

PatternWhen
Web WorkersLayout computation (never block main thread)
Spatial indexingHit detection with quadtree
Level-of-detailSimplify distant/small elements
Viewport cullingOnly render visible
DebouncingExpensive interactions
AggregationToo many points to render

Implementation Anti-Patterns

Anti-PatternWhy WrongFix
Custom graph layoutReinventing solved problemUse dagre/ELK
5000 SVG nodesPoor performanceUse Canvas
Main thread layoutBlocks UIUse Web Worker
No spatial indexingSlow hit detectionUse quadtree
Rendering off-screenWasted computationViewport culling

Accessibility

Screen Reader Support

<svg role="img" aria-labelledby="chart-title chart-desc">
  <title id="chart-title">Monthly Sales 2024</title>
  <desc id="chart-desc">Bar chart showing sales increasing
    from $10M in January to $15M in December</desc>
</svg>

Keyboard Navigation

KeyAction
TabMove between interactive elements
Arrow keysTraverse data points
Enter/SpaceSelect
EscapeCancel/close

Alternative Representations

  • Data tables as fallback
  • Text summaries of key insights
  • Don't rely on color alone

Library Selection

Charts

LibraryBest For
D3.jsCustom, highly interactive
Observable PlotQuick exploration
RechartsReact integration
EChartsFeature-rich dashboards
Chart.jsSimple charts

Graphs

LibraryBest For
dagreLayered DAGs, flowcharts
d3-forceOrganic networks
Cytoscape.jsGraph analysis
Sigma.jsLarge graphs (10k+)

Integration

SkillRelationship
design-principlesApply to visualization code
ui-design-principlesChart styling and states
documentation-standardsDocument chart decisions

Quick Reference

Before implementing visualization:

  • What question am I answering? → Select chart type
  • What's my data volume? → Select rendering technology
  • Is there an established algorithm? → Use the library
  • Is it accessible? → Color, keyboard, screen reader
  • Does it follow perceptual best practices? → Encoding hierarchy

Resources

ResourceUse
data-to-viz.comChart selection decision tree
colorbrewer2.orgAccessible color palettes
D3 GalleryImplementation patterns

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

82/100Analyzed 4/5/2026

"This is a comprehensive data visualization technical reference skill covering perceptual accuracy principles, chart selection by question type, rendering technology choices (SVG/Canvas/WebGL), layout algorithms, accessibility (WCAG, colorblind safety), library selection, and anti-patterns. Highly actionable through decision tables and quick reference checklist. Well-structured with consistent formatting. Scores well on completeness, reusability, and safety. Minor deduction for lacking explicit 'when to use' section and step-by-step implementation. The 'testing' tag appears misplaced. Reference-style content that would benefit from a trigger/usage context section."

90
80
90
85
75

Metadata

Licenseunknown
Version1.0.0
Updated1/15/2026
Publisherjagreehal

Tags

testing