@tscircuit/schematic-trace-solver 0.0.48 → 0.0.49

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 (162) hide show
  1. package/README.md +1 -1
  2. package/dist/index.d.ts +51 -1
  3. package/dist/index.js +730 -43
  4. package/lib/solvers/Example28Solver/Example28Solver.ts +182 -0
  5. package/lib/solvers/Example28Solver/geometry.ts +246 -0
  6. package/lib/solvers/Example28Solver/labelMovement.ts +82 -0
  7. package/lib/solvers/Example28Solver/reroute.ts +368 -0
  8. package/lib/solvers/Example28Solver/types.ts +47 -0
  9. package/lib/solvers/Example28Solver/visualize.ts +96 -0
  10. package/lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver.ts +16 -0
  11. package/package.json +1 -1
  12. package/site/SchematicTraceSingleLineSolver2/SchematicTraceSingleLineSolver2_01-example17-d1_1-u1_1.page.tsx +2 -0
  13. package/site/TraceCleanupSolver/TraceCleanupSolver.page.tsx +23 -0
  14. package/site/TraceLabelOverlapAvoidanceSolver/MergedNetLabelObstacles.page.tsx +18 -0
  15. package/site/TraceLabelOverlapAvoidanceSolver/OverlapAvoidanceStepSolver.page.tsx +24 -0
  16. package/site/TraceLabelOverlapAvoidanceSolver/SingleOverlapSolver.page.tsx +10 -0
  17. package/site/TraceLabelOverlapAvoidanceSolver/TraceLabelOverlapAvoidanceSolver.page.tsx +146 -0
  18. package/site/TraceLabelOverlapAvoidanceSolver/renderComparisonView01.page.tsx +32 -0
  19. package/site/TraceLabelOverlapAvoidanceSolver/renderComparisonView02.page.tsx +32 -0
  20. package/site/TraceLabelOverlapAvoidanceSolver/renderComparisonView03.page.tsx +35 -0
  21. package/site/examples/example01.page.tsx +6 -0
  22. package/site/examples/example02.page.tsx +4 -180
  23. package/site/examples/example03.page.tsx +3 -212
  24. package/site/examples/example04.page.tsx +6 -0
  25. package/site/examples/example05.page.tsx +3 -179
  26. package/site/examples/example06.page.tsx +3 -57
  27. package/site/examples/example07.page.tsx +3 -132
  28. package/site/examples/example08.page.tsx +3 -91
  29. package/site/examples/example09.page.tsx +3 -414
  30. package/site/examples/example10.page.tsx +3 -75
  31. package/site/examples/example11.page.tsx +3 -116
  32. package/site/examples/example12.page.tsx +3 -94
  33. package/site/examples/example13.page.tsx +3 -216
  34. package/site/examples/example14.page.tsx +3 -207
  35. package/site/examples/example15.page.tsx +6 -0
  36. package/site/examples/example16.page.tsx +6 -0
  37. package/site/examples/example17.page.tsx +6 -0
  38. package/site/examples/example18.page.tsx +3 -178
  39. package/site/examples/example19.page.tsx +3 -166
  40. package/site/examples/example20.page.tsx +3 -100
  41. package/site/examples/example21.page.tsx +3 -174
  42. package/site/examples/example22.page.tsx +3 -105
  43. package/site/examples/example23.page.tsx +3 -134
  44. package/site/examples/example24.page.tsx +3 -125
  45. package/site/examples/example25.page.tsx +2 -0
  46. package/site/examples/example26.page.tsx +2 -0
  47. package/site/examples/example27.page.tsx +2 -0
  48. package/site/examples/example28.page.tsx +3 -58
  49. package/site/examples/example29.page.tsx +6 -0
  50. package/site/examples/example30.page.tsx +6 -0
  51. package/site/examples/example31.page.tsx +4 -0
  52. package/tests/assets/example01.json +109 -0
  53. package/tests/assets/example02.json +178 -0
  54. package/tests/assets/example03.json +210 -0
  55. package/tests/assets/example04.json +41 -0
  56. package/tests/assets/example05.json +175 -0
  57. package/tests/assets/example06.json +55 -0
  58. package/tests/assets/example07.json +130 -0
  59. package/tests/assets/example08.json +89 -0
  60. package/tests/assets/example09.json +412 -0
  61. package/tests/assets/example10.json +73 -0
  62. package/tests/assets/example11.json +114 -0
  63. package/tests/assets/example12.json +92 -0
  64. package/tests/assets/example13.json +214 -0
  65. package/tests/assets/example14.json +205 -0
  66. package/tests/assets/example15.json +618 -0
  67. package/tests/assets/example16.json +102 -0
  68. package/tests/assets/example17.json +160 -0
  69. package/tests/assets/example18.json +176 -0
  70. package/tests/assets/example19.json +164 -0
  71. package/tests/assets/example20.json +98 -0
  72. package/tests/assets/example21.json +172 -0
  73. package/tests/assets/example22.json +103 -0
  74. package/tests/assets/example23.json +132 -0
  75. package/tests/assets/example24.json +123 -0
  76. package/tests/assets/example25.json +146 -33
  77. package/tests/assets/example26.json +51 -1134
  78. package/tests/assets/example27.json +151 -91
  79. package/tests/assets/example28.json +56 -0
  80. package/tests/assets/example29.json +1206 -0
  81. package/tests/assets/example30.json +168 -0
  82. package/tests/assets/example31.json +46 -0
  83. package/tests/examples/__snapshots__/example01.snap.svg +12 -6
  84. package/tests/examples/__snapshots__/example02.snap.svg +16 -8
  85. package/tests/examples/__snapshots__/example03.snap.svg +36 -18
  86. package/tests/examples/__snapshots__/example04.snap.svg +8 -4
  87. package/tests/examples/__snapshots__/example05.snap.svg +4 -2
  88. package/tests/examples/__snapshots__/example06.snap.svg +4 -2
  89. package/tests/examples/__snapshots__/example07.snap.svg +20 -10
  90. package/tests/examples/__snapshots__/example08.snap.svg +16 -8
  91. package/tests/examples/__snapshots__/example09.snap.svg +80 -40
  92. package/tests/examples/__snapshots__/example10.snap.svg +16 -8
  93. package/tests/examples/__snapshots__/example11.snap.svg +24 -12
  94. package/tests/examples/__snapshots__/example12.snap.svg +16 -8
  95. package/tests/examples/__snapshots__/example13.snap.svg +32 -16
  96. package/tests/examples/__snapshots__/example14.snap.svg +115 -48
  97. package/tests/examples/__snapshots__/example15.snap.svg +36 -18
  98. package/tests/examples/__snapshots__/example16.snap.svg +16 -8
  99. package/tests/examples/__snapshots__/example17.snap.svg +16 -8
  100. package/tests/examples/__snapshots__/example18.snap.svg +20 -10
  101. package/tests/examples/__snapshots__/example19.snap.svg +16 -8
  102. package/tests/examples/__snapshots__/example20.snap.svg +43 -135
  103. package/tests/examples/__snapshots__/example21.snap.svg +34 -18
  104. package/tests/examples/__snapshots__/example22.snap.svg +37 -23
  105. package/tests/examples/__snapshots__/example23.snap.svg +62 -26
  106. package/tests/examples/__snapshots__/example24.snap.svg +50 -28
  107. package/tests/examples/__snapshots__/example25.snap.svg +175 -49
  108. package/tests/examples/__snapshots__/example26.snap.svg +16 -8
  109. package/tests/examples/__snapshots__/example27.snap.svg +24 -12
  110. package/tests/examples/__snapshots__/example28.snap.svg +24 -18
  111. package/tests/examples/__snapshots__/example29.snap.svg +184 -92
  112. package/tests/examples/__snapshots__/example30.snap.svg +48 -24
  113. package/tests/examples/__snapshots__/example31.snap.svg +88 -0
  114. package/tests/examples/example01.test.ts +2 -2
  115. package/tests/examples/example02.test.ts +2 -2
  116. package/tests/examples/example03.test.ts +2 -2
  117. package/tests/examples/example04.test.ts +2 -2
  118. package/tests/examples/example05.test.ts +2 -2
  119. package/tests/examples/example06.test.ts +2 -2
  120. package/tests/examples/example07.test.ts +2 -2
  121. package/tests/examples/example08.test.ts +2 -2
  122. package/tests/examples/example09.test.ts +2 -2
  123. package/tests/examples/example10.test.ts +2 -2
  124. package/tests/examples/{example11.test.tsx → example11.test.ts} +2 -2
  125. package/tests/examples/{example12.test.tsx → example12.test.ts} +2 -2
  126. package/tests/examples/{example13.test.tsx → example13.test.ts} +2 -2
  127. package/tests/examples/example14.test.ts +12 -0
  128. package/tests/examples/example15.test.ts +12 -0
  129. package/tests/examples/example16.test.ts +12 -0
  130. package/tests/examples/example17.test.ts +12 -0
  131. package/tests/examples/example18.test.ts +12 -0
  132. package/tests/examples/example19.test.ts +12 -0
  133. package/tests/examples/example20.test.ts +12 -0
  134. package/tests/examples/example21.test.ts +12 -0
  135. package/tests/examples/example22.test.ts +12 -0
  136. package/tests/examples/example23.test.ts +12 -0
  137. package/tests/examples/example24.test.ts +12 -0
  138. package/tests/examples/example25.test.ts +12 -0
  139. package/tests/examples/example26.test.ts +12 -0
  140. package/tests/examples/example27.test.ts +3 -232
  141. package/tests/examples/example28.test.ts +2 -2
  142. package/tests/examples/example29.test.ts +1 -2
  143. package/tests/examples/example30.test.ts +2 -2
  144. package/tests/examples/example31.test.ts +12 -0
  145. package/site/examples/example01-basic.page.tsx +0 -105
  146. package/site/examples/example04-single-symbol.page.tsx +0 -46
  147. package/site/examples/example15-rp2040-caps.page.tsx +0 -623
  148. package/site/examples/example16-core-repro51.page.tsx +0 -107
  149. package/site/examples/example17-straight-line-trace.page.tsx +0 -165
  150. package/tests/examples/example14.test.tsx +0 -11
  151. package/tests/examples/example15.test.tsx +0 -629
  152. package/tests/examples/example16.test.tsx +0 -113
  153. package/tests/examples/example17.test.tsx +0 -171
  154. package/tests/examples/example18.test.tsx +0 -187
  155. package/tests/examples/example19.test.tsx +0 -175
  156. package/tests/examples/example20.test.tsx +0 -190
  157. package/tests/examples/example21.test.tsx +0 -183
  158. package/tests/examples/example22.test.tsx +0 -109
  159. package/tests/examples/example23.test.tsx +0 -109
  160. package/tests/examples/example24.test.tsx +0 -114
  161. package/tests/examples/example25.test.tsx +0 -143
  162. package/tests/examples/example26.test.tsx +0 -134
@@ -0,0 +1,146 @@
1
+ import { useMemo } from "react"
2
+ import { GenericSolverDebugger } from "site/components/GenericSolverDebugger"
3
+ import { TraceLabelOverlapAvoidanceSolver } from "lib/solvers/TraceLabelOverlapAvoidanceSolver/TraceLabelOverlapAvoidanceSolver"
4
+ import type { InputProblem } from "lib/types/InputProblem"
5
+ import testInput from "../../tests/assets/TraceLabelOverlapAvoidanceSolver.test.input.json"
6
+
7
+ const inputProblem: InputProblem = {
8
+ chips: [
9
+ {
10
+ chipId: "schematic_component_0",
11
+ center: { x: -5, y: 2 },
12
+ width: 0.6394553499999995,
13
+ height: 1.08,
14
+ pins: [
15
+ { pinId: "V1.1", x: -5.005, y: 2.54 },
16
+ { pinId: "V1.2", x: -4.995, y: 1.46 },
17
+ ],
18
+ },
19
+ {
20
+ chipId: "schematic_component_1",
21
+ center: { x: 0, y: 3 },
22
+ width: 1.16,
23
+ height: 0.46,
24
+ pins: [
25
+ { pinId: "L1.1", x: -0.55, y: 2.98 },
26
+ { pinId: "L1.2", x: 0.55, y: 2.97 },
27
+ ],
28
+ },
29
+ {
30
+ chipId: "schematic_component_2",
31
+ center: { x: 3, y: 3 },
32
+ width: 1.04,
33
+ height: 0.54,
34
+ pins: [
35
+ { pinId: "D1.1", x: 2.48, y: 3 },
36
+ { pinId: "D1.2", x: 3.52, y: 3 },
37
+ ],
38
+ },
39
+ {
40
+ chipId: "schematic_component_3",
41
+ center: { x: 3, y: 0 },
42
+ width: 0.5700000000000001,
43
+ height: 0.99,
44
+ pins: [
45
+ { pinId: "C1.2", x: 3, y: -0.49500000000000005 },
46
+ { pinId: "C1.1", x: 3, y: 0.495 },
47
+ ],
48
+ },
49
+ {
50
+ chipId: "schematic_component_4",
51
+ center: { x: 6, y: 0 },
52
+ width: 0.3194553499999995,
53
+ height: 1.1,
54
+ pins: [
55
+ { pinId: "R1.1", x: 6, y: 0.5499999999999999 },
56
+ { pinId: "R1.2", x: 6, y: -0.55 },
57
+ ],
58
+ },
59
+ {
60
+ chipId: "schematic_component_5",
61
+ center: { x: -3, y: 0 },
62
+ width: 0.39624869999999945,
63
+ height: 0.8916016,
64
+ pins: [
65
+ { pinId: "V2.1", x: -2.9999378, y: 0.4458008 },
66
+ { pinId: "V2.2", x: -3.0000622, y: -0.4458008 },
67
+ ],
68
+ },
69
+ {
70
+ chipId: "schematic_component_6",
71
+ center: { x: 0, y: 0 },
72
+ width: 0.89,
73
+ height: 1.16,
74
+ pins: [
75
+ { pinId: "M1.1", x: 0.3, y: 0.55 },
76
+ { pinId: "M1.2", x: 0.31, y: -0.55 },
77
+ { pinId: "M1.3", x: -0.42, y: -0.1 },
78
+ ],
79
+ },
80
+ ],
81
+ directConnections: [
82
+ {
83
+ pinIds: ["V1.1", "L1.1"],
84
+ netId: ".V1 > .pin1 to .L1 > .pin1",
85
+ },
86
+ {
87
+ pinIds: ["L1.2", "D1.1"],
88
+ netId: ".L1 > .pin2 to .D1 > .anode",
89
+ },
90
+ {
91
+ pinIds: ["D1.2", "C1.1"],
92
+ netId: ".D1 > .cathode to .C1 > .pin1",
93
+ },
94
+ {
95
+ pinIds: ["D1.2", "R1.1"],
96
+ netId: ".D1 > .cathode to .R1 > .pin1",
97
+ },
98
+ {
99
+ pinIds: ["C1.2", "R1.2"],
100
+ netId: ".C1 > .pin2 to .R1 > .pin2",
101
+ },
102
+ {
103
+ pinIds: ["R1.2", "V1.2"],
104
+ netId: ".R1 > .pin2 to .V1 > .pin2",
105
+ },
106
+ {
107
+ pinIds: ["L1.2", "M1.1"],
108
+ netId: ".L1 > .pin2 to .M1 > .drain",
109
+ },
110
+ {
111
+ pinIds: ["M1.2", "V1.2"],
112
+ netId: ".M1 > .source to .V1 > .pin2",
113
+ },
114
+ {
115
+ pinIds: ["M1.3", "V2.1"],
116
+ netId: ".M1 > .gate to .V2 > .pin1",
117
+ },
118
+ {
119
+ pinIds: ["V2.2", "V1.2"],
120
+ netId: ".V2 > .pin2 to .V1 > .pin2",
121
+ },
122
+ ],
123
+ netConnections: [
124
+ {
125
+ netId: "GND",
126
+ pinIds: ["V1.2", "C1.2", "R1.2", "V2.2", "M1.2"],
127
+ netLabelWidth: 0.3,
128
+ },
129
+ ],
130
+ availableNetLabelOrientations: { GND: ["y-"] },
131
+ maxMspPairDistance: 2.4,
132
+ }
133
+
134
+ export default () => {
135
+ const solver = useMemo(
136
+ () =>
137
+ new TraceLabelOverlapAvoidanceSolver({
138
+ inputProblem: inputProblem as any,
139
+ netLabelPlacements: testInput.netLabelPlacements as any,
140
+ traces: testInput.traces as any,
141
+ }),
142
+ [],
143
+ )
144
+
145
+ return <GenericSolverDebugger solver={solver} />
146
+ }
@@ -0,0 +1,32 @@
1
+ import { useMemo } from "react"
2
+ import { InteractiveGraphics } from "graphics-debug/react"
3
+ import { stackGraphicsHorizontally } from "graphics-debug"
4
+ import { NetLabelPlacementSolver } from "lib/solvers/NetLabelPlacementSolver/NetLabelPlacementSolver"
5
+ import { MergedNetLabelObstacleSolver } from "lib/solvers/TraceLabelOverlapAvoidanceSolver/sub-solvers/LabelMergingSolver/LabelMergingSolver"
6
+ import inputData from "../../tests/assets/1.input.json"
7
+
8
+ export default () => {
9
+ const graphics = useMemo(() => {
10
+ const mergedNetLabelObstacleSolver = new MergedNetLabelObstacleSolver(
11
+ inputData.mergedNetLabelObstacleSolver as any,
12
+ )
13
+ const netLabelPlacementSolver = new NetLabelPlacementSolver(
14
+ inputData.netLabelPlacementSolver as any,
15
+ )
16
+
17
+ mergedNetLabelObstacleSolver.solve()
18
+ netLabelPlacementSolver.solve()
19
+
20
+ return stackGraphicsHorizontally(
21
+ [
22
+ netLabelPlacementSolver.visualize(),
23
+ mergedNetLabelObstacleSolver.visualize(),
24
+ ],
25
+ {
26
+ titles: ["NetLabelPlacementSolver", "MergedNetLabelObstacles"],
27
+ },
28
+ )
29
+ }, [])
30
+
31
+ return <InteractiveGraphics graphics={graphics} />
32
+ }
@@ -0,0 +1,32 @@
1
+ import { useMemo } from "react"
2
+ import { InteractiveGraphics } from "graphics-debug/react"
3
+ import { stackGraphicsHorizontally } from "graphics-debug"
4
+ import { MergedNetLabelObstacleSolver } from "lib/solvers/TraceLabelOverlapAvoidanceSolver/sub-solvers/LabelMergingSolver/LabelMergingSolver"
5
+ import { SingleOverlapSolver } from "lib/solvers/TraceLabelOverlapAvoidanceSolver/sub-solvers/SingleOverlapSolver/SingleOverlapSolver"
6
+ import inputData from "../../tests/assets/2.input.json"
7
+
8
+ export default () => {
9
+ const graphics = useMemo(() => {
10
+ const mergedNetLabelObstacleSolver = new MergedNetLabelObstacleSolver(
11
+ inputData.mergedNetLabelObstacleSolver as any,
12
+ )
13
+ const singleOverlapSolver = new SingleOverlapSolver(
14
+ inputData.singleOverlapSolver as any,
15
+ )
16
+
17
+ mergedNetLabelObstacleSolver.solve()
18
+ singleOverlapSolver.solve()
19
+
20
+ return stackGraphicsHorizontally(
21
+ [
22
+ mergedNetLabelObstacleSolver.visualize(),
23
+ singleOverlapSolver.visualize(),
24
+ ],
25
+ {
26
+ titles: ["MergedNetLabelObstaclesSolver", "SingleOverlapSolver"],
27
+ },
28
+ )
29
+ }, [])
30
+
31
+ return <InteractiveGraphics graphics={graphics} />
32
+ }
@@ -0,0 +1,35 @@
1
+ import { useMemo } from "react"
2
+ import { InteractiveGraphics } from "graphics-debug/react"
3
+ import { stackGraphicsHorizontally } from "graphics-debug"
4
+ import { TraceCleanupSolver } from "lib/solvers/TraceCleanupSolver/TraceCleanupSolver"
5
+ import { SingleOverlapSolver } from "lib/solvers/TraceLabelOverlapAvoidanceSolver/sub-solvers/SingleOverlapSolver/SingleOverlapSolver"
6
+ import inputData from "../../tests/assets/3.input.json"
7
+
8
+ export default () => {
9
+ const graphics = useMemo(() => {
10
+ const traceCleanupSolver = new TraceCleanupSolver({
11
+ ...inputData.traceCleanupSolver,
12
+ targetTraceIds: new Set(inputData.traceCleanupSolver.targetTraceIds),
13
+ mergedLabelNetIdMap: Object.fromEntries(
14
+ Object.entries(inputData.traceCleanupSolver.mergedLabelNetIdMap).map(
15
+ ([key, value]) => [key, new Set(value as any)],
16
+ ),
17
+ ),
18
+ } as any)
19
+ const singleOverlapSolver = new SingleOverlapSolver(
20
+ inputData.singleOverlapSolver as any,
21
+ )
22
+
23
+ traceCleanupSolver.solve()
24
+ singleOverlapSolver.solve()
25
+
26
+ return stackGraphicsHorizontally(
27
+ [singleOverlapSolver.visualize(), traceCleanupSolver.visualize()],
28
+ {
29
+ titles: ["SingleOverlapSolver", "TraceCleanupSolver"],
30
+ },
31
+ )
32
+ }, [])
33
+
34
+ return <InteractiveGraphics graphics={graphics} />
35
+ }
@@ -0,0 +1,6 @@
1
+ import { PipelineDebugger } from "site/components/PipelineDebugger"
2
+ import inputProblem from "../../tests/assets/example01.json"
3
+
4
+ export { inputProblem }
5
+
6
+ export default () => <PipelineDebugger inputProblem={inputProblem as any} />
@@ -1,182 +1,6 @@
1
1
  import { PipelineDebugger } from "site/components/PipelineDebugger"
2
- import type { InputProblem } from "lib/types/InputProblem"
3
- export const inputProblem: InputProblem = {
4
- chips: [
5
- {
6
- chipId: "schematic_component_0",
7
- center: {
8
- x: -1.9145832999999999,
9
- y: 0.5512093000000002,
10
- },
11
- width: 0.5291665999999999,
12
- height: 1.0583333000000001,
13
- pins: [
14
- {
15
- pinId: "C6.1",
16
- x: -1.9148566499999995,
17
- y: 1.1024186000000005,
18
- },
19
- {
20
- pinId: "C6.2",
21
- x: -1.9143099500000003,
22
- y: 0,
23
- },
24
- ],
25
- },
26
- {
27
- chipId: "schematic_component_1",
28
- center: {
29
- x: -4.1729164999999995,
30
- y: 0.5512093,
31
- },
32
- width: 0.5291665999999999,
33
- height: 1.0583333000000001,
34
- pins: [
35
- {
36
- pinId: "C1.1",
37
- x: -4.173189849999999,
38
- y: 1.1024186000000002,
39
- },
40
- {
41
- pinId: "C1.2",
42
- x: -4.17264315,
43
- y: -2.220446049250313e-16,
44
- },
45
- ],
46
- },
47
- {
48
- chipId: "schematic_component_2",
49
- center: {
50
- x: -3.0437499,
51
- y: 0.5512093,
52
- },
53
- width: 0.5291665999999999,
54
- height: 1.0583333000000001,
55
- pins: [
56
- {
57
- pinId: "C2.1",
58
- x: -3.0440232499999995,
59
- y: 1.1024186000000002,
60
- },
61
- {
62
- pinId: "C2.2",
63
- x: -3.0434765500000003,
64
- y: -2.220446049250313e-16,
65
- },
66
- ],
67
- },
68
- {
69
- chipId: "schematic_component_3",
70
- center: {
71
- x: 1.9145832999999999,
72
- y: -0.4512093000000006,
73
- },
74
- width: 0.5291665999999999,
75
- height: 1.0583333000000001,
76
- pins: [
77
- {
78
- pinId: "C5.1",
79
- x: 1.9143099500000003,
80
- y: 0.09999999999999964,
81
- },
82
- {
83
- pinId: "C5.2",
84
- x: 1.9148566499999995,
85
- y: -1.0024186000000008,
86
- },
87
- ],
88
- },
89
- {
90
- chipId: "schematic_component_4",
91
- center: {
92
- x: 0,
93
- y: 0,
94
- },
95
- width: 1.2000000000000002,
96
- height: 0.8,
97
- pins: [
98
- {
99
- pinId: "U1.1",
100
- x: -1,
101
- y: 0.2,
102
- },
103
- {
104
- pinId: "U1.2",
105
- x: -1,
106
- y: 0,
107
- },
108
- {
109
- pinId: "U1.3",
110
- x: -1,
111
- y: -0.2,
112
- },
113
- {
114
- pinId: "U1.4",
115
- x: 1,
116
- y: -0.1,
117
- },
118
- {
119
- pinId: "U1.5",
120
- x: 1,
121
- y: 0.1,
122
- },
123
- ],
124
- },
125
- ],
126
- directConnections: [
127
- {
128
- pinIds: ["U1.1", "C6.1"],
129
- netId: "group.voltage_regulator > chip.U1 > port.VIN to C6.1",
130
- },
131
- {
132
- pinIds: ["U1.1", "C1.1"],
133
- netId: "group.voltage_regulator > chip.U1 > port.VIN to C1.1",
134
- },
135
- {
136
- pinIds: ["U1.1", "C2.1"],
137
- netId: "group.voltage_regulator > chip.U1 > port.VIN to C2.1",
138
- },
139
- {
140
- pinIds: ["U1.2", "C6.2"],
141
- netId: "group.voltage_regulator > chip.U1 > port.GND to C6.2",
142
- },
143
- {
144
- pinIds: ["U1.2", "C1.2"],
145
- netId: "group.voltage_regulator > chip.U1 > port.GND to C1.2",
146
- },
147
- {
148
- pinIds: ["U1.2", "C2.2"],
149
- netId: "group.voltage_regulator > chip.U1 > port.GND to C2.2",
150
- },
151
- {
152
- pinIds: ["U1.3", "U1.1"],
153
- netId: "group.voltage_regulator > chip.U1 > port.EN to U1.1",
154
- },
155
- {
156
- pinIds: ["U1.5", "C5.1"],
157
- netId: "group.voltage_regulator > chip.U1 > port.VOUT to C5.1",
158
- },
159
- ],
160
- netConnections: [
161
- {
162
- netId: "VSYS",
163
- pinIds: ["C6.1", "C1.1", "C2.1", "U1.1", "U1.3"],
164
- },
165
- {
166
- netId: "GND",
167
- pinIds: ["C6.2", "C1.2", "C2.2", "C5.2", "U1.2"],
168
- },
169
- {
170
- netId: "V3_3",
171
- pinIds: ["C5.1", "U1.5"],
172
- },
173
- ],
174
- maxMspPairDistance: 2,
175
- availableNetLabelOrientations: {
176
- VSYS: ["y+"],
177
- GND: ["y-"],
178
- V3_3: ["y+"],
179
- },
180
- }
2
+ import inputProblem from "../../tests/assets/example02.json"
181
3
 
182
- export default () => <PipelineDebugger inputProblem={inputProblem} />
4
+ export { inputProblem }
5
+
6
+ export default () => <PipelineDebugger inputProblem={inputProblem as any} />
@@ -1,215 +1,6 @@
1
- import type { InputProblem } from "lib/index"
2
1
  import { PipelineDebugger } from "site/components/PipelineDebugger"
2
+ import inputProblem from "../../tests/assets/example03.json"
3
3
 
4
- export const inputProblem: InputProblem = {
5
- chips: [
6
- {
7
- chipId: "schematic_component_0",
8
- center: {
9
- x: -3,
10
- y: 1.5,
11
- },
12
- width: 1.0011537820000012,
13
- height: 0.44923699999999833,
14
- pins: [
15
- {
16
- pinId: "PIN1_PIN2.1",
17
- x: -3.4724184500000006,
18
- y: 1.4489565000000004,
19
- },
20
- {
21
- pinId: "PIN1_PIN2.2",
22
- x: -3.4724184500000006,
23
- y: 1.4489565000000004,
24
- },
25
- {
26
- pinId: "PIN1_PIN2.3",
27
- x: -2.5275815499999994,
28
- y: 1.4485175000000003,
29
- },
30
- {
31
- pinId: "PIN1_PIN2.4",
32
- x: -2.5275815499999994,
33
- y: 1.4485175000000003,
34
- },
35
- ],
36
- },
37
- {
38
- chipId: "schematic_component_1",
39
- center: {
40
- x: 0,
41
- y: 1.5,
42
- },
43
- width: 1.0011537820000012,
44
- height: 0.44923699999999833,
45
- pins: [
46
- {
47
- pinId: "PIN1_PIN3.1",
48
- x: -0.4724184500000006,
49
- y: 1.4489565000000004,
50
- },
51
- {
52
- pinId: "PIN1_PIN3.2",
53
- x: -0.4724184500000006,
54
- y: 1.4489565000000004,
55
- },
56
- {
57
- pinId: "PIN1_PIN3.3",
58
- x: 0.4724184500000006,
59
- y: 1.4485175000000003,
60
- },
61
- {
62
- pinId: "PIN1_PIN3.4",
63
- x: 0.4724184500000006,
64
- y: 1.4485175000000003,
65
- },
66
- ],
67
- },
68
- {
69
- chipId: "schematic_component_2",
70
- center: {
71
- x: 3,
72
- y: 1.5,
73
- },
74
- width: 1.0011537820000012,
75
- height: 0.44923699999999833,
76
- pins: [
77
- {
78
- pinId: "PIN1_PIN4.1",
79
- x: 2.5275815499999994,
80
- y: 1.4489565000000004,
81
- },
82
- {
83
- pinId: "PIN1_PIN4.2",
84
- x: 2.5275815499999994,
85
- y: 1.4489565000000004,
86
- },
87
- {
88
- pinId: "PIN1_PIN4.3",
89
- x: 3.4724184500000006,
90
- y: 1.4485175000000003,
91
- },
92
- {
93
- pinId: "PIN1_PIN4.4",
94
- x: 3.4724184500000006,
95
- y: 1.4485175000000003,
96
- },
97
- ],
98
- },
99
- {
100
- chipId: "schematic_component_3",
101
- center: {
102
- x: -3,
103
- y: -1.5,
104
- },
105
- width: 1.0011537820000012,
106
- height: 0.44923699999999833,
107
- pins: [
108
- {
109
- pinId: "PIN2_PIN3.1",
110
- x: -3.4724184500000006,
111
- y: -1.5510434999999996,
112
- },
113
- {
114
- pinId: "PIN2_PIN3.2",
115
- x: -3.4724184500000006,
116
- y: -1.5510434999999996,
117
- },
118
- {
119
- pinId: "PIN2_PIN3.3",
120
- x: -2.5275815499999994,
121
- y: -1.5514824999999997,
122
- },
123
- {
124
- pinId: "PIN2_PIN3.4",
125
- x: -2.5275815499999994,
126
- y: -1.5514824999999997,
127
- },
128
- ],
129
- },
130
- {
131
- chipId: "schematic_component_4",
132
- center: {
133
- x: 0,
134
- y: -1.5,
135
- },
136
- width: 1.0011537820000012,
137
- height: 0.44923699999999833,
138
- pins: [
139
- {
140
- pinId: "PIN2_PIN4.1",
141
- x: -0.4724184500000006,
142
- y: -1.5510434999999996,
143
- },
144
- {
145
- pinId: "PIN2_PIN4.2",
146
- x: -0.4724184500000006,
147
- y: -1.5510434999999996,
148
- },
149
- {
150
- pinId: "PIN2_PIN4.3",
151
- x: 0.4724184500000006,
152
- y: -1.5514824999999997,
153
- },
154
- {
155
- pinId: "PIN2_PIN4.4",
156
- x: 0.4724184500000006,
157
- y: -1.5514824999999997,
158
- },
159
- ],
160
- },
161
- {
162
- chipId: "schematic_component_5",
163
- center: {
164
- x: 3,
165
- y: -1.5,
166
- },
167
- width: 1.0011537820000012,
168
- height: 0.44923699999999833,
169
- pins: [
170
- {
171
- pinId: "PIN3_PIN4.1",
172
- x: 2.5275815499999994,
173
- y: -1.5510434999999996,
174
- },
175
- {
176
- pinId: "PIN3_PIN4.2",
177
- x: 2.5275815499999994,
178
- y: -1.5510434999999996,
179
- },
180
- {
181
- pinId: "PIN3_PIN4.3",
182
- x: 3.4724184500000006,
183
- y: -1.5514824999999997,
184
- },
185
- {
186
- pinId: "PIN3_PIN4.4",
187
- x: 3.4724184500000006,
188
- y: -1.5514824999999997,
189
- },
190
- ],
191
- },
192
- ],
193
- directConnections: [],
194
- netConnections: [
195
- {
196
- netId: "PIN1",
197
- pinIds: ["PIN1_PIN2.1", "PIN1_PIN3.1", "PIN1_PIN4.1"],
198
- },
199
- {
200
- netId: "PIN2",
201
- pinIds: ["PIN1_PIN2.2", "PIN2_PIN3.2", "PIN2_PIN4.2"],
202
- },
203
- {
204
- netId: "PIN3",
205
- pinIds: ["PIN1_PIN3.3", "PIN2_PIN3.3", "PIN3_PIN4.3"],
206
- },
207
- {
208
- netId: "PIN4",
209
- pinIds: ["PIN1_PIN4.4", "PIN2_PIN4.4", "PIN3_PIN4.4"],
210
- },
211
- ],
212
- availableNetLabelOrientations: {},
213
- }
4
+ export { inputProblem }
214
5
 
215
- export default () => <PipelineDebugger inputProblem={inputProblem} />
6
+ export default () => <PipelineDebugger inputProblem={inputProblem as any} />
@@ -0,0 +1,6 @@
1
+ import { PipelineDebugger } from "site/components/PipelineDebugger"
2
+ import inputProblem from "../../tests/assets/example04.json"
3
+
4
+ export { inputProblem }
5
+
6
+ export default () => <PipelineDebugger inputProblem={inputProblem as any} />