circuit-json-to-tscircuit 0.0.89 → 0.0.90

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.
@@ -1471,11 +1471,16 @@ var convertNetLabels = (circuitJson) => su4(circuitJson).schematic_net_label.lis
1471
1471
  // lib/generate-board-schematic-tsx/convert-traces.ts
1472
1472
  import { su as su5 } from "@tscircuit/soup-util";
1473
1473
  var SCHEMATIC_WIRE_COLOR = "#009600";
1474
+ var SCHEMATIC_WIRE_STROKE_WIDTH = 0.02;
1474
1475
  var convertTraces = (circuitJson) => su5(circuitJson).schematic_trace.list().flatMap((schematicTrace) => [
1475
1476
  ...schematicTrace.edges.map(
1476
- (edge) => formatElement("schematicpath", {
1477
- points: [edge.from, edge.to],
1478
- strokeColor: SCHEMATIC_WIRE_COLOR
1477
+ (edge) => formatElement("schematicline", {
1478
+ x1: edge.from.x,
1479
+ y1: edge.from.y,
1480
+ x2: edge.to.x,
1481
+ y2: edge.to.y,
1482
+ strokeWidth: SCHEMATIC_WIRE_STROKE_WIDTH,
1483
+ color: SCHEMATIC_WIRE_COLOR
1479
1484
  })
1480
1485
  ),
1481
1486
  ...schematicTrace.junctions.map(
@@ -1493,10 +1498,10 @@ var convertTraces = (circuitJson) => su5(circuitJson).schematic_trace.list().fla
1493
1498
  // lib/generate-board-schematic-tsx.ts
1494
1499
  var generateBoardSchematicElements = (circuitJson) => {
1495
1500
  return [
1501
+ ...convertTraces(circuitJson),
1496
1502
  ...convertComponents(circuitJson),
1497
1503
  ...convertNetLabels(circuitJson),
1498
1504
  ...convertPrimitives(circuitJson),
1499
- ...convertTraces(circuitJson),
1500
1505
  ...convertSchematicGraphics(circuitJson)
1501
1506
  ];
1502
1507
  };
package/dist/cli/main.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  convertCircuitJsonToTscircuit
4
- } from "../chunk-GVGY3ZZN.js";
4
+ } from "../chunk-W3VYZ3FO.js";
5
5
 
6
6
  // cli/main.ts
7
7
  import { Command } from "commander";
@@ -16,7 +16,7 @@ var package_default = {
16
16
  "./cli": "./dist/cli/main.js"
17
17
  },
18
18
  type: "module",
19
- version: "0.0.88",
19
+ version: "0.0.89",
20
20
  repository: {
21
21
  type: "git",
22
22
  url: "https://github.com/tscircuit/circuit-json-to-tscircuit.git"
package/dist/lib/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  convertCircuitJsonToTscircuit
3
- } from "../chunk-GVGY3ZZN.js";
3
+ } from "../chunk-W3VYZ3FO.js";
4
4
  export {
5
5
  convertCircuitJsonToTscircuit
6
6
  };
@@ -3,15 +3,20 @@ import type { SchematicElementConverter } from "./converter-types"
3
3
  import { formatElement } from "./format-attributes"
4
4
 
5
5
  const SCHEMATIC_WIRE_COLOR = "#009600"
6
+ const SCHEMATIC_WIRE_STROKE_WIDTH = 0.02
6
7
 
7
8
  export const convertTraces: SchematicElementConverter = (circuitJson) =>
8
9
  su(circuitJson)
9
10
  .schematic_trace.list()
10
11
  .flatMap((schematicTrace) => [
11
12
  ...schematicTrace.edges.map((edge) =>
12
- formatElement("schematicpath", {
13
- points: [edge.from, edge.to],
14
- strokeColor: SCHEMATIC_WIRE_COLOR,
13
+ formatElement("schematicline", {
14
+ x1: edge.from.x,
15
+ y1: edge.from.y,
16
+ x2: edge.to.x,
17
+ y2: edge.to.y,
18
+ strokeWidth: SCHEMATIC_WIRE_STROKE_WIDTH,
19
+ color: SCHEMATIC_WIRE_COLOR,
15
20
  }),
16
21
  ),
17
22
  ...schematicTrace.junctions.map((center) =>
@@ -18,10 +18,10 @@ export const generateBoardSchematicElements = (
18
18
  circuitJson: AnyCircuitElement[],
19
19
  ): string[] => {
20
20
  return [
21
+ ...convertTraces(circuitJson),
21
22
  ...convertComponents(circuitJson),
22
23
  ...convertNetLabels(circuitJson),
23
24
  ...convertPrimitives(circuitJson),
24
- ...convertTraces(circuitJson),
25
25
  ...convertSchematicGraphics(circuitJson),
26
26
  ]
27
27
  }
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "./cli": "./dist/cli/main.js"
7
7
  },
8
8
  "type": "module",
9
- "version": "0.0.89",
9
+ "version": "0.0.90",
10
10
  "repository": {
11
11
  "type": "git",
12
12
  "url": "https://github.com/tscircuit/circuit-json-to-tscircuit.git"