@tscircuit/matchpack 0.0.19 → 0.0.20
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 +9 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -99,6 +99,14 @@ function getChipLabelFontSize(width, height) {
|
|
|
99
99
|
const smallerDimension = Math.min(width, height);
|
|
100
100
|
return Math.min(0.35, Math.max(0.08, smallerDimension * 0.22));
|
|
101
101
|
}
|
|
102
|
+
function getChipFillColor(chipId) {
|
|
103
|
+
const chipType = chipId.charAt(0).toUpperCase();
|
|
104
|
+
if (chipType === "C") return "rgba(59, 130, 246, 0.18)";
|
|
105
|
+
if (chipType === "R") return "rgba(16, 185, 129, 0.18)";
|
|
106
|
+
if (chipType === "L") return "rgba(168, 85, 247, 0.18)";
|
|
107
|
+
if (chipType === "U") return "rgba(245, 158, 11, 0.18)";
|
|
108
|
+
return "rgba(59, 130, 246, 0.12)";
|
|
109
|
+
}
|
|
102
110
|
function visualizeInputProblem(inputProblem, basicLayout) {
|
|
103
111
|
const inputViz = {
|
|
104
112
|
points: [],
|
|
@@ -143,7 +151,7 @@ function visualizeInputProblem(inputProblem, basicLayout) {
|
|
|
143
151
|
width: rotatedDims.width,
|
|
144
152
|
height: rotatedDims.height,
|
|
145
153
|
label: chipId,
|
|
146
|
-
fill:
|
|
154
|
+
fill: getChipFillColor(chipId),
|
|
147
155
|
stroke: "none"
|
|
148
156
|
});
|
|
149
157
|
inputViz.texts.push({
|