vizmatic 0.3.2 → 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.
Files changed (150) hide show
  1. package/PROMPT.md +75 -525
  2. package/README.md +87 -578
  3. package/ROADMAP.md +49 -67
  4. package/SCIENCE.md +250 -0
  5. package/assets/THIRD_PARTY_LICENSES.md +40 -1
  6. package/assets/fonts/InstrumentSerif-Italic.ttf +0 -0
  7. package/assets/fonts/InstrumentSerif-Regular.ttf +0 -0
  8. package/assets/licenses/raster-codecs-MIT.txt +74 -0
  9. package/dist/chunk-3F2VQ7NW.js +1 -0
  10. package/dist/chunk-4XE64I2U.js +755 -0
  11. package/dist/chunk-JHHPLALU.js +79 -0
  12. package/dist/chunk-LTX44BAE.js +112 -0
  13. package/dist/chunk-MLKGABMK.js +9 -0
  14. package/dist/chunk-PSBF4TEK.js +1 -0
  15. package/dist/chunk-RPAHMKAR.js +605 -0
  16. package/dist/chunk-RWF4VBUL.js +3617 -0
  17. package/dist/chunk-WHT6HRMX.js +4201 -0
  18. package/dist/cli.js +371 -10
  19. package/dist/index.cjs +11129 -2922
  20. package/dist/index.d.cts +1225 -369
  21. package/dist/index.d.ts +1225 -369
  22. package/dist/index.js +6220 -3015
  23. package/dist/math-LXB4FH4E.js +7 -0
  24. package/dist/math-QVCETQDQ.js +1 -0
  25. package/dist/scene-browser-assets.d.ts +38 -0
  26. package/dist/scene-browser-assets.js +53 -0
  27. package/dist/scene-browser-chunks/chunk-5MVLYGXM.js +70 -0
  28. package/dist/scene-browser-chunks/chunk-ASXKN3NU.js +1 -0
  29. package/dist/scene-browser-chunks/chunk-CM5Y5LZP.js +1 -0
  30. package/dist/scene-browser-chunks/chunk-DP7NB4EW.js +6 -0
  31. package/dist/scene-browser-chunks/emscripten-module.browser-M5AEKJGE.js +1 -0
  32. package/dist/scene-browser-chunks/ffi-FL6ORJU3.js +1 -0
  33. package/dist/scene-browser-chunks/module-ES6BEMUI-JD5S5VKR.js +1 -0
  34. package/dist/scene-browser-chunks/module-asyncify-2EFITU5U-HWPFJFJC.js +1 -0
  35. package/dist/scene-browser-chunks/scene-browser-layout-M3XSXMV4.js +27 -0
  36. package/dist/scene-browser.d.ts +117 -0
  37. package/dist/scene-browser.js +220 -0
  38. package/dist/scene-cli.d.ts +1 -0
  39. package/dist/scene-cli.js +4 -0
  40. package/dist/scene-runtime.cjs +995 -0
  41. package/dist/scene-runtime.d.cts +81 -0
  42. package/dist/scene-runtime.d.ts +81 -0
  43. package/dist/scene-runtime.js +22 -0
  44. package/dist/server-2FYHZ4UO.js +331 -0
  45. package/dist/stage-browser/browser.d.ts +2482 -0
  46. package/dist/stage-browser/chunk-SQE76S5B.js +1 -0
  47. package/dist/stage-browser/chunk-VZNL6JY2.js +59 -0
  48. package/dist/stage-browser/dagre.esm-N2NIVIAZ.js +6 -0
  49. package/dist/stage-browser/math-4WFNHVV2.js +18 -0
  50. package/dist/stage-browser/stage.js +19 -0
  51. package/dist/stage-export.cjs +4950 -0
  52. package/dist/stage-export.d.cts +112 -0
  53. package/dist/stage-export.d.ts +112 -0
  54. package/dist/stage-export.js +544 -0
  55. package/dist/stage.cjs +9745 -0
  56. package/dist/stage.d.cts +1678 -0
  57. package/dist/stage.d.ts +1678 -0
  58. package/dist/stage.js +5404 -0
  59. package/dist/svg-import-Djj2q7Pc.d.cts +742 -0
  60. package/dist/svg-import-Djj2q7Pc.d.ts +742 -0
  61. package/dist/video-CcHW1qhV.d.cts +532 -0
  62. package/dist/video-CcHW1qhV.d.ts +532 -0
  63. package/examples/README.md +18 -0
  64. package/examples/agent-pipeline.tsx +4 -4
  65. package/examples/animated-pipeline.tsx +1 -5
  66. package/examples/attention-head.tsx +12 -12
  67. package/examples/aurora-incident.tsx +4 -3
  68. package/examples/building-blocks.tsx +8 -9
  69. package/examples/catalog-charts.tsx +4 -4
  70. package/examples/catalog-content.tsx +7 -9
  71. package/examples/catalog-convolution-kernel.tsx +116 -0
  72. package/examples/catalog-data.tsx +2 -8
  73. package/examples/catalog-dataflow.tsx +5 -9
  74. package/examples/catalog-dense.tsx +80 -0
  75. package/examples/catalog-deployment.tsx +5 -11
  76. package/examples/catalog-diagrams.tsx +13 -16
  77. package/examples/catalog-drawing.tsx +7 -7
  78. package/examples/catalog-flows.tsx +4 -4
  79. package/examples/catalog-foundations.tsx +11 -11
  80. package/examples/catalog-gaussian-blur.tsx +146 -0
  81. package/examples/catalog-image-tensors.tsx +115 -0
  82. package/examples/catalog-ml.tsx +36 -31
  83. package/examples/catalog-numeric-matrices.tsx +93 -0
  84. package/examples/catalog-photo-blur.tsx +209 -0
  85. package/examples/catalog-science-ai.tsx +130 -0
  86. package/examples/catalog-science-chemistry.tsx +103 -0
  87. package/examples/catalog-science-math.tsx +93 -0
  88. package/examples/catalog-science-physics.tsx +84 -0
  89. package/examples/catalog-sequence.tsx +59 -38
  90. package/examples/data-pipeline-lineage-presentation.tsx +5 -0
  91. package/examples/data-pipeline-lineage.tsx +85 -0
  92. package/examples/daybreak-launch.tsx +1 -0
  93. package/examples/desired-quadrant.tsx +7 -8
  94. package/examples/engineering-dashboard-presentation.tsx +13 -0
  95. package/examples/engineering-dashboard.tsx +160 -0
  96. package/examples/engineering-flow.tsx +2 -4
  97. package/examples/eval-dashboard.tsx +6 -6
  98. package/examples/films/attention.ts +278 -0
  99. package/examples/films/cache-miss.ts +431 -0
  100. package/examples/films/catalog.json +132 -0
  101. package/examples/films/central-limit.ts +269 -0
  102. package/examples/films/complex-maps.ts +273 -0
  103. package/examples/films/deck-example.ts +224 -0
  104. package/examples/films/euler-circle.ts +179 -0
  105. package/examples/films/fourier-epicycles.ts +265 -0
  106. package/examples/films/gradient-descent.ts +345 -0
  107. package/examples/films/linear-maps.ts +175 -0
  108. package/examples/films/lorenz.ts +207 -0
  109. package/examples/films/pythagoras.ts +185 -0
  110. package/examples/films/taylor-series.ts +159 -0
  111. package/examples/films/vizmatic-title.ts +117 -0
  112. package/examples/llm-serving-stack-presentation.tsx +5 -0
  113. package/examples/llm-serving-stack.tsx +94 -0
  114. package/examples/model-garden.tsx +1 -0
  115. package/examples/model-router.tsx +6 -6
  116. package/examples/nccl-all-gather.tsx +3 -3
  117. package/examples/nccl-all-reduce.tsx +3 -3
  118. package/examples/nccl-all-to-all.tsx +1 -1
  119. package/examples/nccl-broadcast.tsx +1 -1
  120. package/examples/nccl-reduce-scatter.tsx +5 -5
  121. package/examples/orthogonal-routing.tsx +4 -4
  122. package/examples/pareto-frontier.tsx +9 -10
  123. package/examples/presentation-frame.tsx +6 -6
  124. package/examples/pressure-mechanism.scene.json +14 -0
  125. package/examples/production-system-map-presentation.tsx +5 -0
  126. package/examples/production-system-map.tsx +130 -0
  127. package/examples/rag-graph.tsx +7 -7
  128. package/examples/release-card.tsx +5 -5
  129. package/examples/spec-anatomy.tsx +5 -5
  130. package/examples/system-architecture.tsx +19 -32
  131. package/examples/theme-system.tsx +1 -1
  132. package/examples/token-matrix.tsx +4 -2
  133. package/examples/transparent-badge.tsx +1 -2
  134. package/examples/videos/README.md +62 -0
  135. package/examples/videos/calculus-tangent.tsx +101 -0
  136. package/examples/videos/catalyst-pathway.tsx +56 -0
  137. package/examples/videos/causal-attention.tsx +91 -0
  138. package/examples/videos/convolution-kernel.tsx +34 -0
  139. package/examples/videos/gaussian-blur.tsx +32 -0
  140. package/examples/videos/image-to-matrix.tsx +22 -0
  141. package/examples/videos/matrix-multiplication.tsx +128 -0
  142. package/examples/videos/photo-gaussian-blur.tsx +39 -0
  143. package/examples/videos/request-lifecycle.tsx +99 -0
  144. package/examples/videos/signal-to-story.tsx +126 -0
  145. package/examples/videos/wave-interference.tsx +80 -0
  146. package/examples/vizmatic-bare.d.ts +1 -0
  147. package/examples/vizmatic-hero.tsx +9 -18
  148. package/examples/website-workflow.tsx +7 -7
  149. package/examples/weekend-field-notes.tsx +3 -2
  150. package/package.json +77 -12
@@ -0,0 +1,112 @@
1
+ import { V as VideoCodec } from './video-CcHW1qhV.cjs';
2
+ import { ThemeMode, RenderBackground, VideoFrameInfo, RgbaVideoOutput } from './index.cjs';
3
+ import { FromSvgOptions, SvgNode, CompileOverrides, CompiledFilm, FilmDefinition } from './stage.cjs';
4
+ import { ReactNode } from 'react';
5
+
6
+ interface FromComponentOptions extends FromSvgOptions {
7
+ /** Layout size of the component, in pixels. */
8
+ width: number;
9
+ height: number;
10
+ theme?: ThemeMode;
11
+ /** Canvas behind the component. Transparent by default, so it sits on the film. */
12
+ canvas?: RenderBackground;
13
+ /** Scale on stage. Layout stays at `width` and `height`, so dense text stays small. */
14
+ scale?: number;
15
+ }
16
+ /**
17
+ * Render any Vizmatic TSX component and return it as animatable vector nodes, so
18
+ * every existing diagram and chart can be written on, faded, and morphed.
19
+ * It runs in Node only, because it needs the layout engine:
20
+ *
21
+ * const flow = await fromComponent(<Flow c={c} stages={stages} />, { width: 900, height: 300 })
22
+ * s.play(write(flow))
23
+ */
24
+ declare function fromComponent(element: ReactNode, options: FromComponentOptions): Promise<SvgNode>;
25
+
26
+ type Quality = 'draft' | 'standard' | 'high' | 'master';
27
+
28
+ interface FilmRenderOptions extends CompileOverrides {
29
+ /** Output width in pixels. Defaults to the film's logical width. */
30
+ width?: number;
31
+ quality?: Quality;
32
+ /** Sub-frames averaged per frame for real motion blur. 1 turns it off. */
33
+ motionBlur?: number;
34
+ /** Fraction of the frame interval the shutter stays open. */
35
+ shutter?: number;
36
+ workers?: number;
37
+ /** Approximate limit in bytes for frame buffers held at one time. */
38
+ memoryBudget?: number;
39
+ from?: number;
40
+ to?: number;
41
+ audioPath?: string;
42
+ ffmpegPath?: string;
43
+ /** Encoder threads. Rasterizing is usually the slower step, so a few are enough. */
44
+ threads?: number;
45
+ signal?: AbortSignal;
46
+ onProgress?: (frame: VideoFrameInfo) => void | Promise<void>;
47
+ }
48
+ interface FilmVideoOutput extends RgbaVideoOutput {
49
+ title: string;
50
+ workers: number;
51
+ motionBlur: number;
52
+ codec: VideoCodec;
53
+ }
54
+ interface FilmGifOutput {
55
+ width: number;
56
+ height: number;
57
+ frameCount: number;
58
+ duration: number;
59
+ fps: number;
60
+ bytes: number;
61
+ outputPath: string;
62
+ title: string;
63
+ }
64
+ interface RenderPlan {
65
+ workers: number;
66
+ readAhead: number;
67
+ }
68
+ /**
69
+ * Limit how many full frames exist at once. A 4K frame is 33 MB, and a worker
70
+ * holds more than one while it rasterizes and composites, so a fixed read-ahead
71
+ * could use many gigabytes.
72
+ */
73
+ declare function planRender(width: number, height: number, motionBlur: number, options?: {
74
+ workers?: number;
75
+ memoryBudget?: number;
76
+ }): RenderPlan;
77
+ /** Encode a film to H.264 MP4 or VP9 WebM. Frames rasterize in parallel and encode in order. */
78
+ declare function renderFilmVideo(film: FilmDefinition | CompiledFilm, outputPath: string, options?: FilmRenderOptions & {
79
+ codec?: VideoCodec;
80
+ }): Promise<FilmVideoOutput>;
81
+ /**
82
+ * Encode a film as an optimized GIF with one shared palette. Only the changed
83
+ * rectangle of each frame is stored. FFmpeg is not needed.
84
+ */
85
+ declare function renderFilmGif(film: FilmDefinition | CompiledFilm, outputPath: string, options?: FilmRenderOptions & {
86
+ loop?: boolean;
87
+ }): Promise<FilmGifOutput>;
88
+ /** Render one moment to a PNG. */
89
+ declare function renderFilmFrame(film: FilmDefinition | CompiledFilm, time: number, outputPath: string, options?: FilmRenderOptions): Promise<{
90
+ width: number;
91
+ height: number;
92
+ outputPath: string;
93
+ }>;
94
+ /** Render many moments as PNG files, for review strips and posters. */
95
+ declare function renderFilmFrames(film: FilmDefinition | CompiledFilm, times: readonly number[], outputPrefix: string, options?: FilmRenderOptions): Promise<string[]>;
96
+ /** Write one moment as standalone SVG. Text is outlines, so no fonts are needed to view it. */
97
+ declare function renderFilmSvg(film: FilmDefinition | CompiledFilm, time: number, outputPath: string, options?: FilmRenderOptions): Promise<{
98
+ width: number;
99
+ height: number;
100
+ outputPath: string;
101
+ }>;
102
+ /**
103
+ * A good still for a thumbnail: the author's choice, or else the latest moment at
104
+ * rest that shows most of what the fullest moment shows. Mid-animation frames
105
+ * make poor posters, so only moments between animations qualify.
106
+ */
107
+ declare function posterTime(film: CompiledFilm): Promise<number>;
108
+ /** Captions as WebVTT, for a sidecar track. */
109
+ declare function captionsToVtt(film: CompiledFilm): string;
110
+
111
+ export { VideoCodec, captionsToVtt, fromComponent, planRender, posterTime, renderFilmFrame, renderFilmFrames, renderFilmGif, renderFilmSvg, renderFilmVideo };
112
+ export type { FilmGifOutput, FilmRenderOptions, FilmVideoOutput, FromComponentOptions, Quality, RenderPlan };
@@ -0,0 +1,112 @@
1
+ import { V as VideoCodec } from './video-CcHW1qhV.js';
2
+ import { ThemeMode, RenderBackground, VideoFrameInfo, RgbaVideoOutput } from './index.js';
3
+ import { FromSvgOptions, SvgNode, CompileOverrides, CompiledFilm, FilmDefinition } from './stage.js';
4
+ import { ReactNode } from 'react';
5
+
6
+ interface FromComponentOptions extends FromSvgOptions {
7
+ /** Layout size of the component, in pixels. */
8
+ width: number;
9
+ height: number;
10
+ theme?: ThemeMode;
11
+ /** Canvas behind the component. Transparent by default, so it sits on the film. */
12
+ canvas?: RenderBackground;
13
+ /** Scale on stage. Layout stays at `width` and `height`, so dense text stays small. */
14
+ scale?: number;
15
+ }
16
+ /**
17
+ * Render any Vizmatic TSX component and return it as animatable vector nodes, so
18
+ * every existing diagram and chart can be written on, faded, and morphed.
19
+ * It runs in Node only, because it needs the layout engine:
20
+ *
21
+ * const flow = await fromComponent(<Flow c={c} stages={stages} />, { width: 900, height: 300 })
22
+ * s.play(write(flow))
23
+ */
24
+ declare function fromComponent(element: ReactNode, options: FromComponentOptions): Promise<SvgNode>;
25
+
26
+ type Quality = 'draft' | 'standard' | 'high' | 'master';
27
+
28
+ interface FilmRenderOptions extends CompileOverrides {
29
+ /** Output width in pixels. Defaults to the film's logical width. */
30
+ width?: number;
31
+ quality?: Quality;
32
+ /** Sub-frames averaged per frame for real motion blur. 1 turns it off. */
33
+ motionBlur?: number;
34
+ /** Fraction of the frame interval the shutter stays open. */
35
+ shutter?: number;
36
+ workers?: number;
37
+ /** Approximate limit in bytes for frame buffers held at one time. */
38
+ memoryBudget?: number;
39
+ from?: number;
40
+ to?: number;
41
+ audioPath?: string;
42
+ ffmpegPath?: string;
43
+ /** Encoder threads. Rasterizing is usually the slower step, so a few are enough. */
44
+ threads?: number;
45
+ signal?: AbortSignal;
46
+ onProgress?: (frame: VideoFrameInfo) => void | Promise<void>;
47
+ }
48
+ interface FilmVideoOutput extends RgbaVideoOutput {
49
+ title: string;
50
+ workers: number;
51
+ motionBlur: number;
52
+ codec: VideoCodec;
53
+ }
54
+ interface FilmGifOutput {
55
+ width: number;
56
+ height: number;
57
+ frameCount: number;
58
+ duration: number;
59
+ fps: number;
60
+ bytes: number;
61
+ outputPath: string;
62
+ title: string;
63
+ }
64
+ interface RenderPlan {
65
+ workers: number;
66
+ readAhead: number;
67
+ }
68
+ /**
69
+ * Limit how many full frames exist at once. A 4K frame is 33 MB, and a worker
70
+ * holds more than one while it rasterizes and composites, so a fixed read-ahead
71
+ * could use many gigabytes.
72
+ */
73
+ declare function planRender(width: number, height: number, motionBlur: number, options?: {
74
+ workers?: number;
75
+ memoryBudget?: number;
76
+ }): RenderPlan;
77
+ /** Encode a film to H.264 MP4 or VP9 WebM. Frames rasterize in parallel and encode in order. */
78
+ declare function renderFilmVideo(film: FilmDefinition | CompiledFilm, outputPath: string, options?: FilmRenderOptions & {
79
+ codec?: VideoCodec;
80
+ }): Promise<FilmVideoOutput>;
81
+ /**
82
+ * Encode a film as an optimized GIF with one shared palette. Only the changed
83
+ * rectangle of each frame is stored. FFmpeg is not needed.
84
+ */
85
+ declare function renderFilmGif(film: FilmDefinition | CompiledFilm, outputPath: string, options?: FilmRenderOptions & {
86
+ loop?: boolean;
87
+ }): Promise<FilmGifOutput>;
88
+ /** Render one moment to a PNG. */
89
+ declare function renderFilmFrame(film: FilmDefinition | CompiledFilm, time: number, outputPath: string, options?: FilmRenderOptions): Promise<{
90
+ width: number;
91
+ height: number;
92
+ outputPath: string;
93
+ }>;
94
+ /** Render many moments as PNG files, for review strips and posters. */
95
+ declare function renderFilmFrames(film: FilmDefinition | CompiledFilm, times: readonly number[], outputPrefix: string, options?: FilmRenderOptions): Promise<string[]>;
96
+ /** Write one moment as standalone SVG. Text is outlines, so no fonts are needed to view it. */
97
+ declare function renderFilmSvg(film: FilmDefinition | CompiledFilm, time: number, outputPath: string, options?: FilmRenderOptions): Promise<{
98
+ width: number;
99
+ height: number;
100
+ outputPath: string;
101
+ }>;
102
+ /**
103
+ * A good still for a thumbnail: the author's choice, or else the latest moment at
104
+ * rest that shows most of what the fullest moment shows. Mid-animation frames
105
+ * make poor posters, so only moments between animations qualify.
106
+ */
107
+ declare function posterTime(film: CompiledFilm): Promise<number>;
108
+ /** Captions as WebVTT, for a sidecar track. */
109
+ declare function captionsToVtt(film: CompiledFilm): string;
110
+
111
+ export { VideoCodec, captionsToVtt, fromComponent, planRender, posterTime, renderFilmFrame, renderFilmFrames, renderFilmGif, renderFilmSvg, renderFilmVideo };
112
+ export type { FilmGifOutput, FilmRenderOptions, FilmVideoOutput, FromComponentOptions, Quality, RenderPlan };