Loading...
Loading...
Compare original and translation side by side
What type? [categorical | continuous | temporal | spatial | hierarchical]
How many dimensions? [1D | 2D | multivariate]
How many points? [<100 | 100-1K | 1K-10K | >10K]What type? [categorical | continuous | temporal | spatial | hierarchical]
How many dimensions? [1D | 2D | multivariate]
How many points? [<100 | 100-1K | 1K-10K | >10K]What story to tell? [comparison | trend | distribution | relationship | composition | flow | hierarchy | geographic]What story to tell? [comparison | trend | distribution | relationship | composition | flow | hierarchy | geographic]references/selection-matrix.mdreferences/selection-matrix.md1000 points: Sampling or Canvas rendering
| Purpose | Chart Types |
|---|---|
| Compare values | Bar Chart, Lollipop Chart |
| Show trends | Line Chart, Area Chart |
| Reveal distributions | Histogram, Violin Plot, Box Plot |
| Explore relationships | Scatter Plot, Bubble Chart |
| Explain composition | Treemap, Stacked Bar, Pie Chart (<6 slices) |
| Visualize flow | Sankey Diagram, Chord Diagram |
| Display hierarchy | Sunburst, Dendrogram, Treemap |
| Show geographic | Choropleth Map, Symbol Map |
| 分析目标 | 图表类型 |
|---|---|
| 对比数值 | Bar Chart、Lollipop Chart |
| 展示趋势 | Line Chart、Area Chart |
| 揭示分布 | Histogram、Violin Plot、Box Plot |
| 探索关联 | Scatter Plot、Bubble Chart |
| 说明构成 | Treemap、Stacked Bar、Pie Chart(不超过6个分片) |
| 可视化流向 | Sankey Diagram、Chord Diagram |
| 展示层级结构 | Sunburst、Dendrogram、Treemap |
| 地理空间展示 | Choropleth Map、Symbol Map |
references/chart-catalog.mdreferences/chart-catalog.md<figure role="img" aria-label="Sales increased 15% from Q3 to Q4">
<svg>...</svg>
</figure><figure role="img" aria-label="Sales increased 15% from Q3 to Q4">
<svg>...</svg>
</figure>#648FFF (Blue), #785EF0 (Purple), #DC267F (Magenta),
#FE6100 (Orange), #FFB000 (Yellow)#648FFF (Blue), #785EF0 (Purple), #DC267F (Magenta),
#FE6100 (Orange), #FFB000 (Yellow)references/accessibility.mdreferences/accessibility.md| Rows | Strategy | Implementation |
|---|---|---|
| <1,000 | Direct rendering | Standard libraries (SVG) |
| 1K-10K | Sampling/aggregation | Downsample to ~500 points |
| 10K-100K | Canvas rendering | Switch from SVG to Canvas |
| >100K | Server-side aggregation | Backend processing |
| 数据行数 | 优化策略 | 实现方式 |
|---|---|---|
| <1,000 | 直接渲染 | 标准库(SVG) |
| 1K-10K | 采样/聚合 | 下采样至约500个数据点 |
| 10K-100K | Canvas渲染 | 从SVG切换为Canvas |
| >100K | 服务端聚合 | 后端处理 |
npm install rechartsimport { LineChart, Line, XAxis, YAxis, Tooltip, ResponsiveContainer } from 'recharts';
const data = [
{ month: 'Jan', sales: 4000 },
{ month: 'Feb', sales: 3000 },
{ month: 'Mar', sales: 5000 },
];
export function SalesChart() {
return (
<ResponsiveContainer width="100%" height={300}>
<LineChart data={data}>
<XAxis dataKey="month" />
<YAxis />
<Tooltip />
<Line type="monotone" dataKey="sales" stroke="#8884d8" />
</LineChart>
</ResponsiveContainer>
);
}npm install rechartsimport { LineChart, Line, XAxis, YAxis, Tooltip, ResponsiveContainer } from 'recharts';
const data = [
{ month: 'Jan', sales: 4000 },
{ month: 'Feb', sales: 3000 },
{ month: 'Mar', sales: 5000 },
];
export function SalesChart() {
return (
<ResponsiveContainer width="100%" height={300}>
<LineChart data={data}>
<XAxis dataKey="month" />
<YAxis />
<Tooltip />
<Line type="monotone" dataKey="sales" stroke="#8884d8" />
</LineChart>
</ResponsiveContainer>
);
}npm install d3npm install d3npm install react-plotly.js plotly.jsreferences/javascript/npm install react-plotly.js plotly.jsreferences/javascript/references/python/references/python/--chart-color-primary
--chart-color-1 through --chart-color-10
--chart-axis-color
--chart-grid-color
--chart-tooltip-bg<Line stroke="var(--chart-color-primary)" />--chart-color-primary
--chart-color-1 through --chart-color-10
--chart-axis-color
--chart-grid-color
--chart-tooltip-bg<Line stroke="var(--chart-color-primary)" />START: What is your data?
Categorical (categories/groups)
├─ Compare values → Bar Chart
├─ Show composition → Treemap or Pie Chart (<6 slices)
└─ Show flow → Sankey Diagram
Continuous (numbers)
├─ Single variable → Histogram, Violin Plot
└─ Two variables → Scatter Plot
Temporal (time series)
├─ Single metric → Line Chart
├─ Multiple metrics → Small Multiples
└─ Daily patterns → Calendar Heatmap
Hierarchical (nested)
├─ Proportions → Treemap
└─ Show depth → Sunburst, Dendrogram
Geographic (locations)
├─ Regional aggregates → Choropleth Map
└─ Point locations → Symbol MapSTART: What is your data?
Categorical (categories/groups)
├─ Compare values → Bar Chart
├─ Show composition → Treemap or Pie Chart (<6 slices)
└─ Show flow → Sankey Diagram
Continuous (numbers)
├─ Single variable → Histogram, Violin Plot
└─ Two variables → Scatter Plot
Temporal (time series)
├─ Single metric → Line Chart
├─ Multiple metrics → Small Multiples
└─ Daily patterns → Calendar Heatmap
Hierarchical (nested)
├─ Proportions → Treemap
└─ Show depth → Sunburst, Dendrogram
Geographic (locations)
├─ Regional aggregates → Choropleth Map
└─ Point locations → Symbol Mapreferences/chart-catalog.mdreferences/selection-matrix.mdreferences/accessibility.mdreferences/color-systems.mdreferences/performance.mdreferences/javascript/references/python/assets/color-palettes/assets/example-datasets/references/chart-catalog.mdreferences/selection-matrix.mdreferences/accessibility.mdreferences/color-systems.mdreferences/performance.mdreferences/javascript/references/python/assets/color-palettes/assets/example-datasets/examples/javascript/bar-chart.tsxexamples/javascript/line-chart.tsxexamples/javascript/scatter-plot.tsxexamples/javascript/accessible-chart.tsxcd examples/javascript && npm install && npm startexamples/javascript/bar-chart.tsxexamples/javascript/line-chart.tsxexamples/javascript/scatter-plot.tsxexamples/javascript/accessible-chart.tsxcd examples/javascript && npm install && npm startundefinedundefined
---
**Progressive disclosure:** This SKILL.md provides overview and quick start. Detailed documentation, code examples, and language-specific implementations in `references/` and `examples/` directories.
---
**渐进式披露:** 本SKILL.md提供概述和快速入门内容。详细文档、代码示例和语言专属实现请查看 `references/` 和 `examples/` 目录。