@statelyai/layout 0.0.0 → 0.0.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/NOTICE.md +9 -1
- package/README.md +52 -25
- package/dist/elkjs/index.d.mts +3 -0
- package/dist/elkjs/index.mjs +901 -97
- package/dist/index-D2RodsZY.d.mts +1210 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +3 -3
- package/dist/layered/index.d.mts +2 -2
- package/dist/layered/index.mjs +2 -2
- package/dist/layered-Dd868WZY.mjs +8632 -0
- package/dist/{spore-cihb_Aht.mjs → spore-fTgSoRLP.mjs} +1 -31
- package/package.json +45 -22
- package/dist/index-v0P1Ake8.d.mts +0 -149
- package/dist/layered-ByNCZQgJ.mjs +0 -439
package/NOTICE.md
CHANGED
|
@@ -7,4 +7,12 @@ The project intends to implement algorithms available in the Eclipse Layout
|
|
|
7
7
|
Kernel. Eclipse Layout Kernel is maintained by the ELK contributors and is a
|
|
8
8
|
trademark of the Eclipse Foundation. See https://github.com/eclipse-elk/elk.
|
|
9
9
|
|
|
10
|
-
No Eclipse Layout Kernel source has been copied into the
|
|
10
|
+
No Eclipse Layout Kernel implementation source has been copied into the native
|
|
11
|
+
layout implementation.
|
|
12
|
+
|
|
13
|
+
The demo includes example models derived from the Eclipse ELK Models repository
|
|
14
|
+
at revision ac5af2ba511c0037e4f347e8bd91f013950951c7:
|
|
15
|
+
https://github.com/eclipse/elk-models. Those examples are available under the
|
|
16
|
+
Eclipse Public License 2.0. Their ELKT graph source and upstream paths are
|
|
17
|
+
preserved in the generated example catalog; the upstream repository retains
|
|
18
|
+
the original per-file notices.
|
package/README.md
CHANGED
|
@@ -9,13 +9,12 @@ return `VisualGraph`; positions remain node fields and routes remain
|
|
|
9
9
|
|
|
10
10
|
## Status
|
|
11
11
|
|
|
12
|
-
The native layered implementation
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
capabilities.
|
|
12
|
+
The native layered implementation covers the complete 152-option elkjs 0.11.1
|
|
13
|
+
layered inventory with one simplified typed name per ELK option. Flat and
|
|
14
|
+
compound graphs, cross-hierarchy edges, ports, labels, self-loops, wrapping,
|
|
15
|
+
four directions, constraints, and replaceable phases are differential-tested
|
|
16
|
+
against elkjs. Partial, incremental, and route-only layout remain explicit
|
|
17
|
+
unimplemented capabilities.
|
|
19
18
|
|
|
20
19
|
## Install
|
|
21
20
|
|
|
@@ -54,7 +53,7 @@ result.metrics;
|
|
|
54
53
|
|
|
55
54
|
## elkjs compatibility
|
|
56
55
|
|
|
57
|
-
<!-- elkjs-compatible entry point
|
|
56
|
+
<!-- elkjs-compatible entry point and layered mapping exports from package.json#exports and src/layered/index.ts -->
|
|
58
57
|
|
|
59
58
|
Legacy consumers can migrate through an isolated compatibility entry point:
|
|
60
59
|
|
|
@@ -69,32 +68,45 @@ The adapter accepts ELK JSON and option aliases, translates to
|
|
|
69
68
|
`@statelyai/graph`, runs native algorithms, and translates the result back.
|
|
70
69
|
Native algorithms never consume ELK JSON directly.
|
|
71
70
|
|
|
71
|
+
Advanced layered settings use shorter names such as
|
|
72
|
+
`layering.strategy`, `spacing.edgeNode`, and `nodePlacement.strategy`.
|
|
73
|
+
`toElkLayeredOptions` and `fromElkLayeredOptionId` provide the exact one-to-one
|
|
74
|
+
mapping when migration tooling needs ELK IDs. `elkLayeredOptionDefinitions`
|
|
75
|
+
exposes the complete mapping, value type, and valid graph-element targets;
|
|
76
|
+
`elkLayeredEnumValues` exposes every accepted enum value.
|
|
77
|
+
|
|
72
78
|
## Parity lab
|
|
73
79
|
|
|
74
|
-
<!--
|
|
80
|
+
<!-- ELK Live example count and source from demo/generated/elk-live-examples.json -->
|
|
75
81
|
|
|
76
|
-
The browser lab
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
bundled into the browser.
|
|
82
|
+
The browser lab contains the same 45 categorized examples as ELK Live, sourced
|
|
83
|
+
from the canonical `eclipse/elk-models` catalog. Each is pre-laid out with the
|
|
84
|
+
elkjs oracle after zero-sized nodes and ports receive consistent visual bounds.
|
|
85
|
+
The canonical ELKT source remains unchanged; elkjs is never bundled into the
|
|
86
|
+
browser.
|
|
82
87
|
|
|
83
|
-
The
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
88
|
+
The workbench places a CodeMirror JSON5 editor beside a coordinate-faithful SVG
|
|
89
|
+
viewer in keyboard-accessible shadcn resizable panels. Selecting an example
|
|
90
|
+
loads its complete XGraph into the editor; pasted or edited XGraph redraws
|
|
91
|
+
automatically. Existing visual geometry is preserved; topology-only graphs run
|
|
92
|
+
through native layered layout. Invalid input is marked inline while the last
|
|
93
|
+
valid preview remains visible. Pan, zoom, selection details, and optional
|
|
94
|
+
overlays expose exact node coordinates, edge-label rectangles, route points,
|
|
95
|
+
routing modes, and node-relative ports.
|
|
87
96
|
|
|
88
97
|
```bash
|
|
89
98
|
pnpm demo:generate
|
|
90
99
|
pnpm demo
|
|
91
100
|
```
|
|
92
101
|
|
|
102
|
+
The demo opens at `https://layout.localhost` through Portless.
|
|
103
|
+
|
|
104
|
+
`pnpm demo:sync` refreshes the pinned ELK Live catalog and its converted ELK
|
|
105
|
+
JSON inputs. Normal generation and browser use remain offline.
|
|
106
|
+
|
|
93
107
|
The embed target defaults to `http://localhost:3000`. Override it with
|
|
94
108
|
`?editor=http://localhost:4864` when the Viz editor runs elsewhere.
|
|
95
109
|
|
|
96
|
-

|
|
97
|
-
|
|
98
110
|
## Extensibility
|
|
99
111
|
|
|
100
112
|
<!-- layered strategy fields from src/layered/types.ts -->
|
|
@@ -120,8 +132,9 @@ const result = getLayeredLayout(graph, {
|
|
|
120
132
|
});
|
|
121
133
|
```
|
|
122
134
|
|
|
123
|
-
See [
|
|
124
|
-
[
|
|
135
|
+
See [API reference](./docs/api-reference.md), [Architecture](./docs/architecture.md),
|
|
136
|
+
[Roadmap](./docs/roadmap.md), and [Upstream and provenance](./docs/upstream.md).
|
|
137
|
+
[Parity](./docs/parity.md) tracks
|
|
125
138
|
API coverage separately from native algorithm fidelity.
|
|
126
139
|
|
|
127
140
|
## Development
|
|
@@ -133,8 +146,22 @@ pnpm install
|
|
|
133
146
|
pnpm verify
|
|
134
147
|
pnpm bench
|
|
135
148
|
pnpm demo
|
|
149
|
+
pnpm changeset
|
|
150
|
+
pnpm release
|
|
136
151
|
```
|
|
137
152
|
|
|
138
153
|
`pnpm verify` checks Oxfmt, Oxlint, source and repository TypeScript projects,
|
|
139
|
-
generated corpus freshness, tests,
|
|
140
|
-
bundle, and the packed package surface.
|
|
154
|
+
generated layered-option and demo-corpus freshness, tests,
|
|
155
|
+
declarations/runtime builds, the demo bundle, and the packed package surface.
|
|
156
|
+
|
|
157
|
+
## Releases
|
|
158
|
+
|
|
159
|
+
<!-- release process derived from package.json#scripts and .changeset/config.json -->
|
|
160
|
+
|
|
161
|
+
Add a release note with `pnpm changeset`. When it reaches `main`, the release
|
|
162
|
+
workflow opens or updates a version pull request. Merging that pull request
|
|
163
|
+
publishes the package to npm and creates the GitHub release and tag.
|
|
164
|
+
|
|
165
|
+
Before the first automated release, publish the initial `0.0.0` package and
|
|
166
|
+
configure npm Trusted Publishing for `statelyai/layout` using
|
|
167
|
+
`.github/workflows/release.yml`.
|
package/dist/elkjs/index.d.mts
CHANGED
|
@@ -25,6 +25,8 @@ interface ElkEdgeSection extends ElkGraphElement {
|
|
|
25
25
|
startPoint: ElkPoint;
|
|
26
26
|
endPoint: ElkPoint;
|
|
27
27
|
bendPoints?: ElkPoint[];
|
|
28
|
+
incomingShape?: ElkId;
|
|
29
|
+
outgoingShape?: ElkId;
|
|
28
30
|
}
|
|
29
31
|
interface ElkEdge extends ElkGraphElement {
|
|
30
32
|
sources?: ElkId[];
|
|
@@ -35,6 +37,7 @@ interface ElkEdge extends ElkGraphElement {
|
|
|
35
37
|
targetPort?: ElkId;
|
|
36
38
|
labels?: ElkLabel[];
|
|
37
39
|
sections?: ElkEdgeSection[];
|
|
40
|
+
junctionPoints?: ElkPoint[];
|
|
38
41
|
}
|
|
39
42
|
interface ElkNode extends ElkShape {
|
|
40
43
|
labels?: ElkLabel[];
|