@tscircuit/schematic-viewer 1.3.0 → 1.4.1

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 (54) hide show
  1. package/README.md +1 -1
  2. package/biome.json +45 -0
  3. package/dist/index.d.ts +3 -4
  4. package/dist/index.js +734 -688
  5. package/dist/index.js.map +1 -1
  6. package/package.json +8 -7
  7. package/src/Schematic.tsx +141 -65
  8. package/src/lib/render-context/index.ts +1 -1
  9. package/src/lib/types/core.ts +14 -49
  10. package/src/lib/types/source-component.ts +6 -1
  11. package/src/lib/utils/collect-element-refs.ts +5 -4
  12. package/src/lib/utils/colors.ts +235 -0
  13. package/src/lib/utils/direction-to-vec.ts +3 -3
  14. package/src/schematic-components/SVGPathComponent.tsx +71 -112
  15. package/src/schematic-components/SchematicChip.tsx +222 -0
  16. package/src/schematic-components/SchematicComponent.tsx +25 -22
  17. package/src/schematic-components/SchematicComponentFromSymbol.tsx +46 -0
  18. package/src/schematic-components/SchematicElement.tsx +0 -28
  19. package/src/schematic-components/SchematicNetLabel.tsx +3 -0
  20. package/src/schematic-components/SchematicText.tsx +4 -6
  21. package/src/schematic-components/SchematicTrace.tsx +4 -3
  22. package/src/schematic-components/TableViewer.tsx +1 -1
  23. package/src/schematic-components/index.tsx +6 -14
  24. package/src/stories/basics/schematic-net-label.stories.tsx +2 -0
  25. package/src/stories/basics/schematic-net-labels-2.stories.tsx +22 -20
  26. package/src/stories/bug-connections.stories.tsx +18 -13
  27. package/src/stories/bug-high-port-numbers.stories.tsx +107 -85
  28. package/src/stories/bug-one-sided.stories.tsx +17 -15
  29. package/src/stories/bug-pin-spacing.stories.tsx +19 -17
  30. package/src/stories/bugs/bug1-y-flip.stories.tsx +7 -5
  31. package/src/stories/bugs/bug3-scaling-trace.stories.tsx +11 -5
  32. package/src/stories/bugs/bug4-schematic-line.stories.tsx +0 -1
  33. package/src/stories/bugs/bug5-diode.stories.tsx +3 -2
  34. package/src/stories/bugs/bug6-trace-scaling.stories.tsx +5 -41
  35. package/src/stories/bugs/bug8-autolayout.stories.tsx +20 -29
  36. package/src/stories/circuit-components/diode.stories.tsx +3 -1
  37. package/src/stories/circuit-components/resistor.stories.tsx +3 -1
  38. package/src/stories/led-circuit-react.stories.tsx +35 -48
  39. package/src/stories/rotated-resistor.stories.tsx +10 -8
  40. package/src/stories/three-sided-bug.stories.tsx +17 -15
  41. package/src/pages/led-circuit.tsx +0 -96
  42. package/src/schematic-components/ProjectComponent.tsx +0 -70
  43. package/src/schematic-components/SchematicBox.tsx +0 -29
  44. package/src/schematic-components/SchematicBug.tsx +0 -107
  45. package/src/schematic-components/SchematicLine.tsx +0 -48
  46. package/src/schematic-components/SchematicPath.tsx +0 -51
  47. package/src/schematic-components/SchematicPort.tsx +0 -63
  48. package/src/schematic-components/SimpleCapacitor.tsx +0 -29
  49. package/src/schematic-components/SimpleDiode.tsx +0 -42
  50. package/src/schematic-components/SimpleGround.tsx +0 -30
  51. package/src/schematic-components/SimpleInductor.tsx +0 -29
  52. package/src/schematic-components/SimplePowerSource.tsx +0 -43
  53. package/src/schematic-components/SimpleResistor.tsx +0 -28
  54. package/src/stories/led-circuit-builder.stories.tsx +0 -104
@@ -1,82 +1,107 @@
1
+ import { Circuit } from "@tscircuit/core"
1
2
  import { Schematic } from "Schematic"
2
3
 
3
- const FTDIBasic3v3 = () => (
4
- <group>
5
- <bug
6
- name="U1"
7
- manufacturerPartNumber="part-number"
8
- schPortArrangement={{
9
- leftSide: {
10
- pins: [16, 15, 20, 17, 4, 27, 28, 19, 26, 25, 7, 18, 21],
11
- direction: "top-to-bottom",
12
- },
13
- rightSide: {
14
- pins: [1, 5, 11, 3, 2, 9, 10, 6, 23, 22, 14, 13, 12],
15
- direction: "top-to-bottom",
16
- },
17
- }}
18
- footprint="ssop28Db"
19
- pinLabels={{
20
- "1": "TXD",
21
- "5": "RXD",
22
- "11": "CTS",
23
- "3": "RTS",
24
- "2": "DTR",
25
- "9": "DSR",
26
- "10": "DCD",
27
- "6": "RI",
28
- "23": "TXLED",
29
- "22": "RXLED",
30
- "14": "PWRUN",
31
- "13": "TXDEN",
32
- "12": "SLEEP",
33
- "16": "USBDM",
34
- "15": "USBDP",
35
- "20": "VCC",
36
- "17": "3V3OUT",
37
- "4": "VCCIO",
38
- "27": "OSCI",
39
- "28": "OSCO",
40
- "19": "RESET",
41
- "26": "TEST",
42
- "25": "AGND",
43
- "7": "GND7",
44
- "18": "GND18",
45
- "21": "GND21",
46
- }}
47
- />
48
- <resistor
49
- resistance="1kohm"
50
- name="R1"
51
- footprint="0805"
52
- schX={3}
53
- schY={0}
54
- schRotation="90deg"
55
- />
56
- <resistor
57
- resistance="1kohm"
58
- name="R2"
59
- footprint="0805"
60
- schX={4.5}
61
- schY={0}
62
- schRotation="90deg"
63
- />
64
- <diode name="LED1" footprint="0805" schRotation={"90deg"} schX={3} schY={2} />
65
- <diode name="LED2" footprint="0805" schRotation={"90deg"} schX={4.5} schY={2} />
66
- <netalias net="5V" schX={3} schY={-2} />
67
- <netalias net="5V" schX={4.5} schY={-2} />
68
- <trace path={[".5V", ".R2 > port.left"]} />
69
- <trace path={[".5V", ".R1 > port.left"]} />
70
- <trace path={[".R1 > port.right", ".LED1 > port.left"]} />
71
- <trace path={[".R2 > port.right", ".LED2 > port.left"]} />
72
- <trace path={[".LED1 > port.right", ".U1 > .TXLED"]} />
73
- <trace path={[".LED2 > port.right", ".U1 > .RXLED"]} />
74
- <netalias net="GND" schX={-3} schY={4} schRotation="180deg" />
75
- <netalias net="GND" schX={-5} schY={3} schRotation="180deg" />
76
- <netalias net="GND" schX={-6} schY={3} schRotation="180deg" />
77
- <netalias net="GND" schX={-7} schY={3} schRotation="180deg" />
78
- <netalias net="GND" schX={-8} schY={2} schRotation="180deg" />
79
- {/* <component>
4
+ export const BugHighPortNumbers = () => {
5
+ const circuit = new Circuit()
6
+
7
+ circuit.add(
8
+ <board
9
+ width={10}
10
+ height={10}
11
+ // @ts-ignore
12
+ >
13
+ <chip
14
+ name="U1"
15
+ manufacturerPartNumber="part-number"
16
+ schPortArrangement={{
17
+ leftSide: {
18
+ pins: [16, 15, 20, 17, 4, 27, 28, 19, 26, 25, 7, 18, 21],
19
+ direction: "top-to-bottom",
20
+ },
21
+ rightSide: {
22
+ pins: [1, 5, 11, 3, 2, 9, 10, 6, 23, 22, 14, 13, 12],
23
+ direction: "top-to-bottom",
24
+ },
25
+ bottomSide: {
26
+ pins: [29],
27
+ direction: "left-to-right",
28
+ },
29
+ }}
30
+ schWidth={1}
31
+ footprint="ssop28Db"
32
+ pinLabels={{
33
+ "1": "TXD",
34
+ "5": "RXD",
35
+ "11": "CTS",
36
+ "3": "RTS",
37
+ "2": "DTR",
38
+ "9": "DSR",
39
+ "10": "DCD",
40
+ "6": "RI",
41
+ "23": "TXLED",
42
+ "22": "RXLED",
43
+ "14": "PWRUN",
44
+ "13": "TXDEN",
45
+ "12": "SLEEP",
46
+ "16": "USBDM",
47
+ "15": "USBDP",
48
+ "20": "VCC",
49
+ "17": "3V3OUT",
50
+ "4": "VCCIO",
51
+ "27": "OSCI",
52
+ "28": "OSCO",
53
+ "19": "RESET",
54
+ "26": "TEST",
55
+ "25": "AGND",
56
+ "7": "GND7",
57
+ "18": "GND18",
58
+ "21": "GND21",
59
+ }}
60
+ />
61
+ <resistor
62
+ resistance="1kohm"
63
+ name="R1"
64
+ footprint="0805"
65
+ schX={3}
66
+ schY={-1}
67
+ symbolName="boxresistor_vert"
68
+ />
69
+ <resistor
70
+ resistance="1kohm"
71
+ name="R2"
72
+ footprint="0805"
73
+ schX={4.5}
74
+ schY={-1}
75
+ symbolName="boxresistor_vert"
76
+ />
77
+ <diode
78
+ name="LED1"
79
+ footprint="0805"
80
+ symbolName="diode_vert"
81
+ schX={3}
82
+ schY={2}
83
+ />
84
+ <diode
85
+ name="LED2"
86
+ footprint="0805"
87
+ symbolName="diode_vert"
88
+ schX={4.5}
89
+ schY={2}
90
+ />
91
+ <netalias net="5V" schX={3} schY={-2} />
92
+ <netalias net="5V" schX={4.5} schY={-2} />
93
+ {/* <trace path={[".5V", ".R2 > port.left"]} />
94
+ <trace path={[".5V", ".R1 > port.left"]} /> */}
95
+ <trace path={[".R1 > port.right", ".LED1 > port.left"]} />
96
+ <trace path={[".R2 > port.right", ".LED2 > port.left"]} />
97
+ <trace path={[".LED1 > port.right", ".U1 > .pin20"]} />
98
+ <trace path={[".LED2 > port.right", ".U1 > .pin6"]} />
99
+ <netalias net="GND" schX={-3} schY={4} schRotation="180deg" />
100
+ <netalias net="GND" schX={-5} schY={3} schRotation="180deg" />
101
+ <netalias net="GND" schX={-6} schY={3} schRotation="180deg" />
102
+ <netalias net="GND" schX={-7} schY={3} schRotation="180deg" />
103
+ <netalias net="GND" schX={-8} schY={2} schRotation="180deg" />
104
+ {/* <component>
80
105
  <schematicbox
81
106
  name="USB"
82
107
  center={[-9, 0]}
@@ -86,15 +111,12 @@ const FTDIBasic3v3 = () => (
86
111
  height={2}
87
112
  />
88
113
  </component> */}
89
- </group>
90
- )
91
-
92
- export const BugHighPortNumbers = () => {
93
- return (
94
- <Schematic style={{ height: 600 }}>
95
- <FTDIBasic3v3 />
96
- </Schematic>
114
+ </board>,
97
115
  )
116
+
117
+ const circuitJson = circuit.getCircuitJson()
118
+
119
+ return <Schematic soup={circuitJson as any} style={{ height: 600 }} />
98
120
  }
99
121
 
100
122
  export default {
@@ -1,21 +1,23 @@
1
1
  import { Schematic } from "Schematic"
2
2
 
3
3
  const OneSidedBugExample = () => (
4
- <bug
5
- name="U2"
6
- schPortArrangement={{
7
- leftSize: 0,
8
- rightSize: 4,
9
- }}
10
- schX={-10}
11
- schY={0}
12
- pinLabels={{
13
- "1": "GND",
14
- "2": "VBUS",
15
- "3": "D-",
16
- "4": "D+",
17
- }}
18
- />
4
+ <board width={10} height={10}>
5
+ <bug
6
+ name="U2"
7
+ schPortArrangement={{
8
+ leftSize: 0,
9
+ rightSize: 4,
10
+ }}
11
+ schX={-10}
12
+ schY={0}
13
+ pinLabels={{
14
+ "1": "GND",
15
+ "2": "VBUS",
16
+ "3": "D-",
17
+ "4": "D+",
18
+ }}
19
+ />
20
+ </board>
19
21
  )
20
22
 
21
23
  export const OneSidedBug = () => {
@@ -1,23 +1,25 @@
1
1
  import { Schematic } from "Schematic"
2
2
 
3
3
  const BugPinSpacingExample = () => (
4
- <bug
5
- name="U2"
6
- manufacturerPartNumber="part-number"
7
- schPortArrangement={{
8
- leftSize: 2,
9
- rightSize: 2,
10
- }}
11
- schX={-10}
12
- schY={0}
13
- schPinSpacing="1.5mm"
14
- pinLabels={{
15
- "1": "GND",
16
- "2": "VBUS",
17
- "3": "D-",
18
- "4": "D+",
19
- }}
20
- />
4
+ <board width={10} height={10}>
5
+ <bug
6
+ name="U2"
7
+ manufacturerPartNumber="part-number"
8
+ schPortArrangement={{
9
+ leftSize: 2,
10
+ rightSize: 2,
11
+ }}
12
+ schX={-10}
13
+ schY={0}
14
+ schPinSpacing="1.5mm"
15
+ pinLabels={{
16
+ "1": "GND",
17
+ "2": "VBUS",
18
+ "3": "D-",
19
+ "4": "D+",
20
+ }}
21
+ />
22
+ </board>
21
23
  )
22
24
 
23
25
  export const BugPinSpacing = () => {
@@ -3,11 +3,13 @@ import { Schematic } from "Schematic"
3
3
  export const Bug1YFlip = () => {
4
4
  return (
5
5
  <Schematic style={{ height: 600 }}>
6
- <bug
7
- name="U1"
8
- schPortArrangement={{ topSize: 2 }}
9
- pinLabels={{ 1: "foo", 2: "baz" }}
10
- />
6
+ <board width={10} height={10}>
7
+ <bug
8
+ name="U1"
9
+ schPortArrangement={{ topSize: 2 }}
10
+ pinLabels={{ 1: "foo", 2: "baz" }}
11
+ />
12
+ </board>
11
13
  </Schematic>
12
14
  )
13
15
  }
@@ -1,13 +1,19 @@
1
- import { useResistor } from "@tscircuit/react-fiber"
2
1
  import { Schematic } from "../../Schematic"
3
2
 
4
3
  export const Bug3ScalingTrace = () => {
5
- const R1 = useResistor("R1", { resistance: "10" })
6
- const R2 = useResistor("R2", { resistance: "1k" })
7
4
  return (
8
5
  <Schematic style={{ height: 500 }}>
9
- <R1 schX={2} schY={1} />
10
- <R2 schRotation="90deg" schX={0} schY={3} left={R1.left} />
6
+ <board width={"10mm"} height={"10mm"} pcbX={0} pcbY={0}>
7
+ <resistor name="R1" resistance="10" schX={2} schY={1} />
8
+ <resistor
9
+ name="R2"
10
+ resistance="1k"
11
+ schX={0}
12
+ schY={3}
13
+ symbolName="boxresistor_vert"
14
+ />
15
+ <trace path={[".R1 > port.right", ".R2 > port.left"]} />
16
+ </board>
11
17
  </Schematic>
12
18
  )
13
19
  }
@@ -1,4 +1,3 @@
1
- import { useResistor } from "@tscircuit/react-fiber"
2
1
  import { Schematic } from "../../Schematic"
3
2
 
4
3
  export const Bug4SchematicLine = () => {
@@ -1,10 +1,11 @@
1
- import { useResistor } from "@tscircuit/react-fiber"
2
1
  import { Schematic } from "../../Schematic"
3
2
 
4
3
  export const Bug5SchematicLine = () => {
5
4
  return (
6
5
  <Schematic style={{ height: 500 }}>
7
- <diode name="D1" />
6
+ <board width={10} height={10}>
7
+ <diode name="D1" />
8
+ </board>
8
9
  </Schematic>
9
10
  )
10
11
  }
@@ -3,48 +3,12 @@ import { Schematic } from "../../Schematic"
3
3
  export const Bug6TraceScaling = () => {
4
4
  return (
5
5
  <Schematic style={{ height: 500 }}>
6
- <resistor name="R1" resistance="10 ohm" schX={2} schY={1} />
7
- {/* <powersource voltage="5V" schX={1} schY={2} name="main_power" /> */}
8
- <resistor resistance="1k" schX={1} schY={2} name="main_power" />
9
- {/* <trace path={[".main_power > port.negative", ".R1 > port.left"]} /> */}
10
- <trace path={[".main_power > port.right", ".R1 > port.left"]} />
6
+ <board width={10} height={10}>
7
+ <resistor name="R1" resistance="10 ohm" schX={2} schY={1} />
8
+ <resistor resistance="1k" schX={1} schY={2} name="main_power" />
9
+ <trace path={[".main_power > port.right", ".R1 > port.left"]} />
10
+ </board>
11
11
  </Schematic>
12
- // <Schematic
13
- // style={{ height: 500 }}
14
- // soup={[
15
- // {
16
- // type: "source_trace",
17
- // source_trace_id: "source_trace_0",
18
- // },
19
- // {
20
- // type: "schematic_trace",
21
- // source_trace_id: "source_trace_0",
22
- // schematic_trace_id: "schematic_trace_0",
23
- // edges: [
24
- // {
25
- // from: {
26
- // x: 1,
27
- // y: 1.4000000000000001,
28
- // },
29
- // to: {
30
- // x: 1,
31
- // y: 1,
32
- // },
33
- // },
34
- // {
35
- // from: {
36
- // x: 1,
37
- // y: 1,
38
- // },
39
- // to: {
40
- // x: 1.4000000000000001,
41
- // y: 1,
42
- // },
43
- // },
44
- // ],
45
- // },
46
- // ]}
47
- // />
48
12
  )
49
13
  }
50
14
 
@@ -1,30 +1,7 @@
1
- import { Schematic } from "../../Schematic"
2
1
  import { layout } from "@tscircuit/layout"
3
- import { useBug, useResistor, useCapacitor } from "@tscircuit/react-fiber"
2
+ import { Schematic } from "../../Schematic"
4
3
 
5
4
  export const Bug8Autolayout = () => {
6
- const U1 = useBug("U1", {
7
- pinLabels: {
8
- 1: "VCC",
9
- 2: "D0",
10
- 3: "D1",
11
- 4: "GND",
12
- 5: "INP",
13
- 6: "THR",
14
- },
15
- schPortArrangement: {
16
- leftSize: 3,
17
- topSize: 0,
18
- bottomSize: 0,
19
- rightSize: 3,
20
- },
21
- })
22
-
23
- const R1 = useResistor("R1", { resistance: "10k" })
24
- const R2 = useResistor("R2", { resistance: "1k" })
25
- const R3 = useResistor("R3", { resistance: "5k" })
26
- const C1 = useCapacitor("C1", { capacitance: "1uF" })
27
-
28
5
  return (
29
6
  <div>
30
7
  <Schematic style={{ height: 500 }}>
@@ -35,11 +12,25 @@ export const Bug8Autolayout = () => {
35
12
  width={"10mm"}
36
13
  height={"10mm"}
37
14
  >
38
- <U1 />
39
- <R1 left={U1.D1} right={U1.VCC} />
40
- <R2 left={U1.D0} right={U1.GND} />
41
- <R3 left={U1.INP} right={U1.THR} />
42
- <C1 left={U1.INP} right={U1.THR} />
15
+ <bug
16
+ name="U1"
17
+ schX={0}
18
+ schY={0}
19
+ schPortArrangement={{
20
+ leftSize: 3,
21
+ topSize: 0,
22
+ bottomSize: 0,
23
+ rightSize: 3,
24
+ }}
25
+ />
26
+ <resistor name="R1" resistance="10k" schX={0} schY={1} />
27
+ <resistor name="R2" resistance="1k" schX={0} schY={3} />
28
+ <resistor name="R3" resistance="5k" schX={2} schY={1} />
29
+ <capacitor name="C1" capacitance="1uF" schX={2} schY={3} />
30
+ <trace path={[".R1 > port.right", ".R2 > port.left"]} />
31
+ <trace path={[".R2 > port.right", ".R3 > port.left"]} />
32
+ <trace path={[".R3 > port.right", ".C1 > port.left"]} />
33
+ <trace path={[".C1 > port.right", ".R1 > port.left"]} />
43
34
  </board>
44
35
  </Schematic>
45
36
  </div>
@@ -3,7 +3,9 @@ import { Schematic } from "../../Schematic"
3
3
  export const Diode = () => {
4
4
  return (
5
5
  <Schematic style={{ height: 500 }}>
6
- <diode name="D1" schX={3} schY={1} />
6
+ <board width={10} height={10}>
7
+ <diode name="D1" schX={2} schY={1} />
8
+ </board>
7
9
  </Schematic>
8
10
  )
9
11
  }
@@ -3,7 +3,9 @@ import { Schematic } from "../../Schematic"
3
3
  export const Resistor = () => {
4
4
  return (
5
5
  <Schematic style={{ height: 500 }}>
6
- <resistor name="R1" resistance="10 ohm" schX={2} schY={1} />
6
+ <board width={10} height={10}>
7
+ <resistor name="R1" resistance="10 ohm" schX={2} schY={1} />
8
+ </board>
7
9
  </Schematic>
8
10
  )
9
11
  }
@@ -3,54 +3,41 @@ import { Schematic } from "../Schematic"
3
3
  export const LEDCircuitReact = () => {
4
4
  return (
5
5
  <Schematic style={{ height: 500 }}>
6
- <resistor name="R1" resistance="10 ohm" schX={2} schY={1} />
7
- <capacitor
8
- name="C1"
9
- capacitance="10 uF"
10
- schX={4}
11
- schY={2}
12
- schRotation="90deg"
13
- />
14
- <resistor
15
- name="R2"
16
- resistance="10 ohm"
17
- schX={6}
18
- schY={1}
19
- schRotation="90deg"
20
- />
21
- <trace
22
- path={[".R1 > port.right", ".C1 > port.left", ".R2 > port.left"]}
23
- />
24
- <powersource voltage="5V" schX={1} schY={2} name="main_power" />
25
- <trace path={[".main_power > port.positive", ".R1 > port.left"]} />
26
- <trace
27
- path={["power > port.negative", ".C1 > port.right", ".R2 > port.right"]}
28
- />
29
- <bug
30
- name="B1"
31
- schPortArrangement={{ leftSide: { pins: [3, 2, 1], direction: "top-to-bottom" }, rightSide: { pins: [6, 5, 4], direction: "top-to-bottom" } }}
32
- schX={8}
33
- schY={3}
34
- pinLabels={{
35
- 1: "PWR",
36
- 2: "NC",
37
- 3: "RG",
38
- 4: "D0",
39
- 5: "D1",
40
- 6: "GND",
41
- }}
42
- />
43
- <trace path={[".B1 > port.PWR", ".R2 > port.left"]} />
44
- <ground name="GND" center={[11, 3]} />
45
- <trace path={[".B1 > port.GND", ".GND > .gnd"]} />
46
- {/* <trace from=".B1 > port.GND" to=".GND > .gnd" /> */}
47
- <diode name="D1" schX={6} schY={3.5} schRotation="180deg" />
48
- <trace path={[".D1 > port.right", ".C1 > .right"]} />
49
- <trace path={[".D1 > port.left", ".B1 > .RG"]} />
50
- {/* <trace from=".D1 > .left" to=".B1 > .RG" /> */}
51
- {/* <trace from=".D1 > .right" to=".C1> .right" /> */}
52
- <netalias schX={"10mm"} schY={"1.5mm"} net="D0BUS" />
53
- <trace path={[".B1 > .D0", ".D0BUS"]} />
6
+ <group>
7
+ <resistor name="R1" resistance="10 ohm" schX={2} schY={1} />
8
+ <capacitor
9
+ name="C1"
10
+ capacitance="10 uF"
11
+ schX={4}
12
+ schY={2}
13
+ symbolName="capacitor_vert"
14
+ />
15
+ <resistor name="R2" resistance="10 ohm" schX={6} schY={1} />
16
+ <trace path={[".R1 > port.right", ".C1 > port.left"]} />
17
+ <trace path={[".C1 > port.right", ".R2 > port.left"]} />
18
+ <powersource voltage={5} schX={1} schY={2} name="main_power" />
19
+ <trace path={[".main_power > port.positive", ".R1 > port.left"]} />
20
+ <trace path={[".main_power > port.negative", ".C1 > port.right"]} />
21
+ <trace path={[".C1 > port.right", ".R2 > port.right"]} />
22
+ <bug
23
+ name="B1"
24
+ schPortArrangement={{
25
+ leftSide: { pins: [3, 2, 1], direction: "top-to-bottom" },
26
+ rightSide: { pins: [6, 5, 4], direction: "top-to-bottom" },
27
+ }}
28
+ // schWidth={4}
29
+ schX={8}
30
+ schY={3}
31
+ pinLabels={{
32
+ 1: "PWR",
33
+ 2: "NC",
34
+ 3: "RG",
35
+ 4: "D0",
36
+ 5: "D1",
37
+ 6: "GND",
38
+ }}
39
+ />
40
+ </group>
54
41
  </Schematic>
55
42
  )
56
43
  }
@@ -3,14 +3,16 @@ import { Schematic } from "../Schematic"
3
3
  export const RotatedResistor = () => {
4
4
  return (
5
5
  <Schematic style={{ height: 500 }}>
6
- <resistor
7
- name="R1"
8
- resistance="10 ohm"
9
- schX={2}
10
- schY={1}
11
- schRotation="90deg"
12
- pcbRotation="90deg"
13
- />
6
+ <board width={10} height={10}>
7
+ <resistor
8
+ name="R1"
9
+ resistance="10 ohm"
10
+ schX={2}
11
+ schY={1}
12
+ schRotation="90deg"
13
+ pcbRotation="90deg"
14
+ />
15
+ </board>
14
16
  </Schematic>
15
17
  )
16
18
  }