circuit-to-svg 0.0.315 → 0.0.317
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 +44 -4
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -6042,7 +6042,7 @@ function getSoftwareUsedString(circuitJson) {
|
|
|
6042
6042
|
var package_default = {
|
|
6043
6043
|
name: "circuit-to-svg",
|
|
6044
6044
|
type: "module",
|
|
6045
|
-
version: "0.0.
|
|
6045
|
+
version: "0.0.316",
|
|
6046
6046
|
description: "Convert Circuit JSON to SVG",
|
|
6047
6047
|
main: "dist/index.js",
|
|
6048
6048
|
files: [
|
|
@@ -6065,7 +6065,7 @@ var package_default = {
|
|
|
6065
6065
|
"@vitejs/plugin-react": "5.0.0",
|
|
6066
6066
|
biome: "^0.3.3",
|
|
6067
6067
|
"bun-match-svg": "^0.0.12",
|
|
6068
|
-
"circuit-json": "^0.0.
|
|
6068
|
+
"circuit-json": "^0.0.359",
|
|
6069
6069
|
esbuild: "^0.20.2",
|
|
6070
6070
|
"performance-now": "^2.1.0",
|
|
6071
6071
|
react: "19.1.0",
|
|
@@ -10783,7 +10783,7 @@ var createSvgObjectsFromSchematicComponentWithSymbol = ({
|
|
|
10783
10783
|
);
|
|
10784
10784
|
let textValue = "";
|
|
10785
10785
|
if (text.text === "{REF}") {
|
|
10786
|
-
textValue = srcComponent?.name ?? "";
|
|
10786
|
+
textValue = srcComponent?.display_name ?? srcComponent?.name ?? "";
|
|
10787
10787
|
} else if (text.text === "{VAL}") {
|
|
10788
10788
|
textValue = schComponent.symbol_display_value ?? "";
|
|
10789
10789
|
}
|
|
@@ -10963,6 +10963,8 @@ var createSvgObjectsForSchPortBoxLine = ({
|
|
|
10963
10963
|
const screenSchPortPos = applyToPoint57(transform, schPort.center);
|
|
10964
10964
|
const screenRealEdgePos = applyToPoint57(transform, realEdgePos);
|
|
10965
10965
|
const isConnected = isSourcePortConnected(circuitJson, schPort.source_port_id);
|
|
10966
|
+
const is_drawn_with_inversion_circle = schPort.is_drawn_with_inversion_circle ?? false;
|
|
10967
|
+
const BUBBLE_RADIUS_MM = 0.06;
|
|
10966
10968
|
const realLineEnd = { ...schPort.center };
|
|
10967
10969
|
if (!isConnected) {
|
|
10968
10970
|
switch (schPort.side_of_component) {
|
|
@@ -10981,6 +10983,43 @@ var createSvgObjectsForSchPortBoxLine = ({
|
|
|
10981
10983
|
}
|
|
10982
10984
|
}
|
|
10983
10985
|
const screenLineEnd = applyToPoint57(transform, realLineEnd);
|
|
10986
|
+
if (is_drawn_with_inversion_circle) {
|
|
10987
|
+
const bubbleRadiusPx = Math.abs(transform.a) * BUBBLE_RADIUS_MM;
|
|
10988
|
+
const bubbleCenter = { ...screenRealEdgePos };
|
|
10989
|
+
switch (schPort.side_of_component) {
|
|
10990
|
+
case "left":
|
|
10991
|
+
bubbleCenter.x -= bubbleRadiusPx;
|
|
10992
|
+
screenRealEdgePos.x -= bubbleRadiusPx * 2;
|
|
10993
|
+
break;
|
|
10994
|
+
case "right":
|
|
10995
|
+
bubbleCenter.x += bubbleRadiusPx;
|
|
10996
|
+
screenRealEdgePos.x += bubbleRadiusPx * 2;
|
|
10997
|
+
break;
|
|
10998
|
+
case "top":
|
|
10999
|
+
bubbleCenter.y -= bubbleRadiusPx;
|
|
11000
|
+
screenRealEdgePos.y -= bubbleRadiusPx * 2;
|
|
11001
|
+
break;
|
|
11002
|
+
case "bottom":
|
|
11003
|
+
bubbleCenter.y += bubbleRadiusPx;
|
|
11004
|
+
screenRealEdgePos.y += bubbleRadiusPx * 2;
|
|
11005
|
+
break;
|
|
11006
|
+
}
|
|
11007
|
+
svgObjects.push({
|
|
11008
|
+
name: "circle",
|
|
11009
|
+
type: "element",
|
|
11010
|
+
attributes: {
|
|
11011
|
+
class: "component-pin",
|
|
11012
|
+
cx: bubbleCenter.x.toString(),
|
|
11013
|
+
cy: bubbleCenter.y.toString(),
|
|
11014
|
+
r: bubbleRadiusPx.toString(),
|
|
11015
|
+
fill: "white",
|
|
11016
|
+
stroke: colorMap.schematic.component_outline,
|
|
11017
|
+
"stroke-width": `${getSchStrokeSize(transform)}px`
|
|
11018
|
+
},
|
|
11019
|
+
value: "",
|
|
11020
|
+
children: []
|
|
11021
|
+
});
|
|
11022
|
+
}
|
|
10984
11023
|
svgObjects.push({
|
|
10985
11024
|
name: "line",
|
|
10986
11025
|
type: "element",
|
|
@@ -11168,9 +11207,10 @@ var createSvgObjectsForSchPortPinLabel = (params) => {
|
|
|
11168
11207
|
if (!label) return [];
|
|
11169
11208
|
const isNegated = label.startsWith("N_");
|
|
11170
11209
|
const displayLabel = isNegated ? label.slice(2) : label;
|
|
11210
|
+
const is_drawn_with_inversion_circle = schPort.is_drawn_with_inversion_circle ?? false;
|
|
11171
11211
|
let fontSizePx = getSchScreenFontSize(
|
|
11172
11212
|
transform,
|
|
11173
|
-
isNegated ? "negated_pin_number" : "pin_number"
|
|
11213
|
+
isNegated || is_drawn_with_inversion_circle ? "negated_pin_number" : "pin_number"
|
|
11174
11214
|
);
|
|
11175
11215
|
svgObjects.push({
|
|
11176
11216
|
name: "text",
|