@arach/arc 0.4.1 → 0.4.3

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 (5) hide show
  1. package/README.md +104 -9
  2. package/lib/arc.es.js +14580 -14144
  3. package/lib/arc.umd.js +116 -107
  4. package/lib/index.d.ts +703 -112
  5. package/package.json +20 -12
package/README.md CHANGED
@@ -1,8 +1,87 @@
1
+ <div align="center">
2
+
1
3
  # Arc
2
4
 
3
- A visual diagram editor for creating architecture diagrams. Design visually, export as code.
5
+ ### Design architecture diagrams visually. Ship them as code.
6
+
7
+ Arc is a React component **and** a visual editor for building clean, themeable
8
+ architecture diagrams — then exporting them as **TypeScript, JSON, SVG, PNG, or
9
+ crisp ASCII**. Design in the canvas, drop the component in your app, or render
10
+ straight to text for a README. Same diagram, everywhere.
11
+
12
+ [![npm version](https://img.shields.io/npm/v/@arach/arc.svg?color=6d5efc&label=%40arach%2Farc)](https://www.npmjs.com/package/@arach/arc)
13
+ [![license](https://img.shields.io/npm/l/@arach/arc.svg?color=41b883)](./LICENSE)
14
+ [![types](https://img.shields.io/npm/types/@arach/arc.svg?color=3b82f6)](./lib/index.d.ts)
15
+
16
+ ![A microservices architecture rendered by Arc's ArcDiagram component in the Engineering theme](public/hero.png)
17
+
18
+ <sub>Not a screenshot of a drawing tool — that's the config in <a href="#example-output">Example Output</a>, rendered by <code>&lt;ArcDiagram /&gt;</code> in the Engineering theme.</sub>
19
+
20
+ </div>
21
+
22
+ ---
23
+
24
+ ## Install
4
25
 
5
- ![Arc Editor](public/og-editor.png)
26
+ ```bash
27
+ npm install @arach/arc
28
+ # or: bun add @arach/arc · pnpm add @arach/arc · yarn add @arach/arc
29
+ ```
30
+
31
+ `react`, `react-dom`, and `lucide-react` are peer dependencies.
32
+
33
+ ## Quick Start
34
+
35
+ Render any diagram config as a polished, interactive component:
36
+
37
+ ```tsx
38
+ import { ArcDiagram } from '@arach/arc'
39
+ import type { ArcDiagramData } from '@arach/arc'
40
+
41
+ export function Architecture() {
42
+ return (
43
+ <ArcDiagram
44
+ data={diagram} // your ArcDiagramData (see below)
45
+ theme="default" // seven themes, each with light & dark
46
+ mode="dark" // light · dark
47
+ defaultZoom="fit" // auto-fit to the container
48
+ />
49
+ )
50
+ }
51
+ ```
52
+
53
+ You get pan/zoom, hover highlighting, light/dark modes, and seven color themes
54
+ out of the box.
55
+
56
+ ### Key props
57
+
58
+ | Prop | Type | Notes |
59
+ |------|------|-------|
60
+ | `data` | `ArcDiagramData` | The diagram config (required) — see [Example Output](#example-output). |
61
+ | `theme` | `'default' \| 'warm' \| 'cool' \| 'mono' \| 'engineering' \| 'workbench' \| 'tactical'` | Palette + drafting grammar (grid, frame, type). |
62
+ | `mode` | `'light' \| 'dark'` | Appearance. |
63
+ | `frame` | `'hairline' \| 'inset' \| 'brackets' \| 'ticks' \| 'cropmarks' \| 'corners' \| 'sheet' \| 'none'` | Override the theme's edge treatment. |
64
+ | `interactive` | `boolean` | Pan/zoom controls. |
65
+ | `defaultZoom` | `number \| 'fit'` | Initial zoom, or `'fit'` to auto-fit (`maxFitZoom` caps it). |
66
+ | `showControls` / `showMinimap` | `boolean` | Zoom controls / minimap for read-only chrome. |
67
+ | `hoverEffects` | `boolean \| { dim, lift, glow, highlightEdges }` | Hover highlighting (granular). |
68
+ | `label` | `string` | Override the bottom-left label. |
69
+
70
+ ## The Studio
71
+
72
+ Prefer to design visually? Arc ships a full drag-and-drop **studio** — infinite
73
+ canvas, floating toolbar, reusable connector styles, live properties panel, and
74
+ a minimap. Clone the repo and open it:
75
+
76
+ ```bash
77
+ git clone https://github.com/arach/arc && cd arc
78
+ bun install && bun dev # → http://localhost:5188/editor
79
+ ```
80
+
81
+ ![The Arc Studio — a drag-and-drop editor for architecture diagrams](public/studio.png)
82
+
83
+ Design on the canvas, then **Export** to TypeScript, JSON, SVG, PNG, or a
84
+ shareable link — and drop the result straight into `<ArcDiagram />`.
6
85
 
7
86
  ## Features
8
87
 
@@ -10,21 +89,37 @@ A visual diagram editor for creating architecture diagrams. Design visually, exp
10
89
  - **Multiple Node Sizes** - Large, medium, small
11
90
  - **Color Themes** - Violet, emerald, blue, amber, sky, zinc, rose, orange
12
91
  - **Connector Styles** - Solid/dashed lines, labels, curved paths
13
- - **Export Options** - TypeScript, JSON, SVG, PNG, shareable links
92
+ - **Export Options** - TypeScript, JSON, SVG, PNG, ASCII, shareable links
14
93
  - **Interactive Canvas** - Infinite pan/zoom, grid snapping
15
94
  - **Groups & Images** - Visual grouping, background images
16
95
  - **Templates** - Quick-start layouts
17
96
 
18
- ## Getting Started
97
+ ## Themes
19
98
 
20
- ```bash
21
- pnpm install
22
- pnpm dev
23
- ```
99
+ One diagram, several drafting grammars. The nodes and palette stay the same —
100
+ what changes is the grid system, edge treatment, type, and geometry. Here's
101
+ Arc's own architecture rendered three ways:
102
+
103
+ <div align="center">
104
+ <img src="public/theme-engineering.png" alt="Arc's architecture in the Engineering theme" width="840" />
105
+ <br/>
106
+ <sub><strong>Engineering</strong> — graph grid, drawing-sheet border, title block, uppercase mono</sub>
107
+ <br/><br/>
108
+ <img src="public/theme-workbench.png" alt="Arc's architecture in the Workbench theme" width="840" />
109
+ <br/>
110
+ <sub><strong>Workbench</strong> — dot grid, hairline frame, soft corners</sub>
111
+ <br/><br/>
112
+ <img src="public/theme-tactical.png" alt="Arc's architecture in the Tactical theme" width="840" />
113
+ <br/>
114
+ <sub><strong>Tactical</strong> — crosshair grid, corner brackets, hard edges</sub>
115
+ </div>
116
+
117
+ Plus `default`, `warm`, `cool`, and `mono` — seven in all, each with light and dark modes.
24
118
 
25
119
  ## Example Output
26
120
 
27
- Arc exports diagrams as clean TypeScript. Here's a microservices architecture:
121
+ Arc stores diagrams as plain, typed data the same config that renders the
122
+ diagram at the top of this README:
28
123
 
29
124
  ```typescript
30
125
  const diagram: ArcDiagramData = {