@mark1russell7/layout-contract 0.9.3 → 0.9.4

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 CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as CorpusSplit, A as shapeKindsOf, At as overlapOf, B as LayoutInput, C as checkShapes, Ct as Sides, D as ruleLevel, Dt as dropIndex, E as itemShapeOf, Et as crossingPoint, F as LayoutBox, Ft as toRect, G as PairGap, H as PackInput, I as LayoutCell, It as toSizedRect, J as packLinks, K as Port, L as LayoutContainer, Lt as translate, M as shapeSupportProblems, Mt as regionArea, N as shapesOf, Nt as segmentsCross, O as shapeKindOf, Ot as grow, P as Item, Pt as snapRect, Q as CorpusEntry, R as LayoutEdge, S as boxArea, St as Side, T as isShapeKind, Tt as boundsOf, U as PackInputOptions, V as Obstacle, W as PackLink, X as toPackInput, Y as portPoint, Z as ClaimBreak, _ as ShapeKind, _t as Margin, a as MeasureSpec, at as SPLIT_SCHEMA, b as ShapeLimit, bt as Region, c as minEffectOf, ct as checkDeclared, d as SHAPE_KINDS, dt as declaredClaimOf, et as DeclaredClaim, f as SHAPE_KIND_IDS, ft as declaredCounts, g as ShapeInput, gt as splitFolds, h as ShapeGeometry, ht as splitFileName, i as JointMeasureId, it as FamilyCell, j as shapeLevel, jt as pointSegmentDistance, k as shapeKindProblem, kt as marginSides, l as DEFAULT_SHAPES, lt as checkSplit, m as ShapeCheck, mt as leaveOneSeedOut, n as JOINT_MEASURES, nt as FAMILY_ANY_KIND, o as Verdict, ot as SplitCorpus, p as ShapeBound, pt as familyOf, q as canonicalInput, r as JOINT_MOVED_MIN, rt as FamilyBy, s as compareMeasure, st as SplitFold, t as Direction, tt as Declares, u as RuleLevel, ut as corpusHashOf, v as ShapeKindSpec, vt as Point, w as inputShapeLevel, wt as SizedRect, x as ShapeSupport, xt as SIDES, y as ShapeLevel, yt as Rect, z as LayoutGenerator } from "./measures-O-NfAbmJ.js";
1
+ import { $ as CorpusSplit, A as shapeKindsOf, At as overlapOf, B as LayoutInput, C as checkShapes, Ct as Sides, D as ruleLevel, Dt as dropIndex, E as itemShapeOf, Et as crossingPoint, F as LayoutBox, Ft as snapRect, G as PairGap, H as PackInput, I as LayoutCell, It as toRect, J as packLinks, K as Port, L as LayoutContainer, Lt as toSizedRect, M as shapeSupportProblems, Mt as regionArea, N as shapesOf, Nt as scaleRect, O as shapeKindOf, Ot as grow, P as Item, Pt as segmentsCross, Q as CorpusEntry, R as LayoutEdge, Rt as translate, S as boxArea, St as Side, T as isShapeKind, Tt as boundsOf, U as PackInputOptions, V as Obstacle, W as PackLink, X as toPackInput, Y as portPoint, Z as ClaimBreak, _ as ShapeKind, _t as Margin, a as MeasureSpec, at as SPLIT_SCHEMA, b as ShapeLimit, bt as Region, c as minEffectOf, ct as checkDeclared, d as SHAPE_KINDS, dt as declaredClaimOf, et as DeclaredClaim, f as SHAPE_KIND_IDS, ft as declaredCounts, g as ShapeInput, gt as splitFolds, h as ShapeGeometry, ht as splitFileName, i as JointMeasureId, it as FamilyCell, j as shapeLevel, jt as pointSegmentDistance, k as shapeKindProblem, kt as marginSides, l as DEFAULT_SHAPES, lt as checkSplit, m as ShapeCheck, mt as leaveOneSeedOut, n as JOINT_MEASURES, nt as FAMILY_ANY_KIND, o as Verdict, ot as SplitCorpus, p as ShapeBound, pt as familyOf, q as canonicalInput, r as JOINT_MOVED_MIN, rt as FamilyBy, s as compareMeasure, st as SplitFold, t as Direction, tt as Declares, u as RuleLevel, ut as corpusHashOf, v as ShapeKindSpec, vt as Point, w as inputShapeLevel, wt as SizedRect, x as ShapeSupport, xt as SIDES, y as ShapeLevel, yt as Rect, z as LayoutGenerator } from "./measures-B_n_KDMd.js";
2
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";
3
3
  /** The epsilon for the float compares in an engine. */
4
4
  export declare const EPS = 1e-6;
@@ -1474,5 +1474,5 @@ export declare const CIRCLE_SCATTERED: CorpusFamily<LayoutInput>;
1474
1474
  * The steps `container`, `obstacles` and `boxes` each have a stream of `stepRandom`. Each value is a whole number, so the family is `exact`.
1475
1475
  */
1476
1476
  export declare const RECT_SCATTERED: CorpusFamily<LayoutInput>;
1477
- 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, 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, 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, pointSegmentDistance, portPoint, productSpace, regionArea, ruleLevel, segmentsCross, shapeKindOf, shapeKindProblem, shapeKindsOf, shapeLevel, shapeSupportProblems, shapesOf, snapRect, splitConfig, splitFileName, splitFolds, sweepGrid, sweepOf, sweepValues, toPackInput, toRect, toSizedRect, translate };
1477
+ 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, 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, 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, pointSegmentDistance, portPoint, productSpace, regionArea, ruleLevel, scaleRect, segmentsCross, shapeKindOf, shapeKindProblem, shapeKindsOf, shapeLevel, shapeSupportProblems, shapesOf, snapRect, splitConfig, splitFileName, splitFolds, sweepGrid, sweepOf, sweepValues, toPackInput, toRect, toSizedRect, translate };
1478
1478
  //# sourceMappingURL=index.d.ts.map
package/build/index.js CHANGED
@@ -43,6 +43,20 @@ function snapRect(rect) {
43
43
  h: roundEdge(rect.y + rect.h) - y
44
44
  };
45
45
  }
46
+ /**
47
+ * This function gives a rectangle with each coordinate and each size times `factor`. It changes the unit of a
48
+ * rectangle, for example from the CSS pixels of a zoomed page to the pixels of its window. It does not round:
49
+ * `snapRect` comes after it. A factor that is negative or not finite gives a `RangeError`.
50
+ */
51
+ function scaleRect(rect, factor) {
52
+ if (!Number.isFinite(factor) || factor < 0) throw new RangeError(`The factor of scaleRect must be a finite number of 0 or more, not ${factor}.`);
53
+ return {
54
+ x: rect.x * factor,
55
+ y: rect.y * factor,
56
+ w: rect.w * factor,
57
+ h: rect.h * factor
58
+ };
59
+ }
46
60
  /** This function gives the value of each side of a margin. No margin gives 0 on each side. */
47
61
  function marginSides(margin) {
48
62
  if (margin === void 0) return {
@@ -5130,6 +5144,6 @@ const RECT_SCATTERED = /* @__PURE__ */ Object.freeze({
5130
5144
  };
5131
5145
  }
5132
5146
  });
5133
- 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, 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, 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, pointSegmentDistance, portPoint, portfolio, probeHash, procrustesOf, productSpace, randomInt, rectInRegion, regionArea, regionHitsRect, resolveDimensions, ruleLevel, segmentThroughShape, segmentsCross, selectBest, sha256Hex, shapeKindOf, shapeKindProblem, shapeKindsOf, shapeLevel, shapeSupportProblems, shapesOf, shapesOverlap, sharedDimension, snapRect, spaceShapeKinds, spaceSize, splitConfig, splitFileName, splitFolds, stepRandom, sweepGrid, sweepOf, sweepValues, toLayoutRecord, toPackInput, toRect, toSizedRect, translate, turnBox, turnMargin, turnPoint, turnPort, turnRegion, turnSide, verdict, writeStrategyCatalog };
5147
+ 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, 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, 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, pointSegmentDistance, portPoint, portfolio, probeHash, procrustesOf, productSpace, randomInt, rectInRegion, regionArea, regionHitsRect, resolveDimensions, ruleLevel, scaleRect, segmentThroughShape, segmentsCross, selectBest, sha256Hex, shapeKindOf, shapeKindProblem, shapeKindsOf, shapeLevel, shapeSupportProblems, shapesOf, shapesOverlap, sharedDimension, snapRect, spaceShapeKinds, spaceSize, splitConfig, splitFileName, splitFolds, stepRandom, sweepGrid, sweepOf, sweepValues, toLayoutRecord, toPackInput, toRect, toSizedRect, translate, turnBox, turnMargin, turnPoint, turnPort, turnRegion, turnSide, verdict, writeStrategyCatalog };
5134
5148
 
5135
5149
  //# sourceMappingURL=index.js.map