circuit-to-svg 0.0.166 → 0.0.167

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.js CHANGED
@@ -1446,7 +1446,7 @@ function getSoftwareUsedString(circuitJson) {
1446
1446
  var package_default = {
1447
1447
  name: "circuit-to-svg",
1448
1448
  type: "module",
1449
- version: "0.0.165",
1449
+ version: "0.0.166",
1450
1450
  description: "Convert Circuit JSON to SVG",
1451
1451
  main: "dist/index.js",
1452
1452
  files: [
@@ -1477,7 +1477,7 @@ var package_default = {
1477
1477
  "@tscircuit/plop": "^0.0.10",
1478
1478
  "@types/bun": "^1.2.8",
1479
1479
  biome: "^0.3.3",
1480
- "bun-match-svg": "^0.0.6",
1480
+ "bun-match-svg": "^0.0.12",
1481
1481
  "circuit-json": "^0.0.218",
1482
1482
  esbuild: "^0.20.2",
1483
1483
  "performance-now": "^2.1.0",
@@ -4532,21 +4532,45 @@ var createSvgObjectsForSchPortBoxLine = ({
4532
4532
  children: []
4533
4533
  });
4534
4534
  const isConnected = isSourcePortConnected(circuitJson, schPort.source_port_id);
4535
+ const pinRadiusPx = Math.abs(transform.a) * PIN_CIRCLE_RADIUS_MM;
4536
+ const pinChildren = [];
4535
4537
  if (!isConnected) {
4536
- svgObjects.push({
4538
+ pinChildren.push({
4537
4539
  name: "circle",
4538
4540
  type: "element",
4539
4541
  attributes: {
4540
4542
  class: "component-pin",
4541
4543
  cx: screenSchPortPos.x.toString(),
4542
4544
  cy: screenSchPortPos.y.toString(),
4543
- r: (Math.abs(transform.a) * PIN_CIRCLE_RADIUS_MM).toString(),
4545
+ r: pinRadiusPx.toString(),
4544
4546
  "stroke-width": `${getSchStrokeSize(transform)}px`
4545
4547
  },
4546
4548
  value: "",
4547
4549
  children: []
4548
4550
  });
4549
4551
  }
4552
+ pinChildren.push({
4553
+ name: "rect",
4554
+ type: "element",
4555
+ attributes: {
4556
+ x: (screenSchPortPos.x - pinRadiusPx).toString(),
4557
+ y: (screenSchPortPos.y - pinRadiusPx).toString(),
4558
+ width: (pinRadiusPx * 2).toString(),
4559
+ height: (pinRadiusPx * 2).toString(),
4560
+ opacity: "0"
4561
+ },
4562
+ value: "",
4563
+ children: []
4564
+ });
4565
+ svgObjects.push({
4566
+ name: "g",
4567
+ type: "element",
4568
+ value: "",
4569
+ attributes: {
4570
+ "data-schematic-port-id": schPort.source_port_id
4571
+ },
4572
+ children: pinChildren
4573
+ });
4550
4574
  return svgObjects;
4551
4575
  };
4552
4576