Skip to content

Commit 2f991b9

Browse files
AdametherzLabclaude
andcommitted
v0.6.0: Deep Viz — 10 new visualization functions
Add tree, progressBar, calendarHeatmap, brailleSpark, candlestick, timeline, boxDiagram, multiSpark, diffBar, and matrix functions. 35+ functions total, 100 new tests (194 passing), zero deps. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 16c6b8d commit 2f991b9

6 files changed

Lines changed: 1629 additions & 33 deletions

File tree

README.md

Lines changed: 171 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# webhook-spark
22

3-
**Zero-dep sparklines, gauges, kaomoji, heatmaps, tables, histograms, social media content & posting for Discord/Slack/Telegram/Bluesky/X, LCD screens, IoT & AI agents.**
3+
**[Live Demo](https://che0md.tech/webhook-spark)**
44

5-
Zero dependencies. TypeScript first. Under 25KB.
5+
**Zero-dep sparklines, gauges, kaomoji, heatmaps, tables, histograms, trees, braille charts, candlesticks, flowcharts, timelines, dot-matrix displays & social posting for Discord/Slack/Telegram/Bluesky/X, LCD screens, IoT & AI agents.**
6+
7+
35+ functions. Zero dependencies. TypeScript first. Under 40KB.
68

79
## Who is this for?
810

@@ -321,6 +323,165 @@ const result = await postToX("Server status: all green!", {
321323
// => { success: true, platform: "x", postUrl: "https://x.com/i/status/..." }
322324
```
323325

326+
### `tree(nodes, options?)` -- ASCII Tree / Hierarchy
327+
328+
Folder structures, dependency graphs, org charts. 4 styles: `ascii`, `rounded`, `bold`, `double`.
329+
330+
```typescript
331+
tree([
332+
{ label: "src", children: [
333+
{ label: "index.ts" },
334+
{ label: "sparkline.ts" },
335+
]},
336+
{ label: "package.json" },
337+
]);
338+
// => ├── src
339+
// │ ├── index.ts
340+
// │ └── sparkline.ts
341+
// └── package.json
342+
```
343+
344+
### `progressBar(steps, options?)` -- Multi-Step Pipeline
345+
346+
CI/CD pipelines, deployment status. 4 styles: `line`, `dots`, `blocks`, `arrows`.
347+
348+
```typescript
349+
progressBar([
350+
{ label: "Build", status: "done" },
351+
{ label: "Test", status: "done" },
352+
{ label: "Deploy", status: "active" },
353+
{ label: "Monitor", status: "pending" },
354+
]);
355+
// => ✅ Build ▸ ✅ Test ▸ 🔄 Deploy ▸ ⬜ Monitor
356+
```
357+
358+
### `calendarHeatmap(data, options?)` -- GitHub-Style Contribution Grid
359+
360+
365-day activity grid with month/day labels using date-indexed entries.
361+
362+
```typescript
363+
calendarHeatmap([
364+
{ date: "2025-01-06", value: 3 },
365+
{ date: "2025-01-07", value: 8 },
366+
{ date: "2025-01-08", value: 1 },
367+
// ...
368+
], { showMonths: true, showDays: true });
369+
// => Jan
370+
// Mo ░▓
371+
// Tu ░
372+
// ...
373+
```
374+
375+
### `brailleSpark(values, options?)` -- Hi-Res Braille Sparkline
376+
377+
2x horizontal + 4x vertical resolution via Braille Unicode (U+2800-U+28FF).
378+
379+
```typescript
380+
brailleSpark([1, 3, 5, 7, 9, 7, 5, 3, 1]);
381+
// => ⠀⠐⠠⡀⠄⠂⠈⠀ (single row braille dots)
382+
383+
brailleSpark([1, 5, 10, 5, 1], { height: 2, filled: true });
384+
// => Multi-row filled area braille chart
385+
```
386+
387+
### `candlestick(candles, options?)` -- OHLC Financial Chart
388+
389+
Stock/crypto candlestick charts with bull/bear rendering.
390+
391+
```typescript
392+
candlestick([
393+
{ open: 10, high: 15, low: 5, close: 12 },
394+
{ open: 12, high: 18, low: 10, close: 8 },
395+
{ open: 8, high: 14, low: 6, close: 13 },
396+
], { height: 10 });
397+
// => │
398+
// █ │ │
399+
// █ ░ █
400+
// │ ░ █
401+
// │ │
402+
```
403+
404+
### `timeline(events, options?)` -- Gantt / Timeline Chart
405+
406+
Project scheduling with start/duration offsets and scale labels.
407+
408+
```typescript
409+
timeline([
410+
{ label: "Build", start: 0, duration: 5 },
411+
{ label: "Test", start: 5, duration: 5 },
412+
{ label: "Deploy", start: 10, duration: 5 },
413+
], { unit: "days" });
414+
// => 0 4 8 12 15 days
415+
// Build ████████░░░░░░░░░░░░
416+
// Test ░░░░░░░░████████░░░░
417+
// Deploy ░░░░░░░░░░░░░░░░████
418+
```
419+
420+
### `boxDiagram(boxes, options?)` -- Box-and-Arrow Flowchart
421+
422+
Linear flow diagrams. 4 border styles, horizontal or vertical.
423+
424+
```typescript
425+
boxDiagram([
426+
{ label: "Ingest" },
427+
{ label: "Transform" },
428+
{ label: "Load" },
429+
], { style: "rounded" });
430+
// => ╭───────────╮ ──▶ ╭───────────╮ ──▶ ╭───────────╮
431+
// │ Ingest │ │ Transform │ │ Load │
432+
// ╰───────────╯ ╰───────────╯ ╰───────────╯
433+
```
434+
435+
### `multiSpark(series, options?)` -- Multi-Series Sparklines
436+
437+
Aligned labeled sparklines for comparing metrics.
438+
439+
```typescript
440+
multiSpark([
441+
{ label: "CPU", values: [10, 30, 50, 70, 90], unit: "%" },
442+
{ label: "Memory", values: [40, 45, 50, 55, 60], unit: "%" },
443+
{ label: "Disk", values: [10, 10, 11, 11, 12], unit: "%" },
444+
]);
445+
// => CPU ▁▃▅▇█ peak=90%
446+
// Memory ▁▂▅▇█ peak=60%
447+
// Disk ▁▁▁▁█ peak=12%
448+
```
449+
450+
### `diffBar(items, options?)` -- Diverging / Butterfly Bar Chart
451+
452+
Before/after comparison with centered axis.
453+
454+
```typescript
455+
diffBar([
456+
{ label: "CPU", before: 60, after: 85 },
457+
{ label: "Mem", before: 80, after: 75 },
458+
{ label: "Disk", before: 50, after: 50 },
459+
]);
460+
// => CPU ███████▕█████████ 60→85 ↑42%
461+
// Mem █████████▕████████ 80→75 ↓6%
462+
// Disk ██████▕██████ 50→50 →0%
463+
```
464+
465+
### `matrix(text, options?)` -- LED Dot Matrix Display
466+
467+
Big text using embedded 3x5 font tables. 3 styles: `blocks`, `dots`, `braille`.
468+
469+
```typescript
470+
matrix("HELLO");
471+
// => █ █ ███ █ █ ▀█▀
472+
// █ █ █ █ █ █ █
473+
// ███ ██ █ █ █ █
474+
// █ █ █ █ █ █ █
475+
// █ █ ███ ███ ███ ▀█▀
476+
477+
matrix("HI", { style: "dots" });
478+
// => ● ● ●●●
479+
// ● ● ●
480+
// ●●● ●●
481+
// ● ● ●
482+
// ● ● ●●●
483+
```
484+
324485
## Use Case Gallery
325486

326487
### IoT Greenhouse Dashboard
@@ -426,17 +587,20 @@ const description = socialCaption([
426587
|---------|:---:|:---:|:---:|:---:|
427588
| Zero deps | Yes | No (17) | No (4) | No (11) |
428589
| Sparklines | Yes | Yes | No | No |
590+
| Braille sparklines | Yes | No | No | No |
429591
| Gauges | Yes | Yes | No | No |
430592
| Kaomoji | Yes | No | No | No |
431593
| Heatmaps | Yes | Yes | No | No |
594+
| Calendar heatmap | Yes | No | No | No |
432595
| Tables | Yes | No | Yes | No |
433596
| Histograms | Yes | Yes | No | No |
434-
| Comparisons | Yes | No | No | No |
435-
| Webhooks | Yes | No | No | No |
597+
| Candlestick charts | Yes | No | No | No |
598+
| Trees / hierarchies | Yes | Yes | No | No |
599+
| Flowcharts | Yes | No | No | No |
600+
| Timelines / Gantt | Yes | No | No | No |
601+
| Dot matrix display | Yes | No | No | No |
436602
| Social posting | Yes (X + Bluesky) | No | No | No |
437-
| Thread splitter | Yes | No | No | No |
438-
| #BuildInPublic | Yes | No | No | No |
439-
| Bundle size | <25KB | 2.5MB | 180KB | 400KB |
603+
| Bundle size | <40KB | 2.5MB | 180KB | 400KB |
440604
| Maintained | Yes | No | Minimal | Yes |
441605

442606
## License

package.json

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@adametherzlab/webhook-spark",
3-
"version": "0.5.0",
4-
"description": "Zero-dep sparklines, gauges, kaomoji, heatmaps, tables, histograms, social media content & posting for Discord/Slack/Telegram/Bluesky/X, LCD, IoT & AI agents.",
3+
"version": "0.6.0",
4+
"description": "Zero-dep sparklines, gauges, kaomoji, heatmaps, tables, histograms, trees, braille charts, candlesticks, flowcharts, dot-matrix & social posting for Discord/Slack/Telegram/Bluesky/X, LCD, IoT & AI agents.",
55
"type": "module",
66
"main": "src/index.ts",
77
"module": "src/index.ts",
@@ -29,28 +29,20 @@
2929
"kaomoji",
3030
"heatmap",
3131
"histogram",
32-
"ascii-table",
33-
"terminal-dashboard",
34-
"cli-visualization",
35-
"lcd",
36-
"oled",
37-
"iot",
38-
"ai-agent",
39-
"discord-webhook",
40-
"telegram-bot",
41-
"arduino",
42-
"raspberry-pi",
32+
"ascii-tree",
33+
"progress-bar",
34+
"calendar-heatmap",
35+
"braille-chart",
36+
"candlestick-chart",
37+
"gantt-chart",
38+
"flowchart",
39+
"box-diagram",
40+
"dot-matrix",
41+
"led-display",
4342
"zero-dependency",
44-
"social-media",
45-
"bluesky",
46-
"twitter-api",
47-
"content-generator",
48-
"build-in-public",
49-
"typescript",
50-
"bun",
51-
"homelab",
52-
"devops",
53-
"monitoring"
43+
"cli-visualization",
44+
"terminal-dashboard",
45+
"typescript"
5446
],
5547
"author": "AdametherzLab",
5648
"license": "MIT",

src/index.ts

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,29 @@ import type {
4545
BlueskyConfig,
4646
XConfig,
4747
SocialPostResult,
48+
TreeNode,
49+
TreeStyle,
50+
TreeOptions,
51+
ProgressStep,
52+
ProgressBarStyle,
53+
ProgressBarOptions,
54+
CalendarEntry,
55+
CalendarHeatmapOptions,
56+
BrailleSparkOptions,
57+
CandleData,
58+
CandlestickOptions,
59+
TimelineEvent,
60+
TimelineOptions,
61+
BoxNode,
62+
BoxDiagramStyle,
63+
BoxDiagramOptions,
64+
SparkSeries,
65+
MultiSparkOptions,
66+
DiffBarItem,
67+
DiffBarOptions,
68+
MatrixOptions,
4869
} from "./types.js";
49-
import { generateSparkline, generateSparklineWithOutliers, generateASCIIArt, spark, barChart, trend, gauge, stats, sparkWithStatus, dashboard, kaomoji, kaomojiAll, kaomojiStatus, kaomojiThemes, heatmap, miniTable, kvTable, histogram, compare, socialFormat, thread, buildInPublic, socialCaption } from "./sparkline.js";
70+
import { generateSparkline, generateSparklineWithOutliers, generateASCIIArt, spark, barChart, trend, gauge, stats, sparkWithStatus, dashboard, kaomoji, kaomojiAll, kaomojiStatus, kaomojiThemes, heatmap, miniTable, kvTable, histogram, compare, socialFormat, thread, buildInPublic, socialCaption, tree, progressBar, calendarHeatmap, brailleSpark, candlestick, timeline, boxDiagram, multiSpark, diffBar, matrix } from "./sparkline.js";
5071
import { sendWebhook } from "./webhook.js";
5172
import { postToBluesky, postToX } from "./social.js";
5273
import { isNumericArray, isSparklineConfig, isWebhookConfig } from "./types.js";
@@ -81,6 +102,16 @@ export {
81102
isNumericArray,
82103
isSparklineConfig,
83104
isWebhookConfig,
105+
tree,
106+
progressBar,
107+
calendarHeatmap,
108+
brailleSpark,
109+
candlestick,
110+
timeline,
111+
boxDiagram,
112+
multiSpark,
113+
diffBar,
114+
matrix,
84115
};
85116
export type {
86117
SparklineConfig,
@@ -129,4 +160,25 @@ export type {
129160
BlueskyConfig,
130161
XConfig,
131162
SocialPostResult,
132-
};
163+
TreeNode,
164+
TreeStyle,
165+
TreeOptions,
166+
ProgressStep,
167+
ProgressBarStyle,
168+
ProgressBarOptions,
169+
CalendarEntry,
170+
CalendarHeatmapOptions,
171+
BrailleSparkOptions,
172+
CandleData,
173+
CandlestickOptions,
174+
TimelineEvent,
175+
TimelineOptions,
176+
BoxNode,
177+
BoxDiagramStyle,
178+
BoxDiagramOptions,
179+
SparkSeries,
180+
MultiSparkOptions,
181+
DiffBarItem,
182+
DiffBarOptions,
183+
MatrixOptions,
184+
};

0 commit comments

Comments
 (0)