@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,224 +1,76 @@
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="R1.1
5
- x-" data-x="-4.24" data-y="1.7" cx="245.23560209424073" cy="231.8386777486911" r="3" fill="hsl(226, 100%, 50%, 0.8)" />
6
- </g>
7
- <g>
8
- <circle data-type="point" data-label="R1.2
9
- x+" data-x="-3.1399999999999997" data-y="1.7" cx="325.8638743455497" cy="231.8386777486911" r="3" fill="hsl(227, 100%, 50%, 0.8)" />
10
- </g>
11
- <g>
12
- <circle data-type="point" data-label="C1.1
13
- x-" data-x="-6.74" data-y="0.3" cx="61.98952879581145" cy="334.4564787958115" r="3" fill="hsl(121, 100%, 50%, 0.8)" />
14
- </g>
15
- <g>
16
- <circle data-type="point" data-label="C1.2
17
- x+" data-x="-5.640000000000001" data-y="0.3" cx="142.61780104712034" cy="334.4564787958115" r="3" fill="hsl(122, 100%, 50%, 0.8)" />
18
- </g>
19
- <g>
20
- <circle data-type="point" data-label="U1.1
21
- x-" data-x="-0.6000000000000001" data-y="0.30000000000000004" cx="512.0418848167538" cy="334.4564787958115" r="3" fill="hsl(319, 100%, 50%, 0.8)" />
22
- </g>
23
- <g>
24
- <circle data-type="point" data-label="U1.2
25
- x-" data-x="-0.6000000000000001" data-y="0.10000000000000003" cx="512.0418848167538" cy="349.11616465968586" r="3" fill="hsl(320, 100%, 50%, 0.8)" />
26
- </g>
27
- <g>
28
- <circle data-type="point" data-label="U1.3
29
- x-" data-x="-0.6000000000000001" data-y="-0.09999999999999998" cx="512.0418848167538" cy="363.77585052356017" r="3" fill="hsl(321, 100%, 50%, 0.8)" />
30
- </g>
31
- <g>
32
- <circle data-type="point" data-label="U1.4
33
- x-" data-x="-0.6000000000000001" data-y="-0.30000000000000004" cx="512.0418848167538" cy="378.4355363874345" r="3" fill="hsl(322, 100%, 50%, 0.8)" />
34
- </g>
35
- <g>
36
- <circle data-type="point" data-label="U1.5
37
- x+" data-x="0.6000000000000001" data-y="-0.30000000000000004" cx="599.9999999999999" cy="378.4355363874345" r="3" fill="hsl(323, 100%, 50%, 0.8)" />
38
- </g>
39
- <g>
40
- <circle data-type="point" data-label="U1.6
41
- x+" data-x="0.6000000000000001" data-y="-0.10000000000000003" cx="599.9999999999999" cy="363.77585052356017" r="3" fill="hsl(324, 100%, 50%, 0.8)" />
42
- </g>
43
- <g>
44
- <circle data-type="point" data-label="U1.7
45
- x+" data-x="0.6000000000000001" data-y="0.09999999999999998" cx="599.9999999999999" cy="349.11616465968586" r="3" fill="hsl(325, 100%, 50%, 0.8)" />
46
- </g>
47
- <g>
48
- <circle data-type="point" data-label="U1.8
49
- x+" data-x="0.6000000000000001" data-y="0.30000000000000004" cx="599.9999999999999" cy="334.4564787958115" r="3" fill="hsl(326, 100%, 50%, 0.8)" />
50
- </g>
51
- <g>
52
- <circle data-type="point" data-label="U2.1
53
- x-" data-x="-3.52" data-y="-0.09999999999999998" cx="298.01047120418843" cy="363.77585052356017" r="3" fill="hsl(200, 100%, 50%, 0.8)" />
54
- </g>
55
- <g>
56
- <circle data-type="point" data-label="U2.2
57
- x-" data-x="-3.52" data-y="-0.3" cx="298.01047120418843" cy="378.4355363874345" r="3" fill="hsl(201, 100%, 50%, 0.8)" />
58
- </g>
59
- <g>
60
- <circle data-type="point" data-label="U2.3
61
- x-" data-x="-3.52" data-y="-0.5" cx="298.01047120418843" cy="393.0952222513089" r="3" fill="hsl(202, 100%, 50%, 0.8)" />
62
- </g>
63
- <g>
64
- <circle data-type="point" data-label="U2.4
65
- x-" data-x="-3.52" data-y="-0.7000000000000001" cx="298.01047120418843" cy="407.75490811518324" r="3" fill="hsl(203, 100%, 50%, 0.8)" />
66
- </g>
67
- <g>
68
- <circle data-type="point" data-label="U2.5
69
- x+" data-x="-2.32" data-y="-0.7000000000000001" cx="385.96858638743447" cy="407.75490811518324" r="3" fill="hsl(204, 100%, 50%, 0.8)" />
70
- </g>
71
- <g>
72
- <circle data-type="point" data-label="U2.6
73
- x+" data-x="-2.32" data-y="-0.5" cx="385.96858638743447" cy="393.0952222513089" r="3" fill="hsl(205, 100%, 50%, 0.8)" />
74
- </g>
75
- <g>
76
- <circle data-type="point" data-label="U2.7
77
- x+" data-x="-2.32" data-y="-0.30000000000000004" cx="385.96858638743447" cy="378.4355363874345" r="3" fill="hsl(206, 100%, 50%, 0.8)" />
78
- </g>
79
- <g>
80
- <circle data-type="point" data-label="U2.8
81
- x+" data-x="-2.32" data-y="-0.09999999999999998" cx="385.96858638743447" cy="363.77585052356017" r="3" fill="hsl(207, 100%, 50%, 0.8)" />
82
- </g>
83
- <g>
84
- <circle data-type="point" data-label="anchorPoint
85
- orientation: y-" data-x="-6.94" data-y="0.3" cx="47.329842931937094" cy="334.4564787958115" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
86
- </g>
87
- <g>
88
- <circle data-type="point" data-label="anchorPoint
89
- orientation: x-" data-x="-0.6000000000000001" data-y="0.10000000000000003" cx="512.0418848167538" cy="349.11616465968586" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
90
- </g>
91
- <g>
92
- <circle data-type="point" data-label="anchorPoint
93
- orientation: x+" data-x="-3.1399999999999997" data-y="1.7" cx="325.8638743455497" cy="231.8386777486911" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
94
- </g>
95
- <g>
96
- <circle data-type="point" data-label="anchorPoint
97
- orientation: x-" data-x="-3.72" data-y="-0.09999999999999998" cx="283.3507853403141" cy="363.77585052356017" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
98
- </g>
99
- <g>
100
- <circle data-type="point" data-label="anchorPoint
101
- orientation: x-" data-x="-3.52" data-y="-0.3" cx="298.01047120418843" cy="378.4355363874345" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
102
- </g>
103
- <g>
104
- <circle data-type="point" data-label="anchorPoint
105
- orientation: x-" data-x="-0.6000000000000001" data-y="-0.30000000000000004" cx="512.0418848167538" cy="378.4355363874345" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
106
- </g>
107
- <g>
108
- <polyline data-points="-6.74,0.3 -4.24,1.7" data-type="line" data-label="" points="61.98952879581145,334.4564787958115 245.23560209424073,231.8386777486911" fill="none" stroke="hsl(24, 100%, 50%, 0.8)" stroke-width="1" />
109
- </g>
110
- <g>
111
- <polyline data-points="-0.6000000000000001,0.30000000000000004 -5.640000000000001,0.3" data-type="line" data-label="" points="512.0418848167538,334.4564787958115 142.61780104712034,334.4564787958115" fill="none" stroke="hsl(8, 100%, 50%, 0.8)" stroke-width="1" />
112
- </g>
113
- <g>
114
- <polyline data-points="-0.6000000000000001,0.10000000000000003 -3.1399999999999997,1.7" data-type="line" data-label="" points="512.0418848167538,349.11616465968586 325.8638743455497,231.8386777486911" fill="none" stroke="hsl(8, 100%, 50%, 0.8)" stroke-width="1" />
115
- </g>
116
- <g>
117
- <polyline data-points="-3.52,-0.09999999999999998 -0.6000000000000001,-0.09999999999999998" data-type="line" data-label="" points="298.01047120418843,363.77585052356017 512.0418848167538,363.77585052356017" fill="none" stroke="hsl(152, 100%, 50%, 0.8)" stroke-width="1" />
118
- </g>
119
- <g>
120
- <polyline data-points="-3.52,-0.3 -0.6000000000000001,-0.30000000000000004" data-type="line" data-label="" points="298.01047120418843,378.4355363874345 512.0418848167538,378.4355363874345" fill="none" stroke="hsl(152, 100%, 50%, 0.8)" stroke-width="1" />
121
- </g>
122
- <g>
123
- <polyline data-points="-6.74,0.3 -6.94,0.3 -6.94,1.7 -4.24,1.7" data-type="line" data-label="" points="61.98952879581145,334.4564787958115 47.329842931937094,334.4564787958115 47.329842931937094,231.8386777486911 245.23560209424073,231.8386777486911" fill="none" stroke="purple" stroke-width="1" />
124
- </g>
125
- <g>
126
- <polyline data-points="-0.6000000000000001,0.30000000000000004 -5.640000000000001,0.3" data-type="line" data-label="" points="512.0418848167538,334.4564787958115 142.61780104712034,334.4564787958115" fill="none" stroke="purple" stroke-width="1" />
127
- </g>
128
- <g>
129
- <polyline data-points="-3.52,-0.09999999999999998 -3.72,-0.09999999999999998 -3.72,0.4 -1.1510000000000002,0.4 -1.1510000000000002,-0.09999999999999998 -0.6000000000000005,-0.09999999999999998" data-type="line" data-label="" points="298.01047120418843,363.77585052356017 283.3507853403141,363.77585052356017 283.3507853403141,327.1266358638743 471.65445026177997,327.1266358638743 471.65445026177997,363.77585052356017 512.0418848167538,363.77585052356017" fill="none" stroke="purple" stroke-width="1" />
130
- </g>
131
- <g>
132
- <rect data-type="rect" data-label="schematic_component_0" data-x="-3.69" data-y="1.7" x="245.23560209424073" y="217.58540602094243" width="80.62827225130894" height="28.506543455497336" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.013642857142857144" />
133
- </g>
134
- <g>
135
- <rect data-type="rect" data-label="schematic_component_1" data-x="-6.19" data-y="0.3" x="61.98952879581145" y="303.67113848167537" width="80.62827225130889" height="61.57068062827227" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.013642857142857144" />
136
- </g>
137
- <g>
138
- <rect data-type="rect" data-label="schematic_component_2" data-x="0" data-y="0" x="512.0418848167538" y="319.79679293193715" width="87.95811518324604" height="73.29842931937173" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.013642857142857144" />
139
- </g>
140
- <g>
141
- <rect data-type="rect" data-label="schematic_component_3" data-x="-2.92" data-y="-0.4" x="298.01047120418843" y="349.11616465968586" width="87.95811518324604" height="73.29842931937173" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.013642857142857144" />
142
- </g>
143
- <g>
144
- <rect data-type="rect" data-label="netId: .C1 &gt; .pin1 to R1.pin1
145
- globalConnNetId: connectivity_net0" data-x="-6.94" data-y="0.07499999999999998" x="40" y="334.4564787958115" width="14.659685863874245" height="32.98429319371729" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.013642857142857144" />
146
- </g>
147
- <g>
148
- <rect data-type="rect" data-label="netId: .U1 &gt; .pin2 to R1.pin2
149
- globalConnNetId: connectivity_net2" data-x="-0.8260000000000001" data-y="0.10000000000000003" x="478.9842931937172" y="341.78632172774866" width="32.98429319371729" height="14.659685863874358" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.013642857142857144" />
150
- </g>
151
- <g>
152
- <rect data-type="rect" data-label="netId: .U1 &gt; .pin2 to R1.pin2
153
- globalConnNetId: connectivity_net2" data-x="-2.9139999999999997" data-y="1.7" x="325.93717277486905" y="224.5088348167539" width="32.98429319371729" height="14.659685863874358" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.013642857142857144" />
154
- </g>
155
- <g>
156
- <rect data-type="rect" data-label="netId: .U2 &gt; .pin1 to U1.pin3
157
- globalConnNetId: connectivity_net3" data-x="-3.9450000000000003" data-y="-0.09999999999999998" x="250.36649214659678" y="356.446007591623" width="32.98429319371729" height="14.659685863874358" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.013642857142857144" />
158
- </g>
159
- <g>
160
- <rect data-type="rect" data-label="netId: .U2 &gt; .pin2 to U1.pin4
161
- globalConnNetId: connectivity_net4" data-x="-3.746" data-y="-0.3" x="264.95287958115176" y="371.1056934554974" width="32.98429319371729" height="14.659685863874358" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.013642857142857144" />
162
- </g>
163
- <g>
164
- <rect data-type="rect" data-label="netId: .U2 &gt; .pin2 to U1.pin4
165
- globalConnNetId: connectivity_net4" data-x="-0.8260000000000001" data-y="-0.30000000000000004" x="478.9842931937172" y="371.1056934554974" width="32.98429319371729" height="14.659685863874358" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.013642857142857144" />
166
- </g>
167
- <g id="crosshair" style="display: none">
168
- <line id="crosshair-h" y1="0" y2="640" stroke="#666" stroke-width="0.5" />
169
- <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>
170
- </g>
171
- <script>
172
- <![CDATA[
173
- document.currentScript.parentElement.addEventListener('mousemove', (e) => {
174
- const svg = e.currentTarget;
175
- const rect = svg.getBoundingClientRect();
176
- const x = e.clientX - rect.left;
177
- const y = e.clientY - rect.top;
178
- const crosshair = svg.getElementById('crosshair');
179
- const h = svg.getElementById('crosshair-h');
180
- const v = svg.getElementById('crosshair-v');
181
- 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="-6.74,0.3 -4.24,1.7" data-type="line" data-label="" points="61.98952879581145,334.4564787958115 245.23560209424073,231.8386777486911" fill="none" stroke="hsl(24, 100%, 50%, 0.8)" stroke-width="1px"/></g><g><polyline data-points="-0.6000000000000001,0.30000000000000004 -5.640000000000001,0.3" data-type="line" data-label="" points="512.0418848167538,334.4564787958115 142.61780104712034,334.4564787958115" fill="none" stroke="hsl(8, 100%, 50%, 0.8)" stroke-width="1px"/></g><g><polyline data-points="-0.6000000000000001,0.10000000000000003 -3.1399999999999997,1.7" data-type="line" data-label="" points="512.0418848167538,349.11616465968586 325.8638743455497,231.8386777486911" fill="none" stroke="hsl(8, 100%, 50%, 0.8)" stroke-width="1px"/></g><g><polyline data-points="-3.52,-0.09999999999999998 -0.6000000000000001,-0.09999999999999998" data-type="line" data-label="" points="298.01047120418843,363.77585052356017 512.0418848167538,363.77585052356017" fill="none" stroke="hsl(152, 100%, 50%, 0.8)" stroke-width="1px"/></g><g><polyline data-points="-3.52,-0.3 -0.6000000000000001,-0.30000000000000004" data-type="line" data-label="" points="298.01047120418843,378.4355363874345 512.0418848167538,378.4355363874345" fill="none" stroke="hsl(152, 100%, 50%, 0.8)" stroke-width="1px"/></g><g><polyline data-points="-6.74,0.3 -6.94,0.3 -6.94,1.7 -4.24,1.7" data-type="line" data-label="" points="61.98952879581145,334.4564787958115 47.329842931937094,334.4564787958115 47.329842931937094,231.8386777486911 245.23560209424073,231.8386777486911" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="-0.6000000000000001,0.30000000000000004 -5.640000000000001,0.3" data-type="line" data-label="" points="512.0418848167538,334.4564787958115 142.61780104712034,334.4564787958115" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="-3.52,-0.09999999999999998 -3.72,-0.09999999999999998 -3.72,0.4 -1.1510000000000002,0.4 -1.1510000000000002,-0.09999999999999998 -0.6000000000000005,-0.09999999999999998" data-type="line" data-label="" points="298.01047120418843,363.77585052356017 283.3507853403141,363.77585052356017 283.3507853403141,327.1266358638743 471.65445026177997,327.1266358638743 471.65445026177997,363.77585052356017 512.0418848167538,363.77585052356017" fill="none" stroke="purple" stroke-width="1px"/></g><g><rect data-type="rect" data-label="schematic_component_0" data-x="-3.69" data-y="1.7" x="245.23560209424076" y="217.58540602094246" width="80.62827225130894" height="28.506543455497336" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.013642857142857144"/></g><g><rect data-type="rect" data-label="schematic_component_1" data-x="-6.19" data-y="0.3" x="61.98952879581145" y="303.67113848167537" width="80.62827225130889" height="61.57068062827227" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.013642857142857144"/></g><g><rect data-type="rect" data-label="schematic_component_2" data-x="0" data-y="0" x="512.0418848167538" y="319.79679293193715" width="87.95811518324604" height="73.29842931937173" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.013642857142857144"/></g><g><rect data-type="rect" data-label="schematic_component_3" data-x="-2.92" data-y="-0.4" x="298.01047120418843" y="349.11616465968586" width="87.95811518324604" height="73.29842931937173" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.013642857142857144"/></g><g><rect data-type="rect" data-label="netId: .C1 &gt; .pin1 to R1.pin1
2
+ globalConnNetId: connectivity_net0" data-x="-6.94" data-y="0.07499999999999998" x="39.99999999999997" y="334.45647879581145" width="14.659685863874245" height="32.98429319371729" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.013642857142857144"/></g><g><rect data-type="rect" data-label="netId: .U1 &gt; .pin2 to R1.pin2
3
+ globalConnNetId: connectivity_net2" data-x="-0.8260000000000001" data-y="0.10000000000000003" x="478.9842931937171" y="341.7863217277487" width="32.98429319371729" height="14.659685863874358" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.013642857142857144"/></g><g><rect data-type="rect" data-label="netId: .U1 &gt; .pin2 to R1.pin2
4
+ globalConnNetId: connectivity_net2" data-x="-2.9139999999999997" data-y="1.7" x="325.93717277486905" y="224.50883481675393" width="32.98429319371729" height="14.659685863874358" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.013642857142857144"/></g><g><rect data-type="rect" data-label="netId: .U2 &gt; .pin1 to U1.pin3
5
+ globalConnNetId: connectivity_net3" data-x="-3.9450000000000003" data-y="-0.09999999999999998" x="250.36649214659676" y="356.446007591623" width="32.98429319371729" height="14.659685863874358" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.013642857142857144"/></g><g><rect data-type="rect" data-label="netId: .U2 &gt; .pin2 to U1.pin4
6
+ globalConnNetId: connectivity_net4" data-x="-3.746" data-y="-0.3" x="264.9528795811517" y="371.1056934554973" width="32.98429319371729" height="14.659685863874358" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.013642857142857144"/></g><g><rect data-type="rect" data-label="netId: .U2 &gt; .pin2 to U1.pin4
7
+ globalConnNetId: connectivity_net4" data-x="-0.8260000000000001" data-y="-0.30000000000000004" x="478.9842931937171" y="371.1056934554973" width="32.98429319371729" height="14.659685863874358" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.013642857142857144"/></g><g><circle data-type="point" data-label="R1.1
8
+ x-" data-x="-4.24" data-y="1.7" cx="245.23560209424073" cy="231.8386777486911" r="3" fill="hsl(226, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="R1.2
9
+ x+" data-x="-3.1399999999999997" data-y="1.7" cx="325.8638743455497" cy="231.8386777486911" r="3" fill="hsl(227, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="C1.1
10
+ x-" data-x="-6.74" data-y="0.3" cx="61.98952879581145" cy="334.4564787958115" r="3" fill="hsl(121, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="C1.2
11
+ x+" data-x="-5.640000000000001" data-y="0.3" cx="142.61780104712034" cy="334.4564787958115" r="3" fill="hsl(122, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U1.1
12
+ x-" data-x="-0.6000000000000001" data-y="0.30000000000000004" cx="512.0418848167538" cy="334.4564787958115" r="3" fill="hsl(319, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U1.2
13
+ x-" data-x="-0.6000000000000001" data-y="0.10000000000000003" cx="512.0418848167538" cy="349.11616465968586" r="3" fill="hsl(320, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U1.3
14
+ x-" data-x="-0.6000000000000001" data-y="-0.09999999999999998" cx="512.0418848167538" cy="363.77585052356017" r="3" fill="hsl(321, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U1.4
15
+ x-" data-x="-0.6000000000000001" data-y="-0.30000000000000004" cx="512.0418848167538" cy="378.4355363874345" r="3" fill="hsl(322, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U1.5
16
+ x+" data-x="0.6000000000000001" data-y="-0.30000000000000004" cx="599.9999999999999" cy="378.4355363874345" r="3" fill="hsl(323, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U1.6
17
+ x+" data-x="0.6000000000000001" data-y="-0.10000000000000003" cx="599.9999999999999" cy="363.77585052356017" r="3" fill="hsl(324, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U1.7
18
+ x+" data-x="0.6000000000000001" data-y="0.09999999999999998" cx="599.9999999999999" cy="349.11616465968586" r="3" fill="hsl(325, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U1.8
19
+ x+" data-x="0.6000000000000001" data-y="0.30000000000000004" cx="599.9999999999999" cy="334.4564787958115" r="3" fill="hsl(326, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U2.1
20
+ x-" data-x="-3.52" data-y="-0.09999999999999998" cx="298.01047120418843" cy="363.77585052356017" r="3" fill="hsl(200, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U2.2
21
+ x-" data-x="-3.52" data-y="-0.3" cx="298.01047120418843" cy="378.4355363874345" r="3" fill="hsl(201, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U2.3
22
+ x-" data-x="-3.52" data-y="-0.5" cx="298.01047120418843" cy="393.0952222513089" r="3" fill="hsl(202, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U2.4
23
+ x-" data-x="-3.52" data-y="-0.7000000000000001" cx="298.01047120418843" cy="407.75490811518324" r="3" fill="hsl(203, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U2.5
24
+ x+" data-x="-2.32" data-y="-0.7000000000000001" cx="385.96858638743447" cy="407.75490811518324" r="3" fill="hsl(204, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U2.6
25
+ x+" data-x="-2.32" data-y="-0.5" cx="385.96858638743447" cy="393.0952222513089" r="3" fill="hsl(205, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U2.7
26
+ x+" data-x="-2.32" data-y="-0.30000000000000004" cx="385.96858638743447" cy="378.4355363874345" r="3" fill="hsl(206, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U2.8
27
+ x+" data-x="-2.32" data-y="-0.09999999999999998" cx="385.96858638743447" cy="363.77585052356017" r="3" fill="hsl(207, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="anchorPoint
28
+ orientation: y-" data-x="-6.94" data-y="0.3" cx="47.329842931937094" cy="334.4564787958115" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
29
+ orientation: x-" data-x="-0.6000000000000001" data-y="0.10000000000000003" cx="512.0418848167538" cy="349.11616465968586" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
30
+ orientation: x+" data-x="-3.1399999999999997" data-y="1.7" cx="325.8638743455497" cy="231.8386777486911" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
31
+ orientation: x-" data-x="-3.72" data-y="-0.09999999999999998" cx="283.3507853403141" cy="363.77585052356017" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
32
+ orientation: x-" data-x="-3.52" data-y="-0.3" cx="298.01047120418843" cy="378.4355363874345" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
33
+ orientation: x-" data-x="-0.6000000000000001" data-y="-0.30000000000000004" cx="512.0418848167538" cy="378.4355363874345" 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[
34
+ document.currentScript.parentElement.addEventListener('mousemove', (e) => {
35
+ const svg = e.currentTarget;
36
+ const rect = svg.getBoundingClientRect();
37
+ const x = e.clientX - rect.left;
38
+ const y = e.clientY - rect.top;
39
+ const crosshair = svg.getElementById('crosshair');
40
+ const h = svg.getElementById('crosshair-h');
41
+ const v = svg.getElementById('crosshair-v');
42
+ const coords = svg.getElementById('coordinates');
43
+
44
+ crosshair.style.display = 'block';
45
+ h.setAttribute('x1', '0');
46
+ h.setAttribute('x2', '640');
47
+ h.setAttribute('y1', y);
48
+ h.setAttribute('y2', y);
49
+ v.setAttribute('x1', x);
50
+ v.setAttribute('x2', x);
51
+ v.setAttribute('y1', '0');
52
+ v.setAttribute('y2', '640');
182
53
 
183
- crosshair.style.display = 'block';
184
- h.setAttribute('x1', '0');
185
- h.setAttribute('x2', '640');
186
- h.setAttribute('y1', y);
187
- h.setAttribute('y2', y);
188
- v.setAttribute('x1', x);
189
- v.setAttribute('x2', x);
190
- v.setAttribute('y1', '0');
191
- v.setAttribute('y2', '640');
192
-
193
- // Calculate real coordinates using inverse transformation
194
- const matrix = {
195
- "a": 73.29842931937172,
196
- "c": 0,
197
- "e": 556.0209424083769,
198
- "b": 0,
199
- "d": -73.29842931937172,
200
- "f": 356.446007591623
201
- };
202
- // Manually invert and apply the affine transform
203
- // Since we only use translate and scale, we can directly compute:
204
- // x' = (x - tx) / sx
205
- // y' = (y - ty) / sy
206
- const sx = matrix.a;
207
- const sy = matrix.d;
208
- const tx = matrix.e;
209
- const ty = matrix.f;
210
- const realPoint = {
211
- x: (x - tx) / sx,
212
- y: (y - ty) / sy // Flip y back since we used negative scale
213
- }
214
-
215
- coords.textContent = `(${realPoint.x.toFixed(2)}, ${realPoint.y.toFixed(2)})`;
216
- coords.setAttribute('x', (x + 5).toString());
217
- coords.setAttribute('y', (y - 5).toString());
218
- });
219
- document.currentScript.parentElement.addEventListener('mouseleave', () => {
220
- document.currentScript.parentElement.getElementById('crosshair').style.display = 'none';
221
- });
222
- ]]>
223
- </script>
224
- </svg>
54
+ // Calculate real coordinates using inverse transformation
55
+ const matrix = {"a":73.29842931937172,"c":0,"e":556.0209424083769,"b":0,"d":-73.29842931937172,"f":356.446007591623};
56
+ // Manually invert and apply the affine transform
57
+ // Since we only use translate and scale, we can directly compute:
58
+ // x' = (x - tx) / sx
59
+ // y' = (y - ty) / sy
60
+ const sx = matrix.a;
61
+ const sy = matrix.d;
62
+ const tx = matrix.e;
63
+ const ty = matrix.f;
64
+ const realPoint = {
65
+ x: (x - tx) / sx,
66
+ y: (y - ty) / sy // Flip y back since we used negative scale
67
+ }
68
+
69
+ coords.textContent = `(${realPoint.x.toFixed(2)}, ${realPoint.y.toFixed(2)})`;
70
+ coords.setAttribute('x', (x + 5).toString());
71
+ coords.setAttribute('y', (y - 5).toString());
72
+ });
73
+ document.currentScript.parentElement.addEventListener('mouseleave', () => {
74
+ document.currentScript.parentElement.getElementById('crosshair').style.display = 'none';
75
+ });
76
+ ]]></script></svg>
@@ -1,77 +1,47 @@
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="TP1.1
5
- y+" data-x="-1.2246467991473533e-17" data-y="0.2" cx="440.48192771084337" cy="88.19277108433738" r="3" fill="hsl(128, 100%, 50%, 0.8)" />
6
- </g>
7
- <g>
8
- <circle data-type="point" data-label="" data-x="-0.25" data-y="0.14900000000000002" cx="199.5180722891566" cy="137.34939759036146" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
9
- </g>
10
- <g>
11
- <polyline data-points="-1.2246467991473533e-17,0.2 -1.2246467991473533e-17,0.25 -0.25,0.25 -0.25,0.14900000000000002" data-type="line" data-label="" points="440.48192771084337,88.19277108433738 440.48192771084337,40.00000000000003 199.5180722891566,40.00000000000003 199.5180722891566,137.34939759036146" fill="none" stroke="purple" stroke-width="1" />
12
- </g>
13
- <g>
14
- <rect data-type="rect" data-label="schematic_component_0" data-x="0" data-y="0" x="344.09638554216866" y="88.19277108433738" width="192.77108433734935" height="385.5421686746988" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.0010375" />
15
- </g>
16
- <g>
17
- <rect data-type="rect" data-label="netId: GND
18
- globalConnNetId: connectivity_net0" data-x="-0.25" data-y="-0.09099999999999997" x="103.13253012048193" y="137.34939759036146" width="192.77108433734935" height="462.6506024096385" fill="#00000066" stroke="#000000" stroke-width="0.0010375" />
19
- </g>
20
- <g id="crosshair" style="display: none">
21
- <line id="crosshair-h" y1="0" y2="640" stroke="#666" stroke-width="0.5" />
22
- <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>
23
- </g>
24
- <script>
25
- <![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');
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.2246467991473533e-17,0.2 -1.2246467991473533e-17,0.25 -0.25,0.25 -0.25,0.14900000000000002" data-type="line" data-label="" points="440.48192771084337,88.19277108433738 440.48192771084337,40.00000000000003 199.5180722891566,40.00000000000003 199.5180722891566,137.34939759036146" fill="none" stroke="purple" stroke-width="1px"/></g><g><rect data-type="rect" data-label="schematic_component_0" data-x="0" data-y="0" x="344.0963855421687" y="88.19277108433738" width="192.77108433734935" height="385.5421686746988" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.0010375"/></g><g><rect data-type="rect" data-label="netId: GND
2
+ globalConnNetId: connectivity_net0" data-x="-0.25" data-y="-0.09099999999999997" x="103.13253012048193" y="137.3493975903615" width="192.77108433734935" height="462.6506024096385" fill="#00000066" stroke="#000000" stroke-width="0.0010375"/></g><g><circle data-type="point" data-label="TP1.1
3
+ y+" data-x="-1.2246467991473533e-17" data-y="0.2" cx="440.48192771084337" cy="88.19277108433738" r="3" fill="hsl(128, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="anchorPoint
4
+ orientation: y-" data-x="-0.25" data-y="0.14900000000000002" cx="199.5180722891566" cy="137.34939759036146" 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[
5
+ document.currentScript.parentElement.addEventListener('mousemove', (e) => {
6
+ const svg = e.currentTarget;
7
+ const rect = svg.getBoundingClientRect();
8
+ const x = e.clientX - rect.left;
9
+ const y = e.clientY - rect.top;
10
+ const crosshair = svg.getElementById('crosshair');
11
+ const h = svg.getElementById('crosshair-h');
12
+ const v = svg.getElementById('crosshair-v');
13
+ const coords = svg.getElementById('coordinates');
14
+
15
+ crosshair.style.display = 'block';
16
+ h.setAttribute('x1', '0');
17
+ h.setAttribute('x2', '640');
18
+ h.setAttribute('y1', y);
19
+ h.setAttribute('y2', y);
20
+ v.setAttribute('x1', x);
21
+ v.setAttribute('x2', x);
22
+ v.setAttribute('y1', '0');
23
+ v.setAttribute('y2', '640');
35
24
 
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');
45
-
46
- // Calculate real coordinates using inverse transformation
47
- const matrix = {
48
- "a": 963.855421686747,
49
- "c": 0,
50
- "e": 440.48192771084337,
51
- "b": 0,
52
- "d": -963.855421686747,
53
- "f": 280.9638554216868
54
- };
55
- // Manually invert and apply the affine transform
56
- // Since we only use translate and scale, we can directly compute:
57
- // x' = (x - tx) / sx
58
- // y' = (y - ty) / sy
59
- const sx = matrix.a;
60
- const sy = matrix.d;
61
- const tx = matrix.e;
62
- const ty = matrix.f;
63
- const realPoint = {
64
- x: (x - tx) / sx,
65
- y: (y - ty) / sy // Flip y back since we used negative scale
66
- }
67
-
68
- coords.textContent = `(${realPoint.x.toFixed(2)}, ${realPoint.y.toFixed(2)})`;
69
- coords.setAttribute('x', (x + 5).toString());
70
- coords.setAttribute('y', (y - 5).toString());
71
- });
72
- document.currentScript.parentElement.addEventListener('mouseleave', () => {
73
- document.currentScript.parentElement.getElementById('crosshair').style.display = 'none';
74
- });
75
- ]]>
76
- </script>
77
- </svg>
25
+ // Calculate real coordinates using inverse transformation
26
+ const matrix = {"a":963.855421686747,"c":0,"e":440.48192771084337,"b":0,"d":-963.855421686747,"f":280.9638554216868};
27
+ // Manually invert and apply the affine transform
28
+ // Since we only use translate and scale, we can directly compute:
29
+ // x' = (x - tx) / sx
30
+ // y' = (y - ty) / sy
31
+ const sx = matrix.a;
32
+ const sy = matrix.d;
33
+ const tx = matrix.e;
34
+ const ty = matrix.f;
35
+ const realPoint = {
36
+ x: (x - tx) / sx,
37
+ y: (y - ty) / sy // Flip y back since we used negative scale
38
+ }
39
+
40
+ coords.textContent = `(${realPoint.x.toFixed(2)}, ${realPoint.y.toFixed(2)})`;
41
+ coords.setAttribute('x', (x + 5).toString());
42
+ coords.setAttribute('y', (y - 5).toString());
43
+ });
44
+ document.currentScript.parentElement.addEventListener('mouseleave', () => {
45
+ document.currentScript.parentElement.getElementById('crosshair').style.display = 'none';
46
+ });
47
+ ]]></script></svg>