@knowvah/dot-engine 1.1.1 → 1.2.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 +32 -17
- package/dist/api.js +24 -0
- package/dist/api.js.map +2 -2
- package/dist/common/arrows.d.ts.map +1 -1
- package/dist/common/edge-label-init.d.ts.map +1 -1
- package/dist/common/htmltable-emit.d.ts +0 -8
- package/dist/common/htmltable-emit.d.ts.map +1 -1
- package/dist/common/ps-fontalias.d.ts +22 -9
- package/dist/common/ps-fontalias.d.ts.map +1 -1
- package/dist/common/splines-clip.d.ts.map +1 -1
- package/dist/gvc/device.d.ts.map +1 -1
- package/dist/gvc/job.d.ts +4 -0
- package/dist/gvc/job.d.ts.map +1 -1
- package/dist/index.js +1981 -1533
- package/dist/index.js.map +4 -4
- package/dist/layout/dot/index.d.ts +1 -1
- package/dist/layout/dot/index.d.ts.map +1 -1
- package/dist/layout/sfdp/init.d.ts.map +1 -1
- package/dist/model/graph.d.ts +24 -0
- package/dist/model/graph.d.ts.map +1 -1
- package/dist/parser/builder.d.ts +32 -0
- package/dist/parser/builder.d.ts.map +1 -1
- package/dist/render/dot/agwrite.d.ts +186 -0
- package/dist/render/dot/agwrite.d.ts.map +1 -0
- package/dist/render/dot/attrs.d.ts +220 -0
- package/dist/render/dot/attrs.d.ts.map +1 -0
- package/dist/render/dot/edge-draw.d.ts +60 -0
- package/dist/render/dot/edge-draw.d.ts.map +1 -0
- package/dist/render/dot/types.d.ts +28 -0
- package/dist/render/dot/types.d.ts.map +1 -0
- package/dist/render/dot/xdot-ops.d.ts +206 -0
- package/dist/render/dot/xdot-ops.d.ts.map +1 -0
- package/dist/render/dot.d.ts +58 -277
- package/dist/render/dot.d.ts.map +1 -1
- package/dist/render/map.d.ts +14 -1
- package/dist/render/map.d.ts.map +1 -1
- package/dist/render/svg-graph.d.ts.map +1 -1
- package/dist/render.js +1942 -1494
- package/dist/render.js.map +4 -4
- package/package.json +1 -1
- package/src/common/arrows.ts +17 -4
- package/src/common/edge-label-init.ts +9 -2
- package/src/common/htmltable-emit.ts +36 -8
- package/src/common/poly-gencode.ts +8 -8
- package/src/common/ps-fontalias.ts +80 -49
- package/src/common/splines-clip.ts +36 -10
- package/src/gvc/device.ts +18 -6
- package/src/gvc/job.ts +4 -0
- package/src/layout/dot/index.ts +37 -5
- package/src/layout/sfdp/init.ts +11 -0
- package/src/model/graph.ts +26 -0
- package/src/parser/builder.ts +90 -5
- package/src/render/dot/agwrite.ts +506 -0
- package/src/render/dot/attrs.ts +437 -0
- package/src/render/dot/edge-draw.ts +203 -0
- package/src/render/dot/types.ts +32 -0
- package/src/render/dot/xdot-ops.ts +432 -0
- package/src/render/dot.ts +114 -1131
- package/src/render/map.ts +18 -1
- package/src/render/svg-graph.ts +4 -0
- package/src/render/svg-helpers.ts +1 -1
package/README.md
CHANGED
|
@@ -21,10 +21,18 @@ literal byte-for-byte SVG output — see [Conformance](./docs/conformance.md) fo
|
|
|
21
21
|
the exact definition and the comparison code, and
|
|
22
22
|
[known divergences](./docs/known-divergences.md) for the documented exceptions.
|
|
23
23
|
|
|
24
|
-
> **Status:
|
|
25
|
-
>
|
|
26
|
-
>
|
|
27
|
-
>
|
|
24
|
+
> **Status: published and semver-stable from 1.0.0.** The public API —
|
|
25
|
+
> `renderSvg`, `/api`, `/render` — follows semver: a breaking change gets a
|
|
26
|
+
> major bump. The version line does **not** track C feature coverage, and the
|
|
27
|
+
> two are independent signals.
|
|
28
|
+
>
|
|
29
|
+
> The rendering surface is settled: parsing, all eight layout engines, SVG,
|
|
30
|
+
> and the `json` / `xdot` / `dot` / `plain` / imagemap text formats. It does
|
|
31
|
+
> not cover the whole C feature surface, and the remainder is **out of scope
|
|
32
|
+
> rather than pending** — the unported C areas stay inventoried in the
|
|
33
|
+
> [port catalog](./plans/port-catalog/README.md) so you can check a specific
|
|
34
|
+
> feature before depending on it. The `dot` engine is the primary fidelity
|
|
35
|
+
> target. See [Status & coverage](#status--coverage) below.
|
|
28
36
|
|
|
29
37
|
## Why this exists
|
|
30
38
|
|
|
@@ -261,32 +269,39 @@ from the canonical C Graphviz. New behavior is pinned to the C source — see
|
|
|
261
269
|
## Status & coverage
|
|
262
270
|
|
|
263
271
|
- **What works:** parsing, all eight layout engines, SVG output, and the
|
|
264
|
-
intermediate `json` / `xdot` / `dot` / imagemap text formats.
|
|
272
|
+
intermediate `json` / `xdot` / `dot` / `plain` / imagemap text formats.
|
|
265
273
|
- **Conformance bar:** a render is **conformant** when it matches the C oracle
|
|
266
274
|
within a ±0.01 deterministic tolerance (`dot`, `circo`, `twopi`, `osage`,
|
|
267
275
|
`patchwork`) or is characterized at a looser ±0.5 tolerance for the
|
|
268
276
|
iterative force-directed engines (`neato`, `fdp`, `sfdp`) — never literal
|
|
269
277
|
byte equality. Full definition: [Conformance](./docs/conformance.md).
|
|
270
|
-
- **Current parity
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
278
|
+
- **Current parity:** `dot` SVG 762/788 conformant (0 unaccepted tracked gaps —
|
|
279
|
+
every remaining non-conformant graph is a documented, accepted divergence);
|
|
280
|
+
`dot` xdot 761/761; `patchwork` xdot 762/762; `osage` xdot 755/762; `circo`
|
|
281
|
+
xdot 752/762; `twopi` xdot 746/762 (all deterministic, ±0.01).
|
|
282
|
+
`neato`/`fdp`/`sfdp` are characterized at ±0.5 rather than gated at the
|
|
283
|
+
deterministic bar, per the tolerance split above. These figures are a
|
|
284
|
+
snapshot of one row each from [`test/corpus/PARITY.md`](./test/corpus/PARITY.md),
|
|
285
|
+
which is generated by `test/corpus/parity-report.ts` and covers every
|
|
286
|
+
engine × surface track (SVG, xdot, json, plain, imagemap); read it, or the
|
|
287
|
+
[docs-site parity pages](https://knowvah.github.io/dot-engine/engines),
|
|
288
|
+
rather than this bullet for current counts.
|
|
279
289
|
- **What's tracked:** every C algorithm and its port status is inventoried in
|
|
280
290
|
the [port catalog](./plans/port-catalog/README.md). Items marked `[ ]` there
|
|
281
|
-
are
|
|
291
|
+
are genuinely unported — not footnotes, and not a roadmap either. Treat the
|
|
292
|
+
catalog as the authoritative answer to "is feature X in?".
|
|
282
293
|
- **Known behavioral divergences from C** (differences investigated,
|
|
283
294
|
root-caused, and deliberately not chased) are listed in
|
|
284
295
|
[`docs/known-divergences.md`](./docs/known-divergences.md).
|
|
285
296
|
|
|
286
297
|
## Known limitations
|
|
287
298
|
|
|
288
|
-
- **
|
|
289
|
-
|
|
299
|
+
- **The feature surface is narrower than C's, by design.** The C source
|
|
300
|
+
defines completeness, and this port does not reach it. The uncovered areas
|
|
301
|
+
are listed in the [port catalog](./plans/port-catalog/README.md) rather than
|
|
302
|
+
hidden — check it before depending on a specific C feature. They are not a
|
|
303
|
+
backlog; absence from the shipped surface is a scope decision, not a
|
|
304
|
+
pending item.
|
|
290
305
|
- **Very large graphs are impractical to lay out at runtime.** Graphs beyond
|
|
291
306
|
roughly 10k nodes or a few MB of DOT source hit a scale ceiling — layout
|
|
292
307
|
(mincross, ranking, spline routing) is superlinear. This is **shared with
|
package/dist/api.js
CHANGED
|
@@ -67,6 +67,30 @@ var Graph = class {
|
|
|
67
67
|
* @see lib/cgraph/graph.c:agsubg (attr defval copy)
|
|
68
68
|
*/
|
|
69
69
|
graphDefaultsSnapshot;
|
|
70
|
+
/**
|
|
71
|
+
* Keys in `attrs` the BUILDER seeded from `graphDefaultsSnapshot` rather than
|
|
72
|
+
* the input declaring them in this scope (see builder.ts GRAPH_LABEL_INHERIT_
|
|
73
|
+
* KEYS). cgraph distinguishes these structurally — a seeded value is inherited
|
|
74
|
+
* through the dict view and has no local symbol, while a local declaration
|
|
75
|
+
* creates one even when its value equals the inherited value — so the
|
|
76
|
+
* serializer needs the provenance to decide what write_dict would print.
|
|
77
|
+
* Undefined on the root graph and on any scope that seeded nothing.
|
|
78
|
+
* @see lib/cgraph/write.c:262 write_dict
|
|
79
|
+
*/
|
|
80
|
+
seededAttrs;
|
|
81
|
+
/**
|
|
82
|
+
* Graph-attribute keys whose declaration in THIS scope was the first anywhere
|
|
83
|
+
* in the graph. cgraph's `setattr` splits on exactly this: a key with no
|
|
84
|
+
* existing symbol takes the global-declaration branch, which ends up seeding
|
|
85
|
+
* every direct subgraph that already exists with a local empty value (see
|
|
86
|
+
* `eagerEmptyParts`); a key some earlier scope already declared takes the
|
|
87
|
+
* "new local definition" branch and touches no subgraph at all. So an
|
|
88
|
+
* identical `graph [fill=x]` statement makes a child print `fill=""` or print
|
|
89
|
+
* nothing purely according to whether a SIBLING declared `fill` first.
|
|
90
|
+
* Undefined on any scope that declared nothing new.
|
|
91
|
+
* @see lib/cgraph/attr.c:257 setattr (lsym / psym / global branches)
|
|
92
|
+
*/
|
|
93
|
+
firstGraphDecl;
|
|
70
94
|
/**
|
|
71
95
|
* Layout-engine info; replaces GD_* macros via agbindrec (AD-1).
|
|
72
96
|
* @see lib/cgraph/cgraph.h:agbindrec
|