@tscircuit/matchpack 0.0.18 → 0.0.19

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 +13 -2
  2. package/package.json +3 -1
package/dist/index.js CHANGED
@@ -95,6 +95,10 @@ function getRotatedDimensions(width, height, rotation) {
95
95
  }
96
96
  return { width, height };
97
97
  }
98
+ function getChipLabelFontSize(width, height) {
99
+ const smallerDimension = Math.min(width, height);
100
+ return Math.min(0.35, Math.max(0.08, smallerDimension * 0.22));
101
+ }
98
102
  function visualizeInputProblem(inputProblem, basicLayout) {
99
103
  const inputViz = {
100
104
  points: [],
@@ -138,9 +142,16 @@ function visualizeInputProblem(inputProblem, basicLayout) {
138
142
  center: { x: chipCenterX, y: chipCenterY },
139
143
  width: rotatedDims.width,
140
144
  height: rotatedDims.height,
141
- label: chipId
145
+ label: chipId,
146
+ fill: "rgba(59, 130, 246, 0.12)",
147
+ stroke: "none"
148
+ });
149
+ inputViz.texts.push({
150
+ x: chipCenterX,
151
+ y: chipCenterY,
152
+ text: chipId,
153
+ fontSize: getChipLabelFontSize(rotatedDims.width, rotatedDims.height)
142
154
  });
143
- inputViz.texts.push({ x: chipCenterX, y: chipCenterY, text: chipId });
144
155
  for (const pin of chipPins) {
145
156
  const rotatedOffset = rotatePoint(
146
157
  pin.offset,
package/package.json CHANGED
@@ -2,12 +2,13 @@
2
2
  "name": "@tscircuit/matchpack",
3
3
  "main": "dist/index.js",
4
4
  "type": "module",
5
- "version": "0.0.18",
5
+ "version": "0.0.19",
6
6
  "files": [
7
7
  "dist"
8
8
  ],
9
9
  "scripts": {
10
10
  "start": "cosmos",
11
+ "test": "bun test",
11
12
  "build": "tsup-node --format esm --dts --clean ./lib/index.ts",
12
13
  "format": "biome format --write .",
13
14
  "format:check": "biome format .",
@@ -20,6 +21,7 @@
20
21
  "@tscircuit/math-utils": "^0.0.36",
21
22
  "@tscircuit/schematic-viewer": "^2.0.61",
22
23
  "@types/bun": "^1.3.14",
24
+ "bun-match-svg": "^0.0.15",
23
25
  "bpc-graph": "^0.0.66",
24
26
  "calculate-packing": "^0.0.74",
25
27
  "circuit-json": "^0.0.432",