vizmatic 0.4.0 → 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/PROMPT.md +75 -531
- package/README.md +85 -1052
- package/ROADMAP.md +49 -67
- package/SCIENCE.md +250 -0
- package/assets/THIRD_PARTY_LICENSES.md +40 -1
- package/assets/fonts/InstrumentSerif-Italic.ttf +0 -0
- package/assets/fonts/InstrumentSerif-Regular.ttf +0 -0
- package/assets/licenses/raster-codecs-MIT.txt +74 -0
- package/dist/chunk-3F2VQ7NW.js +1 -0
- package/dist/{chunk-FEIPTPBZ.js → chunk-4XE64I2U.js} +53 -463
- package/dist/chunk-JHHPLALU.js +79 -0
- package/dist/chunk-LTX44BAE.js +112 -0
- package/dist/chunk-MLKGABMK.js +9 -0
- package/dist/chunk-PSBF4TEK.js +1 -0
- package/dist/chunk-RPAHMKAR.js +605 -0
- package/dist/chunk-RWF4VBUL.js +3617 -0
- package/dist/chunk-WHT6HRMX.js +4201 -0
- package/dist/cli.js +369 -12
- package/dist/index.cjs +7413 -1810
- package/dist/index.d.cts +900 -599
- package/dist/index.d.ts +900 -599
- package/dist/index.js +5019 -3278
- package/dist/math-LXB4FH4E.js +7 -0
- package/dist/math-QVCETQDQ.js +1 -0
- package/dist/scene-browser-assets.d.ts +38 -0
- package/dist/scene-browser-assets.js +53 -0
- package/dist/scene-browser-chunks/chunk-5MVLYGXM.js +70 -0
- package/dist/scene-browser-chunks/chunk-ASXKN3NU.js +1 -0
- package/dist/scene-browser-chunks/chunk-CM5Y5LZP.js +1 -0
- package/dist/scene-browser-chunks/chunk-DP7NB4EW.js +6 -0
- package/dist/scene-browser-chunks/emscripten-module.browser-M5AEKJGE.js +1 -0
- package/dist/scene-browser-chunks/ffi-FL6ORJU3.js +1 -0
- package/dist/scene-browser-chunks/module-ES6BEMUI-JD5S5VKR.js +1 -0
- package/dist/scene-browser-chunks/module-asyncify-2EFITU5U-HWPFJFJC.js +1 -0
- package/dist/scene-browser-chunks/scene-browser-layout-M3XSXMV4.js +27 -0
- package/dist/scene-browser.d.ts +117 -0
- package/dist/scene-browser.js +220 -0
- package/dist/scene-cli.js +1 -1
- package/dist/scene-runtime.cjs +168 -103
- package/dist/scene-runtime.d.cts +3 -2
- package/dist/scene-runtime.d.ts +3 -2
- package/dist/scene-runtime.js +3 -1
- package/dist/server-2FYHZ4UO.js +331 -0
- package/dist/stage-browser/browser.d.ts +2482 -0
- package/dist/stage-browser/chunk-SQE76S5B.js +1 -0
- package/dist/stage-browser/chunk-VZNL6JY2.js +59 -0
- package/dist/stage-browser/dagre.esm-N2NIVIAZ.js +6 -0
- package/dist/stage-browser/math-4WFNHVV2.js +18 -0
- package/dist/stage-browser/stage.js +19 -0
- package/dist/stage-export.cjs +4950 -0
- package/dist/stage-export.d.cts +112 -0
- package/dist/stage-export.d.ts +112 -0
- package/dist/stage-export.js +544 -0
- package/dist/stage.cjs +9745 -0
- package/dist/stage.d.cts +1678 -0
- package/dist/stage.d.ts +1678 -0
- package/dist/stage.js +5404 -0
- package/dist/svg-import-Djj2q7Pc.d.cts +742 -0
- package/dist/svg-import-Djj2q7Pc.d.ts +742 -0
- package/dist/video-CcHW1qhV.d.cts +532 -0
- package/dist/video-CcHW1qhV.d.ts +532 -0
- package/examples/README.md +18 -0
- package/examples/agent-pipeline.tsx +4 -4
- package/examples/animated-pipeline.tsx +1 -5
- package/examples/attention-head.tsx +12 -12
- package/examples/aurora-incident.tsx +4 -3
- package/examples/building-blocks.tsx +8 -9
- package/examples/catalog-charts.tsx +4 -4
- package/examples/catalog-content.tsx +7 -9
- package/examples/catalog-convolution-kernel.tsx +116 -0
- package/examples/catalog-data.tsx +2 -8
- package/examples/catalog-dataflow.tsx +5 -9
- package/examples/catalog-dense.tsx +80 -0
- package/examples/catalog-deployment.tsx +5 -11
- package/examples/catalog-diagrams.tsx +13 -16
- package/examples/catalog-drawing.tsx +7 -7
- package/examples/catalog-flows.tsx +4 -4
- package/examples/catalog-foundations.tsx +11 -11
- package/examples/catalog-gaussian-blur.tsx +146 -0
- package/examples/catalog-image-tensors.tsx +115 -0
- package/examples/catalog-ml.tsx +36 -31
- package/examples/catalog-numeric-matrices.tsx +93 -0
- package/examples/catalog-photo-blur.tsx +209 -0
- package/examples/catalog-science-ai.tsx +130 -0
- package/examples/catalog-science-chemistry.tsx +103 -0
- package/examples/catalog-science-math.tsx +93 -0
- package/examples/catalog-science-physics.tsx +84 -0
- package/examples/catalog-sequence.tsx +59 -38
- package/examples/data-pipeline-lineage-presentation.tsx +5 -0
- package/examples/data-pipeline-lineage.tsx +85 -0
- package/examples/daybreak-launch.tsx +1 -0
- package/examples/desired-quadrant.tsx +7 -8
- package/examples/engineering-dashboard-presentation.tsx +13 -0
- package/examples/engineering-dashboard.tsx +160 -0
- package/examples/engineering-flow.tsx +2 -4
- package/examples/eval-dashboard.tsx +6 -6
- package/examples/films/attention.ts +278 -0
- package/examples/films/cache-miss.ts +431 -0
- package/examples/films/catalog.json +132 -0
- package/examples/films/central-limit.ts +269 -0
- package/examples/films/complex-maps.ts +273 -0
- package/examples/films/deck-example.ts +224 -0
- package/examples/films/euler-circle.ts +179 -0
- package/examples/films/fourier-epicycles.ts +265 -0
- package/examples/films/gradient-descent.ts +345 -0
- package/examples/films/linear-maps.ts +175 -0
- package/examples/films/lorenz.ts +207 -0
- package/examples/films/pythagoras.ts +185 -0
- package/examples/films/taylor-series.ts +159 -0
- package/examples/films/vizmatic-title.ts +117 -0
- package/examples/llm-serving-stack-presentation.tsx +5 -0
- package/examples/llm-serving-stack.tsx +94 -0
- package/examples/model-garden.tsx +1 -0
- package/examples/model-router.tsx +6 -6
- package/examples/nccl-all-gather.tsx +3 -3
- package/examples/nccl-all-reduce.tsx +3 -3
- package/examples/nccl-all-to-all.tsx +1 -1
- package/examples/nccl-broadcast.tsx +1 -1
- package/examples/nccl-reduce-scatter.tsx +5 -5
- package/examples/orthogonal-routing.tsx +4 -4
- package/examples/pareto-frontier.tsx +9 -10
- package/examples/presentation-frame.tsx +6 -6
- package/examples/production-system-map-presentation.tsx +5 -0
- package/examples/production-system-map.tsx +130 -0
- package/examples/rag-graph.tsx +7 -7
- package/examples/release-card.tsx +5 -5
- package/examples/spec-anatomy.tsx +5 -5
- package/examples/system-architecture.tsx +19 -32
- package/examples/theme-system.tsx +1 -1
- package/examples/token-matrix.tsx +4 -2
- package/examples/transparent-badge.tsx +1 -2
- package/examples/videos/README.md +36 -2
- package/examples/videos/calculus-tangent.tsx +101 -0
- package/examples/videos/catalyst-pathway.tsx +56 -0
- package/examples/videos/causal-attention.tsx +91 -0
- package/examples/videos/convolution-kernel.tsx +34 -0
- package/examples/videos/gaussian-blur.tsx +32 -0
- package/examples/videos/image-to-matrix.tsx +22 -0
- package/examples/videos/matrix-multiplication.tsx +128 -0
- package/examples/videos/photo-gaussian-blur.tsx +39 -0
- package/examples/videos/wave-interference.tsx +80 -0
- package/examples/vizmatic-bare.d.ts +1 -0
- package/examples/vizmatic-hero.tsx +9 -18
- package/examples/website-workflow.tsx +7 -7
- package/examples/weekend-field-notes.tsx +3 -2
- package/package.json +65 -11
- package/dist/chunk-TH3F4SDB.js +0 -79
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getThemeColors,
|
|
3
|
+
MoleculeDiagram,
|
|
4
|
+
Panel,
|
|
5
|
+
ReactionEnergyDiagram,
|
|
6
|
+
ReactionEquation,
|
|
7
|
+
Row,
|
|
8
|
+
Scene,
|
|
9
|
+
TextLabel,
|
|
10
|
+
type ThemeMode,
|
|
11
|
+
} from 'vizmatic'
|
|
12
|
+
|
|
13
|
+
export const width = 1280
|
|
14
|
+
export const height = 960
|
|
15
|
+
|
|
16
|
+
export function create(theme: ThemeMode = 'dark') {
|
|
17
|
+
const c = getThemeColors(theme)
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<Scene
|
|
21
|
+
c={c}
|
|
22
|
+
title="Chemistry · structure, stoichiometry, energy"
|
|
23
|
+
subtitle="Connect a molecule's geometry to a balanced reaction and its energy pathway."
|
|
24
|
+
background={c.bg}
|
|
25
|
+
padding={24}
|
|
26
|
+
gap={16}
|
|
27
|
+
>
|
|
28
|
+
<Row width="100%" gap={16} align="stretch">
|
|
29
|
+
<Panel
|
|
30
|
+
c={c}
|
|
31
|
+
title="Molecular shape"
|
|
32
|
+
subtitle="Water has a bent geometry."
|
|
33
|
+
width={440}
|
|
34
|
+
align="center"
|
|
35
|
+
>
|
|
36
|
+
<MoleculeDiagram
|
|
37
|
+
c={c}
|
|
38
|
+
width={390}
|
|
39
|
+
height={250}
|
|
40
|
+
atoms={[
|
|
41
|
+
{ id: 'oxygen', element: 'O', x: 0, y: 0 },
|
|
42
|
+
{ id: 'hydrogen-left', element: 'H', x: -0.79, y: 0.61 },
|
|
43
|
+
{ id: 'hydrogen-right', element: 'H', x: 0.79, y: 0.61 },
|
|
44
|
+
]}
|
|
45
|
+
bonds={[
|
|
46
|
+
{ from: 'oxygen', to: 'hydrogen-left', order: 1 },
|
|
47
|
+
{ from: 'oxygen', to: 'hydrogen-right', order: 1 },
|
|
48
|
+
]}
|
|
49
|
+
title="Water molecule"
|
|
50
|
+
/>
|
|
51
|
+
<TextLabel c={c} text="Schematic 2D projection · H–O–H ≈ 104.5°" fontSize={12} color={c.textSecondary} />
|
|
52
|
+
</Panel>
|
|
53
|
+
|
|
54
|
+
<Panel
|
|
55
|
+
c={c}
|
|
56
|
+
title="Conserve each element"
|
|
57
|
+
subtitle="The coefficients balance four hydrogen atoms and two oxygen atoms on both sides."
|
|
58
|
+
width={776}
|
|
59
|
+
align="center"
|
|
60
|
+
justify="center"
|
|
61
|
+
footer="2 H₂(g) + O₂(g) → 2 H₂O(l) · atom counts match"
|
|
62
|
+
>
|
|
63
|
+
<ReactionEquation
|
|
64
|
+
c={c}
|
|
65
|
+
width={720}
|
|
66
|
+
reactants={[
|
|
67
|
+
{ formula: 'H₂', coefficient: 2, state: 'g', composition: { H: 2 } },
|
|
68
|
+
{ formula: 'O₂', state: 'g', composition: { O: 2 } },
|
|
69
|
+
]}
|
|
70
|
+
products={[
|
|
71
|
+
{ formula: 'H₂O', coefficient: 2, state: 'l', composition: { H: 2, O: 1 } },
|
|
72
|
+
]}
|
|
73
|
+
conditions="spark ignition · hydrogen combustion"
|
|
74
|
+
/>
|
|
75
|
+
</Panel>
|
|
76
|
+
</Row>
|
|
77
|
+
|
|
78
|
+
<Panel
|
|
79
|
+
c={c}
|
|
80
|
+
title="A catalyst changes the path, not the endpoints"
|
|
81
|
+
subtitle="Both pathways begin and end at the same energies; the catalyzed route has a smaller activation barrier."
|
|
82
|
+
width="100%"
|
|
83
|
+
align="center"
|
|
84
|
+
footer="Illustrative relative energy values · not measured data for hydrogen combustion"
|
|
85
|
+
>
|
|
86
|
+
<ReactionEnergyDiagram
|
|
87
|
+
c={c}
|
|
88
|
+
width={1150}
|
|
89
|
+
height={320}
|
|
90
|
+
reactants={0}
|
|
91
|
+
products={-100}
|
|
92
|
+
barrier={140}
|
|
93
|
+
catalyzedBarrier={70}
|
|
94
|
+
unit="relative energy"
|
|
95
|
+
reactantLabel="reactants"
|
|
96
|
+
productLabel="products"
|
|
97
|
+
/>
|
|
98
|
+
</Panel>
|
|
99
|
+
</Scene>
|
|
100
|
+
)
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export default create('dark')
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GeometryDiagram,
|
|
3
|
+
getThemeColors,
|
|
4
|
+
NumberLine,
|
|
5
|
+
Panel,
|
|
6
|
+
Row,
|
|
7
|
+
Scene,
|
|
8
|
+
TextLabel,
|
|
9
|
+
type ThemeMode,
|
|
10
|
+
} from 'vizmatic'
|
|
11
|
+
|
|
12
|
+
export const width = 1280
|
|
13
|
+
export const height = 720
|
|
14
|
+
|
|
15
|
+
export function create(theme: ThemeMode = 'dark') {
|
|
16
|
+
const c = getThemeColors(theme)
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<Scene
|
|
20
|
+
c={c}
|
|
21
|
+
title="Math · intervals and geometric proof"
|
|
22
|
+
subtitle="Make endpoint conventions and measurable relationships visible in one frame."
|
|
23
|
+
background={c.bg}
|
|
24
|
+
padding={24}
|
|
25
|
+
gap={16}
|
|
26
|
+
>
|
|
27
|
+
<Row width="100%" gap={16} align="stretch">
|
|
28
|
+
<Panel
|
|
29
|
+
c={c}
|
|
30
|
+
title="A half-open interval"
|
|
31
|
+
subtitle="The left endpoint is included; the right endpoint is excluded."
|
|
32
|
+
width={608}
|
|
33
|
+
align="center"
|
|
34
|
+
footer="The hollow endpoint at 2 distinguishes x < 2 from x ≤ 2."
|
|
35
|
+
>
|
|
36
|
+
<NumberLine
|
|
37
|
+
c={c}
|
|
38
|
+
width={600}
|
|
39
|
+
height={360}
|
|
40
|
+
min={-3}
|
|
41
|
+
max={3}
|
|
42
|
+
ticks={[
|
|
43
|
+
{ value: -2, label: '−2' },
|
|
44
|
+
{ value: -1, label: '−1' },
|
|
45
|
+
{ value: 0, label: '0' },
|
|
46
|
+
{ value: 1, label: '1' },
|
|
47
|
+
{ value: 2, label: '2' },
|
|
48
|
+
]}
|
|
49
|
+
markers={[{ id: 'origin', label: 'origin', value: 0, color: c.info }]}
|
|
50
|
+
interval={{
|
|
51
|
+
from: -1.5,
|
|
52
|
+
to: 2,
|
|
53
|
+
includeFrom: true,
|
|
54
|
+
includeTo: false,
|
|
55
|
+
label: '−3/2 ≤ x < 2',
|
|
56
|
+
color: c.primary,
|
|
57
|
+
}}
|
|
58
|
+
/>
|
|
59
|
+
<TextLabel c={c} text="Every point on the shaded segment satisfies the inequality." fontSize={13} color={c.textSecondary} />
|
|
60
|
+
</Panel>
|
|
61
|
+
|
|
62
|
+
<Panel
|
|
63
|
+
c={c}
|
|
64
|
+
title="A 3–4–5 right triangle"
|
|
65
|
+
subtitle="Coordinates make the side lengths and right angle verifiable."
|
|
66
|
+
width={608}
|
|
67
|
+
align="center"
|
|
68
|
+
footer="AB² + BC² = AC² · 4² + 3² = 5²"
|
|
69
|
+
>
|
|
70
|
+
<GeometryDiagram
|
|
71
|
+
c={c}
|
|
72
|
+
width={600}
|
|
73
|
+
height={360}
|
|
74
|
+
points={[
|
|
75
|
+
{ id: 'A', x: 0, y: 0, label: 'A' },
|
|
76
|
+
{ id: 'B', x: 4, y: 0, label: 'B' },
|
|
77
|
+
{ id: 'C', x: 4, y: 3, label: 'C' },
|
|
78
|
+
]}
|
|
79
|
+
segments={[
|
|
80
|
+
{ from: 'A', to: 'B', label: '4 units', color: c.secondary },
|
|
81
|
+
{ from: 'B', to: 'C', label: '3 units', color: c.info },
|
|
82
|
+
{ from: 'A', to: 'C', label: '5 units', color: c.primary },
|
|
83
|
+
]}
|
|
84
|
+
angles={[{ vertex: 'B', from: 'A', to: 'C', label: '90°', color: c.warning }]}
|
|
85
|
+
/>
|
|
86
|
+
<TextLabel c={c} text="The longest side is opposite the right angle." fontSize={13} color={c.textSecondary} />
|
|
87
|
+
</Panel>
|
|
88
|
+
</Row>
|
|
89
|
+
</Scene>
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export default create('dark')
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FreeBodyDiagram,
|
|
3
|
+
getThemeColors,
|
|
4
|
+
Panel,
|
|
5
|
+
Row,
|
|
6
|
+
Scene,
|
|
7
|
+
TextLabel,
|
|
8
|
+
type ThemeMode,
|
|
9
|
+
WaveDiagram,
|
|
10
|
+
} from 'vizmatic'
|
|
11
|
+
|
|
12
|
+
export const width = 1280
|
|
13
|
+
export const height = 720
|
|
14
|
+
|
|
15
|
+
export function create(theme: ThemeMode = 'dark') {
|
|
16
|
+
const c = getThemeColors(theme)
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<Scene
|
|
20
|
+
c={c}
|
|
21
|
+
title="Physics · net force and wave interference"
|
|
22
|
+
subtitle="Resolve forces into a net vector, then see how coherent waves superpose."
|
|
23
|
+
background={c.bg}
|
|
24
|
+
padding={24}
|
|
25
|
+
gap={16}
|
|
26
|
+
>
|
|
27
|
+
<Row width="100%" gap={16} align="stretch">
|
|
28
|
+
<Panel
|
|
29
|
+
c={c}
|
|
30
|
+
title="A cart accelerates right"
|
|
31
|
+
subtitle="Vertical forces cancel; horizontal forces leave a 5 N resultant."
|
|
32
|
+
tone="green"
|
|
33
|
+
width={608}
|
|
34
|
+
align="center"
|
|
35
|
+
footer="ΣFₓ = 8 N − 3 N = 5 N · ΣFᵧ = 9.8 N − 9.8 N = 0"
|
|
36
|
+
>
|
|
37
|
+
<FreeBodyDiagram
|
|
38
|
+
c={c}
|
|
39
|
+
width={600}
|
|
40
|
+
height={360}
|
|
41
|
+
forces={[
|
|
42
|
+
{ id: 'weight', label: 'weight · 9.8 N', x: 0, y: -9.8, color: c.primary },
|
|
43
|
+
{ id: 'normal', label: 'normal · 9.8 N', x: 0, y: 9.8, color: c.info },
|
|
44
|
+
{ id: 'push', label: 'push · 8 N', x: 8, y: 0, color: c.positive },
|
|
45
|
+
{ id: 'drag', label: 'drag · 3 N', x: -3, y: 0, color: c.warning },
|
|
46
|
+
]}
|
|
47
|
+
showComponents
|
|
48
|
+
showResultant
|
|
49
|
+
/>
|
|
50
|
+
<TextLabel c={c} text="The resultant points right, so the cart's velocity changes in that direction." fontSize={12} color={c.textSecondary} />
|
|
51
|
+
</Panel>
|
|
52
|
+
|
|
53
|
+
<Panel
|
|
54
|
+
c={c}
|
|
55
|
+
title="In-phase wave superposition"
|
|
56
|
+
subtitle="Two equal waves add point by point to a wave with twice the amplitude."
|
|
57
|
+
width={608}
|
|
58
|
+
align="center"
|
|
59
|
+
footer="Illustrative sinusoidal waves · A = 1 m each · λ = 4 m"
|
|
60
|
+
>
|
|
61
|
+
<WaveDiagram
|
|
62
|
+
c={c}
|
|
63
|
+
width={600}
|
|
64
|
+
height={360}
|
|
65
|
+
waves={[
|
|
66
|
+
{ amplitude: 1, wavelength: 4, phase: 0, color: c.info, label: 'wave 1 · A' },
|
|
67
|
+
{ amplitude: 1, wavelength: 4, phase: 0, color: c.primary, label: 'wave 2 · A' },
|
|
68
|
+
]}
|
|
69
|
+
time={0}
|
|
70
|
+
xMin={-4}
|
|
71
|
+
xMax={4}
|
|
72
|
+
yMin={-2.4}
|
|
73
|
+
yMax={2.4}
|
|
74
|
+
showComponents
|
|
75
|
+
showSum
|
|
76
|
+
/>
|
|
77
|
+
<TextLabel c={c} text="At matching crests and troughs, the displacement adds to ±2A." fontSize={12} color={c.textSecondary} />
|
|
78
|
+
</Panel>
|
|
79
|
+
</Row>
|
|
80
|
+
</Scene>
|
|
81
|
+
)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export default create('dark')
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from 'vizmatic'
|
|
8
8
|
|
|
9
9
|
export const width = 1120
|
|
10
|
-
export const height =
|
|
10
|
+
export const height = 1320
|
|
11
11
|
|
|
12
12
|
export function create(theme: ThemeMode = 'dark') {
|
|
13
13
|
const c = getThemeColors(theme)
|
|
@@ -25,7 +25,6 @@ export function create(theme: ThemeMode = 'dark') {
|
|
|
25
25
|
c={c}
|
|
26
26
|
title="Checkout request"
|
|
27
27
|
subtitle="solid sync · dashed async · neutral returns · fragments mark alternate, repeated, and parallel work"
|
|
28
|
-
tone="blue"
|
|
29
28
|
width="100%"
|
|
30
29
|
padding={14}
|
|
31
30
|
align="center"
|
|
@@ -33,18 +32,18 @@ export function create(theme: ThemeMode = 'dark') {
|
|
|
33
32
|
<SequenceDiagram
|
|
34
33
|
c={c}
|
|
35
34
|
width={930}
|
|
36
|
-
height={
|
|
35
|
+
height={1040}
|
|
37
36
|
padding={24}
|
|
38
37
|
participantWidth={132}
|
|
39
38
|
participantGap={30}
|
|
40
39
|
rowHeight={38}
|
|
41
40
|
noteWidth={172}
|
|
42
41
|
title="POST /checkout"
|
|
43
|
-
ariaLabel="
|
|
42
|
+
ariaLabel="Authorized checkout enqueues fulfillment while the browser polls concurrently; parallel tasks complete and the order API returns ready"
|
|
44
43
|
participants={[
|
|
45
|
-
{ id: 'client', label: 'Browser', kind: 'actor', icon: 'browser'
|
|
46
|
-
{ id: 'edge', label: 'Edge gateway', kind: 'boundary', icon: 'gateway'
|
|
47
|
-
{ id: 'orders', label: 'Order API', kind: 'control', icon: 'container'
|
|
44
|
+
{ id: 'client', label: 'Browser', kind: 'actor', icon: 'browser' },
|
|
45
|
+
{ id: 'edge', label: 'Edge gateway', kind: 'boundary', icon: 'gateway' },
|
|
46
|
+
{ id: 'orders', label: 'Order API', kind: 'control', icon: 'container' },
|
|
48
47
|
{ id: 'worker', label: 'Fulfillment', kind: 'entity', icon: 'agent', tone: 'green' },
|
|
49
48
|
]}
|
|
50
49
|
items={[
|
|
@@ -61,6 +60,55 @@ export function create(theme: ThemeMode = 'dark') {
|
|
|
61
60
|
items: [
|
|
62
61
|
{ id: 'enqueue', from: 'orders', to: 'worker', kind: 'async', label: 'enqueue fulfillment' },
|
|
63
62
|
{ id: 'accepted', from: 'orders', to: 'client', kind: 'return', label: '202 Accepted' },
|
|
63
|
+
{
|
|
64
|
+
id: 'checkout-work',
|
|
65
|
+
kind: 'parallel',
|
|
66
|
+
branches: [
|
|
67
|
+
{
|
|
68
|
+
id: 'polling',
|
|
69
|
+
label: 'client polls while pending',
|
|
70
|
+
items: [
|
|
71
|
+
{
|
|
72
|
+
id: 'polling-loop',
|
|
73
|
+
kind: 'loop',
|
|
74
|
+
label: 'while order is pending',
|
|
75
|
+
items: [
|
|
76
|
+
{ id: 'poll', from: 'client', to: 'edge', kind: 'sync', label: 'GET /orders/:id' },
|
|
77
|
+
{ id: 'read-state', from: 'edge', to: 'orders', kind: 'sync', label: 'read status' },
|
|
78
|
+
{ id: 'pending', from: 'orders', to: 'client', kind: 'return', label: '202 · pending' },
|
|
79
|
+
],
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
id: 'fulfillment-work',
|
|
85
|
+
label: 'fulfillment tasks',
|
|
86
|
+
items: [
|
|
87
|
+
{
|
|
88
|
+
id: 'fulfillment-fanout',
|
|
89
|
+
kind: 'parallel',
|
|
90
|
+
branches: [
|
|
91
|
+
{
|
|
92
|
+
id: 'reserve-stock',
|
|
93
|
+
label: 'inventory',
|
|
94
|
+
items: [{ id: 'reserve', from: 'orders', to: 'worker', kind: 'async', label: 'reserve stock' }],
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
id: 'send-receipt',
|
|
98
|
+
label: 'receipt',
|
|
99
|
+
items: [{ id: 'receipt', from: 'orders', to: 'worker', kind: 'async', label: 'send receipt' }],
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
},
|
|
103
|
+
{ id: 'fulfilled', from: 'worker', to: 'orders', kind: 'async', label: 'fulfillment complete' },
|
|
104
|
+
{ id: 'mark-ready', from: 'orders', to: 'orders', kind: 'sync', label: 'persist ready' },
|
|
105
|
+
],
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
{ id: 'ready-poll', from: 'client', to: 'edge', kind: 'sync', label: 'GET /orders/:id' },
|
|
110
|
+
{ id: 'ready-state', from: 'edge', to: 'orders', kind: 'sync', label: 'read status' },
|
|
111
|
+
{ id: 'ready-result', from: 'orders', to: 'client', kind: 'return', label: '200 · ready' },
|
|
64
112
|
],
|
|
65
113
|
},
|
|
66
114
|
{
|
|
@@ -73,39 +121,12 @@ export function create(theme: ThemeMode = 'dark') {
|
|
|
73
121
|
],
|
|
74
122
|
tone: 'warm',
|
|
75
123
|
},
|
|
76
|
-
{
|
|
77
|
-
id: 'polling',
|
|
78
|
-
kind: 'loop',
|
|
79
|
-
items: [
|
|
80
|
-
{ id: 'poll', from: 'client', to: 'edge', kind: 'sync', label: 'GET /orders/:id' },
|
|
81
|
-
{ id: 'read-state', from: 'edge', to: 'orders', kind: 'sync', label: 'read status' },
|
|
82
|
-
{ id: 'pending', from: 'orders', to: 'client', kind: 'return', label: 'pending / ready' },
|
|
83
|
-
],
|
|
84
|
-
tone: 'purple',
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
id: 'fulfillment-fanout',
|
|
88
|
-
kind: 'parallel',
|
|
89
|
-
branches: [
|
|
90
|
-
{
|
|
91
|
-
id: 'reserve-stock',
|
|
92
|
-
label: 'inventory',
|
|
93
|
-
items: [{ id: 'reserve', from: 'orders', to: 'worker', kind: 'async', label: 'reserve stock' }],
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
id: 'send-receipt',
|
|
97
|
-
label: 'receipt',
|
|
98
|
-
items: [{ id: 'receipt', from: 'orders', to: 'worker', kind: 'async', label: 'send receipt' }],
|
|
99
|
-
},
|
|
100
|
-
],
|
|
101
|
-
tone: 'cyan',
|
|
102
|
-
},
|
|
103
124
|
]}
|
|
104
125
|
activations={[
|
|
105
|
-
{ id: 'edge-span', type: 'activation', participant: 'edge', fromMessage: 'request', toMessage: 'accepted'
|
|
106
|
-
{ id: 'order-span', type: 'activation', participant: 'orders', fromMessage: 'authorize', toMessage: 'accepted'
|
|
107
|
-
{ id: 'worker-span', type: 'activation', participant: 'worker', fromMessage: 'enqueue', toMessage: '
|
|
108
|
-
{ id: 'poll-span', type: 'activation', participant: 'orders', fromMessage: '
|
|
126
|
+
{ id: 'edge-span', type: 'activation', participant: 'edge', fromMessage: 'request', toMessage: 'accepted' },
|
|
127
|
+
{ id: 'order-span', type: 'activation', participant: 'orders', fromMessage: 'authorize', toMessage: 'accepted' },
|
|
128
|
+
{ id: 'worker-span', type: 'activation', participant: 'worker', fromMessage: 'enqueue', toMessage: 'fulfilled', tone: 'green' },
|
|
129
|
+
{ id: 'poll-span', type: 'activation', participant: 'orders', fromMessage: 'read-state', toMessage: 'pending', depth: 1, muted: true },
|
|
109
130
|
]}
|
|
110
131
|
/>
|
|
111
132
|
</Panel>
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { getThemeColors, GraphDiagram, Scene, type ThemeMode } from 'vizmatic'
|
|
2
|
+
|
|
3
|
+
// A fictional analytics platform. All schemas and volumes are illustrative.
|
|
4
|
+
export const width = 2200
|
|
5
|
+
export const height = 1200
|
|
6
|
+
|
|
7
|
+
const fields = (...rows: [string, string][]) => rows.map(([key, value]) => ({ key, value }))
|
|
8
|
+
|
|
9
|
+
export function create(theme: ThemeMode = 'dark') {
|
|
10
|
+
const c = getThemeColors(theme)
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<Scene
|
|
14
|
+
c={c}
|
|
15
|
+
title="Revenue data lineage, from event to board metric"
|
|
16
|
+
subtitle="Each table shows its schema, volume, and freshness. Illustrative figures. Dashed links are streaming; solid links are scheduled batch."
|
|
17
|
+
background={c.bg}
|
|
18
|
+
>
|
|
19
|
+
<GraphDiagram
|
|
20
|
+
c={c}
|
|
21
|
+
ariaLabel="Data lineage from source systems through streaming ingestion, a lakehouse, dbt transformations, and metrics"
|
|
22
|
+
direction="LR"
|
|
23
|
+
crossingBudget={4}
|
|
24
|
+
legend={[
|
|
25
|
+
{ label: 'batch', style: 'solid' },
|
|
26
|
+
{ label: 'stream', style: 'dashed' },
|
|
27
|
+
{ label: 'PII removed here', style: 'dot', tone: 'purple' },
|
|
28
|
+
{ label: 'freshness breach', style: 'dot', tone: 'warm' },
|
|
29
|
+
]}
|
|
30
|
+
groups={[
|
|
31
|
+
{ id: 'source', label: 'Sources', detail: 'owned by product teams' },
|
|
32
|
+
{ id: 'bronze', label: 'Bronze', detail: 'raw, append only', summary: '4.2 TB/day' },
|
|
33
|
+
{ id: 'silver', label: 'Silver', detail: 'typed and deduplicated', summary: '1.1 TB/day' },
|
|
34
|
+
{ id: 'gold', label: 'Gold', detail: 'modeled in dbt', summary: '86 GB' },
|
|
35
|
+
{ id: 'serve', label: 'Consumers' },
|
|
36
|
+
]}
|
|
37
|
+
nodes={[
|
|
38
|
+
{ id: 'orders', group: 'source', label: 'orders', detail: 'Postgres CDC', icon: 'database', rows: fields(['volume', '2.1k/s'], ['bytes', '41 GB/day']) },
|
|
39
|
+
{ id: 'payments', group: 'source', label: 'payments', detail: 'Postgres CDC', icon: 'database', rows: fields(['volume', '1.9k/s'], ['bytes', '28 GB/day']) },
|
|
40
|
+
{ id: 'clicks', group: 'source', label: 'clickstream', detail: 'Kafka, Avro', icon: 'stream', rows: fields(['volume', '184k/s'], ['bytes', '3.9 TB/day']) },
|
|
41
|
+
{ id: 'crm', group: 'source', label: 'crm_accounts', detail: 'Fivetran, hourly', icon: 'globe', rows: fields(['rows', '12.4M'], ['delay', '38 min']) },
|
|
42
|
+
|
|
43
|
+
{ id: 'rawOrders', group: 'bronze', label: 'raw.orders', detail: 'Iceberg, by day', icon: 'file', rows: fields(['id', 'uuid'], ['payload', 'json'], ['op', 'c, u, d'], ['_ts', 'timestamp']) },
|
|
44
|
+
{ id: 'rawClicks', group: 'bronze', label: 'raw.events', detail: 'Iceberg, by hour', icon: 'file', rows: fields(['event_id', 'uuid'], ['user_key', 'bytes'], ['props', 'map<str,str>'], ['_ts', 'timestamp']) },
|
|
45
|
+
|
|
46
|
+
{ id: 'flink', group: 'silver', label: 'sessionize', detail: 'Flink, 30 min gap', icon: 'stream', status: 'ok', rows: fields(['state', '380 GB'], ['lag', '41 s']) },
|
|
47
|
+
{ id: 'stgOrders', group: 'silver', label: 'stg.orders', detail: '9.4B rows', icon: 'layers', status: 'ok', tags: ['PII removed'], rows: fields(['order_id', 'uuid'], ['account_id', 'bigint'], ['amount', 'decimal(12,2)'], ['currency', 'char(3)'], ['placed_at', 'timestamp']) },
|
|
48
|
+
{ id: 'stgSessions', group: 'silver', label: 'stg.sessions', detail: '61B rows', icon: 'layers', status: 'ok', tags: ['PII removed'], rows: fields(['session_id', 'uuid'], ['account_id', 'bigint'], ['pages', 'int'], ['converted', 'bool']) },
|
|
49
|
+
{ id: 'stgAccounts', group: 'silver', label: 'stg.accounts', detail: '12.4M rows', icon: 'layers', status: 'warn', rows: fields(['account_id', 'bigint'], ['segment', 'enum(4)'], ['region', 'char(2)'], ['freshness', '2h 14m']) },
|
|
50
|
+
|
|
51
|
+
{ id: 'factRevenue', group: 'gold', label: 'fct_revenue', detail: 'daily, by account', icon: 'chart', status: 'ok', rows: fields(['grain', 'account, day'], ['rows', '1.8B'], ['net_usd', 'decimal(14,2)'], ['refunds', 'decimal(14,2)']) },
|
|
52
|
+
{ id: 'factFunnel', group: 'gold', label: 'fct_funnel', detail: 'by segment', icon: 'chart', status: 'ok', rows: fields(['grain', 'segment, day'], ['rows', '42k'], ['cvr', 'double']) },
|
|
53
|
+
{ id: 'dimAccount', group: 'gold', label: 'dim_account', detail: 'SCD type 2', icon: 'cluster', status: 'warn', rows: fields(['rows', '31M'], ['valid_from', 'date']) },
|
|
54
|
+
|
|
55
|
+
{ id: 'metrics', group: 'serve', label: 'Metrics layer', detail: '84 definitions', icon: 'code', status: 'ok', rows: fields(['ARR', '$48.2M'], ['NRR', '114%']) },
|
|
56
|
+
{ id: 'board', group: 'serve', label: 'Board deck', detail: 'monthly', icon: 'image', rows: fields(['owner', 'finance'], ['SLA', '06:00 UTC']) },
|
|
57
|
+
{ id: 'reverse', group: 'serve', label: 'Reverse ETL', detail: 'to CRM', icon: 'stream', rows: fields(['synced', '12.4M'], ['errors', '0.02%']) },
|
|
58
|
+
]}
|
|
59
|
+
edges={[
|
|
60
|
+
{ from: 'orders', to: 'rawOrders', kind: 'async', label: '41 GB/day' },
|
|
61
|
+
{ from: 'payments', to: 'rawOrders', kind: 'async', label: '28 GB/day' },
|
|
62
|
+
{ from: 'clicks', to: 'rawClicks', kind: 'async', label: '3.9 TB/day' },
|
|
63
|
+
{ from: 'rawOrders', to: 'stgOrders', label: '69 GB' },
|
|
64
|
+
{ from: 'rawClicks', to: 'flink', kind: 'async', label: '184k/s' },
|
|
65
|
+
{ from: 'flink', to: 'stgSessions', kind: 'async', label: '410 GB' },
|
|
66
|
+
{ from: 'crm', to: 'stgAccounts', tone: 'warm', label: '12.4M rows' },
|
|
67
|
+
{ from: 'stgOrders', to: 'factRevenue', label: 'hourly' },
|
|
68
|
+
{ from: 'stgAccounts', to: 'dimAccount', tone: 'warm' },
|
|
69
|
+
{ from: 'stgSessions', to: 'factFunnel', label: 'hourly' },
|
|
70
|
+
{ from: 'dimAccount', to: 'factRevenue' },
|
|
71
|
+
{ from: 'dimAccount', to: 'factFunnel' },
|
|
72
|
+
{ from: 'factRevenue', to: 'metrics' },
|
|
73
|
+
{ from: 'factFunnel', to: 'metrics' },
|
|
74
|
+
{ from: 'metrics', to: 'board' },
|
|
75
|
+
{ from: 'metrics', to: 'reverse' },
|
|
76
|
+
]}
|
|
77
|
+
annotations={[
|
|
78
|
+
{ target: 'stgAccounts', text: 'Two hours behind its one hour SLA. Everything downstream of dim_account inherits the delay.', tone: 'warm', width: 180 },
|
|
79
|
+
]}
|
|
80
|
+
/>
|
|
81
|
+
</Scene>
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export default create('dark')
|
|
@@ -8,13 +8,12 @@ import {
|
|
|
8
8
|
export const width = 1040
|
|
9
9
|
export const height = 570
|
|
10
10
|
|
|
11
|
-
// Same
|
|
12
|
-
// Points stay in raw cost-per-task and weighted-score units.
|
|
11
|
+
// Same illustrative values as pareto-frontier.tsx, shown against policy thresholds.
|
|
13
12
|
const points = [
|
|
14
|
-
{ x: 0.
|
|
15
|
-
{ x: 0.
|
|
16
|
-
{ x: 0.
|
|
17
|
-
{ x: 0.
|
|
13
|
+
{ x: 0.01, y: 57, label: 'low cost', color: 'info', size: 7 },
|
|
14
|
+
{ x: 0.22, y: 89, label: 'high score', color: 'primary', size: 8 },
|
|
15
|
+
{ x: 0.09, y: 72, label: 'balanced', color: 'positive', size: 7 },
|
|
16
|
+
{ x: 0.32, y: 80, label: 'dominated', color: 'warning', size: 7 },
|
|
18
17
|
]
|
|
19
18
|
|
|
20
19
|
export function create(theme: ThemeMode = 'dark') {
|
|
@@ -35,14 +34,14 @@ export function create(theme: ThemeMode = 'dark') {
|
|
|
35
34
|
width={960}
|
|
36
35
|
height={300}
|
|
37
36
|
title="Price × score selection policy"
|
|
38
|
-
subtitle="
|
|
37
|
+
subtitle="Illustrative values; green satisfies both operating thresholds"
|
|
39
38
|
xMin={0}
|
|
40
39
|
xMax={0.4}
|
|
41
40
|
yMin={40}
|
|
42
41
|
yMax={100}
|
|
43
42
|
xThreshold={0.2}
|
|
44
43
|
yThreshold={70}
|
|
45
|
-
xAxisLabel="
|
|
44
|
+
xAxisLabel="cost per task"
|
|
46
45
|
formatX={(value) => `$${value.toFixed(2)}`}
|
|
47
46
|
formatY={(value) => `${Math.round(value)}`}
|
|
48
47
|
showTicks
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ThemeMode } from 'vizmatic'
|
|
2
|
+
import { createAt } from './engineering-dashboard'
|
|
3
|
+
|
|
4
|
+
// The same source as engineering-dashboard.tsx, scaled for a room. Only the density changes.
|
|
5
|
+
export const density = 'presentation'
|
|
6
|
+
export const width = 2500
|
|
7
|
+
export const height = 1760
|
|
8
|
+
|
|
9
|
+
export function create(theme: ThemeMode = 'dark') {
|
|
10
|
+
return createAt(theme, 'presentation')
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default create('dark')
|