@tscircuit/schematic-trace-solver 0.0.87 → 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.
Files changed (113) hide show
  1. package/.agents/skills/schematic-trace-visualization/SKILL.md +115 -0
  2. package/.github/scripts/import-json-bug-report.ts +15 -1
  3. package/.github/workflows/json-bug-report.yml +3 -2
  4. package/AGENTS.md +22 -0
  5. package/lib/testing/PipelineStageDebugRunner.ts +344 -0
  6. package/package.json +3 -2
  7. package/scripts/debug-pipeline-stages.ts +146 -0
  8. package/site/bug-reports/bug-report-20260706T220324Z.page.tsx +4 -0
  9. package/site/bug-reports/bug-report-20260707T020342Z.page.tsx +4 -0
  10. package/site/bug-reports/bug-report-20260707T092615Z.page.tsx +4 -0
  11. package/site/bug-reports/bug-report-20260707T134549Z.page.tsx +4 -0
  12. package/site/bug-reports/bug-report-20260707T134722Z.page.tsx +4 -0
  13. package/site/bug-reports/bug-report-20260707T140410Z.page.tsx +4 -0
  14. package/site/bug-reports/bug-report-20260707T141025Z.page.tsx +4 -0
  15. package/site/bug-reports/bug-report-20260707T141421Z.page.tsx +4 -0
  16. package/tests/bug-reports/bug-report-20260706T220324Z/__snapshots__/bug-report-20260706T220324Z.snap.svg +357 -3448
  17. package/tests/bug-reports/bug-report-20260707T020342Z/__snapshots__/bug-report-20260707T020342Z.snap.svg +64 -0
  18. package/tests/bug-reports/bug-report-20260707T020342Z/bug-report-20260707T020342Z.json +233 -0
  19. package/tests/bug-reports/bug-report-20260707T020342Z/bug-report-20260707T020342Z.test.ts +12 -0
  20. package/tests/bug-reports/bug-report-20260707T092615Z/__snapshots__/bug-report-20260707T092615Z.snap.svg +2098 -0
  21. package/tests/bug-reports/bug-report-20260707T092615Z/bug-report-20260707T092615Z.json +1392 -0
  22. package/tests/bug-reports/bug-report-20260707T092615Z/bug-report-20260707T092615Z.test.ts +12 -0
  23. package/tests/bug-reports/bug-report-20260707T134549Z/__snapshots__/bug-report-20260707T134549Z.snap.svg +857 -0
  24. package/tests/bug-reports/bug-report-20260707T134549Z/bug-report-20260707T134549Z.json +652 -0
  25. package/tests/bug-reports/bug-report-20260707T134549Z/bug-report-20260707T134549Z.test.ts +12 -0
  26. package/tests/bug-reports/bug-report-20260707T134722Z/__snapshots__/bug-report-20260707T134722Z.snap.svg +275 -0
  27. package/tests/bug-reports/bug-report-20260707T134722Z/bug-report-20260707T134722Z.json +265 -0
  28. package/tests/bug-reports/bug-report-20260707T134722Z/bug-report-20260707T134722Z.test.ts +12 -0
  29. package/tests/bug-reports/bug-report-20260707T140410Z/__snapshots__/bug-report-20260707T140410Z.snap.svg +950 -0
  30. package/tests/bug-reports/bug-report-20260707T140410Z/bug-report-20260707T140410Z.json +610 -0
  31. package/tests/bug-reports/bug-report-20260707T140410Z/bug-report-20260707T140410Z.test.ts +12 -0
  32. package/tests/bug-reports/bug-report-20260707T141025Z/__snapshots__/bug-report-20260707T141025Z.snap.svg +218 -0
  33. package/tests/bug-reports/bug-report-20260707T141025Z/bug-report-20260707T141025Z.json +185 -0
  34. package/tests/bug-reports/bug-report-20260707T141025Z/bug-report-20260707T141025Z.test.ts +12 -0
  35. package/tests/bug-reports/bug-report-20260707T141421Z/__snapshots__/bug-report-20260707T141421Z.snap.svg +613 -0
  36. package/tests/bug-reports/bug-report-20260707T141421Z/bug-report-20260707T141421Z.json +499 -0
  37. package/tests/bug-reports/bug-report-20260707T141421Z/bug-report-20260707T141421Z.test.ts +12 -0
  38. package/tests/examples/__snapshots__/example01.snap.svg +59 -162
  39. package/tests/examples/__snapshots__/example02.snap.svg +64 -273
  40. package/tests/examples/__snapshots__/example03.snap.svg +85 -290
  41. package/tests/examples/__snapshots__/example04.snap.svg +50 -94
  42. package/tests/examples/__snapshots__/example05.snap.svg +73 -191
  43. package/tests/examples/__snapshots__/example06.snap.svg +49 -95
  44. package/tests/examples/__snapshots__/example07.snap.svg +65 -218
  45. package/tests/examples/__snapshots__/example08.snap.svg +61 -143
  46. package/tests/examples/__snapshots__/example09.snap.svg +123 -493
  47. package/tests/examples/__snapshots__/example10.snap.svg +57 -136
  48. package/tests/examples/__snapshots__/example11.snap.svg +64 -173
  49. package/tests/examples/__snapshots__/example12.snap.svg +58 -159
  50. package/tests/examples/__snapshots__/example13.snap.svg +78 -348
  51. package/tests/examples/__snapshots__/example14.snap.svg +77 -293
  52. package/tests/examples/__snapshots__/example15.snap.svg +140 -984
  53. package/tests/examples/__snapshots__/example16.snap.svg +62 -162
  54. package/tests/examples/__snapshots__/example17.snap.svg +67 -198
  55. package/tests/examples/__snapshots__/example18.snap.svg +69 -249
  56. package/tests/examples/__snapshots__/example19.snap.svg +63 -202
  57. package/tests/examples/__snapshots__/example20.snap.svg +60 -148
  58. package/tests/examples/__snapshots__/example21.snap.svg +73 -298
  59. package/tests/examples/__snapshots__/example22.snap.svg +62 -156
  60. package/tests/examples/__snapshots__/example23.snap.svg +66 -172
  61. package/tests/examples/__snapshots__/example24.snap.svg +64 -164
  62. package/tests/examples/__snapshots__/example25.snap.svg +76 -299
  63. package/tests/examples/__snapshots__/example26.snap.svg +64 -164
  64. package/tests/examples/__snapshots__/example27.snap.svg +83 -300
  65. package/tests/examples/__snapshots__/example28.snap.svg +54 -115
  66. package/tests/examples/__snapshots__/example29.snap.svg +257 -1299
  67. package/tests/examples/__snapshots__/example30.snap.svg +91 -293
  68. package/tests/examples/__snapshots__/example31.snap.svg +47 -88
  69. package/tests/examples/__snapshots__/example32.snap.svg +107 -405
  70. package/tests/examples/__snapshots__/example33.snap.svg +71 -180
  71. package/tests/examples/__snapshots__/example34.snap.svg +55 -116
  72. package/tests/examples/__snapshots__/example35.snap.svg +69 -176
  73. package/tests/examples/__snapshots__/example36.snap.svg +65 -159
  74. package/tests/examples/__snapshots__/example37.snap.svg +75 -223
  75. package/tests/examples/__snapshots__/example38.snap.svg +46 -76
  76. package/tests/examples/__snapshots__/example39.snap.svg +51 -106
  77. package/tests/examples/__snapshots__/example40.snap.svg +83 -270
  78. package/tests/examples/__snapshots__/example41.snap.svg +54 -118
  79. package/tests/examples/__snapshots__/example42.snap.svg +67 -194
  80. package/tests/examples/__snapshots__/example43.snap.svg +62 -168
  81. package/tests/examples/__snapshots__/example44.snap.svg +86 -369
  82. package/tests/examples/__snapshots__/example45.snap.svg +60 -169
  83. package/tests/examples/__snapshots__/example46.snap.svg +80 -342
  84. package/tests/examples/__snapshots__/example47.snap.svg +82 -323
  85. package/tests/examples/__snapshots__/example48.snap.svg +64 -167
  86. package/tests/examples/__snapshots__/example49.snap.svg +120 -565
  87. package/tests/examples/__snapshots__/example50.snap.svg +71 -189
  88. package/tests/fixtures/getLastStepGraphicsObject.ts +38 -0
  89. package/tests/fixtures/getLastStepSvg.ts +9 -0
  90. package/tests/repros/__snapshots__/bugreport-001-gnd-overlap.snap.svg +67 -218
  91. package/tests/repros/__snapshots__/manufacturePartNumber-text-box.snap.svg +47 -87
  92. package/tests/repros/__snapshots__/netlabel-connector-through-rail-label.snap.svg +73 -272
  93. package/tests/repros/__snapshots__/repro-atmega328p-fault-pullup.snap.svg +284 -0
  94. package/tests/repros/__snapshots__/repro-atmega328p-missing-gnd-netlabel.snap.svg +470 -0
  95. package/tests/repros/__snapshots__/repro-bq24074-battery-charger.snap.svg +94 -395
  96. package/tests/repros/__snapshots__/repro-cc2340r5.snap.svg +88 -467
  97. package/tests/repros/__snapshots__/repro-ina237-current-monitor.snap.svg +109 -569
  98. package/tests/repros/__snapshots__/repro130-bq27441-fuel-gauge-trace-through-c1.snap.svg +95 -459
  99. package/tests/repros/__snapshots__/repro51-overlap-junction-crossing.snap.svg +64 -176
  100. package/tests/repros/__snapshots__/trace-overlap-box-resistor.snap.svg +51 -112
  101. package/tests/repros/assets/repro-atmega328p-fault-pullup.input.json +239 -0
  102. package/tests/repros/assets/repro-atmega328p-missing-gnd-netlabel.input.json +432 -0
  103. package/tests/repros/repro-atmega328p-fault-pullup.test.ts +11 -0
  104. package/tests/repros/repro-atmega328p-missing-gnd-netlabel.test.ts +16 -0
  105. package/tests/solvers/SchematicTraceSingleLineSolver2/__snapshots__/SchematicTraceSingleLineSolver2_01-example17-d1_1-u1_1.snap.svg +59 -159
  106. package/tests/solvers/TraceCleanupSolver/__snapshots__/TraceCleanupSolver.snap.svg +54 -118
  107. package/tests/solvers/TraceLabelOverlapAvoidanceSolver/__snapshots__/TraceLabelOverlapAvoidanceSolver.snap.svg +58 -245
  108. package/tests/solvers/TraceLabelOverlapAvoidanceSolver/renderComparisonView/__snapshots__/renderComparisonView01.snap.svg +73 -222
  109. package/tests/solvers/TraceLabelOverlapAvoidanceSolver/renderComparisonView/__snapshots__/renderComparisonView02.snap.svg +65 -204
  110. package/tests/solvers/TraceLabelOverlapAvoidanceSolver/renderComparisonView/__snapshots__/renderComparisonView03.snap.svg +65 -183
  111. package/tests/solvers/TraceLabelOverlapAvoidanceSolver/sub-solver/__snapshots__/MergedNetLabelObstacles.snap.svg +54 -139
  112. package/tests/solvers/TraceLabelOverlapAvoidanceSolver/sub-solver/__snapshots__/OverlapAvoidanceStepSolver.snap.svg +61 -215
  113. package/tests/solvers/TraceLabelOverlapAvoidanceSolver/sub-solver/__snapshots__/SingleOverlapSolver.snap.svg +54 -124
@@ -1,190 +1,72 @@
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="R7.1
5
- x-" data-x="-1.95" data-y="-6.6" cx="126.46276136167273" cy="214.47382063245198" r="3" fill="hsl(232, 100%, 50%, 0.8)" />
6
- </g>
7
- <g>
8
- <circle data-type="point" data-label="R7.2
9
- x+" data-x="-0.8499999999999999" data-y="-6.6" cx="232.90824261275273" cy="214.47382063245198" r="3" fill="hsl(233, 100%, 50%, 0.8)" />
10
- </g>
11
- <g>
12
- <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)" />
14
- </g>
15
- <g>
16
- <circle data-type="point" data-label="U5.2
17
- x-" data-x="-1.5225" data-y="-8.3" cx="167.83134612061517" cy="378.9804734750303" r="3" fill="hsl(204, 100%, 50%, 0.8)" />
18
- </g>
19
- <g>
20
- <circle data-type="point" data-label="U5.3
21
- x-" data-x="-1.5225" data-y="-8.5" cx="167.83134612061517" cy="398.33419733886296" r="3" fill="hsl(205, 100%, 50%, 0.8)" />
22
- </g>
23
- <g>
24
- <circle data-type="point" data-label="U5.4
25
- x-" data-x="-1.5225" data-y="-8.700000000000001" cx="167.83134612061517" cy="417.68792120269575" r="3" fill="hsl(206, 100%, 50%, 0.8)" />
26
- </g>
27
- <g>
28
- <circle data-type="point" data-label="U5.5
29
- x+" data-x="1.5225" data-y="-8.1" cx="462.4917919474684" cy="359.6267496111974" r="3" fill="hsl(207, 100%, 50%, 0.8)" />
30
- </g>
31
- <g>
32
- <circle data-type="point" data-label="U5.6
33
- x+" data-x="1.5225" data-y="-8.3" cx="462.4917919474684" cy="378.9804734750303" r="3" fill="hsl(208, 100%, 50%, 0.8)" />
34
- </g>
35
- <g>
36
- <circle data-type="point" data-label="U5.7
37
- x+" data-x="1.5225" data-y="-8.700000000000001" cx="462.4917919474684" cy="417.68792120269575" r="3" fill="hsl(209, 100%, 50%, 0.8)" />
38
- </g>
39
- <g>
40
- <circle data-type="point" data-label="U5.8
41
- x+" data-x="1.5225" data-y="-8.5" cx="462.4917919474684" cy="398.33419733886296" r="3" fill="hsl(210, 100%, 50%, 0.8)" />
42
- </g>
43
- <g>
44
- <circle data-type="point" data-label="anchorPoint
45
- 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)" />
46
- </g>
47
- <g>
48
- <circle data-type="point" data-label="anchorPoint
49
- 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)" />
50
- </g>
51
- <g>
52
- <circle data-type="point" data-label="anchorPoint
53
- 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)" />
54
- </g>
55
- <g>
56
- <circle data-type="point" data-label="anchorPoint
57
- 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)" />
58
- </g>
59
- <g>
60
- <circle data-type="point" data-label="anchorPoint
61
- 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)" />
62
- </g>
63
- <g>
64
- <circle data-type="point" data-label="anchorPoint
65
- 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)" />
66
- </g>
67
- <g>
68
- <circle data-type="point" data-label="anchorPoint
69
- 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)" />
70
- </g>
71
- <g>
72
- <circle data-type="point" data-label="anchorPoint
73
- 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)" />
74
- </g>
75
- <g>
76
- <circle data-type="point" data-label="anchorPoint
77
- 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)" />
78
- </g>
79
- <g>
80
- <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="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="232.90824261275273,214.47382063245198 167.83134612061517,417.68792120269575" 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 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="1" />
87
- </g>
88
- <g>
89
- <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="1" />
90
- </g>
91
- <g>
92
- <rect data-type="rect" data-label="schematic_component_0" data-x="-1.4" data-y="-6.6" x="126.46276136167273" y="176.78676412649043" width="106.44548125108" height="75.37411301192321" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.010333928571428572" />
93
- </g>
94
- <g>
95
- <rect data-type="rect" data-label="schematic_component_1" data-x="0" data-y="-8.4" x="167.83134612061517" y="340.27302574736484" width="294.6604458268532" height="96.76861931916358" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.010333928571428572" />
96
- </g>
97
- <g>
98
- <rect data-type="rect" data-label="netId: V3V3
99
- globalConnNetId: connectivity_net0" data-x="-2.15" data-y="-6.3" x="97.43217556592361" y="156.41264904095385" width="19.353723863832755" height="58.06117159149812" fill="#ef444466" stroke="#ef4444" stroke-width="0.010333928571428572" />
100
- </g>
101
- <g>
102
- <rect data-type="rect" data-label="netId: QSPI_CS
103
- globalConnNetId: connectivity_net1" data-x="-0.3689999999999999" data-y="-6.6" x="233.0050112320719" y="204.7969587005357" width="92.8978745463971" height="19.35372386383267" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.010333928571428572" />
104
- </g>
105
- <g>
106
- <rect data-type="rect" data-label="netId: QSPI_CS
107
- globalConnNetId: connectivity_net1" data-x="-2.0035" data-y="-8.700000000000001" x="74.83670295489893" y="408.01105927077947" width="92.8978745463971" height="19.35372386383267" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.010333928571428572" />
108
- </g>
109
- <g>
110
- <rect data-type="rect" data-label="netId: QSPI_SCK
111
- globalConnNetId: connectivity_net2" data-x="-2.0635" data-y="-8.1" x="63.22446863659928" y="349.9498876792811" width="104.51010886469675" height="19.35372386383267" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.010333928571428572" />
112
- </g>
113
- <g>
114
- <rect data-type="rect" data-label="netId: QSPI_DATA0
115
- globalConnNetId: connectivity_net3" data-x="-2.1835" data-y="-8.3" x="40" y="369.3036115431139" width="127.73457750129603" height="19.35372386383267" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.010333928571428572" />
116
- </g>
117
- <g>
118
- <rect data-type="rect" data-label="netId: QSPI_DATA1
119
- globalConnNetId: connectivity_net4" data-x="-2.1835" data-y="-8.5" x="40" y="388.6573354069466" width="127.73457750129603" height="19.35372386383267" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.010333928571428572" />
120
- </g>
121
- <g>
122
- <rect data-type="rect" data-label="netId: QSPI_DATA2
123
- globalConnNetId: connectivity_net5" data-x="2.1835" data-y="-8.1" x="462.5885605667876" y="349.9498876792811" width="127.73457750129603" height="19.35372386383267" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.010333928571428572" />
124
- </g>
125
- <g>
126
- <rect data-type="rect" data-label="netId: QSPI_DATA3
127
- globalConnNetId: connectivity_net6" data-x="2.1835" data-y="-8.3" x="462.5885605667876" y="369.3036115431139" width="127.73457750129603" height="19.35372386383267" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.010333928571428572" />
128
- </g>
129
- <g>
130
- <rect data-type="rect" data-label="netId: GND
131
- globalConnNetId: connectivity_net7" data-x="1.6235" data-y="-9.141" x="462.5885605667876" y="437.1384136858476" width="19.353723863832784" height="46.44893727319857" fill="#00000066" stroke="#000000" stroke-width="0.010333928571428572" />
132
- </g>
133
- <g id="crosshair" style="display: none">
134
- <line id="crosshair-h" y1="0" y2="640" stroke="#666" stroke-width="0.5" />
135
- <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>
136
- </g>
137
- <script>
138
- <![CDATA[
139
- document.currentScript.parentElement.addEventListener('mousemove', (e) => {
140
- const svg = e.currentTarget;
141
- const rect = svg.getBoundingClientRect();
142
- const x = e.clientX - rect.left;
143
- const y = e.clientY - rect.top;
144
- const crosshair = svg.getElementById('crosshair');
145
- const h = svg.getElementById('crosshair-h');
146
- const v = svg.getElementById('crosshair-v');
147
- 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');
148
49
 
149
- crosshair.style.display = 'block';
150
- h.setAttribute('x1', '0');
151
- h.setAttribute('x2', '640');
152
- h.setAttribute('y1', y);
153
- h.setAttribute('y2', y);
154
- v.setAttribute('x1', x);
155
- v.setAttribute('x2', x);
156
- v.setAttribute('y1', '0');
157
- v.setAttribute('y2', '640');
158
-
159
- // Calculate real coordinates using inverse transformation
160
- const matrix = {
161
- "a": 96.76861931916363,
162
- "c": 0,
163
- "e": 315.1615690340418,
164
- "b": 0,
165
- "d": -96.76861931916363,
166
- "f": -424.19906687402795
167
- };
168
- // Manually invert and apply the affine transform
169
- // Since we only use translate and scale, we can directly compute:
170
- // x' = (x - tx) / sx
171
- // y' = (y - ty) / sy
172
- const sx = matrix.a;
173
- const sy = matrix.d;
174
- const tx = matrix.e;
175
- const ty = matrix.f;
176
- const realPoint = {
177
- x: (x - tx) / sx,
178
- y: (y - ty) / sy // Flip y back since we used negative scale
179
- }
180
-
181
- coords.textContent = `(${realPoint.x.toFixed(2)}, ${realPoint.y.toFixed(2)})`;
182
- coords.setAttribute('x', (x + 5).toString());
183
- coords.setAttribute('y', (y - 5).toString());
184
- });
185
- document.currentScript.parentElement.addEventListener('mouseleave', () => {
186
- document.currentScript.parentElement.getElementById('crosshair').style.display = 'none';
187
- });
188
- ]]>
189
- </script>
190
- </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
+ }