@tscircuit/schematic-trace-solver 0.0.33 → 0.0.34
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 +22 -4
- package/lib/solvers/NetLabelPlacementSolver/NetLabelPlacementSolver.ts +25 -4
- package/package.json +1 -1
- package/site/examples/example15-rp2040-caps.page.tsx +623 -0
- package/site/examples/example16-core-repro51.page.tsx +107 -0
- package/site/examples/example17-straight-line-trace.page.tsx +165 -0
- package/site/examples/example18.page.tsx +181 -0
- package/site/examples/example19.page.tsx +169 -0
- package/tests/examples/__snapshots__/example15.snap.svg +800 -71
- package/tests/examples/__snapshots__/example16.snap.svg +40 -86
- package/tests/examples/__snapshots__/example17.snap.svg +190 -0
- package/tests/examples/__snapshots__/example18.snap.svg +235 -0
- package/tests/examples/__snapshots__/example19.snap.svg +195 -0
- package/tests/examples/example15.test.tsx +524 -82
- package/tests/examples/example16.test.tsx +56 -118
- package/tests/examples/example17.test.tsx +171 -0
- package/tests/examples/example18.test.tsx +187 -0
- package/tests/examples/example19.test.tsx +175 -0
|
@@ -0,0 +1,235 @@
|
|
|
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="211.29957848579102" cy="266.28437168733643" 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="211.29957848579102" cy="342.38151179694313" 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="461.9725106115543" cy="259.56991814825346" 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="461.9725106115543" cy="277.47512758580797" 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="461.9725106115543" cy="295.38033702336253" 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="461.9725106115543" cy="313.28554646091703" 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="461.9725106115543" cy="331.1907558984716" 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="461.9725106115543" cy="349.0959653360261" 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="129.39607886784347" cy="254.98535194000064" 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="129.44502275784095" cy="353.6805315442789" 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="494.0287509383446" cy="98.19193067205222" 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="493.97982495355666" cy="196.90168511681264" r="3" fill="hsl(126, 100%, 50%, 0.8)" />
|
|
50
|
+
</g>
|
|
51
|
+
<g>
|
|
52
|
+
<circle data-type="point" data-label="R12.1
|
|
53
|
+
y-" data-x="-1.7580660749999977" data-y="-3.3025814000000002" cx="179.24333815900067" cy="600" r="3" fill="hsl(6, 100%, 50%, 0.8)" />
|
|
54
|
+
</g>
|
|
55
|
+
<g>
|
|
56
|
+
<circle data-type="point" data-label="R12.2
|
|
57
|
+
y+" data-x="-1.757519574999999" data-y="-2.2" cx="179.29226414378866" cy="501.29024555523955" r="3" fill="hsl(7, 100%, 50%, 0.8)" />
|
|
58
|
+
</g>
|
|
59
|
+
<g>
|
|
60
|
+
<circle data-type="point" data-label="R13.1
|
|
61
|
+
y-" data-x="1.7580660749999977" data-y="-3.3025814000000002" cx="494.0287509383446" cy="600" r="3" fill="hsl(247, 100%, 50%, 0.8)" />
|
|
62
|
+
</g>
|
|
63
|
+
<g>
|
|
64
|
+
<circle data-type="point" data-label="R13.2
|
|
65
|
+
y+" data-x="1.757519574999999" data-y="-2.2" cx="493.97982495355666" cy="501.29024555523955" r="3" fill="hsl(248, 100%, 50%, 0.8)" />
|
|
66
|
+
</g>
|
|
67
|
+
<g>
|
|
68
|
+
<circle data-type="point" data-label="" data-x="-1.8574283249999997" data-y="0.7512093000000004" cx="170.34782867681724" cy="237.0801425024461" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
|
|
69
|
+
</g>
|
|
70
|
+
<g>
|
|
71
|
+
<circle data-type="point" data-label="" data-x="1.5790330374999988" data-y="2.5025814000000004" cx="478.0006307749495" cy="80.28672123449769" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
|
|
72
|
+
</g>
|
|
73
|
+
<g>
|
|
74
|
+
<circle data-type="point" data-label="" data-x="-2.31430995" data-y="-0.7512093000000004" cx="129.44502275784095" cy="371.58574098183345" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
|
|
75
|
+
</g>
|
|
76
|
+
<g>
|
|
77
|
+
<circle data-type="point" data-label="" data-x="1.757519574999999" data-y="0.85" cx="493.97982495355666" cy="228.23580163253305" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
|
|
78
|
+
</g>
|
|
79
|
+
<g>
|
|
80
|
+
<circle data-type="point" data-label="" data-x="1.757519574999999" data-y="-2" cx="493.97982495355666" cy="483.385036117685" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
|
|
81
|
+
</g>
|
|
82
|
+
<g>
|
|
83
|
+
<polyline data-points="-2.3148566499999994,0.5512093000000002 -1.4,0.42500000000000004" data-type="line" data-label="" points="129.39607886784347,254.98535194000064 211.29957848579102,266.28437168733643" fill="none" stroke="hsl(256, 100%, 50%, 0.8)" stroke-width="1" />
|
|
84
|
+
</g>
|
|
85
|
+
<g>
|
|
86
|
+
<polyline data-points="-2.31430995,-0.5512093000000002 -1.4,-0.42500000000000004" data-type="line" data-label="" points="129.44502275784095,353.6805315442789 211.29957848579102,342.38151179694313" fill="none" stroke="hsl(256, 100%, 50%, 0.8)" stroke-width="1" />
|
|
87
|
+
</g>
|
|
88
|
+
<g>
|
|
89
|
+
<polyline data-points="1.757519574999999,1.2 1.4,0.5" data-type="line" data-label="" points="493.97982495355666,196.90168511681264 461.9725106115543,259.56991814825346" fill="none" stroke="hsl(144, 100%, 50%, 0.8)" stroke-width="1" />
|
|
90
|
+
</g>
|
|
91
|
+
<g>
|
|
92
|
+
<polyline data-points="1.757519574999999,-2.2 -1.757519574999999,-2.2" data-type="line" data-label="" points="493.97982495355666,501.29024555523955 179.29226414378866,501.29024555523955" fill="none" stroke="hsl(144, 100%, 50%, 0.8)" stroke-width="1" />
|
|
93
|
+
</g>
|
|
94
|
+
<g>
|
|
95
|
+
<polyline data-points="-1.4,0.42500000000000004 1.4,-0.3" data-type="line" data-label="" points="211.29957848579102,266.28437168733643 461.9725106115543,331.1907558984716" fill="none" stroke="hsl(73, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
|
|
96
|
+
</g>
|
|
97
|
+
<g>
|
|
98
|
+
<polyline data-points="-1.4,0.42500000000000004 1.4,-0.5" data-type="line" data-label="" points="211.29957848579102,266.28437168733643 461.9725106115543,349.0959653360261" fill="none" stroke="hsl(73, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
|
|
99
|
+
</g>
|
|
100
|
+
<g>
|
|
101
|
+
<polyline data-points="-1.4,0.42500000000000004 -2.3148566499999994,0.5512093000000002" data-type="line" data-label="" points="211.29957848579102,266.28437168733643 129.39607886784347,254.98535194000064" fill="none" stroke="hsl(73, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
|
|
102
|
+
</g>
|
|
103
|
+
<g>
|
|
104
|
+
<polyline data-points="-1.4,0.42500000000000004 1.7580660749999977,2.3025814000000002" data-type="line" data-label="" points="211.29957848579102,266.28437168733643 494.0287509383446,98.19193067205222" fill="none" stroke="hsl(73, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
|
|
105
|
+
</g>
|
|
106
|
+
<g>
|
|
107
|
+
<polyline data-points="1.4,-0.3 1.4,-0.5" data-type="line" data-label="" points="461.9725106115543,331.1907558984716 461.9725106115543,349.0959653360261" fill="none" stroke="hsl(73, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
|
|
108
|
+
</g>
|
|
109
|
+
<g>
|
|
110
|
+
<polyline data-points="1.4,-0.3 -2.3148566499999994,0.5512093000000002" data-type="line" data-label="" points="461.9725106115543,331.1907558984716 129.39607886784347,254.98535194000064" fill="none" stroke="hsl(73, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
|
|
111
|
+
</g>
|
|
112
|
+
<g>
|
|
113
|
+
<polyline data-points="1.4,-0.3 1.7580660749999977,2.3025814000000002" data-type="line" data-label="" points="461.9725106115543,331.1907558984716 494.0287509383446,98.19193067205222" fill="none" stroke="hsl(73, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
|
|
114
|
+
</g>
|
|
115
|
+
<g>
|
|
116
|
+
<polyline data-points="1.4,-0.5 -2.3148566499999994,0.5512093000000002" data-type="line" data-label="" points="461.9725106115543,349.0959653360261 129.39607886784347,254.98535194000064" fill="none" stroke="hsl(73, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
|
|
117
|
+
</g>
|
|
118
|
+
<g>
|
|
119
|
+
<polyline data-points="1.4,-0.5 1.7580660749999977,2.3025814000000002" data-type="line" data-label="" points="461.9725106115543,349.0959653360261 494.0287509383446,98.19193067205222" fill="none" stroke="hsl(73, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
|
|
120
|
+
</g>
|
|
121
|
+
<g>
|
|
122
|
+
<polyline data-points="-2.3148566499999994,0.5512093000000002 1.7580660749999977,2.3025814000000002" data-type="line" data-label="" points="129.39607886784347,254.98535194000064 494.0287509383446,98.19193067205222" fill="none" stroke="hsl(73, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
|
|
123
|
+
</g>
|
|
124
|
+
<g>
|
|
125
|
+
<polyline data-points="-1.4,-0.42500000000000004 -2.31430995,-0.5512093000000002" data-type="line" data-label="" points="211.29957848579102,342.38151179694313 129.44502275784095,353.6805315442789" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
|
|
126
|
+
</g>
|
|
127
|
+
<g>
|
|
128
|
+
<polyline data-points="1.4,0.5 1.757519574999999,1.2" data-type="line" data-label="" points="461.9725106115543,259.56991814825346 493.97982495355666,196.90168511681264" fill="none" stroke="hsl(304, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
|
|
129
|
+
</g>
|
|
130
|
+
<g>
|
|
131
|
+
<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="211.29957848579102,266.28437168733643 170.34782867681724,266.28437168733643 170.34782867681724,237.0801425024461 129.39607886784347,237.0801425024461 129.39607886784347,254.98535194000064" fill="none" stroke="purple" stroke-width="1" />
|
|
132
|
+
</g>
|
|
133
|
+
<g>
|
|
134
|
+
<polyline data-points="1.4,-0.3 1.5790330374999988,-0.3 1.5790330374999988,2.5025814000000004 1.7580660749999977,2.5025814000000004 1.7580660749999977,2.3025814000000002" data-type="line" data-label="" points="461.9725106115543,331.1907558984716 478.0006307749495,331.1907558984716 478.0006307749495,80.28672123449769 494.0287509383446,80.28672123449769 494.0287509383446,98.19193067205222" fill="none" stroke="purple" stroke-width="1" />
|
|
135
|
+
</g>
|
|
136
|
+
<g>
|
|
137
|
+
<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="461.9725106115543,349.0959653360261 479.8777200491088,349.0959653360261 479.8777200491088,331.1907558984716 461.9725106115543,331.1907558984716" fill="none" stroke="purple" stroke-width="1" />
|
|
138
|
+
</g>
|
|
139
|
+
<g>
|
|
140
|
+
<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="129.44502275784095,353.6805315442789 129.44502275784095,371.58574098183345 170.37230062181598,371.58574098183345 170.37230062181598,342.38151179694313 211.29957848579102,342.38151179694313" fill="none" stroke="purple" stroke-width="1" />
|
|
141
|
+
</g>
|
|
142
|
+
<g>
|
|
143
|
+
<polyline data-points="1.757519574999999,1.2 1.757519574999999,0.5 1.4,0.5" data-type="line" data-label="" points="493.97982495355666,196.90168511681264 493.97982495355666,259.56991814825346 461.9725106115543,259.56991814825346" fill="none" stroke="purple" stroke-width="1" />
|
|
144
|
+
</g>
|
|
145
|
+
<g>
|
|
146
|
+
<polyline data-points="1.757519574999999,-2.2 1.757519574999999,-2 -1.757519574999999,-2 -1.757519574999999,-2.2" data-type="line" data-label="" points="493.97982495355666,501.29024555523955 493.97982495355666,483.385036117685 179.29226414378866,483.385036117685 179.29226414378866,501.29024555523955" fill="none" stroke="purple" stroke-width="1" />
|
|
147
|
+
</g>
|
|
148
|
+
<g>
|
|
149
|
+
<rect data-type="rect" data-label="schematic_component_0" data-x="0" data-y="0" x="211.29957848579102" y="241.66470871069896" width="250.67293212576328" height="125.33646606288164" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.011169933571428573" />
|
|
150
|
+
</g>
|
|
151
|
+
<g>
|
|
152
|
+
<rect data-type="rect" data-label="schematic_component_1" data-x="-2.3145833" data-y="0" x="105.73345381194562" y="254.98535194000064" width="47.37419400179317" height="98.69517960427825" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.011169933571428573" />
|
|
153
|
+
</g>
|
|
154
|
+
<g>
|
|
155
|
+
<rect data-type="rect" data-label="schematic_component_2" data-x="1.7577928249999983" data-y="1.7512907000000002" x="479.87772004910886" y="98.19193067205222" width="28.25313579368361" height="98.70975444476042" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.011169933571428573" />
|
|
156
|
+
</g>
|
|
157
|
+
<g>
|
|
158
|
+
<rect data-type="rect" data-label="schematic_component_3" data-x="-1.7577928249999983" data-y="-2.7512907" x="165.14123325455287" y="501.29024555523955" width="28.253135793683583" height="98.70975444476045" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.011169933571428573" />
|
|
159
|
+
</g>
|
|
160
|
+
<g>
|
|
161
|
+
<rect data-type="rect" data-label="schematic_component_4" data-x="1.7577928249999983" data-y="-2.7512907" x="479.87772004910886" y="501.29024555523955" width="28.25313579368361" height="98.70975444476045" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.011169933571428573" />
|
|
162
|
+
</g>
|
|
163
|
+
<g>
|
|
164
|
+
<rect data-type="rect" data-label="" data-x="-1.8574283249999997" data-y="0.9762093000000004" x="161.39522395803996" y="196.79342126794842" width="17.905209437554532" height="40.28672123449769" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.011169933571428573" />
|
|
165
|
+
</g>
|
|
166
|
+
<g>
|
|
167
|
+
<rect data-type="rect" data-label="" data-x="1.5790330374999988" data-y="2.7275814000000005" x="469.0480260561722" y="40" width="17.90520943755456" height="40.28672123449769" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.011169933571428573" />
|
|
168
|
+
</g>
|
|
169
|
+
<g>
|
|
170
|
+
<rect data-type="rect" data-label="" data-x="-2.31430995" data-y="-0.9762093000000004" x="120.4924180390637" y="371.58574098183345" width="17.905209437554532" height="40.28672123449769" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.011169933571428573" />
|
|
171
|
+
</g>
|
|
172
|
+
<g>
|
|
173
|
+
<rect data-type="rect" data-label="" data-x="1.982519574999999" data-y="0.85" x="493.97982495355666" y="219.2831969137558" width="40.28672123449769" height="17.905209437554532" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.011169933571428573" />
|
|
174
|
+
</g>
|
|
175
|
+
<g>
|
|
176
|
+
<rect data-type="rect" data-label="" data-x="1.982519574999999" data-y="-2" x="493.97982495355666" y="474.43243139890774" width="40.28672123449769" height="17.90520943755456" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.011169933571428573" />
|
|
177
|
+
</g>
|
|
178
|
+
<g id="crosshair" style="display: none">
|
|
179
|
+
<line id="crosshair-h" y1="0" y2="640" stroke="#666" stroke-width="0.5" />
|
|
180
|
+
<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>
|
|
181
|
+
</g>
|
|
182
|
+
<script>
|
|
183
|
+
<![CDATA[
|
|
184
|
+
document.currentScript.parentElement.addEventListener('mousemove', (e) => {
|
|
185
|
+
const svg = e.currentTarget;
|
|
186
|
+
const rect = svg.getBoundingClientRect();
|
|
187
|
+
const x = e.clientX - rect.left;
|
|
188
|
+
const y = e.clientY - rect.top;
|
|
189
|
+
const crosshair = svg.getElementById('crosshair');
|
|
190
|
+
const h = svg.getElementById('crosshair-h');
|
|
191
|
+
const v = svg.getElementById('crosshair-v');
|
|
192
|
+
const coords = svg.getElementById('coordinates');
|
|
193
|
+
|
|
194
|
+
crosshair.style.display = 'block';
|
|
195
|
+
h.setAttribute('x1', '0');
|
|
196
|
+
h.setAttribute('x2', '640');
|
|
197
|
+
h.setAttribute('y1', y);
|
|
198
|
+
h.setAttribute('y2', y);
|
|
199
|
+
v.setAttribute('x1', x);
|
|
200
|
+
v.setAttribute('x2', x);
|
|
201
|
+
v.setAttribute('y1', '0');
|
|
202
|
+
v.setAttribute('y2', '640');
|
|
203
|
+
|
|
204
|
+
// Calculate real coordinates using inverse transformation
|
|
205
|
+
const matrix = {
|
|
206
|
+
"a": 89.52604718777262,
|
|
207
|
+
"c": 0,
|
|
208
|
+
"e": 336.63604454867266,
|
|
209
|
+
"b": 0,
|
|
210
|
+
"d": -89.52604718777262,
|
|
211
|
+
"f": 304.3329417421398
|
|
212
|
+
};
|
|
213
|
+
// Manually invert and apply the affine transform
|
|
214
|
+
// Since we only use translate and scale, we can directly compute:
|
|
215
|
+
// x' = (x - tx) / sx
|
|
216
|
+
// y' = (y - ty) / sy
|
|
217
|
+
const sx = matrix.a;
|
|
218
|
+
const sy = matrix.d;
|
|
219
|
+
const tx = matrix.e;
|
|
220
|
+
const ty = matrix.f;
|
|
221
|
+
const realPoint = {
|
|
222
|
+
x: (x - tx) / sx,
|
|
223
|
+
y: (y - ty) / sy // Flip y back since we used negative scale
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
coords.textContent = `(${realPoint.x.toFixed(2)}, ${realPoint.y.toFixed(2)})`;
|
|
227
|
+
coords.setAttribute('x', (x + 5).toString());
|
|
228
|
+
coords.setAttribute('y', (y - 5).toString());
|
|
229
|
+
});
|
|
230
|
+
document.currentScript.parentElement.addEventListener('mouseleave', () => {
|
|
231
|
+
document.currentScript.parentElement.getElementById('crosshair').style.display = 'none';
|
|
232
|
+
});
|
|
233
|
+
]]>
|
|
234
|
+
</script>
|
|
235
|
+
</svg>
|
|
@@ -0,0 +1,195 @@
|
|
|
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="U1.6
|
|
5
|
+
x+" data-x="0.6000000000000001" data-y="-0.2" cx="160.00000000000003" cy="359.23793250000006" r="3" fill="hsl(324, 100%, 50%, 0.8)" />
|
|
6
|
+
</g>
|
|
7
|
+
<g>
|
|
8
|
+
<circle data-type="point" data-label="U1.8
|
|
9
|
+
x+" data-x="0.6000000000000001" data-y="0" cx="160.00000000000003" cy="339.23793250000006" r="3" fill="hsl(326, 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.2" cx="160.00000000000003" cy="319.23793250000006" r="3" fill="hsl(319, 100%, 50%, 0.8)" />
|
|
14
|
+
</g>
|
|
15
|
+
<g>
|
|
16
|
+
<circle data-type="point" data-label="C2.1
|
|
17
|
+
y-" data-x="1.4002733499999995" data-y="-0.0012093000000001908" cx="240.027335" cy="339.3588625000001" r="3" fill="hsl(2, 100%, 50%, 0.8)" />
|
|
18
|
+
</g>
|
|
19
|
+
<g>
|
|
20
|
+
<circle data-type="point" data-label="C2.2
|
|
21
|
+
y+" data-x="1.3997266500000003" data-y="1.1012093000000003" cx="239.97266500000006" cy="229.1170025" r="3" fill="hsl(3, 100%, 50%, 0.8)" />
|
|
22
|
+
</g>
|
|
23
|
+
<g>
|
|
24
|
+
<circle data-type="point" data-label="R1.1
|
|
25
|
+
x-" data-x="2.1487092999999997" data-y="1.3002732499999994" cx="314.87093" cy="209.21060750000012" r="3" fill="hsl(226, 100%, 50%, 0.8)" />
|
|
26
|
+
</g>
|
|
27
|
+
<g>
|
|
28
|
+
<circle data-type="point" data-label="R1.2
|
|
29
|
+
x+" data-x="3.2512907000000006" data-y="1.2997267500000007" cx="425.12907000000007" cy="209.2652575" r="3" fill="hsl(227, 100%, 50%, 0.8)" />
|
|
30
|
+
</g>
|
|
31
|
+
<g>
|
|
32
|
+
<circle data-type="point" data-label="JP5.1
|
|
33
|
+
x-" data-x="3.8000000000000003" data-y="0" cx="480" cy="339.23793250000006" r="3" fill="hsl(242, 100%, 50%, 0.8)" />
|
|
34
|
+
</g>
|
|
35
|
+
<g>
|
|
36
|
+
<circle data-type="point" data-label="JP9.1
|
|
37
|
+
x-" data-x="3.8000000000000003" data-y="-0.9" cx="480" cy="429.23793250000006" r="3" fill="hsl(126, 100%, 50%, 0.8)" />
|
|
38
|
+
</g>
|
|
39
|
+
<g>
|
|
40
|
+
<circle data-type="point" data-label="JP8.1
|
|
41
|
+
x+" data-x="2.4458007999999998" data-y="-1.2015872704999997" cx="344.58008" cy="459.39665955000004" r="3" fill="hsl(245, 100%, 50%, 0.8)" />
|
|
42
|
+
</g>
|
|
43
|
+
<g>
|
|
44
|
+
<circle data-type="point" data-label="JP8.2
|
|
45
|
+
y+" data-x="2.0034928" data-y="-0.8350319000000007" cx="300.34928" cy="422.74112250000013" r="3" fill="hsl(246, 100%, 50%, 0.8)" />
|
|
46
|
+
</g>
|
|
47
|
+
<g>
|
|
48
|
+
<circle data-type="point" data-label="JP8.3
|
|
49
|
+
x-" data-x="1.5541992" data-y="-1.2014628704999997" cx="255.41992000000002" cy="459.38421955" r="3" fill="hsl(247, 100%, 50%, 0.8)" />
|
|
50
|
+
</g>
|
|
51
|
+
<g>
|
|
52
|
+
<circle data-type="point" data-label="" data-x="1.4002733499999995" data-y="-0.30120930000000024" cx="240.027335" cy="369.3588625000001" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
|
|
53
|
+
</g>
|
|
54
|
+
<g>
|
|
55
|
+
<circle data-type="point" data-label="" data-x="0.7999316625000001" data-y="0.2" cx="179.99316625000006" cy="319.23793250000006" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
|
|
56
|
+
</g>
|
|
57
|
+
<g>
|
|
58
|
+
<circle data-type="point" data-label="" data-x="3.451290700000001" data-y="1.2997267500000007" cx="445.12907000000007" cy="209.2652575" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
|
|
59
|
+
</g>
|
|
60
|
+
<g>
|
|
61
|
+
<circle data-type="point" data-label="" data-x="2.0034928" data-y="-0.46751595000000035" cx="300.34928" cy="385.9895275000001" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
|
|
62
|
+
</g>
|
|
63
|
+
<g>
|
|
64
|
+
<polyline data-points="1.4002733499999995,-0.0012093000000001908 0.6000000000000001,0" data-type="line" data-label="" points="240.027335,339.3588625000001 160.00000000000003,339.23793250000006" fill="none" stroke="hsl(256, 100%, 50%, 0.8)" stroke-width="1" />
|
|
65
|
+
</g>
|
|
66
|
+
<g>
|
|
67
|
+
<polyline data-points="1.3997266500000003,1.1012093000000003 2.1487092999999997,1.3002732499999994" data-type="line" data-label="" points="239.97266500000006,229.1170025 314.87093,209.21060750000012" fill="none" stroke="hsl(256, 100%, 50%, 0.8)" stroke-width="1" />
|
|
68
|
+
</g>
|
|
69
|
+
<g>
|
|
70
|
+
<polyline data-points="2.1487092999999997,1.3002732499999994 0.6000000000000001,0.2" data-type="line" data-label="" points="314.87093,209.21060750000012 160.00000000000003,319.23793250000006" fill="none" stroke="hsl(280, 100%, 50%, 0.8)" stroke-width="1" />
|
|
71
|
+
</g>
|
|
72
|
+
<g>
|
|
73
|
+
<polyline data-points="3.8000000000000003,0 3.2512907000000006,1.2997267500000007" data-type="line" data-label="" points="480,339.23793250000006 425.12907000000007,209.2652575" fill="none" stroke="hsl(336, 100%, 50%, 0.8)" stroke-width="1" />
|
|
74
|
+
</g>
|
|
75
|
+
<g>
|
|
76
|
+
<polyline data-points="3.8000000000000003,-0.9 3.2512907000000006,1.2997267500000007" data-type="line" data-label="" points="480,429.23793250000006 425.12907000000007,209.2652575" fill="none" stroke="hsl(336, 100%, 50%, 0.8)" stroke-width="1" />
|
|
77
|
+
</g>
|
|
78
|
+
<g>
|
|
79
|
+
<polyline data-points="2.0034928,-0.8350319000000007 0.6000000000000001,-0.2" data-type="line" data-label="" points="300.34928,422.74112250000013 160.00000000000003,359.23793250000006" fill="none" stroke="hsl(352, 100%, 50%, 0.8)" stroke-width="1" />
|
|
80
|
+
</g>
|
|
81
|
+
<g>
|
|
82
|
+
<polyline data-points="3.2512907000000006,1.2997267500000007 3.8000000000000003,0" data-type="line" data-label="" points="425.12907000000007,209.2652575 480,339.23793250000006" fill="none" stroke="hsl(123, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
|
|
83
|
+
</g>
|
|
84
|
+
<g>
|
|
85
|
+
<polyline data-points="3.2512907000000006,1.2997267500000007 3.8000000000000003,-0.9" data-type="line" data-label="" points="425.12907000000007,209.2652575 480,429.23793250000006" fill="none" stroke="hsl(123, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
|
|
86
|
+
</g>
|
|
87
|
+
<g>
|
|
88
|
+
<polyline data-points="3.8000000000000003,0 3.8000000000000003,-0.9" data-type="line" data-label="" points="480,339.23793250000006 480,429.23793250000006" fill="none" stroke="hsl(123, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
|
|
89
|
+
</g>
|
|
90
|
+
<g>
|
|
91
|
+
<polyline data-points="1.4002733499999995,-0.0012093000000001908 1.4002733499999995,-0.30120930000000024 1.0001366749999998,-0.30120930000000024 1.0001366749999998,0 0.6000000000000001,0" data-type="line" data-label="" points="240.027335,339.3588625000001 240.027335,369.3588625000001 200.0136675,369.3588625000001 200.0136675,339.23793250000006 160.00000000000003,339.23793250000006" fill="none" stroke="purple" stroke-width="1" />
|
|
92
|
+
</g>
|
|
93
|
+
<g>
|
|
94
|
+
<polyline data-points="2.1487092999999997,1.3002732499999994 1.3997266500000003,1.3002732499999994 1.3997266500000003,1.1012093000000003" data-type="line" data-label="" points="314.87093,209.21060750000012 239.97266500000006,209.21060750000012 239.97266500000006,229.1170025" fill="none" stroke="purple" stroke-width="1" />
|
|
95
|
+
</g>
|
|
96
|
+
<g>
|
|
97
|
+
<polyline data-points="0.6000000000000001,0.2 0.9998633250000002,0.2 0.9998633250000002,1.3012093000000002 1.3997266500000003,1.3012093000000002 1.3997266500000003,1.1012093000000003" data-type="line" data-label="" points="160.00000000000003,319.23793250000006 199.98633250000006,319.23793250000006 199.98633250000006,209.11700250000004 239.97266500000006,209.11700250000004 239.97266500000006,229.1170025" fill="none" stroke="purple" stroke-width="1" />
|
|
98
|
+
</g>
|
|
99
|
+
<g>
|
|
100
|
+
<polyline data-points="3.8000000000000003,-0.9 3.6000000000000005,-0.9 3.6000000000000005,0 3.8000000000000003,0" data-type="line" data-label="" points="480,429.23793250000006 460.0000000000001,429.23793250000006 460.0000000000001,339.23793250000006 480,339.23793250000006" fill="none" stroke="purple" stroke-width="1" />
|
|
101
|
+
</g>
|
|
102
|
+
<g>
|
|
103
|
+
<polyline data-points="3.2512907000000006,1.2997267500000007 3.451290700000001,1.2997267500000007 3.5256453500000005,1.2997267500000007 3.5256453500000005,0 3.6,0 3.8000000000000003,0" data-type="line" data-label="" points="425.12907000000007,209.2652575 445.12907000000007,209.2652575 452.5645350000001,209.2652575 452.5645350000001,339.23793250000006 460,339.23793250000006 480,339.23793250000006" fill="none" stroke="purple" stroke-width="1" />
|
|
104
|
+
</g>
|
|
105
|
+
<g>
|
|
106
|
+
<polyline data-points="2.0034928,-0.8350319000000007 2.0034928,-0.1 0.7000000000000001,-0.1 0.7000000000000001,-0.2 0.6000000000000001,-0.2" data-type="line" data-label="" points="300.34928,422.74112250000013 300.34928,349.23793250000006 170.00000000000003,349.23793250000006 170.00000000000003,359.23793250000006 160.00000000000003,359.23793250000006" fill="none" stroke="purple" stroke-width="1" />
|
|
107
|
+
</g>
|
|
108
|
+
<g>
|
|
109
|
+
<rect data-type="rect" data-label="schematic_component_0" data-x="0" data-y="0" x="40.00000000000002" y="299.23793250000006" width="120" height="80" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.01" />
|
|
110
|
+
</g>
|
|
111
|
+
<g>
|
|
112
|
+
<rect data-type="rect" data-label="schematic_component_1" data-x="1.4" data-y="0.55" x="213.54167" y="229.1170025" width="52.916660000000036" height="110.24186000000009" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.01" />
|
|
113
|
+
</g>
|
|
114
|
+
<g>
|
|
115
|
+
<rect data-type="rect" data-label="schematic_component_2" data-x="2.7" data-y="1.3" x="314.87093" y="189.7923975000001" width="110.25814000000008" height="38.8910699999999" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.01" />
|
|
116
|
+
</g>
|
|
117
|
+
<g>
|
|
118
|
+
<rect data-type="rect" data-label="schematic_component_3" data-x="4.4" data-y="0" x="480" y="319.23793250000006" width="120" height="40" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.01" />
|
|
119
|
+
</g>
|
|
120
|
+
<g>
|
|
121
|
+
<rect data-type="rect" data-label="schematic_component_4" data-x="4.4" data-y="-0.9" x="480" y="409.23793250000006" width="120" height="40" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.01" />
|
|
122
|
+
</g>
|
|
123
|
+
<g>
|
|
124
|
+
<rect data-type="rect" data-label="schematic_component_5" data-x="2" data-y="-1.1" x="255.41992000000002" y="422.74112250000013" width="89.16015999999999" height="52.99361999999991" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.01" />
|
|
125
|
+
</g>
|
|
126
|
+
<g>
|
|
127
|
+
<rect data-type="rect" data-label="" data-x="1.6252733499999996" data-y="-0.30120930000000024" x="240.027335" y="359.3588625000001" width="45" height="20" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.01" />
|
|
128
|
+
</g>
|
|
129
|
+
<g>
|
|
130
|
+
<rect data-type="rect" data-label="" data-x="0.7999316625000001" data-y="0.42500000000000004" x="169.99316625000006" y="274.23793250000006" width="20" height="45" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.01" />
|
|
131
|
+
</g>
|
|
132
|
+
<g>
|
|
133
|
+
<rect data-type="rect" data-label="" data-x="3.451290700000001" data-y="1.5247267500000008" x="435.12907000000007" y="164.26525749999996" width="20" height="45.00000000000003" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.01" />
|
|
134
|
+
</g>
|
|
135
|
+
<g>
|
|
136
|
+
<rect data-type="rect" data-label="" data-x="2.2284928" data-y="-0.46751595000000035" x="300.34928" y="375.9895275000001" width="45" height="19.999999999999943" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.01" />
|
|
137
|
+
</g>
|
|
138
|
+
<g id="crosshair" style="display: none">
|
|
139
|
+
<line id="crosshair-h" y1="0" y2="640" stroke="#666" stroke-width="0.5" />
|
|
140
|
+
<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>
|
|
141
|
+
</g>
|
|
142
|
+
<script>
|
|
143
|
+
<![CDATA[
|
|
144
|
+
document.currentScript.parentElement.addEventListener('mousemove', (e) => {
|
|
145
|
+
const svg = e.currentTarget;
|
|
146
|
+
const rect = svg.getBoundingClientRect();
|
|
147
|
+
const x = e.clientX - rect.left;
|
|
148
|
+
const y = e.clientY - rect.top;
|
|
149
|
+
const crosshair = svg.getElementById('crosshair');
|
|
150
|
+
const h = svg.getElementById('crosshair-h');
|
|
151
|
+
const v = svg.getElementById('crosshair-v');
|
|
152
|
+
const coords = svg.getElementById('coordinates');
|
|
153
|
+
|
|
154
|
+
crosshair.style.display = 'block';
|
|
155
|
+
h.setAttribute('x1', '0');
|
|
156
|
+
h.setAttribute('x2', '640');
|
|
157
|
+
h.setAttribute('y1', y);
|
|
158
|
+
h.setAttribute('y2', y);
|
|
159
|
+
v.setAttribute('x1', x);
|
|
160
|
+
v.setAttribute('x2', x);
|
|
161
|
+
v.setAttribute('y1', '0');
|
|
162
|
+
v.setAttribute('y2', '640');
|
|
163
|
+
|
|
164
|
+
// Calculate real coordinates using inverse transformation
|
|
165
|
+
const matrix = {
|
|
166
|
+
"a": 100,
|
|
167
|
+
"c": 0,
|
|
168
|
+
"e": 100.00000000000003,
|
|
169
|
+
"b": 0,
|
|
170
|
+
"d": -100,
|
|
171
|
+
"f": 339.23793250000006
|
|
172
|
+
};
|
|
173
|
+
// Manually invert and apply the affine transform
|
|
174
|
+
// Since we only use translate and scale, we can directly compute:
|
|
175
|
+
// x' = (x - tx) / sx
|
|
176
|
+
// y' = (y - ty) / sy
|
|
177
|
+
const sx = matrix.a;
|
|
178
|
+
const sy = matrix.d;
|
|
179
|
+
const tx = matrix.e;
|
|
180
|
+
const ty = matrix.f;
|
|
181
|
+
const realPoint = {
|
|
182
|
+
x: (x - tx) / sx,
|
|
183
|
+
y: (y - ty) / sy // Flip y back since we used negative scale
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
coords.textContent = `(${realPoint.x.toFixed(2)}, ${realPoint.y.toFixed(2)})`;
|
|
187
|
+
coords.setAttribute('x', (x + 5).toString());
|
|
188
|
+
coords.setAttribute('y', (y - 5).toString());
|
|
189
|
+
});
|
|
190
|
+
document.currentScript.parentElement.addEventListener('mouseleave', () => {
|
|
191
|
+
document.currentScript.parentElement.getElementById('crosshair').style.display = 'none';
|
|
192
|
+
});
|
|
193
|
+
]]>
|
|
194
|
+
</script>
|
|
195
|
+
</svg>
|