circuit-to-svg 0.0.268 → 0.0.269
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 +58 -19
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3963,7 +3963,7 @@ function getSoftwareUsedString(circuitJson) {
|
|
|
3963
3963
|
var package_default = {
|
|
3964
3964
|
name: "circuit-to-svg",
|
|
3965
3965
|
type: "module",
|
|
3966
|
-
version: "0.0.
|
|
3966
|
+
version: "0.0.268",
|
|
3967
3967
|
description: "Convert Circuit JSON to SVG",
|
|
3968
3968
|
main: "dist/index.js",
|
|
3969
3969
|
files: [
|
|
@@ -8914,12 +8914,59 @@ function createSvgObjectsFromSchVoltageProbe({
|
|
|
8914
8914
|
`L ${tipX - arrowWidth * Math.cos((-50 + 210) * Math.PI / 180)},${tipY - arrowWidth * Math.sin((-50 + 210) * Math.PI / 180)}`,
|
|
8915
8915
|
"Z"
|
|
8916
8916
|
].join(" ");
|
|
8917
|
-
const
|
|
8918
|
-
|
|
8919
|
-
|
|
8920
|
-
|
|
8921
|
-
|
|
8922
|
-
|
|
8917
|
+
const x = (baseX + 8 - (baseX - baseX)).toString();
|
|
8918
|
+
const textChildren = [];
|
|
8919
|
+
if (probe.name && probe.voltage !== void 0) {
|
|
8920
|
+
textChildren.push({
|
|
8921
|
+
type: "element",
|
|
8922
|
+
name: "tspan",
|
|
8923
|
+
value: "",
|
|
8924
|
+
attributes: {
|
|
8925
|
+
x
|
|
8926
|
+
},
|
|
8927
|
+
children: [
|
|
8928
|
+
{
|
|
8929
|
+
type: "text",
|
|
8930
|
+
value: probe.name,
|
|
8931
|
+
name: "",
|
|
8932
|
+
attributes: {},
|
|
8933
|
+
children: []
|
|
8934
|
+
}
|
|
8935
|
+
]
|
|
8936
|
+
});
|
|
8937
|
+
textChildren.push({
|
|
8938
|
+
type: "element",
|
|
8939
|
+
name: "tspan",
|
|
8940
|
+
value: "",
|
|
8941
|
+
attributes: {
|
|
8942
|
+
x,
|
|
8943
|
+
dy: "1.2em"
|
|
8944
|
+
},
|
|
8945
|
+
children: [
|
|
8946
|
+
{
|
|
8947
|
+
type: "text",
|
|
8948
|
+
value: `${probe.voltage}V`,
|
|
8949
|
+
name: "",
|
|
8950
|
+
attributes: {},
|
|
8951
|
+
children: []
|
|
8952
|
+
}
|
|
8953
|
+
]
|
|
8954
|
+
});
|
|
8955
|
+
} else {
|
|
8956
|
+
const textParts = [];
|
|
8957
|
+
if (probe.name) {
|
|
8958
|
+
textParts.push(probe.name);
|
|
8959
|
+
}
|
|
8960
|
+
if (probe.voltage !== void 0) {
|
|
8961
|
+
textParts.push(`${probe.voltage}V`);
|
|
8962
|
+
}
|
|
8963
|
+
textChildren.push({
|
|
8964
|
+
type: "text",
|
|
8965
|
+
value: textParts.join(" "),
|
|
8966
|
+
name: "",
|
|
8967
|
+
attributes: {},
|
|
8968
|
+
children: []
|
|
8969
|
+
});
|
|
8923
8970
|
}
|
|
8924
8971
|
return [
|
|
8925
8972
|
{
|
|
@@ -8939,25 +8986,17 @@ function createSvgObjectsFromSchVoltageProbe({
|
|
|
8939
8986
|
name: "text",
|
|
8940
8987
|
value: "",
|
|
8941
8988
|
attributes: {
|
|
8942
|
-
x
|
|
8943
|
-
y:
|
|
8989
|
+
x,
|
|
8990
|
+
y: baseY.toString(),
|
|
8944
8991
|
fill: colorMap2.schematic.reference,
|
|
8945
|
-
"text-anchor": "
|
|
8992
|
+
"text-anchor": "start",
|
|
8946
8993
|
"dominant-baseline": "middle",
|
|
8947
8994
|
"font-family": "sans-serif",
|
|
8948
8995
|
"font-size": `${getSchScreenFontSize(transform, "reference_designator")}px`,
|
|
8949
8996
|
"font-weight": "bold",
|
|
8950
8997
|
"data-schematic-voltage-probe-id": probe.schematic_voltage_probe_id
|
|
8951
8998
|
},
|
|
8952
|
-
children:
|
|
8953
|
-
{
|
|
8954
|
-
type: "text",
|
|
8955
|
-
value: textParts.join(" "),
|
|
8956
|
-
name: "",
|
|
8957
|
-
attributes: {},
|
|
8958
|
-
children: []
|
|
8959
|
-
}
|
|
8960
|
-
]
|
|
8999
|
+
children: textChildren
|
|
8961
9000
|
}
|
|
8962
9001
|
];
|
|
8963
9002
|
}
|