@mark1russell7/highways 0.1.5 → 0.2.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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/geom.ts","../src/grid.ts","../src/model.ts","../src/fixtures.ts","../src/cases.ts","../src/plugs.ts","../src/curves.ts","../src/curves/model.ts","../src/curves/space.ts","../src/curves/sample.ts","../src/curves/straight/index.ts","../src/curves/rounded/index.ts","../src/curves/spline/index.ts","../src/curves/arc/index.ts","../src/curves/index.ts","../src/visibility.ts","../src/ways.ts","../src/segments.ts","../src/sections.ts","../src/routers/straight.ts","../src/routers/plugs.ts","../src/routers/corners.ts","../src/routers/shared.ts","../src/routers/sections.ts","../src/routers/trunks.ts","../src/routers/index.ts","../src/room/index.ts","../src/room/lanes.ts","../src/bench/properties.ts","../src/bench/quality.ts","../src/bench/links.ts","../src/bench/run.ts","../src/strategies/model.ts","../src/bench/curves.ts","../src/bench/room.ts","../src/strategies/builtins.ts"],"mappings":";iBACiB;WACN;WACA;;;iBAIM;WACN;WACA;WACA;WACA;;;wBAIK,KAAK,GAAG,OAAO,GAAG;;wBAOlB,OAAO,GAAG,MAAM;;wBAKhB,QAAQ,GAAG,KAAK,YAAY;;wBAK5B,eAAe,YAAY;;;;;wBAY3B,cAAc,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG;;;;;wBAY/C,eAAe,GAAG,OAAO,GAAG,OAAO,KAAK,KAAK;;wBAK7C,gBAAgB,GAAG,OAAO,GAAG,OAAO,YAAY,YAAY,YAAY,YAAY;;wBA2BpF,iBAAiB,GAAG,OAAO,GAAG;;wBAO9B,qBAAqB,GAAG,OAAO,GAAG,OAAO,GAAG;;wBAS5C,mBAAmB,GAAG,OAAO,GAAG,OAAO,KAAK;;;;;wBAiB5C,MAAM,YAAY,SAAS;;wBAgB3B,UAAU,YAAY,SAAS;;;;;wBAQ/B,gBAAgB,YAAY,SA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eAAe,6BAA2C;;;;;wBAQ1D,aAAa,8BAA4C,kBAAiB,cAA4B;;wBAQtG,aAAa,6BAA6C,6BAAqC;;wBAK/F,WAAW,eAAe;;YCtK9B,aAAa,KAAK,KAAK;;qBAmBtB;WACF,UAAU;WACV,OAAO;WACP,SAAS,mBAAmB,aAAa;WACzC,kBAAkB,mBAAmB,aAAa;WAClD,QAAQ,mBAAmB,aAAa;WACxC,QAAQ,mBAAmB,aAAa;WACxC,cAAc,mBAAmB,aAAa;WAC9C,UAAU,mBAAmB,aAAa;WAC1C,iBAAiB,mBAAmB,aAAa;;;iBA4D3C;;WAEN;;;iBAIM;;WAEN;;;qBAIE;WACF,UAAU;WACV,SAAS,kBAAkB;WAC3B,QAAQ,kBAAkB;WAC1B,KAAK,kBAAkB;;;YA2BtB,aAAa,KAAK;;qBAMjB;WACF,QAAQ,iBAAiB;WACzB,OAAO,iBAAiB;;;qBAOtB,8BAA8B;;qBAO9B,YAAY"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/geom.ts","../src/grid.ts","../src/model.ts","../src/fixtures.ts","../src/cases.ts","../src/plugs.ts","../src/curves.ts","../src/curves/model.ts","../src/curves/space.ts","../src/curves/sample.ts","../src/curves/straight/index.ts","../src/curves/rounded/index.ts","../src/curves/spline/index.ts","../src/curves/arc/index.ts","../src/curves/index.ts","../src/visibility.ts","../src/ways.ts","../src/segments.ts","../src/sections.ts","../src/groups/quadtree/index.ts","../src/groups/keys/index.ts","../src/pick.ts","../src/routers/straight.ts","../src/routers/plugs.ts","../src/routers/corners.ts","../src/routers/shared.ts","../src/levels.ts","../src/room/index.ts","../src/strategies/model.ts","../src/routers/sections.ts","../src/routers/trunks.ts","../src/routers/index.ts","../src/room/lanes.ts","../src/bench/properties.ts","../src/bench/quality.ts","../src/bench/links.ts","../src/bench/run.ts","../src/bench/curves.ts","../src/bench/room.ts","../src/bench/sections.ts","../src/strategies/builtins.ts"],"mappings":";iBACiB;WACN;WACA;;;iBAIM;WAC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W,eAAe;;YC1K9B,yBAAyB,KAAK;;iBAGzB;;WAEN;WACA,SAAS;;;iBAIH;WACN;WACA;;WAEA,QAAQ;;WAER,aAAa;;WAEb;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;;;;;wBAYK,cAAc,iBAAiB,OAAO,OAAO,mBAAmB,oBAAoB;;qBAwBvF;;wBAGG,gBAAgB,6BAA4C;;qBAK/D;;wBAGG,cAAc,6BAA0C;;qBAK3D;;wBAGG,YAAY,6BAAwC;;;;;wBAQpD,cACd,sBAAqB,qBACrB,UAAS,SAAS,0BACjB;;wBAKa,eAAe,eAAe;;YC5FlC,aAAa,KAAK,KAAK;;qBAmBtB;WACF,UAAU;WACV,OAAO;WACP,SAAS,mBAAmB,aAAa;WACzC,kBAAkB,mBAAmB,aAAa;WAClD,QAAQ,mBAAmB,aAAa;WACxC,QAAQ,mBAAmB,aAAa;WACxC,cAAc,mBAAmB,aAAa;WAC9C,UAAU,mBAAmB,aAAa;WAC1C,iBAAiB,mBAAmB,aAAa;;;iBA4D3C;;WAEN;;;iBAIM;;WAEN;;;qBAIE;WACF,UAAU;WACV,SAAS,kBAAkB;WAC3B,QAAQ,kBAAkB;WAC1B,KAAK,kBAAkB;;;YA2BtB,aAAa,KAAK;;qBAMjB;WACF,QAAQ,iBAAiB;WACzB,OAAO,iBAAiB;;;qBAOtB;WACF,UAAU,kBAAkB,SAAS;WACrC,MAAM,kBAAkB;;;qBAmBtB,8BAA8B;;qBAQ9B,YAAY"}
package/build/index.js CHANGED
@@ -2340,13 +2340,20 @@ function orderLanes(run, routes) {
2340
2340
  return [...placed.map((x) => x.edge), ...lost.sort()];
2341
2341
  }
2342
2342
  // src/sections.ts
2343
+ /** The default values of `SectionOptions`. */
2344
+ const SECTION_DEFAULTS = Object.freeze({
2345
+ cap: 8,
2346
+ maxDepth: 16,
2347
+ collapse: 32
2348
+ });
2343
2349
  /**
2344
2350
  * This function makes the tree of sections of the nodes. A cell with more than `cap` nodes splits in four.
2345
2351
  * When the nodes of a cell are all in one quarter, the cell becomes that quarter and does not make a level.
2346
2352
  */
2347
2353
  function buildSections(nodes, options = {}) {
2348
- const cap = Math.max(1, options.cap ?? 8);
2349
- const maxDepth = options.maxDepth ?? 16;
2354
+ const cap = Math.max(1, options.cap ?? SECTION_DEFAULTS.cap);
2355
+ const maxDepth = options.maxDepth ?? SECTION_DEFAULTS.maxDepth;
2356
+ const collapse = options.collapse ?? SECTION_DEFAULTS.collapse;
2350
2357
  const centers = nodes.map((n) => center(n.box));
2351
2358
  let x0 = Infinity;
2352
2359
  let y0 = Infinity;
@@ -2371,7 +2378,7 @@ function buildSections(nodes, options = {}) {
2371
2378
  };
2372
2379
  const make = (id, depth, cell, list) => {
2373
2380
  let box = cell;
2374
- for (let guard = 0; list.length > cap && depth < maxDepth && guard < 32; guard++) {
2381
+ for (let guard = 0; list.length > cap && depth < maxDepth && guard < collapse; guard++) {
2375
2382
  const mx = box.x + box.w / 2;
2376
2383
  const my = box.y + box.h / 2;
2377
2384
  const parts = [
@@ -2425,6 +2432,156 @@ function allSections(root) {
2425
2432
  function treeDepth(root) {
2426
2433
  return root.children.reduce((d, c) => Math.max(d, treeDepth(c)), root.depth);
2427
2434
  }
2435
+ /**
2436
+ * This function examines a tree of sections from a grouping rule. It throws an error when the tree is not valid for `count` nodes.
2437
+ * In a valid tree, each node is in exactly one leaf. The children of a section split its nodes, and a child is one level deeper than its parent.
2438
+ */
2439
+ function checkSections(root, count) {
2440
+ const seen = new Array(count).fill(0);
2441
+ const ids = /* @__PURE__ */ new Set();
2442
+ const fail = (s, what) => {
2443
+ throw new Error(`The tree of sections is not valid at the section "${s.id}": ${what}.`);
2444
+ };
2445
+ if (root.depth !== 0) fail(root, "the root has a depth that is not 0");
2446
+ if (root.nodes.length !== count) fail(root, `the root has ${root.nodes.length} nodes, and the graph has ${count}`);
2447
+ const walk = (s) => {
2448
+ if (ids.has(s.id)) fail(s, "two sections have this id");
2449
+ ids.add(s.id);
2450
+ if (s.children.length === 0) {
2451
+ for (const i of s.nodes) {
2452
+ if (!Number.isInteger(i) || i < 0 || i >= count) fail(s, `the node index ${i} is not in the graph`);
2453
+ seen[i]++;
2454
+ }
2455
+ return;
2456
+ }
2457
+ let total = 0;
2458
+ const own = new Set(s.nodes);
2459
+ for (const c of s.children) {
2460
+ if (c.depth !== s.depth + 1) fail(c, "a child is not one level deeper than its parent");
2461
+ for (const i of c.nodes) if (!own.has(i)) fail(c, `the node index ${i} is not in the parent`);
2462
+ total += c.nodes.length;
2463
+ walk(c);
2464
+ }
2465
+ if (total !== s.nodes.length) fail(s, "the children do not split the nodes of the section");
2466
+ };
2467
+ walk(root);
2468
+ const lost = seen.findIndex((n) => n !== 1);
2469
+ if (lost >= 0) fail(root, `the node index ${lost} is in ${seen[lost]} leaves, not in one`);
2470
+ }
2471
+ // src/groups/quadtree/index.ts
2472
+ /**
2473
+ * This function gives the tree of sections of the grouping rule `quadtree`: the cells of a quadtree of the plane (`buildSections`).
2474
+ * It is the default grouping rule of the router `sections`.
2475
+ */
2476
+ function quadtreeGroups(graph, options = {}) {
2477
+ return buildSections(graph.nodes, options);
2478
+ }
2479
+ // src/groups/keys/index.ts
2480
+ /** This key rule gives the string `data.group` of the node, or `undefined` when the node has no such string. */
2481
+ const byDataGroup = (node) => {
2482
+ const group = node.data?.["group"];
2483
+ return typeof group === "string" ? group : void 0;
2484
+ };
2485
+ /** This function gives the bounding box of the boxes of the nodes of the list. */
2486
+ function boundsOf(nodes, list) {
2487
+ let x0 = Infinity;
2488
+ let y0 = Infinity;
2489
+ let x1 = -Infinity;
2490
+ let y1 = -Infinity;
2491
+ for (const i of list) {
2492
+ const b = nodes[i].box;
2493
+ x0 = Math.min(x0, b.x);
2494
+ y0 = Math.min(y0, b.y);
2495
+ x1 = Math.max(x1, b.x + b.w);
2496
+ y1 = Math.max(y1, b.y + b.h);
2497
+ }
2498
+ return list.length ? {
2499
+ x: x0,
2500
+ y: y0,
2501
+ w: x1 - x0,
2502
+ h: y1 - y0
2503
+ } : {
2504
+ x: 0,
2505
+ y: 0,
2506
+ w: 0,
2507
+ h: 0
2508
+ };
2509
+ }
2510
+ /**
2511
+ * This function gives the tree of sections of the grouping rule `keys`. The root holds each node. Each child of the root holds the nodes of one key,
2512
+ * in the order of their first node. The id of a group is `s:` and its key. A node without a key is a group alone, with the id `s#` and its index.
2513
+ * Thus the far view of the router `sections` shows one item for each group.
2514
+ */
2515
+ function keyedSections(nodes, options = {}) {
2516
+ const key = options.key ?? byDataGroup;
2517
+ const groups = /* @__PURE__ */ new Map();
2518
+ nodes.forEach((n, i) => {
2519
+ const k = key(n, i);
2520
+ const id = k === void 0 ? `s#${i}` : `s:${k}`;
2521
+ const list = groups.get(id);
2522
+ if (list) list.push(i);
2523
+ else groups.set(id, [i]);
2524
+ });
2525
+ const children = [...groups].map(([id, list]) => group(nodes, id, list, options.split));
2526
+ return {
2527
+ id: "s",
2528
+ depth: 0,
2529
+ cell: boundsOf(nodes, nodes.map((_, i) => i)),
2530
+ nodes: nodes.map((_, i) => i),
2531
+ children
2532
+ };
2533
+ }
2534
+ /** This function gives the section of one group at depth 1. With `split`, the section has the quadtree of its nodes below it. */
2535
+ function group(nodes, id, list, split) {
2536
+ if (!split) return {
2537
+ id,
2538
+ depth: 1,
2539
+ cell: boundsOf(nodes, list),
2540
+ nodes: list,
2541
+ children: []
2542
+ };
2543
+ const tree = buildSections(list.map((i) => nodes[i]), split);
2544
+ const rebase = (s) => ({
2545
+ id: s.id === "s" ? id : `${id}/${s.id.slice(1)}`,
2546
+ depth: s.depth + 1,
2547
+ cell: s.cell,
2548
+ nodes: s.nodes.map((j) => list[j]),
2549
+ children: s.children.map(rebase)
2550
+ });
2551
+ return rebase(tree);
2552
+ }
2553
+ /** This function gives the tree of sections of the grouping rule `keys` for a graph. */
2554
+ function keyGroups(graph, options = {}) {
2555
+ return keyedSections(graph.nodes, options);
2556
+ }
2557
+ // src/pick.ts
2558
+ /** This function gives the median width of the shown items of each level, in units of the plane. */
2559
+ function itemSizes(levels) {
2560
+ return levels.map((level) => {
2561
+ const sizes = level.items.map((i) => Math.max(i.box.w, i.box.h)).sort((a, b) => a - b);
2562
+ return sizes.length ? sizes[Math.floor(sizes.length / 2)] : 0;
2563
+ });
2564
+ }
2565
+ /** The default thresholds: a node of 22 pixels shows its routes, and a group of 120 pixels shows its parts. */
2566
+ const PICK = Object.freeze({
2567
+ routesAt: 22,
2568
+ itemAt: 120
2569
+ });
2570
+ /**
2571
+ * This function picks the level that a camera shows at a scale, in pixels for each unit of the plane. The sizes come from `itemSizes`.
2572
+ * The value `sizes.length` stands for the routes of each edge. The last level holds the nodes alone.
2573
+ * Each threshold that `options` does not give gets its value from `PICK`.
2574
+ */
2575
+ function pickLevel(sizes, scale, options = PICK) {
2576
+ const routesAt = options.routesAt ?? PICK.routesAt;
2577
+ const itemAt = options.itemAt ?? PICK.itemAt;
2578
+ const n = sizes.length;
2579
+ if (n === 0) return 0;
2580
+ if (sizes[n - 1] * scale >= routesAt) return n;
2581
+ let pick = 0;
2582
+ for (let d = 0; d < n - 1; d++) if (sizes[d] * scale >= itemAt) pick = d;
2583
+ return pick;
2584
+ }
2428
2585
  // src/routers/corners.ts
2429
2586
  /**
2430
2587
  * This function makes a router that goes around the nodes.
@@ -2623,8 +2780,11 @@ function sumFaults(list) {
2623
2780
  });
2624
2781
  }
2625
2782
  // src/levels.ts
2626
- /** The margin of the second corner graph. A gap between two boxes wider than approximately 1.5 times this margin lets a link through. */
2627
- const TIGHT_MARGIN = 1;
2783
+ /** The default values of the two limits of `LevelLinkOptions`. */
2784
+ const LEVEL_LINK_DEFAULTS = Object.freeze({
2785
+ tightMargin: 1,
2786
+ plugInset: 6
2787
+ });
2628
2788
  const EPS$1 = 1e-6;
2629
2789
  /**
2630
2790
  * This function removes the repeated points, the points in the middle of a straight run,
@@ -2659,7 +2819,7 @@ function levelLinks(items, pairs, options = {}) {
2659
2819
  }));
2660
2820
  const byId = new Map(nodes.map((n) => [n.id, n]));
2661
2821
  const ways = levelWays(nodes, options);
2662
- const inset = Math.min(6, ways.margin);
2822
+ const inset = Math.min(options.plugInset ?? LEVEL_LINK_DEFAULTS.plugInset, ways.margin);
2663
2823
  const out = [];
2664
2824
  for (const p of pairs) {
2665
2825
  const s = byId.get(p.source);
@@ -2713,7 +2873,7 @@ function levelWays(nodes, options) {
2713
2873
  });
2714
2874
  let tight;
2715
2875
  const tightGraph = () => tight ??= new CornerGraph(nodes, obstacles, {
2716
- margin: Math.min(margin, TIGHT_MARGIN),
2876
+ margin: Math.min(margin, options.tightMargin ?? LEVEL_LINK_DEFAULTS.tightMargin),
2717
2877
  k,
2718
2878
  cones: true
2719
2879
  });
@@ -3041,13 +3201,20 @@ function square(a, b, obstacles, pad, from, to) {
3041
3201
  for (const { c } of options) if (obstacles.clear(a, c, pad) && obstacles.clear(c, b, pad)) return [c, b];
3042
3202
  }
3043
3203
  // src/routers/sections.ts
3204
+ /** The default values of the numbers of `SectionsOptions`: the limits of the hubs, of the tree and of the level links. */
3205
+ const SECTIONS_DEFAULTS = Object.freeze({
3206
+ cap: SECTION_DEFAULTS.cap,
3207
+ maxDepth: SECTION_DEFAULTS.maxDepth,
3208
+ collapse: SECTION_DEFAULTS.collapse,
3209
+ tightMargin: LEVEL_LINK_DEFAULTS.tightMargin,
3210
+ plugInset: LEVEL_LINK_DEFAULTS.plugInset,
3211
+ hubs: Infinity,
3212
+ stretch: 2,
3213
+ stretchPad: 4,
3214
+ hubSlack: 80
3215
+ });
3044
3216
  const dedupe$1 = (p) => p.filter((q, i) => i === 0 || dist(q, p[i - 1]) > 1e-9);
3045
3217
  /**
3046
- * A hub can be this many units farther from the target than the nearest approach of the way before it.
3047
- * A hub farther away goes out and back, so the way skips it.
3048
- */
3049
- const HUB_SLACK = 80;
3050
- /**
3051
3218
  * This function makes a router with a tree of sections. Each section has a hub: the free corner nearest to the center of its nodes.
3052
3219
  * An edge goes from its node up the hubs of its sections to the lowest common section, across, and down to the other node.
3053
3220
  * Each way from hub to hub is found one time, so all the edges on it share its points.
@@ -3062,12 +3229,14 @@ function sectionsRouter(options) {
3062
3229
  const router = {
3063
3230
  name: options.name,
3064
3231
  route(graph) {
3065
- const stretch = options.stretch ?? 2;
3232
+ const stretch = options.stretch ?? SECTIONS_DEFAULTS.stretch;
3233
+ const stretchPad = options.stretchPad ?? SECTIONS_DEFAULTS.stretchPad;
3234
+ const hubSlack = options.hubSlack ?? SECTIONS_DEFAULTS.hubSlack;
3066
3235
  const byId = nodeIndex(graph);
3067
3236
  const indexOfNode = new Map(graph.nodes.map((n, i) => [n.id, i]));
3068
3237
  const ways = new WayFinder(graph.nodes, options);
3069
3238
  const corners = ways.corners;
3070
- const root = buildSections(graph.nodes, options);
3239
+ const root = groupNodes(graph, options);
3071
3240
  const parent = /* @__PURE__ */ new Map();
3072
3241
  const leafOf = [];
3073
3242
  for (const s of allSections(root)) {
@@ -3101,7 +3270,7 @@ function sectionsRouter(options) {
3101
3270
  let last = from;
3102
3271
  for (const c of list) {
3103
3272
  const h = hub(c);
3104
- if (dist(h, to) > near + HUB_SLACK) continue;
3273
+ if (dist(h, to) > near + hubSlack) continue;
3105
3274
  near = Math.min(near, pointSegmentDistance(to, last, h));
3106
3275
  last = h;
3107
3276
  kept.push(c);
@@ -3151,7 +3320,7 @@ function sectionsRouter(options) {
3151
3320
  const b = up(lv);
3152
3321
  const common = new Set(b);
3153
3322
  const lca = a.find((x) => common.has(x));
3154
- const keep = options.hubs ?? Infinity;
3323
+ const keep = options.hubs ?? SECTIONS_DEFAULTS.hubs;
3155
3324
  const side = (list) => list.slice(Math.max(0, list.indexOf(lca) - keep), list.indexOf(lca));
3156
3325
  const end = ways.out(pt);
3157
3326
  const start = ways.out(ps);
@@ -3172,7 +3341,7 @@ function sectionsRouter(options) {
3172
3341
  for (let i = 1; i < chain.length; i++) append(piece(chain[i - 1].id, hub(chain[i - 1]), chain[i].id, hub(chain[i]), used));
3173
3342
  append(piece(chain[chain.length - 1].id, hub(chain[chain.length - 1]), at(end), end, used));
3174
3343
  append([pt.point]);
3175
- if (polylineLength(out) > stretch * dist(ps.point, pt.point) + 4 * ways.margin || goesOutAndBack(out)) {
3344
+ if (polylineLength(out) > stretch * dist(ps.point, pt.point) + stretchPad * ways.margin || goesOutAndBack(out)) {
3176
3345
  routes.push({
3177
3346
  edge: e.id,
3178
3347
  points: ways.between(ps, pt, /* @__PURE__ */ new Set([s, t]))
@@ -3213,8 +3382,16 @@ function sectionsRouter(options) {
3213
3382
  maxNodes: options.maxNodes
3214
3383
  };
3215
3384
  }
3385
+ /** This function gives the tree of sections of the grouping rule. It examines the tree of a strategy (`checkSections`). */
3386
+ function groupNodes(graph, options) {
3387
+ if (!options.group) return buildSections(graph.nodes, options);
3388
+ const root = options.group.run(graph, options.groupOptions);
3389
+ checkSections(root, graph.nodes.length);
3390
+ return root;
3391
+ }
3216
3392
  /**
3217
3393
  * This function gives one zoom level for each depth of the tree, and a last level with each node alone.
3394
+ * With the option `levels`, only those depths get a level with groups.
3218
3395
  * At depth d, a section of depth d is one item. A link joins two items and counts the edges between them.
3219
3396
  * In a level with groups, a link goes around the boxes of the other items (`levelLinks`).
3220
3397
  * In the last level, the points of a link are the route of its first edge.
@@ -3223,7 +3400,9 @@ function makeLevels(graph, root, routeOf, options) {
3223
3400
  const indexOfNode = new Map(graph.nodes.map((n, i) => [n.id, i]));
3224
3401
  const levels = [];
3225
3402
  const deepest = treeDepth(root);
3403
+ const shown = options.levels && new Set(options.levels);
3226
3404
  for (let d = 0; d <= deepest + 1; d++) {
3405
+ if (shown && d <= deepest && !shown.has(d)) continue;
3227
3406
  const items = [];
3228
3407
  const itemOf = [];
3229
3408
  const boxOf = (list) => {
@@ -4355,7 +4534,7 @@ function measureStability(before, after) {
4355
4534
  };
4356
4535
  }
4357
4536
  // src/bench/run.ts
4358
- const now$2 = () => globalThis.performance?.now() ?? Date.now();
4537
+ const now$3 = () => globalThis.performance?.now() ?? Date.now();
4359
4538
  /** This function routes each fixture with each router, checks the hard rules and measures the quality. */
4360
4539
  function runBenchmark(routers, fixtures, options = {}) {
4361
4540
  const rows = [];
@@ -4394,9 +4573,9 @@ function benchOne(router, fixture, graph, repeat = 3) {
4394
4573
  let first;
4395
4574
  let deterministic = true;
4396
4575
  for (let i = 0; i < Math.max(2, repeat); i++) {
4397
- const t0 = now$2();
4576
+ const t0 = now$3();
4398
4577
  const r = router.route(graph);
4399
- times.push(now$2() - t0);
4578
+ times.push(now$3() - t0);
4400
4579
  if (!first) first = r;
4401
4580
  else if (i === 1 && !sameData(r, first)) deterministic = false;
4402
4581
  }
@@ -4461,6 +4640,7 @@ function formatFaults(rows) {
4461
4640
  // src/strategies/model.ts
4462
4641
  /** The steps that have strategies, in the order of the pipeline. */
4463
4642
  const STEPS = [
4643
+ "group",
4464
4644
  "router",
4465
4645
  "curve",
4466
4646
  "room"
@@ -4491,6 +4671,7 @@ function defineStrategy(definition) {
4491
4671
  /** This function makes a registry from a list of strategies. It keeps their order. Two strategies with one step and one name are an error. */
4492
4672
  function createRegistry(strategies) {
4493
4673
  const out = {
4674
+ group: [],
4494
4675
  router: [],
4495
4676
  curve: [],
4496
4677
  room: []
@@ -4502,6 +4683,7 @@ function createRegistry(strategies) {
4502
4683
  list.push(s);
4503
4684
  }
4504
4685
  return Object.freeze({
4686
+ group: Object.freeze(out.group),
4505
4687
  router: Object.freeze(out.router),
4506
4688
  curve: Object.freeze(out.curve),
4507
4689
  room: Object.freeze(out.room)
@@ -4510,6 +4692,7 @@ function createRegistry(strategies) {
4510
4692
  /** This function gives a new registry with the strategies of `registry` and then `strategies`. It does not change `registry`. */
4511
4693
  function register(registry, ...strategies) {
4512
4694
  return createRegistry([
4695
+ ...registry.group ?? [],
4513
4696
  ...registry.router,
4514
4697
  ...registry.curve,
4515
4698
  ...registry.room,
@@ -4518,7 +4701,7 @@ function register(registry, ...strategies) {
4518
4701
  }
4519
4702
  /** This function gives the strategies of one step of a registry, in order. */
4520
4703
  function listStrategies(registry, step) {
4521
- return registry[step];
4704
+ return registry[step] ?? [];
4522
4705
  }
4523
4706
  /** This function gives the strategy of one step with a name, or `undefined` when the registry has no such strategy. */
4524
4707
  function findStrategy(registry, step, name) {
@@ -4640,8 +4823,26 @@ const roomStrategies = Object.freeze({
4640
4823
  routes: roomStrategy("routes", "The lanes of a gap are the most routes that run along it side by side, with each gap open to the gutter."),
4641
4824
  lines: roomStrategy("lines", "The lanes of a gap are the straight lines between the centers of the boxes that cross the gap.")
4642
4825
  });
4826
+ /** The built-in grouping rules: the strategies of the step `group`. The router `sections` makes its hubs and its zoom levels from their tree. */
4827
+ const groupStrategies = Object.freeze({
4828
+ quadtree: defineStrategy({
4829
+ step: "group",
4830
+ name: "quadtree",
4831
+ describe: "The cells of a quadtree of the plane. A cell with more than `cap` nodes splits in four. It is the default rule of the router `sections`.",
4832
+ defaults: { ...SECTION_DEFAULTS },
4833
+ run: (graph, o) => quadtreeGroups(graph, o)
4834
+ }),
4835
+ keys: defineStrategy({
4836
+ step: "group",
4837
+ name: "keys",
4838
+ describe: "One group for each key of the nodes. The default key is the string `data.group` of the node. A node without a key is a group alone.",
4839
+ defaults: { key: byDataGroup },
4840
+ run: (graph, o) => keyGroups(graph, o)
4841
+ })
4842
+ });
4643
4843
  /** The built-in strategies of each step, in order. A consumer adds its own: `createRegistry([...BUILT_IN_STRATEGIES, mine])`. */
4644
4844
  const BUILT_IN_STRATEGIES = Object.freeze([
4845
+ ...Object.values(groupStrategies),
4645
4846
  ...Object.values(routerStrategies),
4646
4847
  ...Object.values(curveStrategies),
4647
4848
  ...Object.values(roomStrategies)
@@ -4649,7 +4850,7 @@ const BUILT_IN_STRATEGIES = Object.freeze([
4649
4850
  /** The registry of the built-in strategies. The benchmark and the site take their lists from it. */
4650
4851
  const STRATEGIES = createRegistry(BUILT_IN_STRATEGIES);
4651
4852
  // src/bench/curves.ts
4652
- const now$1 = () => globalThis.performance?.now() ?? Date.now();
4853
+ const now$2 = () => globalThis.performance?.now() ?? Date.now();
4653
4854
  /**
4654
4855
  * This function routes a graph with a router and makes each curve type of each route.
4655
4856
  * It counts the curves that go through a box, with and without the free space, and it compares their length to the polylines.
@@ -4699,9 +4900,9 @@ function benchCurveStrategies(router, fixture, graph, curves, options = {}) {
4699
4900
  }, radius), tolerance)
4700
4901
  }));
4701
4902
  const free = measureLinks(boxes, make(false));
4702
- const t0 = now$1();
4903
+ const t0 = now$2();
4703
4904
  const clamped = make(true);
4704
- const ms = now$1() - t0;
4905
+ const ms = now$2() - t0;
4705
4906
  const length = clamped.reduce((sum, l) => sum + polylineLength(l.points), 0);
4706
4907
  return {
4707
4908
  router: router.name,
@@ -4725,7 +4926,7 @@ function formatCurves(rows) {
4725
4926
  ].join("\n");
4726
4927
  }
4727
4928
  // src/bench/room.ts
4728
- const now = () => globalThis.performance?.now() ?? Date.now();
4929
+ const now$1 = () => globalThis.performance?.now() ?? Date.now();
4729
4930
  /** This function gives the area of the bounding box of the nodes. */
4730
4931
  function areaOf(nodes) {
4731
4932
  let x0 = Infinity;
@@ -4800,22 +5001,22 @@ function benchRoom(fixture, graph, options = {}, methods = [roomStrategies.route
4800
5001
  }, spacing)
4801
5002
  });
4802
5003
  const rows = [row("packed", graph.nodes, 0)];
4803
- const t0 = now();
5004
+ const t0 = now$1();
4804
5005
  const gutter = makeRoom(graph.nodes, links, {
4805
5006
  ...options,
4806
5007
  spacing: 0,
4807
5008
  method: "routes"
4808
5009
  });
4809
- rows.push(row("gutter", gutter.items, now() - t0));
5010
+ rows.push(row("gutter", gutter.items, now$1() - t0));
4810
5011
  const { method: _method, ...preset } = options;
4811
5012
  for (const s of methods) {
4812
- const t1 = now();
5013
+ const t1 = now$1();
4813
5014
  const gaps = s.run({
4814
5015
  items: graph.nodes,
4815
5016
  links
4816
5017
  }, preset);
4817
5018
  const nodes = openGaps(graph.nodes, gaps, options.snap);
4818
- rows.push(row(s.name, nodes, now() - t1));
5019
+ rows.push(row(s.name, nodes, now$1() - t1));
4819
5020
  }
4820
5021
  return rows;
4821
5022
  }
@@ -4847,12 +5048,12 @@ function sweepRoom(fixture, graph, settings, baseline = {
4847
5048
  passes: 1
4848
5049
  }).items, 0, baseline.spacing ?? 4)];
4849
5050
  for (const s of settings) {
4850
- const t0 = now();
5051
+ const t0 = now$1();
4851
5052
  const open = makeRoom(graph.nodes, links, {
4852
5053
  ...s.options,
4853
5054
  method: "routes"
4854
5055
  });
4855
- rows.push(row(s.name, open.items, now() - t0, s.options.spacing ?? 4, s.lanes));
5056
+ rows.push(row(s.name, open.items, now$1() - t0, s.options.spacing ?? 4, s.lanes));
4856
5057
  }
4857
5058
  return rows;
4858
5059
  }
@@ -4934,6 +5135,118 @@ function formatRoom(rows) {
4934
5135
  })
4935
5136
  ].join("\n");
4936
5137
  }
4937
- export { BACKTRACK_MIN, BACKTRACK_SHARE, BUILT_IN_STRATEGIES, CASES, CLEARANCE_CAP, CURVE_TYPES, CornerGraph, FIXTURES, GROWTH_SWEEP, Grid, LANE_ORDERS, OUTSIDE_SLACK, Obstacles, ROUTERS, SIDE_NORMAL, STEPS, STRATEGIES, TOLERANCE, WayFinder, allSections, arcCurve, asRouter, backtrackOf, benchCurveStrategies, benchCurves, benchOne, benchRoom, bendCount, boardGaps, boxExit, buildSections, byCollection, center, checkProperties, cornersRouter, countCrossings, countOverlaps, createRegistry, cubicAt, curveOf, curveSpace, curveStrategies, defineStrategy, denseGroupsBoard, dist, distinctPoints, findStrategy, fixedPortPoint, formatCurves, formatFaults, formatRoom, formatTable, frechet, gapLanes, getStrategy, goesOutAndBack, groupEdges, growthSettings, hubChainBoard, inflate, inflectionCount, inflectionCurve, inflectionSector, laneOrder, laneRoutes, laneSettings, listStrategies, makeFixture, makeRoom, manyGroupsBoard, measureBoard, measureLevel, measureLevelFaults, measureLinks, measureQuality, measureRouteFaults, measureStability, nearestSide, nodeIndex, offsetPolyline, openGaps, orderLanes, packedGridBoard, passSettings, pathPoints, placePlug, plugsRouter, pointBoxDistance, pointOnSide, pointSegmentDistance, polylineLength, pullApart, register, rng, roomDemand, roomLinks, roomStrategies, roundCorners, roundedCurve, routerStrategies, routersOf, runBenchmark, runKey, sameData, sampleCurve, sectionsRouter, segmentBounds, segmentBoxDistance, segmentHitsBox, segmentHitsRect, segmentsCross, segmentsOf, sharedRouter, sideAngle, sideToward, splineCurve, splitPoint, straightCurve, straightRouter, sumFaults, sweepRoom, toSvgPath, treeDepth, trunksRouter, turns };
5138
+ // src/bench/sections.ts
5139
+ const now = () => globalThis.performance?.now() ?? Date.now();
5140
+ /** This function gives the number of items of the first level with more than one item, or 0 for a result without levels. */
5141
+ function farItems(result) {
5142
+ return result.levels?.find((l) => l.items.length > 1)?.items.length ?? 0;
5143
+ }
5144
+ /**
5145
+ * This function measures the router `sections` on one board with each setting. The first row is the fair baseline: the defaults, with no option.
5146
+ * The direct routes come from the hub limit 0, so `hubRoutes` counts the routes that use the hubs.
5147
+ */
5148
+ function sweepSections(fixture, graph, settings) {
5149
+ return [{
5150
+ name: "defaults",
5151
+ options: {}
5152
+ }, ...settings].map((s) => {
5153
+ const direct = sectionsRouter({
5154
+ ...s.options,
5155
+ name: "direct",
5156
+ stretch: 0,
5157
+ stretchPad: 0
5158
+ }).route(graph);
5159
+ const t0 = now();
5160
+ const result = sectionsRouter({
5161
+ ...s.options,
5162
+ name: s.name
5163
+ }).route(graph);
5164
+ const ms = now() - t0;
5165
+ const levelFaults = measureLevelFaults(result);
5166
+ return {
5167
+ fixture,
5168
+ setting: s.name,
5169
+ faults: measureRouteFaults(graph, result),
5170
+ levelFaults: sumFaults(levelFaults),
5171
+ overlaps: levelFaults.reduce((n, f) => n + f.overlaps, 0),
5172
+ hubRoutes: result.routes.filter((r, i) => !sameData(r.points, direct.routes[i]?.points)).length,
5173
+ runs: result.runs?.length ?? 0,
5174
+ levels: result.levels?.length ?? 0,
5175
+ farItems: farItems(result),
5176
+ ms
5177
+ };
5178
+ });
5179
+ }
5180
+ /** The values of the hub limit (`stretch`) of the sweep of CUSTOM. The default is 2. */
5181
+ const STRETCH_SWEEP = [
5182
+ 1.25,
5183
+ 1.5,
5184
+ 2,
5185
+ 3,
5186
+ Infinity
5187
+ ];
5188
+ /** This function gives the settings of the sweep of the hub limit: one setting for each value of `stretch`. */
5189
+ function stretchSettings(values = STRETCH_SWEEP) {
5190
+ return values.map((stretch) => ({
5191
+ name: `stretch ${stretch}`,
5192
+ options: { stretch }
5193
+ }));
5194
+ }
5195
+ /** The values of `hubSlack` of the sweep of CUSTOM. The default is 80. */
5196
+ const SLACK_SWEEP = [
5197
+ 0,
5198
+ 40,
5199
+ 80,
5200
+ 160,
5201
+ Infinity
5202
+ ];
5203
+ /** This function gives the settings of the sweep of the slack of the hubs: one setting for each value of `hubSlack`. */
5204
+ function slackSettings(values = SLACK_SWEEP) {
5205
+ return values.map((hubSlack) => ({
5206
+ name: `hubSlack ${hubSlack}`,
5207
+ options: { hubSlack }
5208
+ }));
5209
+ }
5210
+ /** The values of the section limit (`cap`) of the sweep of CUSTOM. The default is 8. */
5211
+ const CAP_SWEEP = [
5212
+ 4,
5213
+ 6,
5214
+ 8,
5215
+ 12,
5216
+ 16
5217
+ ];
5218
+ /** This function gives the settings of the sweep of the section limit: one setting for each value of `cap`. */
5219
+ function capSettings(values = CAP_SWEEP) {
5220
+ return values.map((cap) => ({
5221
+ name: `cap ${cap}`,
5222
+ options: { cap }
5223
+ }));
5224
+ }
5225
+ /**
5226
+ * This function gives one setting for each grouping rule: the router `sections` with the strategy as its option `group`.
5227
+ * The map `options` gives the options of a strategy by its name.
5228
+ */
5229
+ function groupSettings(strategies = Object.values(groupStrategies), options = {}) {
5230
+ return strategies.map((group) => ({
5231
+ name: `group ${group.name}`,
5232
+ options: {
5233
+ group,
5234
+ ...options[group.name] ? { groupOptions: options[group.name] } : {}
5235
+ }
5236
+ }));
5237
+ }
5238
+ /** This function writes the rows of `sweepSections` as a Markdown table. */
5239
+ function formatSections(rows) {
5240
+ return [
5241
+ "| fixture | setting | through | out and back | worst detour | outside | hub routes | runs | levels | far items | level through | level out and back | level outside | level overlaps | ms |",
5242
+ "|---|---|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|",
5243
+ ...rows.map((r) => {
5244
+ const f = r.faults;
5245
+ const l = r.levelFaults;
5246
+ return `| ${r.fixture} | ${r.setting} | ${f.through} | ${f.backtrack} | ${f.worstDetour.toFixed(2)} | ${f.outside} | ${r.hubRoutes} | ${r.runs} | ${r.levels} | ${r.farItems} | ${l.through} | ${l.backtrack} | ${l.outside} | ${r.overlaps} | ${r.ms.toFixed(1)} |`;
5247
+ })
5248
+ ].join("\n");
5249
+ }
5250
+ export { BACKTRACK_MIN, BACKTRACK_SHARE, BUILT_IN_STRATEGIES, CAP_SWEEP, CASES, CLEARANCE_CAP, CURVE_TYPES, CornerGraph, FIXTURES, GROWTH_SWEEP, Grid, LANE_ORDERS, OUTSIDE_SLACK, Obstacles, PICK, ROUTERS, SECTION_DEFAULTS, SIDE_NORMAL, SLACK_SWEEP, STEPS, STRATEGIES, STRETCH_SWEEP, TOLERANCE, WayFinder, allSections, arcCurve, asRouter, backtrackOf, benchCurveStrategies, benchCurves, benchOne, benchRoom, bendCount, boardGaps, boxExit, buildSections, byCollection, byDataGroup, capSettings, center, checkProperties, checkSections, cornersRouter, countCrossings, countOverlaps, createRegistry, cubicAt, curveOf, curveSpace, curveStrategies, defineStrategy, denseGroupsBoard, dist, distinctPoints, findStrategy, fixedPortPoint, formatCurves, formatFaults, formatRoom, formatSections, formatTable, frechet, gapLanes, getStrategy, goesOutAndBack, groupEdges, groupSettings, groupStrategies, growthSettings, hubChainBoard, inflate, inflectionCount, inflectionCurve, inflectionSector, itemSizes, keyGroups, keyedSections, laneOrder, laneRoutes, laneSettings, listStrategies, makeFixture, makeRoom, manyGroupsBoard, measureBoard, measureLevel, measureLevelFaults, measureLinks, measureQuality, measureRouteFaults, measureStability, nearestSide, nodeIndex, offsetPolyline, openGaps, orderLanes, packedGridBoard, passSettings, pathPoints, pickLevel, placePlug, plugsRouter, pointBoxDistance, pointOnSide, pointSegmentDistance, polylineLength, pullApart, quadtreeGroups, register, rng, roomDemand, roomLinks, roomStrategies, roundCorners, roundedCurve, routerStrategies, routersOf, runBenchmark, runKey, sameData, sampleCurve, sectionsRouter, segmentBounds, segmentBoxDistance, segmentHitsBox, segmentHitsRect, segmentsCross, segmentsOf, sharedRouter, sideAngle, sideToward, slackSettings, splineCurve, splitPoint, straightCurve, straightRouter, stretchSettings, sumFaults, sweepRoom, sweepSections, toSvgPath, treeDepth, trunksRouter, turns };
4938
5251
 
4939
5252
  //# sourceMappingURL=index.js.map