@statelyai/layout 0.3.0 → 0.4.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 +4 -2
- package/README.md +150 -11
- package/dist/elkjs/index.cjs +2 -2
- package/dist/elkjs/index.d.cts +2 -0
- package/dist/elkjs/index.d.mts +2 -0
- package/dist/elkjs/index.mjs +2 -2
- package/dist/elkjs/main.cjs +1 -1
- package/dist/elkjs/main.mjs +1 -1
- package/dist/elkjs/worker.cjs +2 -2
- package/dist/elkjs/worker.mjs +2 -2
- package/dist/elkjs-BBfKN4Dw.mjs +3075 -0
- package/dist/elkjs-DNfXDPup.cjs +3104 -0
- package/dist/{index-BEA_pzeT.d.cts → index-B6cWNrMw.d.cts} +9 -1
- package/dist/{index-DNTLRsDl.d.mts → index-CJQLUKD9.d.mts} +9 -1
- package/dist/{index-DNixtE3h.d.mts → index-DT6lPMfS.d.cts} +85 -5
- package/dist/{index-D9dhxrRl.d.cts → index-F1U-fCTu.d.mts} +85 -5
- package/dist/index.cjs +6 -3
- package/dist/index.d.cts +3 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +4 -4
- package/dist/layered/index.cjs +3 -1
- package/dist/layered/index.d.cts +2 -2
- package/dist/layered/index.d.mts +2 -2
- package/dist/layered/index.mjs +2 -2
- package/dist/{layered-B2buJqMf.cjs → layered-5RxQhryb.cjs} +11184 -2932
- package/dist/{layered-DGFTeQSl.mjs → layered-DSesbctm.mjs} +12059 -3903
- package/dist/{layout-engine-Dn1PiFwP.cjs → layout-engine-CLFySz3R.cjs} +5 -18
- package/dist/{layout-engine-Cs5tatA6.mjs → layout-engine-GpBIX6ng.mjs} +3 -10
- package/dist/routing/index.cjs +2 -1
- package/dist/routing/index.d.cts +2 -2
- package/dist/routing/index.d.mts +2 -2
- package/dist/routing/index.mjs +2 -2
- package/dist/{routing-A2hrK9MP.mjs → routing-CR8flv8b.mjs} +977 -593
- package/dist/{routing-ujEP7Qh6.cjs → routing-QIdGGFBe.cjs} +986 -596
- package/package.json +8 -2
- package/src/authoring/coordinates.ts +28 -8
- package/src/authoring/partial.ts +7 -2
- package/src/authoring/routing.ts +4 -1
- package/src/constraints.ts +174 -6
- package/src/elkjs/index.ts +1476 -449
- package/src/elkjs/layout-quality.ts +267 -0
- package/src/elkjs/opposing-tracks.ts +161 -0
- package/src/elkjs/orthogonal-junctions.ts +174 -0
- package/src/elkjs/statechart.ts +9 -3
- package/src/elkjs/types.ts +2 -0
- package/src/index.ts +2 -0
- package/src/internal/elkjs-compatibility.ts +4 -1
- package/src/internal/layered-trace.ts +48 -0
- package/src/internal/layout-engine.ts +2 -1
- package/src/java-random.ts +6 -0
- package/src/layered/bk-node-placement.ts +403 -92
- package/src/layered/center-labels.ts +398 -0
- package/src/layered/compaction-bounds.ts +26 -0
- package/src/layered/compaction-errors.ts +2 -0
- package/src/layered/compaction-scanline.ts +63 -0
- package/src/layered/compound-boundaries.ts +99 -0
- package/src/layered/compound.ts +35 -7
- package/src/layered/constraint-orientation.ts +141 -0
- package/src/layered/crossing-constraints.ts +243 -0
- package/src/layered/crossing-counter.ts +233 -0
- package/src/layered/crossing-graph.ts +401 -0
- package/src/layered/cycle-random.ts +22 -0
- package/src/layered/elk-port-lists.ts +243 -0
- package/src/layered/end-labels.ts +124 -0
- package/src/layered/external-port-dummy.ts +137 -0
- package/src/layered/feedback-chains.ts +114 -0
- package/src/layered/fixed-self-loop.ts +150 -0
- package/src/layered/greedy-switch-decider.ts +356 -0
- package/src/layered/grouped-compaction.ts +787 -0
- package/src/layered/gwt-sort.ts +53 -0
- package/src/layered/hierarchical-port-phases.ts +242 -0
- package/src/layered/hierarchical-port-restoration.ts +233 -0
- package/src/layered/hierarchical-port-routing.ts +179 -0
- package/src/layered/hierarchy-crossing.ts +121 -0
- package/src/layered/hierarchy-sweepiness.ts +79 -0
- package/src/layered/hints.ts +371 -0
- package/src/layered/hyperedge-dummy-merger.ts +195 -0
- package/src/layered/index.ts +875 -161
- package/src/layered/initial-model-order.ts +404 -0
- package/src/layered/inverted-ports.ts +207 -0
- package/src/layered/label-dummy-switcher.ts +200 -0
- package/src/layered/long-edges.ts +135 -44
- package/src/layered/loop-envelopes.ts +184 -0
- package/src/layered/native-routing.ts +275 -0
- package/src/layered/network-simplex.ts +11 -15
- package/src/layered/node-margins.ts +59 -0
- package/src/layered/north-south-ports.ts +271 -0
- package/src/layered/opposing-tracks.ts +1044 -0
- package/src/layered/orthogonal-cycle-order.ts +106 -0
- package/src/layered/orthogonal-hypersegments.ts +154 -0
- package/src/layered/orthogonal-junctions.ts +202 -0
- package/src/layered/orthogonal-segments.ts +243 -0
- package/src/layered/placement-orientation.ts +22 -0
- package/src/layered/port-distributor.ts +192 -0
- package/src/layered/port-edge-order.ts +20 -0
- package/src/layered/replace-routing.ts +45 -0
- package/src/layered/routing-coordinates.ts +32 -0
- package/src/layered/separate-exterior-labels.ts +24 -6
- package/src/layered/spacing.ts +34 -12
- package/src/layered/splitter-order.ts +106 -0
- package/src/layered/strategies.ts +2124 -886
- package/src/layered/types.ts +13 -0
- package/src/layered/weighted-compaction.ts +84 -0
- package/src/routing/adapters.ts +32 -0
- package/src/routing/algorithms.ts +433 -21
- package/src/routing/coordination.ts +8 -3
- package/src/routing/index.ts +1 -0
- package/src/routing/search.ts +93 -11
- package/dist/elkjs-DaHMISnQ.mjs +0 -1677
- package/dist/elkjs-dMghiiWW.cjs +0 -1706
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_layered = require('./layered-
|
|
1
|
+
const require_layered = require('./layered-5RxQhryb.cjs');
|
|
2
2
|
let _statelyai_graph_layout = require("@statelyai/graph/layout");
|
|
3
3
|
|
|
4
4
|
//#region src/fixed.ts
|
|
@@ -68,14 +68,6 @@ const fixedAlgorithm = {
|
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
70
|
|
|
71
|
-
//#endregion
|
|
72
|
-
//#region src/internal/elkjs-compatibility.ts
|
|
73
|
-
const elkjs0111ResultPolicy = Symbol("elkjs0111ResultPolicy");
|
|
74
|
-
function setElkjs0111ResultPolicy(graph, policy) {
|
|
75
|
-
Object.defineProperty(graph, elkjs0111ResultPolicy, { value: policy });
|
|
76
|
-
return graph;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
71
|
//#endregion
|
|
80
72
|
//#region src/box.ts
|
|
81
73
|
function getPadding$3(value) {
|
|
@@ -207,7 +199,7 @@ const elkjs0111BoxAlgorithm = {
|
|
|
207
199
|
layout(graph, options = {}) {
|
|
208
200
|
const result = getBoxLayout(graph, options);
|
|
209
201
|
const padding = getPadding$3(options.padding);
|
|
210
|
-
return setElkjs0111ResultPolicy(result, {
|
|
202
|
+
return require_layered.setElkjs0111ResultPolicy(result, {
|
|
211
203
|
providerBounds: result.nodes.length === 0 ? {
|
|
212
204
|
width: 0,
|
|
213
205
|
height: 0
|
|
@@ -292,7 +284,7 @@ const elkjs0111RectanglePackingAlgorithm = {
|
|
|
292
284
|
layout(graph, options = {}) {
|
|
293
285
|
const result = getRectanglePackingLayout(graph, options);
|
|
294
286
|
const padding = getPadding$2(options.padding);
|
|
295
|
-
return setElkjs0111ResultPolicy(result, {
|
|
287
|
+
return require_layered.setElkjs0111ResultPolicy(result, {
|
|
296
288
|
providerBounds: result.nodes.length === 0 ? {
|
|
297
289
|
width: 0,
|
|
298
290
|
height: 0
|
|
@@ -453,7 +445,7 @@ function getRandomLayoutWithBehavior(graph, options, behavior) {
|
|
|
453
445
|
nodes,
|
|
454
446
|
edges
|
|
455
447
|
}, { direction: options.direction ?? graph.direction });
|
|
456
|
-
if (behavior.preserveProviderBounds) setElkjs0111ResultPolicy(result, { providerBounds: {
|
|
448
|
+
if (behavior.preserveProviderBounds) require_layered.setElkjs0111ResultPolicy(result, { providerBounds: {
|
|
457
449
|
width: drawWidth + 2 * (padding.left + padding.right),
|
|
458
450
|
height: drawHeight + 2 * (padding.top + padding.bottom)
|
|
459
451
|
} });
|
|
@@ -577,6 +569,7 @@ const elkjs0111LayoutAlgorithms = {
|
|
|
577
569
|
...builtInLayoutAlgorithms,
|
|
578
570
|
box: elkjs0111BoxAlgorithm,
|
|
579
571
|
random: elkjs0111RandomAlgorithm,
|
|
572
|
+
layered: require_layered.elkjs0111LayeredAlgorithm,
|
|
580
573
|
rectpacking: elkjs0111RectanglePackingAlgorithm
|
|
581
574
|
};
|
|
582
575
|
function getBuiltInLayoutAlgorithm(id) {
|
|
@@ -620,12 +613,6 @@ Object.defineProperty(exports, 'builtInLayoutAlgorithms', {
|
|
|
620
613
|
return builtInLayoutAlgorithms;
|
|
621
614
|
}
|
|
622
615
|
});
|
|
623
|
-
Object.defineProperty(exports, 'elkjs0111ResultPolicy', {
|
|
624
|
-
enumerable: true,
|
|
625
|
-
get: function () {
|
|
626
|
-
return elkjs0111ResultPolicy;
|
|
627
|
-
}
|
|
628
|
-
});
|
|
629
616
|
Object.defineProperty(exports, 'executeElkjs0111Layout', {
|
|
630
617
|
enumerable: true,
|
|
631
618
|
get: function () {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { K as placePorts, X as JavaRandom, i as layeredAlgorithm, n as elkjs0111LayeredAlgorithm, x as setElkjs0111ResultPolicy, z as getPolylineMidpoint } from "./layered-DSesbctm.mjs";
|
|
2
2
|
import { getNodeSize } from "@statelyai/graph/layout";
|
|
3
3
|
|
|
4
4
|
//#region src/fixed.ts
|
|
@@ -68,14 +68,6 @@ const fixedAlgorithm = {
|
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
70
|
|
|
71
|
-
//#endregion
|
|
72
|
-
//#region src/internal/elkjs-compatibility.ts
|
|
73
|
-
const elkjs0111ResultPolicy = Symbol("elkjs0111ResultPolicy");
|
|
74
|
-
function setElkjs0111ResultPolicy(graph, policy) {
|
|
75
|
-
Object.defineProperty(graph, elkjs0111ResultPolicy, { value: policy });
|
|
76
|
-
return graph;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
71
|
//#endregion
|
|
80
72
|
//#region src/box.ts
|
|
81
73
|
function getPadding$3(value) {
|
|
@@ -577,6 +569,7 @@ const elkjs0111LayoutAlgorithms = {
|
|
|
577
569
|
...builtInLayoutAlgorithms,
|
|
578
570
|
box: elkjs0111BoxAlgorithm,
|
|
579
571
|
random: elkjs0111RandomAlgorithm,
|
|
572
|
+
layered: elkjs0111LayeredAlgorithm,
|
|
580
573
|
rectpacking: elkjs0111RectanglePackingAlgorithm
|
|
581
574
|
};
|
|
582
575
|
function getBuiltInLayoutAlgorithm(id) {
|
|
@@ -608,4 +601,4 @@ function executeElkjs0111Layout({ algorithm: algorithm$1, graph, options }) {
|
|
|
608
601
|
}
|
|
609
602
|
|
|
610
603
|
//#endregion
|
|
611
|
-
export {
|
|
604
|
+
export { getSporeCompactionLayout as a, sporeOverlapRemovalAlgorithm as c, getRectanglePackingLayout as d, rectanglePackingAlgorithm as f, getFixedLayout as g, fixedAlgorithm as h, getBuiltInLayoutAlgorithm as i, getRandomLayout as l, getBoxLayout as m, executeElkjs0111Layout as n, getSporeOverlapRemovalLayout as o, boxAlgorithm as p, executeLayoutAlgorithm as r, sporeCompactionAlgorithm as s, builtInLayoutAlgorithms as t, randomAlgorithm as u };
|
package/dist/routing/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_routing = require('../routing-
|
|
1
|
+
const require_routing = require('../routing-QIdGGFBe.cjs');
|
|
2
2
|
|
|
3
3
|
exports.applyRoutePatches = require_routing.applyRoutePatches;
|
|
4
4
|
exports.bezierRouting = require_routing.bezierRouting;
|
|
@@ -21,6 +21,7 @@ exports.pathFromSplinePoints = require_routing.pathFromSplinePoints;
|
|
|
21
21
|
exports.polylineRouting = require_routing.polylineRouting;
|
|
22
22
|
exports.roundCorners = require_routing.roundCorners;
|
|
23
23
|
exports.routeToGraphPatch = require_routing.routeToGraphPatch;
|
|
24
|
+
exports.routeToPoints = require_routing.routeToPoints;
|
|
24
25
|
exports.routeToPolylines = require_routing.routeToPolylines;
|
|
25
26
|
exports.routingStrategies = require_routing.routingStrategies;
|
|
26
27
|
exports.selfLoopRouting = require_routing.selfLoopRouting;
|
package/dist/routing/index.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { _ as RoutingMetrics, a as RouteBounds, b as RoutingStrategy, c as RoutePath, d as RouteSegment, f as RouteSide, g as RoutingGraph, h as RoutingDiagnosticCode, i as RouteAttachment, l as RoutePoint, m as RoutingDiagnostic, n as NativeRoutingStrategy, o as RouteEndpoint, p as RouteStyle, r as Route, s as RoutePatch, t as EdgeRoutingSettings, u as RouteSection, v as RoutingSettings, x as RoutingUpdate, y as RoutingSnapshot } from "../types-uxPlGRof.cjs";
|
|
2
|
-
import { C as
|
|
3
|
-
export { EdgeRoutingSettings, FlattenPathOptions, NativeRoutingStrategy, Route, RouteAttachment, RouteBounds, RouteEndpoint, RoutePatch, RoutePath, RoutePoint, RouteSection, RouteSegment, RouteSide, RouteStyle, RoutingDiagnostic, RoutingDiagnosticCode, RoutingGraph, RoutingMetrics, RoutingSettings, RoutingSnapshot, RoutingStrategy, RoutingUpdate, applyRoutePatches, bezierRouting, bundleRouting, busRouting, curvedRouting, fanRouting, flattenPath, getLayoutRoutes, getPathBounds, getPathLength, getPointAtLength, getTangentAtLength, octilinearRouting, organicRouting, orthogonalRouting, parallelRouting, pathFromPoints, pathFromSplinePoints, polylineRouting, roundCorners, routeToGraphPatch, routeToPolylines, routingStrategies, selfLoopRouting, straightRouting, toSvgPath };
|
|
2
|
+
import { C as getPointAtLength, D as toSvgPath, E as roundCorners, O as applyRoutePatches, S as getPathLength, T as pathFromPoints, _ as routeToPoints, a as fanRouting, b as flattenPath, c as orthogonalRouting, d as routingStrategies, f as selfLoopRouting, g as routeToGraphPatch, h as pathFromSplinePoints, i as curvedRouting, l as parallelRouting, m as getLayoutRoutes, n as bundleRouting, o as octilinearRouting, p as straightRouting, r as busRouting, s as organicRouting, t as bezierRouting, u as polylineRouting, v as routeToPolylines, w as getTangentAtLength, x as getPathBounds, y as FlattenPathOptions } from "../index-B6cWNrMw.cjs";
|
|
3
|
+
export { EdgeRoutingSettings, FlattenPathOptions, NativeRoutingStrategy, Route, RouteAttachment, RouteBounds, RouteEndpoint, RoutePatch, RoutePath, RoutePoint, RouteSection, RouteSegment, RouteSide, RouteStyle, RoutingDiagnostic, RoutingDiagnosticCode, RoutingGraph, RoutingMetrics, RoutingSettings, RoutingSnapshot, RoutingStrategy, RoutingUpdate, applyRoutePatches, bezierRouting, bundleRouting, busRouting, curvedRouting, fanRouting, flattenPath, getLayoutRoutes, getPathBounds, getPathLength, getPointAtLength, getTangentAtLength, octilinearRouting, organicRouting, orthogonalRouting, parallelRouting, pathFromPoints, pathFromSplinePoints, polylineRouting, roundCorners, routeToGraphPatch, routeToPoints, routeToPolylines, routingStrategies, selfLoopRouting, straightRouting, toSvgPath };
|
package/dist/routing/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { _ as RoutingMetrics, a as RouteBounds, b as RoutingStrategy, c as RoutePath, d as RouteSegment, f as RouteSide, g as RoutingGraph, h as RoutingDiagnosticCode, i as RouteAttachment, l as RoutePoint, m as RoutingDiagnostic, n as NativeRoutingStrategy, o as RouteEndpoint, p as RouteStyle, r as Route, s as RoutePatch, t as EdgeRoutingSettings, u as RouteSection, v as RoutingSettings, x as RoutingUpdate, y as RoutingSnapshot } from "../types-CT2akdK0.mjs";
|
|
2
|
-
import { C as
|
|
3
|
-
export { EdgeRoutingSettings, FlattenPathOptions, NativeRoutingStrategy, Route, RouteAttachment, RouteBounds, RouteEndpoint, RoutePatch, RoutePath, RoutePoint, RouteSection, RouteSegment, RouteSide, RouteStyle, RoutingDiagnostic, RoutingDiagnosticCode, RoutingGraph, RoutingMetrics, RoutingSettings, RoutingSnapshot, RoutingStrategy, RoutingUpdate, applyRoutePatches, bezierRouting, bundleRouting, busRouting, curvedRouting, fanRouting, flattenPath, getLayoutRoutes, getPathBounds, getPathLength, getPointAtLength, getTangentAtLength, octilinearRouting, organicRouting, orthogonalRouting, parallelRouting, pathFromPoints, pathFromSplinePoints, polylineRouting, roundCorners, routeToGraphPatch, routeToPolylines, routingStrategies, selfLoopRouting, straightRouting, toSvgPath };
|
|
2
|
+
import { C as getPointAtLength, D as toSvgPath, E as roundCorners, O as applyRoutePatches, S as getPathLength, T as pathFromPoints, _ as routeToPoints, a as fanRouting, b as flattenPath, c as orthogonalRouting, d as routingStrategies, f as selfLoopRouting, g as routeToGraphPatch, h as pathFromSplinePoints, i as curvedRouting, l as parallelRouting, m as getLayoutRoutes, n as bundleRouting, o as octilinearRouting, p as straightRouting, r as busRouting, s as organicRouting, t as bezierRouting, u as polylineRouting, v as routeToPolylines, w as getTangentAtLength, x as getPathBounds, y as FlattenPathOptions } from "../index-CJQLUKD9.mjs";
|
|
3
|
+
export { EdgeRoutingSettings, FlattenPathOptions, NativeRoutingStrategy, Route, RouteAttachment, RouteBounds, RouteEndpoint, RoutePatch, RoutePath, RoutePoint, RouteSection, RouteSegment, RouteSide, RouteStyle, RoutingDiagnostic, RoutingDiagnosticCode, RoutingGraph, RoutingMetrics, RoutingSettings, RoutingSnapshot, RoutingStrategy, RoutingUpdate, applyRoutePatches, bezierRouting, bundleRouting, busRouting, curvedRouting, fanRouting, flattenPath, getLayoutRoutes, getPathBounds, getPathLength, getPointAtLength, getTangentAtLength, octilinearRouting, organicRouting, orthogonalRouting, parallelRouting, pathFromPoints, pathFromSplinePoints, polylineRouting, roundCorners, routeToGraphPatch, routeToPoints, routeToPolylines, routingStrategies, selfLoopRouting, straightRouting, toSvgPath };
|
package/dist/routing/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as getPointAtLength, D as toSvgPath, E as roundCorners, S as getPathLength, T as pathFromPoints, _ as routeToGraphPatch, a as fanRouting, b as flattenPath, c as orthogonalRouting, d as routingStrategies, f as selfLoopRouting, g as pathFromSplinePoints, h as getLayoutRoutes, i as curvedRouting, l as parallelRouting, m as applyRoutePatches, n as bundleRouting, o as octilinearRouting, p as straightRouting, r as busRouting, s as organicRouting, t as bezierRouting, u as polylineRouting, v as routeToPoints, w as getTangentAtLength, x as getPathBounds, y as routeToPolylines } from "../routing-CR8flv8b.mjs";
|
|
2
2
|
|
|
3
|
-
export { applyRoutePatches, bezierRouting, bundleRouting, busRouting, curvedRouting, fanRouting, flattenPath, getLayoutRoutes, getPathBounds, getPathLength, getPointAtLength, getTangentAtLength, octilinearRouting, organicRouting, orthogonalRouting, parallelRouting, pathFromPoints, pathFromSplinePoints, polylineRouting, roundCorners, routeToGraphPatch, routeToPolylines, routingStrategies, selfLoopRouting, straightRouting, toSvgPath };
|
|
3
|
+
export { applyRoutePatches, bezierRouting, bundleRouting, busRouting, curvedRouting, fanRouting, flattenPath, getLayoutRoutes, getPathBounds, getPathLength, getPointAtLength, getTangentAtLength, octilinearRouting, organicRouting, orthogonalRouting, parallelRouting, pathFromPoints, pathFromSplinePoints, polylineRouting, roundCorners, routeToGraphPatch, routeToPoints, routeToPolylines, routingStrategies, selfLoopRouting, straightRouting, toSvgPath };
|