vizmatic 0.3.1 → 0.4.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/PROMPT.md +9 -3
- package/README.md +479 -3
- package/dist/chunk-FEIPTPBZ.js +1165 -0
- package/dist/chunk-TH3F4SDB.js +79 -0
- package/dist/cli.js +14 -8
- package/dist/index.cjs +2732 -125
- package/dist/index.d.cts +557 -2
- package/dist/index.d.ts +557 -2
- package/dist/index.js +2026 -559
- package/dist/scene-cli.d.ts +1 -0
- package/dist/scene-cli.js +4 -0
- package/dist/scene-runtime.cjs +930 -0
- package/dist/scene-runtime.d.cts +80 -0
- package/dist/scene-runtime.d.ts +80 -0
- package/dist/scene-runtime.js +20 -0
- package/examples/README.md +4 -0
- package/examples/aurora-incident.tsx +108 -0
- package/examples/daybreak-launch.tsx +81 -0
- package/examples/model-garden.tsx +97 -0
- package/examples/pressure-mechanism.scene.json +14 -0
- package/examples/videos/README.md +28 -0
- package/examples/videos/request-lifecycle.tsx +99 -0
- package/examples/videos/signal-to-story.tsx +126 -0
- package/examples/vizmatic-bare.d.ts +7 -0
- package/examples/weekend-field-notes.tsx +81 -0
- package/package.json +18 -7
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defineAnimation,
|
|
3
|
+
getThemeColors,
|
|
4
|
+
hold,
|
|
5
|
+
tween,
|
|
6
|
+
type ThemeMode,
|
|
7
|
+
} from 'vizmatic'
|
|
8
|
+
|
|
9
|
+
export const width = 1280
|
|
10
|
+
export const height = 720
|
|
11
|
+
|
|
12
|
+
type State = { progress: number }
|
|
13
|
+
|
|
14
|
+
const stages = [
|
|
15
|
+
{ label: '01', title: 'Receive', detail: 'Accept the request', x: 110 },
|
|
16
|
+
{ label: '02', title: 'Process', detail: 'Do the work', x: 490 },
|
|
17
|
+
{ label: '03', title: 'Return', detail: 'Send the result', x: 870 },
|
|
18
|
+
] as const
|
|
19
|
+
|
|
20
|
+
function buildFrame(theme: ThemeMode, progress: number) {
|
|
21
|
+
const c = getThemeColors(theme)
|
|
22
|
+
const markerX = 260 + progress * 760
|
|
23
|
+
const complete = progress > 0.94
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<div style={{
|
|
27
|
+
display: 'flex', position: 'relative', width, height, overflow: 'hidden',
|
|
28
|
+
backgroundColor: c.bg, color: c.textPrimary, fontFamily: c.fontSans,
|
|
29
|
+
}}>
|
|
30
|
+
<div style={{ display: 'flex', position: 'absolute', left: 96, top: 84, flexDirection: 'column', gap: 14 }}>
|
|
31
|
+
<span style={{ color: c.textSecondary, fontFamily: c.fontMono, fontSize: 16, letterSpacing: 2 }}>A REQUEST IN MOTION</span>
|
|
32
|
+
<span style={{ fontSize: 52, fontWeight: 750, letterSpacing: -1.5 }}>One request. Three steps.</span>
|
|
33
|
+
<span style={{ color: c.textSecondary, fontSize: 22 }}>Follow it from arrival to the result.</span>
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
{stages.map((stage, index) => {
|
|
37
|
+
const active = Math.min(2, Math.round(progress * 2)) === index
|
|
38
|
+
return (
|
|
39
|
+
<div key={stage.label} style={{
|
|
40
|
+
display: 'flex', position: 'absolute', left: stage.x, top: 276,
|
|
41
|
+
width: 300, height: 158, flexDirection: 'column', justifyContent: 'center',
|
|
42
|
+
gap: 14, padding: '0 26px', borderRadius: 18,
|
|
43
|
+
backgroundColor: active ? c.bgCard : c.bgCardAlt,
|
|
44
|
+
border: `2px solid ${active ? c.primary : c.borderSubtle}`,
|
|
45
|
+
}}>
|
|
46
|
+
<span style={{ color: active ? c.textPrimary : c.textMuted, fontFamily: c.fontMono, fontSize: 14, letterSpacing: 1.5 }}>{stage.label}</span>
|
|
47
|
+
<span style={{ fontSize: 28, fontWeight: 700 }}>{stage.title}</span>
|
|
48
|
+
<span style={{ color: c.textSecondary, fontSize: 17 }}>{stage.detail}</span>
|
|
49
|
+
</div>
|
|
50
|
+
)
|
|
51
|
+
})}
|
|
52
|
+
|
|
53
|
+
<div style={{ display: 'flex', position: 'absolute', left: 260, top: 510, width: 760, height: 4, backgroundColor: c.borderSubtle }} />
|
|
54
|
+
{[260, 640, 1020].map((x, index) => (
|
|
55
|
+
<div key={x} style={{
|
|
56
|
+
display: 'flex', position: 'absolute', left: x - 7, top: 502,
|
|
57
|
+
width: 18, height: 18, borderRadius: 18,
|
|
58
|
+
backgroundColor: progress >= index / 2 ? c.positive : c.bg,
|
|
59
|
+
border: `2px solid ${progress >= index / 2 ? c.positive : c.borderLight}`,
|
|
60
|
+
}} />
|
|
61
|
+
))}
|
|
62
|
+
|
|
63
|
+
<div style={{
|
|
64
|
+
display: 'flex', position: 'absolute', left: markerX - 66, top: 468,
|
|
65
|
+
minWidth: 132, height: 42, alignItems: 'center', justifyContent: 'center',
|
|
66
|
+
borderRadius: 21, padding: '0 14px', color: c.textOnColor,
|
|
67
|
+
backgroundColor: complete ? c.positiveDark : c.secondaryDark,
|
|
68
|
+
fontFamily: c.fontMono, fontSize: 15, fontWeight: 700,
|
|
69
|
+
}}>{complete ? 'RESULT READY' : 'REQUEST'}</div>
|
|
70
|
+
|
|
71
|
+
<div style={{
|
|
72
|
+
display: 'flex', position: 'absolute', left: 0, right: 0, top: 594,
|
|
73
|
+
justifyContent: 'center', color: c.textPrimary,
|
|
74
|
+
fontSize: 22, fontWeight: complete ? 700 : 500,
|
|
75
|
+
}}>{complete ? 'The result returns to the caller.' : 'The request advances through the workflow.'}</div>
|
|
76
|
+
</div>
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function create(theme: ThemeMode = 'dark') {
|
|
81
|
+
return buildFrame(theme, 1)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function createAnimation(theme: ThemeMode) {
|
|
85
|
+
return defineAnimation<State>({
|
|
86
|
+
initial: { progress: 0 },
|
|
87
|
+
timeline: [
|
|
88
|
+
hold(900, 'Follow the request'),
|
|
89
|
+
tween({ progress: 0.5 }, { duration: 1800, easing: 'ease-in-out', label: 'Process the request' }),
|
|
90
|
+
hold(500, 'Work completes'),
|
|
91
|
+
tween({ progress: 1 }, { duration: 1800, easing: 'ease-in-out', label: 'Return the result' }),
|
|
92
|
+
hold(1600, 'Read the completed workflow'),
|
|
93
|
+
],
|
|
94
|
+
fps: 30,
|
|
95
|
+
render: (state) => buildFrame(theme, state.progress),
|
|
96
|
+
})
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export default create('dark')
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defineAnimation,
|
|
3
|
+
hold,
|
|
4
|
+
parallel,
|
|
5
|
+
pointAlongPath,
|
|
6
|
+
smoothstep,
|
|
7
|
+
tracePolyline,
|
|
8
|
+
tween,
|
|
9
|
+
type ThemeMode,
|
|
10
|
+
} from 'vizmatic'
|
|
11
|
+
|
|
12
|
+
export const width = 1280
|
|
13
|
+
export const height = 720
|
|
14
|
+
|
|
15
|
+
type State = { intro: number; observations: number; trace: number; cursor: number; focus: number; camera: number; outro: number }
|
|
16
|
+
|
|
17
|
+
// Synthetic observations and their least-squares fit, not measured performance.
|
|
18
|
+
const values = [34, 51, 39, 67, 53, 79, 61, 88, 77, 105, 94, 115]
|
|
19
|
+
const meanX = (values.length - 1) / 2
|
|
20
|
+
const meanY = values.reduce((sum, value) => sum + value, 0) / values.length
|
|
21
|
+
export const slope = values.reduce((sum, value, index) => sum + (index - meanX) * (value - meanY), 0)
|
|
22
|
+
/ values.reduce((sum, _, index) => sum + (index - meanX) ** 2, 0)
|
|
23
|
+
const intercept = meanY - slope * meanX
|
|
24
|
+
const plot = { left: 136, top: 284, width: 1008, height: 286 }
|
|
25
|
+
const xAt = (index: number) => plot.left + index * plot.width / (values.length - 1)
|
|
26
|
+
const yAt = (value: number) => plot.top + plot.height - (value - 20) / 110 * plot.height
|
|
27
|
+
const trend = values.map((_, index) => ({ x: xAt(index), y: yAt(intercept + slope * index) }))
|
|
28
|
+
|
|
29
|
+
function buildFrame(theme: ThemeMode, state: State) {
|
|
30
|
+
const dark = theme === 'dark'
|
|
31
|
+
const c = dark
|
|
32
|
+
? { bg: '#0a191e', surface: '#10272e', text: '#edf6ee', muted: '#a4bbbd', line: '#25434a', mint: '#a5f2c6', gold: '#f3ca79', orange: '#ffad8a' }
|
|
33
|
+
: { bg: '#f3f5ec', surface: '#e5ecdf', text: '#17353a', muted: '#506b6c', line: '#cad8ce', mint: '#19744d', gold: '#926317', orange: '#a84d32' }
|
|
34
|
+
const visible = tracePolyline(trend, state.trace)
|
|
35
|
+
const marker = pointAlongPath(trend, state.cursor)
|
|
36
|
+
const chartOpacity = (1 - state.outro) * Math.min(1, state.observations * 4)
|
|
37
|
+
const chapter = state.focus > 0.2 ? '03 / MAKE IT MEAN SOMETHING' : state.trace > 0 ? '02 / REVEAL THE RELATIONSHIP' : '01 / START WITH THE OBSERVATIONS'
|
|
38
|
+
const headline = state.focus > 0.2 ? 'A relationship you can see.' : state.trace > 0 ? 'Let the pattern emerge.' : 'Every point has a story.'
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<div style={{ display: 'flex', position: 'relative', width, height, overflow: 'hidden', backgroundColor: c.bg, color: c.text, fontFamily: 'Inter' }}>
|
|
42
|
+
<div style={{ display: 'flex', position: 'absolute', left: 760, top: 80, width: 520, height: 520, borderRadius: 520, backgroundImage: `radial-gradient(circle, ${c.surface}, ${c.bg})` }} />
|
|
43
|
+
<div style={{ display: 'flex', position: 'absolute', left: 64, top: 38, right: 64, alignItems: 'center', justifyContent: 'space-between' }}>
|
|
44
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: 12, fontSize: 18, fontWeight: 700, letterSpacing: -0.5 }}><span style={{ display: 'flex', width: 12, height: 12, borderRadius: 4, backgroundColor: c.mint, transform: 'rotate(-12deg)' }} />vizmatic</div>
|
|
45
|
+
<span style={{ color: c.muted, fontSize: 12, letterSpacing: 2, fontFamily: 'JetBrains Mono' }}>A STUDY IN MOTION / 001</span>
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
{state.intro > 0 && <div style={{ display: 'flex', position: 'absolute', left: 90, top: 176 - 24 * state.intro, flexDirection: 'column', opacity: state.intro }}>
|
|
49
|
+
<span style={{ color: c.mint, fontFamily: 'JetBrains Mono', fontSize: 14, letterSpacing: 3, marginBottom: 24 }}>FROM NOISE TO SIGNAL</span>
|
|
50
|
+
<div style={{ display: 'flex', flexDirection: 'column', fontSize: 104, fontWeight: 700, lineHeight: 1.06, letterSpacing: -6 }}><span>Make the</span><span style={{ color: c.mint }}>invisible click.</span></div>
|
|
51
|
+
<span style={{ color: c.muted, marginTop: 28, fontSize: 22 }}>One scene. A little math. A story that moves.</span>
|
|
52
|
+
</div>}
|
|
53
|
+
|
|
54
|
+
{chartOpacity > 0 && <div style={{ display: 'flex', position: 'absolute', inset: 0, opacity: chartOpacity, transform: `scale(${1 + state.camera * 0.035})` }}>
|
|
55
|
+
<div style={{ display: 'flex', position: 'absolute', left: 90, top: 124, flexDirection: 'column', gap: 16 }}>
|
|
56
|
+
<span style={{ color: c.mint, fontFamily: 'JetBrains Mono', fontSize: 13, letterSpacing: 2 }}>{chapter}</span>
|
|
57
|
+
<span style={{ fontSize: 47, fontWeight: 700, letterSpacing: -2 }}>{headline}</span>
|
|
58
|
+
</div>
|
|
59
|
+
{[20, 50, 80, 110].map((value) => <div key={value} style={{ display: 'flex', position: 'absolute', left: plot.left, top: yAt(value), width: plot.width, height: 1, backgroundColor: c.line }} />)}
|
|
60
|
+
{[20, 50, 80, 110].map((value) => <span key={`label-${value}`} style={{ position: 'absolute', left: 87, top: yAt(value) - 8, color: c.muted, fontSize: 12, fontFamily: 'JetBrains Mono' }}>{value}</span>)}
|
|
61
|
+
<span style={{ position: 'absolute', left: plot.left, top: 600, color: c.muted, fontSize: 12, fontFamily: 'JetBrains Mono' }}>01</span>
|
|
62
|
+
<span style={{ position: 'absolute', right: 136, top: 600, color: c.muted, fontSize: 12, fontFamily: 'JetBrains Mono' }}>12 OBSERVATIONS</span>
|
|
63
|
+
{values.map((value, index) => {
|
|
64
|
+
const arrival = smoothstep(Math.min(1, Math.max(0, state.observations * 1.9 - index * 0.075)))
|
|
65
|
+
return <div key={index} style={{ display: 'flex', position: 'absolute', left: xAt(index) - 7, top: yAt(value) - 7 + 52 * (1 - arrival), width: 14, height: 14, borderRadius: 14, backgroundColor: c.gold, opacity: arrival * (1 - state.focus * 0.35) }} />
|
|
66
|
+
})}
|
|
67
|
+
{visible.length > 1 && <svg style={{ position: 'absolute', left: 0, top: 0 }} width={width} height={height} viewBox={`0 0 ${width} ${height}`}><polyline points={visible.map(({ x, y }) => `${x},${y}`).join(' ')} fill="none" stroke={c.mint} strokeWidth="5" strokeLinecap="round" strokeLinejoin="round" /></svg>}
|
|
68
|
+
{state.trace > 0 && <div style={{ display: 'flex', position: 'absolute', left: marker.x - 9, top: marker.y - 9, width: 18, height: 18, borderRadius: 18, backgroundColor: c.mint, border: `4px solid ${c.bg}` }} />}
|
|
69
|
+
<div style={{ display: 'flex', position: 'absolute', left: 688, top: 488 - 12 * state.focus, flexDirection: 'column', gap: 9, padding: '18px 24px', borderRadius: 12, backgroundColor: c.surface, opacity: state.focus }}>
|
|
70
|
+
<span style={{ color: c.mint, fontSize: 28, fontWeight: 700 }}>+{slope.toFixed(1)} per observation</span>
|
|
71
|
+
<span style={{ color: c.muted, fontSize: 14 }}>Least-squares trend. Every point still visible.</span>
|
|
72
|
+
</div>
|
|
73
|
+
</div>}
|
|
74
|
+
|
|
75
|
+
{state.outro > 0 && <div style={{ display: 'flex', position: 'absolute', inset: 0, backgroundColor: c.bg, opacity: state.outro, alignItems: 'center', justifyContent: 'center', flexDirection: 'column' }}>
|
|
76
|
+
<span style={{ color: c.mint, fontFamily: 'JetBrains Mono', fontSize: 14, letterSpacing: 3, marginBottom: 26 }}>FROM CODE TO CLARITY</span>
|
|
77
|
+
<span style={{ fontSize: 85, fontWeight: 700, letterSpacing: -5 }}>Give your ideas</span>
|
|
78
|
+
<span style={{ color: c.mint, fontSize: 85, fontWeight: 700, letterSpacing: -5 }}>a little motion.</span>
|
|
79
|
+
<div style={{ display: 'flex', gap: 28, marginTop: 32, color: c.muted, fontSize: 17 }}><span>Editable TSX</span><span style={{ color: c.orange }}>→</span><span>Typed timelines</span><span style={{ color: c.orange }}>→</span><span>Your next film</span></div>
|
|
80
|
+
<span style={{ marginTop: 42, color: c.muted, fontFamily: 'JetBrains Mono', fontSize: 14 }}>vizmatic / bvolpato.github.io/vizmatic</span>
|
|
81
|
+
</div>}
|
|
82
|
+
|
|
83
|
+
<div style={{ display: 'flex', position: 'absolute', left: 64, right: 64, bottom: 32, justifyContent: 'space-between', alignItems: 'center', color: c.muted, fontFamily: 'JetBrains Mono', fontSize: 11 }}>
|
|
84
|
+
<span>DESIGNED IN CODE. RENDERED FRAME BY FRAME.</span><span>SYNTHETIC DATA / REAL MOTION</span>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function createAnimation(theme: ThemeMode = 'dark') {
|
|
91
|
+
return defineAnimation<State>({
|
|
92
|
+
initial: { intro: 0, observations: 0, trace: 0, cursor: 0, focus: 0, camera: 0, outro: 0 },
|
|
93
|
+
timeline: [
|
|
94
|
+
tween({ intro: 1 }, { duration: 700, easing: 'ease-out' }),
|
|
95
|
+
hold(1300, 'Make the invisible click'),
|
|
96
|
+
parallel<State>({
|
|
97
|
+
intro: [tween(0, { duration: 650, easing: 'ease-in-out' })],
|
|
98
|
+
observations: [hold(350), tween(1, { duration: 2050, easing: 'ease-out' })],
|
|
99
|
+
}, 'Collect observations'),
|
|
100
|
+
hold(600),
|
|
101
|
+
parallel<State>({
|
|
102
|
+
trace: [tween(1, { duration: 3600, easing: 'ease-in-out' })],
|
|
103
|
+
cursor: [tween(1, { duration: 3600, easing: 'ease-in-out' })],
|
|
104
|
+
}, 'Reveal the trend'),
|
|
105
|
+
hold(800),
|
|
106
|
+
parallel<State>({
|
|
107
|
+
focus: [tween(1, { duration: 1000, easing: 'ease-out' })],
|
|
108
|
+
camera: [tween(1, { duration: 1600, easing: 'ease-in-out' })],
|
|
109
|
+
}, 'Explain the relationship'),
|
|
110
|
+
hold(2200),
|
|
111
|
+
parallel<State>({
|
|
112
|
+
camera: [tween(0, { duration: 1000, easing: 'ease-in-out' })],
|
|
113
|
+
outro: [hold(400), tween(1, { duration: 1200, easing: 'ease-in-out' })],
|
|
114
|
+
}, 'From code to clarity'),
|
|
115
|
+
hold(3200),
|
|
116
|
+
],
|
|
117
|
+
fps: 20,
|
|
118
|
+
render: (state) => buildFrame(theme, state),
|
|
119
|
+
})
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export function create(theme: ThemeMode = 'dark') {
|
|
123
|
+
return buildFrame(theme, { intro: 1, observations: 0, trace: 0, cursor: 0, focus: 0, camera: 0, outro: 0 })
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export default create('dark')
|
|
@@ -8,9 +8,14 @@ declare global {
|
|
|
8
8
|
var width: number
|
|
9
9
|
var height: number
|
|
10
10
|
var preset: import('../src').ThemePreset
|
|
11
|
+
var background: string
|
|
11
12
|
|
|
12
13
|
const c: import('../src').ThemeColors
|
|
14
|
+
const BadgePill: AutoTheme<typeof import('../src').BadgePill>
|
|
13
15
|
const BarChart: AutoTheme<typeof import('../src').BarChart>
|
|
16
|
+
const Board: AutoTheme<typeof import('../src').Board>
|
|
17
|
+
const CanvasItem: AutoTheme<typeof import('../src').CanvasItem>
|
|
18
|
+
const Card: AutoTheme<typeof import('../src').Card>
|
|
14
19
|
const CalloutCard: AutoTheme<typeof import('../src').CalloutCard>
|
|
15
20
|
const Column: AutoTheme<typeof import('../src').Column>
|
|
16
21
|
const DataTable: AutoTheme<typeof import('../src').DataTable>
|
|
@@ -28,6 +33,8 @@ declare global {
|
|
|
28
33
|
const MetricCard: AutoTheme<typeof import('../src').MetricCard>
|
|
29
34
|
const MiniBarChart: AutoTheme<typeof import('../src').MiniBarChart>
|
|
30
35
|
const Panel: AutoTheme<typeof import('../src').Panel>
|
|
36
|
+
const ParetoBarChart: AutoTheme<typeof import('../src').ParetoBarChart>
|
|
37
|
+
const ParetoChart: AutoTheme<typeof import('../src').ParetoChart>
|
|
31
38
|
const QuadrantChart: AutoTheme<typeof import('../src').QuadrantChart>
|
|
32
39
|
const Row: AutoTheme<typeof import('../src').Row>
|
|
33
40
|
const ScatterPlot: AutoTheme<typeof import('../src').ScatterPlot>
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
width = 1120;
|
|
2
|
+
height = 800;
|
|
3
|
+
background = "theme";
|
|
4
|
+
|
|
5
|
+
// themeColors = {"primary":"#9a3412","primaryLight":"#fdba74","primaryDark":"#7c2d12","secondary":"#0f766e","secondaryLight":"#5eead4","secondaryDark":"#134e4a","positive":"#4d7c0f","positiveLight":"#a3e635","positiveDark":"#365314","warning":"#b45309","warningLight":"#fbbf24","warningDark":"#78350f","info":"#0369a1","infoLight":"#38bdf8","infoDark":"#075985","accent":"#be185d","accentLight":"#f9a8d4"}
|
|
6
|
+
|
|
7
|
+
<Board width={1120} height={800}>
|
|
8
|
+
<CanvasItem x={40} y={28} width={226} height={28}>
|
|
9
|
+
<BadgePill text="THE WEEKENDER / FIELD NOTE 04" tone="warm" filled />
|
|
10
|
+
</CanvasItem>
|
|
11
|
+
<CanvasItem x={40} y={66} width={720} height={46}>
|
|
12
|
+
<TextLabel text="Take the long way through Bellweather." variant="title" fontSize={30} color={c.textPrimary} />
|
|
13
|
+
</CanvasItem>
|
|
14
|
+
<CanvasItem x={40} y={116} width={720} height={36}>
|
|
15
|
+
<TextLabel text="A fictional neighborhood walk · invented stops, scores, and timings" variant="body" fontSize={14} color={c.textSecondary} />
|
|
16
|
+
</CanvasItem>
|
|
17
|
+
<CanvasItem x={822} y={28} width={258} height={112}>
|
|
18
|
+
<MetricCard label="READER RATING" value="4.9 / 5" detail="42 min on foot" tone="green" width={258} minHeight={112} valueFontSize={28} align="left" />
|
|
19
|
+
</CanvasItem>
|
|
20
|
+
|
|
21
|
+
<CanvasItem x={40} y={178} width={694} height={320}>
|
|
22
|
+
<Card title="SAFFRON ROW · 1.8 MILES" subtitle="Four gentle stops from the tram to the old market" tone="warm" width={694} height={320} padding={16}>
|
|
23
|
+
<GraphDiagram
|
|
24
|
+
title="Fictional walking route through Saffron Row"
|
|
25
|
+
ariaLabel="Demo walking route from Juniper Cafe through Glasshouse Garden and Paper Moon Books to Old Market"
|
|
26
|
+
width={660}
|
|
27
|
+
height={225}
|
|
28
|
+
nodeWidth={126}
|
|
29
|
+
nodeHeight={76}
|
|
30
|
+
labelFontSize={13}
|
|
31
|
+
detailFontSize={12}
|
|
32
|
+
routing="orthogonal"
|
|
33
|
+
routingClearance={12}
|
|
34
|
+
nodes={[
|
|
35
|
+
{ id: 'cafe', label: 'Juniper', detail: 'tram stop', x: 0.12, y: 0.25, tone: 'warm', icon: 'globe' },
|
|
36
|
+
{ id: 'garden', label: 'Glasshouse', detail: 'shaded pause', x: 0.37, y: 0.70, tone: 'green', icon: 'bucket' },
|
|
37
|
+
{ id: 'books', label: 'Paper Moon', detail: 'quiet shelves', x: 0.63, y: 0.25, tone: 'purple', icon: 'file' },
|
|
38
|
+
{ id: 'market', label: 'Old Market', detail: 'citrus bun', x: 0.88, y: 0.70, tone: 'cyan', icon: 'check' },
|
|
39
|
+
]}
|
|
40
|
+
edges={[
|
|
41
|
+
{ from: 'cafe', to: 'garden', tone: 'warm' },
|
|
42
|
+
{ from: 'garden', to: 'books', tone: 'green' },
|
|
43
|
+
{ from: 'books', to: 'market', tone: 'cyan' },
|
|
44
|
+
]}
|
|
45
|
+
/>
|
|
46
|
+
</Card>
|
|
47
|
+
</CanvasItem>
|
|
48
|
+
|
|
49
|
+
<CanvasItem x={40} y={518} width={694} height={222}>
|
|
50
|
+
<BarChart
|
|
51
|
+
width={660}
|
|
52
|
+
height={158}
|
|
53
|
+
title="Suggested pause, in demo minutes"
|
|
54
|
+
format="integer"
|
|
55
|
+
data={[
|
|
56
|
+
{ label: 'Cafe', value: 18, color: 'warning' },
|
|
57
|
+
{ label: 'Garden', value: 26, color: 'positive' },
|
|
58
|
+
{ label: 'Books', value: 22, color: 'primary' },
|
|
59
|
+
{ label: 'Market', value: 14, color: 'info' },
|
|
60
|
+
]}
|
|
61
|
+
/>
|
|
62
|
+
</CanvasItem>
|
|
63
|
+
|
|
64
|
+
<CanvasItem x={762} y={178} width={318} height={88}>
|
|
65
|
+
<StepCard eyebrow="01 · 4.9 / 5" title="Juniper Café" subtitle="Cortado · sesame bun" tone="warm" align="left" width={318} minHeight={88} />
|
|
66
|
+
</CanvasItem>
|
|
67
|
+
<CanvasItem x={762} y={278} width={318} height={88}>
|
|
68
|
+
<StepCard eyebrow="02 · 4.8 / 5" title="Glasshouse Garden" subtitle="Fern shade · quiet benches" tone="green" align="left" width={318} minHeight={88} />
|
|
69
|
+
</CanvasItem>
|
|
70
|
+
<CanvasItem x={762} y={378} width={318} height={88}>
|
|
71
|
+
<StepCard eyebrow="03 · 4.7 / 5" title="Paper Moon Books" subtitle="Used books · window seat" tone="purple" align="left" width={318} minHeight={88} />
|
|
72
|
+
</CanvasItem>
|
|
73
|
+
<CanvasItem x={762} y={478} width={318} height={88}>
|
|
74
|
+
<StepCard eyebrow="04 · 4.6 / 5" title="Old Market Hall" subtitle="Citrus bun · flower stall" tone="cyan" align="left" width={318} minHeight={88} />
|
|
75
|
+
</CanvasItem>
|
|
76
|
+
<CanvasItem x={762} y={584} width={318} height={122}>
|
|
77
|
+
<Card title="Let the route breathe" subtitle="No reservations. No hurry. Every place in this guide is fictional demo content." tone="purple" width={318} height={122} padding={16}>
|
|
78
|
+
<TextLabel text="Start when the rain clears; stay as long as the coffee is warm." variant="tiny" color={c.textSecondary} />
|
|
79
|
+
</Card>
|
|
80
|
+
</CanvasItem>
|
|
81
|
+
</Board>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vizmatic",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Theme-aware
|
|
3
|
+
"version": "0.4.0",
|
|
4
|
+
"description": "Theme-aware diagrams, charts, animations, and MP4 video from TSX.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "Bruno Volpato",
|
|
@@ -27,6 +27,9 @@
|
|
|
27
27
|
"react",
|
|
28
28
|
"diagrams",
|
|
29
29
|
"presentations",
|
|
30
|
+
"animation",
|
|
31
|
+
"video",
|
|
32
|
+
"mp4",
|
|
30
33
|
"theme-aware",
|
|
31
34
|
"ai-agents",
|
|
32
35
|
"structured-visuals"
|
|
@@ -57,13 +60,18 @@
|
|
|
57
60
|
"types": "./dist/index.d.cts",
|
|
58
61
|
"default": "./dist/index.cjs"
|
|
59
62
|
}
|
|
63
|
+
},
|
|
64
|
+
"./scene-runtime": {
|
|
65
|
+
"import": { "types": "./dist/scene-runtime.d.ts", "default": "./dist/scene-runtime.js" },
|
|
66
|
+
"require": { "types": "./dist/scene-runtime.d.cts", "default": "./dist/scene-runtime.cjs" }
|
|
60
67
|
}
|
|
61
68
|
},
|
|
62
69
|
"bin": {
|
|
63
|
-
"vizmatic": "dist/cli.js"
|
|
70
|
+
"vizmatic": "dist/cli.js",
|
|
71
|
+
"vizmatic-scene": "dist/scene-cli.js"
|
|
64
72
|
},
|
|
65
73
|
"scripts": {
|
|
66
|
-
"build": "tsup src/index.ts --format esm --dts --target node20 --clean --external react && tsup src/index.ts --format cjs --dts --target node20 --external react --define.import.meta.url undefined && tsup src/cli.ts --format esm --dts --target node20 --external react --minify-whitespace",
|
|
74
|
+
"build": "tsup src/index.ts src/scene-runtime.ts --format esm --dts --target node20 --clean --external react && tsup src/index.ts src/scene-runtime.ts --format cjs --dts --target node20 --external react --define.import.meta.url undefined && tsup src/cli.ts src/scene-cli.ts --format esm --dts --target node20 --external react --minify-whitespace",
|
|
67
75
|
"assets:emoji": "node scripts/build-emoji-bundle.mjs",
|
|
68
76
|
"assets:check": "node scripts/build-emoji-bundle.mjs --check",
|
|
69
77
|
"prepare": "pnpm build",
|
|
@@ -71,6 +79,7 @@
|
|
|
71
79
|
"typecheck": "tsc --noEmit",
|
|
72
80
|
"test": "pnpm build && vitest run",
|
|
73
81
|
"render:examples": "pnpm build && tsx scripts/render-examples.ts && pnpm site:build",
|
|
82
|
+
"render:video": "pnpm build && tsx scripts/render-video-example.ts",
|
|
74
83
|
"benchmark:quality": "pnpm build && tsx scripts/benchmark-quality.ts && pnpm site:build",
|
|
75
84
|
"check:examples": "tsx scripts/check-examples.ts",
|
|
76
85
|
"playground:build": "tsx scripts/build-playground.ts",
|
|
@@ -90,9 +99,12 @@
|
|
|
90
99
|
"@dagrejs/dagre": "3.1.1",
|
|
91
100
|
"@resvg/resvg-js": "^2.6.2",
|
|
92
101
|
"gifenc": "^1.0.3",
|
|
102
|
+
"mathjax-full": "3.2.2",
|
|
93
103
|
"parse-css-color": "0.2.1",
|
|
104
|
+
"quickjs-emscripten": "0.32.0",
|
|
94
105
|
"react": "^19.2.8",
|
|
95
|
-
"satori": "0.
|
|
106
|
+
"satori": "0.41.0",
|
|
107
|
+
"sucrase": "3.35.1",
|
|
96
108
|
"tsx": "^4.23.12"
|
|
97
109
|
},
|
|
98
110
|
"peerDependencies": {
|
|
@@ -105,10 +117,9 @@
|
|
|
105
117
|
"esbuild": "0.28.2",
|
|
106
118
|
"github-actionlint": "1.7.12",
|
|
107
119
|
"harfbuzzjs": "0.10.0",
|
|
108
|
-
"playwright": "1.
|
|
120
|
+
"playwright": "1.64.0",
|
|
109
121
|
"publint": "0.3.25",
|
|
110
122
|
"shiki": "^4.5.0",
|
|
111
|
-
"sucrase": "3.35.1",
|
|
112
123
|
"tsup": "^8.5.1",
|
|
113
124
|
"typescript": ">=6.0.3 <7",
|
|
114
125
|
"vitest": "^5.0.3"
|