reladraw 0.14.2 → 0.14.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.
- package/README.md +1 -1
- package/SYNTAX.md +7 -1
- package/dist/render.js +6 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -82,7 +82,7 @@ That gets you a copy of the skill at the time you run it, so you'll need to re-r
|
|
|
82
82
|
|
|
83
83
|
## Status
|
|
84
84
|
|
|
85
|
-
Version 0.14.
|
|
85
|
+
Version 0.14.3. 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
86
|
|
|
87
87
|
The language isn't stable yet, so expect the syntax to change.
|
|
88
88
|
|
package/SYNTAX.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Syntax reference — 0.14.
|
|
1
|
+
# Syntax reference — 0.14.3
|
|
2
2
|
|
|
3
3
|
What the language accepts. The parser, resolver and SVG renderer implement all of it; the sections at the end record what is defective, unchecked or undecided.
|
|
4
4
|
|
|
@@ -1112,6 +1112,12 @@ That one was found by testing the lexer, not by rendering — and it could not h
|
|
|
1112
1112
|
|
|
1113
1113
|
Pre-1.0, so the minor number is where a breaking change goes. Every removal below is refused by name with the replacement quoted, rather than dropped in silence — an older file stops with an error saying what to write instead.
|
|
1114
1114
|
|
|
1115
|
+
**0.14.3**
|
|
1116
|
+
|
|
1117
|
+
No syntax changes, and no file that worked is refused. No example diagram draws differently.
|
|
1118
|
+
|
|
1119
|
+
- A fix: many curved lines into one side could hang the page. With twenty-two copies of `edge a -> b from: right to: left`, some lines had no room left to curve before the arrowhead, and the tool kept trying ever smaller curves thousands of times. It now stops at the smallest, and the same file draws in a tenth of a second.
|
|
1120
|
+
|
|
1115
1121
|
**0.14.2**
|
|
1116
1122
|
|
|
1117
1123
|
No syntax changes, and no file that worked is refused.
|
package/dist/render.js
CHANGED
|
@@ -2738,9 +2738,13 @@ function sweptPath(points, boxes, neighbors, arrow, marks) {
|
|
|
2738
2738
|
const p3 = along(corner, dout, b);
|
|
2739
2739
|
return [p0, along(p0, din, a * kappa), along(p3, dout, -b * kappa), p3];
|
|
2740
2740
|
};
|
|
2741
|
+
// Within half a pixel of the smallest is the smallest: where an end piece
|
|
2742
|
+
// has no room left, the smallest is zero, which shrinking never reaches,
|
|
2743
|
+
// and twenty-two lines into one side took the page down.
|
|
2744
|
+
const shrink = (size) => (size * 0.85 < least + 0.5 ? least : size * 0.85);
|
|
2741
2745
|
while ((a > least || b > least) && !clear(...quarter(a, b))) {
|
|
2742
|
-
a =
|
|
2743
|
-
b =
|
|
2746
|
+
a = shrink(a);
|
|
2747
|
+
b = shrink(b);
|
|
2744
2748
|
}
|
|
2745
2749
|
curve(...quarter(a, b));
|
|
2746
2750
|
}
|