@mark1russell7/layout-contract 0.9.7 → 0.9.8
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/build/index.d.ts +3 -3
- package/build/index.d.ts.map +1 -1
- package/build/index.js +59 -17
- package/build/index.js.map +1 -1
- package/build/{measures-Aan-rHz1.d.ts → measures-CJZw-Y3H.d.ts} +14 -2
- package/build/measures-CJZw-Y3H.d.ts.map +1 -0
- package/build/text.d.ts +1 -1
- package/package.json +2 -2
- package/src/families.ts +3 -16
- package/src/geometry.ts +51 -0
- package/src/strategy-space.ts +2 -0
- package/build/measures-Aan-rHz1.d.ts.map +0 -1
package/build/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as CorpusEntry, A as shapeKindsOf, At as
|
|
2
|
-
import { AnyOption, BooleanOption, DeclaredStrategy, EnumOption, EnumerateOptions, EnumerateOptions as EnumerateOptions$1, GridOptions, KindOptions, KindOptions as KindOptions$1, ListItem, MemberRule, NoDefault, NoDefaultReason, NumberOption, OptionDeclaration, OptionIssue, OptionRef, OptionScale, OptionSchema, OptionSetting, OptionSupports, ParamKind, ParamValue, ParamWhen, STRATEGY_SPACE_SCHEMA, SampleOptions, ShapeFilter, SpaceConstraint, SpaceParam, SpaceSize, SpaceSize as SpaceSize$1, SpaceSizeOptions, SpaceSizeOptions as SpaceSizeOptions$1, SpaceStage, StageChoice, StageOption, StrategyConfig, StrategyConfig as StrategyConfig$1, StrategySpace, StrategySpace as StrategySpace$1, SweepOptions, ValueOption, canonicalConfig, checkConfig, checkOptions, checkSchema, clampOptions, configId, declarationIssues, joinConfigs, listOptions, optionDefaults, optionIssue, paramActive, paramLevels, paramProblem, paramValue, productSpace, splitConfig, sweepGrid, sweepOf, sweepValues } from "@mark1russell7/strategy-space";
|
|
1
|
+
import { $ as CorpusEntry, A as shapeKindsOf, At as crossingPoint, B as LayoutInput, Bt as scaleRect, C as checkShapes, Ct as SIDES, D as ruleLevel, Dt as boundsOf, E as itemShapeOf, Et as SizedRect, F as LayoutBox, Ft as pointInRing, G as PairGap, Gt as translate, H as PackInput, Ht as snapRect, I as LayoutCell, It as pointInRings, J as canonicalInput, K as Port, L as LayoutContainer, Lt as pointSegmentDistance, M as shapeSupportProblems, Mt as grow, N as shapesOf, Nt as marginSides, O as shapeKindOf, Ot as boxCenterDistance, P as Item, Pt as overlapOf, Q as ClaimBreak, R as LayoutEdge, Rt as regionArea, S as boxArea, St as Ring, T as isShapeKind, Tt as Sides, U as PackInputOptions, Ut as toRect, V as Obstacle, Vt as segmentsCross, W as PackLink, Wt as toSizedRect, X as portPoint, Y as packLinks, Z as toPackInput, _ as ShapeKind, _t as splitFolds, a as MeasureSpec, at as FamilyCell, b as ShapeLimit, bt as Rect, c as minEffectOf, ct as SplitFold, d as SHAPE_KINDS, dt as corpusHashOf, et as CorpusSplit, f as SHAPE_KIND_IDS, ft as declaredClaimOf, g as ShapeInput, gt as splitFileName, h as ShapeGeometry, ht as leaveOneSeedOut, i as JointMeasureId, it as FamilyBy, j as shapeLevel, jt as dropIndex, k as shapeKindProblem, kt as clipRing, l as DEFAULT_SHAPES, lt as checkDeclared, m as ShapeCheck, mt as familyOf, n as JOINT_MEASURES, nt as Declares, o as Verdict, ot as SPLIT_SCHEMA, p as ShapeBound, pt as declaredCounts, q as Resize, r as JOINT_MOVED_MIN, rt as FAMILY_ANY_KIND, s as compareMeasure, st as SplitCorpus, t as Direction, tt as DeclaredClaim, u as RuleLevel, ut as checkSplit, v as ShapeKindSpec, vt as Margin, w as inputShapeLevel, wt as Side, x as ShapeSupport, xt as Region, y as ShapeLevel, yt as Point, z as LayoutGenerator, zt as ringCentroid } from "./measures-CJZw-Y3H.js";
|
|
2
|
+
import { AnyOption, BooleanOption, DeclaredStrategy, EnumOption, EnumerateOptions, EnumerateOptions as EnumerateOptions$1, GridOptions, KindOptions, KindOptions as KindOptions$1, ListItem, MemberRule, NoDefault, NoDefaultReason, NumberOption, OptionDeclaration, OptionIssue, OptionRef, OptionScale, OptionSchema, OptionSetting, OptionSupports, ParamKind, ParamValue, ParamWhen, STRATEGY_SPACE_SCHEMA, SampleOptions, ShapeFilter, SpaceConstraint, SpaceParam, SpaceSize, SpaceSize as SpaceSize$1, SpaceSizeOptions, SpaceSizeOptions as SpaceSizeOptions$1, SpaceStage, StageChoice, StageOption, StrategyConfig, StrategyConfig as StrategyConfig$1, StrategySpace, StrategySpace as StrategySpace$1, SweepOptions, ValueOption, canonicalConfig, checkConfig, checkOptions, checkSchema, clampOptions, configId, declarationIssues, joinConfigs, listOptions, optionDefaults, optionIssue, paramActive, paramAt, paramLevels, paramProblem, paramUnit, paramValue, productSpace, splitConfig, sweepGrid, sweepOf, sweepValues } from "@mark1russell7/strategy-space";
|
|
3
3
|
/** The epsilon for the float compares in an engine. */
|
|
4
4
|
export declare const EPS = 1e-6;
|
|
5
5
|
/** The count of `EPS` steps in one layout unit. It is the integer equal to `1 / EPS`. */
|
|
@@ -1561,5 +1561,5 @@ export declare const CIRCLE_SCATTERED: CorpusFamily<LayoutInput>;
|
|
|
1561
1561
|
* The steps `container`, `obstacles` and `boxes` each have a stream of `stepRandom`. Each value is a whole number, so the family is `exact`.
|
|
1562
1562
|
*/
|
|
1563
1563
|
export declare const RECT_SCATTERED: CorpusFamily<LayoutInput>;
|
|
1564
|
-
export { type AnyOption, type BooleanOption, ClaimBreak, CorpusEntry, CorpusSplit, DEFAULT_SHAPES, DeclaredClaim, type DeclaredStrategy, Declares, Direction, type EnumOption, type EnumerateOptions, FAMILY_ANY_KIND, FamilyBy, FamilyCell, type GridOptions, Item, JOINT_MEASURES, JOINT_MOVED_MIN, JointMeasureId, type KindOptions, LayoutBox, LayoutCell, LayoutContainer, LayoutEdge, LayoutGenerator, LayoutInput, type ListItem, Margin, MeasureSpec, type MemberRule, type NoDefault, type NoDefaultReason, type NumberOption, Obstacle, type OptionDeclaration, type OptionIssue, type OptionRef, type OptionScale, type OptionSchema, type OptionSetting, type OptionSupports, PackInput, PackInputOptions, PackLink, PairGap, type ParamKind, type ParamValue, type ParamWhen, Point, Port, Rect, Region, Resize, Ring, RuleLevel, SHAPE_KINDS, SHAPE_KIND_IDS, SIDES, SPLIT_SCHEMA, STRATEGY_SPACE_SCHEMA, type SampleOptions, ShapeBound, ShapeCheck, type ShapeFilter, ShapeGeometry, ShapeInput, ShapeKind, ShapeKindSpec, ShapeLevel, ShapeLimit, ShapeSupport, Side, Sides, SizedRect, type SpaceConstraint, type SpaceParam, type SpaceSize, type SpaceSizeOptions, type SpaceStage, SplitCorpus, SplitFold, type StageChoice, type StageOption, type StrategyConfig, type StrategySpace, type SweepOptions, type ValueOption, Verdict, boundsOf, boxArea, boxCenterDistance, canonicalConfig, canonicalInput, checkConfig, checkDeclared, checkOptions, checkSchema, checkShapes, checkSplit, clampOptions, compareMeasure, configId, corpusHashOf, crossingPoint, declarationIssues, declaredClaimOf, declaredCounts, dropIndex, familyOf, grow, inputShapeLevel, isShapeKind, itemShapeOf, joinConfigs, leaveOneSeedOut, listOptions, marginSides, minEffectOf, optionDefaults, optionIssue, overlapOf, packLinks, paramActive, paramLevels, paramProblem, paramValue, pointInRing, pointInRings, pointSegmentDistance, portPoint, productSpace, regionArea, ruleLevel, scaleRect, segmentsCross, shapeKindOf, shapeKindProblem, shapeKindsOf, shapeLevel, shapeSupportProblems, shapesOf, snapRect, splitConfig, splitFileName, splitFolds, sweepGrid, sweepOf, sweepValues, toPackInput, toRect, toSizedRect, translate };
|
|
1564
|
+
export { type AnyOption, type BooleanOption, ClaimBreak, CorpusEntry, CorpusSplit, DEFAULT_SHAPES, DeclaredClaim, type DeclaredStrategy, Declares, Direction, type EnumOption, type EnumerateOptions, FAMILY_ANY_KIND, FamilyBy, FamilyCell, type GridOptions, Item, JOINT_MEASURES, JOINT_MOVED_MIN, JointMeasureId, type KindOptions, LayoutBox, LayoutCell, LayoutContainer, LayoutEdge, LayoutGenerator, LayoutInput, type ListItem, Margin, MeasureSpec, type MemberRule, type NoDefault, type NoDefaultReason, type NumberOption, Obstacle, type OptionDeclaration, type OptionIssue, type OptionRef, type OptionScale, type OptionSchema, type OptionSetting, type OptionSupports, PackInput, PackInputOptions, PackLink, PairGap, type ParamKind, type ParamValue, type ParamWhen, Point, Port, Rect, Region, Resize, Ring, RuleLevel, SHAPE_KINDS, SHAPE_KIND_IDS, SIDES, SPLIT_SCHEMA, STRATEGY_SPACE_SCHEMA, type SampleOptions, ShapeBound, ShapeCheck, type ShapeFilter, ShapeGeometry, ShapeInput, ShapeKind, ShapeKindSpec, ShapeLevel, ShapeLimit, ShapeSupport, Side, Sides, SizedRect, type SpaceConstraint, type SpaceParam, type SpaceSize, type SpaceSizeOptions, type SpaceStage, SplitCorpus, SplitFold, type StageChoice, type StageOption, type StrategyConfig, type StrategySpace, type SweepOptions, type ValueOption, Verdict, boundsOf, boxArea, boxCenterDistance, canonicalConfig, canonicalInput, checkConfig, checkDeclared, checkOptions, checkSchema, checkShapes, checkSplit, clampOptions, clipRing, compareMeasure, configId, corpusHashOf, crossingPoint, declarationIssues, declaredClaimOf, declaredCounts, dropIndex, familyOf, grow, inputShapeLevel, isShapeKind, itemShapeOf, joinConfigs, leaveOneSeedOut, listOptions, marginSides, minEffectOf, optionDefaults, optionIssue, overlapOf, packLinks, paramActive, paramAt, paramLevels, paramProblem, paramUnit, paramValue, pointInRing, pointInRings, pointSegmentDistance, portPoint, productSpace, regionArea, ringCentroid, ruleLevel, scaleRect, segmentsCross, shapeKindOf, shapeKindProblem, shapeKindsOf, shapeLevel, shapeSupportProblems, shapesOf, snapRect, splitConfig, splitFileName, splitFolds, sweepGrid, sweepOf, sweepValues, toPackInput, toRect, toSizedRect, translate };
|
|
1565
1565
|
//# sourceMappingURL=index.d.ts.map
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":["StrategySpace","KindOptions","SpaceSizeOptions","SpaceSize","EnumerateOptions","StrategyConfig"],"sources":["../src/tolerance.ts","../src/output.ts","../src/record.ts","../src/rules.ts","../src/turn.ts","../src/resize.ts","../src/balance.ts","../src/frame.ts","../src/strategy.ts","../src/random.ts","../src/edges.ts","../src/hash.ts","../src/portfolio.ts","../src/corpus-manifest.ts","../src/strategy-space.ts","../src/strategy-catalog.ts","../src/verdict.ts","../src/families.ts"],"mappings":";;;qBACa;;qBAGA;;;;;qBAMA;;;;;qBAMA;;;;;iBAMI;;WAEN;;WAEA;;;;;;qBAOE,mBAAmB;;;;;iBCxBf;WACN;WACA;WACA;WACA;WACA;WACA;;;iBAIM;WACN;WACA;WACA,WAAW,SAAS;;;iBAId;WACN,qBAAqB;;WAErB;;WAEA;aAAiB;aAAoB;;;WAErC;aAA2B;aAAqB;aAAoB;;WACpE,iBAAiB;;;;;;;;;wBAUZ,UAAU,OAAO,aAAa,QAAQ,aAAa;;YCvCvD;;iBAGK;WACN;WACA,OAAO;WACP;WACA;;WAEA,SAAS,SAAS;WAClB;;WAEA;;WAEA;WACA;WACA;WACA;WACA;;WAEA,kBAAkB;;WAElB,UAAU,SAAS;;WAEnB,MAAM,SAAS;;WAEf,YAAY,SAAS,QAAQ;;WAE7B;;;;;;;WAOA;;WAEA;;WAEA;;WAEA;;;;;;WAMA;;WAEA;;WAEA;;WAEA;;;;;WAKA;;WAEA,MAAM;;WAEN;WACA;;;;;;WAMA,UAAU;;;;;;iBAOJ;;WAEN,MAAM,SAAS;;WAEf,IAAI,SAAS;;WAEb,cAAc,SAAS;;WAEvB;;WAEA,OAAO;;;;;;iBAOD;;WAEN;;WAEA;;WAEA;;WAEA;;;;;;YAOC,WAAW,SAAS;;iBAGf;WACN;WACA;WACA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;;YAIC,WAAW,KAAK;;;;;wBAMZ,eAAe,OAAO,aAAa,KAAK,WAAW;;;;;wBAmFnD,WAAW,QAAQ,KAAK;;;;;;wBASxB,kBAAkB;;;;;;wBAuClB,kBAAkB,iBAAiB;;iBAQlC;;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A,QAAQ,SAAS;;;iBAIX;WACN;WACA,MAAM;;;iBAIA;WACN;;WAEA;;;;;;;;;;;;;;;wBAgBK,WAAW,qBAAqB,mBAAmB,iBAAiB,gBAAgB;;wBAsBpF,UAAU,OAAO,KAAK;EAA8B;;;;;;;;;;;;;;wBAwCpD,UAAU,GAAG,GAC3B,YACA,kBAAkB,OAAO,GAAG,SAAS,OAAO,eAAe,OAAO,GAAG,OACrE,KAAK,aAAa,GAAG,IACrB,UAAS,mBACR,UAAU,GAAG;;qBCnMH;;YAGD;;iBAGK;WACN,WAAW;;;;;;iBAOL,eAAe,gBAAgB,wBAAwB,gBAAgB;WAC7E,eAAe;WACf;WACA,UAAU;WACV,SAAS;WACT,gBAAgB;WAChB,kBAAkB;;;;;;YAOjB;;wBAGI,SAAS,gBAAgB,QAAO;;iBAQ/B;WACN;;WAEA;WACA;;WAEA,QAAQ;;;iBAIF;;WAEN,QAAQ;;WAER;;;wBAIK,aAAa,iBAAiB,iBAAiB,UAAS;;;;;;wBAqBxD,mBAAmB,MAAM,uBAAuB,OAAO,UAAU,eAAe,MAAM,QAAQ,QAAQ,UAAS;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["StrategySpace","KindOptions","SpaceSizeOptions","SpaceSize","EnumerateOptions","StrategyConfig"],"sources":["../src/tolerance.ts","../src/output.ts","../src/record.ts","../src/rules.ts","../src/turn.ts","../src/resize.ts","../src/balance.ts","../src/frame.ts","../src/strategy.ts","../src/random.ts","../src/edges.ts","../src/hash.ts","../src/portfolio.ts","../src/corpus-manifest.ts","../src/strategy-space.ts","../src/strategy-catalog.ts","../src/verdict.ts","../src/families.ts"],"mappings":";;;qBACa;;qBAGA;;;;;qBAMA;;;;;qBAMA;;;;;iBAMI;;WAEN;;WAEA;;;;;;qBAOE,mBAAmB;;;;;iBCxBf;WACN;WACA;WACA;WACA;WACA;WACA;;;iBAIM;WACN;WACA;WACA,WAAW,SAAS;;;iBAId;WACN,qBAAqB;;WAErB;;WAEA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;;YAUzE,qBAAqB,KAAK;;;;;;wBAOtB,eAAe,cAAc,MAAM,qBAAqB;;;;;wBA+BxD,kBAAkB,KAAK,iBAAiB;;;;;wBA+FxC,YAAY,KAAK,YAAY;;wBAM7B,cAAc,KAAK,YAAY;;;;;;wBAgB/B,SAAS,KAAK,iBAAiB,iBAAiB;;;;;;;;wBAsChD,kBACd,qBAAqB,mBACrB,OAAM,SAAS,eAAe,cAC9B,gBACA,cACC;;wBA8Ha,qBAAqB,IAAI,aAAa,WAAU,SAAS,aAAa,MAAW,eAAe;;iBA2G/F;WACN;WACA;;WAEA;WACA;;WAEA,qBAAqB;;WAErB;WACA,aAAa;;WAEb,cAAc,MAAM;;EAE7B,MAAM,OAAO,aAAa,cAAc,MAAM,kBAAkB;;;iBAIjD;;WAEN;;WAEA;WACA;;WAEA,QAAQ,OAAO;;;;;;;wBAWV,cAAc,MAAM,aAAa,cAAc,gBAAgB,cAAc,UAAS,iBAAsB,aAAa;;;;;qBA+D5H,YAAY;;;;qBA0BZ,eAAe;;;;;;;;;qBAuBf,kBAAkB,aAAa;;;;;;qBAqD/B,gBAAgB,aAAa"}
|
package/build/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { orient2dSign } from "@mark1russell7/predicates";
|
|
2
2
|
import { canonicalJson as canonicalJson$1, deriveSeed, fnv1a32 as fnv1a32$1, mulberry32 as mulberry32$1, sha256Hex as sha256Hex$1 } from "@mark1russell7/rigor-generators";
|
|
3
|
-
import { STRATEGY_SPACE_SCHEMA, canonicalConfig, checkConfig, checkOptions, checkSchema, checkSpace as checkSpace$1, clampOptions, configId, declarationIssues, enumerateSpace as enumerateSpace$1, joinConfigs, listOptions, optionDefaults, optionIssue, paramActive, paramLevels, paramProblem, paramValue, productSpace, spaceShapeKinds as spaceShapeKinds$1, spaceSize as spaceSize$1, splitConfig, sweepGrid, sweepOf, sweepValues } from "@mark1russell7/strategy-space";
|
|
3
|
+
import { STRATEGY_SPACE_SCHEMA, canonicalConfig, checkConfig, checkOptions, checkSchema, checkSpace as checkSpace$1, clampOptions, configId, declarationIssues, enumerateSpace as enumerateSpace$1, joinConfigs, listOptions, optionDefaults, optionIssue, paramActive, paramAt, paramLevels, paramProblem, paramUnit, paramValue, productSpace, spaceShapeKinds as spaceShapeKinds$1, spaceSize as spaceSize$1, splitConfig, sweepGrid, sweepOf, sweepValues } from "@mark1russell7/strategy-space";
|
|
4
4
|
import { bootstrap, bootstrapStrata, signFlipTest, signTest } from "@mark1russell7/rigor-statistics";
|
|
5
5
|
// src/geometry.ts
|
|
6
6
|
/** The sides in clockwise order, from the top. */
|
|
@@ -245,6 +245,61 @@ function pointInRings(x, y, rings) {
|
|
|
245
245
|
}
|
|
246
246
|
return inside;
|
|
247
247
|
}
|
|
248
|
+
/**
|
|
249
|
+
* This function gives the centroid of the area of a ring, by the shoelace formula. The order of the corners can be
|
|
250
|
+
* clockwise or counterclockwise. A ring with the area 0 gives the mean of its corners. An empty ring is a `RangeError`.
|
|
251
|
+
* The sums use the corners relative to the first corner. Thus a small ring far from the origin keeps its digits.
|
|
252
|
+
*/
|
|
253
|
+
function ringCentroid(ring) {
|
|
254
|
+
if (ring.length === 0) throw new RangeError("ringCentroid needs a ring with at least one corner.");
|
|
255
|
+
const [ox, oy] = ring[0];
|
|
256
|
+
let twice = 0;
|
|
257
|
+
let sx = 0;
|
|
258
|
+
let sy = 0;
|
|
259
|
+
for (let i = 0; i < ring.length; i++) {
|
|
260
|
+
const a = ring[i];
|
|
261
|
+
const b = ring[(i + 1) % ring.length];
|
|
262
|
+
const ax = a[0] - ox;
|
|
263
|
+
const ay = a[1] - oy;
|
|
264
|
+
const bx = b[0] - ox;
|
|
265
|
+
const by = b[1] - oy;
|
|
266
|
+
const cross = ax * by - bx * ay;
|
|
267
|
+
twice += cross;
|
|
268
|
+
sx += (ax + bx) * cross;
|
|
269
|
+
sy += (ay + by) * cross;
|
|
270
|
+
}
|
|
271
|
+
if (twice === 0) {
|
|
272
|
+
const mean = (k) => ring.reduce((sum, corner) => sum + (corner[k] - ring[0][k]), 0) / ring.length;
|
|
273
|
+
return {
|
|
274
|
+
x: ox + mean(0),
|
|
275
|
+
y: oy + mean(1)
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
return {
|
|
279
|
+
x: ox + sx / (3 * twice),
|
|
280
|
+
y: oy + sy / (3 * twice)
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* This function gives the part of a ring in the half-plane `a * x + b * y <= c`, by the steps of Sutherland and Hodgman.
|
|
285
|
+
* The corners keep their order. A new corner goes where a side crosses the line. A ring with no part in the half-plane
|
|
286
|
+
* gives an empty ring. The part of a convex ring is convex. The part of a concave ring can have sides of length 0 on the line.
|
|
287
|
+
*/
|
|
288
|
+
function clipRing(ring, a, b, c) {
|
|
289
|
+
const out = [];
|
|
290
|
+
for (let i = 0; i < ring.length; i++) {
|
|
291
|
+
const p = ring[i];
|
|
292
|
+
const q = ring[(i + 1) % ring.length];
|
|
293
|
+
const fp = a * p[0] + b * p[1] - c;
|
|
294
|
+
const fq = a * q[0] + b * q[1] - c;
|
|
295
|
+
if (fp <= 0) out.push(p);
|
|
296
|
+
if (fp < 0 && fq > 0 || fp > 0 && fq < 0) {
|
|
297
|
+
const t = fp / (fp - fq);
|
|
298
|
+
out.push([p[0] + t * (q[0] - p[0]), p[1] + t * (q[1] - p[1])]);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
return out;
|
|
302
|
+
}
|
|
248
303
|
/** This function gives the distance between the centers of two rectangles. */
|
|
249
304
|
function boxCenterDistance(a, b) {
|
|
250
305
|
return Math.hypot(b.x + b.w / 2 - (a.x + a.w / 2), b.y + b.h / 2 - (a.y + a.h / 2));
|
|
@@ -4745,25 +4800,12 @@ const fromZero = (d) => d.scale === "log" && (d.min ?? 0) <= 0;
|
|
|
4745
4800
|
* A log scale with a `min` of 0 or less is the log of `1 + x - min`. An `int` dimension gives a whole number.
|
|
4746
4801
|
*/
|
|
4747
4802
|
function dimensionAt(dim, t) {
|
|
4748
|
-
const
|
|
4749
|
-
const max = dim.max ?? min;
|
|
4750
|
-
const u = Math.min(1, Math.max(0, t));
|
|
4751
|
-
let v;
|
|
4752
|
-
if (dim.scale !== "log") v = min + u * (max - min);
|
|
4753
|
-
else if (fromZero(dim)) v = min + Math.expm1(u * Math.log1p(max - min));
|
|
4754
|
-
else v = Math.exp(Math.log(min) + u * (Math.log(max) - Math.log(min)));
|
|
4755
|
-
v = Math.min(max, Math.max(min, v));
|
|
4803
|
+
const v = paramAt(dim, t);
|
|
4756
4804
|
return dim.kind === "int" ? Math.round(v) : paramValue(dim, v);
|
|
4757
4805
|
}
|
|
4758
4806
|
/** This function gives the fraction of the range of a numeric dimension at a value, on its scale. It is the inverse of `dimensionAt`. */
|
|
4759
4807
|
function dimensionUnit(dim, value) {
|
|
4760
|
-
|
|
4761
|
-
const max = dim.max ?? min;
|
|
4762
|
-
if (max === min) return 0;
|
|
4763
|
-
const v = Math.min(max, Math.max(min, value));
|
|
4764
|
-
if (dim.scale !== "log") return (v - min) / (max - min);
|
|
4765
|
-
if (fromZero(dim)) return Math.log1p(v - min) / Math.log1p(max - min);
|
|
4766
|
-
return (Math.log(v) - Math.log(min)) / (Math.log(max) - Math.log(min));
|
|
4808
|
+
return paramUnit(dim, value);
|
|
4767
4809
|
}
|
|
4768
4810
|
/** This function gives the range of the supported values of a numeric dimension: its own `min` and `max` in place of the ends of `supported`. */
|
|
4769
4811
|
function supportedSpan(dim) {
|
|
@@ -5343,6 +5385,6 @@ const RECT_SCATTERED = /* @__PURE__ */ Object.freeze({
|
|
|
5343
5385
|
};
|
|
5344
5386
|
}
|
|
5345
5387
|
});
|
|
5346
|
-
export { BALANCE_MEASURE_SUFFIXES, BALANCE_SIDE_DEPTH, CIRCLE_SCATTERED, CORPUS_DIMENSIONS, CORPUS_MANIFEST_SCHEMA, DEFAULT_FAMILY_BY, DEFAULT_RNG, DEFAULT_SHAPES, DEFAULT_TOLERANCE, EDGES_STEP, EDGE_DENSITY, EDGE_KEY_STEP, EDGE_KEY_STEP_VERSION, EDGE_STEP_VERSION, EPS, EPS_STEPS, FAMILY_ANY_KIND, FRAME_SCHEMA, FRAME_STATES, 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, REFUSED_PROBE, 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, boxCenterDistance, canonicalConfig, canonicalInput, canonicalJson, carryRecord, catalogChoices, catalogDefaults, catalogKey, catalogOptions, checkCatalog, checkConfig, checkDeclared, checkInput, checkLayoutRecord, checkOptions, checkSchema, checkShapes, checkSpace, checkSplit, circleOverlaps, circlesOutside, clampOptions, compareMeasure, composeFamily, configId, corpusHashOf, corpusManifestText, countLinksThroughShapes, countObstacleHits, countOutside, countOverlaps, countPortsOffBorder, countResizeBreaks, createFamilyRegistry, crossingPoint, declarationIssues, declaredClaimOf, declaredCounts, decodeOptionValue, dimensionAt, dimensionSupports, dimensionUnit, documentHash, dropIndex, edgeKeyStep, edgeStep, encodeOptionValue, enumerateSpace, exercised, familyKind, familyOf, fingerprintOf, fixedPointMove, fnv1a32, frameAt, frameMove, frameOf, grow, hardRuleOf, inputShapeLevel, isShapeKind, itemShapeOf, joinConfigs, leaveOneSeedOut, levelsOf, lineJson, listOptions, manifestText, marginSides, minEffectOf, mulberry32, nearestGaps, optionDefaults, optionIssue, outputGridClass, outputGroups, outputHash, outputOf, overlapOf, ownerDimension, packHard, packLinks, packOutputForm, paramActive, paramLevels, paramProblem, paramValue, parseLayoutRecord, parseStrategyCatalog, perChange, pickMoves, placedCircle, placedRect, pointInRing, pointInRings, pointSegmentDistance, portPoint, portfolio, probeHash, procrustesOf, productSpace, randomInt, rectInRegion, regionArea, regionHitsRect, resizeBox, resizeProblems, resolveDimensions, ruleLevel, scaleRect, segmentThroughShape, segmentsCross, selectBest, sha256Hex, shapeKindOf, shapeKindProblem, shapeKindsOf, shapeLevel, shapeSupportProblems, shapesOf, shapesOverlap, sharedDimension, sizeBoundsOf, sizeFits, snapRect, spaceShapeKinds, spaceSize, splitConfig, splitFileName, splitFolds, stepRandom, sweepGrid, sweepOf, sweepValues, toLayoutRecord, toPackInput, toRect, toSizedRect, translate, turnBox, turnMargin, turnPoint, turnPort, turnRegion, turnResize, turnSide, verdict, writeStrategyCatalog };
|
|
5388
|
+
export { BALANCE_MEASURE_SUFFIXES, BALANCE_SIDE_DEPTH, CIRCLE_SCATTERED, CORPUS_DIMENSIONS, CORPUS_MANIFEST_SCHEMA, DEFAULT_FAMILY_BY, DEFAULT_RNG, DEFAULT_SHAPES, DEFAULT_TOLERANCE, EDGES_STEP, EDGE_DENSITY, EDGE_KEY_STEP, EDGE_KEY_STEP_VERSION, EDGE_STEP_VERSION, EPS, EPS_STEPS, FAMILY_ANY_KIND, FRAME_SCHEMA, FRAME_STATES, 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, REFUSED_PROBE, 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, boxCenterDistance, canonicalConfig, canonicalInput, canonicalJson, carryRecord, catalogChoices, catalogDefaults, catalogKey, catalogOptions, checkCatalog, checkConfig, checkDeclared, checkInput, checkLayoutRecord, checkOptions, checkSchema, checkShapes, checkSpace, checkSplit, circleOverlaps, circlesOutside, clampOptions, clipRing, compareMeasure, composeFamily, configId, corpusHashOf, corpusManifestText, countLinksThroughShapes, countObstacleHits, countOutside, countOverlaps, countPortsOffBorder, countResizeBreaks, createFamilyRegistry, crossingPoint, declarationIssues, declaredClaimOf, declaredCounts, decodeOptionValue, dimensionAt, dimensionSupports, dimensionUnit, documentHash, dropIndex, edgeKeyStep, edgeStep, encodeOptionValue, enumerateSpace, exercised, familyKind, familyOf, fingerprintOf, fixedPointMove, fnv1a32, frameAt, frameMove, frameOf, grow, hardRuleOf, inputShapeLevel, isShapeKind, itemShapeOf, joinConfigs, leaveOneSeedOut, levelsOf, lineJson, listOptions, manifestText, marginSides, minEffectOf, mulberry32, nearestGaps, optionDefaults, optionIssue, outputGridClass, outputGroups, outputHash, outputOf, overlapOf, ownerDimension, packHard, packLinks, packOutputForm, paramActive, paramAt, paramLevels, paramProblem, paramUnit, paramValue, parseLayoutRecord, parseStrategyCatalog, perChange, pickMoves, placedCircle, placedRect, pointInRing, pointInRings, pointSegmentDistance, portPoint, portfolio, probeHash, procrustesOf, productSpace, randomInt, rectInRegion, regionArea, regionHitsRect, resizeBox, resizeProblems, resolveDimensions, ringCentroid, ruleLevel, scaleRect, segmentThroughShape, segmentsCross, selectBest, sha256Hex, shapeKindOf, shapeKindProblem, shapeKindsOf, shapeLevel, shapeSupportProblems, shapesOf, shapesOverlap, sharedDimension, sizeBoundsOf, sizeFits, snapRect, spaceShapeKinds, spaceSize, splitConfig, splitFileName, splitFolds, stepRandom, sweepGrid, sweepOf, sweepValues, toLayoutRecord, toPackInput, toRect, toSizedRect, translate, turnBox, turnMargin, turnPoint, turnPort, turnRegion, turnResize, turnSide, verdict, writeStrategyCatalog };
|
|
5347
5389
|
|
|
5348
5390
|
//# sourceMappingURL=index.js.map
|