reladraw 0.15.0 → 0.15.1
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 +4 -1
- 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.15.
|
|
85
|
+
Version 0.15.1. 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.15.
|
|
1
|
+
# Syntax reference — 0.15.1
|
|
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
|
|
|
@@ -1140,6 +1140,12 @@ That one was found by testing the lexer, not by rendering — and it could not h
|
|
|
1140
1140
|
|
|
1141
1141
|
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.
|
|
1142
1142
|
|
|
1143
|
+
**0.15.1**
|
|
1144
|
+
|
|
1145
|
+
No syntax changes, and no file that worked is refused. No example diagram draws differently.
|
|
1146
|
+
|
|
1147
|
+
- A fix: many copies of one line slowed down sharply past fifty-five. With fifty-six or more copies of `edge a -> b from: left to: right`, the ends on each side sat under half a pixel apart, and every copy was then routed on its own instead of being drawn as a copy, so sixty took five and a half seconds. They now draw as copies however close their ends sit, and sixty take under a second.
|
|
1148
|
+
|
|
1143
1149
|
**0.15.0**
|
|
1144
1150
|
|
|
1145
1151
|
No file that worked is refused. No example diagram draws differently.
|
package/dist/render.js
CHANGED
|
@@ -1888,7 +1888,10 @@ function planWays(edges, nodes, ends, corridors, measurer, fontSize) {
|
|
|
1888
1888
|
const normal = heading.map((one) => ({ x: -one.y, y: one.x }));
|
|
1889
1889
|
const along = (from, to, axis) => (to.x - from.x) * axis.x + (to.y - from.y) * axis.y;
|
|
1890
1890
|
const shift = along(base[0], start, normal[0]);
|
|
1891
|
-
|
|
1891
|
+
// Any shift will do, however small: where more lines leave a side than it
|
|
1892
|
+
// has room for, their ends sit under half a pixel apart, and refusing those
|
|
1893
|
+
// sent fifty-six copies to the search and took seconds.
|
|
1894
|
+
if (Math.abs(shift) < 1e-6 || Math.abs(along(base[0], start, heading[0])) > 0.5)
|
|
1892
1895
|
return undefined;
|
|
1893
1896
|
if (Math.abs(along(base[count], end, normal[count - 1]) - shift) > 0.5 || Math.abs(along(base[count], end, heading[count - 1])) > 0.5) {
|
|
1894
1897
|
return undefined;
|