Skip to content

Commit a8bf4be

Browse files
Merge pull request #91 from themashcodee/claude/wizardly-turing-k9ucct
Support the new Slack data visualization block (line, bar, area, pie)
2 parents bb2b269 + 9f2af7f commit a8bf4be

8 files changed

Lines changed: 1360 additions & 17 deletions

File tree

playground/src/fixtures.ts

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,4 +238,119 @@ export const FIXTURES: Fixture[] = [
238238
},
239239
],
240240
},
241+
{
242+
id: "data-visualization",
243+
label: "Data visualization · charts",
244+
blocks: [
245+
{
246+
type: "data_visualization",
247+
block_id: "viz-line-multi",
248+
title: "Weekly active users by platform",
249+
chart: {
250+
type: "line",
251+
series: [
252+
{
253+
name: "Desktop",
254+
data: [
255+
{ label: "Mon", value: 800 },
256+
{ label: "Tue", value: 920 },
257+
{ label: "Wed", value: 880 },
258+
{ label: "Thu", value: 1010 },
259+
{ label: "Fri", value: 1120 },
260+
],
261+
},
262+
{
263+
name: "Mobile",
264+
data: [
265+
{ label: "Mon", value: 400 },
266+
{ label: "Tue", value: 530 },
267+
{ label: "Wed", value: 500 },
268+
{ label: "Thu", value: 590 },
269+
{ label: "Fri", value: 600 },
270+
],
271+
},
272+
],
273+
axis_config: {
274+
categories: ["Mon", "Tue", "Wed", "Thu", "Fri"],
275+
x_label: "Day",
276+
y_label: "Users",
277+
},
278+
},
279+
},
280+
{
281+
type: "data_visualization",
282+
block_id: "viz-bar-negative",
283+
title: "Net headcount change",
284+
chart: {
285+
type: "bar",
286+
series: [
287+
{
288+
name: "Delta",
289+
data: [
290+
{ label: "Mon", value: 4 },
291+
{ label: "Tue", value: -2 },
292+
{ label: "Wed", value: 6 },
293+
{ label: "Thu", value: -1 },
294+
{ label: "Fri", value: 3 },
295+
],
296+
},
297+
],
298+
axis_config: {
299+
categories: ["Mon", "Tue", "Wed", "Thu", "Fri"],
300+
x_label: "Day",
301+
y_label: "People (delta)",
302+
},
303+
},
304+
},
305+
{
306+
type: "data_visualization",
307+
block_id: "viz-area-multi",
308+
title: "Concurrent users by platform",
309+
chart: {
310+
type: "area",
311+
series: [
312+
{
313+
name: "Desktop",
314+
data: [
315+
{ label: "Mon", value: 2800 },
316+
{ label: "Tue", value: 3000 },
317+
{ label: "Wed", value: 3400 },
318+
{ label: "Thu", value: 3200 },
319+
{ label: "Fri", value: 3500 },
320+
],
321+
},
322+
{
323+
name: "Mobile",
324+
data: [
325+
{ label: "Mon", value: 1400 },
326+
{ label: "Tue", value: 1500 },
327+
{ label: "Wed", value: 1700 },
328+
{ label: "Thu", value: 1600 },
329+
{ label: "Fri", value: 1800 },
330+
],
331+
},
332+
],
333+
axis_config: {
334+
categories: ["Mon", "Tue", "Wed", "Thu", "Fri"],
335+
x_label: "Day",
336+
y_label: "Users",
337+
},
338+
},
339+
},
340+
{
341+
type: "data_visualization",
342+
block_id: "viz-pie-multi",
343+
title: "Plan distribution by tier",
344+
chart: {
345+
type: "pie",
346+
segments: [
347+
{ label: "Free", value: 4200 },
348+
{ label: "Pro", value: 2300 },
349+
{ label: "Business+", value: 1100 },
350+
{ label: "Enterprise", value: 480 },
351+
],
352+
},
353+
},
354+
],
355+
},
241356
];

readme.md

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -125,23 +125,27 @@ const blocks: Block[] = [
125125

126126
## Supported Blocks
127127

128-
| Block Type | Status | Notes |
129-
| --------------- | ------- | ------------------------------------------------------------ |
130-
| Section | ✅ Full | Text, fields, accessories, `expand` property |
131-
| Divider | ✅ Full | Horizontal divider |
132-
| Image | ✅ Full | Collapsible with alt text, `slack_file` support |
133-
| Context | ✅ Full | Images and text elements |
134-
| Header | ✅ Full | Large bold text |
135-
| Rich Text | ✅ Full | Lists, quotes, preformatted, sections, color elements |
136-
| Video | ✅ Full | Collapsible video embed |
137-
| Table | ✅ Full | Rows, columns, alignment |
138-
| Actions | ✅ Full | All interactive element types supported |
139-
| Input | ✅ Full | All input element types supported |
140-
| File | ✅ Full | Remote file display |
141-
| Context Actions | ✅ Full | Feedback buttons and icon buttons |
142-
| Markdown | ✅ Full | Standard markdown with GFM (tables, task lists, code blocks) |
143-
| Plan | ✅ Full | Sequential task display with status indicators |
144-
| Task Card | ✅ Full | Individual task with title, details, output, sources, status |
128+
| Block Type | Status | Notes |
129+
| ------------------ | ------- | ------------------------------------------------------------ |
130+
| Section | ✅ Full | Text, fields, accessories, `expand` property |
131+
| Divider | ✅ Full | Horizontal divider |
132+
| Image | ✅ Full | Collapsible with alt text, `slack_file` support |
133+
| Context | ✅ Full | Images and text elements |
134+
| Header | ✅ Full | Large bold text with `level` (H1–H4) heading sizes |
135+
| Rich Text | ✅ Full | Lists, quotes, preformatted, sections, color elements |
136+
| Video | ✅ Full | Collapsible video embed |
137+
| Table | ✅ Full | Rows, columns, alignment |
138+
| Actions | ✅ Full | All interactive element types supported |
139+
| Input | ✅ Full | All input element types supported |
140+
| File | ✅ Full | Remote file display |
141+
| Context Actions | ✅ Full | Feedback buttons and icon buttons |
142+
| Markdown | ✅ Full | Standard markdown with GFM (tables, task lists, code blocks) |
143+
| Alert | ✅ Full | Status banner with info / warning / error / success levels |
144+
| Card | ✅ Full | Title, subtitle, body, image, icon, and action buttons |
145+
| Carousel | ✅ Full | Horizontally-scrollable gallery of up to 10 cards |
146+
| Plan | ✅ Full | Sequential task display with status indicators |
147+
| Task Card | ✅ Full | Individual task with title, details, output, sources, status |
148+
| Data Visualization | ✅ Full | Line, bar, area, and pie charts; legend, axes, table & CSV |
145149

146150
## Supported Elements
147151

@@ -408,11 +412,16 @@ import type {
408412
InputBlock,
409413
RichTextBlock,
410414
VideoBlock,
415+
TableBlock,
411416
FileBlock,
412417
ContextActionsBlock,
413418
MarkdownBlock,
414419
PlanBlock,
415420
TaskCardBlock,
421+
AlertBlock,
422+
CardBlock,
423+
CarouselBlock,
424+
DataVisualizationBlock,
416425

417426
// Element types
418427
ButtonElement,

0 commit comments

Comments
 (0)