@tscircuit/core 0.0.552 → 0.0.554

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.
Files changed (2) hide show
  1. package/dist/index.js +48 -46
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -7298,35 +7298,21 @@ var normalizePinLabels = (inputPinLabels) => {
7298
7298
  };
7299
7299
 
7300
7300
  // lib/components/primitive-components/Group/Group_doInitialSchematicLayoutMatchAdapt.ts
7301
- import "@tscircuit/schematic-match-adapt";
7302
- import "@tscircuit/schematic-match-adapt";
7303
-
7304
- // lib/utils/schematic/deriveSourceTraceIdFromMatchAdaptPath.ts
7305
- import {
7306
- getRefKey,
7307
- parseRefKey
7308
- } from "@tscircuit/schematic-match-adapt";
7309
-
7310
- // lib/components/primitive-components/Group/Group_doInitialSchematicLayoutMatchAdapt.ts
7311
- import "@tscircuit/circuit-json-util";
7312
- import "circuit-json-to-connectivity-map";
7313
7301
  import { corpusNoNetLabel } from "@tscircuit/schematic-corpus";
7302
+ import { convertCircuitJsonToBpc } from "circuit-json-to-bpc";
7314
7303
  import {
7315
- convertCircuitJsonToBpc
7316
- } from "circuit-json-to-bpc";
7317
- import {
7318
- layoutSchematicGraph,
7319
- getGraphicsForBpcGraph
7304
+ getGraphicsForBpcGraph,
7305
+ layoutSchematicGraphVariants
7320
7306
  } from "bpc-graph";
7321
- import "graphics-debug";
7322
- import "circuit-to-svg";
7323
7307
  import Debug5 from "debug";
7308
+ import { buildSubtree } from "@tscircuit/circuit-json-util";
7324
7309
  var debug4 = Debug5("Group_doInitialSchematicLayoutMatchAdapt");
7325
7310
  function Group_doInitialSchematicLayoutMatchAdapt(group) {
7326
7311
  const { db } = group.root;
7327
- const subtreeCircuitJson = structuredClone(db.toArray());
7312
+ const subtreeCircuitJson = buildSubtree(db.toArray(), {
7313
+ source_group_id: group.source_group_id
7314
+ });
7328
7315
  const bpcGraphBeforeGeneratedNetLabels = convertCircuitJsonToBpc(subtreeCircuitJson);
7329
- console.log("Writing bpcGraphBeforeGeneratedNetLabels.svg");
7330
7316
  if (debug4.enabled) {
7331
7317
  global.debugGraphics?.push(
7332
7318
  getGraphicsForBpcGraph(bpcGraphBeforeGeneratedNetLabels, {
@@ -7334,29 +7320,45 @@ function Group_doInitialSchematicLayoutMatchAdapt(group) {
7334
7320
  })
7335
7321
  );
7336
7322
  }
7337
- const targetBpcGraph = convertCircuitJsonToBpc(
7323
+ const floatingGraph = convertCircuitJsonToBpc(
7338
7324
  subtreeCircuitJson
7339
7325
  // .concat(implicitNetLabels),
7340
7326
  );
7341
- const laidOutBpcGraph = layoutSchematicGraph(targetBpcGraph, {
7342
- singletonKeys: ["vcc/2", "gnd/2"],
7343
- centerPinColors: ["netlabel_center", "component_center"],
7344
- floatingBoxIdsWithMutablePinOffsets: new Set(
7345
- targetBpcGraph.boxes.filter((box) => {
7346
- const boxPins = targetBpcGraph.pins.filter(
7347
- (p) => p.boxId === box.boxId
7348
- );
7349
- const nonCenterBoxPins = boxPins.filter(
7350
- (bp) => !bp.color.includes("center")
7351
- );
7352
- if (nonCenterBoxPins.length <= 2) {
7353
- return true;
7354
- }
7355
- return false;
7356
- }).map((b) => b.boxId)
7357
- ),
7358
- corpus: corpusNoNetLabel
7359
- });
7327
+ const floatingGraphNoNotConnected = {
7328
+ boxes: floatingGraph.boxes,
7329
+ pins: floatingGraph.pins.map((p) => ({
7330
+ ...p,
7331
+ color: p.color.replace("not_connected", "normal")
7332
+ }))
7333
+ };
7334
+ const { result: laidOutBpcGraph } = layoutSchematicGraphVariants(
7335
+ [
7336
+ { variantName: "default", floatingGraph },
7337
+ {
7338
+ variantName: "noNotConnected",
7339
+ floatingGraph: floatingGraphNoNotConnected
7340
+ }
7341
+ ],
7342
+ {
7343
+ singletonKeys: ["vcc/2", "gnd/2"],
7344
+ centerPinColors: ["netlabel_center", "component_center"],
7345
+ floatingBoxIdsWithMutablePinOffsets: new Set(
7346
+ floatingGraph.boxes.filter((box) => {
7347
+ const boxPins = floatingGraph.pins.filter(
7348
+ (p) => p.boxId === box.boxId
7349
+ );
7350
+ const nonCenterBoxPins = boxPins.filter(
7351
+ (bp) => !bp.color.includes("center")
7352
+ );
7353
+ if (nonCenterBoxPins.length <= 2) {
7354
+ return true;
7355
+ }
7356
+ return false;
7357
+ }).map((b) => b.boxId)
7358
+ ),
7359
+ corpus: corpusNoNetLabel
7360
+ }
7361
+ );
7360
7362
  if (debug4.enabled) {
7361
7363
  global.debugGraphics?.push(
7362
7364
  getGraphicsForBpcGraph(laidOutBpcGraph, {
@@ -7420,12 +7422,12 @@ function Group_doInitialSchematicLayoutMatchAdapt(group) {
7420
7422
  }
7421
7423
 
7422
7424
  // lib/components/primitive-components/Group/Group_doInitialSourceAddConnectivityMapKey.ts
7423
- import { ConnectivityMap as ConnectivityMap3 } from "circuit-json-to-connectivity-map";
7425
+ import { ConnectivityMap as ConnectivityMap2 } from "circuit-json-to-connectivity-map";
7424
7426
  function Group_doInitialSourceAddConnectivityMapKey(group) {
7425
7427
  if (!group.isSubcircuit) return;
7426
7428
  const { db } = group.root;
7427
7429
  const traces = group.selectAll("trace");
7428
- const connMap = new ConnectivityMap3({});
7430
+ const connMap = new ConnectivityMap2({});
7429
7431
  connMap.addConnections(
7430
7432
  traces.map((t) => {
7431
7433
  const source_trace = db.source_trace.get(
@@ -10714,7 +10716,7 @@ import { identity as identity5 } from "transformation-matrix";
10714
10716
  var package_default = {
10715
10717
  name: "@tscircuit/core",
10716
10718
  type: "module",
10717
- version: "0.0.551",
10719
+ version: "0.0.553",
10718
10720
  types: "dist/index.d.ts",
10719
10721
  main: "dist/index.js",
10720
10722
  module: "dist/index.js",
@@ -10739,7 +10741,7 @@ var package_default = {
10739
10741
  "@biomejs/biome": "^1.8.3",
10740
10742
  "@tscircuit/capacity-autorouter": "^0.0.93",
10741
10743
  "@tscircuit/checks": "^0.0.52",
10742
- "@tscircuit/circuit-json-util": "^0.0.50",
10744
+ "@tscircuit/circuit-json-util": "^0.0.51",
10743
10745
  "@tscircuit/footprinter": "^0.0.189",
10744
10746
  "@tscircuit/import-snippet": "^0.0.4",
10745
10747
  "@tscircuit/infgrid-ijump-astar": "^0.0.33",
@@ -10756,7 +10758,7 @@ var package_default = {
10756
10758
  "@types/react": "^19.0.1",
10757
10759
  "@types/react-dom": "^19.0.2",
10758
10760
  "@types/react-reconciler": "^0.28.9",
10759
- "bpc-graph": "^0.0.53",
10761
+ "bpc-graph": "^0.0.57",
10760
10762
  "bun-match-svg": "0.0.12",
10761
10763
  "calculate-elbow": "^0.0.5",
10762
10764
  "chokidar-cli": "^3.0.0",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.552",
4
+ "version": "0.0.554",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -26,7 +26,7 @@
26
26
  "@biomejs/biome": "^1.8.3",
27
27
  "@tscircuit/capacity-autorouter": "^0.0.93",
28
28
  "@tscircuit/checks": "^0.0.52",
29
- "@tscircuit/circuit-json-util": "^0.0.50",
29
+ "@tscircuit/circuit-json-util": "^0.0.51",
30
30
  "@tscircuit/footprinter": "^0.0.189",
31
31
  "@tscircuit/import-snippet": "^0.0.4",
32
32
  "@tscircuit/infgrid-ijump-astar": "^0.0.33",
@@ -43,7 +43,7 @@
43
43
  "@types/react": "^19.0.1",
44
44
  "@types/react-dom": "^19.0.2",
45
45
  "@types/react-reconciler": "^0.28.9",
46
- "bpc-graph": "^0.0.53",
46
+ "bpc-graph": "^0.0.57",
47
47
  "bun-match-svg": "0.0.12",
48
48
  "calculate-elbow": "^0.0.5",
49
49
  "chokidar-cli": "^3.0.0",