vizmatic 0.1.7 → 0.1.8

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.
@@ -1,44 +1,34 @@
1
- import React from 'react'
2
- import { DataTable, defineIllustration, Flow, Panel, Row, Scene, TextLabel } from 'vizmatic'
1
+ width = 1040;
2
+ height = 680;
3
3
 
4
- export const width = 1040
5
- export const height = 680
6
-
7
- const frame = defineIllustration((c) =>
8
- <Scene c={c} title="Scene spec anatomy" subtitle="strong defaults with escape hatches" gap={18}>
9
- <Row gap={18} align="stretch">
10
- <Panel c={c} title="Spec fields" tone="purple" width={420} align="center">
11
- <DataTable
12
- c={c}
13
- firstColWidth={110}
14
- cellWidth={210}
15
- cellHeight={34}
16
- rows={[
17
- ['field', 'meaning'],
18
- ['canvas', 'width, height, theme'],
19
- ['layout', 'row, column, flow, grid'],
20
- ['content', 'labels, metrics, chart data'],
21
- ['tone', 'semantic color token'],
22
- ['verify', 'overflow and bounds'],
23
- ]}
24
- />
25
- </Panel>
26
- <Panel c={c} title="Render path" tone="cyan" width={520}>
27
- <Flow
28
- c={c}
29
- direction="vertical"
30
- stages={[
31
- { title: 'Validate', subtitle: 'typed module or schema', tone: 'blue', width: 430 },
32
- { title: 'Compose', subtitle: 'React primitive tree', tone: 'purple', width: 430 },
33
- { title: 'Render', subtitle: 'Satori + resvg', tone: 'cyan', width: 430 },
34
- { title: 'Verify', subtitle: 'crop, contrast, overflow', tone: 'green', width: 430 },
35
- ]}
36
- />
37
- <TextLabel c={c} text="Use raw SVG only where custom geometry is the point." align="center" width={440} />
38
- </Panel>
39
- </Row>
40
- </Scene>
41
- )
42
-
43
- export const create = frame.create
44
- export default frame.default
4
+ <Scene title="Scene spec anatomy" subtitle="strong defaults with escape hatches" gap={18}>
5
+ <Row gap={18} align="stretch">
6
+ <Panel title="Spec fields" tone="purple" width={420} align="center">
7
+ <DataTable
8
+ firstColWidth={110}
9
+ cellWidth={210}
10
+ cellHeight={34}
11
+ rows={[
12
+ ['field', 'meaning'],
13
+ ['canvas', 'width, height, theme'],
14
+ ['layout', 'row, column, flow, grid'],
15
+ ['content', 'labels, metrics, chart data'],
16
+ ['tone', 'semantic color token'],
17
+ ['verify', 'overflow and bounds'],
18
+ ]}
19
+ />
20
+ </Panel>
21
+ <Panel title="Render path" tone="cyan" width={520}>
22
+ <Flow
23
+ direction="vertical"
24
+ stages={[
25
+ { title: 'Validate', subtitle: 'typed module or schema', tone: 'blue', width: 430 },
26
+ { title: 'Compose', subtitle: 'React primitive tree', tone: 'purple', width: 430 },
27
+ { title: 'Render', subtitle: 'Satori + resvg', tone: 'cyan', width: 430 },
28
+ { title: 'Verify', subtitle: 'crop, contrast, overflow', tone: 'green', width: 430 },
29
+ ]}
30
+ />
31
+ <TextLabel text="Use raw SVG only where custom geometry is the point." align="center" width={440} />
32
+ </Panel>
33
+ </Row>
34
+ </Scene>
@@ -1,30 +1,22 @@
1
- import React from 'react'
2
- import { CalloutCard, Column, defineIllustration, MetricCard, Panel, Row, Scene, StepCard, TextLabel, ToneStrip } from 'vizmatic'
1
+ width = 1040;
2
+ height = 560;
3
3
 
4
- export const width = 1040
5
- export const height = 560
4
+ const tones = ['blue', 'purple', 'green', 'warm', 'cyan', 'pink', 'critical', 'ocean'] as const;
6
5
 
7
- const tones = ['blue', 'purple', 'green', 'warm', 'cyan', 'pink', 'critical', 'ocean'] as const
8
-
9
- const frame = defineIllustration((c) =>
10
- <Scene c={c} title="Theme-aware primitives" subtitle="semantic tones, not hard-coded colors" gap={18}>
11
- <Row gap={14} wrap width="100%">
12
- {tones.map((tone) => (
13
- <Panel key={tone} c={c} title={tone} tone={tone} width={225} minHeight={106}>
14
- <Column gap={9} align="stretch">
15
- <ToneStrip tone={tone} width={62} />
16
- <TextLabel c={c} text="inherits border, fill, label, and chart color" fontSize={11} />
17
- </Column>
18
- </Panel>
19
- ))}
20
- </Row>
21
- <Row gap={14}>
22
- <StepCard c={c} tone="purple" title="Spec first" subtitle="models write intent" width={210} />
23
- <MetricCard c={c} tone="green" label="Themes" value="2 modes" detail="dark + light" width={180} />
24
- <CalloutCard c={c} tone="ocean" title="Adapters own the brand" detail="Bring your own palette and typography." width={430} />
25
- </Row>
26
- </Scene>
27
- )
28
-
29
- export const create = frame.create
30
- export default frame.default
6
+ <Scene title="Theme-aware primitives" subtitle="semantic tones, not hard-coded colors" gap={18}>
7
+ <Row gap={14} wrap width="100%">
8
+ {tones.map((tone) => (
9
+ <Panel key={tone} title={tone} tone={tone} width={225} minHeight={106}>
10
+ <Column gap={9} align="stretch">
11
+ <ToneStrip tone={tone} width={62} />
12
+ <TextLabel text="inherits border, fill, label, and chart color" fontSize={11} />
13
+ </Column>
14
+ </Panel>
15
+ ))}
16
+ </Row>
17
+ <Row gap={14}>
18
+ <StepCard tone="purple" title="Spec first" subtitle="models write intent" width={210} />
19
+ <MetricCard tone="green" label="Themes" value="2 modes" detail="dark + light" width={180} />
20
+ <CalloutCard tone="ocean" title="Adapters own the brand" detail="Bring your own palette and typography." width={430} />
21
+ </Row>
22
+ </Scene>
@@ -1,49 +1,39 @@
1
- import React from 'react'
2
- import { Column, DataTable, defineIllustration, Grid, Panel, Row, Scene, TextLabel } from 'vizmatic'
1
+ width = 1040;
2
+ height = 560;
3
3
 
4
- export const width = 1040
5
- export const height = 560
4
+ const heat = ['#172033', '#123044', '#0f4a58', '#126a5b', '#6c7f2c', '#b46b24', '#d54545'];
6
5
 
7
- const heat = ['#172033', '#123044', '#0f4a58', '#126a5b', '#6c7f2c', '#b46b24', '#d54545']
8
-
9
- const frame = defineIllustration((c) =>
10
- <Scene c={c} title="Token matrix view" subtitle="tables and grids use wrapping-safe cells" gap={18}>
11
- <Row gap={18} align="stretch">
12
- <Panel c={c} title="Attention weights" tone="purple" width={480} align="center">
13
- <Grid
14
- c={c}
15
- cellWidth={48}
16
- cellHeight={34}
17
- headerRows={1}
18
- headerCols={1}
6
+ <Scene title="Token matrix view" subtitle="tables and grids use wrapping-safe cells" gap={18}>
7
+ <Row gap={18} align="stretch">
8
+ <Panel title="Attention weights" tone="purple" width={480} align="center">
9
+ <Grid
10
+ cellWidth={48}
11
+ cellHeight={34}
12
+ headerRows={1}
13
+ headerCols={1}
14
+ rows={[
15
+ ['', 'the', 'cat', 'sat', 'down'],
16
+ ['the', { label: '.91', backgroundColor: heat[6] }, { label: '.04', backgroundColor: heat[1] }, { label: '.03', backgroundColor: heat[1] }, { label: '.02', backgroundColor: heat[0] }],
17
+ ['cat', { label: '.10', backgroundColor: heat[2] }, { label: '.70', backgroundColor: heat[5] }, { label: '.14', backgroundColor: heat[3] }, { label: '.06', backgroundColor: heat[1] }],
18
+ ['sat', { label: '.05', backgroundColor: heat[1] }, { label: '.22', backgroundColor: heat[4] }, { label: '.61', backgroundColor: heat[5] }, { label: '.12', backgroundColor: heat[2] }],
19
+ ['down', { label: '.03', backgroundColor: heat[0] }, { label: '.09', backgroundColor: heat[2] }, { label: '.18', backgroundColor: heat[3] }, { label: '.70', backgroundColor: heat[5] }],
20
+ ]}
21
+ />
22
+ </Panel>
23
+ <Panel title="Feature table" tone="cyan" width={420} align="center">
24
+ <Column gap={12}>
25
+ <DataTable
26
+ firstColWidth={98}
27
+ cellWidth={76}
19
28
  rows={[
20
- ['', 'the', 'cat', 'sat', 'down'],
21
- ['the', { label: '.91', backgroundColor: heat[6] }, { label: '.04', backgroundColor: heat[1] }, { label: '.03', backgroundColor: heat[1] }, { label: '.02', backgroundColor: heat[0] }],
22
- ['cat', { label: '.10', backgroundColor: heat[2] }, { label: '.70', backgroundColor: heat[5] }, { label: '.14', backgroundColor: heat[3] }, { label: '.06', backgroundColor: heat[1] }],
23
- ['sat', { label: '.05', backgroundColor: heat[1] }, { label: '.22', backgroundColor: heat[4] }, { label: '.61', backgroundColor: heat[5] }, { label: '.12', backgroundColor: heat[2] }],
24
- ['down', { label: '.03', backgroundColor: heat[0] }, { label: '.09', backgroundColor: heat[2] }, { label: '.18', backgroundColor: heat[3] }, { label: '.70', backgroundColor: heat[5] }],
29
+ ['metric', 'base', 'tuned', 'delta'],
30
+ ['BLEU', '31.2', '34.8', '+3.6'],
31
+ ['faith', '.72', '.81', '+.09'],
32
+ ['latency', '1.3s', '1.1s', '-.2s'],
25
33
  ]}
26
34
  />
27
- </Panel>
28
- <Panel c={c} title="Feature table" tone="cyan" width={420} align="center">
29
- <Column gap={12}>
30
- <DataTable
31
- c={c}
32
- firstColWidth={98}
33
- cellWidth={76}
34
- rows={[
35
- ['metric', 'base', 'tuned', 'delta'],
36
- ['BLEU', '31.2', '34.8', '+3.6'],
37
- ['faith', '.72', '.81', '+.09'],
38
- ['latency', '1.3s', '1.1s', '-.2s'],
39
- ]}
40
- />
41
- <TextLabel c={c} text="Same component renders dark and light themes without rewriting cells." align="center" width={330} />
42
- </Column>
43
- </Panel>
44
- </Row>
45
- </Scene>
46
- )
47
-
48
- export const create = frame.create
49
- export default frame.default
35
+ <TextLabel text="Same component renders dark and light themes without rewriting cells." align="center" width={330} />
36
+ </Column>
37
+ </Panel>
38
+ </Row>
39
+ </Scene>
@@ -0,0 +1,30 @@
1
+ export {}
2
+
3
+ type AutoTheme<T> = T extends (props: infer Props) => infer Result
4
+ ? (props: Omit<Props, 'c'> & { c?: Props extends { c: infer Theme } ? Theme : never }) => Result
5
+ : T
6
+
7
+ declare global {
8
+ var width: number
9
+ var height: number
10
+
11
+ const BarChart: AutoTheme<typeof import('../src').BarChart>
12
+ const CalloutCard: AutoTheme<typeof import('../src').CalloutCard>
13
+ const Column: AutoTheme<typeof import('../src').Column>
14
+ const DataTable: AutoTheme<typeof import('../src').DataTable>
15
+ const Flow: AutoTheme<typeof import('../src').Flow>
16
+ const GraphDiagram: AutoTheme<typeof import('../src').GraphDiagram>
17
+ const Grid: AutoTheme<typeof import('../src').Grid>
18
+ const LayeredNetwork: AutoTheme<typeof import('../src').LayeredNetwork>
19
+ const LineChart: AutoTheme<typeof import('../src').LineChart>
20
+ const MetricCard: AutoTheme<typeof import('../src').MetricCard>
21
+ const MiniBarChart: AutoTheme<typeof import('../src').MiniBarChart>
22
+ const Panel: AutoTheme<typeof import('../src').Panel>
23
+ const QuadrantChart: AutoTheme<typeof import('../src').QuadrantChart>
24
+ const Row: AutoTheme<typeof import('../src').Row>
25
+ const ScatterPlot: AutoTheme<typeof import('../src').ScatterPlot>
26
+ const Scene: AutoTheme<typeof import('../src').Scene>
27
+ const StepCard: AutoTheme<typeof import('../src').StepCard>
28
+ const TextLabel: AutoTheme<typeof import('../src').TextLabel>
29
+ const ToneStrip: AutoTheme<typeof import('../src').ToneStrip>
30
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vizmatic",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "Theme-aware visual primitives and render pipeline for AI-generated diagrams, figures, and presentation frames.",
5
5
  "type": "module",
6
6
  "license": "MIT",