@metronforge/concept-map 0.3.2 → 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/README.md +5 -2
- package/dist/layout/hints.d.ts +2 -2
- package/dist/layout/hints.d.ts.map +1 -1
- package/dist/layout/hints.js.map +1 -1
- package/dist/layout/index.d.ts +1 -6
- package/dist/layout/index.d.ts.map +1 -1
- package/dist/layout/index.js +1 -89
- package/dist/layout/index.js.map +1 -1
- package/dist/layout/layout.d.ts +7 -0
- package/dist/layout/layout.d.ts.map +1 -0
- package/dist/layout/layout.js +83 -0
- package/dist/layout/layout.js.map +1 -0
- package/dist/layout/place-sketch.d.ts +74 -0
- package/dist/layout/place-sketch.d.ts.map +1 -0
- package/dist/layout/place-sketch.js +20 -0
- package/dist/layout/place-sketch.js.map +1 -0
- package/dist/layout/place-with-hints.d.ts +7 -0
- package/dist/layout/place-with-hints.d.ts.map +1 -0
- package/dist/layout/place-with-hints.js +17 -0
- package/dist/layout/place-with-hints.js.map +1 -0
- package/dist/layout/relations/align-layout.d.ts.map +1 -1
- package/dist/layout/relations/align-layout.js +6 -2
- package/dist/layout/relations/align-layout.js.map +1 -1
- package/dist/layout/relations/apply.js +1 -1
- package/dist/layout/relations/apply.js.map +1 -1
- package/dist/layout/relations/bounds.d.ts +24 -0
- package/dist/layout/relations/bounds.d.ts.map +1 -0
- package/dist/layout/relations/bounds.js +126 -0
- package/dist/layout/relations/bounds.js.map +1 -0
- package/dist/layout/relations/check-linear.d.ts +17 -0
- package/dist/layout/relations/check-linear.d.ts.map +1 -0
- package/dist/layout/relations/check-linear.js +88 -0
- package/dist/layout/relations/check-linear.js.map +1 -0
- package/dist/layout/relations/check-objective.d.ts +10 -0
- package/dist/layout/relations/check-objective.d.ts.map +1 -0
- package/dist/layout/relations/check-objective.js +41 -0
- package/dist/layout/relations/check-objective.js.map +1 -0
- package/dist/layout/relations/check-witness.d.ts +4 -0
- package/dist/layout/relations/check-witness.d.ts.map +1 -1
- package/dist/layout/relations/check-witness.js +86 -5
- package/dist/layout/relations/check-witness.js.map +1 -1
- package/dist/layout/relations/cross.d.ts +1 -1
- package/dist/layout/relations/cross.d.ts.map +1 -1
- package/dist/layout/relations/cross.js +2 -2
- package/dist/layout/relations/cross.js.map +1 -1
- package/dist/layout/relations/derive.d.ts.map +1 -1
- package/dist/layout/relations/derive.js +18 -9
- package/dist/layout/relations/derive.js.map +1 -1
- package/dist/layout/relations/derived-input.d.ts +3 -0
- package/dist/layout/relations/derived-input.d.ts.map +1 -1
- package/dist/layout/relations/derived-input.js +9 -0
- package/dist/layout/relations/derived-input.js.map +1 -1
- package/dist/layout/relations/explain.d.ts +5 -0
- package/dist/layout/relations/explain.d.ts.map +1 -1
- package/dist/layout/relations/explain.js +53 -28
- package/dist/layout/relations/explain.js.map +1 -1
- package/dist/layout/relations/free-witness.d.ts +8 -0
- package/dist/layout/relations/free-witness.d.ts.map +1 -0
- package/dist/layout/relations/free-witness.js +38 -0
- package/dist/layout/relations/free-witness.js.map +1 -0
- package/dist/layout/relations/implication.d.ts +4 -0
- package/dist/layout/relations/implication.d.ts.map +1 -0
- package/dist/layout/relations/implication.js +23 -0
- package/dist/layout/relations/implication.js.map +1 -0
- package/dist/layout/relations/linear-differences.d.ts +16 -0
- package/dist/layout/relations/linear-differences.d.ts.map +1 -0
- package/dist/layout/relations/linear-differences.js +57 -0
- package/dist/layout/relations/linear-differences.js.map +1 -0
- package/dist/layout/relations/linear.d.ts +25 -0
- package/dist/layout/relations/linear.d.ts.map +1 -0
- package/dist/layout/relations/linear.js +75 -0
- package/dist/layout/relations/linear.js.map +1 -0
- package/dist/layout/relations/min-cost-flow.d.ts +7 -0
- package/dist/layout/relations/min-cost-flow.d.ts.map +1 -0
- package/dist/layout/relations/min-cost-flow.js +79 -0
- package/dist/layout/relations/min-cost-flow.js.map +1 -0
- package/dist/layout/relations/objective.d.ts +14 -0
- package/dist/layout/relations/objective.d.ts.map +1 -0
- package/dist/layout/relations/objective.js +33 -0
- package/dist/layout/relations/objective.js.map +1 -0
- package/dist/layout/relations/optimise.d.ts +20 -0
- package/dist/layout/relations/optimise.d.ts.map +1 -0
- package/dist/layout/relations/optimise.js +54 -0
- package/dist/layout/relations/optimise.js.map +1 -0
- package/dist/layout/relations/paths.d.ts +6 -0
- package/dist/layout/relations/paths.d.ts.map +1 -1
- package/dist/layout/relations/paths.js +35 -0
- package/dist/layout/relations/paths.js.map +1 -1
- package/dist/layout/relations/rank.d.ts +3 -2
- package/dist/layout/relations/rank.d.ts.map +1 -1
- package/dist/layout/relations/rank.js +5 -5
- package/dist/layout/relations/rank.js.map +1 -1
- package/dist/layout/relations/rational.d.ts +13 -0
- package/dist/layout/relations/rational.d.ts.map +1 -0
- package/dist/layout/relations/rational.js +28 -0
- package/dist/layout/relations/rational.js.map +1 -0
- package/dist/layout/relations/reduce-objective.d.ts +12 -0
- package/dist/layout/relations/reduce-objective.d.ts.map +1 -0
- package/dist/layout/relations/reduce-objective.js +37 -0
- package/dist/layout/relations/reduce-objective.js.map +1 -0
- package/dist/layout/relations/sketch-order.d.ts +7 -0
- package/dist/layout/relations/sketch-order.d.ts.map +1 -0
- package/dist/layout/relations/sketch-order.js +67 -0
- package/dist/layout/relations/sketch-order.js.map +1 -0
- package/dist/layout/relations/sketch-placement.d.ts +14 -0
- package/dist/layout/relations/sketch-placement.d.ts.map +1 -0
- package/dist/layout/relations/sketch-placement.js +123 -0
- package/dist/layout/relations/sketch-placement.js.map +1 -0
- package/dist/layout/relations/sketch-ranks.d.ts +5 -0
- package/dist/layout/relations/sketch-ranks.d.ts.map +1 -0
- package/dist/layout/relations/sketch-ranks.js +26 -0
- package/dist/layout/relations/sketch-ranks.js.map +1 -0
- package/dist/layout/relations/solve.d.ts +4 -1
- package/dist/layout/relations/solve.d.ts.map +1 -1
- package/dist/layout/relations/solve.js +10 -6
- package/dist/layout/relations/solve.js.map +1 -1
- package/dist/layout/route/channel-layout.d.ts +1 -0
- package/dist/layout/route/channel-layout.d.ts.map +1 -1
- package/dist/layout/route/channel-layout.js +4 -0
- package/dist/layout/route/channel-layout.js.map +1 -1
- package/dist/layout/route/channel-moved.d.ts +1 -1
- package/dist/layout/route/channel-moved.d.ts.map +1 -1
- package/dist/layout/route/channel-moved.js +8 -5
- package/dist/layout/route/channel-moved.js.map +1 -1
- package/dist/layout/sketch-agreement.d.ts +7 -0
- package/dist/layout/sketch-agreement.d.ts.map +1 -0
- package/dist/layout/sketch-agreement.js +48 -0
- package/dist/layout/sketch-agreement.js.map +1 -0
- package/dist/layout/sketch-bends.d.ts +5 -0
- package/dist/layout/sketch-bends.d.ts.map +1 -0
- package/dist/layout/sketch-bends.js +21 -0
- package/dist/layout/sketch-bends.js.map +1 -0
- package/dist/layout/sketch-conflicts.d.ts +8 -0
- package/dist/layout/sketch-conflicts.d.ts.map +1 -0
- package/dist/layout/sketch-conflicts.js +56 -0
- package/dist/layout/sketch-conflicts.js.map +1 -0
- package/dist/layout/sketch-returns.d.ts +4 -0
- package/dist/layout/sketch-returns.d.ts.map +1 -0
- package/dist/layout/sketch-returns.js +67 -0
- package/dist/layout/sketch-returns.js.map +1 -0
- package/dist/layout/sketch-route.d.ts +12 -0
- package/dist/layout/sketch-route.d.ts.map +1 -0
- package/dist/layout/sketch-route.js +109 -0
- package/dist/layout/sketch-route.js.map +1 -0
- package/dist/layout/sketch-safety.d.ts +6 -0
- package/dist/layout/sketch-safety.d.ts.map +1 -0
- package/dist/layout/sketch-safety.js +29 -0
- package/dist/layout/sketch-safety.js.map +1 -0
- package/dist/layout/sketch-shortcuts.d.ts +4 -0
- package/dist/layout/sketch-shortcuts.d.ts.map +1 -0
- package/dist/layout/sketch-shortcuts.js +51 -0
- package/dist/layout/sketch-shortcuts.js.map +1 -0
- package/dist/layout/stages/hints.d.ts.map +1 -1
- package/dist/layout/stages/hints.js +33 -15
- package/dist/layout/stages/hints.js.map +1 -1
- package/dist/layout/width.d.ts +1 -0
- package/dist/layout/width.d.ts.map +1 -1
- package/dist/layout/width.js +3 -0
- package/dist/layout/width.js.map +1 -1
- package/package.json +2 -2
- package/src/layout/hints.ts +2 -2
- package/src/layout/index.ts +1 -155
- package/src/layout/layout.ts +147 -0
- package/src/layout/place-sketch.ts +39 -0
- package/src/layout/place-with-hints.ts +32 -0
- package/src/layout/relations/align-layout.ts +11 -6
- package/src/layout/relations/apply.ts +1 -1
- package/src/layout/relations/bounds.ts +163 -0
- package/src/layout/relations/check-linear.ts +153 -0
- package/src/layout/relations/check-objective.ts +60 -0
- package/src/layout/relations/check-witness.ts +118 -5
- package/src/layout/relations/cross.ts +2 -1
- package/src/layout/relations/derive.ts +24 -9
- package/src/layout/relations/derived-input.ts +13 -0
- package/src/layout/relations/explain.ts +69 -32
- package/src/layout/relations/free-witness.ts +41 -0
- package/src/layout/relations/implication.ts +30 -0
- package/src/layout/relations/linear-differences.ts +77 -0
- package/src/layout/relations/linear.ts +107 -0
- package/src/layout/relations/min-cost-flow.ts +96 -0
- package/src/layout/relations/objective.ts +53 -0
- package/src/layout/relations/optimise.ts +97 -0
- package/src/layout/relations/paths.ts +35 -0
- package/src/layout/relations/rank.ts +7 -4
- package/src/layout/relations/rational.ts +39 -0
- package/src/layout/relations/reduce-objective.ts +60 -0
- package/src/layout/relations/sketch-order.ts +90 -0
- package/src/layout/relations/sketch-placement.ts +174 -0
- package/src/layout/relations/sketch-ranks.ts +29 -0
- package/src/layout/relations/solve.ts +14 -6
- package/src/layout/route/channel-layout.ts +7 -0
- package/src/layout/route/channel-moved.ts +8 -6
- package/src/layout/sketch-agreement.ts +69 -0
- package/src/layout/sketch-bends.ts +29 -0
- package/src/layout/sketch-conflicts.ts +69 -0
- package/src/layout/sketch-returns.ts +81 -0
- package/src/layout/sketch-route.ts +199 -0
- package/src/layout/sketch-safety.ts +64 -0
- package/src/layout/sketch-shortcuts.ts +65 -0
- package/src/layout/stages/hints.ts +47 -19
- package/src/layout/width.ts +4 -0
package/README.md
CHANGED
|
@@ -55,11 +55,11 @@ Load the stylesheet, one module script and one element on an HTML page:
|
|
|
55
55
|
```html
|
|
56
56
|
<link
|
|
57
57
|
rel="stylesheet"
|
|
58
|
-
href="https://esm.sh/@metronforge/concept-map@0.
|
|
58
|
+
href="https://esm.sh/@metronforge/concept-map@0.4.1/css"
|
|
59
59
|
/>
|
|
60
60
|
<script
|
|
61
61
|
type="module"
|
|
62
|
-
src="https://esm.sh/@metronforge/concept-map@0.
|
|
62
|
+
src="https://esm.sh/@metronforge/concept-map@0.4.1/element"
|
|
63
63
|
></script>
|
|
64
64
|
<concept-map src="./map.json" layout="dagre"></concept-map>
|
|
65
65
|
```
|
|
@@ -87,6 +87,9 @@ The last two accept resolved maps. For source maps, call `layout(source, engine)
|
|
|
87
87
|
from `@metronforge/concept-map/layout` first. See [integration](docs/INTEGRATION.md)
|
|
88
88
|
and [automatic layout](docs/LAYOUT.md).
|
|
89
89
|
|
|
90
|
+
Framework examples: [React](docs/frameworks/react.md),
|
|
91
|
+
[Vue](docs/frameworks/vue.md), and [Svelte](docs/frameworks/svelte.md).
|
|
92
|
+
|
|
90
93
|
## Lay out on the server
|
|
91
94
|
|
|
92
95
|
Install the optional engine with `npm install @dagrejs/dagre`. Read the source
|
package/dist/layout/hints.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SourceMap, ResolvedMap } from "../schema.js";
|
|
2
2
|
import type { Constraint } from "./problem.js";
|
|
3
|
-
import type { LayoutOptions, UnsupportedHint } from "./types.js";
|
|
3
|
+
import type { LayoutOptions, StatedHint, UnsupportedHint } from "./types.js";
|
|
4
4
|
export declare function statedHints(map: SourceMap | ResolvedMap): ({
|
|
5
5
|
origin: "stated";
|
|
6
6
|
path: string;
|
|
@@ -30,6 +30,6 @@ export declare function statedHints(map: SourceMap | ResolvedMap): ({
|
|
|
30
30
|
strength: "preferred" | "required";
|
|
31
31
|
})[];
|
|
32
32
|
/** Name source hints in capability refusals without losing their references. */
|
|
33
|
-
export declare function constraintName(constraint: Constraint): string;
|
|
33
|
+
export declare function constraintName(constraint: Constraint | StatedHint): string;
|
|
34
34
|
export declare function reportUnsupportedHints(constraints: readonly Constraint[], notify: LayoutOptions["onUnsupportedHints"], dropped?: readonly UnsupportedHint[]): void;
|
|
35
35
|
//# sourceMappingURL=hints.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hints.d.ts","sourceRoot":"","sources":["../../src/layout/hints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"hints.d.ts","sourceRoot":"","sources":["../../src/layout/hints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7E,wBAAgB,WAAW,CAAC,GAAG,EAAE,SAAS,GAAG,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;KAMvD;AAED,gFAAgF;AAChF,wBAAgB,cAAc,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,GAAG,MAAM,CAa1E;AAED,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,SAAS,UAAU,EAAE,EAClC,MAAM,EAAE,aAAa,CAAC,oBAAoB,CAAC,EAC3C,OAAO,GAAE,SAAS,eAAe,EAAO,GACvC,IAAI,CAuBN"}
|
package/dist/layout/hints.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hints.js","sourceRoot":"","sources":["../../src/layout/hints.ts"],"names":[],"mappings":"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;QAAE,MAAM,EAAE,CAAC,CAAC,GAAG,KAAK,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC;AACvE,CAAC"}
|
package/dist/layout/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import type { LayoutEngine, LayoutOptions } from "./types.js";
|
|
1
|
+
export { layout } from "./layout.js";
|
|
3
2
|
export { LayoutError, EngineFailedError, ResultRejectedError, UnsupportedConstraintsError, LayoutDefectsError, SameRankContradictionError, SameRankRoutingError, isSameRankContradictionError, isSameRankRoutingError, isLayoutError, isEngineFailedError, isResultRejectedError, isUnsupportedConstraintsError, isLayoutDefectsError, } from "./errors.js";
|
|
4
3
|
export type { SameRankHint, SameRankContradictionData, SameRankRoutingData, } from "./errors.js";
|
|
5
4
|
export type { Measurer } from "./ports.js";
|
|
@@ -11,8 +10,4 @@ export { measureLabel, fontTableMeasurer } from "./measure.js";
|
|
|
11
10
|
export { validateReferences } from "../schema/references.js";
|
|
12
11
|
export { check, describeDefects } from "./stages/report.js";
|
|
13
12
|
export type { Band, CheckOptions, Contact, LayoutReport, } from "./stages/report.js";
|
|
14
|
-
/** Validate first, then measure and lay out; complete hand geometry is retained.
|
|
15
|
-
* `layout` proposes a drawing; `check` judges it. Success here does not mean
|
|
16
|
-
* the drawing was checked unless `strict` is set. */
|
|
17
|
-
export declare function layout(input: unknown, engine: LayoutEngine, options?: LayoutOptions): Promise<ResolvedMap>;
|
|
18
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/layout/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/layout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,2BAA2B,EAC3B,kBAAkB,EAClB,0BAA0B,EAC1B,oBAAoB,EACpB,4BAA4B,EAC5B,sBAAsB,EACtB,aAAa,EACb,mBAAmB,EACnB,qBAAqB,EACrB,6BAA6B,EAC7B,oBAAoB,GACrB,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,YAAY,EACZ,yBAAyB,EACzB,mBAAmB,GACpB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,YAAY,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAChE,mBAAmB,YAAY,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC5D,YAAY,EACV,IAAI,EACJ,YAAY,EACZ,OAAO,EACP,YAAY,GACb,MAAM,oBAAoB,CAAC"}
|
package/dist/layout/index.js
CHANGED
|
@@ -1,96 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
import { parseMap } from "./check.js";
|
|
3
|
-
import { asMeasurer } from "./measure.js";
|
|
4
|
-
import { atWidth } from "./width.js";
|
|
5
|
-
import { refine } from "./stages/refine.js";
|
|
6
|
-
import { buildProblem, problemGraph } from "./build-problem.js";
|
|
7
|
-
import { reportUnsupportedHints } from "./hints.js";
|
|
8
|
-
import { asPlacer } from "./legacy.js";
|
|
9
|
-
import { place } from "./place.js";
|
|
10
|
-
import { checkConstraints } from "./stages/constraints.js";
|
|
11
|
-
import { resolveMeasured } from "./resolve-measured.js";
|
|
12
|
-
import { EngineFailedError, ResultRejectedError, UnsupportedConstraintsError, LayoutDefectsError, } from "./errors.js";
|
|
13
|
-
import { placeAnnotations } from "./stages/placement.js";
|
|
1
|
+
export { layout } from "./layout.js";
|
|
14
2
|
export { LayoutError, EngineFailedError, ResultRejectedError, UnsupportedConstraintsError, LayoutDefectsError, SameRankContradictionError, SameRankRoutingError, isSameRankContradictionError, isSameRankRoutingError, isLayoutError, isEngineFailedError, isResultRejectedError, isUnsupportedConstraintsError, isLayoutDefectsError, } from "./errors.js";
|
|
15
3
|
export { labelsInPanel } from "./stages/presentation.js";
|
|
16
4
|
export { refine } from "./stages/refine.js";
|
|
17
5
|
export { measureLabel, fontTableMeasurer } from "./measure.js";
|
|
18
6
|
export { validateReferences } from "../schema/references.js";
|
|
19
7
|
export { check, describeDefects } from "./stages/report.js";
|
|
20
|
-
/** Validate first, then measure and lay out; complete hand geometry is retained.
|
|
21
|
-
* `layout` proposes a drawing; `check` judges it. Success here does not mean
|
|
22
|
-
* the drawing was checked unless `strict` is set. */
|
|
23
|
-
export async function layout(input, engine, options = {}) {
|
|
24
|
-
const map = parseMap(input);
|
|
25
|
-
validateReferences(map);
|
|
26
|
-
if (options.widthEm !== undefined &&
|
|
27
|
-
(!Number.isFinite(options.widthEm) || options.widthEm <= 0))
|
|
28
|
-
throw new Error("widthEm must be a finite positive number");
|
|
29
|
-
const measurer = asMeasurer(options.measureLabel);
|
|
30
|
-
if ("viewBox" in map)
|
|
31
|
-
return strict(map, map, atWidth(measurer, map, options.widthEm).measure, options);
|
|
32
|
-
const resolved = await resolveAtWidth(map, engine, measurer, options);
|
|
33
|
-
return strict(map, resolved, atWidth(measurer, resolved, options.widthEm).measure, options);
|
|
34
|
-
}
|
|
35
|
-
async function resolveAtWidth(map, engine, measurer, options) {
|
|
36
|
-
let hints = [];
|
|
37
|
-
const collect = {
|
|
38
|
-
...options,
|
|
39
|
-
onUnsupportedHints: (items) => {
|
|
40
|
-
hints = items;
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
let resolved = await resolveSource(map, engine, measurer, collect);
|
|
44
|
-
if (options.widthEm !== undefined &&
|
|
45
|
-
resolved.viewBox[0] / options.widthEm > 10.5) {
|
|
46
|
-
hints = [];
|
|
47
|
-
resolved = await resolveSource(map, engine, atWidth(measurer, resolved, options.widthEm), collect, { measurer, widthEm: options.widthEm });
|
|
48
|
-
resolved = refine(resolved, atWidth(measurer, resolved, options.widthEm));
|
|
49
|
-
}
|
|
50
|
-
if (hints.length)
|
|
51
|
-
options.onUnsupportedHints?.(hints);
|
|
52
|
-
return resolved;
|
|
53
|
-
}
|
|
54
|
-
async function resolveSource(map, engine, measurer, options, refinement) {
|
|
55
|
-
const measure = measurer.measure.bind(measurer);
|
|
56
|
-
const problem = buildProblem(map, measure, options.intent);
|
|
57
|
-
const graph = problemGraph(problem);
|
|
58
|
-
const placer = asPlacer(engine);
|
|
59
|
-
const sameRank = map.layout?.hints.some((h) => h.kind === "sameRank");
|
|
60
|
-
const requiredPin = map.layout?.hints.some((h) => h.kind === "pin" && h.strength === "required");
|
|
61
|
-
const free = map.layout?.hints.some((h) => h.kind === "free");
|
|
62
|
-
const outcome = (sameRank || requiredPin) && !free
|
|
63
|
-
? await (await import("./place-same-rank.js")).placeSameRank(map, problem, placer, measurer, refinement)
|
|
64
|
-
: free
|
|
65
|
-
? await (await import("./place-free.js")).placeFree(map, problem, placer, measurer, refinement)
|
|
66
|
-
: await place(problem, placer);
|
|
67
|
-
if (outcome.kind === "engine-failed")
|
|
68
|
-
throw new EngineFailedError(outcome);
|
|
69
|
-
if (outcome.kind === "unsupported-constraints")
|
|
70
|
-
throw new UnsupportedConstraintsError(outcome);
|
|
71
|
-
reportUnsupportedHints(outcome.unsupported, options.onUnsupportedHints, outcome.dropped);
|
|
72
|
-
const resolved = resolveMeasured(map, graph, outcome.result, measurer);
|
|
73
|
-
checkRequired(map, resolved, placer.name);
|
|
74
|
-
validateReferences(resolved);
|
|
75
|
-
return placeAnnotations(resolved);
|
|
76
|
-
}
|
|
77
|
-
function checkRequired(map, resolved, placer) {
|
|
78
|
-
const rejected = checkConstraints(map, resolved).find((c) => c.strength === "required" && c.holds === false);
|
|
79
|
-
if (rejected)
|
|
80
|
-
throw new ResultRejectedError({
|
|
81
|
-
placer,
|
|
82
|
-
constraint: rejected.kind,
|
|
83
|
-
message: rejected.message,
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
/** The check is loaded only for `strict`, so plain layout stays small. */
|
|
87
|
-
async function strict(source, resolved, measure, options) {
|
|
88
|
-
if (!options.strict)
|
|
89
|
-
return resolved;
|
|
90
|
-
const { check, describeDefects } = await import("./stages/report.js");
|
|
91
|
-
const report = check(source, resolved, { measureLabel: measure });
|
|
92
|
-
if (!report.hard)
|
|
93
|
-
return resolved;
|
|
94
|
-
throw new LayoutDefectsError(report, `The layout has hard defects:\n${describeDefects(report).join("\n")}`);
|
|
95
|
-
}
|
|
96
8
|
//# sourceMappingURL=index.js.map
|
package/dist/layout/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/layout/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/layout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,2BAA2B,EAC3B,kBAAkB,EAClB,0BAA0B,EAC1B,oBAAoB,EACpB,4BAA4B,EAC5B,sBAAsB,EACtB,aAAa,EACb,mBAAmB,EACnB,qBAAqB,EACrB,6BAA6B,EAC7B,oBAAoB,GACrB,MAAM,aAAa,CAAC;AAOrB,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG5C,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ResolvedMap } from "../schema.js";
|
|
2
|
+
import type { LayoutEngine, LayoutOptions } from "./types.js";
|
|
3
|
+
/** Validate first, then measure and lay out; complete hand geometry is retained.
|
|
4
|
+
* `layout` proposes a drawing; `check` judges it. Success here does not mean
|
|
5
|
+
* the drawing was checked unless `strict` is set. */
|
|
6
|
+
export declare function layout(input: unknown, engine: LayoutEngine, options?: LayoutOptions): Promise<ResolvedMap>;
|
|
7
|
+
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/layout/layout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAa,MAAM,cAAc,CAAC;AAc3D,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAmB,MAAM,YAAY,CAAC;AAQ/E;;qDAEqD;AACrD,wBAAsB,MAAM,CAC1B,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,YAAY,EACpB,OAAO,GAAE,aAAkB,GAC1B,OAAO,CAAC,WAAW,CAAC,CAuBtB"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { validateReferences } from "../schema/references.js";
|
|
2
|
+
import { parseMap } from "./check.js";
|
|
3
|
+
import { asMeasurer } from "./measure.js";
|
|
4
|
+
import { atWidth, needsWidthPass } from "./width.js";
|
|
5
|
+
import { refine } from "./stages/refine.js";
|
|
6
|
+
import { buildProblem, problemGraph } from "./build-problem.js";
|
|
7
|
+
import { reportUnsupportedHints } from "./hints.js";
|
|
8
|
+
import { asPlacer } from "./legacy.js";
|
|
9
|
+
import { placeWithHints } from "./place-with-hints.js";
|
|
10
|
+
import { checkConstraints } from "./stages/constraints.js";
|
|
11
|
+
import { resolveMeasured } from "./resolve-measured.js";
|
|
12
|
+
import { EngineFailedError, ResultRejectedError, UnsupportedConstraintsError, LayoutDefectsError, } from "./errors.js";
|
|
13
|
+
import { placeAnnotations } from "./stages/placement.js";
|
|
14
|
+
/** Validate first, then measure and lay out; complete hand geometry is retained.
|
|
15
|
+
* `layout` proposes a drawing; `check` judges it. Success here does not mean
|
|
16
|
+
* the drawing was checked unless `strict` is set. */
|
|
17
|
+
export async function layout(input, engine, options = {}) {
|
|
18
|
+
const map = parseMap(input);
|
|
19
|
+
validateReferences(map);
|
|
20
|
+
if (options.widthEm !== undefined &&
|
|
21
|
+
(!Number.isFinite(options.widthEm) || options.widthEm <= 0))
|
|
22
|
+
throw new Error("widthEm must be a finite positive number");
|
|
23
|
+
const measurer = asMeasurer(options.measureLabel);
|
|
24
|
+
if ("viewBox" in map)
|
|
25
|
+
return strict(map, map, atWidth(measurer, map, options.widthEm).measure, options);
|
|
26
|
+
const resolved = await resolveAtWidth(map, engine, measurer, options);
|
|
27
|
+
return strict(map, resolved, atWidth(measurer, resolved, options.widthEm).measure, options);
|
|
28
|
+
}
|
|
29
|
+
async function resolveAtWidth(map, engine, measurer, options) {
|
|
30
|
+
let hints = [];
|
|
31
|
+
const collect = {
|
|
32
|
+
...options,
|
|
33
|
+
onUnsupportedHints: (items) => {
|
|
34
|
+
hints = items;
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
let resolved = await resolveSource(map, engine, measurer, collect);
|
|
38
|
+
if (options.widthEm !== undefined &&
|
|
39
|
+
needsWidthPass(resolved, options.widthEm)) {
|
|
40
|
+
hints = [];
|
|
41
|
+
resolved = await resolveSource(map, engine, atWidth(measurer, resolved, options.widthEm), collect, { measurer, widthEm: options.widthEm });
|
|
42
|
+
resolved = refine(resolved, atWidth(measurer, resolved, options.widthEm));
|
|
43
|
+
}
|
|
44
|
+
if (hints.length)
|
|
45
|
+
options.onUnsupportedHints?.(hints);
|
|
46
|
+
return resolved;
|
|
47
|
+
}
|
|
48
|
+
async function resolveSource(map, engine, measurer, options, refinement) {
|
|
49
|
+
const measure = measurer.measure.bind(measurer);
|
|
50
|
+
const problem = buildProblem(map, measure, options.intent);
|
|
51
|
+
const graph = problemGraph(problem);
|
|
52
|
+
const placer = asPlacer(engine);
|
|
53
|
+
const outcome = await placeWithHints(map, problem, placer, measurer, refinement, refinement ? undefined : options.widthEm);
|
|
54
|
+
if (outcome.kind === "engine-failed")
|
|
55
|
+
throw new EngineFailedError(outcome);
|
|
56
|
+
if (outcome.kind === "unsupported-constraints")
|
|
57
|
+
throw new UnsupportedConstraintsError(outcome);
|
|
58
|
+
reportUnsupportedHints(outcome.unsupported, options.onUnsupportedHints, outcome.dropped);
|
|
59
|
+
const resolved = resolveMeasured(map, graph, outcome.result, measurer);
|
|
60
|
+
checkRequired(map, resolved, placer.name);
|
|
61
|
+
validateReferences(resolved);
|
|
62
|
+
return placeAnnotations(resolved);
|
|
63
|
+
}
|
|
64
|
+
function checkRequired(map, resolved, placer) {
|
|
65
|
+
const rejected = checkConstraints(map, resolved).find((c) => c.strength === "required" && c.holds === false);
|
|
66
|
+
if (rejected)
|
|
67
|
+
throw new ResultRejectedError({
|
|
68
|
+
placer,
|
|
69
|
+
constraint: rejected.kind,
|
|
70
|
+
message: rejected.message,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/** The check is loaded only for `strict`, so plain layout stays small. */
|
|
74
|
+
async function strict(source, resolved, measure, options) {
|
|
75
|
+
if (!options.strict)
|
|
76
|
+
return resolved;
|
|
77
|
+
const { check, describeDefects } = await import("./stages/report.js");
|
|
78
|
+
const report = check(source, resolved, { measureLabel: measure });
|
|
79
|
+
if (!report.hard)
|
|
80
|
+
return resolved;
|
|
81
|
+
throw new LayoutDefectsError(report, `The layout has hard defects:\n${describeDefects(report).join("\n")}`);
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../../src/layout/layout.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AAC;AAED,SAAS,aAAa,CAAC,GAAc,EAAE,QAAqB,EAAE,MAAc;IAC1E,MAAM,QAAQ,GAAG,gBAAgB,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,IAAI,CACnD,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,UAAU,IAAI,CAAC,CAAC,KAAK,KAAK,KAAK,CACtD,CAAC;IACF,IAAI,QAAQ;QACV,MAAM,IAAI,mBAAmB,CAAC;YAC5B,MAAM;YACN,UAAU,EAAE,QAAQ,CAAC,IAAI;YACzB,OAAO,EAAE,QAAQ,CAAC,OAAO;SAC1B,CAAC,CAAC;AACP,CAAC;AAED,0EAA0E;AAC1E,KAAK,UAAU,MAAM,CACnB,MAA+B,EAC/B,QAAqB,EACrB,OAA2C,EAC3C,OAAsB;IAEtB,IAAI,CAAC,OAAO,CAAC,MAAM;QAAE,OAAO,QAAQ,CAAC;IACrC,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAAC,CAAC;IACtE,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,EAAE,QAAQ,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC,CAAC;IAClE,IAAI,CAAC,MAAM,CAAC,IAAI;QAAE,OAAO,QAAQ,CAAC;IAClC,MAAM,IAAI,kBAAkB,CAC1B,MAAM,EACN,iCAAiC,eAAe,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACtE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { SourceMap } from "../schema.js";
|
|
2
|
+
import type { LayoutProblem } from "./problem.js";
|
|
3
|
+
import type { Measurer, Placer } from "./ports.js";
|
|
4
|
+
import type { RouteRefinement } from "./inspect-routes.js";
|
|
5
|
+
/** Optional preferred-pin pass after an engine places the boxes. */
|
|
6
|
+
export declare function placeSketch(source: SourceMap, problem: LayoutProblem, placer: Placer, measurer: Measurer, refinement?: RouteRefinement, sizingWidthEm?: number): Promise<import("./outcomes.js").EngineFailure | import("./outcomes.js").UnsupportedConstraints | {
|
|
7
|
+
dropped: import("./types.js").UnsupportedHint[];
|
|
8
|
+
unsupported: (({
|
|
9
|
+
strength: import("./problem.js").Strength;
|
|
10
|
+
origin?: "stated";
|
|
11
|
+
path?: string;
|
|
12
|
+
} & {
|
|
13
|
+
kind: "direction";
|
|
14
|
+
direction: import("./problem.js").Direction;
|
|
15
|
+
}) | ({
|
|
16
|
+
strength: import("./problem.js").Strength;
|
|
17
|
+
origin?: "stated";
|
|
18
|
+
path?: string;
|
|
19
|
+
} & {
|
|
20
|
+
kind: "lanes";
|
|
21
|
+
direction: import("./problem.js").Direction;
|
|
22
|
+
lanes: readonly string[];
|
|
23
|
+
}) | ({
|
|
24
|
+
strength: import("./problem.js").Strength;
|
|
25
|
+
origin?: "stated";
|
|
26
|
+
path?: string;
|
|
27
|
+
} & {
|
|
28
|
+
kind: "order";
|
|
29
|
+
nodes: readonly string[];
|
|
30
|
+
}) | ({
|
|
31
|
+
strength: import("./problem.js").Strength;
|
|
32
|
+
origin?: "stated";
|
|
33
|
+
path?: string;
|
|
34
|
+
} & {
|
|
35
|
+
kind: "mainPath";
|
|
36
|
+
edges: readonly string[];
|
|
37
|
+
}) | ({
|
|
38
|
+
strength: import("./problem.js").Strength;
|
|
39
|
+
origin?: "stated";
|
|
40
|
+
path?: string;
|
|
41
|
+
} & {
|
|
42
|
+
kind: "free";
|
|
43
|
+
edge: string;
|
|
44
|
+
}) | ({
|
|
45
|
+
strength: import("./problem.js").Strength;
|
|
46
|
+
origin?: "stated";
|
|
47
|
+
path?: string;
|
|
48
|
+
} & {
|
|
49
|
+
kind: "sameRank";
|
|
50
|
+
nodes: readonly string[];
|
|
51
|
+
}) | ({
|
|
52
|
+
strength: import("./problem.js").Strength;
|
|
53
|
+
origin?: "stated";
|
|
54
|
+
path?: string;
|
|
55
|
+
} & {
|
|
56
|
+
kind: "relation";
|
|
57
|
+
node: string;
|
|
58
|
+
target: string;
|
|
59
|
+
relation: "rightOf" | "leftOf" | "above" | "below" | "alignX" | "alignY";
|
|
60
|
+
gap?: number;
|
|
61
|
+
}) | ({
|
|
62
|
+
strength: import("./problem.js").Strength;
|
|
63
|
+
origin?: "stated";
|
|
64
|
+
path?: string;
|
|
65
|
+
} & {
|
|
66
|
+
kind: "side";
|
|
67
|
+
edge: string;
|
|
68
|
+
end: "from" | "to";
|
|
69
|
+
side: "left" | "top" | "right" | "bottom";
|
|
70
|
+
}))[];
|
|
71
|
+
result: import("./types.js").LayoutResult;
|
|
72
|
+
kind: "placed";
|
|
73
|
+
}>;
|
|
74
|
+
//# sourceMappingURL=place-sketch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"place-sketch.d.ts","sourceRoot":"","sources":["../../src/layout/place-sketch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAM3D,oEAAoE;AACpE,wBAAsB,WAAW,CAC/B,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,UAAU,CAAC,EAAE,eAAe,EAC5B,aAAa,CAAC,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsBvB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { place } from "./place.js";
|
|
2
|
+
import { problemGraph } from "./build-problem.js";
|
|
3
|
+
import { sketchConflicts } from "./sketch-conflicts.js";
|
|
4
|
+
import { routeSketch } from "./sketch-route.js";
|
|
5
|
+
/** Optional preferred-pin pass after an engine places the boxes. */
|
|
6
|
+
export async function placeSketch(source, problem, placer, measurer, refinement, sizingWidthEm) {
|
|
7
|
+
const outcome = await place(problem, placer);
|
|
8
|
+
if (outcome.kind !== "placed")
|
|
9
|
+
return outcome;
|
|
10
|
+
const graph = problemGraph(problem);
|
|
11
|
+
const diagnostics = sketchConflicts(problem);
|
|
12
|
+
const result = routeSketch(source, problem, graph, outcome.result, measurer, refinement, sizingWidthEm, diagnostics.record);
|
|
13
|
+
return {
|
|
14
|
+
...outcome,
|
|
15
|
+
dropped: diagnostics.hints,
|
|
16
|
+
unsupported: outcome.unsupported.filter((hint) => hint.kind !== "pin"),
|
|
17
|
+
result,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=place-sketch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"place-sketch.js","sourceRoot":"","sources":["../../src/layout/place-sketch.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,oEAAoE;AACpE,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,MAAiB,EACjB,OAAsB,EACtB,MAAc,EACd,QAAkB,EAClB,UAA4B,EAC5B,aAAsB;IAEtB,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC7C,IAAI,OAAO,CAAC,IAAI,KAAK,QAAQ;QAAE,OAAO,OAAO,CAAC;IAC9C,MAAM,KAAK,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;IACpC,MAAM,WAAW,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;IAC7C,MAAM,MAAM,GAAG,WAAW,CACxB,MAAM,EACN,OAAO,EACP,KAAK,EACL,OAAO,CAAC,MAAM,EACd,QAAQ,EACR,UAAU,EACV,aAAa,EACb,WAAW,CAAC,MAAM,CACnB,CAAC;IACF,OAAO;QACL,GAAG,OAAO;QACV,OAAO,EAAE,WAAW,CAAC,KAAK;QAC1B,WAAW,EAAE,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC;QACtE,MAAM;KACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SourceMap } from "../schema.js";
|
|
2
|
+
import type { LayoutProblem } from "./problem.js";
|
|
3
|
+
import type { Measurer, Placer } from "./ports.js";
|
|
4
|
+
import type { RouteRefinement } from "./inspect-routes.js";
|
|
5
|
+
/** Load only the hint stage needed by this map. */
|
|
6
|
+
export declare function placeWithHints(map: SourceMap, problem: LayoutProblem, placer: Placer, measurer: Measurer, refinement?: RouteRefinement, sizingWidthEm?: number): Promise<import("./outcomes.js").PlacementOutcome>;
|
|
7
|
+
//# sourceMappingURL=place-with-hints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"place-with-hints.d.ts","sourceRoot":"","sources":["../../src/layout/place-with-hints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAG3D,mDAAmD;AACnD,wBAAsB,cAAc,CAClC,GAAG,EAAE,SAAS,EACd,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,UAAU,CAAC,EAAE,eAAe,EAC5B,aAAa,CAAC,EAAE,MAAM,qDAkBvB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { place } from "./place.js";
|
|
2
|
+
/** Load only the hint stage needed by this map. */
|
|
3
|
+
export async function placeWithHints(map, problem, placer, measurer, refinement, sizingWidthEm) {
|
|
4
|
+
const hints = map.layout?.hints ?? [];
|
|
5
|
+
const sameRank = hints.some((h) => h.kind === "sameRank");
|
|
6
|
+
const requiredPin = hints.some((h) => h.kind === "pin" && h.strength === "required");
|
|
7
|
+
const free = hints.some((h) => h.kind === "free");
|
|
8
|
+
const args = [map, problem, placer, measurer, refinement];
|
|
9
|
+
if ((sameRank || requiredPin) && !free)
|
|
10
|
+
return (await import("./place-same-rank.js")).placeSameRank(...args);
|
|
11
|
+
if (free)
|
|
12
|
+
return (await import("./place-free.js")).placeFree(...args);
|
|
13
|
+
if (hints.some((hint) => hint.kind === "pin"))
|
|
14
|
+
return (await import("./place-sketch.js")).placeSketch(...args, sizingWidthEm);
|
|
15
|
+
return place(problem, placer);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=place-with-hints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"place-with-hints.js","sourceRoot":"","sources":["../../src/layout/place-with-hints.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,mDAAmD;AACnD,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,GAAc,EACd,OAAsB,EACtB,MAAc,EACd,QAAkB,EAClB,UAA4B,EAC5B,aAAsB;IAEtB,MAAM,KAAK,GAAG,GAAG,CAAC,MAAM,EAAE,KAAK,IAAI,EAAE,CAAC;IACtC,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC;IAC1D,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAC5B,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,KAAK,IAAI,CAAC,CAAC,QAAQ,KAAK,UAAU,CACrD,CAAC;IACF,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC;IAClD,MAAM,IAAI,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,CAAU,CAAC;IACnE,IAAI,CAAC,QAAQ,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI;QACpC,OAAO,CAAC,MAAM,MAAM,CAAC,sBAAsB,CAAC,CAAC,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,CAAC;IACvE,IAAI,IAAI;QAAE,OAAO,CAAC,MAAM,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,CAAC;IACtE,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC;QAC3C,OAAO,CAAC,MAAM,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAAC,WAAW,CACpD,GAAG,IAAI,EACP,aAAa,CACd,CAAC;IACJ,OAAO,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"align-layout.d.ts","sourceRoot":"","sources":["../../../src/layout/relations/align-layout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"align-layout.d.ts","sourceRoot":"","sources":["../../../src/layout/relations/align-layout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAsChD,8EAA8E;AAC9E,wBAAgB,WAAW,CACzB,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM;;;;;;;;EA+BhB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { alignLaneRanks } from "./align-lanes.js";
|
|
2
2
|
import { applyRelations } from "./apply.js";
|
|
3
3
|
import { crossRelations } from "./cross.js";
|
|
4
|
+
import { optimiseAligned } from "./optimise.js";
|
|
4
5
|
import { solveRelations } from "./solve.js";
|
|
5
6
|
/** Grow only the trailing cross boundary, retaining the engine's padding.
|
|
6
7
|
* Empty lanes retain their cross extents, even when rank order moves them.
|
|
@@ -36,12 +37,15 @@ export function alignLayout(problem, original, rankGap, nodeGap) {
|
|
|
36
37
|
const direction = problem.constraints.find((c) => c.kind === "direction");
|
|
37
38
|
const cross = direction?.direction === "right" ? 1 : 0;
|
|
38
39
|
const system = crossRelations(problem, ranked.nodes, nodeGap);
|
|
39
|
-
const
|
|
40
|
+
const solution = solveRelations(system);
|
|
41
|
+
const aligned = applyRelations(system, solution, ranked.nodes, cross);
|
|
40
42
|
if (aligned.status === "contradictory")
|
|
41
43
|
throw new Error("Internal cross-axis separation contradiction");
|
|
44
|
+
const nodes = optimiseAligned(problem, system, solution, aligned.nodes, cross);
|
|
42
45
|
return {
|
|
43
46
|
...aligned,
|
|
44
|
-
|
|
47
|
+
nodes,
|
|
48
|
+
lanes: widenLanes(problem, original, nodes, ranked.lanes, cross),
|
|
45
49
|
};
|
|
46
50
|
}
|
|
47
51
|
//# sourceMappingURL=align-layout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"align-layout.js","sourceRoot":"","sources":["../../../src/layout/relations/align-layout.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cA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C,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC;IAC1E,MAAM,KAAK,GAAG,SAAS,EAAE,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACvD,MAAM,MAAM,GAAG,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAC9D,MAAM,QAAQ,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;IACxC,MAAM,OAAO,GAAG,cAAc,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACtE,IAAI,OAAO,CAAC,MAAM,KAAK,eAAe;QACpC,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;IAClE,MAAM,KAAK,GAAG,eAAe,CAC3B,OAAO,EACP,MAAM,EACN,QAAQ,EACR,OAAO,CAAC,KAAK,EACb,KAAK,CACN,CAAC;IACF,OAAO;QACL,GAAG,OAAO;QACV,KAAK;QACL,KAAK,EAAE,UAAU,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC;KACjE,CAAC;AACJ,CAAC"}
|
|
@@ -65,7 +65,7 @@ export function applyRelations(system, solution, boxes, axis) {
|
|
|
65
65
|
if (solution.status === "contradictory")
|
|
66
66
|
return solution;
|
|
67
67
|
if (solution.status === "underdetermined")
|
|
68
|
-
throw new Error(`Internal alignment error: unexpected shift ${JSON.stringify(solution.shift)}`);
|
|
68
|
+
throw new Error(`Internal alignment error: unexpected free shift ${JSON.stringify(solution.shift)}`);
|
|
69
69
|
const nodes = Object.fromEntries(Object.entries(boxes).map(([id, box]) => [id, [...box]]));
|
|
70
70
|
for (const p of solution.placements)
|
|
71
71
|
if (Object.hasOwn(nodes, p.variable))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply.js","sourceRo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C,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { RelationGraph, RelationSource } from "./types.js";
|
|
2
|
+
export interface RelationBound {
|
|
3
|
+
variable: string;
|
|
4
|
+
determined: boolean;
|
|
5
|
+
lower: number | null;
|
|
6
|
+
upper: number | null;
|
|
7
|
+
lowerPath: RelationSource[] | null;
|
|
8
|
+
upperPath: RelationSource[] | null;
|
|
9
|
+
/** Feasible coordinates in ticks with this finite end reached. */
|
|
10
|
+
lowerAttainment: number[] | null;
|
|
11
|
+
upperAttainment: number[] | null;
|
|
12
|
+
/** A feasible placement and a group that can move without limit. */
|
|
13
|
+
lowerRay: {
|
|
14
|
+
placement: number[];
|
|
15
|
+
variables: string[];
|
|
16
|
+
} | null;
|
|
17
|
+
upperRay: {
|
|
18
|
+
placement: number[];
|
|
19
|
+
variables: string[];
|
|
20
|
+
} | null;
|
|
21
|
+
}
|
|
22
|
+
/** Feasible bounds in exact 1/64 ticks; null means no bound on that side. */
|
|
23
|
+
export declare function relationBounds(graph: RelationGraph, feasible?: number[]): RelationBound[];
|
|
24
|
+
//# sourceMappingURL=bounds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bounds.d.ts","sourceRoot":"","sources":["../../../src/layout/relations/bounds.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAgB,aAAa,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE9E,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,SAAS,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC;IACnC,SAAS,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC;IACnC,kEAAkE;IAClE,eAAe,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACjC,eAAe,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACjC,oEAAoE;IACpE,QAAQ,EAAE;QAAE,SAAS,EAAE,MAAM,EAAE,CAAC;QAAC,SAAS,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,IAAI,CAAC;IAC9D,QAAQ,EAAE;QAAE,SAAS,EAAE,MAAM,EAAE,CAAC;QAAC,SAAS,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,IAAI,CAAC;CAC/D;AAgHD,6EAA6E;AAC7E,wBAAgB,cAAc,CAC5B,KAAK,EAAE,aAAa,EACpB,QAAQ,CAAC,EAAE,MAAM,EAAE,GAClB,aAAa,EAAE,CA8BjB"}
|