@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.
Files changed (117) 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/dist/index.js +86 -10
  6. package/lib/solvers/Example28Solver/Example28Solver.ts +46 -10
  7. package/lib/solvers/Example28Solver/countCrossingsWithOtherTraces.ts +19 -0
  8. package/lib/solvers/Example28Solver/scoreSolutionTracePath.ts +26 -0
  9. package/lib/testing/PipelineStageDebugRunner.ts +344 -0
  10. package/package.json +3 -2
  11. package/scripts/debug-pipeline-stages.ts +146 -0
  12. package/site/bug-reports/bug-report-20260706T220324Z.page.tsx +4 -0
  13. package/site/bug-reports/bug-report-20260707T020342Z.page.tsx +4 -0
  14. package/site/bug-reports/bug-report-20260707T092615Z.page.tsx +4 -0
  15. package/site/bug-reports/bug-report-20260707T134549Z.page.tsx +4 -0
  16. package/site/bug-reports/bug-report-20260707T134722Z.page.tsx +4 -0
  17. package/site/bug-reports/bug-report-20260707T140410Z.page.tsx +4 -0
  18. package/site/bug-reports/bug-report-20260707T141025Z.page.tsx +4 -0
  19. package/site/bug-reports/bug-report-20260707T141421Z.page.tsx +4 -0
  20. package/tests/bug-reports/bug-report-20260706T220324Z/__snapshots__/bug-report-20260706T220324Z.snap.svg +357 -3448
  21. package/tests/bug-reports/bug-report-20260707T020342Z/__snapshots__/bug-report-20260707T020342Z.snap.svg +64 -0
  22. package/tests/bug-reports/bug-report-20260707T020342Z/bug-report-20260707T020342Z.json +233 -0
  23. package/tests/bug-reports/bug-report-20260707T020342Z/bug-report-20260707T020342Z.test.ts +12 -0
  24. package/tests/bug-reports/bug-report-20260707T092615Z/__snapshots__/bug-report-20260707T092615Z.snap.svg +2098 -0
  25. package/tests/bug-reports/bug-report-20260707T092615Z/bug-report-20260707T092615Z.json +1392 -0
  26. package/tests/bug-reports/bug-report-20260707T092615Z/bug-report-20260707T092615Z.test.ts +12 -0
  27. package/tests/bug-reports/bug-report-20260707T134549Z/__snapshots__/bug-report-20260707T134549Z.snap.svg +857 -0
  28. package/tests/bug-reports/bug-report-20260707T134549Z/bug-report-20260707T134549Z.json +652 -0
  29. package/tests/bug-reports/bug-report-20260707T134549Z/bug-report-20260707T134549Z.test.ts +12 -0
  30. package/tests/bug-reports/bug-report-20260707T134722Z/__snapshots__/bug-report-20260707T134722Z.snap.svg +275 -0
  31. package/tests/bug-reports/bug-report-20260707T134722Z/bug-report-20260707T134722Z.json +265 -0
  32. package/tests/bug-reports/bug-report-20260707T134722Z/bug-report-20260707T134722Z.test.ts +12 -0
  33. package/tests/bug-reports/bug-report-20260707T140410Z/__snapshots__/bug-report-20260707T140410Z.snap.svg +950 -0
  34. package/tests/bug-reports/bug-report-20260707T140410Z/bug-report-20260707T140410Z.json +610 -0
  35. package/tests/bug-reports/bug-report-20260707T140410Z/bug-report-20260707T140410Z.test.ts +12 -0
  36. package/tests/bug-reports/bug-report-20260707T141025Z/__snapshots__/bug-report-20260707T141025Z.snap.svg +218 -0
  37. package/tests/bug-reports/bug-report-20260707T141025Z/bug-report-20260707T141025Z.json +185 -0
  38. package/tests/bug-reports/bug-report-20260707T141025Z/bug-report-20260707T141025Z.test.ts +12 -0
  39. package/tests/bug-reports/bug-report-20260707T141421Z/__snapshots__/bug-report-20260707T141421Z.snap.svg +613 -0
  40. package/tests/bug-reports/bug-report-20260707T141421Z/bug-report-20260707T141421Z.json +499 -0
  41. package/tests/bug-reports/bug-report-20260707T141421Z/bug-report-20260707T141421Z.test.ts +12 -0
  42. package/tests/examples/__snapshots__/example01.snap.svg +59 -162
  43. package/tests/examples/__snapshots__/example02.snap.svg +64 -273
  44. package/tests/examples/__snapshots__/example03.snap.svg +85 -290
  45. package/tests/examples/__snapshots__/example04.snap.svg +50 -94
  46. package/tests/examples/__snapshots__/example05.snap.svg +73 -191
  47. package/tests/examples/__snapshots__/example06.snap.svg +49 -95
  48. package/tests/examples/__snapshots__/example07.snap.svg +65 -218
  49. package/tests/examples/__snapshots__/example08.snap.svg +61 -143
  50. package/tests/examples/__snapshots__/example09.snap.svg +123 -493
  51. package/tests/examples/__snapshots__/example10.snap.svg +57 -136
  52. package/tests/examples/__snapshots__/example11.snap.svg +64 -173
  53. package/tests/examples/__snapshots__/example12.snap.svg +58 -159
  54. package/tests/examples/__snapshots__/example13.snap.svg +78 -348
  55. package/tests/examples/__snapshots__/example14.snap.svg +77 -293
  56. package/tests/examples/__snapshots__/example15.snap.svg +140 -984
  57. package/tests/examples/__snapshots__/example16.snap.svg +62 -162
  58. package/tests/examples/__snapshots__/example17.snap.svg +67 -198
  59. package/tests/examples/__snapshots__/example18.snap.svg +69 -249
  60. package/tests/examples/__snapshots__/example19.snap.svg +63 -202
  61. package/tests/examples/__snapshots__/example20.snap.svg +60 -148
  62. package/tests/examples/__snapshots__/example21.snap.svg +73 -298
  63. package/tests/examples/__snapshots__/example22.snap.svg +62 -156
  64. package/tests/examples/__snapshots__/example23.snap.svg +66 -172
  65. package/tests/examples/__snapshots__/example24.snap.svg +64 -164
  66. package/tests/examples/__snapshots__/example25.snap.svg +76 -299
  67. package/tests/examples/__snapshots__/example26.snap.svg +64 -164
  68. package/tests/examples/__snapshots__/example27.snap.svg +83 -300
  69. package/tests/examples/__snapshots__/example28.snap.svg +54 -115
  70. package/tests/examples/__snapshots__/example29.snap.svg +257 -1299
  71. package/tests/examples/__snapshots__/example30.snap.svg +91 -293
  72. package/tests/examples/__snapshots__/example31.snap.svg +47 -88
  73. package/tests/examples/__snapshots__/example32.snap.svg +107 -405
  74. package/tests/examples/__snapshots__/example33.snap.svg +71 -180
  75. package/tests/examples/__snapshots__/example34.snap.svg +55 -116
  76. package/tests/examples/__snapshots__/example35.snap.svg +69 -176
  77. package/tests/examples/__snapshots__/example36.snap.svg +65 -159
  78. package/tests/examples/__snapshots__/example37.snap.svg +75 -223
  79. package/tests/examples/__snapshots__/example38.snap.svg +46 -76
  80. package/tests/examples/__snapshots__/example39.snap.svg +51 -106
  81. package/tests/examples/__snapshots__/example40.snap.svg +83 -270
  82. package/tests/examples/__snapshots__/example41.snap.svg +54 -118
  83. package/tests/examples/__snapshots__/example42.snap.svg +67 -194
  84. package/tests/examples/__snapshots__/example43.snap.svg +62 -168
  85. package/tests/examples/__snapshots__/example44.snap.svg +86 -369
  86. package/tests/examples/__snapshots__/example45.snap.svg +60 -169
  87. package/tests/examples/__snapshots__/example46.snap.svg +80 -342
  88. package/tests/examples/__snapshots__/example47.snap.svg +82 -323
  89. package/tests/examples/__snapshots__/example48.snap.svg +64 -167
  90. package/tests/examples/__snapshots__/example49.snap.svg +120 -565
  91. package/tests/examples/__snapshots__/example50.snap.svg +71 -195
  92. package/tests/fixtures/getLastStepGraphicsObject.ts +38 -0
  93. package/tests/fixtures/getLastStepSvg.ts +9 -0
  94. package/tests/repros/__snapshots__/bugreport-001-gnd-overlap.snap.svg +67 -218
  95. package/tests/repros/__snapshots__/manufacturePartNumber-text-box.snap.svg +47 -87
  96. package/tests/repros/__snapshots__/netlabel-connector-through-rail-label.snap.svg +73 -272
  97. package/tests/repros/__snapshots__/repro-atmega328p-fault-pullup.snap.svg +284 -0
  98. package/tests/repros/__snapshots__/repro-atmega328p-missing-gnd-netlabel.snap.svg +470 -0
  99. package/tests/repros/__snapshots__/repro-bq24074-battery-charger.snap.svg +94 -395
  100. package/tests/repros/__snapshots__/repro-cc2340r5.snap.svg +88 -467
  101. package/tests/repros/__snapshots__/repro-ina237-current-monitor.snap.svg +109 -569
  102. package/tests/repros/__snapshots__/repro130-bq27441-fuel-gauge-trace-through-c1.snap.svg +95 -459
  103. package/tests/repros/__snapshots__/repro51-overlap-junction-crossing.snap.svg +64 -176
  104. package/tests/repros/__snapshots__/trace-overlap-box-resistor.snap.svg +51 -112
  105. package/tests/repros/assets/repro-atmega328p-fault-pullup.input.json +239 -0
  106. package/tests/repros/assets/repro-atmega328p-missing-gnd-netlabel.input.json +432 -0
  107. package/tests/repros/repro-atmega328p-fault-pullup.test.ts +11 -0
  108. package/tests/repros/repro-atmega328p-missing-gnd-netlabel.test.ts +16 -0
  109. package/tests/solvers/SchematicTraceSingleLineSolver2/__snapshots__/SchematicTraceSingleLineSolver2_01-example17-d1_1-u1_1.snap.svg +59 -159
  110. package/tests/solvers/TraceCleanupSolver/__snapshots__/TraceCleanupSolver.snap.svg +54 -118
  111. package/tests/solvers/TraceLabelOverlapAvoidanceSolver/__snapshots__/TraceLabelOverlapAvoidanceSolver.snap.svg +58 -245
  112. package/tests/solvers/TraceLabelOverlapAvoidanceSolver/renderComparisonView/__snapshots__/renderComparisonView01.snap.svg +73 -222
  113. package/tests/solvers/TraceLabelOverlapAvoidanceSolver/renderComparisonView/__snapshots__/renderComparisonView02.snap.svg +65 -204
  114. package/tests/solvers/TraceLabelOverlapAvoidanceSolver/renderComparisonView/__snapshots__/renderComparisonView03.snap.svg +65 -183
  115. package/tests/solvers/TraceLabelOverlapAvoidanceSolver/sub-solver/__snapshots__/MergedNetLabelObstacles.snap.svg +54 -139
  116. package/tests/solvers/TraceLabelOverlapAvoidanceSolver/sub-solver/__snapshots__/OverlapAvoidanceStepSolver.snap.svg +61 -215
  117. 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
- <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="122.2014128470511" cy="219.67471660916704" 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="223.4006899950715" cy="219.67471660916704" 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="161.5311319204863" cy="357.6737309019221" 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="161.5311319204863" cy="376.0735994742896" 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="161.5311319204863" cy="394.4734680466569" 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="161.5311319204863" cy="412.87333661902426" 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="441.66913093477905" cy="357.6737309019221" 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="441.66913093477905" cy="376.0735994742896" 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="441.66913093477905" cy="412.87333661902426" 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="441.66913093477905" cy="394.4734680466569" 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="103.80154427468375" cy="219.67471660916704" 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="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
- crosshair.style.display = 'block';
156
- h.setAttribute('x1', '0');
157
- h.setAttribute('x2', '640');
158
- h.setAttribute('y1', y);
159
- h.setAttribute('y2', y);
160
- v.setAttribute('x1', x);
161
- v.setAttribute('x2', x);
162
- v.setAttribute('y1', '0');
163
- v.setAttribute('y2', '640');
164
-
165
- // Calculate real coordinates using inverse transformation
166
- const matrix = {
167
- "a": 91.99934286183671,
168
- "c": 0,
169
- "e": 301.6001314276327,
170
- "b": 0,
171
- "d": -91.99934286183671,
172
- "f": -387.5209462789552
173
- };
174
- // Manually invert and apply the affine transform
175
- // Since we only use translate and scale, we can directly compute:
176
- // x' = (x - tx) / sx
177
- // y' = (y - ty) / sy
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
+ }