@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.
- package/README.md +1 -1
- package/biome.json +45 -0
- package/dist/index.d.ts +3 -4
- package/dist/index.js +734 -688
- package/dist/index.js.map +1 -1
- package/package.json +8 -7
- package/src/Schematic.tsx +141 -65
- package/src/lib/render-context/index.ts +1 -1
- package/src/lib/types/core.ts +14 -49
- package/src/lib/types/source-component.ts +6 -1
- package/src/lib/utils/collect-element-refs.ts +5 -4
- package/src/lib/utils/colors.ts +235 -0
- package/src/lib/utils/direction-to-vec.ts +3 -3
- package/src/schematic-components/SVGPathComponent.tsx +71 -112
- package/src/schematic-components/SchematicChip.tsx +222 -0
- package/src/schematic-components/SchematicComponent.tsx +25 -22
- package/src/schematic-components/SchematicComponentFromSymbol.tsx +46 -0
- package/src/schematic-components/SchematicElement.tsx +0 -28
- package/src/schematic-components/SchematicNetLabel.tsx +3 -0
- package/src/schematic-components/SchematicText.tsx +4 -6
- package/src/schematic-components/SchematicTrace.tsx +4 -3
- package/src/schematic-components/TableViewer.tsx +1 -1
- package/src/schematic-components/index.tsx +6 -14
- package/src/stories/basics/schematic-net-label.stories.tsx +2 -0
- package/src/stories/basics/schematic-net-labels-2.stories.tsx +22 -20
- package/src/stories/bug-connections.stories.tsx +18 -13
- package/src/stories/bug-high-port-numbers.stories.tsx +107 -85
- package/src/stories/bug-one-sided.stories.tsx +17 -15
- package/src/stories/bug-pin-spacing.stories.tsx +19 -17
- package/src/stories/bugs/bug1-y-flip.stories.tsx +7 -5
- package/src/stories/bugs/bug3-scaling-trace.stories.tsx +11 -5
- package/src/stories/bugs/bug4-schematic-line.stories.tsx +0 -1
- package/src/stories/bugs/bug5-diode.stories.tsx +3 -2
- package/src/stories/bugs/bug6-trace-scaling.stories.tsx +5 -41
- package/src/stories/bugs/bug8-autolayout.stories.tsx +20 -29
- package/src/stories/circuit-components/diode.stories.tsx +3 -1
- package/src/stories/circuit-components/resistor.stories.tsx +3 -1
- package/src/stories/led-circuit-react.stories.tsx +35 -48
- package/src/stories/rotated-resistor.stories.tsx +10 -8
- package/src/stories/three-sided-bug.stories.tsx +17 -15
- package/src/pages/led-circuit.tsx +0 -96
- package/src/schematic-components/ProjectComponent.tsx +0 -70
- package/src/schematic-components/SchematicBox.tsx +0 -29
- package/src/schematic-components/SchematicBug.tsx +0 -107
- package/src/schematic-components/SchematicLine.tsx +0 -48
- package/src/schematic-components/SchematicPath.tsx +0 -51
- package/src/schematic-components/SchematicPort.tsx +0 -63
- package/src/schematic-components/SimpleCapacitor.tsx +0 -29
- package/src/schematic-components/SimpleDiode.tsx +0 -42
- package/src/schematic-components/SimpleGround.tsx +0 -30
- package/src/schematic-components/SimpleInductor.tsx +0 -29
- package/src/schematic-components/SimplePowerSource.tsx +0 -43
- package/src/schematic-components/SimpleResistor.tsx +0 -28
- 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
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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
|
-
|
|
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
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
<
|
|
10
|
-
|
|
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,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
|
-
<
|
|
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
|
-
<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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 {
|
|
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
|
-
<
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
<
|
|
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
|
-
<
|
|
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
|
-
<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
name="R2"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
}
|