edododraw 0.1.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/LICENSE +27 -0
- package/README.md +71 -0
- package/dist-lib/chunks/EdodoDraw-CUf224RG.js +5432 -0
- package/dist-lib/chunks/EdodoDraw-CUf224RG.js.map +1 -0
- package/dist-lib/engine/annotate/interact.d.ts +69 -0
- package/dist-lib/engine/annotate/interact.d.ts.map +1 -0
- package/dist-lib/engine/annotate/layer.d.ts +34 -0
- package/dist-lib/engine/annotate/layer.d.ts.map +1 -0
- package/dist-lib/engine/camera/controller.d.ts +42 -0
- package/dist-lib/engine/camera/controller.d.ts.map +1 -0
- package/dist-lib/engine/camera/easing.d.ts +9 -0
- package/dist-lib/engine/camera/easing.d.ts.map +1 -0
- package/dist-lib/engine/camera/fit.d.ts +21 -0
- package/dist-lib/engine/camera/fit.d.ts.map +1 -0
- package/dist-lib/engine/dsl/ast.d.ts +266 -0
- package/dist-lib/engine/dsl/ast.d.ts.map +1 -0
- package/dist-lib/engine/dsl/compile.d.ts +18 -0
- package/dist-lib/engine/dsl/compile.d.ts.map +1 -0
- package/dist-lib/engine/dsl/diagnostics.d.ts +42 -0
- package/dist-lib/engine/dsl/diagnostics.d.ts.map +1 -0
- package/dist-lib/engine/dsl/index.d.ts +19 -0
- package/dist-lib/engine/dsl/index.d.ts.map +1 -0
- package/dist-lib/engine/dsl/lexer.d.ts +8 -0
- package/dist-lib/engine/dsl/lexer.d.ts.map +1 -0
- package/dist-lib/engine/dsl/lower.d.ts +35 -0
- package/dist-lib/engine/dsl/lower.d.ts.map +1 -0
- package/dist-lib/engine/dsl/parser.d.ts +19 -0
- package/dist-lib/engine/dsl/parser.d.ts.map +1 -0
- package/dist-lib/engine/dsl/tokens.d.ts +66 -0
- package/dist-lib/engine/dsl/tokens.d.ts.map +1 -0
- package/dist-lib/engine/export.d.ts +22 -0
- package/dist-lib/engine/export.d.ts.map +1 -0
- package/dist-lib/engine/geometry.d.ts +55 -0
- package/dist-lib/engine/geometry.d.ts.map +1 -0
- package/dist-lib/engine/import/mermaid.d.ts +25 -0
- package/dist-lib/engine/import/mermaid.d.ts.map +1 -0
- package/dist-lib/engine/index.d.ts +32 -0
- package/dist-lib/engine/index.d.ts.map +1 -0
- package/dist-lib/engine/layout/dag.d.ts +29 -0
- package/dist-lib/engine/layout/dag.d.ts.map +1 -0
- package/dist-lib/engine/layout/grid.d.ts +12 -0
- package/dist-lib/engine/layout/grid.d.ts.map +1 -0
- package/dist-lib/engine/layout/index.d.ts +30 -0
- package/dist-lib/engine/layout/index.d.ts.map +1 -0
- package/dist-lib/engine/layout/radial.d.ts +18 -0
- package/dist-lib/engine/layout/radial.d.ts.map +1 -0
- package/dist-lib/engine/plugins/builtins.d.ts +10 -0
- package/dist-lib/engine/plugins/builtins.d.ts.map +1 -0
- package/dist-lib/engine/plugins/registry.d.ts +19 -0
- package/dist-lib/engine/plugins/registry.d.ts.map +1 -0
- package/dist-lib/engine/render/edges.d.ts +42 -0
- package/dist-lib/engine/render/edges.d.ts.map +1 -0
- package/dist-lib/engine/render/fontData.d.ts +8 -0
- package/dist-lib/engine/render/fontData.d.ts.map +1 -0
- package/dist-lib/engine/render/shapes.d.ts +26 -0
- package/dist-lib/engine/render/shapes.d.ts.map +1 -0
- package/dist-lib/engine/render/svgRenderer.d.ts +56 -0
- package/dist-lib/engine/render/svgRenderer.d.ts.map +1 -0
- package/dist-lib/engine/render/theme.css.d.ts +16 -0
- package/dist-lib/engine/render/theme.css.d.ts.map +1 -0
- package/dist-lib/engine/scene/anchors.d.ts +20 -0
- package/dist-lib/engine/scene/anchors.d.ts.map +1 -0
- package/dist-lib/engine/scene/defaults.d.ts +47 -0
- package/dist-lib/engine/scene/defaults.d.ts.map +1 -0
- package/dist-lib/engine/scene/palette.d.ts +71 -0
- package/dist-lib/engine/scene/palette.d.ts.map +1 -0
- package/dist-lib/engine/scene/query.d.ts +25 -0
- package/dist-lib/engine/scene/query.d.ts.map +1 -0
- package/dist-lib/engine/scene/types.d.ts +203 -0
- package/dist-lib/engine/scene/types.d.ts.map +1 -0
- package/dist-lib/engine/timeline/player.d.ts +44 -0
- package/dist-lib/engine/timeline/player.d.ts.map +1 -0
- package/dist-lib/fonts/CascadiaCode-Regular.woff2 +0 -0
- package/dist-lib/fonts/Excalifont-Regular-349fac6ca4700ffec595a7150a0d1e1d.woff2 +0 -0
- package/dist-lib/fonts/Excalifont-Regular-3f2c5db56cc93c5a6873b1361d730c16.woff2 +0 -0
- package/dist-lib/fonts/Excalifont-Regular-41b173a47b57366892116a575a43e2b6.woff2 +0 -0
- package/dist-lib/fonts/Excalifont-Regular-623ccf21b21ef6b3a0d87738f77eb071.woff2 +0 -0
- package/dist-lib/fonts/Excalifont-Regular-a88b72a24fb54c9f94e3b5fdaa7481c9.woff2 +0 -0
- package/dist-lib/fonts/Excalifont-Regular-b9dcf9d2e50a1eaf42fc664b50a3fd0d.woff2 +0 -0
- package/dist-lib/fonts/Excalifont-Regular-be310b9bcd4f1a43f571c46df7809174.woff2 +0 -0
- package/dist-lib/fonts/Nunito-Regular.woff2 +0 -0
- package/dist-lib/fonts/Virgil-Regular.woff2 +0 -0
- package/dist-lib/index.js +76 -0
- package/dist-lib/index.js.map +1 -0
- package/dist-lib/lib/EdodoDraw.d.ts +96 -0
- package/dist-lib/lib/EdodoDraw.d.ts.map +1 -0
- package/dist-lib/lib/index.d.ts +17 -0
- package/dist-lib/lib/index.d.ts.map +1 -0
- package/dist-lib/lib/react.d.ts +25 -0
- package/dist-lib/lib/react.d.ts.map +1 -0
- package/dist-lib/react.js +29 -0
- package/dist-lib/react.js.map +1 -0
- package/package.json +99 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 vivmagarwal
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
The bundled hand-drawn fonts (Virgil, Excalifont) in public/fonts/ and embedded
|
|
26
|
+
in the build are licensed under the SIL Open Font License, Version 1.1.
|
|
27
|
+
Copyright (c) 2024 Excalidraw. See https://scripts.sil.org/OFL.
|
package/README.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<h1 align="center">β EDodoDraw</h1>
|
|
2
|
+
<p align="center"><i>Diagrams as code β with the Excalidraw hand-drawn soul.</i></p>
|
|
3
|
+
|
|
4
|
+
EDodoDraw turns a small, LLM-friendly text language into beautiful hand-drawn diagrams, then lets you **choreograph** them (magic-move camera, step-by-step presentations) and **annotate** them (highlights, arrows, callouts) β in code *or* live, with everything round-trippable back to code.
|
|
5
|
+
|
|
6
|
+
```edd
|
|
7
|
+
scene {
|
|
8
|
+
layout dag { direction: down }
|
|
9
|
+
ellipse hello "Hello π" { fill: yellow }
|
|
10
|
+
rect idea "Diagrams as CODE" { fill: blue }
|
|
11
|
+
round-rect vibe "β¦with the Excalidraw vibe" { fill: green }
|
|
12
|
+
hello --> idea --> vibe
|
|
13
|
+
vibe ~> hello "loop" // ~> == an animated flowing arrow
|
|
14
|
+
}
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Why it exists
|
|
18
|
+
|
|
19
|
+
Excalidraw is a joy to draw *by hand*. EDodoDraw is a joy to drive *by code* β while keeping the same pleasant look. It is built from the ground up (no Excalidraw runtime baggage), reusing only the good primitives: rough.js for strokes, dagre for layout, the Virgil/Excalifont hand-drawn font, and `@excalidraw/mermaid-to-excalidraw` for import.
|
|
20
|
+
|
|
21
|
+
## Features
|
|
22
|
+
|
|
23
|
+
- **100% code β diagram.** The primary goal. A robust DSL (`lexer β parser β compiler`) with great error messages.
|
|
24
|
+
- **First-class Mermaid.** Paste `mermaid """ β¦ """`; ids are preserved so you can choreograph and annotate imported diagrams.
|
|
25
|
+
- **Magic-move camera.** `camera focus [db, cache] zoom 1.7` β smooth, interruptible, spring-eased. Pan/zoom by mouse too.
|
|
26
|
+
- **Timeline presentations.** A `timeline` of `beat`s turns a static diagram into a guided walkthrough.
|
|
27
|
+
- **Annotations, scripted + live.** Highlight / underline / box / circle / point-at / callout / spotlight. Draw them with the toolbar, then **commit to code**.
|
|
28
|
+
- **More animated arrows** than Excalidraw: flow, dash-march, draw-on, comet, gradient-flow, electric, pulse.
|
|
29
|
+
- **15+ hand-drawn shapes** + a **plugin registry** to add your own without touching the core.
|
|
30
|
+
- **Export** to self-contained SVG (font embedded), PNG, or JSON.
|
|
31
|
+
|
|
32
|
+
## Use it in your app
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm i edododraw
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
```js
|
|
39
|
+
import { EdodoDraw } from "edododraw";
|
|
40
|
+
|
|
41
|
+
const edd = new EdodoDraw(document.getElementById("diagram"));
|
|
42
|
+
await edd.render(`
|
|
43
|
+
scene {
|
|
44
|
+
a([Start]) --> b[Do work] --> c{OK?}
|
|
45
|
+
c -->|yes| d(Done)
|
|
46
|
+
}
|
|
47
|
+
`);
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
A React wrapper lives at `edododraw/react` (`<EdodoDrawView source={code} />`), and a
|
|
51
|
+
pure, DOM-free compiler (`compileEdd(source) β { scene, diagnostics }`) is exported for
|
|
52
|
+
Node/SSR. See the **[Embed guide](docs/INTEGRATION_GUIDE.md)** for the full API.
|
|
53
|
+
|
|
54
|
+
## Run this repo (playground + docs site)
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
git clone https://github.com/vivmagarwal/edododraw.git
|
|
58
|
+
cd edododraw && npm install
|
|
59
|
+
npm run dev # http://localhost:5273
|
|
60
|
+
npm test # 200+ unit tests
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Open the app, pick an example (Welcome Β· Flowchart Β· Architecture Β· Animated Arrows Β· Mermaid), and edit the code on the left β the diagram updates live.
|
|
64
|
+
|
|
65
|
+
## Docs
|
|
66
|
+
|
|
67
|
+
Start with **[docs/DSL_LANGUAGE_GUIDE.md](docs/DSL_LANGUAGE_GUIDE.md)**. Architecture and feature guides are in [`docs/`](docs/); AI-agent guidance is in [CLAUDE.md](CLAUDE.md).
|
|
68
|
+
|
|
69
|
+
## License
|
|
70
|
+
|
|
71
|
+
The bundled fonts (Virgil, Excalifont) are under the SIL Open Font License. See `public/fonts/`.
|