@mark1russell7/layout-contract 0.3.12 → 0.5.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 +6 -5
- package/build/index.d.ts +112 -13
- package/build/index.d.ts.map +1 -1
- package/build/index.js +327 -50
- package/build/index.js.map +1 -1
- package/build/{measures-C-Tuv8GU.d.ts → measures-KWg_was6.d.ts} +28 -5
- package/build/{measures-C-Tuv8GU.d.ts.map → measures-KWg_was6.d.ts.map} +1 -1
- package/build/text.d.ts +1 -1
- package/package.json +1 -1
- package/src/record.ts +11 -1
- package/src/rules.ts +184 -30
- package/src/shapes.ts +47 -5
- package/src/strategy-catalog.ts +140 -10
package/build/index.js
CHANGED
|
@@ -177,7 +177,7 @@ function pointSegmentDistance(p, a, b) {
|
|
|
177
177
|
// src/shapes.ts
|
|
178
178
|
/**
|
|
179
179
|
* The declared shape kinds, in their order. Only `rect` has all of its geometry.
|
|
180
|
-
* `polygon` and `circle` have their bounding box and their exact area. `free` has its bounding box only.
|
|
180
|
+
* `polygon` and `circle` have their bounding box and their exact area. A `circle` also has the overlap test of two circles. `free` has its bounding box only.
|
|
181
181
|
*/
|
|
182
182
|
const SHAPE_KINDS = /* @__PURE__ */ Object.freeze([
|
|
183
183
|
{
|
|
@@ -214,7 +214,7 @@ const SHAPE_KINDS = /* @__PURE__ */ Object.freeze([
|
|
|
214
214
|
bounds: true,
|
|
215
215
|
area: true,
|
|
216
216
|
contains: false,
|
|
217
|
-
overlap:
|
|
217
|
+
overlap: true
|
|
218
218
|
}
|
|
219
219
|
},
|
|
220
220
|
{
|
|
@@ -256,14 +256,35 @@ function shapeLevel(use, kind) {
|
|
|
256
256
|
if (level !== "none") return level;
|
|
257
257
|
return use.bound?.shapes.includes(kind) === true ? "bound" : "none";
|
|
258
258
|
}
|
|
259
|
+
/** This function tells if a limit names an input. An input without a circle box is not in a limit. */
|
|
260
|
+
function inLimit(limit, input) {
|
|
261
|
+
const kinds = shapeKindsOf(input);
|
|
262
|
+
if (!kinds.includes("circle")) return false;
|
|
263
|
+
if (limit.reads === "neighbours") return kinds.length > 1 || (input.obstacles?.length ?? 0) > 0;
|
|
264
|
+
const shape = input.container?.shape?.kind;
|
|
265
|
+
return shape === "polygon" || shape === "ellipse";
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* This function gives the level of a measure or a rule on a shape kind for one input. It is `shapeLevel` with the `limit` of the rule.
|
|
269
|
+
* When the limit names the input, the level `exact` becomes `safe`. Each other level does not change.
|
|
270
|
+
*/
|
|
271
|
+
function inputShapeLevel(use, kind, input) {
|
|
272
|
+
const level = shapeLevel(use, kind);
|
|
273
|
+
return level === "exact" && use.limit !== void 0 && inLimit(use.limit, input) ? "safe" : level;
|
|
274
|
+
}
|
|
259
275
|
/**
|
|
260
276
|
* This function gives the problems of a list of measures and rules. An empty list tells that the list is good.
|
|
261
277
|
* It refuses an unknown kind, a kind two times in one list, and a kind in more than one of `shapesOf`, `safe` and `bound.shapes`.
|
|
262
278
|
* It also refuses a `bound` without a list of kinds, and a `side` that is not `upper` or `lower`.
|
|
279
|
+
* It also refuses a `limit` with a bad `reads` or a bad `until`.
|
|
263
280
|
*/
|
|
264
281
|
function shapeSupportProblems(uses) {
|
|
265
282
|
const out = [];
|
|
266
283
|
for (const use of uses) {
|
|
284
|
+
if (use.limit !== void 0) {
|
|
285
|
+
if (use.limit.reads !== "neighbours" && use.limit.reads !== "container") out.push(`${use.id}: the limit reads ${String(use.limit.reads)}, not neighbours or container`);
|
|
286
|
+
if (!/^\d{4}-\d{2}-\d{2}$/.test(String(use.limit.until))) out.push(`${use.id}: the limit date ${String(use.limit.until)} is not YYYY-MM-DD`);
|
|
287
|
+
}
|
|
267
288
|
const bound = use.bound;
|
|
268
289
|
const isBound = typeof bound === "object" && bound !== null && !Array.isArray(bound);
|
|
269
290
|
if (bound !== void 0 && !isBound) out.push(`${use.id}: the bound value is not an object with shapes and a side`);
|
|
@@ -364,7 +385,7 @@ function checkShapes(input, uses, options = {}) {
|
|
|
364
385
|
for (const use of uses) {
|
|
365
386
|
const shapes = shapesOf(use);
|
|
366
387
|
for (const kind of kinds) {
|
|
367
|
-
const level =
|
|
388
|
+
const level = inputShapeLevel(use, kind, input);
|
|
368
389
|
if (level === "exact" || level === "safe" && (options.level === "safe" || options.level === "bound") || level === "bound" && options.level === "bound") continue;
|
|
369
390
|
const ids = input.boxes.filter((b) => shapeKindOf(b) === kind).map((b) => b.id);
|
|
370
391
|
const shown = ids.slice(0, 5).join(", ") + (ids.length > 5 ? `, and ${ids.length - 5} more` : "");
|
|
@@ -664,7 +685,11 @@ const RECORD_OPTIONAL_STRINGS = [
|
|
|
664
685
|
"skipped",
|
|
665
686
|
"commit"
|
|
666
687
|
];
|
|
667
|
-
const RECORD_OPTIONAL_NUMBERS = [
|
|
688
|
+
const RECORD_OPTIONAL_NUMBERS = [
|
|
689
|
+
"budgetMs",
|
|
690
|
+
"msAtLeast",
|
|
691
|
+
"hardRule"
|
|
692
|
+
];
|
|
668
693
|
const ENV_STRINGS = [
|
|
669
694
|
"node",
|
|
670
695
|
"os",
|
|
@@ -691,6 +716,13 @@ function envProblems(env) {
|
|
|
691
716
|
return out;
|
|
692
717
|
}
|
|
693
718
|
/**
|
|
719
|
+
* This function gives the version of the rules that made the counts of `hard` of a record. A record without `hardRule` has version 1.
|
|
720
|
+
* On version 1, a count on a circle is by its bounding box. So it is an upper bound, and a count over 0 proves nothing.
|
|
721
|
+
*/
|
|
722
|
+
function hardRuleOf(record) {
|
|
723
|
+
return record.hardRule ?? 1;
|
|
724
|
+
}
|
|
725
|
+
/**
|
|
694
726
|
* This function gives the problems of one `layout-record/1` value. An empty list means a good record.
|
|
695
727
|
* A record that has `skipped` has `deterministic: null`. An old skipped record with a boolean is also correct.
|
|
696
728
|
* A record without `skipped` has a boolean. The check accepts fields that the format does not know.
|
|
@@ -756,45 +788,136 @@ function placedRect(box) {
|
|
|
756
788
|
};
|
|
757
789
|
}
|
|
758
790
|
/**
|
|
759
|
-
*
|
|
760
|
-
* A box with a shape counts as its bounding box. That area is larger, thus the count is safe.
|
|
791
|
+
* The version of the rules that count `no-overlap` and `in-container`. A record states it in `LayoutRecord.hardRule`.
|
|
761
792
|
*
|
|
762
|
-
*
|
|
763
|
-
*
|
|
793
|
+
* - Version 1 counts each shape by its bounding box. On a circle, that count is an upper bound. A count over 0 proves nothing.
|
|
794
|
+
* - Version 2 counts two circles, and a circle in a circle container, by the distance of the centers. The other pairs stay on the bounding box.
|
|
764
795
|
*/
|
|
765
|
-
|
|
766
|
-
|
|
796
|
+
const HARD_RULE_VERSION = 2;
|
|
797
|
+
/** This function gives the circle of a placed box. A box without a position, or with another shape, gives `undefined`. */
|
|
798
|
+
function placedCircle(box) {
|
|
799
|
+
if (box.shape?.kind !== "circle" || box.x === void 0 || box.y === void 0) return void 0;
|
|
800
|
+
return {
|
|
801
|
+
cx: box.x + box.shape.cx,
|
|
802
|
+
cy: box.y + box.shape.cy,
|
|
803
|
+
r: box.shape.r
|
|
804
|
+
};
|
|
805
|
+
}
|
|
806
|
+
/** This function gives the largest side of a margin. A circle has one distance to the things near it, so its margin is this side. */
|
|
807
|
+
function marginReach(margin) {
|
|
808
|
+
const m = marginSides(margin);
|
|
809
|
+
return Math.max(m.top, m.right, m.bottom, m.left);
|
|
810
|
+
}
|
|
811
|
+
/** This function tells if the centers of two circles are nearer than `need`. It compares the squares, so it does not take a root. */
|
|
812
|
+
function nearerThan(a, b, need) {
|
|
813
|
+
if (need <= 0) return false;
|
|
814
|
+
const dx = a.cx - b.cx;
|
|
815
|
+
const dy = a.cy - b.cy;
|
|
816
|
+
return dx * dx + dy * dy < need * need;
|
|
817
|
+
}
|
|
818
|
+
/**
|
|
819
|
+
* This function tells if two placed boxes break `no-overlap`. It is the rule for one pair of `countOverlaps`.
|
|
820
|
+
*
|
|
821
|
+
* - Two circles break the rule when their centers are nearer than the two radii and the two margins, less `tolerance`. The margin of a circle is the largest side of its margin.
|
|
822
|
+
* - Another pair breaks the rule when the bounding boxes with their margins overlap by more than `tolerance` on each axis. With a shape that is not a rectangle, this test is an upper bound.
|
|
823
|
+
* - With `gap`, the gap replaces the two margins. Two circles are then apart by the two radii and the gap. For another pair, one box grows by the gap.
|
|
824
|
+
* - A box without a position does not overlap.
|
|
825
|
+
*/
|
|
826
|
+
function shapesOverlap(a, b, tolerance = DEFAULT_TOLERANCE.overlap, gap) {
|
|
827
|
+
const ca = placedCircle(a);
|
|
828
|
+
const cb = placedCircle(b);
|
|
829
|
+
if (ca !== void 0 && cb !== void 0) return nearerThan(ca, cb, ca.r + cb.r + (gap ?? marginReach(a.margin) + marginReach(b.margin)) - tolerance);
|
|
830
|
+
const ra = placedRect(a);
|
|
831
|
+
const rb = placedRect(b);
|
|
832
|
+
if (ra === void 0 || rb === void 0) return false;
|
|
833
|
+
const o = gap === void 0 ? overlapOf(grow(ra, a.margin), grow(rb, b.margin)) : overlapOf(grow(ra, gap), rb);
|
|
834
|
+
return o.x > tolerance && o.y > tolerance;
|
|
835
|
+
}
|
|
836
|
+
/** This function gives the gap of each pair of `pairGaps` by `pairKey`. The first entry of a pair wins. A pair of one box has no gap. */
|
|
837
|
+
function gapsOf(pairGaps) {
|
|
767
838
|
const gaps = /* @__PURE__ */ new Map();
|
|
768
|
-
for (const p of pairGaps) {
|
|
839
|
+
for (const p of pairGaps ?? []) {
|
|
769
840
|
const key = pairKey(p.a, p.b);
|
|
770
841
|
if (p.a !== p.b && !gaps.has(key)) gaps.set(key, p.gap);
|
|
771
842
|
}
|
|
843
|
+
return gaps;
|
|
844
|
+
}
|
|
845
|
+
/**
|
|
846
|
+
* This function counts the pairs of placed boxes that break `no-overlap`. `shapesOverlap` is the rule for one pair.
|
|
847
|
+
* Two circles count by the distance of their centers. Each other pair counts by the bounding boxes, so a circle beside another shape is an upper bound (roadmap item L107).
|
|
848
|
+
*
|
|
849
|
+
* A pair of `pairGaps`, in either order, uses its `gap` in place of the two margins. One box grows by the gap, and the other box does not grow.
|
|
850
|
+
* Thus the pair breaks the rule only when the boxes are nearer than the gap on each axis. The other pairs do not change.
|
|
851
|
+
*/
|
|
852
|
+
function countOverlaps(boxes, tolerance = DEFAULT_TOLERANCE.overlap, pairGaps) {
|
|
853
|
+
const circles = circleOverlaps(boxes, tolerance, pairGaps);
|
|
854
|
+
if (pairGaps === void 0 || pairGaps.length === 0) return circles + marginOverlaps(boxes, tolerance, void 0);
|
|
855
|
+
const gaps = gapsOf(pairGaps);
|
|
772
856
|
const raw = /* @__PURE__ */ new Map();
|
|
773
|
-
for (const box of boxes)
|
|
774
|
-
|
|
775
|
-
if (r !== void 0 && !raw.has(box.id)) raw.set(box.id, r);
|
|
776
|
-
}
|
|
777
|
-
let count = marginOverlaps(boxes, tolerance, gaps);
|
|
857
|
+
for (const box of boxes) if (placedRect(box) !== void 0 && !raw.has(box.id)) raw.set(box.id, box);
|
|
858
|
+
let count = circles + marginOverlaps(boxes, tolerance, gaps);
|
|
778
859
|
for (const [key, gap] of gaps) {
|
|
779
860
|
const [a, b] = JSON.parse(key);
|
|
780
|
-
const
|
|
781
|
-
const
|
|
782
|
-
if (
|
|
783
|
-
|
|
784
|
-
if (
|
|
861
|
+
const ba = raw.get(a);
|
|
862
|
+
const bb = raw.get(b);
|
|
863
|
+
if (ba === void 0 || bb === void 0) continue;
|
|
864
|
+
if (placedCircle(ba) !== void 0 && placedCircle(bb) !== void 0) continue;
|
|
865
|
+
if (shapesOverlap(ba, bb, tolerance, gap)) count++;
|
|
785
866
|
}
|
|
786
867
|
return count;
|
|
787
868
|
}
|
|
788
869
|
/** This function gives the key of a pair of box ids, with the same key for each order. */
|
|
789
870
|
const pairKey = (a, b) => JSON.stringify(a < b ? [a, b] : [b, a]);
|
|
790
|
-
/**
|
|
871
|
+
/**
|
|
872
|
+
* This function counts the pairs of placed circles that break `no-overlap`, by the distance of their centers. Each other box does not count.
|
|
873
|
+
*
|
|
874
|
+
* - Two circles break the rule when their centers are nearer than the two radii, the two margins and `gap`, less `tolerance`.
|
|
875
|
+
* - The margin of a circle is the largest side of its margin.
|
|
876
|
+
* - A pair of `pairGaps` is apart by the two radii and its gap, in place of the margins and `gap`.
|
|
877
|
+
* - `gap` has the default 0. The rule `no-overlap` does not read `LayoutInput.gap`, so `countOverlaps` gives no value. An engine that keeps the gap between circles gives it here.
|
|
878
|
+
*/
|
|
879
|
+
function circleOverlaps(boxes, tolerance = DEFAULT_TOLERANCE.overlap, pairGaps, gap = 0) {
|
|
880
|
+
const gaps = gapsOf(pairGaps);
|
|
881
|
+
const discs = [];
|
|
882
|
+
const first = /* @__PURE__ */ new Map();
|
|
883
|
+
for (const box of boxes) {
|
|
884
|
+
const c = placedCircle(box);
|
|
885
|
+
if (c === void 0) continue;
|
|
886
|
+
discs.push({
|
|
887
|
+
id: box.id,
|
|
888
|
+
c,
|
|
889
|
+
reach: c.r + marginReach(box.margin) + gap / 2
|
|
890
|
+
});
|
|
891
|
+
if (!first.has(box.id)) first.set(box.id, c);
|
|
892
|
+
}
|
|
893
|
+
discs.sort((a, b) => a.c.cx - a.reach - (b.c.cx - b.reach));
|
|
894
|
+
let count = 0;
|
|
895
|
+
for (let i = 0; i < discs.length; i++) {
|
|
896
|
+
const a = discs[i];
|
|
897
|
+
for (let j = i + 1; j < discs.length; j++) {
|
|
898
|
+
const b = discs[j];
|
|
899
|
+
if (b.c.cx - b.reach >= a.c.cx + a.reach - tolerance) break;
|
|
900
|
+
if (gaps.has(pairKey(a.id, b.id))) continue;
|
|
901
|
+
if (nearerThan(a.c, b.c, a.reach + b.reach - tolerance)) count++;
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
for (const [key, g] of gaps) {
|
|
905
|
+
const [a, b] = JSON.parse(key);
|
|
906
|
+
const ca = first.get(a);
|
|
907
|
+
const cb = first.get(b);
|
|
908
|
+
if (ca !== void 0 && cb !== void 0 && nearerThan(ca, cb, ca.r + cb.r + g - tolerance)) count++;
|
|
909
|
+
}
|
|
910
|
+
return count;
|
|
911
|
+
}
|
|
912
|
+
/** This function counts the overlaps by the bounding boxes with their margins. It skips the pairs of `skip` and the pairs of two circles. */
|
|
791
913
|
function marginOverlaps(boxes, tolerance, skip) {
|
|
792
914
|
const rects = [];
|
|
793
915
|
for (const box of boxes) {
|
|
794
916
|
const r = placedRect(box);
|
|
795
917
|
if (r !== void 0) rects.push({
|
|
796
918
|
id: box.id,
|
|
797
|
-
r: grow(r, box.margin)
|
|
919
|
+
r: grow(r, box.margin),
|
|
920
|
+
circle: box.shape?.kind === "circle"
|
|
798
921
|
});
|
|
799
922
|
}
|
|
800
923
|
rects.sort((a, b) => a.r.x - b.r.x);
|
|
@@ -804,6 +927,7 @@ function marginOverlaps(boxes, tolerance, skip) {
|
|
|
804
927
|
for (let j = i + 1; j < rects.length; j++) {
|
|
805
928
|
const b = rects[j].r;
|
|
806
929
|
if (b.x >= a.x + a.w - tolerance) break;
|
|
930
|
+
if (rects[i].circle && rects[j].circle) continue;
|
|
807
931
|
if (skip !== void 0 && skip.has(pairKey(rects[i].id, rects[j].id))) continue;
|
|
808
932
|
const o = overlapOf(a, b);
|
|
809
933
|
if (o.x > tolerance && o.y > tolerance) count++;
|
|
@@ -811,18 +935,61 @@ function marginOverlaps(boxes, tolerance, skip) {
|
|
|
811
935
|
}
|
|
812
936
|
return count;
|
|
813
937
|
}
|
|
938
|
+
/** This function gives the circle of a circle container. A free size reads its radius from `w`, and the corner of the shape stays. Another container, or a free size without `w`, gives `undefined`. */
|
|
939
|
+
function containerCircle(c) {
|
|
940
|
+
const s = c.shape;
|
|
941
|
+
if (s?.kind !== "circle") return void 0;
|
|
942
|
+
if (c.fixed === "size") return s;
|
|
943
|
+
if (c.w === void 0) return void 0;
|
|
944
|
+
const r = c.w / 2;
|
|
945
|
+
return {
|
|
946
|
+
cx: s.cx - s.r + r,
|
|
947
|
+
cy: s.cy - s.r + r,
|
|
948
|
+
r
|
|
949
|
+
};
|
|
950
|
+
}
|
|
951
|
+
/** This function tells if a circle goes out of a circle container. The reach is the center distance, the radius and `extra`. It compares the squares. */
|
|
952
|
+
function circleOutside(disc, extra, ring, tolerance) {
|
|
953
|
+
const room = ring.r + tolerance - disc.r - extra;
|
|
954
|
+
if (room < 0) return true;
|
|
955
|
+
const dx = disc.cx - ring.cx;
|
|
956
|
+
const dy = disc.cy - ring.cy;
|
|
957
|
+
return dx * dx + dy * dy > room * room;
|
|
958
|
+
}
|
|
959
|
+
/**
|
|
960
|
+
* This function counts the placed circles that go out of a circle container, by the distance of the centers.
|
|
961
|
+
*
|
|
962
|
+
* - The reach of a circle is the sum of the center distance, the radius, the largest side of the margin and the inset.
|
|
963
|
+
* - A circle breaks the rule when its reach is more than the container radius plus `tolerance`.
|
|
964
|
+
* - A container with a free size reads its radius from `w`, and its center is the corner of the shape plus that radius. `applyPack` writes that `w`.
|
|
965
|
+
* - Each other box does not count. The function throws a `RangeError` for a container that is not a circle.
|
|
966
|
+
*/
|
|
967
|
+
function circlesOutside(input, tolerance = DEFAULT_TOLERANCE.overlap) {
|
|
968
|
+
const c = input.container;
|
|
969
|
+
const ring = c === void 0 ? void 0 : containerCircle(c);
|
|
970
|
+
if (c === void 0 || ring === void 0) throw new RangeError("The function circlesOutside needs a circle container, with w when its size is free.");
|
|
971
|
+
let count = 0;
|
|
972
|
+
for (const box of input.boxes) {
|
|
973
|
+
const disc = placedCircle(box);
|
|
974
|
+
if (disc !== void 0 && circleOutside(disc, marginReach(box.margin) + (c.inset ?? 0), ring, tolerance)) count++;
|
|
975
|
+
}
|
|
976
|
+
return count;
|
|
977
|
+
}
|
|
814
978
|
/**
|
|
815
979
|
* This function counts the placed boxes that go out of the container.
|
|
816
980
|
* Each box with its margin must stay inside the container made smaller by `inset`. Only the fixed sides of the size count. A shaped container counts as its bounding box.
|
|
817
981
|
*
|
|
818
|
-
* With `exactContainer`, a box of a shaped container with the size `fixed` also counts when
|
|
982
|
+
* With `exactContainer`, the default, a box of a shaped container with the size `fixed` also counts when it is not inside the shape, by `rectInRegion`.
|
|
819
983
|
* For that test, the box grows by `inset` and becomes smaller by `tolerance` on each side. A shaped container with a free side keeps the bounding test only.
|
|
984
|
+
* A circle in a circle container does not use `rectInRegion`. It counts by distance, as in `circlesOutside`, also when the size is free.
|
|
820
985
|
* An input without a container gives 0.
|
|
821
986
|
*/
|
|
822
987
|
function countOutside(input, tolerance = DEFAULT_TOLERANCE.overlap, options = {}) {
|
|
823
988
|
const c = input.container;
|
|
824
989
|
if (c === void 0) return 0;
|
|
825
|
-
const
|
|
990
|
+
const exact = options.exactContainer !== false;
|
|
991
|
+
const shape = exact && c.fixed === "size" ? c.shape : void 0;
|
|
992
|
+
const ring = exact ? containerCircle(c) : void 0;
|
|
826
993
|
const area = c.shape === void 0 ? {
|
|
827
994
|
x: 0,
|
|
828
995
|
y: 0,
|
|
@@ -839,8 +1006,11 @@ function countOutside(input, tolerance = DEFAULT_TOLERANCE.overlap, options = {}
|
|
|
839
1006
|
const r = grow(r0, box.margin);
|
|
840
1007
|
const outX = r.x < area.x + inset - tolerance || r.x + r.w > area.x + area.w - inset + tolerance;
|
|
841
1008
|
const outY = r.y < area.y + inset - tolerance || r.y + r.h > area.y + area.h - inset + tolerance;
|
|
1009
|
+
const disc = ring === void 0 ? void 0 : placedCircle(box);
|
|
842
1010
|
if (fixW && outX || fixH && outY) count++;
|
|
843
|
-
else if (
|
|
1011
|
+
else if (ring !== void 0 && disc !== void 0) {
|
|
1012
|
+
if (circleOutside(disc, marginReach(box.margin) + inset, ring, tolerance)) count++;
|
|
1013
|
+
} else if (shape !== void 0 && !rectInRegion(shape, shrink(grow(r, inset), tolerance))) count++;
|
|
844
1014
|
}
|
|
845
1015
|
return count;
|
|
846
1016
|
}
|
|
@@ -863,28 +1033,30 @@ function countPortsOffBorder(boxes, eps = RECORD_EPS) {
|
|
|
863
1033
|
}
|
|
864
1034
|
/**
|
|
865
1035
|
* The hard rules of a pack, with the shape kinds that each rule supports.
|
|
866
|
-
* `no-overlap` and `in-container`
|
|
867
|
-
* For the other kinds, the count is safe: a shape is inside its bounding box, so the count is an upper bound. A count of 0 tells that the rule has no break.
|
|
1036
|
+
* `no-overlap` and `in-container` are exact for a `rect` and a `circle`. `limit` tells the inputs where the count of a circle is only safe (roadmap item L107).
|
|
1037
|
+
* For the other kinds, these rules test the bounding box. The count is safe: a shape is inside its bounding box, so the count is an upper bound. A count of 0 tells that the rule has no break.
|
|
868
1038
|
* `locked-kept` and `complete` read only the positions and the ids, so they support each kind.
|
|
869
1039
|
*/
|
|
870
1040
|
const PACK_HARD_RULES = /* @__PURE__ */ Object.freeze([
|
|
871
1041
|
{
|
|
872
1042
|
id: "no-overlap",
|
|
873
|
-
shapes: ["rect"],
|
|
874
|
-
safe: [
|
|
875
|
-
|
|
876
|
-
"
|
|
877
|
-
"
|
|
878
|
-
|
|
1043
|
+
shapes: ["rect", "circle"],
|
|
1044
|
+
safe: ["polygon", "free"],
|
|
1045
|
+
limit: {
|
|
1046
|
+
reads: "neighbours",
|
|
1047
|
+
because: "A circle beside another shape kind or an obstacle counts by its bounding box.",
|
|
1048
|
+
until: "2026-11-28"
|
|
1049
|
+
}
|
|
879
1050
|
},
|
|
880
1051
|
{
|
|
881
1052
|
id: "in-container",
|
|
882
|
-
shapes: ["rect"],
|
|
883
|
-
safe: [
|
|
884
|
-
|
|
885
|
-
"
|
|
886
|
-
"
|
|
887
|
-
|
|
1053
|
+
shapes: ["rect", "circle"],
|
|
1054
|
+
safe: ["polygon", "free"],
|
|
1055
|
+
limit: {
|
|
1056
|
+
reads: "container",
|
|
1057
|
+
because: "A circle in a polygon or an ellipse container counts by its bounding box.",
|
|
1058
|
+
until: "2026-11-28"
|
|
1059
|
+
}
|
|
888
1060
|
},
|
|
889
1061
|
{
|
|
890
1062
|
id: "locked-kept",
|
|
@@ -1050,7 +1222,7 @@ function countObstacleHits(boxes, obstacles, tolerance = DEFAULT_TOLERANCE.overl
|
|
|
1050
1222
|
/**
|
|
1051
1223
|
* This function gives the count of each hard rule of the output of a packer.
|
|
1052
1224
|
* It applies the output with `applyPack`. Only the placed boxes and the locked boxes count for the overlaps and the container.
|
|
1053
|
-
* `no-overlap` counts the pairs of boxes and the pairs of a box and an obstacle. A pair of `pairGaps` uses its gap in place of the margins.
|
|
1225
|
+
* `no-overlap` counts the pairs of boxes and the pairs of a box and an obstacle. A pair of `pairGaps` uses its gap in place of the margins. `HARD_RULE_VERSION` tells the version of these counts.
|
|
1054
1226
|
*
|
|
1055
1227
|
* A locked box without a placement, or with a move of more than `RECORD_EPS`, breaks `locked-kept`.
|
|
1056
1228
|
* A locked box without a position in the input is a bad input, not a break. `checkInput` finds it.
|
|
@@ -3749,13 +3921,30 @@ function checkSchema(strategy) {
|
|
|
3749
3921
|
return out;
|
|
3750
3922
|
}
|
|
3751
3923
|
// src/strategy-catalog.ts
|
|
3752
|
-
/** The schema of a strategy catalog. A new field is a new version of the schema. */
|
|
3753
|
-
const STRATEGY_CATALOG_SCHEMA = "strategy-catalog/
|
|
3924
|
+
/** The newest schema of a strategy catalog. A new field is a new version of the schema. */
|
|
3925
|
+
const STRATEGY_CATALOG_SCHEMA = "strategy-catalog/2";
|
|
3926
|
+
/** The schemas that `parseStrategyCatalog` reads, oldest first. Schema 2 adds the field `output` of an entry. */
|
|
3927
|
+
const STRATEGY_CATALOG_SCHEMAS = ["strategy-catalog/1", STRATEGY_CATALOG_SCHEMA];
|
|
3754
3928
|
/**
|
|
3755
3929
|
* The dimension of `supports` that tells who owns the positions of the nodes. The value `host` means that the strategy keeps the positions that the host gives.
|
|
3756
3930
|
* The value `engine` means that the strategy can set them. A strategy that moves nodes has only `engine`. A `SupportProbe` tests the claim with a run.
|
|
3757
3931
|
*/
|
|
3758
3932
|
const NODE_POSITIONS_DIMENSION = "nodePositions";
|
|
3933
|
+
/** The output properties that tell if the numbers of a result are whole: the positions and the sizes. The parser examines the class of these properties. */
|
|
3934
|
+
const OUTPUT_GRID_PROPERTIES = ["position-grid", "size-grid"];
|
|
3935
|
+
/** The largest distance from a whole number for a near-whole value. A value at a larger distance is fractional. */
|
|
3936
|
+
const OUTPUT_NEAR_WHOLE = 1e-9;
|
|
3937
|
+
/** The fewest packed inputs for the class `whole` or `near-whole`. A fraction needs no such count, because one counterexample is a proof. */
|
|
3938
|
+
const OUTPUT_CLASS_MIN_INPUTS = 30;
|
|
3939
|
+
/**
|
|
3940
|
+
* This function gives the class of a grid property from its counts. One fractional input gives `fractional` at any count.
|
|
3941
|
+
* With no fraction, fewer than `OUTPUT_CLASS_MIN_INPUTS` inputs give `untested`. Each other read gives `near-whole` or `whole`.
|
|
3942
|
+
*/
|
|
3943
|
+
function outputGridClass(counts) {
|
|
3944
|
+
if (counts.fractionalInputs > 0) return "fractional";
|
|
3945
|
+
if (counts.inputs < 30) return "untested";
|
|
3946
|
+
return counts.nearWholeInputs > 0 ? "near-whole" : "whole";
|
|
3947
|
+
}
|
|
3759
3948
|
const STRATEGY_KINDS = [
|
|
3760
3949
|
"single",
|
|
3761
3950
|
"composite",
|
|
@@ -3787,6 +3976,7 @@ const ENTRY_FIELDS = [
|
|
|
3787
3976
|
"determinismNote",
|
|
3788
3977
|
"optIn",
|
|
3789
3978
|
"baseline",
|
|
3979
|
+
"output",
|
|
3790
3980
|
"options"
|
|
3791
3981
|
];
|
|
3792
3982
|
const COMMON_FIELDS = [
|
|
@@ -3831,6 +4021,19 @@ const LIST_FIELDS = [
|
|
|
3831
4021
|
"min",
|
|
3832
4022
|
"max"
|
|
3833
4023
|
];
|
|
4024
|
+
const ROW_FIELDS = [
|
|
4025
|
+
"property",
|
|
4026
|
+
"class",
|
|
4027
|
+
"evidence"
|
|
4028
|
+
];
|
|
4029
|
+
const EVIDENCE_FIELDS = [
|
|
4030
|
+
"inputs",
|
|
4031
|
+
"fractionalInputs",
|
|
4032
|
+
"nearWholeInputs",
|
|
4033
|
+
"source",
|
|
4034
|
+
"optionSet",
|
|
4035
|
+
"catalogVersion"
|
|
4036
|
+
];
|
|
3834
4037
|
/** The fields of a declaration, in the order of the file. */
|
|
3835
4038
|
const OPTION_ORDER = [
|
|
3836
4039
|
"type",
|
|
@@ -4084,8 +4287,61 @@ function checkLimits(at, limits, faults) {
|
|
|
4084
4287
|
if (isFiniteNumber(raw["min"]) && isFiniteNumber(raw["max"]) && raw["min"] > raw["max"]) faults.push(`${place}: "min" is more than "max".`);
|
|
4085
4288
|
}
|
|
4086
4289
|
}
|
|
4290
|
+
/** This function adds the faults of the evidence of one output row. */
|
|
4291
|
+
function checkEvidence(at, property, rowClass, raw, faults) {
|
|
4292
|
+
if (!isFields(raw)) {
|
|
4293
|
+
faults.push(`${at}: "evidence" is not an object.`);
|
|
4294
|
+
return;
|
|
4295
|
+
}
|
|
4296
|
+
refuseUnknown(`${at}: the evidence`, raw, EVIDENCE_FIELDS, faults);
|
|
4297
|
+
for (const f of [
|
|
4298
|
+
"source",
|
|
4299
|
+
"optionSet",
|
|
4300
|
+
"catalogVersion"
|
|
4301
|
+
]) if (!isText(raw[f])) faults.push(`${at}: the evidence field "${f}" is not a text.`);
|
|
4302
|
+
const count = (v) => Number.isInteger(v) && v >= 0;
|
|
4303
|
+
if (!count(raw["inputs"])) faults.push(`${at}: the evidence field "inputs" is not a count.`);
|
|
4304
|
+
const grid = OUTPUT_GRID_PROPERTIES.includes(property);
|
|
4305
|
+
for (const f of ["fractionalInputs", "nearWholeInputs"]) if (grid ? !count(raw[f]) : raw[f] !== void 0 && !count(raw[f])) faults.push(`${at}: the evidence field "${f}" is not a count.`);
|
|
4306
|
+
const [inputs, fractionalInputs, nearWholeInputs] = [
|
|
4307
|
+
raw["inputs"],
|
|
4308
|
+
raw["fractionalInputs"],
|
|
4309
|
+
raw["nearWholeInputs"]
|
|
4310
|
+
];
|
|
4311
|
+
if (!grid || !count(inputs) || !count(fractionalInputs) || !count(nearWholeInputs)) return;
|
|
4312
|
+
if (fractionalInputs + nearWholeInputs > inputs) faults.push(`${at}: the fractional and near-whole counts are more than the inputs.`);
|
|
4313
|
+
const expected = outputGridClass({
|
|
4314
|
+
inputs,
|
|
4315
|
+
fractionalInputs,
|
|
4316
|
+
nearWholeInputs
|
|
4317
|
+
});
|
|
4318
|
+
if (rowClass !== expected) faults.push(`${at}: the evidence gives the class "${expected}".`);
|
|
4319
|
+
}
|
|
4320
|
+
/** This function adds the faults of the field `output` of one entry. */
|
|
4321
|
+
function checkOutput(at, raw, schema, faults) {
|
|
4322
|
+
if (schema === STRATEGY_CATALOG_SCHEMAS[0]) faults.push(`${at}: the field "output" needs the schema ${STRATEGY_CATALOG_SCHEMA}.`);
|
|
4323
|
+
if (!Array.isArray(raw) || raw.length === 0) {
|
|
4324
|
+
faults.push(`${at}: "output" is not a list with rows.`);
|
|
4325
|
+
return;
|
|
4326
|
+
}
|
|
4327
|
+
const seen = /* @__PURE__ */ new Set();
|
|
4328
|
+
raw.forEach((row, i) => {
|
|
4329
|
+
const place = `${at}: the output row ${i}`;
|
|
4330
|
+
if (!isFields(row)) {
|
|
4331
|
+
faults.push(`${place} is not an object.`);
|
|
4332
|
+
return;
|
|
4333
|
+
}
|
|
4334
|
+
refuseUnknown(place, row, ROW_FIELDS, faults);
|
|
4335
|
+
for (const f of ["property", "class"]) if (!isText(row[f])) faults.push(`${place}: "${f}" is not a text.`);
|
|
4336
|
+
checkEvidence(place, row["property"], row["class"], row["evidence"], faults);
|
|
4337
|
+
const optionSet = isFields(row["evidence"]) ? row["evidence"]["optionSet"] : void 0;
|
|
4338
|
+
const name = JSON.stringify([row["property"], optionSet]);
|
|
4339
|
+
if (seen.has(name)) faults.push(`${place}: the property and the option set are not unique.`);
|
|
4340
|
+
seen.add(name);
|
|
4341
|
+
});
|
|
4342
|
+
}
|
|
4087
4343
|
/** This function restores one entry of a file. */
|
|
4088
|
-
function readEntry(at, raw, faults) {
|
|
4344
|
+
function readEntry(at, raw, schema, faults) {
|
|
4089
4345
|
if (!isFields(raw)) {
|
|
4090
4346
|
faults.push(`${at} is not an object.`);
|
|
4091
4347
|
return;
|
|
@@ -4106,6 +4362,7 @@ function readEntry(at, raw, faults) {
|
|
|
4106
4362
|
if (raw["baseline"] === true && raw["optIn"] !== true) faults.push(`${at}: a baseline has "optIn" true.`);
|
|
4107
4363
|
if (!isFields(raw["supports"]) || !Object.values(raw["supports"]).every(isTextList)) faults.push(`${at}: "supports" is not a record of text lists.`);
|
|
4108
4364
|
checkLimits(at, raw["limits"], faults);
|
|
4365
|
+
if (raw["output"] !== void 0) checkOutput(at, raw["output"], schema, faults);
|
|
4109
4366
|
if (isText(raw["id"]) && raw["key"] !== catalogKey(raw["id"], raw["step"])) faults.push(`${at}: the key does not follow from "step" and "id".`);
|
|
4110
4367
|
if (!isFields(raw["options"])) {
|
|
4111
4368
|
faults.push(`${at}: "options" is not an object.`);
|
|
@@ -4138,6 +4395,7 @@ function readEntry(at, raw, faults) {
|
|
|
4138
4395
|
...determinismNote === void 0 ? {} : { determinismNote },
|
|
4139
4396
|
optIn: raw["optIn"],
|
|
4140
4397
|
...raw["baseline"] === true ? { baseline: true } : {},
|
|
4398
|
+
...raw["output"] === void 0 ? {} : { output: raw["output"] },
|
|
4141
4399
|
options
|
|
4142
4400
|
};
|
|
4143
4401
|
}
|
|
@@ -4193,7 +4451,7 @@ function checkReferences(entries, faults) {
|
|
|
4193
4451
|
}
|
|
4194
4452
|
}
|
|
4195
4453
|
/**
|
|
4196
|
-
* This function reads a catalog from parsed JSON
|
|
4454
|
+
* This function reads a catalog from parsed JSON, in each schema of `STRATEGY_CATALOG_SCHEMAS`. It refuses each unknown field and each other schema.
|
|
4197
4455
|
* It gives the catalog with its `Infinity` values restored, or the list of all faults.
|
|
4198
4456
|
*/
|
|
4199
4457
|
function parseStrategyCatalog(value) {
|
|
@@ -4203,7 +4461,8 @@ function parseStrategyCatalog(value) {
|
|
|
4203
4461
|
faults: ["The catalog is not an object."]
|
|
4204
4462
|
};
|
|
4205
4463
|
refuseUnknown("The catalog", value, TOP_FIELDS, faults);
|
|
4206
|
-
|
|
4464
|
+
const schema = value["schema"];
|
|
4465
|
+
if (!STRATEGY_CATALOG_SCHEMAS.includes(schema)) faults.push(`The schema is not one of ${STRATEGY_CATALOG_SCHEMAS.join(", ")}.`);
|
|
4207
4466
|
if (!isText(value["engine"])) faults.push(`"engine" is not a text.`);
|
|
4208
4467
|
if (!isText(value["version"])) faults.push(`"version" is not a text.`);
|
|
4209
4468
|
if (!Array.isArray(value["strategies"])) return {
|
|
@@ -4212,7 +4471,7 @@ function parseStrategyCatalog(value) {
|
|
|
4212
4471
|
};
|
|
4213
4472
|
const entries = [];
|
|
4214
4473
|
value["strategies"].forEach((raw, i) => {
|
|
4215
|
-
const entry = readEntry(`The strategy ${isFields(raw) && isText(raw["key"]) ? raw["key"] : i}`, raw, faults);
|
|
4474
|
+
const entry = readEntry(`The strategy ${isFields(raw) && isText(raw["key"]) ? raw["key"] : i}`, raw, schema, faults);
|
|
4216
4475
|
if (entry !== void 0) entries.push(entry);
|
|
4217
4476
|
});
|
|
4218
4477
|
for (let i = 1; i < entries.length; i++) {
|
|
@@ -4228,7 +4487,7 @@ function parseStrategyCatalog(value) {
|
|
|
4228
4487
|
return {
|
|
4229
4488
|
ok: true,
|
|
4230
4489
|
catalog: {
|
|
4231
|
-
schema
|
|
4490
|
+
schema,
|
|
4232
4491
|
engine: value["engine"],
|
|
4233
4492
|
version: value["version"],
|
|
4234
4493
|
strategies: entries
|
|
@@ -4274,6 +4533,22 @@ function writeOption(option) {
|
|
|
4274
4533
|
}
|
|
4275
4534
|
return out;
|
|
4276
4535
|
}
|
|
4536
|
+
/** This function gives the file form of one output row, with the fields in the order of the file. */
|
|
4537
|
+
function writeRow(row) {
|
|
4538
|
+
const e = row.evidence;
|
|
4539
|
+
return {
|
|
4540
|
+
property: row.property,
|
|
4541
|
+
class: row.class,
|
|
4542
|
+
evidence: {
|
|
4543
|
+
inputs: e.inputs,
|
|
4544
|
+
...e.fractionalInputs === void 0 ? {} : { fractionalInputs: e.fractionalInputs },
|
|
4545
|
+
...e.nearWholeInputs === void 0 ? {} : { nearWholeInputs: e.nearWholeInputs },
|
|
4546
|
+
source: e.source,
|
|
4547
|
+
optionSet: e.optionSet,
|
|
4548
|
+
catalogVersion: e.catalogVersion
|
|
4549
|
+
}
|
|
4550
|
+
};
|
|
4551
|
+
}
|
|
4277
4552
|
/** This function gives the file form of an entry, with its fields in the order of the file. */
|
|
4278
4553
|
function writeEntry(e) {
|
|
4279
4554
|
const options = Object.fromEntries(Object.entries(e.options).map(([key, o]) => [key, writeOption(o)]));
|
|
@@ -4290,6 +4565,7 @@ function writeEntry(e) {
|
|
|
4290
4565
|
...e.determinismNote === void 0 ? {} : { determinismNote: e.determinismNote },
|
|
4291
4566
|
optIn: e.optIn,
|
|
4292
4567
|
...e.baseline === true ? { baseline: true } : {},
|
|
4568
|
+
...e.output === void 0 ? {} : { output: e.output.map(writeRow) },
|
|
4293
4569
|
options
|
|
4294
4570
|
};
|
|
4295
4571
|
}
|
|
@@ -4303,12 +4579,13 @@ function unsafeValues(v, at) {
|
|
|
4303
4579
|
}
|
|
4304
4580
|
/**
|
|
4305
4581
|
* This function gives the text of the catalog file, sorted by key. The same source and version give the same bytes.
|
|
4582
|
+
* The file has the oldest schema that holds it, so a catalog with no `output` stays valid for a reader of the schema 1.
|
|
4306
4583
|
* The caller gives the version from `package.json`. The function throws an error if the file breaks a rule of the format.
|
|
4307
4584
|
*/
|
|
4308
4585
|
function writeStrategyCatalog(source, version) {
|
|
4309
4586
|
const strategies = [...source.strategies].sort((a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0).map(writeEntry);
|
|
4310
4587
|
const doc = {
|
|
4311
|
-
schema: STRATEGY_CATALOG_SCHEMA,
|
|
4588
|
+
schema: source.strategies.some((e) => e.output !== void 0) ? STRATEGY_CATALOG_SCHEMA : STRATEGY_CATALOG_SCHEMAS[0],
|
|
4312
4589
|
engine: source.engine,
|
|
4313
4590
|
version,
|
|
4314
4591
|
strategies
|
|
@@ -5565,6 +5842,6 @@ const RECT_SCATTERED = /* @__PURE__ */ Object.freeze({
|
|
|
5565
5842
|
};
|
|
5566
5843
|
}
|
|
5567
5844
|
});
|
|
5568
|
-
export { BALANCE_MEASURE_SUFFIXES, BALANCE_SIDE_DEPTH, CORPUS_DIMENSIONS, DEFAULT_FAMILY_BY, DEFAULT_RNG, DEFAULT_SHAPES, DEFAULT_TOLERANCE, EDGES_STEP, EDGE_DENSITY, EDGE_KEY_STEP, EDGE_KEY_STEP_VERSION, EDGE_STEP_VERSION, EPS, FAMILY_ANY_KIND, INVALIDATED_FIELD, JOINT_MEASURES, JOINT_MOVED_MIN, NODE_POSITIONS_DIMENSION, PACK_HARD_RULES, RECORD_EPS, RECORD_SCALE, RECT_SCATTERED, SHAPE_KINDS, SHAPE_KIND_IDS, SIDES, SPLIT_SCHEMA, STRATEGY_CATALOG_SCHEMA, STRATEGY_SPACE_SCHEMA, VERDICT_DRAWS, VERDICT_EXACT_CAP, VERDICT_EXACT_MAX, VERDICT_RUNS, VERDICT_SEED, applyPack, balanceMeasureSpecs, balanceMeasures, balanceOf, boundsOf, boxArea, canonicalConfig, canonicalInput, canonicalJson, catalogChoices, catalogDefaults, catalogKey, catalogOptions, checkCatalog, checkConfig, checkDeclared, checkInput, checkLayoutRecord, checkOptions, checkSchema, checkShapes, checkSpace, checkSplit, clampOptions, compareMeasure, composeFamily, configId, corpusHashOf, countObstacleHits, countOutside, countOverlaps, countPortsOffBorder, createFamilyRegistry, declarationIssues, declaredClaimOf, declaredCounts, decodeOptionValue, dimensionAt, dimensionSupports, dimensionUnit, documentHash, edgeKeyStep, edgeStep, encodeOptionValue, enumerateSpace, exercised, familyKind, familyOf, fnv1a32, grow, isShapeKind, itemShapeOf, joinConfigs, leaveOneSeedOut, levelsOf, listOptions, marginSides, minEffectOf, mulberry32, nearestGaps, optionDefaults, optionIssue, outputGroups, outputHash, overlapOf, ownerDimension, packHard, packLinks, paramActive, paramLevels, paramProblem, paramValue, parseLayoutRecord, parseStrategyCatalog, perChange, pickMoves, placedRect, pointSegmentDistance, portPoint, portfolio, procrustesOf, productSpace, randomInt, rectInRegion, regionArea, regionHitsRect, resolveDimensions, ruleLevel, segmentsCross, selectBest, sha256Hex, shapeKindOf, shapeKindProblem, shapeKindsOf, shapeLevel, shapeSupportProblems, shapesOf, sharedDimension, spaceShapeKinds, spaceSize, splitConfig, splitFileName, splitFolds, stepRandom, sweepGrid, sweepOf, sweepValues, toLayoutRecord, toPackInput, toRect, toSizedRect, translate, turnBox, turnMargin, turnPoint, turnPort, turnRegion, turnSide, verdict, writeStrategyCatalog };
|
|
5845
|
+
export { BALANCE_MEASURE_SUFFIXES, BALANCE_SIDE_DEPTH, CORPUS_DIMENSIONS, DEFAULT_FAMILY_BY, DEFAULT_RNG, DEFAULT_SHAPES, DEFAULT_TOLERANCE, EDGES_STEP, EDGE_DENSITY, EDGE_KEY_STEP, EDGE_KEY_STEP_VERSION, EDGE_STEP_VERSION, EPS, FAMILY_ANY_KIND, HARD_RULE_VERSION, INVALIDATED_FIELD, JOINT_MEASURES, JOINT_MOVED_MIN, NODE_POSITIONS_DIMENSION, OUTPUT_CLASS_MIN_INPUTS, OUTPUT_GRID_PROPERTIES, OUTPUT_NEAR_WHOLE, PACK_HARD_RULES, RECORD_EPS, RECORD_SCALE, RECT_SCATTERED, SHAPE_KINDS, SHAPE_KIND_IDS, SIDES, SPLIT_SCHEMA, STRATEGY_CATALOG_SCHEMA, STRATEGY_CATALOG_SCHEMAS, STRATEGY_SPACE_SCHEMA, VERDICT_DRAWS, VERDICT_EXACT_CAP, VERDICT_EXACT_MAX, VERDICT_RUNS, VERDICT_SEED, applyPack, balanceMeasureSpecs, balanceMeasures, balanceOf, boundsOf, boxArea, canonicalConfig, canonicalInput, canonicalJson, catalogChoices, catalogDefaults, catalogKey, catalogOptions, checkCatalog, checkConfig, checkDeclared, checkInput, checkLayoutRecord, checkOptions, checkSchema, checkShapes, checkSpace, checkSplit, circleOverlaps, circlesOutside, clampOptions, compareMeasure, composeFamily, configId, corpusHashOf, countObstacleHits, countOutside, countOverlaps, countPortsOffBorder, createFamilyRegistry, declarationIssues, declaredClaimOf, declaredCounts, decodeOptionValue, dimensionAt, dimensionSupports, dimensionUnit, documentHash, edgeKeyStep, edgeStep, encodeOptionValue, enumerateSpace, exercised, familyKind, familyOf, fnv1a32, grow, hardRuleOf, inputShapeLevel, isShapeKind, itemShapeOf, joinConfigs, leaveOneSeedOut, levelsOf, listOptions, marginSides, minEffectOf, mulberry32, nearestGaps, optionDefaults, optionIssue, outputGridClass, outputGroups, outputHash, overlapOf, ownerDimension, packHard, packLinks, paramActive, paramLevels, paramProblem, paramValue, parseLayoutRecord, parseStrategyCatalog, perChange, pickMoves, placedCircle, placedRect, pointSegmentDistance, portPoint, portfolio, procrustesOf, productSpace, randomInt, rectInRegion, regionArea, regionHitsRect, resolveDimensions, ruleLevel, segmentsCross, selectBest, sha256Hex, shapeKindOf, shapeKindProblem, shapeKindsOf, shapeLevel, shapeSupportProblems, shapesOf, shapesOverlap, sharedDimension, spaceShapeKinds, spaceSize, splitConfig, splitFileName, splitFolds, stepRandom, sweepGrid, sweepOf, sweepValues, toLayoutRecord, toPackInput, toRect, toSizedRect, translate, turnBox, turnMargin, turnPoint, turnPort, turnRegion, turnSide, verdict, writeStrategyCatalog };
|
|
5569
5846
|
|
|
5570
5847
|
//# sourceMappingURL=index.js.map
|