xiaohongshu
xiaohongshu
Creating effective data visualizations using charts, graphs, and visual representations to communicate insights clearly and accurately following Tufte and Few principles.
Full skill instructions
Current Level: Intermediate
Domain: Business Analytics / Data Science
Data visualization transforms data into visual representations that make insights clear and actionable. Effective data visualization follows principles of clarity, accuracy, and simplicity to help users understand complex data quickly.
| Principle | Description | Example |
|---|---|---|
| Show the data | Let data speak for itself | Don't hide behind decoration |
| Maximize data-ink ratio | Remove non-data ink | Eliminate chart junk |
| Integrate text and graphics | Labels near data | Direct labeling, not legends |
| Avoid distortion | Accurate representation | Start Y-axis at zero |
| Small multiples | Compare many charts | Side-by-side comparison |
| Principle | Description |
|---|---|
| Simplicity | Remove unnecessary elements |
| Clarity | Make message obvious |
| Accuracy | Represent data truthfully |
| Efficiency | Convey information quickly |
| Aesthetics | Pleasing but not distracting |
Data-Ink Ratio = Data-Ink / Total Ink
Goal: Maximize ratio (close to 1)
Bad: Lots of decoration, 3D effects, shadows Good: Clean, minimal, data-focused
| Chart Type | Best For | Data Type | Example |
|---|---|---|---|
| Line Chart | Trends over time | Continuous | Revenue over months |
| Bar Chart | Compare categories | Categorical | Sales by region |
| Column Chart | Compare categories (vertical) | Categorical | Sales by product |
| Pie Chart | Parts of whole (max 5) | Categorical | Market share |
| Donut Chart | Parts of whole (modern) | Categorical | Budget breakdown |
| Area Chart | Cumulative over time | Continuous | Total users over time |
| Scatter Plot | Correlation | Two continuous | Price vs. quantity |
| Bubble Chart | Three dimensions | Two continuous + size | Sales vs. profit vs. volume |
| Heatmap | Two dimensions | Categorical × Categorical | Sales by region × month |
| Treemap | Hierarchical parts | Hierarchical | Budget by department |
| Histogram | Distribution | Continuous | Order value distribution |
| Box Plot | Distribution + outliers | Continuous | Salary distribution |
| Violin Plot | Distribution shape | Continuous | Response time distribution |
| Radar Chart | Multi-variable comparison | Multiple | Skills assessment |
| Gauge Chart | Single metric vs. target | Single | Progress to goal |
| Funnel Chart | Process stages | Sequential | Conversion funnel |
| Sankey Diagram | Flow between stages | Sequential | User journey |
| Waterfall Chart | Cumulative changes | Sequential | Revenue breakdown |
| Sparkline | Mini trend | Time series | Stock price trend |
Use for: Time series, trends
Revenue ($)
$100k ┤
$80k ┤ ●───●───●───●───●
$60k ┤
$40k ┤
$20k ┤
$0 └────────────────────────────
Jan Feb Mar Apr May
Best practices:
Use for: Category comparison
Sales by Region
North America ████████████████████████████████████████ $50M
Europe ████████████████████████████ $35M
Asia ████████████████████ $25M
Other ████████████ $10M
0 10M 20M 30M 40M 50M
Best practices:
Use for: Parts of whole (max 5 slices)
Market Share
Product A ████████████████████████████████████████ 50%
Product B ████████████████████ 25%
Product C ████████████████████ 25%
Best practices:
Use for: Correlation between two variables
Quantity
100 ┤ ●
│ ● ●
50 ┤ ● ● ●
│ ● ● ●
0 └────────────────────
0 50 100 150
Price
Best practices:
Use for: Two-dimensional data
Sales by Region × Month
Jan Feb Mar Apr
US ■■■■■ ■■■■■ ■■■■■ ■■■■■
EU ■■■■ ■■■■ ■■■■ ■■■■
Asia ■■■ ■■■ ■■■ ■■■
Best practices:
Use for: Distribution of continuous data
Order Value Distribution
$0-10 ████████████████████████████████████████ 100
$10-20 ████████████████████████████ 80
$20-30 ████████████████████ 60
$30-40 ████████████ 40
$40-50 ██████████ 20
$50+ ██████ 10
Best practices:
Use for: Distribution with outliers
Salary Distribution
┌─────────────────────────────────────┐
│ ┌───┐ │
│ │ │ │
│ ┌───┤ ├───┐ │
│ │ │ │ │ │
│ │ │ │ │ │
│ └───┴───┴───┘ │
└─────────────────────────────────────┘
Min Q1 Med Q3 Max
Best practices:
Use for continuous, ordered data.
Viridis: #440154 → #3b528b → #21918c → #5ec962 → #fde725
Blues: #f7fbff → #deebf7 → #c6dbef → #9ecae1 → #6baed6
Greens: #f7fcf5 → #e5f5e0 → #c7e9c0 → #a1d99b → #74c476
Use for data with meaningful midpoint.
RdYlGn: #a50026 → #d73027 → #f46d43 → #fdae61 → #fee08b
→ #d9ef8b → #a6d96a → #66bd63 → #1a9850 → #006837
Use for distinct categories.
Set1: #e41a1c, #377eb8, #4daf4a, #984ea3, #ff7f00
Set2: #66c2a5, #fc8d62, #8da0cb, #e78ac3, #a6d854
| Color | Meaning | Use Case |
|---|---|---|
| Green | Positive, good | Above target, growth |
| Red | Negative, bad | Below target, decline |
| Yellow/Orange | Warning | Near threshold |
| Blue | Neutral, information | Default state |
| Gray | Inactive, placeholder | Disabled elements |
Tips:
Safe Palettes:
Attributes processed instantly (before conscious thought).
| Attribute | Speed | Example |
|---|---|---|
| Color | Fast | Highlighting important data |
| Size | Fast | Larger = more important |
| Orientation | Fast | Angles, lines |
| Motion | Very fast | Animations |
| Position | Fast | Top-left = primary |
From most to least accurate for quantitative data:
Implication: Use position/length for precise values, color for categories.
| Principle | Description | Application |
|---|---|---|
| Proximity | Near items grouped together | Group related charts |
| Similarity | Similar items grouped | Use consistent colors |
| Continuity | Eye follows lines | Use flow in layouts |
| Closure | Complete incomplete shapes | Don't over-complete |
| Figure-Ground | Separate foreground/background | Use white space |
Bad (legend):
[Chart]
Legend: Blue = A, Red = B, Green = C
Good (direct labels):
[Chart with labels on chart]
Series A ●───●───●
Series B ●───●───●
Series C ●───●───●
Bad (truncated):
$100k ┤ ●
$98k ┤
$96k ┤ ●
$94k ┤
└────────
Good (starts at zero):
$100k ┤ ●
$50k ┤
$0 ┤ ●
└────────
Exception: When zero is not meaningful (e.g., temperature)
Bad (alphabetical):
Zebra ████████
Apple ████████████████
Banana ████████████
Good (by value):
Apple ████████████████
Banana ████████████
Zebra ████████
Bad (cluttered):
[Chart with grid, borders, 3D effects, shadows, gradients]
Good (clean):
[Clean chart with minimal decoration]
Bad (different scales):
Chart A: 0-100
Chart B: 0-1000
Good (consistent scales):
Chart A: 0-100
Chart B: 0-100 (normalized)
| Feature | Description | Use Case |
|---|---|---|
| Tooltips | Hover for details | Show exact values |
| Zoom | Zoom into data | Explore details |
| Pan | Move around zoomed data | Navigate |
| Filter | Filter data | Focus on subset |
| Highlight | Highlight selection | Compare |
| Brush | Select range | Time range selection |
| Click | Click for drill-down | Navigate hierarchy |
Good tooltip:
┌─────────────────────────────────────┐
│ January 2024 │
│ ─────────────────────────────── │
│ Revenue: $1,234,567 │
│ Orders: 1,234 │
│ AOV: $1,000 │
│ ▲ 12.3% vs previous month │
└─────────────────────────────────────┘
Before zoom:
┌─────────────────────────────────────┐
│ ●───●───●───●───●───●───●───● │ ← Full view
└─────────────────────────────────────┘
After zoom:
┌─────────────────────────────────────┐
│ ●───●───● │ ← Zoomed in
└─────────────────────────────────────┘
| Guideline | Requirement |
|---|---|
| Color contrast | 4.5:1 for text, 3:1 for large text |
| Color independence | Don't rely on color alone |
| Keyboard navigation | All features accessible via keyboard |
| Screen reader support | Provide alt text, ARIA labels |
| Focus indicators | Visible focus state |
Good contrast (7:1):
Black text on white background
#000000 on #FFFFFF
Poor contrast (1.5:1):
Light gray on white background
#CCCCCC on #FFFFFF
Bad (color only):
Red = Negative, Green = Positive
Good (color + pattern/icon):
Red ↓ = Negative, Green ↑ = Positive
Example:
<figure>
<img src="revenue-chart.png" alt="Line chart showing revenue
increasing from $1M in January to $1.5M in June, with a
12% month-over-month growth rate.">
<figcaption>Revenue Growth Q1-Q2 2024</figcaption>
</figure>
| Library | Strengths | Learning Curve |
|---|---|---|
| D3.js | Most flexible, powerful | Steep |
| Plotly | Easy, interactive | Gentle |
| Chart.js | Simple, popular | Gentle |
| Recharts | React-friendly | Gentle |
| Victory | React, declarative | Gentle |
| Nivo | React, beautiful | Gentle |
| Library | Strengths | Use Case |
|---|---|---|
| Matplotlib | Foundation, flexible | All-purpose |
| Seaborn | Statistical plots | Data analysis |
| Plotly | Interactive | Web dashboards |
| Altair | Declarative grammar | Statistical |
| Bokeh | Interactive | Web apps |
| Library | Strengths | Use Case |
|---|---|---|
| ggplot2 | Grammar of graphics | All-purpose |
| plotly | Interactive | Web dashboards |
| lattice | Trellis displays | Multi-panel |
| Tool | Strengths |
|---|---|
| Tableau | Powerful visualizations |
| Looker | SQL-based, embedded |
| Power BI | Microsoft ecosystem |
| Metabase | Open-source, simple |
Problem: 3D distorts data perception.
Bad:
[3D bar chart with perspective]
Good:
[2D bar chart, flat]
Problem: Exaggerates differences.
Bad:
$100k ┤ ●
$98k ┤
$96k ┤ ●
Good:
$100k ┤ ●
$0 ┤ ●
Problem: Confusing, hard to distinguish.
Bad: 10+ colors Good: 3-5 colors max
Problem: Hard to compare.
Bad: 10+ slices Good: Max 5 slices, use bar chart instead
Problem: Numbers without meaning.
Bad: "Revenue: $1.2M" Good: "Revenue: $1.2M ▲ 12% vs last month"
Problem: No meaning, hard to read.
Bad: Random colors Good: Semantic colors (red=bad, green=good)
Problem: Hard to read.
Bad: 10px font Good: 12px+ font
Desktop: Wide charts, side-by-side Mobile: Narrow charts, stacked
Desktop: Mobile:
┌─────┬─────┐ ┌─────┐
│ A │ B │ │ A │
├─────┼─────┤ ├─────┤
│ C │ D │ │ B │
└─────┴─────┘ ├─────┤
│ C │
├─────┤
│ D │
└─────┘
| Principle | Description |
|---|---|
| Purposeful | Animation should have purpose |
| Smooth | 60fps, no jank |
| Subtle | Don't distract |
| Fast | < 500ms for transitions |
| Type | Use Case |
|---|---|
| Fade | Show/hide elements |
| Slide | Move between states |
| Scale | Emphasize elements |
| Rotate | Draw attention |
// Smooth transition
d3.select('.bar')
.transition()
.duration(500)
.attr('height', newHeight);
import Chart from 'chart.js/auto';
const ctx = document.getElementById('myChart');
new Chart(ctx, {
type: 'line',
data: {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May'],
datasets: [{
label: 'Revenue',
data: [100, 120, 115, 134, 168],
borderColor: 'rgb(75, 192, 192)',
backgroundColor: 'rgba(75, 192, 192, 0.2)',
tension: 0.1
}]
},
options: {
responsive: true,
plugins: {
legend: {
display: false
},
tooltip: {
callbacks: {
label: function(context) {
return `$${context.parsed.y}K`;
}
}
}
},
scales: {
y: {
beginAtZero: true,
ticks: {
callback: function(value) {
return `$${value}K`;
}
}
}
}
}
});
import * as d3 from 'd3';
const data = [
{ month: 'Jan', value: 100 },
{ month: 'Feb', value: 120 },
{ month: 'Mar', value: 115 },
{ month: 'Apr', value: 134 },
{ month: 'May', value: 168 }
];
const margin = {top: 20, right: 30, bottom: 40, left: 50};
const width = 800 - margin.left - margin.right;
const height = 400 - margin.top - margin.bottom;
const svg = d3.select('#chart')
.append('svg')
.attr('width', width + margin.left + margin.right)
.attr('height', height + margin.top + margin.bottom)
.append('g')
.attr('transform', `translate(${margin.left},${margin.top})`);
const x = d3.scaleBand()
.domain(data.map(d => d.month))
.range([0, width])
.padding(0.2);
const y = d3.scaleLinear()
.domain([0, d3.max(data, d => d.value)])
.range([height, 0]);
svg.append('g')
.attr('transform', `translate(0,${height})`)
.call(d3.axisBottom(x));
svg.append('g')
.call(d3.axisLeft(y));
svg.selectAll('.bar')
.data(data)
.enter()
.append('rect')
.attr('class', 'bar')
.attr('x', d => x(d.month))
.attr('width', x.bandwidth())
.attr('y', height)
.attr('height', 0)
.transition()
.duration(500)
.attr('y', d => y(d.value))
.attr('height', d => height - y(d.value))
.attr('fill', '#4daf4a');
import plotly.express as px
import pandas as pd
data = pd.DataFrame({
'month': ['Jan', 'Feb', 'Mar', 'Apr', 'May'],
'revenue': [100, 120, 115, 134, 168]
})
fig = px.line(
data,
x='month',
y='revenue',
title='Revenue Trend',
labels={'revenue': 'Revenue ($K)', 'month': 'Month'},
markers=True
)
fig.update_layout(
yaxis_range=[0, 200],
hovermode='x unified'
)
fig.update_traces(
line=dict(width=3, color='#4daf4a'),
marker=dict(size=8)
)
fig.show()
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
data = pd.DataFrame({
'region': ['North', 'South', 'East', 'West'],
'sales': [50, 35, 25, 10]
})
plt.figure(figsize=(10, 6))
ax = sns.barplot(
data=data,
x='sales',
y='region',
palette='viridis'
)
ax.set_xlabel('Sales ($M)')
ax.set_ylabel('Region')
ax.set_title('Sales by Region')
# Add value labels
for i, v in enumerate(data['sales']):
ax.text(v + 1, i, f'${v}M', va='center')
plt.tight_layout()
plt.show()
---
## Quick Start
### Basic Chart with Chart.js
```javascript
import { Chart } from 'chart.js'
const ctx = document.getElementById('myChart')
const chart = new Chart(ctx, {
type: 'line',
data: {
labels: ['Jan', 'Feb', 'Mar', 'Apr'],
datasets: [{
label: 'Revenue',
data: [1000, 1200, 1100, 1300],
borderColor: 'rgb(75, 192, 192)',
tension: 0.1
}]
},
options: {
responsive: true,
scales: {
y: {
beginAtZero: true
}
}
}
})
import * as d3 from 'd3'
const data = [10, 20, 30, 40, 50]
const svg = d3.select('body').append('svg')
.attr('width', 400)
.attr('height', 300)
svg.selectAll('rect')
.data(data)
.enter()
.append('rect')
.attr('x', (d, i) => i * 50)
.attr('y', d => 300 - d * 5)
.attr('width', 40)
.attr('height', d => d * 5)
// ❌ Bad - Y-axis doesn't start at zero
chart.options.scales.y.min = 90 // Misleading!
// ✅ Good - Y-axis starts at zero
chart.options.scales.y.min = 0 // Accurate representation
// ❌ Bad - Too many decorations
chart.options.plugins.legend.display = true
chart.options.plugins.title.display = true
chart.options.plugins.annotation = { /* decorations */ }
// Too much!
// ✅ Good - Clean, focused
chart.options.plugins.legend.display = true // Only if needed
// Remove unnecessary decorations
// ❌ Bad - Line chart for categories
type: 'line' // Categories don't have trends
// ✅ Good - Bar chart for categories
type: 'bar' // Better for comparing categories
23-business-analytics/dashboard-design/) - Dashboard layouts23-business-analytics/kpi-metrics/) - Metric visualization23-business-analytics/sql-for-analytics/) - Data queriesxiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience