vizmatic 0.1.42 → 0.3.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 +23 -4
- package/README.md +108 -2
- package/ROADMAP.md +10 -8
- package/assets/THIRD_PARTY_LICENSES.md +12 -0
- package/assets/licenses/Apache-2.0.txt +176 -0
- package/assets/licenses/harfbuzzjs-LICENSE.txt +22 -0
- package/dist/cli.js +28 -11214
- package/dist/index.cjs +2862 -262
- package/dist/index.d.cts +237 -10
- package/dist/index.d.ts +237 -10
- package/dist/index.js +2788 -191
- package/examples/README.md +4 -0
- package/examples/orthogonal-routing.tsx +25 -0
- package/examples/pareto-bar-chart.tsx +44 -0
- package/examples/pie-chart.tsx +46 -0
- package/examples/website-workflow.tsx +38 -0
- package/package.json +18 -13
package/PROMPT.md
CHANGED
|
@@ -39,6 +39,10 @@ vizmatic check ./frame.tsx --theme dark,light --json
|
|
|
39
39
|
|
|
40
40
|
Fix all errors before the final render. Warnings report low contrast, text below 11px, overlapping labels, uneven panel whitespace, connector congestion, and asset fallbacks. Overflow errors name the affected edges and suggest dimensions.
|
|
41
41
|
|
|
42
|
+
The [browser playground](https://bvolpato.github.io/vizmatic/playground.html) supports component composition, inline text edits, undo/redo, and local drafts. Choose Freeform canvas for positioned `Board` / `CanvasItem` editing with move and resize handles and snapping. Structured editors cover pie segments, bar categories, scatter points, table cells, line series, interval data, and graph nodes/edges/groups; computed data stays in TSX. Save project writes a named `.vizmatic.json` file containing source, output theme, and canvas background, and Open project restores it. PNG/SVG exports preserve the full canvas.
|
|
43
|
+
|
|
44
|
+
For scenes already created inside a build or editor, use the typed `checkFrame` API instead of writing a frame file and launching the CLI. Pass a React element as `scene` or use `create(theme)` for theme-specific scenes. Set `failOn` to `"warning"` when warnings should fail CI. Reports include per-theme dimensions and diagnostics with stable codes plus element IDs or rendered locations where available. Use `vizmatic check <files> --json` when the CLI should discover and load frame modules.
|
|
45
|
+
|
|
42
46
|
## Install in a project
|
|
43
47
|
|
|
44
48
|
Use the package manager already present in the project.
|
|
@@ -132,6 +136,8 @@ vizmatic frames --out public/vizmatic --theme dark,light --watermark "Your Produ
|
|
|
132
136
|
|
|
133
137
|
Generated `manifest.json` includes each output file plus its theme, path, width, and height.
|
|
134
138
|
|
|
139
|
+
The static CLI defaults to PNG. Add `--format svg` for vector output or `--format both` to render PNG and SVG together in every requested theme.
|
|
140
|
+
|
|
135
141
|
PNG and SVG renders have transparent backgrounds by default. Use the theme background when the image needs an opaque canvas:
|
|
136
142
|
|
|
137
143
|
```bash
|
|
@@ -146,6 +152,8 @@ Or set it in the frame:
|
|
|
146
152
|
</Scene>
|
|
147
153
|
```
|
|
148
154
|
|
|
155
|
+
CSS alpha colors are preserved in PNG/SVG backgrounds. Use `<Scene background="rgba(15, 23, 42, 0.5)">` or `--background 'rgba(15, 23, 42, 0.5)'` for a semi-transparent canvas. Leave the background unset for fully transparent output. Contrast checks composite alpha text and nested backgrounds over known solid surfaces; a transparent canvas has no known host-page backdrop.
|
|
156
|
+
|
|
149
157
|
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
158
|
|
|
151
159
|
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.
|
|
@@ -258,6 +266,8 @@ Frame helpers:
|
|
|
258
266
|
|
|
259
267
|
- `defineIllustration(build, defaultTheme?)`: `build: (c: ThemeColors) => ReactElement`, `defaultTheme?: ThemeMode = "dark"`. Returns `{ create(theme), default }`.
|
|
260
268
|
- `Canvas`: `children?`, `c`, `padding?: number = 40`, `justify?: "center" | "flex-start" | "space-between" | "space-around" = "center"`, `background?: string`. Default root background is alpha-transparent during PNG/SVG rendering.
|
|
269
|
+
- `Board`: `children?`, `c`, `width?: number = 960`, `height?: number = 540`, `background?: string`. Fixed relative canvas with a transparent default background; clips content outside its bounds. Match frame dimensions to the board. Dimensions must be finite, greater than zero, and at most 8192.
|
|
270
|
+
- `CanvasItem`: `children?`, `x: number`, `y: number`, `width?: number`, `height?: number`. Absolute position in logical board pixels. Coordinates must be finite. Explicit dimensions must be greater than zero and at most 8192; they supply the child's width/height props. With both dimensions set, chart primitives scale proportionally to fit their complete plotting layer, headings, legends, and footer inside the item. Use literal coordinates and dimensions for preview move/resize controls.
|
|
261
271
|
- `Scene`: `c`, `children`, `title?`, `subtitle?`, `padding?: number = 40`, `gap?: number = 24`, `justify?: "center" | "flex-start" | "space-between" | "space-around" = "flex-start"`, `align?: FlexAlign = "stretch"`, `contentWidth?: number | string = "100%"`, `background?`, `contentStyle?: React.CSSProperties`. Title/subtitle are optional and the title bar is omitted when no title is provided. Use `background={c.bg}` for an opaque theme frame.
|
|
262
272
|
- `TitleBar`: `title`, `subtitle?`, `c`.
|
|
263
273
|
|
|
@@ -314,11 +324,16 @@ Flows and process diagrams:
|
|
|
314
324
|
Graphs and networks:
|
|
315
325
|
|
|
316
326
|
- `LayeredNetwork`: `c`, `layers: LayeredNetworkLayer[]`, `activePath?: number[] = []`, `annotations?: string[] = []`, `formula?`, `legend?: string = "highlighted path"`, `width?: number = 900`, `height?: number = 400`, `nodeSize?: number = 56`, `showFormula?: boolean = true`. `LayeredNetworkLayer`: `title`, `nodes: string[]`, `tone?`.
|
|
317
|
-
- `GraphDiagram
|
|
327
|
+
- `GraphDiagram` routing options: `routing?: "dagre" | "straight" | "orthogonal" = "dagre"`, `routingClearance?: number = 12`. Dagre preserves existing routes; straight connects facing node sides; orthogonal avoids node boxes and group headers with right-angle paths. Node layout remains automatic or manual independently of routing. `GraphDiagramNode` additionally accepts `ports?: GraphDiagramPort[]`; a port is `{ id: string, side: "top" | "right" | "bottom" | "left", offset?: number = 0.5 }`. Offset is finite and in `[0, 1]`, running left to right or top to bottom. `GraphDiagramEdge` additionally accepts `fromPort?`, `toPort?`, `fromSide?`, and `toSide?`. An endpoint cannot combine a port reference with a side. Explicit anchors opt an edge into orthogonal geometry even in Dagre mode. Missing references, duplicate port IDs, and invalid offsets fail validation.
|
|
328
|
+
|
|
329
|
+
- Orthogonal routing separates parallel relationships, supports self-loops with distinct endpoint anchors, and uses `edgeGap` for lane spacing. It runs offline with limits of 64 node/header obstacles, 256 edges, 18,000 grid points per search, 54,000 search states per search, and 160,000 search states per diagram. A blocked path, unavailable separate lane, same-anchor self-loop, or exhausted limit omits that connector and emits a checker error with code `layout.connector_unroutable`. Increase canvas size or spacing, choose different sides/ports, or reduce clearance; do not publish missing connectors. See `examples/orthogonal-routing.tsx`.
|
|
330
|
+
|
|
331
|
+
- `GraphDiagram`: `nodes: GraphDiagramNode[]`, `edges: GraphDiagramEdge[]`, `groups?: GraphDiagramGroup[]`, `c`, `width?: number = 520`, `height?: number = 420`, `nodeWidth?: number = 150`, `nodeHeight?: number = 66`, `labelFontSize?: number = 14`, `detailFontSize?: number = 11`, `arrowSize?: number = 5`, `padding?: number = 28`, `layout?: "auto" | "manual"`, `direction?: "LR" | "RL" | "TB" | "BT" = "LR"`, `nodeGap?: number = 34`, `rankGap?: number = 64`, `edgeGap?: number = 14`, `sizing?: "content" | "fixed" = "content"`, `iconSize?: number = 20`, `id?`, `ariaLabel?`, `title?`, `description?`. `GraphDiagramNode`: `id`, `label`, `detail?`, `href?`, `title?`, `x?`, `y?`, `tone?`, `muted?`, `width?`, `height?`, `group?`, `icon?: IconName | DiagramIconDefinition | ReactElement`, `iconSize?`. Icon size is clamped inside its node; custom React elements own their theme colors and accessible label. `GraphDiagramGroup`: `id`, `label`, `detail?`, `parent?`, `tone?`, `muted?`. Groups nest through `parent` and require automatic layout. Omit coordinates on every node for automatic layout; array order is the stable tie-breaker and dimensions expand to fit unless `sizing="fixed"`. Set both coordinates on every node for manual normalized positioning when no groups are present. Mixed coordinate modes fail. `GraphDiagramEdge`: `id?`, `from`, `to`, `tone?`, `muted?`, `dashed?`, `label?`, `href?`, `title?`, `kind?: "sync" | "async" | "event" | "data" | "dependency" | "association"`, `style?: "solid" | "dashed" | "dotted"`, `arrow?: "forward" | "backward" | "both" | "none"`. Association edges default to no arrow. `title`, `description`, and `id` add structured SVG metadata and deterministic graph, node, and edge IDs. Nodes and edges can link to HTTP(S), `mailto:`, `tel:`, fragment, or relative URLs; unsupported schemes fail. Use these properties for `renderToSvg` and playground SVG downloads.
|
|
318
332
|
- `SequenceDiagram`: `participants`, ordered `items`, `c`, and optional `width`, `height`, spacing, title, subtitle, and `ariaLabel`. Participants have `id`, `label`, optional `detail`, `tone`, `kind`, and `icon`. Items are messages (`from`, `to`, `label`, `kind?: "sync" | "async" | "return"`), notes, activations, or recursive fragments with `kind: "alt" | "loop" | "parallel"` and labeled branches.
|
|
319
|
-
- `DataflowDiagram`: `nodes`, `edges`, optional nested `boundaries`, `c`, GraphDiagram sizing/layout props
|
|
320
|
-
- `DeploymentDiagram`: `nodes`, `connections`, optional nested `boundaries`, `c`, GraphDiagram sizing/layout props
|
|
321
|
-
- `
|
|
333
|
+
- `DataflowDiagram`: `nodes`, `edges`, optional nested `boundaries`, `c`, GraphDiagram sizing/layout props including `id`, `title`, and `description`, and `ariaLabel`. Nodes require `id`, `label`, and `kind: "source" | "transform" | "store" | "sink"`; optional schema metadata renders in node detail, with optional `href` and `title` for SVG links and tooltips. Edges use `mode?: "batch" | "stream"`, optional schema/label metadata, and optional `id`, `href`, and `title`.
|
|
334
|
+
- `DeploymentDiagram`: `nodes`, `connections`, optional nested `boundaries`, `c`, GraphDiagram sizing/layout props including `id`, `title`, and `description`, and `ariaLabel`. Boundaries distinguish region, zone, VPC, subnet, namespace, host, cluster, and trust scopes. Nodes declare infrastructure kind, boundary, and ports, with optional `href` and `title`. Connections declare ingress, egress, internal, or cross-boundary direction plus protocol and port references; `id`, `href`, and `title` add stable SVG identity and links.
|
|
335
|
+
- `DeploymentPort`: `id`, `port?`, `protocol?`, `label?`, `direction?: "ingress" | "egress" | "bidirectional"`, `side?: GraphPortSide`, `offset?: number`. With explicit `routing="straight"` or `routing="orthogonal"`, connection `fromPort` / `toPort` references require declared node ports and anchor geometrically. Side defaults follow graph direction and ingress/egress use; explicit side/offset overrides them. Default Dagre deployment rendering keeps the existing label-only behavior.
|
|
336
|
+
- `TransformerTopology`: `blocks`, optional `routes`, `c`, `expandRepeats?`, GraphDiagram sizing/layout props including `id`, `title`, and `description`, and `ariaLabel`. Blocks use embedding, attention, norm, MLP, residual, router, output, or custom kinds with tensor shapes and repeat counts, plus optional `href` and `title`. Routes use activation, residual, KV-cache, expert, or collective semantics, plus optional `id`, `href`, and `title`. `formatTensorShape(shape)` formats reusable shape metadata.
|
|
322
337
|
- `defineDiagramIcon(id, render)`: defines a reusable custom graph icon. `render` receives `c`, `color`, `size`, and optional `label`.
|
|
323
338
|
- `defineIconRegistry(icons)`: preserves typed names for a set of custom or provider icons without global mutable state.
|
|
324
339
|
- `TreeDiagram`: `root: TreeNodeSpec`, `c`, `title?`, `subtitle?`, `width?`, `height?`, `nodeWidth?: number = 156`, `nodeHeight?: number = 64`, `levelGap?: number = 58`, `siblingGap?: number = 24`, `padding?: number = 28`, `math?: boolean = false`. `TreeNodeSpec`: `label`, `id?`, `detail?`, `tone?`, `muted?`, `children?`.
|
|
@@ -332,8 +347,10 @@ Matrices and heatmaps:
|
|
|
332
347
|
Charts and plots:
|
|
333
348
|
|
|
334
349
|
- `ChartFrame`: `children`, `c`, `title?`, `subtitle?`, `legend?: ChartLegendItem[]`, `footer?`, `width?: number | string = "100%"`, `height?`, `padding?: number = 16`. `ChartLegendItem`: `label`, `color: ColorName | string`.
|
|
350
|
+
- `PieChart`: `segments: DonutChartSegment[]`, `c`, `title?`, `subtitle?`, `width?: number = 360`, `height?: number = 240`, `size?`, `format?: ChartValueFormat = "decimal"`, `showLegend?: boolean = true`, `footer?`. Each segment has `label`, `value`, optional `color`, and optional `valueLabel`. Values must be finite and non-negative; zero slices are omitted. The full-circle pie shows part-to-whole proportions, with values and shares in the legend. Use `examples/pie-chart.tsx` for a complete frame.
|
|
335
351
|
- `DonutChart`: `segments: DonutChartSegment[]`, `c`, `title?`, `subtitle?`, `width?: number = 360`, `height?: number = 230`, `size?`, `thickness?`, `format?: ChartValueFormat = "decimal"`, `centerLabel?`, `centerValue?`, `showLegend?: boolean = true`, `footer?`. `DonutChartSegment`: `label`, `value`, `color?`, `valueLabel?`.
|
|
336
352
|
- `BarChart`: `data: BarChartDatum[]`, `c`, `title?`, `subtitle?`, `width?: number = 320`, `height?: number = 220`, `min?`, `max?`, `format?: ChartValueFormat = "decimal"`, `showGrid?: boolean = true`, `showValues?: boolean = true`, `yAxisLabel?`, `footer?`. `BarChartDatum`: `label`, `value`, `color?`, `valueLabel?`.
|
|
353
|
+
- `ParetoBarChart`: `data: BarChartDatum[]`, `c`, `title?`, `subtitle?`, `width?: number = 520`, `height?: number = 300`, `format?: ChartValueFormat = "integer"`, `showGrid?: boolean = true`, `showValues?: boolean = true`, `footer?`. A classic categorical Pareto chart with descending bars and a cumulative percentage line, separate value/share axes, and stable tie order. Values must be finite and non-negative. Sorting preserves the input array. A positive total ends at 100%; an all-zero total stays at 0%. Use this for the causes behind a total, and `ParetoChart` for a non-dominated scatter frontier. See `examples/pareto-bar-chart.tsx`.
|
|
337
354
|
- `LineChart`: `series: LineChartSeries[]`, `c`, `title?`, `subtitle?`, `width?: number = 420`, `height?: number = 240`, `labels?`, `min?`, `max?`, `format?: ChartValueFormat = "decimal"`, `showGrid?: boolean = true`, `showPoints?: boolean = true`, `yAxisLabel?`, `footer?`. `LineChartSeries`: `name`, `points`, `color?`, `area?`.
|
|
338
355
|
- `ScatterPlot`: `points: ScatterPoint[]`, `c`, `title?`, `subtitle?`, `width?: number = 380`, `height?: number = 260`, `xMin?`, `xMax?`, `yMin?`, `yMax?`, `xAxisLabel?`, `yAxisLabel?`, `formatX?: ChartValueFormat = "decimal"`, `formatY?: ChartValueFormat = "decimal"`, `showGrid?: boolean = true`, `footer?`. `ScatterPoint`: `x`, `y`, `label?`, `color?`, `size?`.
|
|
339
356
|
- `ParetoChart`: `points: ScatterPoint[]`, `c`, `title?`, `subtitle?`, `width?: number = 640`, `height?: number = 360`, `xMin?`, `xMax?`, `yMin?`, `yMax?`, `xAxisLabel?`, `yAxisLabel?`, `formatX?: ChartValueFormat = "decimal"`, `formatY?: ChartValueFormat = "decimal"`, `showGrid?: boolean = true`, `xScale?: "linear" | "log" = "linear"`, `xObjective?: "minimize" | "maximize" = "minimize"`, `yObjective?: "minimize" | "maximize" = "maximize"`, `frontierColor?`, `showGoal?: boolean = true`, `goalLabel?`, `footer?`. It detects non-dominated points automatically; logarithmic x scales omit non-positive points.
|
|
@@ -364,6 +381,8 @@ SVG and geometry helpers:
|
|
|
364
381
|
|
|
365
382
|
Theme and render APIs:
|
|
366
383
|
|
|
384
|
+
- `checkFrame(frame, options?)`: Check `{ scene: ReactNode }` or `{ create(theme): ReactNode }` inputs. Frame metadata accepts `source?`, `width?`, `height?`, and `autoSize?`. Options accept `themes?: ThemeMode[]`, `background?: "transparent" | "theme" | CSS color`, and `failOn?: "error" | "warning" | "info" | "never"`; defaults are both themes, transparent background, and errors only. `ok` means diagnostics pass `failOn`; `rendered` means every requested theme completed rendering. Reports include per-theme `dimensions` and `diagnostics`, plus `summary` severity counts.
|
|
385
|
+
- `CHECK_DIAGNOSTIC_CODES`, `CheckDiagnostic`, `CheckDiagnosticCode`, `CheckDiagnosticLocation`, `CheckAutoSize`, `CheckAutoSizeAxes`, `CheckFrameInput`, `CheckFrameReport`, `CheckOptions`: Stable code list and TypeScript contracts for programmatic checks. Locations contain a React `path` or rendered `x`, `y`, `width`, and `height`; available element identifiers appear as `elementId` and `relatedElementIds` on diagnostics.
|
|
367
386
|
- `getThemeColors(mode, preset?)`: `mode: ThemeMode`; `preset?: "default" | "engineering"`. Use `engineering` for flat technical-blog figures with a light gray palette, left-aligned black titles, pastel nodes, thin neutral connectors, compact corners, no shadows, Inter labels, and JetBrains Mono annotations. In a bare frame, set `preset = "engineering";` before the JSX. Add `background={c.bg}` to `Scene` for an opaque light gray canvas; omit it for alpha transparency.
|
|
368
387
|
- `getToneColor(tone, c)`, `getToneFill(tone, c)`, `getToneGradient(tone)`, `getColor(name, c?)`, `getGradient(name)`, `heatColor(value)`.
|
|
369
388
|
- `getReadableColor(name, c)`: returns the semantic color variant with greatest contrast against `c.bgCard`.
|
package/README.md
CHANGED
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
<p align="center">
|
|
22
22
|
<a href="https://bvolpato.github.io/vizmatic/">Website</a> ·
|
|
23
23
|
<a href="https://bvolpato.github.io/vizmatic/playground.html">Playground</a> ·
|
|
24
|
+
<a href="https://bvolpato.github.io/vizmatic/components.html">Components</a> ·
|
|
25
|
+
<a href="https://bvolpato.github.io/vizmatic/agents.html">For agents</a> ·
|
|
24
26
|
<a href="examples">Examples</a> ·
|
|
25
27
|
<a href="PROMPT.md">Agent Prompt</a> ·
|
|
26
28
|
<a href="#api">API</a>
|
|
@@ -70,6 +72,18 @@ PNG and SVG renders have transparent backgrounds by default. Add `--background t
|
|
|
70
72
|
vizmatic ./frame.tsx --out ./dist/frames --theme dark,light --background theme
|
|
71
73
|
```
|
|
72
74
|
|
|
75
|
+
CSS alpha colors stay semi-transparent in PNG and SVG output. Set the canvas background in the frame or pass a quoted CSS color to `--background`:
|
|
76
|
+
|
|
77
|
+
```tsx
|
|
78
|
+
<Scene background="rgba(15, 23, 42, 0.5)">
|
|
79
|
+
<CalloutCard title="Alpha background" detail="The host page remains visible through the canvas." />
|
|
80
|
+
</Scene>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
vizmatic ./frame.tsx --background 'rgba(15, 23, 42, 0.5)'
|
|
85
|
+
```
|
|
86
|
+
|
|
73
87
|
When a 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.
|
|
74
88
|
|
|
75
89
|
Bare CLI frames do not need imports. Use a regular module when a frame needs helper code, data loading, other dependencies, animation, or direct renderer APIs.
|
|
@@ -109,6 +123,8 @@ Use the Vizmatic skill to turn this release workflow into an animated GIF for do
|
|
|
109
123
|
|
|
110
124
|
Skill source lives in [`.agents/skills/vizmatic`](.agents/skills/vizmatic). Review it before installing with `npx skills add bvolpato/vizmatic --list`.
|
|
111
125
|
|
|
126
|
+
The [agent guide](https://bvolpato.github.io/vizmatic/agents.html) explains installation and the check/render workflow. Agents can discover instructions through [llms.txt](https://bvolpato.github.io/vizmatic/llms.txt), load the [full context bundle](https://bvolpato.github.io/vizmatic/llms-full.txt), or read [runnable component examples as JSON](https://bvolpato.github.io/vizmatic/components.json).
|
|
127
|
+
|
|
112
128
|
Codex and Claude Code can also install Vizmatic as a plugin:
|
|
113
129
|
|
|
114
130
|
```bash
|
|
@@ -131,6 +147,12 @@ vizmatic ./frame.tsx --out ./dist/frames --theme dark,light --watermark "Acme" -
|
|
|
131
147
|
|
|
132
148
|
Each output directory includes `manifest.json`. `outputs` lists generated files, and `outputDetails` records theme, path, and pixel dimensions.
|
|
133
149
|
|
|
150
|
+
Static CLI renders default to PNG. Use `--format svg` for vector output or `--format both` to export PNG and SVG together. Each manifest output detail includes its `format`; both formats support themes, backgrounds, watermarks, cropping, and automatic canvas growth.
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
vizmatic ./frame.tsx --out ./visuals --theme dark,light --format both
|
|
154
|
+
```
|
|
155
|
+
|
|
134
156
|
Render an animation:
|
|
135
157
|
|
|
136
158
|
```bash
|
|
@@ -209,7 +231,7 @@ Vizmatic provides reusable layout, diagram, and chart primitives:
|
|
|
209
231
|
|
|
210
232
|
NCCL gallery examples cover five operations: Broadcast, AllReduce, AllGather, ReduceScatter, and AllToAll. Their diagrams follow NVIDIA's documented [collective operation semantics](https://docs.nvidia.com/deeplearning/nccl/user-guide/docs/usage/collectives.html): rooted transfer, reduction, rank-ordered gathering, reduced chunk ownership, and pairwise exchange.
|
|
211
233
|
|
|
212
|
-
More examples live in [`examples/`](examples).
|
|
234
|
+
More examples live in [`examples/`](examples). Browse the searchable [component catalog on the homepage](https://bvolpato.github.io/vizmatic/#component-browser), copy a focused example, or open it in the playground to edit and render both themes. The [full catalog](https://bvolpato.github.io/vizmatic/components.html) also includes category previews and source. [`PROMPT.md`](PROMPT.md) contains the full install, syntax, component, and verification reference for coding agents. [`ROADMAP.md`](ROADMAP.md) tracks the next C4, provider pack, UML, layout, and interoperability capabilities.
|
|
213
235
|
|
|
214
236
|
## Repository checks
|
|
215
237
|
|
|
@@ -266,11 +288,32 @@ Use these primitives before writing raw SVG or absolute-positioned layouts.
|
|
|
266
288
|
|---|---|
|
|
267
289
|
| `defineIllustration` | Wraps a theme-aware frame builder and exports `create(theme)` plus a default element. |
|
|
268
290
|
| `Canvas` | Low-level full-frame root with alpha-transparent default background, optional background fill, padding, and vertical alignment. |
|
|
291
|
+
| `Board` | Fixed canvas for freely positioned components, with explicit dimensions and an optional background. |
|
|
292
|
+
| `CanvasItem` | Positions and sizes a component at logical-pixel `x` / `y` coordinates. Charts fit their complete plotting layers, labels, and frame inside the item. |
|
|
269
293
|
| `Scene` | Standard frame wrapper with optional title/subtitle, content column, and theme-aware typography. |
|
|
270
294
|
| `TitleBar` | Shared title/subtitle block used by `Scene`. |
|
|
271
295
|
| `Row` / `Column` | Flex layout primitives with gap, alignment, wrapping, width, and height props. |
|
|
272
296
|
| `Stack` | Layered vertical stack for repeated cards, tokens, or processing layers. |
|
|
273
297
|
|
|
298
|
+
Use `Board` with `CanvasItem` for layouts that people can move and resize in the browser builder. Coordinates and sizes remain in the TSX source. Set the frame dimensions to match the board; the board clips content outside its bounds. With both item dimensions set, chart primitives scale proportionally to fit the complete chart, including wrapped headings, legends, and footers.
|
|
299
|
+
|
|
300
|
+
```tsx
|
|
301
|
+
width = 960;
|
|
302
|
+
height = 540;
|
|
303
|
+
|
|
304
|
+
<Board width={960} height={540}>
|
|
305
|
+
<CanvasItem x={40} y={40} width={280} height={160}>
|
|
306
|
+
<MetricCard label="Requests" value="1,240" tone="green" />
|
|
307
|
+
</CanvasItem>
|
|
308
|
+
<CanvasItem x={360} y={40} width={540} height={340}>
|
|
309
|
+
<PieChart title="Requests by outcome" format="integer" segments={[
|
|
310
|
+
{ label: "Successful", value: 82, color: "positive" },
|
|
311
|
+
{ label: "Retried", value: 18, color: "warning" },
|
|
312
|
+
]} />
|
|
313
|
+
</CanvasItem>
|
|
314
|
+
</Board>
|
|
315
|
+
```
|
|
316
|
+
|
|
274
317
|
#### Surfaces, labels, and cards
|
|
275
318
|
|
|
276
319
|
| Component | Use |
|
|
@@ -356,8 +399,18 @@ Use these primitives before writing raw SVG or absolute-positioned layouts.
|
|
|
356
399
|
|
|
357
400
|
Groups support unlimited nesting in automatic layout, reserve a boundary-header gutter, and clip long headers inside the boundary. Set `icon` to a built-in `IconName`, a React element, or a reusable icon from `defineDiagramIcon`; `defineIconRegistry` groups provider packs without a runtime registry. Icon size stays inside its node. Custom React elements own their theme colors and accessible label. Relationship `kind` selects solid, dashed, or dotted defaults, `style` overrides them, and `arrow` accepts `forward`, `backward`, `both`, or `none`. Associations default to no arrow.
|
|
358
401
|
|
|
402
|
+
Set `id`, `title`, and `description` for accessible SVG exports. Nodes and edges accept safe `href` links and tooltip `title` text. These semantics are included by `renderToSvg` and the playground SVG download; see the [SVG accessibility guide](docs/accessibility.md) for supported links and stable ID behavior.
|
|
403
|
+
|
|
359
404
|
Set `x` and `y` on every node for normalized manual positioning when no groups are present. Mixed coordinate modes fail with a clear error. Automatic layout treats node and edge array order as its stable tie-breaker and expands `width` or `height` when needed. Set `sizing="fixed"` to keep exact graph dimensions and let overflow checks report a canvas that is too small. Use `direction`, `nodeGap`, `rankGap`, and `edgeGap` to tune the result.
|
|
360
405
|
|
|
406
|
+
Connector routing is separate from node layout. The default `routing="dagre"` preserves existing geometry. Choose `routing="straight"` for direct connectors or `routing="orthogonal"` for right-angle routes that avoid node boxes and group headers. `routingClearance` defaults to 12 logical pixels; `edgeGap` separates parallel traffic. Orthogonal routing supports automatic and manual node positions, self-loops with distinct anchors, and separated parallel routes.
|
|
407
|
+
|
|
408
|
+
Declare node `ports` as `{ id, side, offset? }`, then reference them with edge `fromPort` / `toPort`. Sides are `top`, `right`, `bottom`, or `left`; offsets run from 0 to 1 along the side and default to 0.5. An edge can instead specify `fromSide` / `toSide`. Use either a port reference or a side for each endpoint. Explicit anchors also opt an edge into orthogonal geometry when the routing mode is Dagre. With explicit straight or orthogonal routing, `DeploymentDiagram` anchors declared port references and accepts port `side` / `offset` overrides.
|
|
409
|
+
|
|
410
|
+
Routing runs synchronously offline with limits of 64 node/header obstacles and 256 edges, plus bounded grid and search work. A blocked route, repeated route with no separate lane, or exhausted limit omits the affected connector and makes the checker report `layout.connector_unroutable` as an error. Increase spacing or canvas size, change anchors, or reduce clearance before publishing. Missing port references fail validation. See the [routed graph example](examples/orthogonal-routing.tsx).
|
|
411
|
+
|
|
412
|
+
The [import guide](docs/import.md) documents the supported Mermaid and D2 subsets and their structured source diagnostics.
|
|
413
|
+
|
|
361
414
|
#### Matrices, tables, and grids
|
|
362
415
|
|
|
363
416
|
| Component | Use |
|
|
@@ -374,22 +427,27 @@ Set `x` and `y` on every node for normalized manual positioning when no groups a
|
|
|
374
427
|
|---|---|
|
|
375
428
|
| `ChartFrame` | Shared chart wrapper with title, subtitle, footer, and theme-aware shell. |
|
|
376
429
|
| `AxisPlot` | Low-level axis plot for custom lines, paths, and plotted values. |
|
|
430
|
+
| `PieChart` | Full-circle part-to-whole chart with segment values, percentages, and a legend. |
|
|
377
431
|
| `DonutChart` | Part-to-whole chart with center label/value, segment labels, and shared chart styling. |
|
|
378
432
|
| `MiniBarChart` | Small bar chart for cards and dashboards. |
|
|
379
433
|
| `StackedBar` | Segmented horizontal bar with labels and percentages. |
|
|
380
434
|
| `BarChart` | Full bar chart with ticks, labels, values, grids, and formats. |
|
|
381
435
|
| `LineChart` | Multi-series line chart with optional area fill, points, labels, and grid. |
|
|
382
436
|
| `ScatterPlot` | Labeled scatter plot with axes, ticks, point sizing, and collision-aware labels. |
|
|
437
|
+
| `ParetoBarChart` | Categories sorted by descending count with a cumulative percentage line and separate count/share axes. |
|
|
383
438
|
| `ParetoChart` | Automatic non-dominated frontier for competing objectives, including log-scaled cost axes. |
|
|
384
439
|
| `QuadrantChart` | 2x2 decision matrix with numeric axes, configurable thresholds, labeled points, and optional region emphasis. |
|
|
385
440
|
| `IntervalPlot` | Timeline/range plot for spans, phases, latencies, and schedules. |
|
|
386
441
|
|
|
387
|
-
`
|
|
442
|
+
Use `PieChart` for category shares, `BarChart` for category values, `ScatterPlot` for paired numeric observations, and `ParetoBarChart` to identify the categories behind most of a total. Pie and Pareto bar values must be finite and non-negative; zero-valued pie slices are omitted. Pareto bars sort descending without changing the input array and preserve input order for equal values. The cumulative line reaches 100% when the total is positive. See the [pie](examples/pie-chart.tsx) and [Pareto bar](examples/pareto-bar-chart.tsx) examples.
|
|
443
|
+
|
|
444
|
+
`ParetoChart` shows a non-dominated scatter frontier for competing objectives. It defaults to minimizing x and maximizing y, which fits cost-versus-score comparisons. Set `xObjective` or `yObjective` for other tradeoffs. Non-positive x values are omitted on a logarithmic x-axis. `QuadrantChart` accepts raw numeric domains, threshold values, tick formats, and optional grid lines; omit them to keep normalized 0-1 coordinates and centered splits. Regions accept `emphasis: true` to give one decision region a stronger fill and border.
|
|
388
445
|
|
|
389
446
|
#### Rendering and verification
|
|
390
447
|
|
|
391
448
|
| API | Use |
|
|
392
449
|
|---|---|
|
|
450
|
+
| `checkFrame` | Check a React scene or themed frame and return typed diagnostics with configurable severity-based pass/fail. |
|
|
393
451
|
| `renderToPng` | Render React scene to PNG through Satori and resvg, with optional watermark, crop, scale, and overflow check. |
|
|
394
452
|
| `renderToPngWithOutput` | Render PNG and return logical dimensions, physical pixel dimensions, and painted `contentBounds`. |
|
|
395
453
|
| `CanvasOverflowError` | Typed clipping failure with canvas dimensions and per-edge overflow details. |
|
|
@@ -415,6 +473,36 @@ Set `x` and `y` on every node for normalized manual positioning when no groups a
|
|
|
415
473
|
|
|
416
474
|
Theme and chart helpers are public for custom primitives: `getReadableColor(name, c)` selects the highest-contrast semantic variant, `getReadableToneColor(tone, c, background?)` adapts tone text to a background, and `getReadableTextColor(background, c)` chooses a foreground meeting 4.5:1 contrast when possible. `createPlotArea(width, height, margin)` returns clamped chart geometry for custom axes and marks.
|
|
417
475
|
|
|
476
|
+
### Programmatic checking
|
|
477
|
+
|
|
478
|
+
Use `checkFrame` when a build, editor, or agent already has a React scene in memory. Pass `scene` for one fixed element or `create(theme)` for theme-specific elements:
|
|
479
|
+
|
|
480
|
+
```tsx
|
|
481
|
+
import { CalloutCard, Scene, checkFrame, getThemeColors } from "vizmatic"
|
|
482
|
+
|
|
483
|
+
const report = await checkFrame({
|
|
484
|
+
source: "agent-pipeline",
|
|
485
|
+
width: 640,
|
|
486
|
+
height: 360,
|
|
487
|
+
create(theme) {
|
|
488
|
+
const c = getThemeColors(theme)
|
|
489
|
+
return (
|
|
490
|
+
<Scene c={c}>
|
|
491
|
+
<CalloutCard c={c} title="Ready" detail="Checked in-process" tone="green" />
|
|
492
|
+
</Scene>
|
|
493
|
+
)
|
|
494
|
+
},
|
|
495
|
+
}, {
|
|
496
|
+
themes: ["dark", "light"],
|
|
497
|
+
background: "theme",
|
|
498
|
+
failOn: "warning",
|
|
499
|
+
})
|
|
500
|
+
|
|
501
|
+
if (!report.ok) throw new Error(`Visual check failed: ${report.summary.errors} errors`)
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
`failOn` accepts `"error"` (the default), `"warning"`, `"info"`, or `"never"`. `report.ok` means the diagnostics pass that policy; `report.rendered` means every requested theme completed rendering. Each theme report includes resolved and output dimensions, stable diagnostic codes, and severity counts. Diagnostics expose `elementId`, related IDs, and a `location` path or rendered bounds when available. Import `CHECK_DIAGNOSTIC_CODES`, `CheckDiagnostic`, `CheckFrameInput`, and `CheckFrameReport` for typed integrations. Use `vizmatic check ... --json` when the checker should discover and load frame files itself.
|
|
505
|
+
|
|
418
506
|
### Rendering
|
|
419
507
|
|
|
420
508
|
```ts
|
|
@@ -488,12 +576,30 @@ await renderAnimationGif(createAnimation("dark"), {
|
|
|
488
576
|
|
|
489
577
|
## Development
|
|
490
578
|
|
|
579
|
+
See [`CONTRIBUTING.md`](CONTRIBUTING.md) for setup, testing, visual review, dependency updates, and pull request guidance.
|
|
580
|
+
|
|
491
581
|
```bash
|
|
492
582
|
pnpm install
|
|
493
583
|
pnpm verify
|
|
494
584
|
pnpm site:serve
|
|
495
585
|
```
|
|
496
586
|
|
|
587
|
+
The homepage, Components page, and Playground share a live component explorer. Choose a component to open its focused example, or use Add to scene to compose several components. Select an element to edit that instance's literal props, duplicate or remove it, and move it within its group. Controls follow inline text and TSX edits. Computed props and expression-generated structure stay editable in the TSX. Preview framing and zoom preserve the full canvas in downloaded PNG and SVG files.
|
|
588
|
+
|
|
589
|
+
Choose the Freeform canvas template for a positioned builder. Move and resize `CanvasItem` components through the preview handles, use grid snapping, or adjust their literal coordinates in the inspector. Arrow keys nudge a focused handle; Shift makes a larger move and Alt bypasses snapping. The layout remains ordinary `Board` / `CanvasItem` TSX.
|
|
590
|
+
|
|
591
|
+
Structured data editors let you add, remove, and change pie segments, bar categories, scatter points, and table cells. Line series, interval data, and graph nodes, edges, and groups have JSON editors. Invalid shapes and missing graph node references report an error before changing the source. Computed data remains editable in TSX.
|
|
592
|
+
|
|
593
|
+
Edits are saved locally in this browser and restore after reload. Component, shared-source, and gallery links open their own examples. Editing clears the original example or source bookmark so reload can recover your draft. Undo and redo cover source typing, controls, inline text, and scene operations, with up to 100 source snapshots for the current session. Use the buttons or Ctrl/Command+Z and Ctrl/Command+Shift+Z. Drafts do not sync between devices; use Save project to download a named `.vizmatic.json` file containing source, output theme, and canvas background, then Open project to restore it. Share and Copy source also let you move your TSX between tools.
|
|
594
|
+
|
|
595
|
+
Double-click a text label in the preview to edit its literal TSX value. Press Enter or click outside to save, Shift+Enter for a new line, or Escape to cancel. Keyboard users can focus a label and press Enter or F2. Labels derived from computed expressions or ambiguous source values stay editable in the TSX editor.
|
|
596
|
+
|
|
597
|
+
Choose the Animation scene template to play, pause, scrub time, and export a GIF in the browser. Bare animated source declares `animationDuration = 3` and optionally `animationFps = 10` before setup code. The injected `t` variable is time in seconds; Vizmatic timeline helpers continue to use milliseconds. Gallery timeline animations are adapted to the same browser workflow. Browser GIFs use the selected theme background, with limits of 120 frames, 2 million pixels per frame, and 60 million pixels total. Static CLI render and check evaluate these snippets at `t=0`. Use a CLI animation module for larger animations or transparent GIF output.
|
|
598
|
+
|
|
599
|
+
The generated `components.json` includes compiler-derived prop types, requiredness, and finite allowed-value references. Shared value lists live in `propEnums`; defaults are not inferred. Full TypeScript definitions remain the contract for structured data and React values.
|
|
600
|
+
|
|
601
|
+
The website is generated from `docs/*.template.html`, the shared shell in `scripts/site-shell.ts`, and the component registry. Run `pnpm site:build` after editing these sources, then `pnpm docs:check`. Use `pnpm site:serve` for browser validation. The generated agent references, property controls, and example adapters update with the same build. If the bundled fonts change, regenerate the website's WOFF2 files with `pnpm site:fonts` using uv.
|
|
602
|
+
|
|
497
603
|
## Publishing
|
|
498
604
|
|
|
499
605
|
Prepare release commit locally, push it to protected `main`, and wait for required CI before pushing its tag:
|
package/ROADMAP.md
CHANGED
|
@@ -12,16 +12,22 @@ Benchmarks: [Diagrams](https://diagrams.mingrammer.com/), [D2](https://d2lang.co
|
|
|
12
12
|
- Reusable custom icon definitions and typed icon registries.
|
|
13
13
|
- Labeled synchronous, asynchronous, event, data, dependency, and association relationships.
|
|
14
14
|
- Solid, dashed, and dotted connectors with forward, backward, bidirectional, or no arrows.
|
|
15
|
+
- Named ports and endpoint sides, with straight or obstacle-aware orthogonal routing and separated parallel connectors.
|
|
15
16
|
- Manual positioning for ungrouped editorial diagrams.
|
|
16
17
|
- Connector diagnostics for crossings, label collisions, crowded endpoints, and parallel routes.
|
|
18
|
+
- Typed in-process visual checks with stable diagnostic codes, element locations where available, and configurable failure policy.
|
|
17
19
|
- Dark, light, and Engineering visual presets with PNG, SVG, and GIF output.
|
|
20
|
+
- Accessible SVG titles, descriptions, stable element IDs, and optional links for graph diagrams and their typed graph views.
|
|
21
|
+
- Conservative Mermaid flowchart and D2 text import with explicit diagnostics for unsupported or lossy syntax.
|
|
18
22
|
- Typed state timelines with holds, eased tweens, keyframes, parallel tracks, deterministic sampling, and streamed GIF encoding.
|
|
19
|
-
- Sequence diagrams with participants, lifelines, activations, notes, and `alt`, `loop`, or `parallel` fragments.
|
|
23
|
+
- Sequence diagrams with participants, lifelines, activations, sync/async/return messages, notes, and `alt`, `loop`, or `parallel` fragments.
|
|
20
24
|
- Typed batch/stream dataflow and lineage views with schema metadata.
|
|
21
25
|
- Deployment and network views with nested boundaries, ports, protocols, and trust direction.
|
|
22
26
|
- Transformer topology views with tensor shapes, repeated blocks, residual/cache/expert routes, and collectives.
|
|
23
27
|
- Cadence-boundary animation sampling, per-frame overflow detection, and opaque delta-frame GIF encoding.
|
|
24
28
|
- Compressed offline Twemoji bundle instead of thousands of package entries.
|
|
29
|
+
- Positioned browser builder with editable text and chart data, drag/resize, undo/redo, local drafts, and portable project files.
|
|
30
|
+
- Pie, donut, bar, line, scatter, classic Pareto bar, Pareto frontier, quadrant, and interval charts.
|
|
25
31
|
|
|
26
32
|
## Next capability batches
|
|
27
33
|
|
|
@@ -44,25 +50,21 @@ Specialized APIs remain declarative and reusable. Examples contain complete scen
|
|
|
44
50
|
|
|
45
51
|
### Interaction and software design
|
|
46
52
|
|
|
47
|
-
- Sequence diagrams with participants, lifelines, activations, sync/async/return messages, notes, and `alt`/`loop`/`parallel` fragments.
|
|
48
53
|
- UML class and component diagrams with compartments, inheritance, aggregation, composition, multiplicity, and stereotypes.
|
|
49
54
|
- State machines with nested states, guards, entry/exit actions, and parallel regions.
|
|
50
55
|
- ER diagrams with tables, fields, keys, data types, and cardinality-aware relationships.
|
|
51
56
|
|
|
52
57
|
### Infrastructure and data systems
|
|
53
58
|
|
|
54
|
-
- Deployment and network views with regions, zones, VPCs, subnets, namespaces, hosts, ports, protocols, trust boundaries, and ingress/egress.
|
|
55
|
-
- Dataflow and lineage views with sources, sinks, stores, transformations, schemas, and batch/stream semantics.
|
|
56
59
|
- Swimlanes and activity diagrams for ownership, handoffs, conditions, and parallel work.
|
|
57
60
|
|
|
58
61
|
### Layout and rendering
|
|
59
62
|
|
|
60
|
-
-
|
|
61
|
-
- Orthogonal, curved, and user-routed connectors with parallel-edge separation.
|
|
63
|
+
- Curved and user-routed connectors with editable waypoints.
|
|
62
64
|
- Layout adapter interface with Dagre as default and ELK as optional backend.
|
|
63
65
|
- Per-boundary direction, collapsed groups, named scenarios, and reusable animation compositions.
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
+
- Extend structured SVG accessibility beyond graph diagrams to charts and other visual primitives.
|
|
67
|
+
- Expand Mermaid and D2 interoperability, and add Structurizr, Kubernetes, and Terraform adapters where semantics map safely.
|
|
66
68
|
|
|
67
69
|
## Design constraints
|
|
68
70
|
|
|
@@ -20,9 +20,21 @@ runtime fetches.
|
|
|
20
20
|
|
|
21
21
|
Full license: [`licenses/OFL-1.1.txt`](licenses/OFL-1.1.txt).
|
|
22
22
|
|
|
23
|
+
The website uses WOFF2 copies of the same Inter and JetBrains Mono font files.
|
|
24
|
+
Regenerate them with `pnpm site:fonts`; the original font licenses apply.
|
|
25
|
+
|
|
23
26
|
## Emoji
|
|
24
27
|
|
|
25
28
|
- Twemoji SVG assets from `@twemoji/svg@15.0.0`: MIT.
|
|
26
29
|
Copyright (c) 2023 Samuel Kopp.
|
|
27
30
|
Source: https://github.com/boywithkeyboard/twemoji_svg
|
|
28
31
|
Full license: [`licenses/twemoji-svg-MIT.txt`](licenses/twemoji-svg-MIT.txt).
|
|
32
|
+
|
|
33
|
+
## Browser text shaping
|
|
34
|
+
|
|
35
|
+
- HarfBuzzJS 0.10.0 JavaScript and `hb.wasm`: MIT, with Apache-2.0 portions
|
|
36
|
+
from Zephyr libc (`zephyr-string.c`) and Emscripten (`emmalloc.cpp`).
|
|
37
|
+
Copyright (c) 2019 Ebrahim Byagowi.
|
|
38
|
+
Source: https://github.com/harfbuzz/harfbuzzjs
|
|
39
|
+
Full notices: [`licenses/harfbuzzjs-LICENSE.txt`](licenses/harfbuzzjs-LICENSE.txt)
|
|
40
|
+
and [`licenses/Apache-2.0.txt`](licenses/Apache-2.0.txt).
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Apache license for Zephyr libc implementations (zephyr-string.c),
|
|
2
|
+
emmalloc.cpp (from emscripten project) and MIT for rest of the project
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2019 Ebrahim Byagowi
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|