reladraw 0.15.1 → 0.17.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/README.md +11 -7
- package/SYNTAX.md +818 -680
- package/dist/ast.d.ts +342 -18
- package/dist/ast.js +138 -27
- package/dist/checks.d.ts +58 -0
- package/dist/checks.js +891 -0
- package/dist/cli.js +88 -12
- package/dist/constants.d.ts +15 -55
- package/dist/constants.js +30 -78
- package/dist/grammar.d.ts +2 -2
- package/dist/grammar.js +70 -10
- package/dist/index.d.ts +20 -0
- package/dist/index.js +18 -1
- package/dist/lexer.d.ts +12 -0
- package/dist/lexer.js +34 -0
- package/dist/lines.d.ts +96 -0
- package/dist/lines.js +1968 -0
- package/dist/linetexts.d.ts +44 -0
- package/dist/linetexts.js +412 -0
- package/dist/model.d.ts +187 -36
- package/dist/model.js +23 -1
- package/dist/parser.js +1811 -107
- package/dist/place.d.ts +501 -0
- package/dist/place.js +2226 -0
- package/dist/render.d.ts +3 -1
- package/dist/render.js +691 -2493
- package/dist/resolve.d.ts +1 -1
- package/dist/resolve.js +1195 -1789
- package/dist/size.d.ts +64 -0
- package/dist/size.js +222 -0
- package/dist/themes.d.ts +17 -0
- package/dist/themes.js +28 -3
- package/package.json +2 -2
- package/dist/constrain.d.ts +0 -56
- package/dist/constrain.js +0 -95
package/README.md
CHANGED
|
@@ -25,27 +25,31 @@ reladraw sits between those two extremes, aiming to have the benefits of a diagr
|
|
|
25
25
|
```
|
|
26
26
|
node app "Web app"
|
|
27
27
|
node app.ui "Interface"
|
|
28
|
-
node app.api "API" below app.ui
|
|
28
|
+
node app.api "API" below app.ui (gap: tight)
|
|
29
29
|
|
|
30
|
-
node store "Database" right of app
|
|
30
|
+
node store "Database" right of app (gap: 12) even with app.api
|
|
31
31
|
|
|
32
|
-
edge app.api -> store "queries"
|
|
32
|
+
edge app.api -> store "queries"
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
+
The tool draws what the file says and nothing else: a gap is the gap you wrote, and a line is straight unless you say how it bends or where it passes. It never moves a box to make room or routes a line round one. Where the picture may not read as you meant, such as a line crossing a box or two texts on top of each other, it draws it anyway and prints a one-line warning saying where and by how much, so you or your agent can fix the source.
|
|
36
|
+
|
|
35
37
|
See also [SYNTAX.md](SYNTAX.md) and [examples/](examples/).
|
|
36
38
|
|
|
37
39
|
## Install
|
|
38
40
|
|
|
39
41
|
```
|
|
40
42
|
npm install -g reladraw
|
|
41
|
-
reladraw diagram.reladraw -o diagram.svg
|
|
43
|
+
reladraw render diagram.reladraw -o diagram.svg
|
|
42
44
|
```
|
|
43
45
|
|
|
46
|
+
`reladraw check diagram.reladraw` prints the warnings without writing a picture.
|
|
47
|
+
|
|
44
48
|
Or from a clone, which also gets you the examples:
|
|
45
49
|
|
|
46
50
|
```
|
|
47
51
|
npm install && npm run build
|
|
48
|
-
node dist/cli.js examples/arch.reladraw -o out.svg
|
|
52
|
+
node dist/cli.js render examples/arch.reladraw -o out.svg
|
|
49
53
|
```
|
|
50
54
|
|
|
51
55
|
## In a web page
|
|
@@ -82,7 +86,7 @@ That gets you a copy of the skill at the time you run it, so you'll need to re-r
|
|
|
82
86
|
|
|
83
87
|
## Status
|
|
84
88
|
|
|
85
|
-
Version 0.
|
|
89
|
+
Version 0.17.0. Early stage, but works. The parser, layout engine, and SVG renderer are written in TypeScript, with zero runtime dependencies. There is a command-line tool that turns a .reladraw text file into an SVG, and an element that does the same inside a web page.
|
|
86
90
|
|
|
87
91
|
The language isn't stable yet, so expect the syntax to change.
|
|
88
92
|
|
|
@@ -92,4 +96,4 @@ Apache-2.0. See [LICENSE](LICENSE). The license covers the code, not the name. I
|
|
|
92
96
|
|
|
93
97
|
## Contributing
|
|
94
98
|
|
|
95
|
-
Issues are welcome. Particularly helpful is a diagram you could not represent in reladraw.
|
|
99
|
+
Issues are welcome. Particularly helpful is a diagram you could not represent in reladraw. Pull requests are not accepted; please open an issue instead. See [CONTRIBUTING.md](CONTRIBUTING.md).
|