@tscircuit/schematic-trace-solver 0.0.86 → 0.0.88
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/.agents/skills/schematic-trace-visualization/SKILL.md +115 -0
- package/.github/scripts/import-json-bug-report.ts +15 -1
- package/.github/workflows/json-bug-report.yml +3 -2
- package/AGENTS.md +22 -0
- package/dist/index.js +86 -10
- package/lib/solvers/Example28Solver/Example28Solver.ts +46 -10
- package/lib/solvers/Example28Solver/countCrossingsWithOtherTraces.ts +19 -0
- package/lib/solvers/Example28Solver/scoreSolutionTracePath.ts +26 -0
- package/lib/testing/PipelineStageDebugRunner.ts +344 -0
- package/package.json +3 -2
- package/scripts/debug-pipeline-stages.ts +146 -0
- package/site/bug-reports/bug-report-20260706T220324Z.page.tsx +4 -0
- package/site/bug-reports/bug-report-20260707T020342Z.page.tsx +4 -0
- package/site/bug-reports/bug-report-20260707T092615Z.page.tsx +4 -0
- package/site/bug-reports/bug-report-20260707T134549Z.page.tsx +4 -0
- package/site/bug-reports/bug-report-20260707T134722Z.page.tsx +4 -0
- package/site/bug-reports/bug-report-20260707T140410Z.page.tsx +4 -0
- package/site/bug-reports/bug-report-20260707T141025Z.page.tsx +4 -0
- package/site/bug-reports/bug-report-20260707T141421Z.page.tsx +4 -0
- package/tests/bug-reports/bug-report-20260706T220324Z/__snapshots__/bug-report-20260706T220324Z.snap.svg +357 -3448
- package/tests/bug-reports/bug-report-20260707T020342Z/__snapshots__/bug-report-20260707T020342Z.snap.svg +64 -0
- package/tests/bug-reports/bug-report-20260707T020342Z/bug-report-20260707T020342Z.json +233 -0
- package/tests/bug-reports/bug-report-20260707T020342Z/bug-report-20260707T020342Z.test.ts +12 -0
- package/tests/bug-reports/bug-report-20260707T092615Z/__snapshots__/bug-report-20260707T092615Z.snap.svg +2098 -0
- package/tests/bug-reports/bug-report-20260707T092615Z/bug-report-20260707T092615Z.json +1392 -0
- package/tests/bug-reports/bug-report-20260707T092615Z/bug-report-20260707T092615Z.test.ts +12 -0
- package/tests/bug-reports/bug-report-20260707T134549Z/__snapshots__/bug-report-20260707T134549Z.snap.svg +857 -0
- package/tests/bug-reports/bug-report-20260707T134549Z/bug-report-20260707T134549Z.json +652 -0
- package/tests/bug-reports/bug-report-20260707T134549Z/bug-report-20260707T134549Z.test.ts +12 -0
- package/tests/bug-reports/bug-report-20260707T134722Z/__snapshots__/bug-report-20260707T134722Z.snap.svg +275 -0
- package/tests/bug-reports/bug-report-20260707T134722Z/bug-report-20260707T134722Z.json +265 -0
- package/tests/bug-reports/bug-report-20260707T134722Z/bug-report-20260707T134722Z.test.ts +12 -0
- package/tests/bug-reports/bug-report-20260707T140410Z/__snapshots__/bug-report-20260707T140410Z.snap.svg +950 -0
- package/tests/bug-reports/bug-report-20260707T140410Z/bug-report-20260707T140410Z.json +610 -0
- package/tests/bug-reports/bug-report-20260707T140410Z/bug-report-20260707T140410Z.test.ts +12 -0
- package/tests/bug-reports/bug-report-20260707T141025Z/__snapshots__/bug-report-20260707T141025Z.snap.svg +218 -0
- package/tests/bug-reports/bug-report-20260707T141025Z/bug-report-20260707T141025Z.json +185 -0
- package/tests/bug-reports/bug-report-20260707T141025Z/bug-report-20260707T141025Z.test.ts +12 -0
- package/tests/bug-reports/bug-report-20260707T141421Z/__snapshots__/bug-report-20260707T141421Z.snap.svg +613 -0
- package/tests/bug-reports/bug-report-20260707T141421Z/bug-report-20260707T141421Z.json +499 -0
- package/tests/bug-reports/bug-report-20260707T141421Z/bug-report-20260707T141421Z.test.ts +12 -0
- package/tests/examples/__snapshots__/example01.snap.svg +59 -162
- package/tests/examples/__snapshots__/example02.snap.svg +64 -273
- package/tests/examples/__snapshots__/example03.snap.svg +85 -290
- package/tests/examples/__snapshots__/example04.snap.svg +50 -94
- package/tests/examples/__snapshots__/example05.snap.svg +73 -191
- package/tests/examples/__snapshots__/example06.snap.svg +49 -95
- package/tests/examples/__snapshots__/example07.snap.svg +65 -218
- package/tests/examples/__snapshots__/example08.snap.svg +61 -143
- package/tests/examples/__snapshots__/example09.snap.svg +123 -493
- package/tests/examples/__snapshots__/example10.snap.svg +57 -136
- package/tests/examples/__snapshots__/example11.snap.svg +64 -173
- package/tests/examples/__snapshots__/example12.snap.svg +58 -159
- package/tests/examples/__snapshots__/example13.snap.svg +78 -348
- package/tests/examples/__snapshots__/example14.snap.svg +77 -293
- package/tests/examples/__snapshots__/example15.snap.svg +140 -984
- package/tests/examples/__snapshots__/example16.snap.svg +62 -162
- package/tests/examples/__snapshots__/example17.snap.svg +67 -198
- package/tests/examples/__snapshots__/example18.snap.svg +69 -249
- package/tests/examples/__snapshots__/example19.snap.svg +63 -202
- package/tests/examples/__snapshots__/example20.snap.svg +60 -148
- package/tests/examples/__snapshots__/example21.snap.svg +73 -298
- package/tests/examples/__snapshots__/example22.snap.svg +62 -156
- package/tests/examples/__snapshots__/example23.snap.svg +66 -172
- package/tests/examples/__snapshots__/example24.snap.svg +64 -164
- package/tests/examples/__snapshots__/example25.snap.svg +76 -299
- package/tests/examples/__snapshots__/example26.snap.svg +64 -164
- package/tests/examples/__snapshots__/example27.snap.svg +83 -300
- package/tests/examples/__snapshots__/example28.snap.svg +54 -115
- package/tests/examples/__snapshots__/example29.snap.svg +257 -1299
- package/tests/examples/__snapshots__/example30.snap.svg +91 -293
- package/tests/examples/__snapshots__/example31.snap.svg +47 -88
- package/tests/examples/__snapshots__/example32.snap.svg +107 -405
- package/tests/examples/__snapshots__/example33.snap.svg +71 -180
- package/tests/examples/__snapshots__/example34.snap.svg +55 -116
- package/tests/examples/__snapshots__/example35.snap.svg +69 -176
- package/tests/examples/__snapshots__/example36.snap.svg +65 -159
- package/tests/examples/__snapshots__/example37.snap.svg +75 -223
- package/tests/examples/__snapshots__/example38.snap.svg +46 -76
- package/tests/examples/__snapshots__/example39.snap.svg +51 -106
- package/tests/examples/__snapshots__/example40.snap.svg +83 -270
- package/tests/examples/__snapshots__/example41.snap.svg +54 -118
- package/tests/examples/__snapshots__/example42.snap.svg +67 -194
- package/tests/examples/__snapshots__/example43.snap.svg +62 -168
- package/tests/examples/__snapshots__/example44.snap.svg +86 -369
- package/tests/examples/__snapshots__/example45.snap.svg +60 -169
- package/tests/examples/__snapshots__/example46.snap.svg +80 -342
- package/tests/examples/__snapshots__/example47.snap.svg +82 -323
- package/tests/examples/__snapshots__/example48.snap.svg +64 -167
- package/tests/examples/__snapshots__/example49.snap.svg +120 -565
- package/tests/examples/__snapshots__/example50.snap.svg +71 -195
- package/tests/fixtures/getLastStepGraphicsObject.ts +38 -0
- package/tests/fixtures/getLastStepSvg.ts +9 -0
- package/tests/repros/__snapshots__/bugreport-001-gnd-overlap.snap.svg +67 -218
- package/tests/repros/__snapshots__/manufacturePartNumber-text-box.snap.svg +47 -87
- package/tests/repros/__snapshots__/netlabel-connector-through-rail-label.snap.svg +73 -272
- package/tests/repros/__snapshots__/repro-atmega328p-fault-pullup.snap.svg +284 -0
- package/tests/repros/__snapshots__/repro-atmega328p-missing-gnd-netlabel.snap.svg +470 -0
- package/tests/repros/__snapshots__/repro-bq24074-battery-charger.snap.svg +94 -395
- package/tests/repros/__snapshots__/repro-cc2340r5.snap.svg +88 -467
- package/tests/repros/__snapshots__/repro-ina237-current-monitor.snap.svg +109 -569
- package/tests/repros/__snapshots__/repro130-bq27441-fuel-gauge-trace-through-c1.snap.svg +95 -459
- package/tests/repros/__snapshots__/repro51-overlap-junction-crossing.snap.svg +64 -176
- package/tests/repros/__snapshots__/trace-overlap-box-resistor.snap.svg +51 -112
- package/tests/repros/assets/repro-atmega328p-fault-pullup.input.json +239 -0
- package/tests/repros/assets/repro-atmega328p-missing-gnd-netlabel.input.json +432 -0
- package/tests/repros/repro-atmega328p-fault-pullup.test.ts +11 -0
- package/tests/repros/repro-atmega328p-missing-gnd-netlabel.test.ts +16 -0
- package/tests/solvers/SchematicTraceSingleLineSolver2/__snapshots__/SchematicTraceSingleLineSolver2_01-example17-d1_1-u1_1.snap.svg +59 -159
- package/tests/solvers/TraceCleanupSolver/__snapshots__/TraceCleanupSolver.snap.svg +54 -118
- package/tests/solvers/TraceLabelOverlapAvoidanceSolver/__snapshots__/TraceLabelOverlapAvoidanceSolver.snap.svg +58 -245
- package/tests/solvers/TraceLabelOverlapAvoidanceSolver/renderComparisonView/__snapshots__/renderComparisonView01.snap.svg +73 -222
- package/tests/solvers/TraceLabelOverlapAvoidanceSolver/renderComparisonView/__snapshots__/renderComparisonView02.snap.svg +65 -204
- package/tests/solvers/TraceLabelOverlapAvoidanceSolver/renderComparisonView/__snapshots__/renderComparisonView03.snap.svg +65 -183
- package/tests/solvers/TraceLabelOverlapAvoidanceSolver/sub-solver/__snapshots__/MergedNetLabelObstacles.snap.svg +54 -139
- package/tests/solvers/TraceLabelOverlapAvoidanceSolver/sub-solver/__snapshots__/OverlapAvoidanceStepSolver.snap.svg +61 -215
- package/tests/solvers/TraceLabelOverlapAvoidanceSolver/sub-solver/__snapshots__/SingleOverlapSolver.snap.svg +54 -124
|
@@ -1,196 +1,72 @@
|
|
|
1
|
-
<svg width="640" height="640" viewBox="0 0 640 640" xmlns="http://www.w3.org/2000/svg"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
x-" data-x="-1.5225" data-y="-8.1" cx="
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
x
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
x-" data-x="-1.5225" data-y="-8.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
orientation: x+" data-x="-0.8499999999999999" data-y="-6.6" cx="223.4006899950715" cy="219.67471660916704" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
|
|
50
|
-
</g>
|
|
51
|
-
<g>
|
|
52
|
-
<circle data-type="point" data-label="anchorPoint
|
|
53
|
-
orientation: x-" data-x="-1.5225" data-y="-8.700000000000001" cx="161.5311319204863" cy="412.87333661902426" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
|
|
54
|
-
</g>
|
|
55
|
-
<g>
|
|
56
|
-
<circle data-type="point" data-label="anchorPoint
|
|
57
|
-
orientation: x-" data-x="-1.5225" data-y="-8.1" cx="161.5311319204863" cy="357.6737309019221" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
|
|
58
|
-
</g>
|
|
59
|
-
<g>
|
|
60
|
-
<circle data-type="point" data-label="anchorPoint
|
|
61
|
-
orientation: x-" data-x="-1.5225" data-y="-8.3" cx="161.5311319204863" cy="376.0735994742896" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
|
|
62
|
-
</g>
|
|
63
|
-
<g>
|
|
64
|
-
<circle data-type="point" data-label="anchorPoint
|
|
65
|
-
orientation: x-" data-x="-1.5225" data-y="-8.5" cx="161.5311319204863" cy="394.4734680466569" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
|
|
66
|
-
</g>
|
|
67
|
-
<g>
|
|
68
|
-
<circle data-type="point" data-label="anchorPoint
|
|
69
|
-
orientation: x+" data-x="1.8225" data-y="-8.1" cx="469.2689337933301" cy="357.6737309019221" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
|
|
70
|
-
</g>
|
|
71
|
-
<g>
|
|
72
|
-
<circle data-type="point" data-label="anchorPoint
|
|
73
|
-
orientation: x+" data-x="1.9224999999999999" data-y="-8.3" cx="478.46886807951375" cy="376.0735994742896" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
|
|
74
|
-
</g>
|
|
75
|
-
<g>
|
|
76
|
-
<circle data-type="point" data-label="anchorPoint
|
|
77
|
-
orientation: y-" data-x="1.6235" data-y="-8.901" cx="450.9610645638246" cy="431.3652045342533" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
|
|
78
|
-
</g>
|
|
79
|
-
<g>
|
|
80
|
-
<polyline data-points="-1.95,-6.6 1.5225,-8.5" data-type="line" data-label="" points="122.2014128470511,219.67471660916704 441.66913093477905,394.4734680466569" fill="none" stroke="hsl(154, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
|
|
81
|
-
</g>
|
|
82
|
-
<g>
|
|
83
|
-
<polyline data-points="-0.8499999999999999,-6.6 -1.5225,-8.700000000000001" data-type="line" data-label="" points="223.4006899950715,219.67471660916704 161.5311319204863,412.87333661902426" fill="none" stroke="hsl(172, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
|
|
84
|
-
</g>
|
|
85
|
-
<g>
|
|
86
|
-
<polyline data-points="-1.95,-6.6 -2.15,-6.6 -2.15,-7.55 1.7225000000000004,-7.55 1.7225000000000004,-8.5 1.5225000000000002,-8.5" data-type="line" data-label="" points="122.2014128470511,219.67471660916704 103.80154427468375,219.67471660916704 103.80154427468375,307.0740923279119 460.06899950714643,307.0740923279119 460.06899950714643,394.4734680466569 441.6691309347791,394.4734680466569" fill="none" stroke="purple" stroke-width="1" />
|
|
87
|
-
</g>
|
|
88
|
-
<g>
|
|
89
|
-
<polyline data-points="1.5225,-8.1 1.8225,-8.1" data-type="line" data-label="" points="441.66913093477905,357.6737309019221 469.2689337933301,357.6737309019221" fill="none" stroke="purple" stroke-width="1" />
|
|
90
|
-
</g>
|
|
91
|
-
<g>
|
|
92
|
-
<polyline data-points="1.5225,-8.3 1.9224999999999999,-8.3" data-type="line" data-label="" points="441.66913093477905,376.0735994742896 478.46886807951375,376.0735994742896" fill="none" stroke="purple" stroke-width="1" />
|
|
93
|
-
</g>
|
|
94
|
-
<g>
|
|
95
|
-
<polyline data-points="1.5225,-8.700000000000001 1.6235,-8.700000000000001 1.6235,-8.901" data-type="line" data-label="" points="441.66913093477905,412.87333661902426 450.9610645638246,412.87333661902426 450.9610645638246,431.3652045342533" fill="none" stroke="purple" stroke-width="1" />
|
|
96
|
-
</g>
|
|
97
|
-
<g>
|
|
98
|
-
<rect data-type="rect" data-label="schematic_component_0" data-x="-1.4" data-y="-6.6" x="122.2014128470511" y="183.84508033514044" width="101.1992771480204" height="71.6592725480532" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.010869642857142855" />
|
|
99
|
-
</g>
|
|
100
|
-
<g>
|
|
101
|
-
<rect data-type="rect" data-label="schematic_component_1" data-x="0" data-y="-8.4" x="161.5311319204863" y="339.27386232955485" width="280.13799901429275" height="91.99934286183668" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.010869642857142855" />
|
|
102
|
-
</g>
|
|
103
|
-
<g>
|
|
104
|
-
<rect data-type="rect" data-label="netId: V3V3
|
|
105
|
-
globalConnNetId: connectivity_net0" data-x="-2.15" data-y="-6.3" x="94.60160998850009" y="164.47511089206512" width="18.399868572367353" height="55.19960571710192" fill="#ef444466" stroke="#ef4444" stroke-width="0.010869642857142855" />
|
|
106
|
-
</g>
|
|
107
|
-
<g>
|
|
108
|
-
<rect data-type="rect" data-label="netId: QSPI_CS
|
|
109
|
-
globalConnNetId: connectivity_net1" data-x="-0.3689999999999999" data-y="-6.6" x="223.4926893379333" y="210.4747823229834" width="88.31936914736326" height="18.399868572367268" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.010869642857142855" />
|
|
110
|
-
</g>
|
|
111
|
-
<g>
|
|
112
|
-
<rect data-type="rect" data-label="netId: QSPI_CS
|
|
113
|
-
globalConnNetId: connectivity_net1" data-x="-2.0035" data-y="-8.700000000000001" x="73.11976343026123" y="403.6734023328406" width="88.31936914736323" height="18.399868572367268" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.010869642857142855" />
|
|
114
|
-
</g>
|
|
115
|
-
<g>
|
|
116
|
-
<rect data-type="rect" data-label="netId: QSPI_SCK
|
|
117
|
-
globalConnNetId: connectivity_net2" data-x="-2.0635" data-y="-8.1" x="62.0798422868408" y="348.4737966157385" width="99.35929029078366" height="18.399868572367268" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.010869642857142855" />
|
|
118
|
-
</g>
|
|
119
|
-
<g>
|
|
120
|
-
<rect data-type="rect" data-label="netId: QSPI_DATA0
|
|
121
|
-
globalConnNetId: connectivity_net3" data-x="-2.1835" data-y="-8.3" x="40" y="366.873665188106" width="121.43913257762446" height="18.399868572367268" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.010869642857142855" />
|
|
122
|
-
</g>
|
|
123
|
-
<g>
|
|
124
|
-
<rect data-type="rect" data-label="netId: QSPI_DATA1
|
|
125
|
-
globalConnNetId: connectivity_net4" data-x="-2.1835" data-y="-8.5" x="40" y="385.27353376047324" width="121.43913257762446" height="18.399868572367268" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.010869642857142855" />
|
|
126
|
-
</g>
|
|
127
|
-
<g>
|
|
128
|
-
<rect data-type="rect" data-label="netId: QSPI_DATA2
|
|
129
|
-
globalConnNetId: connectivity_net5" data-x="2.4835000000000003" data-y="-8.1" x="469.36093313619193" y="348.4737966157385" width="121.43913257762443" height="18.399868572367268" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.010869642857142855" />
|
|
130
|
-
</g>
|
|
131
|
-
<g>
|
|
132
|
-
<rect data-type="rect" data-label="netId: QSPI_DATA3
|
|
133
|
-
globalConnNetId: connectivity_net6" data-x="2.5835" data-y="-8.3" x="478.56086742237557" y="366.873665188106" width="121.43913257762443" height="18.399868572367268" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.010869642857142855" />
|
|
134
|
-
</g>
|
|
135
|
-
<g>
|
|
136
|
-
<rect data-type="rect" data-label="netId: GND
|
|
137
|
-
globalConnNetId: connectivity_net7" data-x="1.6235" data-y="-9.141" x="441.76113027764086" y="431.3652045342533" width="18.39986857236738" height="44.159684573681716" fill="#00000066" stroke="#000000" stroke-width="0.010869642857142855" />
|
|
138
|
-
</g>
|
|
139
|
-
<g id="crosshair" style="display: none">
|
|
140
|
-
<line id="crosshair-h" y1="0" y2="640" stroke="#666" stroke-width="0.5" />
|
|
141
|
-
<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>
|
|
142
|
-
</g>
|
|
143
|
-
<script>
|
|
144
|
-
<![CDATA[
|
|
145
|
-
document.currentScript.parentElement.addEventListener('mousemove', (e) => {
|
|
146
|
-
const svg = e.currentTarget;
|
|
147
|
-
const rect = svg.getBoundingClientRect();
|
|
148
|
-
const x = e.clientX - rect.left;
|
|
149
|
-
const y = e.clientY - rect.top;
|
|
150
|
-
const crosshair = svg.getElementById('crosshair');
|
|
151
|
-
const h = svg.getElementById('crosshair-h');
|
|
152
|
-
const v = svg.getElementById('crosshair-v');
|
|
153
|
-
const coords = svg.getElementById('coordinates');
|
|
1
|
+
<svg width="640" height="640" viewBox="0 0 640 640" xmlns="http://www.w3.org/2000/svg"><rect width="100%" height="100%" fill="white"/><g><polyline data-points="-1.95,-6.6 1.5225,-8.5" data-type="line" data-label="" points="126.46276136167273,214.47382063245198 462.4917919474684,398.33419733886296" fill="none" stroke="hsl(154, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-0.8499999999999999,-6.6 -1.5225,-8.700000000000001" data-type="line" data-label="" points="232.90824261275273,214.47382063245198 167.83134612061517,417.68792120269575" fill="none" stroke="hsl(172, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-1.95,-6.6 -2.15,-6.6 -2.15,-7.55 2.9435000000000002,-7.55 2.9435000000000002,-8.5 1.5225000000000002,-8.5" data-type="line" data-label="" points="126.46276136167273,214.47382063245198 107.10903749784,214.47382063245198 107.10903749784,306.40400898565747 600,306.40400898565747 600,398.33419733886296 462.4917919474684,398.33419733886296" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="1.5225,-8.700000000000001 1.6235,-8.700000000000001 1.6235,-8.901" data-type="line" data-label="" points="462.4917919474684,417.68792120269575 472.26542249870397,417.68792120269575 472.26542249870397,437.1384136858476" fill="none" stroke="purple" stroke-width="1px"/></g><g><rect data-type="rect" data-label="schematic_component_0" data-x="-1.4" data-y="-6.6" x="126.46276136167272" y="176.78676412649037" width="106.44548125108" height="75.37411301192321" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.010333928571428572"/></g><g><rect data-type="rect" data-label="schematic_component_1" data-x="0" data-y="-8.4" x="167.8313461206152" y="340.2730257473648" width="294.6604458268532" height="96.76861931916358" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.010333928571428572"/></g><g><rect data-type="rect" data-label="netId: V3V3
|
|
2
|
+
globalConnNetId: connectivity_net0" data-x="-2.15" data-y="-6.3" x="97.43217556592363" y="156.41264904095385" width="19.353723863832755" height="58.06117159149812" fill="#ef444466" stroke="#ef4444" stroke-width="0.010333928571428572"/></g><g><rect data-type="rect" data-label="netId: QSPI_CS
|
|
3
|
+
globalConnNetId: connectivity_net1" data-x="-0.3689999999999999" data-y="-6.6" x="233.00501123207187" y="204.79695870053564" width="92.8978745463971" height="19.35372386383267" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.010333928571428572"/></g><g><rect data-type="rect" data-label="netId: QSPI_CS
|
|
4
|
+
globalConnNetId: connectivity_net1" data-x="-2.0035" data-y="-8.700000000000001" x="74.83670295489894" y="408.0110592707794" width="92.8978745463971" height="19.35372386383267" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.010333928571428572"/></g><g><rect data-type="rect" data-label="netId: QSPI_SCK
|
|
5
|
+
globalConnNetId: connectivity_net2" data-x="-2.0635" data-y="-8.1" x="63.22446863659928" y="349.94988767928106" width="104.51010886469675" height="19.35372386383267" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.010333928571428572"/></g><g><rect data-type="rect" data-label="netId: QSPI_DATA0
|
|
6
|
+
globalConnNetId: connectivity_net3" data-x="-2.1835" data-y="-8.3" x="40" y="369.30361154311396" width="127.73457750129603" height="19.35372386383267" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.010333928571428572"/></g><g><rect data-type="rect" data-label="netId: QSPI_DATA1
|
|
7
|
+
globalConnNetId: connectivity_net4" data-x="-2.1835" data-y="-8.5" x="40" y="388.65733540694663" width="127.73457750129603" height="19.35372386383267" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.010333928571428572"/></g><g><rect data-type="rect" data-label="netId: QSPI_DATA2
|
|
8
|
+
globalConnNetId: connectivity_net5" data-x="2.1835" data-y="-8.1" x="462.58856056678763" y="349.94988767928106" width="127.73457750129603" height="19.35372386383267" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.010333928571428572"/></g><g><rect data-type="rect" data-label="netId: QSPI_DATA3
|
|
9
|
+
globalConnNetId: connectivity_net6" data-x="2.1835" data-y="-8.3" x="462.58856056678763" y="369.30361154311396" width="127.73457750129603" height="19.35372386383267" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.010333928571428572"/></g><g><rect data-type="rect" data-label="netId: GND
|
|
10
|
+
globalConnNetId: connectivity_net7" data-x="1.6235" data-y="-9.141" x="462.5885605667876" y="437.1384136858475" width="19.353723863832784" height="46.44893727319857" fill="#00000066" stroke="#000000" stroke-width="0.010333928571428572"/></g><g><circle data-type="point" data-label="R7.1
|
|
11
|
+
x-" data-x="-1.95" data-y="-6.6" cx="126.46276136167273" cy="214.47382063245198" r="3" fill="hsl(232, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="R7.2
|
|
12
|
+
x+" data-x="-0.8499999999999999" data-y="-6.6" cx="232.90824261275273" cy="214.47382063245198" r="3" fill="hsl(233, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U5.1
|
|
13
|
+
x-" data-x="-1.5225" data-y="-8.1" cx="167.83134612061517" cy="359.6267496111974" r="3" fill="hsl(203, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U5.2
|
|
14
|
+
x-" data-x="-1.5225" data-y="-8.3" cx="167.83134612061517" cy="378.9804734750303" r="3" fill="hsl(204, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U5.3
|
|
15
|
+
x-" data-x="-1.5225" data-y="-8.5" cx="167.83134612061517" cy="398.33419733886296" r="3" fill="hsl(205, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U5.4
|
|
16
|
+
x-" data-x="-1.5225" data-y="-8.700000000000001" cx="167.83134612061517" cy="417.68792120269575" r="3" fill="hsl(206, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U5.5
|
|
17
|
+
x+" data-x="1.5225" data-y="-8.1" cx="462.4917919474684" cy="359.6267496111974" r="3" fill="hsl(207, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U5.6
|
|
18
|
+
x+" data-x="1.5225" data-y="-8.3" cx="462.4917919474684" cy="378.9804734750303" r="3" fill="hsl(208, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U5.7
|
|
19
|
+
x+" data-x="1.5225" data-y="-8.700000000000001" cx="462.4917919474684" cy="417.68792120269575" r="3" fill="hsl(209, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U5.8
|
|
20
|
+
x+" data-x="1.5225" data-y="-8.5" cx="462.4917919474684" cy="398.33419733886296" r="3" fill="hsl(210, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="anchorPoint
|
|
21
|
+
orientation: y+" data-x="-2.15" data-y="-6.6" cx="107.10903749784" cy="214.47382063245198" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
|
|
22
|
+
orientation: x+" data-x="-0.8499999999999999" data-y="-6.6" cx="232.90824261275273" cy="214.47382063245198" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
|
|
23
|
+
orientation: x-" data-x="-1.5225" data-y="-8.700000000000001" cx="167.83134612061517" cy="417.68792120269575" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
|
|
24
|
+
orientation: x-" data-x="-1.5225" data-y="-8.1" cx="167.83134612061517" cy="359.6267496111974" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
|
|
25
|
+
orientation: x-" data-x="-1.5225" data-y="-8.3" cx="167.83134612061517" cy="378.9804734750303" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
|
|
26
|
+
orientation: x-" data-x="-1.5225" data-y="-8.5" cx="167.83134612061517" cy="398.33419733886296" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
|
|
27
|
+
orientation: x+" data-x="1.5225" data-y="-8.1" cx="462.4917919474684" cy="359.6267496111974" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
|
|
28
|
+
orientation: x+" data-x="1.5225" data-y="-8.3" cx="462.4917919474684" cy="378.9804734750303" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
|
|
29
|
+
orientation: y-" data-x="1.6235" data-y="-8.901" cx="472.26542249870397" cy="437.1384136858476" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g id="crosshair" style="display: none"><line id="crosshair-h" y1="0" y2="640" stroke="#666" stroke-width="0.5"/><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></g><script><![CDATA[
|
|
30
|
+
document.currentScript.parentElement.addEventListener('mousemove', (e) => {
|
|
31
|
+
const svg = e.currentTarget;
|
|
32
|
+
const rect = svg.getBoundingClientRect();
|
|
33
|
+
const x = e.clientX - rect.left;
|
|
34
|
+
const y = e.clientY - rect.top;
|
|
35
|
+
const crosshair = svg.getElementById('crosshair');
|
|
36
|
+
const h = svg.getElementById('crosshair-h');
|
|
37
|
+
const v = svg.getElementById('crosshair-v');
|
|
38
|
+
const coords = svg.getElementById('coordinates');
|
|
39
|
+
|
|
40
|
+
crosshair.style.display = 'block';
|
|
41
|
+
h.setAttribute('x1', '0');
|
|
42
|
+
h.setAttribute('x2', '640');
|
|
43
|
+
h.setAttribute('y1', y);
|
|
44
|
+
h.setAttribute('y2', y);
|
|
45
|
+
v.setAttribute('x1', x);
|
|
46
|
+
v.setAttribute('x2', x);
|
|
47
|
+
v.setAttribute('y1', '0');
|
|
48
|
+
v.setAttribute('y2', '640');
|
|
154
49
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
const sx = matrix.a;
|
|
179
|
-
const sy = matrix.d;
|
|
180
|
-
const tx = matrix.e;
|
|
181
|
-
const ty = matrix.f;
|
|
182
|
-
const realPoint = {
|
|
183
|
-
x: (x - tx) / sx,
|
|
184
|
-
y: (y - ty) / sy // Flip y back since we used negative scale
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
coords.textContent = `(${realPoint.x.toFixed(2)}, ${realPoint.y.toFixed(2)})`;
|
|
188
|
-
coords.setAttribute('x', (x + 5).toString());
|
|
189
|
-
coords.setAttribute('y', (y - 5).toString());
|
|
190
|
-
});
|
|
191
|
-
document.currentScript.parentElement.addEventListener('mouseleave', () => {
|
|
192
|
-
document.currentScript.parentElement.getElementById('crosshair').style.display = 'none';
|
|
193
|
-
});
|
|
194
|
-
]]>
|
|
195
|
-
</script>
|
|
196
|
-
</svg>
|
|
50
|
+
// Calculate real coordinates using inverse transformation
|
|
51
|
+
const matrix = {"a":96.76861931916363,"c":0,"e":315.1615690340418,"b":0,"d":-96.76861931916363,"f":-424.19906687402795};
|
|
52
|
+
// Manually invert and apply the affine transform
|
|
53
|
+
// Since we only use translate and scale, we can directly compute:
|
|
54
|
+
// x' = (x - tx) / sx
|
|
55
|
+
// y' = (y - ty) / sy
|
|
56
|
+
const sx = matrix.a;
|
|
57
|
+
const sy = matrix.d;
|
|
58
|
+
const tx = matrix.e;
|
|
59
|
+
const ty = matrix.f;
|
|
60
|
+
const realPoint = {
|
|
61
|
+
x: (x - tx) / sx,
|
|
62
|
+
y: (y - ty) / sy // Flip y back since we used negative scale
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
coords.textContent = `(${realPoint.x.toFixed(2)}, ${realPoint.y.toFixed(2)})`;
|
|
66
|
+
coords.setAttribute('x', (x + 5).toString());
|
|
67
|
+
coords.setAttribute('y', (y - 5).toString());
|
|
68
|
+
});
|
|
69
|
+
document.currentScript.parentElement.addEventListener('mouseleave', () => {
|
|
70
|
+
document.currentScript.parentElement.getElementById('crosshair').style.display = 'none';
|
|
71
|
+
});
|
|
72
|
+
]]></script></svg>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { GraphicsObject } from "graphics-debug"
|
|
2
|
+
|
|
3
|
+
const graphicsObjectKeys = [
|
|
4
|
+
"lines",
|
|
5
|
+
"points",
|
|
6
|
+
"circles",
|
|
7
|
+
"rects",
|
|
8
|
+
"texts",
|
|
9
|
+
] as const
|
|
10
|
+
|
|
11
|
+
type GraphicsObjectKey = (typeof graphicsObjectKeys)[number]
|
|
12
|
+
|
|
13
|
+
export function getLastStepGraphicsObject(
|
|
14
|
+
graphicsObject: GraphicsObject,
|
|
15
|
+
): GraphicsObject {
|
|
16
|
+
const steps = new Set<number>()
|
|
17
|
+
|
|
18
|
+
for (const key of graphicsObjectKeys) {
|
|
19
|
+
for (const object of (graphicsObject[key] ?? []) as Array<{
|
|
20
|
+
step?: number
|
|
21
|
+
}>) {
|
|
22
|
+
if (typeof object.step === "number") steps.add(object.step)
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const maxStep = Math.max(...steps, -1)
|
|
27
|
+
if (maxStep === -1) return graphicsObject
|
|
28
|
+
|
|
29
|
+
const lastStepGraphicsObject: GraphicsObject = {}
|
|
30
|
+
|
|
31
|
+
for (const key of graphicsObjectKeys) {
|
|
32
|
+
const objects = graphicsObject[key] as Array<{ step?: number }> | undefined
|
|
33
|
+
;(lastStepGraphicsObject as Record<GraphicsObjectKey, unknown>)[key] =
|
|
34
|
+
objects?.filter((object) => object.step === maxStep) ?? []
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return lastStepGraphicsObject
|
|
38
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { getSvgFromGraphicsObject } from "graphics-debug"
|
|
2
|
+
import type { GraphicsObject } from "graphics-debug"
|
|
3
|
+
import { getLastStepGraphicsObject } from "./getLastStepGraphicsObject"
|
|
4
|
+
|
|
5
|
+
export function getLastStepSvg(graphicsObject: GraphicsObject) {
|
|
6
|
+
return getSvgFromGraphicsObject(getLastStepGraphicsObject(graphicsObject), {
|
|
7
|
+
backgroundColor: "white",
|
|
8
|
+
})
|
|
9
|
+
}
|