@tscircuit/builder v1.5.79
@tscircuit/builder
TSCircuit Builder is a Typescript builder pattern for constructing schematic and PCB layouts. @tscircuit/builder
is an internal module, use tscircuit tsx instead
TSCircuit TSX eventually renders to a builder. The builder will build TSCircuit Soup, a JSON output. Soup can be rendered to a webpage as either a schematic or PCB layout.
Why not go directly from TSX -> Schematic/PCB?
If you think about how React works, there's a layer between React and the rendered HTML image you see on your screen, that layer is the DOM. The DOM simplifies the amount of work React has to do. In the same way, the Builder simplifies the amount of work that the TSCircuit TSX have to do while providing a lot of flexibility for different renderers. It's like the DOM for Circuits.
Example
const projectBuilder = await createProjectBuilder()
.addResistor((rb) =>
rb
.setSourceProperties({
resistance: "10 ohm",
name: "R1",
})
.setSchematicCenter(2, 1)
)
const projectBuilderOutput = await projectBuilder.build()
/*
// Soup JSON, very verbose! Looks easy to render though!
[
{
ftype: 'simple_resistor',
name: 'R1',
resistance: '10 ohm',
source_component_id: 'simple_resistor_0',
type: 'source_component',
},
{
center: {
x: 2,
y: 1,
},
rotation: 0,
schematic_component_id: 'schematic_component_simple_resistor_0',
size: {
height: 0.3,
width: 1,
},
source_component_id: 'simple_resistor_0',
type: 'schematic_component',
},
...
]
Installation
npm install --save @tscircuit/builder
1 day ago
23 hours ago
2 days ago
2 days ago
4 days ago
8 days ago
8 days ago
9 days ago
9 days ago
15 days ago
15 days ago
15 days ago
15 days ago
15 days ago
16 days ago
16 days ago
16 days ago
16 days ago
17 days ago
17 days ago
17 days ago
19 days ago
19 days ago
19 days ago
19 days ago
20 days ago
23 days ago
23 days ago
25 days ago
25 days ago
26 days ago
25 days ago
26 days ago
26 days ago
26 days ago
26 days ago
26 days ago
26 days ago
27 days ago
28 days ago
28 days ago
28 days ago
29 days ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
2 months ago
10 months ago
9 months ago
9 months ago
9 months ago
7 months ago
9 months ago
7 months ago
10 months ago
7 months ago
10 months ago
7 months ago
10 months ago
10 months ago
9 months ago
9 months ago
9 months ago
9 months ago
8 months ago
8 months ago
9 months ago
9 months ago
8 months ago
8 months ago
6 months ago
6 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
8 months ago
8 months ago
10 months ago
8 months ago
8 months ago
8 months ago
8 months ago
9 months ago
11 months ago
11 months ago
12 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago