vizmatic 0.1.32 → 0.1.33
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/PROMPT.md +41 -41
- package/README.md +37 -264
- package/dist/cli.js +248 -78
- package/dist/index.cjs +20 -10
- package/dist/index.js +20 -10
- package/examples/agent-pipeline.tsx +7 -7
- package/examples/animated-pipeline.tsx +8 -8
- package/examples/building-blocks.tsx +7 -7
- package/examples/embedding-map.tsx +1 -1
- package/examples/engineering-flow.tsx +5 -5
- package/examples/eval-dashboard.tsx +5 -5
- package/examples/model-router.tsx +6 -6
- package/examples/presentation-frame.tsx +11 -11
- package/examples/release-card.tsx +9 -9
- package/examples/research-landscape.tsx +5 -5
- package/examples/theme-background.tsx +1 -1
- package/examples/transparent-badge.tsx +1 -1
- package/examples/vizmatic-hero.tsx +6 -6
- package/package.json +4 -4
package/PROMPT.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Vizmatic agent prompt
|
|
2
2
|
|
|
3
|
-
Use Vizmatic to create
|
|
3
|
+
Use Vizmatic to create diagrams, figures, dashboards, presentation frames, and animated GIFs from React scene primitives. Render dark and light files locally or in CI.
|
|
4
4
|
|
|
5
5
|
## Quick start
|
|
6
6
|
|
|
7
|
-
Vizmatic requires Node.js 20 or newer. Install the CLI
|
|
7
|
+
Vizmatic requires Node.js 20 or newer. Install the CLI:
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
10
|
npm install -g vizmatic
|
|
@@ -31,33 +31,33 @@ Render dark and light assets:
|
|
|
31
31
|
vizmatic ./frame.tsx --out ./dist/frames --theme dark,light
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
Check the scene before publishing:
|
|
35
35
|
|
|
36
36
|
```bash
|
|
37
37
|
vizmatic check ./frame.tsx --theme dark,light --json
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
Fix errors before
|
|
40
|
+
Fix all errors before the final render. Warnings report low contrast and asset fallbacks. Overflow errors name the affected edges and suggest dimensions.
|
|
41
41
|
|
|
42
|
-
##
|
|
42
|
+
## Install in a project
|
|
43
43
|
|
|
44
44
|
Use the package manager already present in the project.
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
Add Vizmatic to a project for scripts, editor types, or direct renderer APIs:
|
|
47
47
|
|
|
48
48
|
```bash
|
|
49
49
|
pnpm add vizmatic react
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
To use the current GitHub version:
|
|
53
53
|
|
|
54
54
|
```bash
|
|
55
55
|
pnpm add github:bvolpato/vizmatic react
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
Use the equivalent command for npm, Yarn, or Bun projects.
|
|
59
59
|
|
|
60
|
-
##
|
|
60
|
+
## Full frame example
|
|
61
61
|
|
|
62
62
|
Create `frames/agent-pipeline.tsx`:
|
|
63
63
|
|
|
@@ -67,7 +67,7 @@ height = 560;
|
|
|
67
67
|
|
|
68
68
|
<Scene
|
|
69
69
|
title="Agent visual pipeline"
|
|
70
|
-
subtitle="prompt -> scene
|
|
70
|
+
subtitle="prompt -> TSX scene -> render -> files"
|
|
71
71
|
gap={26}
|
|
72
72
|
>
|
|
73
73
|
<Flow
|
|
@@ -91,32 +91,32 @@ height = 560;
|
|
|
91
91
|
},
|
|
92
92
|
{
|
|
93
93
|
eyebrow: "render",
|
|
94
|
-
title: "
|
|
95
|
-
subtitle: "
|
|
94
|
+
title: "Node renderer",
|
|
95
|
+
subtitle: "headless output",
|
|
96
96
|
tone: "cyan",
|
|
97
|
-
lines: ["layout
|
|
97
|
+
lines: ["layout", "theme", "checks"],
|
|
98
98
|
width: 190,
|
|
99
99
|
},
|
|
100
100
|
{
|
|
101
101
|
eyebrow: "output",
|
|
102
|
-
title: "PNG / GIF",
|
|
103
|
-
subtitle: "
|
|
102
|
+
title: "PNG / SVG / GIF",
|
|
103
|
+
subtitle: "rendered files",
|
|
104
104
|
tone: "green",
|
|
105
|
-
lines: ["
|
|
105
|
+
lines: ["dark + light", "alpha", "manifest"],
|
|
106
106
|
width: 190,
|
|
107
107
|
},
|
|
108
108
|
]}
|
|
109
109
|
/>
|
|
110
110
|
<Row width="100%" gap={14}>
|
|
111
111
|
<CalloutCard
|
|
112
|
-
title="
|
|
113
|
-
detail="
|
|
112
|
+
title="Use scene primitives"
|
|
113
|
+
detail="Common diagrams do not need hand-written SVG paths or x/y coordinates."
|
|
114
114
|
tone="purple"
|
|
115
115
|
width={470}
|
|
116
116
|
/>
|
|
117
117
|
<CalloutCard
|
|
118
|
-
title="
|
|
119
|
-
detail="
|
|
118
|
+
title="Use theme tokens"
|
|
119
|
+
detail="Tokens set color, typography, radius, spacing, and contrast."
|
|
120
120
|
tone="green"
|
|
121
121
|
width={470}
|
|
122
122
|
/>
|
|
@@ -130,9 +130,9 @@ Render it:
|
|
|
130
130
|
vizmatic frames --out public/vizmatic --theme dark,light --watermark "Your Product" --watermark-image ./logo.svg --watermark-position top-right
|
|
131
131
|
```
|
|
132
132
|
|
|
133
|
-
|
|
133
|
+
Generated `manifest.json` includes each output file plus its theme, path, width, and height.
|
|
134
134
|
|
|
135
|
-
PNG and SVG renders
|
|
135
|
+
PNG and SVG renders have transparent backgrounds by default. Use the theme background when the image needs an opaque canvas:
|
|
136
136
|
|
|
137
137
|
```bash
|
|
138
138
|
vizmatic frames --out public/vizmatic --theme dark,light --background theme
|
|
@@ -146,11 +146,11 @@ Or set it in the frame:
|
|
|
146
146
|
</Scene>
|
|
147
147
|
```
|
|
148
148
|
|
|
149
|
-
|
|
149
|
+
When a CLI frame omits `width` or `height`, Vizmatic starts at `960x540` and grows that axis if content overflows. Set `autoSize = false` when dimensions must remain fixed and clipping should fail the render.
|
|
150
150
|
|
|
151
|
-
|
|
151
|
+
Bare CLI frames do not need imports, `defineIllustration`, or `c` props. Use `c` for explicit tokens such as `background={c.bg}`. `Scene` title and subtitle are optional. Use a full module for other dependencies, reusable helpers, animation exports, or direct renderer APIs.
|
|
152
152
|
|
|
153
|
-
Frame modules can
|
|
153
|
+
Frame modules can export a watermark element instead of using CLI flags:
|
|
154
154
|
|
|
155
155
|
```tsx
|
|
156
156
|
import { Watermark } from "vizmatic"
|
|
@@ -179,9 +179,9 @@ Render animated frames with `createScenes(theme)`:
|
|
|
179
179
|
vizmatic gif frames/animated-pipeline.tsx --out public/vizmatic --theme dark,light --watermark "Your Product" --watermark-image ./logo.svg --watermark-position top-right --scale 1
|
|
180
180
|
```
|
|
181
181
|
|
|
182
|
-
##
|
|
182
|
+
## Animated frames
|
|
183
183
|
|
|
184
|
-
|
|
184
|
+
An animated module exports `createScenes(theme)` for GIF output and keeps `create(theme)` for a static frame.
|
|
185
185
|
|
|
186
186
|
```tsx
|
|
187
187
|
import React from "react"
|
|
@@ -236,9 +236,9 @@ export const create = frame.create
|
|
|
236
236
|
export default frame.default
|
|
237
237
|
```
|
|
238
238
|
|
|
239
|
-
##
|
|
239
|
+
## Choose primitives
|
|
240
240
|
|
|
241
|
-
Use Vizmatic primitives
|
|
241
|
+
Use Vizmatic primitives for common layouts. Use raw SVG only for geometry the component set cannot express.
|
|
242
242
|
|
|
243
243
|
Shared values:
|
|
244
244
|
|
|
@@ -247,8 +247,8 @@ Shared values:
|
|
|
247
247
|
- `ColorName`: `"primary" | "secondary" | "positive" | "warning" | "critical" | "info" | "accent" | "neutral"`.
|
|
248
248
|
- `FlexAlign`: `"start" | "center" | "end" | "stretch"`.
|
|
249
249
|
- `FlexJustify`: `"start" | "center" | "end" | "space-between" | "space-around"`.
|
|
250
|
-
-
|
|
251
|
-
-
|
|
250
|
+
- Bare CLI frames omit `c` props. The local `c` object remains available for explicit values such as `background={c.bg}`.
|
|
251
|
+
- Full modules pass the `c: ThemeColors` value from `defineIllustration((c) => ...)` to visual components.
|
|
252
252
|
- PNG/SVG renders are alpha-transparent by default. Use `--background theme`, `background: "theme"`, or `<Scene background={c.bg}>` for opaque theme fill.
|
|
253
253
|
- Omitted CLI dimensions auto-grow on overflow. Explicit `width` / `height` remain fixed and fail on clipping.
|
|
254
254
|
|
|
@@ -447,20 +447,20 @@ height = 560;
|
|
|
447
447
|
</Scene>
|
|
448
448
|
```
|
|
449
449
|
|
|
450
|
-
##
|
|
450
|
+
## Rendering rules
|
|
451
451
|
|
|
452
452
|
- Use semantic tones instead of hard-coded colors: `blue`, `purple`, `green`, `warm`, `cyan`, `pink`, `critical`, `ocean`, `neutral`.
|
|
453
453
|
- For Datadog Engineering-style article diagrams, set `preset = "engineering";` and render the light theme. Keep each figure focused on one transition or tradeoff.
|
|
454
|
-
-
|
|
455
|
-
-
|
|
454
|
+
- Use explicit sizes for final assets. Common sizes are `1040x560` for article figures, `1280x720` for slide frames, and `900x520` for compact diagrams.
|
|
455
|
+
- During exploration, dimensions can be omitted. Vizmatic starts at `960x540` and grows to fit content.
|
|
456
456
|
- Prefer alpha-transparent PNG/SVG backgrounds for blog embeds and docs cards. Use theme backgrounds only when the host surface is unknown or needs full-frame fill.
|
|
457
|
-
- Use `width`, `minWidth`, `height`, `minHeight`, `gap`, and `padding`
|
|
457
|
+
- Use `width`, `minWidth`, `height`, `minHeight`, `gap`, and `padding` to keep layout stable.
|
|
458
458
|
- Keep text short. Use `TextLabel`, `Panel`, `StepCard`, `MetricCard`, `DataTable`, and `Grid` for wrapping-safe labels.
|
|
459
|
-
- Render
|
|
459
|
+
- Render reusable assets in both themes with `--theme dark,light`.
|
|
460
460
|
- Run `vizmatic check <frame> --theme dark,light --json` before final render and fix every error.
|
|
461
461
|
- Use GIF only when motion explains state change. Keep scenes short, export `createScenes(theme)`, and keep a static `create(theme)` fallback.
|
|
462
|
-
- If render fails with `Canvas overflow detected`, the
|
|
463
|
-
-
|
|
462
|
+
- If render fails with `Canvas overflow detected`, increase the canvas, reduce content, or remove strict sizing. Do not ignore the error.
|
|
463
|
+
- Confirm generated files exist and open at least one image before finishing.
|
|
464
464
|
|
|
465
465
|
## Common recipes
|
|
466
466
|
|
|
@@ -470,7 +470,7 @@ height = 560;
|
|
|
470
470
|
width = 1040;
|
|
471
471
|
height = 560;
|
|
472
472
|
|
|
473
|
-
<Scene title="RAG control graph" subtitle="retrieval
|
|
473
|
+
<Scene title="RAG control graph" subtitle="retrieval with a citation check" align="center">
|
|
474
474
|
<GraphDiagram
|
|
475
475
|
width={820}
|
|
476
476
|
height={390}
|
|
@@ -527,9 +527,9 @@ height = 620;
|
|
|
527
527
|
</Scene>
|
|
528
528
|
```
|
|
529
529
|
|
|
530
|
-
## Final
|
|
530
|
+
## Final response
|
|
531
531
|
|
|
532
|
-
After creating a
|
|
532
|
+
After creating a visual, report:
|
|
533
533
|
|
|
534
534
|
- files created or changed
|
|
535
535
|
- render command used
|