@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,219 +1,68 @@
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="BT1.1
5
- x+" data-x="-2.6" data-y="2.2" cx="84.13793103448276" cy="230.89655172413794" r="3" fill="hsl(114, 100%, 50%, 0.8)" />
6
- </g>
7
- <g>
8
- <circle data-type="point" data-label="BT1.2
9
- x+" data-x="-2.6" data-y="1.8" cx="84.13793103448276" cy="252.9655172413793" r="3" fill="hsl(115, 100%, 50%, 0.8)" />
10
- </g>
11
- <g>
12
- <circle data-type="point" data-label="SW1.1
13
- x-" data-x="-0.5" data-y="2" cx="200" cy="241.93103448275863" r="3" fill="hsl(104, 100%, 50%, 0.8)" />
14
- </g>
15
- <g>
16
- <circle data-type="point" data-label="SW1.2
17
- x+" data-x="0.5" data-y="2" cx="255.17241379310343" cy="241.93103448275863" r="3" fill="hsl(105, 100%, 50%, 0.8)" />
18
- </g>
19
- <g>
20
- <circle data-type="point" data-label="R1.1
21
- x-" data-x="2.45" data-y="1" cx="362.7586206896552" cy="297.1034482758621" r="3" fill="hsl(226, 100%, 50%, 0.8)" />
22
- </g>
23
- <g>
24
- <circle data-type="point" data-label="R1.2
25
- x+" data-x="3.55" data-y="1" cx="423.44827586206895" cy="297.1034482758621" r="3" fill="hsl(227, 100%, 50%, 0.8)" />
26
- </g>
27
- <g>
28
- <circle data-type="point" data-label="R2.1
29
- x-" data-x="2.45" data-y="-1" cx="362.7586206896552" cy="407.44827586206895" r="3" fill="hsl(107, 100%, 50%, 0.8)" />
30
- </g>
31
- <g>
32
- <circle data-type="point" data-label="R2.2
33
- x+" data-x="3.55" data-y="-1" cx="423.44827586206895" cy="407.44827586206895" r="3" fill="hsl(108, 100%, 50%, 0.8)" />
34
- </g>
35
- <g>
36
- <circle data-type="point" data-label="D1.1
37
- x-" data-x="5.45" data-y="1" cx="528.2758620689655" cy="297.1034482758621" r="3" fill="hsl(32, 100%, 50%, 0.8)" />
38
- </g>
39
- <g>
40
- <circle data-type="point" data-label="D1.2
41
- x+" data-x="6.55" data-y="1" cx="588.9655172413793" cy="297.1034482758621" r="3" fill="hsl(33, 100%, 50%, 0.8)" />
42
- </g>
43
- <g>
44
- <circle data-type="point" data-label="D2.1
45
- x-" data-x="5.45" data-y="-1" cx="528.2758620689655" cy="407.44827586206895" r="3" fill="hsl(273, 100%, 50%, 0.8)" />
46
- </g>
47
- <g>
48
- <circle data-type="point" data-label="D2.2
49
- x+" data-x="6.55" data-y="-1" cx="588.9655172413793" cy="407.44827586206895" r="3" fill="hsl(274, 100%, 50%, 0.8)" />
50
- </g>
51
- <g>
52
- <circle data-type="point" data-label="anchorPoint
53
- orientation: y+" data-x="-2.075" data-y="2.2" cx="113.10344827586206" cy="230.89655172413794" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
54
- </g>
55
- <g>
56
- <circle data-type="point" data-label="anchorPoint
57
- orientation: y-" data-x="-2.499" data-y="1.5990000000000002" cx="89.7103448275862" cy="264.0551724137931" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
58
- </g>
59
- <g>
60
- <circle data-type="point" data-label="anchorPoint
61
- orientation: y-" data-x="6.65" data-y="-1" cx="594.4827586206897" cy="407.44827586206895" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
62
- </g>
63
- <g>
64
- <circle data-type="point" data-label="anchorPoint
65
- orientation: y-" data-x="2.25" data-y="-1" cx="351.7241379310345" cy="407.44827586206895" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
66
- </g>
67
- <g>
68
- <circle data-type="point" data-label="anchorPoint
69
- orientation: y+" data-x="4.5" data-y="1" cx="475.8620689655172" cy="297.1034482758621" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
70
- </g>
71
- <g>
72
- <circle data-type="point" data-label="anchorPoint
73
- orientation: y+" data-x="4.5" data-y="-1" cx="475.8620689655172" cy="407.44827586206895" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
74
- </g>
75
- <g>
76
- <polyline data-points="-2.6,2.2 -0.5,2" data-type="line" data-label="" points="84.13793103448276,230.89655172413794 200,241.93103448275863" fill="none" stroke="hsl(0, 100%, 50%, 0.8)" stroke-width="1" />
77
- </g>
78
- <g>
79
- <polyline data-points="0.5,2 2.45,1" data-type="line" data-label="" points="255.17241379310343,241.93103448275863 362.7586206896552,297.1034482758621" fill="none" stroke="hsl(304, 100%, 50%, 0.8)" stroke-width="1" />
80
- </g>
81
- <g>
82
- <polyline data-points="0.5,2 2.45,-1" data-type="line" data-label="" points="255.17241379310343,241.93103448275863 362.7586206896552,407.44827586206895" fill="none" stroke="hsl(304, 100%, 50%, 0.8)" stroke-width="1" />
83
- </g>
84
- <g>
85
- <polyline data-points="3.55,1 5.45,1" data-type="line" data-label="" points="423.44827586206895,297.1034482758621 528.2758620689655,297.1034482758621" fill="none" stroke="hsl(312, 100%, 50%, 0.8)" stroke-width="1" />
86
- </g>
87
- <g>
88
- <polyline data-points="3.55,-1 5.45,-1" data-type="line" data-label="" points="423.44827586206895,407.44827586206895 528.2758620689655,407.44827586206895" fill="none" stroke="hsl(320, 100%, 50%, 0.8)" stroke-width="1" />
89
- </g>
90
- <g>
91
- <polyline data-points="-2.6,1.8 6.55,1" data-type="line" data-label="" points="84.13793103448276,252.9655172413793 588.9655172413793,297.1034482758621" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
92
- </g>
93
- <g>
94
- <polyline data-points="-2.6,1.8 6.55,-1" data-type="line" data-label="" points="84.13793103448276,252.9655172413793 588.9655172413793,407.44827586206895" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
95
- </g>
96
- <g>
97
- <polyline data-points="6.55,1 6.55,-1" data-type="line" data-label="" points="588.9655172413793,297.1034482758621 588.9655172413793,407.44827586206895" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
98
- </g>
99
- <g>
100
- <polyline data-points="-2.6,2.2 -1.55,2.2 -1.55,2 -0.5,2" data-type="line" data-label="" points="84.13793103448276,230.89655172413794 142.06896551724137,230.89655172413794 142.06896551724137,241.93103448275863 200,241.93103448275863" fill="none" stroke="purple" stroke-width="1" />
101
- </g>
102
- <g>
103
- <polyline data-points="2.45,-1 2.25,-1 2.25,1 2.45,1" data-type="line" data-label="" points="362.7586206896552,407.44827586206895 351.7241379310345,407.44827586206895 351.7241379310345,297.1034482758621 362.7586206896552,297.1034482758621" fill="none" stroke="purple" stroke-width="1" />
104
- </g>
105
- <g>
106
- <polyline data-points="0.5,2 1.475,2 1.475,1 2.45,1" data-type="line" data-label="" points="255.17241379310343,241.93103448275863 308.9655172413793,241.93103448275863 308.9655172413793,297.1034482758621 362.7586206896552,297.1034482758621" fill="none" stroke="purple" stroke-width="1" />
107
- </g>
108
- <g>
109
- <polyline data-points="3.55,1 5.45,1" data-type="line" data-label="" points="423.44827586206895,297.1034482758621 528.2758620689655,297.1034482758621" fill="none" stroke="purple" stroke-width="1" />
110
- </g>
111
- <g>
112
- <polyline data-points="3.55,-1 5.45,-1" data-type="line" data-label="" points="423.44827586206895,407.44827586206895 528.2758620689655,407.44827586206895" fill="none" stroke="purple" stroke-width="1" />
113
- </g>
114
- <g>
115
- <polyline data-points="6.55,-1 6.75,-1 6.75,1 6.55,1" data-type="line" data-label="" points="588.9655172413793,407.44827586206895 600,407.44827586206895 600,297.1034482758621 588.9655172413793,297.1034482758621" fill="none" stroke="purple" stroke-width="1" />
116
- </g>
117
- <g>
118
- <polyline data-points="-2.6,1.8 -2.499,1.8 -2.499,1.5990000000000002" data-type="line" data-label="" points="84.13793103448276,252.9655172413793 89.7103448275862,252.9655172413793 89.7103448275862,264.0551724137931" fill="none" stroke="purple" stroke-width="1" />
119
- </g>
120
- <g>
121
- <rect data-type="rect" data-label="BT1" data-x="-3" data-y="2" x="40" y="219.86206896551727" width="44.13793103448276" height="44.13793103448273" fill="hsl(199, 100%, 50%, 0.8)" stroke="black" stroke-width="0.018125000000000002" />
122
- </g>
123
- <g>
124
- <rect data-type="rect" data-label="SW1" data-x="0" data-y="2" x="200" y="219.86206896551727" width="55.17241379310343" height="44.13793103448273" fill="hsl(69, 100%, 50%, 0.8)" stroke="black" stroke-width="0.018125000000000002" />
125
- </g>
126
- <g>
127
- <rect data-type="rect" data-label="R1" data-x="3" data-y="1" x="362.7586206896552" y="286.3748772413793" width="60.68965517241378" height="21.45714206896554" fill="hsl(71, 100%, 50%, 0.8)" stroke="black" stroke-width="0.018125000000000002" />
128
- </g>
129
- <g>
130
- <rect data-type="rect" data-label="R2" data-x="3" data-y="-1" x="362.7586206896552" y="396.7197048275862" width="60.68965517241378" height="21.45714206896554" fill="hsl(72, 100%, 50%, 0.8)" stroke="black" stroke-width="0.018125000000000002" />
131
- </g>
132
- <g>
133
- <rect data-type="rect" data-label="D1" data-x="6" data-y="1" x="528.2758620689655" y="286.3748772413793" width="60.689655172413836" height="21.45714206896554" fill="hsl(357, 100%, 50%, 0.8)" stroke="black" stroke-width="0.018125000000000002" />
134
- </g>
135
- <g>
136
- <rect data-type="rect" data-label="D2" data-x="6" data-y="-1" x="528.2758620689655" y="396.7197048275862" width="60.689655172413836" height="21.45714206896554" fill="hsl(358, 100%, 50%, 0.8)" stroke="black" stroke-width="0.018125000000000002" />
137
- </g>
138
- <g>
139
- <rect data-type="rect" data-label="netId: BT1.plus to SW1.in
140
- globalConnNetId: connectivity_net0" data-x="-2.075" data-y="2.4250000000000003" x="107.5862068965517" y="206.06896551724137" width="11.034482758620712" height="24.82758620689657" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.018125000000000002" />
141
- </g>
142
- <g>
143
- <rect data-type="rect" data-label="netId: GND
144
- globalConnNetId: connectivity_net4" data-x="-2.499" data-y="1.3590000000000002" x="84.19310344827585" y="264.0551724137931" width="11.034482758620697" height="26.48275862068965" fill="#00000066" stroke="#000000" stroke-width="0.018125000000000002" />
145
- </g>
146
- <g>
147
- <rect data-type="rect" data-label="netId: GND
148
- globalConnNetId: connectivity_net4" data-x="6.65" data-y="-1.24" x="588.9655172413793" y="407.44827586206895" width="11.034482758620697" height="26.48275862068965" fill="#00000066" stroke="#000000" stroke-width="0.018125000000000002" />
149
- </g>
150
- <g>
151
- <rect data-type="rect" data-label="netId: SW1.out to R2.left
152
- globalConnNetId: connectivity_net1" data-x="2.25" data-y="-1.225" x="346.2068965517241" y="407.44827586206895" width="11.034482758620697" height="24.82758620689657" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.018125000000000002" />
153
- </g>
154
- <g>
155
- <rect data-type="rect" data-label="netId: R1.right to D1.a
156
- globalConnNetId: connectivity_net2" data-x="4.5" data-y="1.225" x="470.34482758620686" y="272.2758620689655" width="11.034482758620697" height="24.82758620689657" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.018125000000000002" />
157
- </g>
158
- <g>
159
- <rect data-type="rect" data-label="netId: R2.right to D2.a
160
- globalConnNetId: connectivity_net3" data-x="4.5" data-y="-0.775" x="470.34482758620686" y="382.62068965517244" width="11.034482758620697" height="24.827586206896513" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.018125000000000002" />
161
- </g>
162
- <g id="crosshair" style="display: none">
163
- <line id="crosshair-h" y1="0" y2="640" stroke="#666" stroke-width="0.5" />
164
- <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>
165
- </g>
166
- <script>
167
- <![CDATA[
168
- document.currentScript.parentElement.addEventListener('mousemove', (e) => {
169
- const svg = e.currentTarget;
170
- const rect = svg.getBoundingClientRect();
171
- const x = e.clientX - rect.left;
172
- const y = e.clientY - rect.top;
173
- const crosshair = svg.getElementById('crosshair');
174
- const h = svg.getElementById('crosshair-h');
175
- const v = svg.getElementById('crosshair-v');
176
- 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="-2.6,2.2 -0.5,2" data-type="line" data-label="" points="84.13793103448276,230.89655172413794 200,241.93103448275863" fill="none" stroke="hsl(0, 100%, 50%, 0.8)" stroke-width="1px"/></g><g><polyline data-points="0.5,2 2.45,1" data-type="line" data-label="" points="255.17241379310343,241.93103448275863 362.7586206896552,297.1034482758621" fill="none" stroke="hsl(304, 100%, 50%, 0.8)" stroke-width="1px"/></g><g><polyline data-points="0.5,2 2.45,-1" data-type="line" data-label="" points="255.17241379310343,241.93103448275863 362.7586206896552,407.44827586206895" fill="none" stroke="hsl(304, 100%, 50%, 0.8)" stroke-width="1px"/></g><g><polyline data-points="3.55,1 5.45,1" data-type="line" data-label="" points="423.44827586206895,297.1034482758621 528.2758620689655,297.1034482758621" fill="none" stroke="hsl(312, 100%, 50%, 0.8)" stroke-width="1px"/></g><g><polyline data-points="3.55,-1 5.45,-1" data-type="line" data-label="" points="423.44827586206895,407.44827586206895 528.2758620689655,407.44827586206895" fill="none" stroke="hsl(320, 100%, 50%, 0.8)" stroke-width="1px"/></g><g><polyline data-points="-2.6,1.8 6.55,1" data-type="line" data-label="" points="84.13793103448276,252.9655172413793 588.9655172413793,297.1034482758621" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-2.6,1.8 6.55,-1" data-type="line" data-label="" points="84.13793103448276,252.9655172413793 588.9655172413793,407.44827586206895" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="6.55,1 6.55,-1" data-type="line" data-label="" points="588.9655172413793,297.1034482758621 588.9655172413793,407.44827586206895" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-2.6,2.2 -1.55,2.2 -1.55,2 -0.5,2" data-type="line" data-label="" points="84.13793103448276,230.89655172413794 142.06896551724137,230.89655172413794 142.06896551724137,241.93103448275863 200,241.93103448275863" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="2.45,-1 2.25,-1 2.25,1 2.45,1" data-type="line" data-label="" points="362.7586206896552,407.44827586206895 351.7241379310345,407.44827586206895 351.7241379310345,297.1034482758621 362.7586206896552,297.1034482758621" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="0.5,2 1.475,2 1.475,1 2.45,1" data-type="line" data-label="" points="255.17241379310343,241.93103448275863 308.9655172413793,241.93103448275863 308.9655172413793,297.1034482758621 362.7586206896552,297.1034482758621" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="3.55,1 5.45,1" data-type="line" data-label="" points="423.44827586206895,297.1034482758621 528.2758620689655,297.1034482758621" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="3.55,-1 5.45,-1" data-type="line" data-label="" points="423.44827586206895,407.44827586206895 528.2758620689655,407.44827586206895" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="6.55,-1 6.75,-1 6.75,1 6.55,1" data-type="line" data-label="" points="588.9655172413793,407.44827586206895 600,407.44827586206895 600,297.1034482758621 588.9655172413793,297.1034482758621" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="-2.6,1.8 -2.499,1.8 -2.499,1.5990000000000002" data-type="line" data-label="" points="84.13793103448276,252.9655172413793 89.7103448275862,252.9655172413793 89.7103448275862,264.0551724137931" fill="none" stroke="purple" stroke-width="1px"/></g><g><rect data-type="rect" data-label="BT1" data-x="-3" data-y="2" x="39.999999999999986" y="219.86206896551727" width="44.13793103448276" height="44.13793103448273" fill="hsl(199, 100%, 50%, 0.8)" stroke="black" stroke-width="0.018125000000000002"/></g><g><rect data-type="rect" data-label="SW1" data-x="0" data-y="2" x="200" y="219.86206896551727" width="55.17241379310343" height="44.13793103448273" fill="hsl(69, 100%, 50%, 0.8)" stroke="black" stroke-width="0.018125000000000002"/></g><g><rect data-type="rect" data-label="R1" data-x="3" data-y="1" x="362.75862068965523" y="286.3748772413793" width="60.68965517241378" height="21.45714206896554" fill="hsl(71, 100%, 50%, 0.8)" stroke="black" stroke-width="0.018125000000000002"/></g><g><rect data-type="rect" data-label="R2" data-x="3" data-y="-1" x="362.75862068965523" y="396.71970482758616" width="60.68965517241378" height="21.45714206896554" fill="hsl(72, 100%, 50%, 0.8)" stroke="black" stroke-width="0.018125000000000002"/></g><g><rect data-type="rect" data-label="D1" data-x="6" data-y="1" x="528.2758620689656" y="286.3748772413793" width="60.689655172413836" height="21.45714206896554" fill="hsl(357, 100%, 50%, 0.8)" stroke="black" stroke-width="0.018125000000000002"/></g><g><rect data-type="rect" data-label="D2" data-x="6" data-y="-1" x="528.2758620689656" y="396.71970482758616" width="60.689655172413836" height="21.45714206896554" fill="hsl(358, 100%, 50%, 0.8)" stroke="black" stroke-width="0.018125000000000002"/></g><g><rect data-type="rect" data-label="netId: BT1.plus to SW1.in
2
+ globalConnNetId: connectivity_net0" data-x="-2.075" data-y="2.4250000000000003" x="107.58620689655172" y="206.06896551724137" width="11.034482758620712" height="24.82758620689657" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.018125000000000002"/></g><g><rect data-type="rect" data-label="netId: GND
3
+ globalConnNetId: connectivity_net4" data-x="-2.499" data-y="1.3590000000000002" x="84.19310344827585" y="264.0551724137931" width="11.034482758620697" height="26.48275862068965" fill="#00000066" stroke="#000000" stroke-width="0.018125000000000002"/></g><g><rect data-type="rect" data-label="netId: GND
4
+ globalConnNetId: connectivity_net4" data-x="6.65" data-y="-1.24" x="588.9655172413793" y="407.44827586206895" width="11.034482758620697" height="26.48275862068965" fill="#00000066" stroke="#000000" stroke-width="0.018125000000000002"/></g><g><rect data-type="rect" data-label="netId: SW1.out to R2.left
5
+ globalConnNetId: connectivity_net1" data-x="2.25" data-y="-1.225" x="346.2068965517241" y="407.44827586206895" width="11.034482758620697" height="24.82758620689657" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.018125000000000002"/></g><g><rect data-type="rect" data-label="netId: R1.right to D1.a
6
+ globalConnNetId: connectivity_net2" data-x="4.5" data-y="1.225" x="470.34482758620686" y="272.27586206896547" width="11.034482758620697" height="24.82758620689657" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.018125000000000002"/></g><g><rect data-type="rect" data-label="netId: R2.right to D2.a
7
+ globalConnNetId: connectivity_net3" data-x="4.5" data-y="-0.775" x="470.34482758620686" y="382.62068965517244" width="11.034482758620697" height="24.827586206896513" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.018125000000000002"/></g><g><circle data-type="point" data-label="BT1.1
8
+ x+" data-x="-2.6" data-y="2.2" cx="84.13793103448276" cy="230.89655172413794" r="3" fill="hsl(114, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="BT1.2
9
+ x+" data-x="-2.6" data-y="1.8" cx="84.13793103448276" cy="252.9655172413793" r="3" fill="hsl(115, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="SW1.1
10
+ x-" data-x="-0.5" data-y="2" cx="200" cy="241.93103448275863" r="3" fill="hsl(104, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="SW1.2
11
+ x+" data-x="0.5" data-y="2" cx="255.17241379310343" cy="241.93103448275863" r="3" fill="hsl(105, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="R1.1
12
+ x-" data-x="2.45" data-y="1" cx="362.7586206896552" cy="297.1034482758621" r="3" fill="hsl(226, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="R1.2
13
+ x+" data-x="3.55" data-y="1" cx="423.44827586206895" cy="297.1034482758621" r="3" fill="hsl(227, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="R2.1
14
+ x-" data-x="2.45" data-y="-1" cx="362.7586206896552" cy="407.44827586206895" r="3" fill="hsl(107, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="R2.2
15
+ x+" data-x="3.55" data-y="-1" cx="423.44827586206895" cy="407.44827586206895" r="3" fill="hsl(108, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="D1.1
16
+ x-" data-x="5.45" data-y="1" cx="528.2758620689655" cy="297.1034482758621" r="3" fill="hsl(32, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="D1.2
17
+ x+" data-x="6.55" data-y="1" cx="588.9655172413793" cy="297.1034482758621" r="3" fill="hsl(33, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="D2.1
18
+ x-" data-x="5.45" data-y="-1" cx="528.2758620689655" cy="407.44827586206895" r="3" fill="hsl(273, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="D2.2
19
+ x+" data-x="6.55" data-y="-1" cx="588.9655172413793" cy="407.44827586206895" r="3" fill="hsl(274, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="anchorPoint
20
+ orientation: y+" data-x="-2.075" data-y="2.2" cx="113.10344827586206" cy="230.89655172413794" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
21
+ orientation: y-" data-x="-2.499" data-y="1.5990000000000002" cx="89.7103448275862" cy="264.0551724137931" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
22
+ orientation: y-" data-x="6.65" data-y="-1" cx="594.4827586206897" cy="407.44827586206895" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
23
+ orientation: y-" data-x="2.25" data-y="-1" cx="351.7241379310345" cy="407.44827586206895" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
24
+ orientation: y+" data-x="4.5" data-y="1" cx="475.8620689655172" cy="297.1034482758621" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
25
+ orientation: y+" data-x="4.5" data-y="-1" cx="475.8620689655172" cy="407.44827586206895" 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[
26
+ document.currentScript.parentElement.addEventListener('mousemove', (e) => {
27
+ const svg = e.currentTarget;
28
+ const rect = svg.getBoundingClientRect();
29
+ const x = e.clientX - rect.left;
30
+ const y = e.clientY - rect.top;
31
+ const crosshair = svg.getElementById('crosshair');
32
+ const h = svg.getElementById('crosshair-h');
33
+ const v = svg.getElementById('crosshair-v');
34
+ const coords = svg.getElementById('coordinates');
35
+
36
+ crosshair.style.display = 'block';
37
+ h.setAttribute('x1', '0');
38
+ h.setAttribute('x2', '640');
39
+ h.setAttribute('y1', y);
40
+ h.setAttribute('y2', y);
41
+ v.setAttribute('x1', x);
42
+ v.setAttribute('x2', x);
43
+ v.setAttribute('y1', '0');
44
+ v.setAttribute('y2', '640');
177
45
 
178
- crosshair.style.display = 'block';
179
- h.setAttribute('x1', '0');
180
- h.setAttribute('x2', '640');
181
- h.setAttribute('y1', y);
182
- h.setAttribute('y2', y);
183
- v.setAttribute('x1', x);
184
- v.setAttribute('x2', x);
185
- v.setAttribute('y1', '0');
186
- v.setAttribute('y2', '640');
187
-
188
- // Calculate real coordinates using inverse transformation
189
- const matrix = {
190
- "a": 55.172413793103445,
191
- "c": 0,
192
- "e": 227.58620689655172,
193
- "b": 0,
194
- "d": -55.172413793103445,
195
- "f": 352.2758620689655
196
- };
197
- // Manually invert and apply the affine transform
198
- // Since we only use translate and scale, we can directly compute:
199
- // x' = (x - tx) / sx
200
- // y' = (y - ty) / sy
201
- const sx = matrix.a;
202
- const sy = matrix.d;
203
- const tx = matrix.e;
204
- const ty = matrix.f;
205
- const realPoint = {
206
- x: (x - tx) / sx,
207
- y: (y - ty) / sy // Flip y back since we used negative scale
208
- }
209
-
210
- coords.textContent = `(${realPoint.x.toFixed(2)}, ${realPoint.y.toFixed(2)})`;
211
- coords.setAttribute('x', (x + 5).toString());
212
- coords.setAttribute('y', (y - 5).toString());
213
- });
214
- document.currentScript.parentElement.addEventListener('mouseleave', () => {
215
- document.currentScript.parentElement.getElementById('crosshair').style.display = 'none';
216
- });
217
- ]]>
218
- </script>
219
- </svg>
46
+ // Calculate real coordinates using inverse transformation
47
+ const matrix = {"a":55.172413793103445,"c":0,"e":227.58620689655172,"b":0,"d":-55.172413793103445,"f":352.2758620689655};
48
+ // Manually invert and apply the affine transform
49
+ // Since we only use translate and scale, we can directly compute:
50
+ // x' = (x - tx) / sx
51
+ // y' = (y - ty) / sy
52
+ const sx = matrix.a;
53
+ const sy = matrix.d;
54
+ const tx = matrix.e;
55
+ const ty = matrix.f;
56
+ const realPoint = {
57
+ x: (x - tx) / sx,
58
+ y: (y - ty) / sy // Flip y back since we used negative scale
59
+ }
60
+
61
+ coords.textContent = `(${realPoint.x.toFixed(2)}, ${realPoint.y.toFixed(2)})`;
62
+ coords.setAttribute('x', (x + 5).toString());
63
+ coords.setAttribute('y', (y - 5).toString());
64
+ });
65
+ document.currentScript.parentElement.addEventListener('mouseleave', () => {
66
+ document.currentScript.parentElement.getElementById('crosshair').style.display = 'none';
67
+ });
68
+ ]]></script></svg>
@@ -1,88 +1,48 @@
1
- <svg width="640" height="640" viewBox="0 0 640 640" xmlns="http://www.w3.org/2000/svg">
2
- <rect width="100%" height="100%" fill="white" />
3
- <g>
4
- <circle data-type="point" data-label="U1.3
5
- x+" data-x="1.05" data-y="-0.1" cx="359.5652173913043" cy="313.9130434782609" r="3" fill="hsl(321, 100%, 50%, 0.8)" />
6
- </g>
7
- <g>
8
- <circle data-type="point" data-label="U1.4
9
- x+" data-x="1.05" data-y="0.1" cx="359.5652173913043" cy="283.47826086956525" r="3" fill="hsl(322, 100%, 50%, 0.8)" />
10
- </g>
11
- <g>
12
- <circle data-type="point" data-label="anchorPoint
13
- orientation: y-" data-x="2.5300000000000002" data-y="-0.1" cx="584.7826086956521" cy="313.9130434782609" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
14
- </g>
15
- <g>
16
- <polyline data-points="1.05,-0.1 1.05,0.1" data-type="line" data-label="" points="359.5652173913043,313.9130434782609 359.5652173913043,283.47826086956525" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
17
- </g>
18
- <g>
19
- <polyline data-points="1.05,-0.1 2.5300000000000002,-0.1 2.5300000000000002,0.1 1.05,0.1" data-type="line" data-label="" points="359.5652173913043,313.9130434782609 584.7826086956521,313.9130434782609 584.7826086956521,283.47826086956525 359.5652173913043,283.47826086956525" fill="none" stroke="purple" stroke-width="1" />
20
- </g>
21
- <g>
22
- <rect data-type="rect" data-label="U1" data-x="0" data-y="0" x="40.00000000000006" y="253.0434782608696" width="319.56521739130426" height="91.30434782608691" fill="hsl(164, 100%, 50%, 0.8)" stroke="black" stroke-width="0.006571428571428573" />
23
- </g>
24
- <g>
25
- <rect data-type="rect" data-label="SOMETHING_THAT_IS_LONG" data-x="0.79" data-y="-0.43" x="100.86956521739135" y="350.4347826086956" width="438.26086956521726" height="27.39130434782612" fill="rgba(160, 0, 220, 0.14)" stroke="black" stroke-width="0.006571428571428573" />
26
- </g>
27
- <g>
28
- <rect data-type="rect" data-label="netId: GND
29
- globalConnNetId: connectivity_net0" data-x="2.5300000000000002" data-y="-0.33999999999999997" x="569.5652173913043" y="313.9130434782609" width="30.43478260869574" height="73.04347826086956" fill="#00000066" stroke="#000000" stroke-width="0.006571428571428573" />
30
- </g>
31
- <g id="crosshair" style="display: none">
32
- <line id="crosshair-h" y1="0" y2="640" stroke="#666" stroke-width="0.5" />
33
- <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>
34
- </g>
35
- <script>
36
- <![CDATA[
37
- document.currentScript.parentElement.addEventListener('mousemove', (e) => {
38
- const svg = e.currentTarget;
39
- const rect = svg.getBoundingClientRect();
40
- const x = e.clientX - rect.left;
41
- const y = e.clientY - rect.top;
42
- const crosshair = svg.getElementById('crosshair');
43
- const h = svg.getElementById('crosshair-h');
44
- const v = svg.getElementById('crosshair-v');
45
- 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.05,-0.1 1.05,0.1" data-type="line" data-label="" points="359.5652173913043,313.9130434782609 359.5652173913043,283.47826086956525" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="1.05,-0.1 2.5300000000000002,-0.1 2.5300000000000002,0.1 1.05,0.1" data-type="line" data-label="" points="359.5652173913043,313.9130434782609 584.7826086956521,313.9130434782609 584.7826086956521,283.47826086956525 359.5652173913043,283.47826086956525" fill="none" stroke="purple" stroke-width="1px"/></g><g><rect data-type="rect" data-label="U1" data-x="0" data-y="0" x="40.00000000000006" y="253.04347826086962" width="319.56521739130426" height="91.30434782608691" fill="hsl(164, 100%, 50%, 0.8)" stroke="black" stroke-width="0.006571428571428573"/></g><g><rect data-type="rect" data-label="SOMETHING_THAT_IS_LONG" data-x="0.79" data-y="-0.43" x="100.86956521739137" y="350.4347826086956" width="438.26086956521726" height="27.39130434782612" fill="rgba(160, 0, 220, 0.14)" stroke="black" stroke-width="0.006571428571428573"/></g><g><rect data-type="rect" data-label="netId: GND
2
+ globalConnNetId: connectivity_net0" data-x="2.5300000000000002" data-y="-0.33999999999999997" x="569.5652173913043" y="313.9130434782609" width="30.43478260869574" height="73.04347826086956" fill="#00000066" stroke="#000000" stroke-width="0.006571428571428573"/></g><g><circle data-type="point" data-label="U1.3
3
+ x+" data-x="1.05" data-y="-0.1" cx="359.5652173913043" cy="313.9130434782609" r="3" fill="hsl(321, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U1.4
4
+ x+" data-x="1.05" data-y="0.1" cx="359.5652173913043" cy="283.47826086956525" r="3" fill="hsl(322, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="anchorPoint
5
+ orientation: y-" data-x="2.5300000000000002" data-y="-0.1" cx="584.7826086956521" cy="313.9130434782609" 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[
6
+ document.currentScript.parentElement.addEventListener('mousemove', (e) => {
7
+ const svg = e.currentTarget;
8
+ const rect = svg.getBoundingClientRect();
9
+ const x = e.clientX - rect.left;
10
+ const y = e.clientY - rect.top;
11
+ const crosshair = svg.getElementById('crosshair');
12
+ const h = svg.getElementById('crosshair-h');
13
+ const v = svg.getElementById('crosshair-v');
14
+ const coords = svg.getElementById('coordinates');
15
+
16
+ crosshair.style.display = 'block';
17
+ h.setAttribute('x1', '0');
18
+ h.setAttribute('x2', '640');
19
+ h.setAttribute('y1', y);
20
+ h.setAttribute('y2', y);
21
+ v.setAttribute('x1', x);
22
+ v.setAttribute('x2', x);
23
+ v.setAttribute('y1', '0');
24
+ v.setAttribute('y2', '640');
46
25
 
47
- crosshair.style.display = 'block';
48
- h.setAttribute('x1', '0');
49
- h.setAttribute('x2', '640');
50
- h.setAttribute('y1', y);
51
- h.setAttribute('y2', y);
52
- v.setAttribute('x1', x);
53
- v.setAttribute('x2', x);
54
- v.setAttribute('y1', '0');
55
- v.setAttribute('y2', '640');
56
-
57
- // Calculate real coordinates using inverse transformation
58
- const matrix = {
59
- "a": 152.17391304347822,
60
- "c": 0,
61
- "e": 199.7826086956522,
62
- "b": 0,
63
- "d": -152.17391304347822,
64
- "f": 298.69565217391306
65
- };
66
- // Manually invert and apply the affine transform
67
- // Since we only use translate and scale, we can directly compute:
68
- // x' = (x - tx) / sx
69
- // y' = (y - ty) / sy
70
- const sx = matrix.a;
71
- const sy = matrix.d;
72
- const tx = matrix.e;
73
- const ty = matrix.f;
74
- const realPoint = {
75
- x: (x - tx) / sx,
76
- y: (y - ty) / sy // Flip y back since we used negative scale
77
- }
78
-
79
- coords.textContent = `(${realPoint.x.toFixed(2)}, ${realPoint.y.toFixed(2)})`;
80
- coords.setAttribute('x', (x + 5).toString());
81
- coords.setAttribute('y', (y - 5).toString());
82
- });
83
- document.currentScript.parentElement.addEventListener('mouseleave', () => {
84
- document.currentScript.parentElement.getElementById('crosshair').style.display = 'none';
85
- });
86
- ]]>
87
- </script>
88
- </svg>
26
+ // Calculate real coordinates using inverse transformation
27
+ const matrix = {"a":152.17391304347822,"c":0,"e":199.7826086956522,"b":0,"d":-152.17391304347822,"f":298.69565217391306};
28
+ // Manually invert and apply the affine transform
29
+ // Since we only use translate and scale, we can directly compute:
30
+ // x' = (x - tx) / sx
31
+ // y' = (y - ty) / sy
32
+ const sx = matrix.a;
33
+ const sy = matrix.d;
34
+ const tx = matrix.e;
35
+ const ty = matrix.f;
36
+ const realPoint = {
37
+ x: (x - tx) / sx,
38
+ y: (y - ty) / sy // Flip y back since we used negative scale
39
+ }
40
+
41
+ coords.textContent = `(${realPoint.x.toFixed(2)}, ${realPoint.y.toFixed(2)})`;
42
+ coords.setAttribute('x', (x + 5).toString());
43
+ coords.setAttribute('y', (y - 5).toString());
44
+ });
45
+ document.currentScript.parentElement.addEventListener('mouseleave', () => {
46
+ document.currentScript.parentElement.getElementById('crosshair').style.display = 'none';
47
+ });
48
+ ]]></script></svg>