@tscircuit/capacity-autorouter 0.0.98 → 0.0.100

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/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as graphics_debug from 'graphics-debug';
2
- import { GraphicsObject } from 'graphics-debug';
2
+ import { GraphicsObject, Rect, Circle, Line, Point as Point$3 } from 'graphics-debug';
3
3
  import { ConnectivityMap } from 'circuit-json-to-connectivity-map';
4
4
 
5
5
  type TraceId = string;
@@ -2074,4 +2074,11 @@ declare function getGlobalLocalStorageCache(): LocalStorageCache;
2074
2074
  declare function getGlobalInMemoryCache(): InMemoryCache;
2075
2075
  declare function setupGlobalCaches(): void;
2076
2076
 
2077
- export { type CachableSolver, type CacheProvider, CapacityMeshSolver, InMemoryCache, LocalStorageCache, calculateOptimalCapacityDepth, getGlobalInMemoryCache, getGlobalLocalStorageCache, getTunedTotalCapacity1, setupGlobalCaches };
2077
+ declare const convertSrjToGraphicsObject: (srj: SimpleRouteJson) => {
2078
+ rects: Rect[];
2079
+ circles: Circle[];
2080
+ lines: Line[];
2081
+ points: Point$3[];
2082
+ };
2083
+
2084
+ export { type CachableSolver, type CacheProvider, CapacityMeshSolver, InMemoryCache, LocalStorageCache, calculateOptimalCapacityDepth, convertSrjToGraphicsObject, getGlobalInMemoryCache, getGlobalLocalStorageCache, getTunedTotalCapacity1, setupGlobalCaches };
package/dist/index.js CHANGED
@@ -10149,7 +10149,7 @@ var MultipleHighDensityRouteStitchSolver = class extends BaseSolver {
10149
10149
  }
10150
10150
  };
10151
10151
 
10152
- // tests/fixtures/convertSrjToGraphicsObject.ts
10152
+ // lib/utils/convertSrjToGraphicsObject.ts
10153
10153
  var convertSrjToGraphicsObject = (srj) => {
10154
10154
  const lines = [];
10155
10155
  const circles = [];
@@ -15760,6 +15760,12 @@ var CapacityMeshEdgeSolver = class extends BaseSolver {
15760
15760
  return node1.availableZ.some((z) => node2.availableZ.includes(z));
15761
15761
  }
15762
15762
  visualize() {
15763
+ const edgeCount = /* @__PURE__ */ new Map();
15764
+ for (const edge of this.edges) {
15765
+ for (const nodeId of edge.nodeIds) {
15766
+ edgeCount.set(nodeId, 1 + (edgeCount.get(nodeId) ?? 0));
15767
+ }
15768
+ }
15763
15769
  const graphics = {
15764
15770
  lines: [],
15765
15771
  points: [],
@@ -15781,7 +15787,8 @@ var CapacityMeshEdgeSolver = class extends BaseSolver {
15781
15787
  node.capacityMeshNodeId,
15782
15788
  `availableZ: ${node.availableZ.join(",")}`,
15783
15789
  `target? ${node._containsTarget ?? false}`,
15784
- `obs? ${node._containsObstacle ?? false}`
15790
+ `obs? ${node._containsObstacle ?? false}`,
15791
+ `conn: ${edgeCount.get(node.capacityMeshNodeId) ?? 0}`
15785
15792
  ].join("\n"),
15786
15793
  layer: `z${node.availableZ.join(",")}`
15787
15794
  };
@@ -15927,6 +15934,12 @@ var DeadEndSolver = class extends BaseSolver {
15927
15934
  this.nodeMap.set(node.capacityMeshNodeId, node);
15928
15935
  }
15929
15936
  }
15937
+ const edgeCount = /* @__PURE__ */ new Map();
15938
+ for (const edge of this.edges) {
15939
+ for (const nodeId of edge.nodeIds) {
15940
+ edgeCount.set(nodeId, 1 + (edgeCount.get(nodeId) ?? 0));
15941
+ }
15942
+ }
15930
15943
  const graphics = {
15931
15944
  lines: [],
15932
15945
  points: [],
@@ -15948,7 +15961,8 @@ var DeadEndSolver = class extends BaseSolver {
15948
15961
  node.capacityMeshNodeId,
15949
15962
  `availableZ: ${node.availableZ.join(",")}`,
15950
15963
  `target? ${node._containsTarget ?? false}`,
15951
- `obs? ${node._containsObstacle ?? false}`
15964
+ `obs? ${node._containsObstacle ?? false}`,
15965
+ `conn: ${edgeCount.get(node.capacityMeshNodeId) ?? 0}`
15952
15966
  ].join("\n"),
15953
15967
  layer: `z${node.availableZ.join(",")}`
15954
15968
  };
@@ -17069,6 +17083,7 @@ export {
17069
17083
  InMemoryCache,
17070
17084
  LocalStorageCache,
17071
17085
  calculateOptimalCapacityDepth,
17086
+ convertSrjToGraphicsObject,
17072
17087
  getGlobalInMemoryCache,
17073
17088
  getGlobalLocalStorageCache,
17074
17089
  getTunedTotalCapacity1,