Data storytelling
<essential_principles>
These principles transform data from noise into narrative. Apply them in order.
Before touching any tool, answer three questions:
WHO is your audience?
WHAT do you want them to do?
HOW will you communicate?
<context_checklist> Before creating any visualization:
The right chart for the job:
| Data Relationship | Best Chart Type | Avoid |
|---|---|---|
| Comparison (few categories) | Horizontal bar | Pie, 3D |
| Comparison (many categories) | Horizontal bar, sorted | Vertical bar |
| Time series | Line chart | Area (unless stacked) |
| Part-to-whole | 100% stacked bar, treemap | Pie (>3 slices) |
| Correlation | Scatterplot | Dual-axis line |
| Distribution | Histogram, box plot | Bar chart |
Default choices:
<chart_selection_rules> ALWAYS avoid:
PREFER:
Clutter is your enemy. Every element should earn its place.
Remove ruthlessly:
The Declutter Checklist:
For each element ask: "Would removing this change the meaning?"
If NO → Remove it
If YES → Keep it (but consider if it can be lighter/smaller)
<clutter_identification> Visual clutter includes:
Use preattentive attributes strategically.
Preattentive attributes (processed in <500ms):
<attention_strategy> The hierarchy of emphasis:
COLOR RULES:
Affordances: Make it obvious how to read your visual
Accessibility:
Alignment:
<design_checklist>
Structure your narrative:
Beginning: Set up the context
Middle: Build the tension
End: Resolve with action
<story_framework> The "So What?" test: After every insight, ask "So what?" until you reach the action.
Example:
Share your visualization, data, or context and I'll apply the SWD framework. </intake>
<review_process>
When reviewing any visualization, evaluate in this order:
1. Context Check
2. Chart Type Audit
3. Clutter Scan
4. Attention Assessment
5. Story Structure
| Category | Weight | Criteria |
|---|---|---|
| Context | 15 | Clear audience, action, mechanism |
| Chart Choice | 20 | Appropriate type, no forbidden charts |
| Clutter | 25 | Minimal non-data ink |
| Focus | 25 | Strategic use of preattentive attributes |
| Story | 15 | Insight title, clear narrative |
<quick_fixes>
| Problem | SWD Fix |
|---|---|
| "I don't know what to look at" | Add ONE accent color, gray everything else |
| "It's too busy" | Remove gridlines, borders, legend → direct labels |
| "The title is generic" | Change "Sales Data" to "Sales grew 15% in Q3" |
| "Too many categories" | Group into "Top 5 + Other" or use horizontal bars |
| "Pie chart with 8 slices" | Convert to horizontal bar, sorted by value |
| "Can't read axis labels" | Rotate chart (vertical → horizontal bars) |
| "Dual y-axes" | Split into two charts or use indexed values |
| "3D chart" | Flatten immediately |
| </quick_fixes> |
<code_patterns>
// Minimal, clean styling
const swd = {
colors: {
emphasis: '#2563eb', // Blue for focus
neutral: '#6b7280', // Gray for context
background: '#ffffff',
light: '#e5e7eb' // Very light gray for subtle gridlines
},
axis: {
tickSize: 0, // No tick marks
strokeWidth: 0 // No axis lines
},
grid: {
stroke: '#f3f4f6', // Nearly invisible
strokeDasharray: '2,2' // Dotted if needed
}
};
// Direct labels over legends
bars.append('text')
.attr('x', d => x(d.value) + 5)
.attr('y', d => y(d.category) + y.bandwidth() / 2)
.attr('dy', '0.35em')
.text(d => d.value);
/* De-emphasis (most elements) */
.swd-muted { @apply text-gray-400; }
/* Normal context */
.swd-neutral { @apply text-gray-600; }
/* Emphasis (ONE thing) */
.swd-emphasis { @apply text-blue-600 font-semibold; }
/* Remove chart chrome */
.swd-clean-chart {
@apply border-0 bg-transparent;
}
</code_patterns>
<success_criteria> A visualization passes the SWD test when: