astro-component-kit 0.4.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -1
- package/bin/cli.js +67 -0
- package/bin/installer.js +179 -0
- package/package.json +22 -5
- package/src/components/lib/sections/ChangelogSection.astro +6 -0
- package/src/data/registry/app.ts +93 -0
- package/src/data/registry/buttons.ts +3279 -0
- package/src/data/registry/cards.ts +1753 -0
- package/src/data/registry/charts-svg.ts +557 -0
- package/src/data/registry/charts.ts +500 -0
- package/src/data/registry/data.ts +986 -0
- package/src/data/registry/ecommerce.ts +269 -0
- package/src/data/registry/feedback.ts +1824 -0
- package/src/data/registry/forms.ts +2513 -0
- package/src/data/registry/index.ts +64 -0
- package/src/data/registry/layout.ts +206 -0
- package/src/data/registry/navigation.ts +936 -0
- package/src/data/registry/overlays.ts +1133 -0
- package/src/data/registry/sections-extra.ts +397 -0
- package/src/data/registry/sections.ts +361 -0
- package/src/data/registry/sources.ts +41 -0
- package/src/data/registry/templates.ts +414 -0
- package/src/data/registry/types.ts +30 -0
- package/src/data/registry/typography.ts +777 -0
- package/src/mcp/http-server.ts +324 -0
- package/src/mcp/index.ts +67 -0
- package/src/mcp/installer.ts +178 -0
- package/src/mcp/registry-adapter.ts +278 -0
- package/src/mcp/stdio-server.ts +11 -0
- package/src/mcp/tools.ts +247 -0
- package/src/mcp/types.ts +53 -0
|
@@ -0,0 +1,557 @@
|
|
|
1
|
+
// src/data/registry/charts-svg.ts
|
|
2
|
+
// Zero-dependency SVG charts & statistics. Source code is loaded from the real
|
|
3
|
+
// component files via `source()` so the docs always show the shipped code.
|
|
4
|
+
import type { ComponentDoc } from './types';
|
|
5
|
+
import { source } from './sources';
|
|
6
|
+
|
|
7
|
+
interface ChartMeta {
|
|
8
|
+
slug: string;
|
|
9
|
+
name: string;
|
|
10
|
+
file: string;
|
|
11
|
+
description: string;
|
|
12
|
+
tags: string[];
|
|
13
|
+
featured?: boolean;
|
|
14
|
+
usage: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const HELPERS = 'ChartFrame.astro, chart-utils.ts and chart-tooltip.ts';
|
|
18
|
+
|
|
19
|
+
function chart(meta: ChartMeta): ComponentDoc {
|
|
20
|
+
return {
|
|
21
|
+
slug: meta.slug,
|
|
22
|
+
name: meta.name,
|
|
23
|
+
description: meta.description,
|
|
24
|
+
category: 'charts',
|
|
25
|
+
tags: ['chart', 'svg', 'zero-dependency', ...meta.tags],
|
|
26
|
+
featured: meta.featured ?? false,
|
|
27
|
+
code: source(`charts/${meta.file}`),
|
|
28
|
+
usage: `---
|
|
29
|
+
import { ${meta.file.replace('.astro', '')} } from 'astro-component-kit/charts';
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
${meta.usage.trim()}`,
|
|
33
|
+
installation: {
|
|
34
|
+
manual: `1. No npm dependencies — pure SVG rendered at build time.
|
|
35
|
+
2. Copy the shared chart helpers (${HELPERS}) from the "Chart Frame" page into src/components/charts/.
|
|
36
|
+
3. Copy ${meta.file} next to them.
|
|
37
|
+
4. Add the --chart-* color tokens from global.css (they also have hex fallbacks).
|
|
38
|
+
5. Import the component and pass your data.`,
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export const chartsSvg: ComponentDoc[] = [
|
|
44
|
+
{
|
|
45
|
+
slug: 'chart-frame',
|
|
46
|
+
name: 'Chart Frame',
|
|
47
|
+
description: 'Shared accessible chart shell: card surface, header, legend, hover tooltip and a data-table fallback used by every SVG chart.',
|
|
48
|
+
category: 'charts',
|
|
49
|
+
tags: ['chart', 'svg', 'a11y', 'foundation', 'tooltip'],
|
|
50
|
+
featured: false,
|
|
51
|
+
code: `${source('charts/ChartFrame.astro')}
|
|
52
|
+
|
|
53
|
+
// ─────────────────────────────────────────────────────────────
|
|
54
|
+
// chart-utils.ts
|
|
55
|
+
// ─────────────────────────────────────────────────────────────
|
|
56
|
+
${source('charts/chart-utils.ts')}
|
|
57
|
+
|
|
58
|
+
// ─────────────────────────────────────────────────────────────
|
|
59
|
+
// chart-tooltip.ts
|
|
60
|
+
// ─────────────────────────────────────────────────────────────
|
|
61
|
+
${source('charts/chart-tooltip.ts')}`,
|
|
62
|
+
usage: `---
|
|
63
|
+
import { ChartFrame } from 'astro-component-kit/charts';
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
<ChartFrame
|
|
67
|
+
title="Custom visual"
|
|
68
|
+
subtitle="Any SVG you like"
|
|
69
|
+
legend={[{ label: 'A', color: 'var(--chart-1)' }, { label: 'B', color: 'var(--chart-2)' }]}
|
|
70
|
+
table={{ headers: ['Item', 'Value'], rows: [['A', 10], ['B', 20]] }}
|
|
71
|
+
>
|
|
72
|
+
<svg viewBox="0 0 640 200" role="img" aria-label="Custom visual">…</svg>
|
|
73
|
+
</ChartFrame>`,
|
|
74
|
+
},
|
|
75
|
+
chart({
|
|
76
|
+
slug: 'line-chart',
|
|
77
|
+
name: 'Line Chart',
|
|
78
|
+
file: 'LineChart.astro',
|
|
79
|
+
description: 'Multi-series SVG line chart with smooth, linear or step curves, gradient area fill and a crosshair tooltip.',
|
|
80
|
+
tags: ['line', 'trend', 'time-series', 'area'],
|
|
81
|
+
featured: true,
|
|
82
|
+
usage: `<LineChart
|
|
83
|
+
title="Revenue"
|
|
84
|
+
categories={['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun']}
|
|
85
|
+
series={[{ name: 'Revenue', data: [12, 19, 15, 24, 28, 33] }]}
|
|
86
|
+
prefix="$"
|
|
87
|
+
curve="smooth"
|
|
88
|
+
/>`,
|
|
89
|
+
}),
|
|
90
|
+
chart({
|
|
91
|
+
slug: 'stacked-area-chart', name: 'Stacked Area Chart', file: 'StackedAreaChart.astro',
|
|
92
|
+
description: 'Stacked or 100% normalised area chart showing how each layer contributes to a changing total.',
|
|
93
|
+
tags: ['area', 'stacked', 'composition', 'time-series'], featured: true,
|
|
94
|
+
usage: `<StackedAreaChart
|
|
95
|
+
categories={['Jan', 'Feb', 'Mar', 'Apr']}
|
|
96
|
+
series={[
|
|
97
|
+
{ name: 'Organic', data: [320, 340, 390, 420] },
|
|
98
|
+
{ name: 'Paid', data: [180, 210, 200, 240] },
|
|
99
|
+
]}
|
|
100
|
+
normalized={false}
|
|
101
|
+
/>`,
|
|
102
|
+
}),
|
|
103
|
+
chart({
|
|
104
|
+
slug: 'range-area-chart', name: 'Range Area Chart', file: 'RangeAreaChart.astro',
|
|
105
|
+
description: 'Min/max band with a central median line, ideal for latency percentiles, temperatures or price ranges.',
|
|
106
|
+
tags: ['area', 'band', 'range', 'percentile'],
|
|
107
|
+
usage: `<RangeAreaChart
|
|
108
|
+
categories={['Mon', 'Tue', 'Wed', 'Thu', 'Fri']}
|
|
109
|
+
min={[42, 45, 40, 48, 52]}
|
|
110
|
+
avg={[74, 80, 70, 92, 101]}
|
|
111
|
+
max={[120, 135, 118, 160, 172]}
|
|
112
|
+
suffix="ms"
|
|
113
|
+
/>`,
|
|
114
|
+
}),
|
|
115
|
+
chart({
|
|
116
|
+
slug: 'forecast-line-chart', name: 'Forecast Line Chart', file: 'ForecastLineChart.astro',
|
|
117
|
+
description: 'Actuals as a solid line and projections as a dashed line with a widening confidence cone and a Today divider.',
|
|
118
|
+
tags: ['line', 'forecast', 'projection', 'confidence'],
|
|
119
|
+
usage: `<ForecastLineChart
|
|
120
|
+
categories={['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun']}
|
|
121
|
+
actual={[48, 51, 55, 54]}
|
|
122
|
+
forecast={[59, 63]}
|
|
123
|
+
confidence={0.12}
|
|
124
|
+
prefix="$" suffix="k"
|
|
125
|
+
/>`,
|
|
126
|
+
}),
|
|
127
|
+
chart({
|
|
128
|
+
slug: 'slope-chart', name: 'Slope Chart', file: 'SlopeChart.astro',
|
|
129
|
+
description: 'Before/after comparison between two points in time with rising and falling lines in status colors.',
|
|
130
|
+
tags: ['slope', 'comparison', 'before-after'],
|
|
131
|
+
usage: `<SlopeChart
|
|
132
|
+
fromLabel="2025" toLabel="2026"
|
|
133
|
+
items={[
|
|
134
|
+
{ label: 'Enterprise', from: 7.8, to: 9.6 },
|
|
135
|
+
{ label: 'Pro', from: 5.4, to: 4.6 },
|
|
136
|
+
]}
|
|
137
|
+
suffix="%"
|
|
138
|
+
/>`,
|
|
139
|
+
}),
|
|
140
|
+
chart({
|
|
141
|
+
slug: 'bump-chart', name: 'Bump Chart', file: 'BumpChart.astro',
|
|
142
|
+
description: 'Rank-over-time chart tracking each entity\'s position across periods with labelled rank nodes.',
|
|
143
|
+
tags: ['rank', 'bump', 'leaderboard', 'time-series'],
|
|
144
|
+
usage: `<BumpChart
|
|
145
|
+
periods={['2024', '2025', '2026']}
|
|
146
|
+
series={[
|
|
147
|
+
{ name: 'Astro', ranks: [3, 2, 1] },
|
|
148
|
+
{ name: 'Next', ranks: [1, 1, 2] },
|
|
149
|
+
{ name: 'Svelte', ranks: [2, 3, 3] },
|
|
150
|
+
]}
|
|
151
|
+
/>`,
|
|
152
|
+
}),
|
|
153
|
+
chart({
|
|
154
|
+
slug: 'sparkline-chart', name: 'Sparkline Chart', file: 'SparklineChart.astro',
|
|
155
|
+
description: 'Compact inline trend line, area or micro-bars for tables, KPI tiles and running text.',
|
|
156
|
+
tags: ['sparkline', 'inline', 'micro', 'trend'],
|
|
157
|
+
usage: `<SparklineChart data={[12, 15, 11, 18, 22, 19, 25]} variant="area" size="md" label="Signups, last 7 days" />`,
|
|
158
|
+
}),
|
|
159
|
+
chart({
|
|
160
|
+
slug: 'grouped-bar-chart', name: 'Grouped Bar Chart', file: 'GroupedBarChart.astro',
|
|
161
|
+
description: 'Side-by-side vertical bars comparing several series across categories, with rounded data-ends.',
|
|
162
|
+
tags: ['bar', 'grouped', 'comparison', 'column'], featured: true,
|
|
163
|
+
usage: `<GroupedBarChart
|
|
164
|
+
categories={['NA', 'EMEA', 'APAC']}
|
|
165
|
+
series={[
|
|
166
|
+
{ name: '2025', data: [420, 310, 260] },
|
|
167
|
+
{ name: '2026', data: [510, 365, 340] },
|
|
168
|
+
]}
|
|
169
|
+
prefix="$" suffix="k"
|
|
170
|
+
/>`,
|
|
171
|
+
}),
|
|
172
|
+
chart({
|
|
173
|
+
slug: 'stacked-bar-chart', name: 'Stacked Bar Chart', file: 'StackedBarChart.astro',
|
|
174
|
+
description: 'Vertical or horizontal stacked bars with optional 100% mode and 2px surface gaps between segments.',
|
|
175
|
+
tags: ['bar', 'stacked', 'composition', 'horizontal'],
|
|
176
|
+
usage: `<StackedBarChart
|
|
177
|
+
categories={['S1', 'S2', 'S3']}
|
|
178
|
+
series={[
|
|
179
|
+
{ name: 'Done', data: [42, 48, 51] },
|
|
180
|
+
{ name: 'Blocked', data: [5, 7, 3] },
|
|
181
|
+
]}
|
|
182
|
+
horizontal={false}
|
|
183
|
+
normalized={false}
|
|
184
|
+
/>`,
|
|
185
|
+
}),
|
|
186
|
+
chart({
|
|
187
|
+
slug: 'horizontal-bar-chart', name: 'Horizontal Bar Chart', file: 'HorizontalBarChart.astro',
|
|
188
|
+
description: 'Ranked horizontal bars with labels and values, single color and optional highlight of one item.',
|
|
189
|
+
tags: ['bar', 'horizontal', 'ranking', 'top-list'],
|
|
190
|
+
usage: `<HorizontalBarChart
|
|
191
|
+
items={[
|
|
192
|
+
{ label: '/pricing', value: 18420 },
|
|
193
|
+
{ label: '/docs', value: 15210 },
|
|
194
|
+
{ label: '/', value: 12980 },
|
|
195
|
+
]}
|
|
196
|
+
highlight="/pricing"
|
|
197
|
+
/>`,
|
|
198
|
+
}),
|
|
199
|
+
chart({
|
|
200
|
+
slug: 'diverging-bar-chart', name: 'Diverging Bar Chart', file: 'DivergingBarChart.astro',
|
|
201
|
+
description: 'Horizontal bars extending left or right from zero for variance, sentiment and P&L deltas.',
|
|
202
|
+
tags: ['bar', 'diverging', 'variance', 'positive-negative'],
|
|
203
|
+
usage: `<DivergingBarChart
|
|
204
|
+
items={[
|
|
205
|
+
{ label: 'Engineering', value: -42 },
|
|
206
|
+
{ label: 'Sales', value: 64 },
|
|
207
|
+
]}
|
|
208
|
+
prefix="$" suffix="k"
|
|
209
|
+
/>`,
|
|
210
|
+
}),
|
|
211
|
+
chart({
|
|
212
|
+
slug: 'waterfall-chart', name: 'Waterfall Chart', file: 'WaterfallChart.astro',
|
|
213
|
+
description: 'Bridge chart showing how a starting value is built up or eroded by positive and negative steps.',
|
|
214
|
+
tags: ['waterfall', 'bridge', 'finance', 'variance'],
|
|
215
|
+
usage: `<WaterfallChart
|
|
216
|
+
startLabel="Jan" start={1200000}
|
|
217
|
+
steps={[
|
|
218
|
+
{ label: 'New', value: 380000 },
|
|
219
|
+
{ label: 'Churn', value: -160000 },
|
|
220
|
+
]}
|
|
221
|
+
endLabel="Jun"
|
|
222
|
+
prefix="$"
|
|
223
|
+
/>`,
|
|
224
|
+
}),
|
|
225
|
+
chart({
|
|
226
|
+
slug: 'histogram-chart', name: 'Histogram Chart', file: 'HistogramChart.astro',
|
|
227
|
+
description: 'Bins raw values into equal-width buckets and shows the distribution with mean and median markers.',
|
|
228
|
+
tags: ['histogram', 'distribution', 'statistics'],
|
|
229
|
+
usage: `<HistogramChart values={loadTimes} bins={12} unit="s" showStats />`,
|
|
230
|
+
}),
|
|
231
|
+
chart({
|
|
232
|
+
slug: 'lollipop-chart', name: 'Lollipop Chart', file: 'LollipopChart.astro',
|
|
233
|
+
description: 'Thin stems with value dots and an optional goal line; a lighter alternative to bar charts.',
|
|
234
|
+
tags: ['lollipop', 'dot', 'target', 'score'],
|
|
235
|
+
usage: `<LollipopChart
|
|
236
|
+
items={[
|
|
237
|
+
{ label: 'Home', value: 98 },
|
|
238
|
+
{ label: 'Search', value: 69 },
|
|
239
|
+
]}
|
|
240
|
+
target={90}
|
|
241
|
+
targetLabel="Goal"
|
|
242
|
+
/>`,
|
|
243
|
+
}),
|
|
244
|
+
chart({
|
|
245
|
+
slug: 'dumbbell-chart', name: 'Dumbbell Chart', file: 'DumbbellChart.astro',
|
|
246
|
+
description: 'Two connected dots per row showing the gap between before/after or two groups.',
|
|
247
|
+
tags: ['dumbbell', 'gap', 'comparison', 'before-after'],
|
|
248
|
+
usage: `<DumbbellChart
|
|
249
|
+
items={[
|
|
250
|
+
{ label: 'Startups', a: 41, b: 18 },
|
|
251
|
+
{ label: 'Enterprise', a: 88, b: 54 },
|
|
252
|
+
]}
|
|
253
|
+
aLabel="Before" bLabel="After" suffix="m"
|
|
254
|
+
/>`,
|
|
255
|
+
}),
|
|
256
|
+
chart({
|
|
257
|
+
slug: 'bullet-chart', name: 'Bullet Chart', file: 'BulletChart.astro',
|
|
258
|
+
description: 'Compact KPI-vs-target bars with qualitative performance bands and an explicit on-target status.',
|
|
259
|
+
tags: ['bullet', 'kpi', 'target', 'performance'],
|
|
260
|
+
usage: `<BulletChart
|
|
261
|
+
metrics={[
|
|
262
|
+
{ label: 'Revenue', value: 270, target: 250, ranges: [150, 225, 300], unit: '$k' },
|
|
263
|
+
{ label: 'NPS', value: 54, target: 50, ranges: [30, 50, 70] },
|
|
264
|
+
]}
|
|
265
|
+
/>`,
|
|
266
|
+
}),
|
|
267
|
+
chart({
|
|
268
|
+
slug: 'population-pyramid', name: 'Population Pyramid', file: 'PopulationPyramid.astro',
|
|
269
|
+
description: 'Back-to-back horizontal bars comparing two groups across ordered bands like age groups.',
|
|
270
|
+
tags: ['pyramid', 'demographics', 'butterfly', 'comparison'],
|
|
271
|
+
usage: `<PopulationPyramid
|
|
272
|
+
bands={['35–44', '25–34', '18–24']}
|
|
273
|
+
left={[12.6, 15.4, 7.9]}
|
|
274
|
+
right={[11.8, 16.2, 8.8]}
|
|
275
|
+
leftLabel="Women" rightLabel="Men"
|
|
276
|
+
/>`,
|
|
277
|
+
}),
|
|
278
|
+
chart({
|
|
279
|
+
slug: 'radial-bar-chart', name: 'Radial Bar Chart', file: 'RadialBarChart.astro',
|
|
280
|
+
description: 'Concentric progress arcs sharing a 0–100% scale with a labelled breakdown list.',
|
|
281
|
+
tags: ['radial', 'progress', 'arc', 'adoption'],
|
|
282
|
+
usage: `<RadialBarChart
|
|
283
|
+
items={[
|
|
284
|
+
{ label: 'Dashboards', value: 86 },
|
|
285
|
+
{ label: 'API', value: 47 },
|
|
286
|
+
]}
|
|
287
|
+
sweep={270}
|
|
288
|
+
/>`,
|
|
289
|
+
}),
|
|
290
|
+
chart({
|
|
291
|
+
slug: 'segmented-bar-chart', name: 'Segmented Bar Chart', file: 'SegmentedBarChart.astro',
|
|
292
|
+
description: 'A single tall part-to-whole bar with labelled segments and a breakdown list; clearer than a pie.',
|
|
293
|
+
tags: ['segmented', 'part-to-whole', 'storage', 'breakdown'],
|
|
294
|
+
usage: `<SegmentedBarChart
|
|
295
|
+
segments={[
|
|
296
|
+
{ label: 'Media', value: 182 },
|
|
297
|
+
{ label: 'Backups', value: 96 },
|
|
298
|
+
{ label: 'Other', value: 22 },
|
|
299
|
+
]}
|
|
300
|
+
suffix=" GB"
|
|
301
|
+
/>`,
|
|
302
|
+
}),
|
|
303
|
+
chart({
|
|
304
|
+
slug: 'pie-chart', name: 'Pie Chart', file: 'PieChart.astro',
|
|
305
|
+
description: 'Pure SVG pie or donut with slice gaps, centre total and a value breakdown list.',
|
|
306
|
+
tags: ['pie', 'donut', 'part-to-whole', 'share'], featured: true,
|
|
307
|
+
usage: `<PieChart
|
|
308
|
+
slices={[
|
|
309
|
+
{ label: 'Enterprise', value: 48200 },
|
|
310
|
+
{ label: 'Team', value: 31400 },
|
|
311
|
+
{ label: 'Pro', value: 18900 },
|
|
312
|
+
]}
|
|
313
|
+
donut
|
|
314
|
+
prefix="$"
|
|
315
|
+
/>`,
|
|
316
|
+
}),
|
|
317
|
+
chart({
|
|
318
|
+
slug: 'gauge-chart', name: 'Gauge Chart', file: 'GaugeChart.astro',
|
|
319
|
+
description: 'Semicircular progress gauge for a single KPI against a goal with the number always shown as text.',
|
|
320
|
+
tags: ['gauge', 'kpi', 'goal', 'progress'],
|
|
321
|
+
usage: `<GaugeChart title="Sales goal" value={73400} max={100000} prefix="$" label="of $100k goal" />`,
|
|
322
|
+
}),
|
|
323
|
+
chart({
|
|
324
|
+
slug: 'waffle-chart', name: 'Waffle Chart', file: 'WaffleChart.astro',
|
|
325
|
+
description: '10×10 grid where each square is 1% of the whole; an intuitive view of percentages.',
|
|
326
|
+
tags: ['waffle', 'percentage', 'part-to-whole', 'grid'],
|
|
327
|
+
usage: `<WaffleChart
|
|
328
|
+
parts={[
|
|
329
|
+
{ label: 'Desktop', value: 54 },
|
|
330
|
+
{ label: 'Mobile', value: 38 },
|
|
331
|
+
{ label: 'Tablet', value: 8 },
|
|
332
|
+
]}
|
|
333
|
+
/>`,
|
|
334
|
+
}),
|
|
335
|
+
chart({
|
|
336
|
+
slug: 'treemap-chart', name: 'Treemap Chart', file: 'TreemapChart.astro',
|
|
337
|
+
description: 'Squarified treemap where tile area is proportional to value, grouped by color.',
|
|
338
|
+
tags: ['treemap', 'hierarchy', 'part-to-whole', 'bundle'],
|
|
339
|
+
usage: `<TreemapChart
|
|
340
|
+
groups={['Vendor', 'App']}
|
|
341
|
+
items={[
|
|
342
|
+
{ label: 'react-dom', value: 42, group: 0 },
|
|
343
|
+
{ label: 'charts', value: 24, group: 1 },
|
|
344
|
+
{ label: 'utils', value: 5, group: 1 },
|
|
345
|
+
]}
|
|
346
|
+
suffix=" KB"
|
|
347
|
+
/>`,
|
|
348
|
+
}),
|
|
349
|
+
chart({
|
|
350
|
+
slug: 'funnel-chart', name: 'Funnel Chart', file: 'FunnelChart.astro',
|
|
351
|
+
description: 'Conversion funnel with tapered stages, step drop-off and overall conversion rate.',
|
|
352
|
+
tags: ['funnel', 'conversion', 'marketing', 'drop-off'], featured: true,
|
|
353
|
+
usage: `<FunnelChart
|
|
354
|
+
stages={[
|
|
355
|
+
{ label: 'Visited', value: 48200 },
|
|
356
|
+
{ label: 'Trial', value: 6400 },
|
|
357
|
+
{ label: 'Paid', value: 1240 },
|
|
358
|
+
]}
|
|
359
|
+
/>`,
|
|
360
|
+
}),
|
|
361
|
+
chart({
|
|
362
|
+
slug: 'sunburst-chart', name: 'Sunburst Chart', file: 'SunburstChart.astro',
|
|
363
|
+
description: 'Two-level hierarchical donut with parent categories inside and their children on the outer ring.',
|
|
364
|
+
tags: ['sunburst', 'hierarchy', 'donut', 'breakdown'],
|
|
365
|
+
usage: `<SunburstChart
|
|
366
|
+
data={[
|
|
367
|
+
{ label: 'Compute', children: [{ label: 'VMs', value: 4200 }, { label: 'Functions', value: 1800 }] },
|
|
368
|
+
{ label: 'Storage', children: [{ label: 'Object', value: 1900 }] },
|
|
369
|
+
]}
|
|
370
|
+
prefix="$"
|
|
371
|
+
/>`,
|
|
372
|
+
}),
|
|
373
|
+
chart({
|
|
374
|
+
slug: 'activity-rings', name: 'Activity Rings', file: 'ActivityRings.astro',
|
|
375
|
+
description: 'Concentric goal rings with values, targets and progress percentages; over-100% wraps around.',
|
|
376
|
+
tags: ['rings', 'goals', 'progress', 'fitness'],
|
|
377
|
+
usage: `<ActivityRings
|
|
378
|
+
rings={[
|
|
379
|
+
{ label: 'Focus time', value: 5.2, goal: 6, unit: 'h' },
|
|
380
|
+
{ label: 'Tasks done', value: 11, goal: 8 },
|
|
381
|
+
]}
|
|
382
|
+
/>`,
|
|
383
|
+
}),
|
|
384
|
+
chart({
|
|
385
|
+
slug: 'scatter-plot', name: 'Scatter Plot', file: 'ScatterPlot.astro',
|
|
386
|
+
description: 'X/Y relationship plot for up to three groups with distinct shapes and a least-squares trend line.',
|
|
387
|
+
tags: ['scatter', 'correlation', 'regression', 'statistics'],
|
|
388
|
+
usage: `<ScatterPlot
|
|
389
|
+
groups={[
|
|
390
|
+
{ name: 'Search', points: [{ x: 10, y: 40 }, { x: 25, y: 70 }, { x: 40, y: 98 }] },
|
|
391
|
+
]}
|
|
392
|
+
xLabel="Spend ($k)" yLabel="Signups"
|
|
393
|
+
trend
|
|
394
|
+
/>`,
|
|
395
|
+
}),
|
|
396
|
+
chart({
|
|
397
|
+
slug: 'bubble-chart', name: 'Bubble Chart', file: 'BubbleChart.astro',
|
|
398
|
+
description: 'Three-variable scatter where bubble area encodes a third measure such as revenue.',
|
|
399
|
+
tags: ['bubble', 'scatter', 'portfolio', 'three-variables'],
|
|
400
|
+
usage: `<BubbleChart
|
|
401
|
+
groups={['Core', 'Emerging']}
|
|
402
|
+
items={[
|
|
403
|
+
{ label: 'Analytics', x: 34, y: 62, z: 120, group: 0 },
|
|
404
|
+
{ label: 'AI tools', x: 71, y: 48, z: 70, group: 1 },
|
|
405
|
+
]}
|
|
406
|
+
/>`,
|
|
407
|
+
}),
|
|
408
|
+
chart({
|
|
409
|
+
slug: 'box-plot-chart', name: 'Box Plot Chart', file: 'BoxPlotChart.astro',
|
|
410
|
+
description: 'Distribution summary per group with median, IQR box, whiskers and outliers computed from raw data.',
|
|
411
|
+
tags: ['box-plot', 'distribution', 'statistics', 'quartiles'],
|
|
412
|
+
usage: `<BoxPlotChart
|
|
413
|
+
groups={[
|
|
414
|
+
{ label: 'us-east', values: [62, 70, 81, 85, 90, 120] },
|
|
415
|
+
{ label: 'eu-west', values: [55, 60, 66, 71, 79, 160] },
|
|
416
|
+
]}
|
|
417
|
+
suffix="ms"
|
|
418
|
+
/>`,
|
|
419
|
+
}),
|
|
420
|
+
chart({
|
|
421
|
+
slug: 'heatmap-chart', name: 'Heatmap Chart', file: 'HeatmapChart.astro',
|
|
422
|
+
description: 'Matrix heatmap on a single-hue sequential ramp with values, scale legend and keyboard-focusable cells.',
|
|
423
|
+
tags: ['heatmap', 'matrix', 'sequential', 'grid'],
|
|
424
|
+
usage: `<HeatmapChart
|
|
425
|
+
rows={['auth', 'billing']}
|
|
426
|
+
columns={['Mon', 'Tue', 'Wed']}
|
|
427
|
+
values={[[0.2, 0.3, 0.2], [0.8, 1.2, 0.9]]}
|
|
428
|
+
suffix="%"
|
|
429
|
+
/>`,
|
|
430
|
+
}),
|
|
431
|
+
chart({
|
|
432
|
+
slug: 'punch-card-chart', name: 'Punch Card Chart', file: 'PunchCardChart.astro',
|
|
433
|
+
description: 'Day × hour dot matrix where dot area encodes volume; shows when activity happens.',
|
|
434
|
+
tags: ['punch-card', 'activity', 'time-of-day', 'dots'],
|
|
435
|
+
usage: `<PunchCardChart
|
|
436
|
+
days={['Mon', 'Tue']}
|
|
437
|
+
hours={[9, 12, 15, 18]}
|
|
438
|
+
values={[[4, 12, 9, 2], [6, 15, 11, 3]]}
|
|
439
|
+
unit="deploys"
|
|
440
|
+
/>`,
|
|
441
|
+
}),
|
|
442
|
+
chart({
|
|
443
|
+
slug: 'polar-area-chart', name: 'Polar Area Chart', file: 'PolarAreaChart.astro',
|
|
444
|
+
description: 'Equal-angle wedges with area-correct radius for cyclical categories like months or hours.',
|
|
445
|
+
tags: ['polar', 'seasonality', 'radial', 'cyclical'],
|
|
446
|
+
usage: `<PolarAreaChart
|
|
447
|
+
items={[
|
|
448
|
+
{ label: 'Q1', value: 320 },
|
|
449
|
+
{ label: 'Q2', value: 410 },
|
|
450
|
+
{ label: 'Q3', value: 380 },
|
|
451
|
+
{ label: 'Q4', value: 690 },
|
|
452
|
+
]}
|
|
453
|
+
/>`,
|
|
454
|
+
}),
|
|
455
|
+
chart({
|
|
456
|
+
slug: 'radar-chart', name: 'Radar Chart', file: 'RadarChart.astro',
|
|
457
|
+
description: 'Pure SVG spider chart comparing up to three entities across 5–8 attributes on a shared scale.',
|
|
458
|
+
tags: ['radar', 'spider', 'comparison', 'attributes'],
|
|
459
|
+
usage: `<RadarChart
|
|
460
|
+
axes={['Speed', 'DX', 'Ecosystem', 'SEO', 'Flexibility']}
|
|
461
|
+
series={[
|
|
462
|
+
{ name: 'Astro', data: [9.5, 8.5, 7, 9.5, 8] },
|
|
463
|
+
{ name: 'Next', data: [7.5, 8, 9.5, 8, 8.5] },
|
|
464
|
+
]}
|
|
465
|
+
max={10}
|
|
466
|
+
/>`,
|
|
467
|
+
}),
|
|
468
|
+
chart({
|
|
469
|
+
slug: 'sankey-chart', name: 'Sankey Chart', file: 'SankeyChart.astro',
|
|
470
|
+
description: 'Two-column flow diagram where ribbon thickness encodes the volume moving from sources to targets.',
|
|
471
|
+
tags: ['sankey', 'flow', 'attribution', 'journey'],
|
|
472
|
+
usage: `<SankeyChart
|
|
473
|
+
flows={[
|
|
474
|
+
{ source: 'Organic', target: 'Free', value: 820 },
|
|
475
|
+
{ source: 'Organic', target: 'Pro', value: 310 },
|
|
476
|
+
{ source: 'Referral', target: 'Pro', value: 220 },
|
|
477
|
+
]}
|
|
478
|
+
/>`,
|
|
479
|
+
}),
|
|
480
|
+
chart({
|
|
481
|
+
slug: 'candlestick-chart', name: 'Candlestick Chart', file: 'CandlestickChart.astro',
|
|
482
|
+
description: 'OHLC price chart with hollow up-candles and filled down-candles so direction never relies on color.',
|
|
483
|
+
tags: ['candlestick', 'ohlc', 'finance', 'trading'],
|
|
484
|
+
usage: `<CandlestickChart
|
|
485
|
+
title="ACME / USD"
|
|
486
|
+
candles={[
|
|
487
|
+
{ label: 'Oct 1', open: 182, high: 186, low: 180, close: 185 },
|
|
488
|
+
{ label: 'Oct 2', open: 185, high: 187, low: 181, close: 182 },
|
|
489
|
+
]}
|
|
490
|
+
/>`,
|
|
491
|
+
}),
|
|
492
|
+
chart({
|
|
493
|
+
slug: 'kpi-stat-tile', name: 'KPI Stat Tile', file: 'KpiStatTile.astro',
|
|
494
|
+
description: 'Hero-number statistic tile with change chip (icon + text), comparison period and sparkline.',
|
|
495
|
+
tags: ['kpi', 'stat', 'metric', 'dashboard', 'sparkline'], featured: true,
|
|
496
|
+
usage: `<KpiStatTile label="MRR" value="$84,210" change={12.4} period="vs last month" trend={[52, 60, 63, 72, 84]} />
|
|
497
|
+
<KpiStatTile label="Churn" value="2.3%" change={-0.6} invert variant="solid" size="sm" />`,
|
|
498
|
+
}),
|
|
499
|
+
chart({
|
|
500
|
+
slug: 'kpi-trend-grid', name: 'KPI Trend Grid', file: 'KpiTrendGrid.astro',
|
|
501
|
+
description: 'Responsive grid of KPI tiles with sparklines; the classic top row of an analytics dashboard.',
|
|
502
|
+
tags: ['kpi', 'dashboard', 'grid', 'overview'],
|
|
503
|
+
usage: `<KpiTrendGrid
|
|
504
|
+
metrics={[
|
|
505
|
+
{ label: 'Revenue', value: '$128.4k', change: 9.2, trend: [80, 90, 96, 110, 128] },
|
|
506
|
+
{ label: 'Churn', value: '2.3%', change: -0.6, invert: true },
|
|
507
|
+
]}
|
|
508
|
+
/>`,
|
|
509
|
+
}),
|
|
510
|
+
chart({
|
|
511
|
+
slug: 'meter-gauge', name: 'Meter Gauge', file: 'MeterGauge.astro',
|
|
512
|
+
description: 'Speedometer dial with labelled status zones and an animated needle for live readings.',
|
|
513
|
+
tags: ['gauge', 'meter', 'speedometer', 'threshold'],
|
|
514
|
+
usage: `<MeterGauge
|
|
515
|
+
title="CPU load" value={68} unit="%"
|
|
516
|
+
zones={[
|
|
517
|
+
{ to: 60, label: 'Healthy', tone: 'good' },
|
|
518
|
+
{ to: 85, label: 'Elevated', tone: 'warn' },
|
|
519
|
+
{ to: 100, label: 'Critical', tone: 'bad' },
|
|
520
|
+
]}
|
|
521
|
+
/>`,
|
|
522
|
+
}),
|
|
523
|
+
chart({
|
|
524
|
+
slug: 'goal-progress-chart', name: 'Goal Progress Chart', file: 'GoalProgressChart.astro',
|
|
525
|
+
description: 'Cumulative progress toward a goal versus the ideal linear pace with an ahead/behind readout.',
|
|
526
|
+
tags: ['goal', 'burnup', 'pace', 'target'],
|
|
527
|
+
usage: `<GoalProgressChart
|
|
528
|
+
periods={['W1', 'W2', 'W3', 'W4', 'W5', 'W6']}
|
|
529
|
+
values={[22, 31, 28]}
|
|
530
|
+
goal={160}
|
|
531
|
+
prefix="$" suffix="k"
|
|
532
|
+
/>`,
|
|
533
|
+
}),
|
|
534
|
+
chart({
|
|
535
|
+
slug: 'retention-cohort-table', name: 'Retention Cohort Table', file: 'RetentionCohortTable.astro',
|
|
536
|
+
description: 'Triangular cohort retention matrix shaded on a single-hue ramp with per-period averages.',
|
|
537
|
+
tags: ['cohort', 'retention', 'saas', 'table', 'heatmap'],
|
|
538
|
+
usage: `<RetentionCohortTable
|
|
539
|
+
cohorts={[
|
|
540
|
+
{ cohort: 'Aug', size: 1720, retention: [100, 71, 57] },
|
|
541
|
+
{ cohort: 'Sep', size: 1890, retention: [100, 73] },
|
|
542
|
+
{ cohort: 'Oct', size: 2050, retention: [100] },
|
|
543
|
+
]}
|
|
544
|
+
/>`,
|
|
545
|
+
}),
|
|
546
|
+
chart({
|
|
547
|
+
slug: 'metric-delta-table', name: 'Metric Delta Table', file: 'MetricDeltaTable.astro',
|
|
548
|
+
description: 'Comparison table with inline bars, current vs previous values, signed deltas and sparklines.',
|
|
549
|
+
tags: ['table', 'comparison', 'delta', 'sparkline'],
|
|
550
|
+
usage: `<MetricDeltaTable
|
|
551
|
+
rows={[
|
|
552
|
+
{ label: 'Organic', current: 4820, previous: 4310, trend: [30, 34, 38, 44, 48] },
|
|
553
|
+
{ label: 'Paid', current: 1310, previous: 1480 },
|
|
554
|
+
]}
|
|
555
|
+
/>`,
|
|
556
|
+
}),
|
|
557
|
+
];
|