@tscircuit/schematic-trace-solver 0.0.25 → 0.0.27
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/.github/workflows/bun-test.yml +8 -0
- package/README.md +28 -0
- package/bunfig.toml +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +31 -6136
- package/lib/solvers/NetLabelPlacementSolver/NetLabelPlacementSolver.ts +0 -1
- package/lib/solvers/NetLabelPlacementSolver/SingleNetLabelPlacementSolver/SingleNetLabelPlacementSolver.ts +11 -0
- package/lib/solvers/NetLabelPlacementSolver/SingleNetLabelPlacementSolver/SingleNetLabelPlacementSolver_visualize.ts +0 -1
- package/lib/solvers/SchematicTraceLinesSolver/SchematicTraceLinesSolver.ts +0 -2
- package/lib/solvers/SchematicTraceLinesSolver/SchematicTraceSingleLineSolver/SchematicTraceSingleLineSolver.ts +0 -1
- package/lib/solvers/TraceOverlapShiftSolver/TraceOverlapIssueSolver/TraceOverlapIssueSolver.ts +0 -2
- package/lib/solvers/TraceOverlapShiftSolver/TraceOverlapShiftSolver.ts +0 -1
- package/package.json +6 -7
- package/site/SingleNetLabelPlacementSolver/SingleNetLabelPlacementSolver01.page.tsx +574 -0
- package/site/components/DownloadDropdown.tsx +4 -2
- package/site/examples/example01-basic.page.tsx +1 -1
- package/site/examples/example02.page.tsx +1 -1
- package/site/examples/example03.page.tsx +1 -1
- package/site/examples/example04-single-symbol.page.tsx +1 -1
- package/site/examples/example05.page.tsx +1 -1
- package/site/examples/example06.page.tsx +1 -1
- package/site/examples/example07.page.tsx +1 -1
- package/site/examples/example08.page.tsx +1 -1
- package/site/examples/example09.page.tsx +1 -1
- package/site/examples/example10.page.tsx +1 -1
- package/site/examples/example11.page.tsx +1 -1
- package/site/examples/example12.page.tsx +1 -1
- package/site/examples/example13.page.tsx +219 -0
- package/site/examples/example14.page.tsx +210 -0
- package/tests/__snapshots__/svg.snap.svg +3 -0
- package/tests/examples/__snapshots__/example01.snap.svg +157 -0
- package/tests/examples/__snapshots__/example02.snap.svg +262 -0
- package/tests/examples/__snapshots__/example03.snap.svg +282 -0
- package/tests/examples/__snapshots__/example04.snap.svg +87 -0
- package/tests/examples/__snapshots__/example05.snap.svg +190 -0
- package/tests/examples/__snapshots__/example06.snap.svg +94 -0
- package/tests/examples/__snapshots__/example07.snap.svg +204 -0
- package/tests/examples/__snapshots__/example08.snap.svg +136 -0
- package/tests/examples/__snapshots__/example09.snap.svg +484 -0
- package/tests/examples/__snapshots__/example10.snap.svg +135 -0
- package/tests/examples/__snapshots__/example11.snap.svg +162 -0
- package/tests/examples/__snapshots__/example12.snap.svg +145 -0
- package/tests/examples/__snapshots__/example13.snap.svg +316 -0
- package/tests/examples/__snapshots__/example14.snap.svg +213 -0
- package/tests/examples/example01.test.ts +12 -0
- package/tests/examples/example02.test.ts +12 -0
- package/tests/examples/example03.test.ts +12 -0
- package/tests/examples/example04.test.ts +12 -0
- package/tests/examples/example05.test.ts +12 -0
- package/tests/examples/example06.test.ts +12 -0
- package/tests/examples/example07.test.ts +12 -0
- package/tests/examples/example08.test.ts +12 -0
- package/tests/examples/example09.test.ts +12 -0
- package/tests/examples/example10.test.ts +12 -0
- package/tests/examples/example11.test.tsx +12 -0
- package/tests/examples/example12.test.tsx +12 -0
- package/tests/examples/example13.test.tsx +12 -0
- package/tests/examples/example14.test.tsx +12 -0
- package/tests/fixtures/matcher.ts +62 -0
- package/tests/fixtures/preload.ts +1 -0
- package/tests/solvers/NetLabelPlacementSolver/SingleNetLabelPlacementSolver/SingleNetLabelPlacementSolver01.test.ts +13 -0
- package/tests/svg.test.ts +11 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
<svg width="640" height="640" viewBox="0 0 640 640" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<rect width="100%" height="100%" fill="white" />
|
|
3
|
+
<g>
|
|
4
|
+
<circle data-type="point" data-label="R1.1
|
|
5
|
+
x-" data-x="-3.5512907000000005" data-y="0.0002732499999993365" cx="62.695035460992926" cy="318.8552397163121" r="3" fill="hsl(226, 100%, 50%, 0.8)" />
|
|
6
|
+
</g>
|
|
7
|
+
<g>
|
|
8
|
+
<circle data-type="point" data-label="R1.2
|
|
9
|
+
x+" data-x="-2.4487092999999995" data-y="-0.0002732499999993365" cx="146.10544869976368" cy="318.89658250591015" r="3" fill="hsl(227, 100%, 50%, 0.8)" />
|
|
10
|
+
</g>
|
|
11
|
+
<g>
|
|
12
|
+
<circle data-type="point" data-label="C1.1
|
|
13
|
+
x-" data-x="2.4487906999999995" data-y="-0.00027334999999961695" cx="516.6019026004727" cy="318.89659007092195" r="3" fill="hsl(121, 100%, 50%, 0.8)" />
|
|
14
|
+
</g>
|
|
15
|
+
<g>
|
|
16
|
+
<circle data-type="point" data-label="C1.2
|
|
17
|
+
x+" data-x="3.5512093000000005" data-y="0.00027334999999961695" cx="600" cy="318.8552321513003" r="3" fill="hsl(122, 100%, 50%, 0.8)" />
|
|
18
|
+
</g>
|
|
19
|
+
<g>
|
|
20
|
+
<circle data-type="point" data-label="" data-x="-3.7512907000000006" data-y="0.0002732499999993365" cx="47.565011820330994" cy="318.8552397163121" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
|
|
21
|
+
</g>
|
|
22
|
+
<g>
|
|
23
|
+
<polyline data-points="-3.5512907000000005,0.0002732499999993365 2.4487906999999995,-0.00027334999999961695" data-type="line" data-label="" points="62.695035460992926,318.8552397163121 516.6019026004727,318.89659007092195" fill="none" stroke="hsl(72, 100%, 50%, 0.8)" stroke-width="1" />
|
|
24
|
+
</g>
|
|
25
|
+
<g>
|
|
26
|
+
<polyline data-points="-3.5512907000000005,0.0002732499999993365 -3.7512907000000006,0.0002732499999993365 -3.7512907000000006,0.20027324999999935 2.2487906999999994,0.20027324999999935 2.2487906999999994,-0.00027334999999961695 2.4487906999999987,-0.00027334999999961695" data-type="line" data-label="" points="62.695035460992926,318.8552397163121 47.565011820330994,318.8552397163121 47.565011820330994,303.72521607565017 501.4718789598108,303.72521607565017 501.4718789598108,318.89659007092195 516.6019026004726,318.89659007092195" fill="none" stroke="purple" stroke-width="1" />
|
|
27
|
+
</g>
|
|
28
|
+
<g>
|
|
29
|
+
<rect data-type="rect" data-label="schematic_component_0" data-x="-3" data-y="0" x="62.695035460992926" y="304.1653408983452" width="83.41041323877076" height="29.421140425531803" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.013218750000000003" />
|
|
30
|
+
</g>
|
|
31
|
+
<g>
|
|
32
|
+
<rect data-type="rect" data-label="schematic_component_1" data-x="3" data-y="0" x="516.6019026004727" y="287.10220709219846" width="83.39809739952727" height="63.547408037825335" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.013218750000000003" />
|
|
33
|
+
</g>
|
|
34
|
+
<g>
|
|
35
|
+
<rect data-type="rect" data-label="" data-x="-3.7512907000000006" data-y="-0.22472675000000067" x="40" y="318.8552397163121" width="15.130023640661989" height="34.04255319148939" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.013218750000000003" />
|
|
36
|
+
</g>
|
|
37
|
+
<g id="crosshair" style="display: none">
|
|
38
|
+
<line id="crosshair-h" y1="0" y2="640" stroke="#666" stroke-width="0.5" />
|
|
39
|
+
<line id="crosshair-v" x1="0" x2="640" stroke="#666" stroke-width="0.5" /><text id="coordinates" font-family="monospace" font-size="12" fill="#666"></text>
|
|
40
|
+
</g>
|
|
41
|
+
<script>
|
|
42
|
+
<![CDATA[
|
|
43
|
+
document.currentScript.parentElement.addEventListener('mousemove', (e) => {
|
|
44
|
+
const svg = e.currentTarget;
|
|
45
|
+
const rect = svg.getBoundingClientRect();
|
|
46
|
+
const x = e.clientX - rect.left;
|
|
47
|
+
const y = e.clientY - rect.top;
|
|
48
|
+
const crosshair = svg.getElementById('crosshair');
|
|
49
|
+
const h = svg.getElementById('crosshair-h');
|
|
50
|
+
const v = svg.getElementById('crosshair-v');
|
|
51
|
+
const coords = svg.getElementById('coordinates');
|
|
52
|
+
|
|
53
|
+
crosshair.style.display = 'block';
|
|
54
|
+
h.setAttribute('x1', '0');
|
|
55
|
+
h.setAttribute('x2', '640');
|
|
56
|
+
h.setAttribute('y1', y);
|
|
57
|
+
h.setAttribute('y2', y);
|
|
58
|
+
v.setAttribute('x1', x);
|
|
59
|
+
v.setAttribute('x2', x);
|
|
60
|
+
v.setAttribute('y1', '0');
|
|
61
|
+
v.setAttribute('y2', '640');
|
|
62
|
+
|
|
63
|
+
// Calculate real coordinates using inverse transformation
|
|
64
|
+
const matrix = {
|
|
65
|
+
"a": 75.65011820330967,
|
|
66
|
+
"c": 0,
|
|
67
|
+
"e": 331.3505966903073,
|
|
68
|
+
"b": 0,
|
|
69
|
+
"d": -75.65011820330967,
|
|
70
|
+
"f": 318.8759111111111
|
|
71
|
+
};
|
|
72
|
+
// Manually invert and apply the affine transform
|
|
73
|
+
// Since we only use translate and scale, we can directly compute:
|
|
74
|
+
// x' = (x - tx) / sx
|
|
75
|
+
// y' = (y - ty) / sy
|
|
76
|
+
const sx = matrix.a;
|
|
77
|
+
const sy = matrix.d;
|
|
78
|
+
const tx = matrix.e;
|
|
79
|
+
const ty = matrix.f;
|
|
80
|
+
const realPoint = {
|
|
81
|
+
x: (x - tx) / sx,
|
|
82
|
+
y: (y - ty) / sy // Flip y back since we used negative scale
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
coords.textContent = `(${realPoint.x.toFixed(2)}, ${realPoint.y.toFixed(2)})`;
|
|
86
|
+
coords.setAttribute('x', (x + 5).toString());
|
|
87
|
+
coords.setAttribute('y', (y - 5).toString());
|
|
88
|
+
});
|
|
89
|
+
document.currentScript.parentElement.addEventListener('mouseleave', () => {
|
|
90
|
+
document.currentScript.parentElement.getElementById('crosshair').style.display = 'none';
|
|
91
|
+
});
|
|
92
|
+
]]>
|
|
93
|
+
</script>
|
|
94
|
+
</svg>
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
<svg width="640" height="640" viewBox="0 0 640 640" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<rect width="100%" height="100%" fill="white" />
|
|
3
|
+
<g>
|
|
4
|
+
<circle data-type="point" data-label="U3.8
|
|
5
|
+
x-" data-x="-1.4" data-y="0.42500000000000004" cx="177.95207620854734" cy="361.0856657006556" r="3" fill="hsl(88, 100%, 50%, 0.8)" />
|
|
6
|
+
</g>
|
|
7
|
+
<g>
|
|
8
|
+
<circle data-type="point" data-label="U3.4
|
|
9
|
+
x-" data-x="-1.4" data-y="-0.42500000000000004" cx="177.95207620854734" cy="460.5281573530356" r="3" fill="hsl(84, 100%, 50%, 0.8)" />
|
|
10
|
+
</g>
|
|
11
|
+
<g>
|
|
12
|
+
<circle data-type="point" data-label="U3.1
|
|
13
|
+
x+" data-x="1.4" data-y="0.5" cx="505.5273428281519" cy="352.31132820191624" r="3" fill="hsl(81, 100%, 50%, 0.8)" />
|
|
14
|
+
</g>
|
|
15
|
+
<g>
|
|
16
|
+
<circle data-type="point" data-label="U3.6
|
|
17
|
+
x+" data-x="1.4" data-y="0.30000000000000004" cx="505.5273428281519" cy="375.70956153188797" r="3" fill="hsl(86, 100%, 50%, 0.8)" />
|
|
18
|
+
</g>
|
|
19
|
+
<g>
|
|
20
|
+
<circle data-type="point" data-label="U3.5
|
|
21
|
+
x+" data-x="1.4" data-y="0.10000000000000009" cx="505.5273428281519" cy="399.10779486185976" r="3" fill="hsl(85, 100%, 50%, 0.8)" />
|
|
22
|
+
</g>
|
|
23
|
+
<g>
|
|
24
|
+
<circle data-type="point" data-label="U3.2
|
|
25
|
+
x+" data-x="1.4" data-y="-0.09999999999999998" cx="505.5273428281519" cy="422.5060281918315" r="3" fill="hsl(82, 100%, 50%, 0.8)" />
|
|
26
|
+
</g>
|
|
27
|
+
<g>
|
|
28
|
+
<circle data-type="point" data-label="U3.3
|
|
29
|
+
x+" data-x="1.4" data-y="-0.3" cx="505.5273428281519" cy="445.9042615218033" r="3" fill="hsl(83, 100%, 50%, 0.8)" />
|
|
30
|
+
</g>
|
|
31
|
+
<g>
|
|
32
|
+
<circle data-type="point" data-label="U3.7
|
|
33
|
+
x+" data-x="1.4" data-y="-0.5" cx="505.5273428281519" cy="469.302494851775" r="3" fill="hsl(87, 100%, 50%, 0.8)" />
|
|
34
|
+
</g>
|
|
35
|
+
<g>
|
|
36
|
+
<circle data-type="point" data-label="C20.1
|
|
37
|
+
y+" data-x="-2.3148566499999994" data-y="0.5512093000000002" cx="70.92192940766586" cy="346.32029245159356" r="3" fill="hsl(140, 100%, 50%, 0.8)" />
|
|
38
|
+
</g>
|
|
39
|
+
<g>
|
|
40
|
+
<circle data-type="point" data-label="C20.2
|
|
41
|
+
y-" data-x="-2.31430995" data-y="-0.5512093000000002" cx="70.98588847847327" cy="475.2935306020977" r="3" fill="hsl(141, 100%, 50%, 0.8)" />
|
|
42
|
+
</g>
|
|
43
|
+
<g>
|
|
44
|
+
<circle data-type="point" data-label="R11.1
|
|
45
|
+
y+" data-x="1.7580660749999977" data-y="2.3025814000000002" cx="547.4179106801375" cy="141.42522723458046" r="3" fill="hsl(125, 100%, 50%, 0.8)" />
|
|
46
|
+
</g>
|
|
47
|
+
<g>
|
|
48
|
+
<circle data-type="point" data-label="R11.2
|
|
49
|
+
y-" data-x="1.757519574999999" data-y="1.2" cx="547.3539750075635" cy="270.4175115470151" r="3" fill="hsl(126, 100%, 50%, 0.8)" />
|
|
50
|
+
</g>
|
|
51
|
+
<g>
|
|
52
|
+
<circle data-type="point" data-label="" data-x="-1.8574283249999997" data-y="0.7512093000000004" cx="124.4370028081066" cy="322.9220591216218" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
|
|
53
|
+
</g>
|
|
54
|
+
<g>
|
|
55
|
+
<circle data-type="point" data-label="" data-x="1.5999999999999999" data-y="-0.3" cx="528.9255761581237" cy="445.9042615218033" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
|
|
56
|
+
</g>
|
|
57
|
+
<g>
|
|
58
|
+
<circle data-type="point" data-label="" data-x="1.7580660749999977" data-y="2.3025814000000002" cx="547.4179106801375" cy="141.42522723458046" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
|
|
59
|
+
</g>
|
|
60
|
+
<g>
|
|
61
|
+
<circle data-type="point" data-label="" data-x="-2.31430995" data-y="-0.7512093000000004" cx="70.98588847847327" cy="498.6917639320694" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
|
|
62
|
+
</g>
|
|
63
|
+
<g>
|
|
64
|
+
<circle data-type="point" data-label="" data-x="1.757519574999999" data-y="0.85" cx="547.3539750075635" cy="311.3644198744657" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
|
|
65
|
+
</g>
|
|
66
|
+
<g>
|
|
67
|
+
<polyline data-points="-2.3148566499999994,0.5512093000000002 -1.4,0.42500000000000004" data-type="line" data-label="" points="70.92192940766586,346.32029245159356 177.95207620854734,361.0856657006556" fill="none" stroke="hsl(256, 100%, 50%, 0.8)" stroke-width="1" />
|
|
68
|
+
</g>
|
|
69
|
+
<g>
|
|
70
|
+
<polyline data-points="-2.31430995,-0.5512093000000002 -1.4,-0.42500000000000004" data-type="line" data-label="" points="70.98588847847327,475.2935306020977 177.95207620854734,460.5281573530356" fill="none" stroke="hsl(256, 100%, 50%, 0.8)" stroke-width="1" />
|
|
71
|
+
</g>
|
|
72
|
+
<g>
|
|
73
|
+
<polyline data-points="1.757519574999999,1.2 1.4,0.5" data-type="line" data-label="" points="547.3539750075635,270.4175115470151 505.5273428281519,352.31132820191624" fill="none" stroke="hsl(144, 100%, 50%, 0.8)" stroke-width="1" />
|
|
74
|
+
</g>
|
|
75
|
+
<g>
|
|
76
|
+
<polyline data-points="-1.4,0.42500000000000004 1.4,-0.3" data-type="line" data-label="" points="177.95207620854734,361.0856657006556 505.5273428281519,445.9042615218033" fill="none" stroke="hsl(73, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
|
|
77
|
+
</g>
|
|
78
|
+
<g>
|
|
79
|
+
<polyline data-points="-1.4,0.42500000000000004 1.4,-0.5" data-type="line" data-label="" points="177.95207620854734,361.0856657006556 505.5273428281519,469.302494851775" fill="none" stroke="hsl(73, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
|
|
80
|
+
</g>
|
|
81
|
+
<g>
|
|
82
|
+
<polyline data-points="-1.4,0.42500000000000004 -2.3148566499999994,0.5512093000000002" data-type="line" data-label="" points="177.95207620854734,361.0856657006556 70.92192940766586,346.32029245159356" fill="none" stroke="hsl(73, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
|
|
83
|
+
</g>
|
|
84
|
+
<g>
|
|
85
|
+
<polyline data-points="-1.4,0.42500000000000004 1.7580660749999977,2.3025814000000002" data-type="line" data-label="" points="177.95207620854734,361.0856657006556 547.4179106801375,141.42522723458046" fill="none" stroke="hsl(73, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
|
|
86
|
+
</g>
|
|
87
|
+
<g>
|
|
88
|
+
<polyline data-points="1.4,-0.3 1.4,-0.5" data-type="line" data-label="" points="505.5273428281519,445.9042615218033 505.5273428281519,469.302494851775" fill="none" stroke="hsl(73, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
|
|
89
|
+
</g>
|
|
90
|
+
<g>
|
|
91
|
+
<polyline data-points="1.4,-0.3 -2.3148566499999994,0.5512093000000002" data-type="line" data-label="" points="505.5273428281519,445.9042615218033 70.92192940766586,346.32029245159356" fill="none" stroke="hsl(73, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
|
|
92
|
+
</g>
|
|
93
|
+
<g>
|
|
94
|
+
<polyline data-points="1.4,-0.3 1.7580660749999977,2.3025814000000002" data-type="line" data-label="" points="505.5273428281519,445.9042615218033 547.4179106801375,141.42522723458046" fill="none" stroke="hsl(73, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
|
|
95
|
+
</g>
|
|
96
|
+
<g>
|
|
97
|
+
<polyline data-points="1.4,-0.5 -2.3148566499999994,0.5512093000000002" data-type="line" data-label="" points="505.5273428281519,469.302494851775 70.92192940766586,346.32029245159356" fill="none" stroke="hsl(73, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
|
|
98
|
+
</g>
|
|
99
|
+
<g>
|
|
100
|
+
<polyline data-points="1.4,-0.5 1.7580660749999977,2.3025814000000002" data-type="line" data-label="" points="505.5273428281519,469.302494851775 547.4179106801375,141.42522723458046" fill="none" stroke="hsl(73, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
|
|
101
|
+
</g>
|
|
102
|
+
<g>
|
|
103
|
+
<polyline data-points="-2.3148566499999994,0.5512093000000002 1.7580660749999977,2.3025814000000002" data-type="line" data-label="" points="70.92192940766586,346.32029245159356 547.4179106801375,141.42522723458046" fill="none" stroke="hsl(73, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
|
|
104
|
+
</g>
|
|
105
|
+
<g>
|
|
106
|
+
<polyline data-points="-1.4,-0.42500000000000004 -2.31430995,-0.5512093000000002" data-type="line" data-label="" points="177.95207620854734,460.5281573530356 70.98588847847327,475.2935306020977" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
|
|
107
|
+
</g>
|
|
108
|
+
<g>
|
|
109
|
+
<polyline data-points="1.4,0.5 1.757519574999999,1.2" data-type="line" data-label="" points="505.5273428281519,352.31132820191624 547.3539750075635,270.4175115470151" fill="none" stroke="hsl(304, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
|
|
110
|
+
</g>
|
|
111
|
+
<g>
|
|
112
|
+
<polyline data-points="-1.4,0.42500000000000004 -1.8574283249999997,0.42500000000000004 -1.8574283249999997,0.7512093000000004 -2.3148566499999994,0.7512093000000004 -2.3148566499999994,0.5512093000000002" data-type="line" data-label="" points="177.95207620854734,361.0856657006556 124.4370028081066,361.0856657006556 124.4370028081066,322.9220591216218 70.92192940766586,322.9220591216218 70.92192940766586,346.32029245159356" fill="none" stroke="purple" stroke-width="1" />
|
|
113
|
+
</g>
|
|
114
|
+
<g>
|
|
115
|
+
<polyline data-points="1.4,-0.5 1.5999999999999999,-0.5 1.5999999999999999,-0.3 1.4,-0.3" data-type="line" data-label="" points="505.5273428281519,469.302494851775 528.9255761581237,469.302494851775 528.9255761581237,445.9042615218033 505.5273428281519,445.9042615218033" fill="none" stroke="purple" stroke-width="1" />
|
|
116
|
+
</g>
|
|
117
|
+
<g>
|
|
118
|
+
<polyline data-points="-2.31430995,-0.5512093000000002 -2.31430995,-0.7512093000000004 -1.857154975,-0.7512093000000004 -1.857154975,-0.42500000000000004 -1.4,-0.42500000000000004" data-type="line" data-label="" points="70.98588847847327,475.2935306020977 70.98588847847327,498.6917639320694 124.4689823435103,498.6917639320694 124.4689823435103,460.5281573530356 177.95207620854734,460.5281573530356" fill="none" stroke="purple" stroke-width="1" />
|
|
119
|
+
</g>
|
|
120
|
+
<g>
|
|
121
|
+
<polyline data-points="1.757519574999999,1.2 1.757519574999999,0.5 1.4,0.5" data-type="line" data-label="" points="547.3539750075635,270.4175115470151 547.3539750075635,352.31132820191624 505.5273428281519,352.31132820191624" fill="none" stroke="purple" stroke-width="1" />
|
|
122
|
+
</g>
|
|
123
|
+
<g>
|
|
124
|
+
<rect data-type="rect" data-label="schematic_component_0" data-x="0" data-y="0" x="177.95207620854734" y="328.9130948719445" width="327.5752666196046" height="163.78763330980223" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.00854765388392857" />
|
|
125
|
+
</g>
|
|
126
|
+
<g>
|
|
127
|
+
<rect data-type="rect" data-label="schematic_component_1" data-x="-2.3145833" data-y="0" x="40" y="346.32029245159356" width="61.907817886139156" height="128.97323815050413" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.00854765388392857" />
|
|
128
|
+
</g>
|
|
129
|
+
<g>
|
|
130
|
+
<rect data-type="rect" data-label="schematic_component_2" data-x="1.7577928249999983" data-y="1.7512907000000002" x="528.9255761581237" y="141.42522723458046" width="36.92073337145359" height="128.99228431243466" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.00854765388392857" />
|
|
131
|
+
</g>
|
|
132
|
+
<g>
|
|
133
|
+
<rect data-type="rect" data-label="" data-x="-1.8574283249999997" data-y="0.9762093000000004" x="112.7378861431207" y="270.2760341291854" width="23.398233329971788" height="52.64602499243642" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.00854765388392857" />
|
|
134
|
+
</g>
|
|
135
|
+
<g>
|
|
136
|
+
<rect data-type="rect" data-label="" data-x="1.5999999999999999" data-y="-0.07499999999999998" x="517.2264594931378" y="393.2582365293668" width="23.39823332997173" height="52.64602499243648" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.00854765388392857" />
|
|
137
|
+
</g>
|
|
138
|
+
<g>
|
|
139
|
+
<rect data-type="rect" data-label="" data-x="1.7580660749999977" data-y="2.5285814" x="535.7187940151516" y="88.66221107549416" width="23.39823332997173" height="52.64602499243642" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.00854765388392857" />
|
|
140
|
+
</g>
|
|
141
|
+
<g>
|
|
142
|
+
<rect data-type="rect" data-label="" data-x="-2.31430995" data-y="-0.9762093000000004" x="59.28677181348735" y="498.6917639320694" width="23.398233329971788" height="52.64602499243642" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.00854765388392857" />
|
|
143
|
+
</g>
|
|
144
|
+
<g>
|
|
145
|
+
<rect data-type="rect" data-label="" data-x="1.982519574999999" data-y="0.85" x="547.3539750075635" y="299.6653032094798" width="52.64602499243654" height="23.39823332997173" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.00854765388392857" />
|
|
146
|
+
</g>
|
|
147
|
+
<g id="crosshair" style="display: none">
|
|
148
|
+
<line id="crosshair-h" y1="0" y2="640" stroke="#666" stroke-width="0.5" />
|
|
149
|
+
<line id="crosshair-v" x1="0" x2="640" stroke="#666" stroke-width="0.5" /><text id="coordinates" font-family="monospace" font-size="12" fill="#666"></text>
|
|
150
|
+
</g>
|
|
151
|
+
<script>
|
|
152
|
+
<![CDATA[
|
|
153
|
+
document.currentScript.parentElement.addEventListener('mousemove', (e) => {
|
|
154
|
+
const svg = e.currentTarget;
|
|
155
|
+
const rect = svg.getBoundingClientRect();
|
|
156
|
+
const x = e.clientX - rect.left;
|
|
157
|
+
const y = e.clientY - rect.top;
|
|
158
|
+
const crosshair = svg.getElementById('crosshair');
|
|
159
|
+
const h = svg.getElementById('crosshair-h');
|
|
160
|
+
const v = svg.getElementById('crosshair-v');
|
|
161
|
+
const coords = svg.getElementById('coordinates');
|
|
162
|
+
|
|
163
|
+
crosshair.style.display = 'block';
|
|
164
|
+
h.setAttribute('x1', '0');
|
|
165
|
+
h.setAttribute('x2', '640');
|
|
166
|
+
h.setAttribute('y1', y);
|
|
167
|
+
h.setAttribute('y2', y);
|
|
168
|
+
v.setAttribute('x1', x);
|
|
169
|
+
v.setAttribute('x2', x);
|
|
170
|
+
v.setAttribute('y1', '0');
|
|
171
|
+
v.setAttribute('y2', '640');
|
|
172
|
+
|
|
173
|
+
// Calculate real coordinates using inverse transformation
|
|
174
|
+
const matrix = {
|
|
175
|
+
"a": 116.99116664985878,
|
|
176
|
+
"c": 0,
|
|
177
|
+
"e": 341.7397095183496,
|
|
178
|
+
"b": 0,
|
|
179
|
+
"d": -116.99116664985878,
|
|
180
|
+
"f": 410.8069115268456
|
|
181
|
+
};
|
|
182
|
+
// Manually invert and apply the affine transform
|
|
183
|
+
// Since we only use translate and scale, we can directly compute:
|
|
184
|
+
// x' = (x - tx) / sx
|
|
185
|
+
// y' = (y - ty) / sy
|
|
186
|
+
const sx = matrix.a;
|
|
187
|
+
const sy = matrix.d;
|
|
188
|
+
const tx = matrix.e;
|
|
189
|
+
const ty = matrix.f;
|
|
190
|
+
const realPoint = {
|
|
191
|
+
x: (x - tx) / sx,
|
|
192
|
+
y: (y - ty) / sy // Flip y back since we used negative scale
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
coords.textContent = `(${realPoint.x.toFixed(2)}, ${realPoint.y.toFixed(2)})`;
|
|
196
|
+
coords.setAttribute('x', (x + 5).toString());
|
|
197
|
+
coords.setAttribute('y', (y - 5).toString());
|
|
198
|
+
});
|
|
199
|
+
document.currentScript.parentElement.addEventListener('mouseleave', () => {
|
|
200
|
+
document.currentScript.parentElement.getElementById('crosshair').style.display = 'none';
|
|
201
|
+
});
|
|
202
|
+
]]>
|
|
203
|
+
</script>
|
|
204
|
+
</svg>
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
<svg width="640" height="640" viewBox="0 0 640 640" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<rect width="100%" height="100%" fill="white" />
|
|
3
|
+
<g>
|
|
4
|
+
<circle data-type="point" data-label="R1.1
|
|
5
|
+
x-" data-x="3.4487093" data-y="0.0002732499999993365" cx="456.27559832869093" cy="319.9747211876014" r="3" fill="hsl(226, 100%, 50%, 0.8)" />
|
|
6
|
+
</g>
|
|
7
|
+
<g>
|
|
8
|
+
<circle data-type="point" data-label="R1.2
|
|
9
|
+
x+" data-x="4.5512907" data-y="-0.0002732499999993365" cx="558.277239188265" cy="320.0252788123986" r="3" fill="hsl(227, 100%, 50%, 0.8)" />
|
|
10
|
+
</g>
|
|
11
|
+
<g>
|
|
12
|
+
<circle data-type="point" data-label="U1.1
|
|
13
|
+
x-" data-x="-0.6000000000000001" data-y="0.30000000000000004" cx="81.722760811735" cy="292.2465005686907" r="3" fill="hsl(319, 100%, 50%, 0.8)" />
|
|
14
|
+
</g>
|
|
15
|
+
<g>
|
|
16
|
+
<circle data-type="point" data-label="U1.2
|
|
17
|
+
x-" data-x="-0.6000000000000001" data-y="0.10000000000000003" cx="81.722760811735" cy="310.7488335228969" r="3" fill="hsl(320, 100%, 50%, 0.8)" />
|
|
18
|
+
</g>
|
|
19
|
+
<g>
|
|
20
|
+
<circle data-type="point" data-label="U1.3
|
|
21
|
+
x-" data-x="-0.6000000000000001" data-y="-0.09999999999999998" cx="81.722760811735" cy="329.2511664771031" r="3" fill="hsl(321, 100%, 50%, 0.8)" />
|
|
22
|
+
</g>
|
|
23
|
+
<g>
|
|
24
|
+
<circle data-type="point" data-label="U1.4
|
|
25
|
+
x-" data-x="-0.6000000000000001" data-y="-0.30000000000000004" cx="81.722760811735" cy="347.7534994313093" r="3" fill="hsl(322, 100%, 50%, 0.8)" />
|
|
26
|
+
</g>
|
|
27
|
+
<g>
|
|
28
|
+
<circle data-type="point" data-label="U1.5
|
|
29
|
+
x+" data-x="0.6000000000000001" data-y="-0.30000000000000004" cx="192.73675853697233" cy="347.7534994313093" r="3" fill="hsl(323, 100%, 50%, 0.8)" />
|
|
30
|
+
</g>
|
|
31
|
+
<g>
|
|
32
|
+
<circle data-type="point" data-label="U1.6
|
|
33
|
+
x+" data-x="0.6000000000000001" data-y="-0.10000000000000003" cx="192.73675853697233" cy="329.2511664771031" r="3" fill="hsl(324, 100%, 50%, 0.8)" />
|
|
34
|
+
</g>
|
|
35
|
+
<g>
|
|
36
|
+
<circle data-type="point" data-label="U1.7
|
|
37
|
+
x+" data-x="0.6000000000000001" data-y="0.09999999999999998" cx="192.73675853697233" cy="310.7488335228969" r="3" fill="hsl(325, 100%, 50%, 0.8)" />
|
|
38
|
+
</g>
|
|
39
|
+
<g>
|
|
40
|
+
<circle data-type="point" data-label="U1.8
|
|
41
|
+
x+" data-x="0.6000000000000001" data-y="0.30000000000000004" cx="192.73675853697233" cy="292.2465005686907" r="3" fill="hsl(326, 100%, 50%, 0.8)" />
|
|
42
|
+
</g>
|
|
43
|
+
<g>
|
|
44
|
+
<circle data-type="point" data-label="" data-x="-0.6000000000000001" data-y="0.30000000000000004" cx="81.722760811735" cy="292.2465005686907" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
|
|
45
|
+
</g>
|
|
46
|
+
<g>
|
|
47
|
+
<circle data-type="point" data-label="" data-x="3.4487093" data-y="0.0002732499999993365" cx="456.27559832869093" cy="319.9747211876014" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
|
|
48
|
+
</g>
|
|
49
|
+
<g>
|
|
50
|
+
<circle data-type="point" data-label="" data-x="0.6000000000000001" data-y="-0.10000000000000003" cx="192.73675853697233" cy="329.2511664771031" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
|
|
51
|
+
</g>
|
|
52
|
+
<g>
|
|
53
|
+
<circle data-type="point" data-label="" data-x="4.5512907" data-y="-0.0002732499999993365" cx="558.277239188265" cy="320.0252788123986" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
|
|
54
|
+
</g>
|
|
55
|
+
<g>
|
|
56
|
+
<polyline data-points="-0.6000000000000001,0.30000000000000004 3.4487093,0.0002732499999993365" data-type="line" data-label="" points="81.722760811735,292.2465005686907 456.27559832869093,319.9747211876014" fill="none" stroke="hsl(248, 100%, 50%, 0.8)" stroke-width="1" />
|
|
57
|
+
</g>
|
|
58
|
+
<g>
|
|
59
|
+
<polyline data-points="0.6000000000000001,-0.10000000000000003 4.5512907,-0.0002732499999993365" data-type="line" data-label="" points="192.73675853697233,329.2511664771031 558.277239188265,320.0252788123986" fill="none" stroke="hsl(248, 100%, 50%, 0.8)" stroke-width="1" />
|
|
60
|
+
</g>
|
|
61
|
+
<g>
|
|
62
|
+
<rect data-type="rect" data-label="schematic_component_0" data-x="4" data-y="0" x="456.27559832869093" y="302.0106118478665" width="102.00164085957402" height="35.978776304266944" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.010809447678571428" />
|
|
63
|
+
</g>
|
|
64
|
+
<g>
|
|
65
|
+
<rect data-type="rect" data-label="schematic_component_1" data-x="0" data-y="0" x="81.722760811735" y="273.74416761448447" width="111.01399772523733" height="92.51166477103106" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.010809447678571428" />
|
|
66
|
+
</g>
|
|
67
|
+
<g>
|
|
68
|
+
<rect data-type="rect" data-label="" data-x="-0.8260000000000001" data-y="0.30000000000000004" x="39.999999999999986" y="282.99533409158755" width="41.630249146963976" height="18.502332954206224" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.010809447678571428" />
|
|
69
|
+
</g>
|
|
70
|
+
<g>
|
|
71
|
+
<rect data-type="rect" data-label="" data-x="3.2227093" data-y="0.0002732499999993365" x="414.5528375169559" y="310.72355471049826" width="41.63024914696399" height="18.502332954206224" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.010809447678571428" />
|
|
72
|
+
</g>
|
|
73
|
+
<g>
|
|
74
|
+
<rect data-type="rect" data-label="" data-x="0.8260000000000001" data-y="-0.10000000000000003" x="192.82927020174336" y="320" width="41.63024914696396" height="18.502332954206224" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.010809447678571428" />
|
|
75
|
+
</g>
|
|
76
|
+
<g>
|
|
77
|
+
<rect data-type="rect" data-label="" data-x="4.7772907" data-y="-0.0002732499999993365" x="558.3697508530361" y="310.7741123352955" width="41.63024914696393" height="18.502332954206224" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.010809447678571428" />
|
|
78
|
+
</g>
|
|
79
|
+
<g id="crosshair" style="display: none">
|
|
80
|
+
<line id="crosshair-h" y1="0" y2="640" stroke="#666" stroke-width="0.5" />
|
|
81
|
+
<line id="crosshair-v" x1="0" x2="640" stroke="#666" stroke-width="0.5" /><text id="coordinates" font-family="monospace" font-size="12" fill="#666"></text>
|
|
82
|
+
</g>
|
|
83
|
+
<script>
|
|
84
|
+
<![CDATA[
|
|
85
|
+
document.currentScript.parentElement.addEventListener('mousemove', (e) => {
|
|
86
|
+
const svg = e.currentTarget;
|
|
87
|
+
const rect = svg.getBoundingClientRect();
|
|
88
|
+
const x = e.clientX - rect.left;
|
|
89
|
+
const y = e.clientY - rect.top;
|
|
90
|
+
const crosshair = svg.getElementById('crosshair');
|
|
91
|
+
const h = svg.getElementById('crosshair-h');
|
|
92
|
+
const v = svg.getElementById('crosshair-v');
|
|
93
|
+
const coords = svg.getElementById('coordinates');
|
|
94
|
+
|
|
95
|
+
crosshair.style.display = 'block';
|
|
96
|
+
h.setAttribute('x1', '0');
|
|
97
|
+
h.setAttribute('x2', '640');
|
|
98
|
+
h.setAttribute('y1', y);
|
|
99
|
+
h.setAttribute('y2', y);
|
|
100
|
+
v.setAttribute('x1', x);
|
|
101
|
+
v.setAttribute('x2', x);
|
|
102
|
+
v.setAttribute('y1', '0');
|
|
103
|
+
v.setAttribute('y2', '640');
|
|
104
|
+
|
|
105
|
+
// Calculate real coordinates using inverse transformation
|
|
106
|
+
const matrix = {
|
|
107
|
+
"a": 92.51166477103108,
|
|
108
|
+
"c": 0,
|
|
109
|
+
"e": 137.22975967435366,
|
|
110
|
+
"b": 0,
|
|
111
|
+
"d": -92.51166477103108,
|
|
112
|
+
"f": 320
|
|
113
|
+
};
|
|
114
|
+
// Manually invert and apply the affine transform
|
|
115
|
+
// Since we only use translate and scale, we can directly compute:
|
|
116
|
+
// x' = (x - tx) / sx
|
|
117
|
+
// y' = (y - ty) / sy
|
|
118
|
+
const sx = matrix.a;
|
|
119
|
+
const sy = matrix.d;
|
|
120
|
+
const tx = matrix.e;
|
|
121
|
+
const ty = matrix.f;
|
|
122
|
+
const realPoint = {
|
|
123
|
+
x: (x - tx) / sx,
|
|
124
|
+
y: (y - ty) / sy // Flip y back since we used negative scale
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
coords.textContent = `(${realPoint.x.toFixed(2)}, ${realPoint.y.toFixed(2)})`;
|
|
128
|
+
coords.setAttribute('x', (x + 5).toString());
|
|
129
|
+
coords.setAttribute('y', (y - 5).toString());
|
|
130
|
+
});
|
|
131
|
+
document.currentScript.parentElement.addEventListener('mouseleave', () => {
|
|
132
|
+
document.currentScript.parentElement.getElementById('crosshair').style.display = 'none';
|
|
133
|
+
});
|
|
134
|
+
]]>
|
|
135
|
+
</script>
|
|
136
|
+
</svg>
|