circuit-json 0.0.453 → 0.0.455
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 +250 -0
- package/dist/index.d.mts +2748 -42
- package/dist/index.mjs +932 -615
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -140,6 +140,7 @@ https://github.com/user-attachments/assets/2f28b7ba-689e-4d80-85b2-5bdef84b41f8
|
|
|
140
140
|
- [PcbNotePath](#pcbnotepath)
|
|
141
141
|
- [PcbNoteRect](#pcbnoterect)
|
|
142
142
|
- [PcbNoteText](#pcbnotetext)
|
|
143
|
+
- [PcbPackingError](#pcbpackingerror)
|
|
143
144
|
- [PcbPadPadClearanceError](#pcbpadpadclearanceerror)
|
|
144
145
|
- [PcbPadTraceClearanceError](#pcbpadtraceclearanceerror)
|
|
145
146
|
- [PcbPanel](#pcbpanel)
|
|
@@ -195,11 +196,21 @@ https://github.com/user-attachments/assets/2f28b7ba-689e-4d80-85b2-5bdef84b41f8
|
|
|
195
196
|
- [SchematicTrace](#schematictrace)
|
|
196
197
|
- [SchematicVoltageProbe](#schematicvoltageprobe)
|
|
197
198
|
- [Simulation Elements](#simulation-elements)
|
|
199
|
+
- [SimulationAcSweepCurrentGraph](#simulationacsweepcurrentgraph)
|
|
200
|
+
- [SimulationAcSweepVoltageGraph](#simulationacsweepvoltagegraph)
|
|
201
|
+
- [SimulationAnalysisResult](#simulationanalysisresult)
|
|
202
|
+
- [SimulationComplexSample](#simulationcomplexsample)
|
|
198
203
|
- [SimulationCurrentProbe](#simulationcurrentprobe)
|
|
199
204
|
- [SimulationCurrentSource](#simulationcurrentsource)
|
|
205
|
+
- [SimulationDcOperatingPointCurrent](#simulationdcoperatingpointcurrent)
|
|
206
|
+
- [SimulationDcOperatingPointVoltage](#simulationdcoperatingpointvoltage)
|
|
207
|
+
- [SimulationDcSweepCurrentGraph](#simulationdcsweepcurrentgraph)
|
|
208
|
+
- [SimulationDcSweepVoltageGraph](#simulationdcsweepvoltagegraph)
|
|
200
209
|
- [SimulationExperiment](#simulationexperiment)
|
|
201
210
|
- [SimulationOpAmp](#simulationopamp)
|
|
202
211
|
- [SimulationOscilloscopeTrace](#simulationoscilloscopetrace)
|
|
212
|
+
- [SimulationParameterSweep](#simulationparametersweep)
|
|
213
|
+
- [SimulationParameterSweepCoordinate](#simulationparametersweepcoordinate)
|
|
203
214
|
- [SimulationSpiceSubcircuit](#simulationspicesubcircuit)
|
|
204
215
|
- [SimulationSwitch](#simulationswitch)
|
|
205
216
|
- [SimulationTransientCurrentGraph](#simulationtransientcurrentgraph)
|
|
@@ -2093,6 +2104,23 @@ interface PcbNoteText {
|
|
|
2093
2104
|
}
|
|
2094
2105
|
```
|
|
2095
2106
|
|
|
2107
|
+
### PcbPackingError
|
|
2108
|
+
|
|
2109
|
+
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_packing_error.ts)
|
|
2110
|
+
|
|
2111
|
+
Defines a failure to pack PCB components within layout bounds
|
|
2112
|
+
|
|
2113
|
+
```typescript
|
|
2114
|
+
/** Defines a failure to pack PCB components within layout bounds */
|
|
2115
|
+
interface PcbPackingError extends BaseCircuitJsonError {
|
|
2116
|
+
type: "pcb_packing_error"
|
|
2117
|
+
pcb_packing_error_id: string
|
|
2118
|
+
error_type: "pcb_packing_error"
|
|
2119
|
+
pcb_group_id?: string
|
|
2120
|
+
subcircuit_id?: string
|
|
2121
|
+
}
|
|
2122
|
+
```
|
|
2123
|
+
|
|
2096
2124
|
### PcbPadPadClearanceError
|
|
2097
2125
|
|
|
2098
2126
|
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_pad_pad_clearance_error.ts)
|
|
@@ -3412,6 +3440,81 @@ interface SchematicVoltageProbe {
|
|
|
3412
3440
|
|
|
3413
3441
|
## Simulation Elements
|
|
3414
3442
|
|
|
3443
|
+
### SimulationAcSweepCurrentGraph
|
|
3444
|
+
|
|
3445
|
+
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_ac_sweep_current_graph.ts)
|
|
3446
|
+
|
|
3447
|
+
```typescript
|
|
3448
|
+
interface SimulationAcSweepCurrentGraph {
|
|
3449
|
+
type: "simulation_ac_sweep_current_graph"
|
|
3450
|
+
simulation_ac_sweep_current_graph_id: string
|
|
3451
|
+
simulation_experiment_id: string
|
|
3452
|
+
simulation_parameter_sweep_coordinate?: SimulationParameterSweepCoordinate
|
|
3453
|
+
simulation_current_probe_id: string
|
|
3454
|
+
frequencies_hz: number[]
|
|
3455
|
+
complex_currents: SimulationComplexSample[]
|
|
3456
|
+
name?: string
|
|
3457
|
+
color?: string
|
|
3458
|
+
}
|
|
3459
|
+
```
|
|
3460
|
+
|
|
3461
|
+
### SimulationAcSweepVoltageGraph
|
|
3462
|
+
|
|
3463
|
+
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_ac_sweep_voltage_graph.ts)
|
|
3464
|
+
|
|
3465
|
+
```typescript
|
|
3466
|
+
interface SimulationAcSweepVoltageGraph {
|
|
3467
|
+
type: "simulation_ac_sweep_voltage_graph"
|
|
3468
|
+
simulation_ac_sweep_voltage_graph_id: string
|
|
3469
|
+
simulation_experiment_id: string
|
|
3470
|
+
simulation_parameter_sweep_coordinate?: SimulationParameterSweepCoordinate
|
|
3471
|
+
simulation_voltage_probe_id: string
|
|
3472
|
+
frequencies_hz: number[]
|
|
3473
|
+
complex_voltages: SimulationComplexSample[]
|
|
3474
|
+
name?: string
|
|
3475
|
+
color?: string
|
|
3476
|
+
}
|
|
3477
|
+
```
|
|
3478
|
+
|
|
3479
|
+
### SimulationAnalysisResult
|
|
3480
|
+
|
|
3481
|
+
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_analysis_result.ts)
|
|
3482
|
+
|
|
3483
|
+
```typescript
|
|
3484
|
+
type SimulationAnalysisResult =
|
|
3485
|
+
| SimulationVoltageAnalysisResult
|
|
3486
|
+
| SimulationCurrentAnalysisResult
|
|
3487
|
+
|
|
3488
|
+
type SimulationNonTransientVoltageAnalysisResult =
|
|
3489
|
+
| SimulationDcOperatingPointVoltage
|
|
3490
|
+
| SimulationDcSweepVoltageGraph
|
|
3491
|
+
| SimulationAcSweepVoltageGraph
|
|
3492
|
+
|
|
3493
|
+
type SimulationNonTransientCurrentAnalysisResult =
|
|
3494
|
+
| SimulationDcOperatingPointCurrent
|
|
3495
|
+
| SimulationDcSweepCurrentGraph
|
|
3496
|
+
| SimulationAcSweepCurrentGraph
|
|
3497
|
+
|
|
3498
|
+
type SimulationVoltageAnalysisResult =
|
|
3499
|
+
| SimulationTransientVoltageGraph
|
|
3500
|
+
| SimulationNonTransientVoltageAnalysisResult
|
|
3501
|
+
|
|
3502
|
+
type SimulationCurrentAnalysisResult =
|
|
3503
|
+
| SimulationTransientCurrentGraph
|
|
3504
|
+
| SimulationNonTransientCurrentAnalysisResult
|
|
3505
|
+
```
|
|
3506
|
+
|
|
3507
|
+
### SimulationComplexSample
|
|
3508
|
+
|
|
3509
|
+
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_complex_sample.ts)
|
|
3510
|
+
|
|
3511
|
+
```typescript
|
|
3512
|
+
interface SimulationComplexSample {
|
|
3513
|
+
re: number
|
|
3514
|
+
im: number
|
|
3515
|
+
}
|
|
3516
|
+
```
|
|
3517
|
+
|
|
3415
3518
|
### SimulationCurrentProbe
|
|
3416
3519
|
|
|
3417
3520
|
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_current_probe.ts)
|
|
@@ -3453,6 +3556,8 @@ interface SimulationDcCurrentSource {
|
|
|
3453
3556
|
negative_source_port_id?: string
|
|
3454
3557
|
negative_source_net_id?: string
|
|
3455
3558
|
current: number
|
|
3559
|
+
ac_magnitude?: number
|
|
3560
|
+
ac_phase?: number
|
|
3456
3561
|
}
|
|
3457
3562
|
|
|
3458
3563
|
/** Defines an AC current source for simulation purposes. */
|
|
@@ -3470,6 +3575,80 @@ interface SimulationAcCurrentSource {
|
|
|
3470
3575
|
wave_shape?: WaveShape
|
|
3471
3576
|
phase?: number
|
|
3472
3577
|
duty_cycle?: number
|
|
3578
|
+
ac_magnitude?: number
|
|
3579
|
+
ac_phase?: number
|
|
3580
|
+
}
|
|
3581
|
+
```
|
|
3582
|
+
|
|
3583
|
+
### SimulationDcOperatingPointCurrent
|
|
3584
|
+
|
|
3585
|
+
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_dc_operating_point_current.ts)
|
|
3586
|
+
|
|
3587
|
+
```typescript
|
|
3588
|
+
interface SimulationDcOperatingPointCurrent {
|
|
3589
|
+
type: "simulation_dc_operating_point_current"
|
|
3590
|
+
simulation_dc_operating_point_current_id: string
|
|
3591
|
+
simulation_experiment_id: string
|
|
3592
|
+
simulation_parameter_sweep_coordinate?: SimulationParameterSweepCoordinate
|
|
3593
|
+
simulation_current_probe_id: string
|
|
3594
|
+
current: number
|
|
3595
|
+
name?: string
|
|
3596
|
+
color?: string
|
|
3597
|
+
}
|
|
3598
|
+
```
|
|
3599
|
+
|
|
3600
|
+
### SimulationDcOperatingPointVoltage
|
|
3601
|
+
|
|
3602
|
+
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_dc_operating_point_voltage.ts)
|
|
3603
|
+
|
|
3604
|
+
```typescript
|
|
3605
|
+
interface SimulationDcOperatingPointVoltage {
|
|
3606
|
+
type: "simulation_dc_operating_point_voltage"
|
|
3607
|
+
simulation_dc_operating_point_voltage_id: string
|
|
3608
|
+
simulation_experiment_id: string
|
|
3609
|
+
simulation_parameter_sweep_coordinate?: SimulationParameterSweepCoordinate
|
|
3610
|
+
simulation_voltage_probe_id: string
|
|
3611
|
+
voltage: number
|
|
3612
|
+
name?: string
|
|
3613
|
+
color?: string
|
|
3614
|
+
}
|
|
3615
|
+
```
|
|
3616
|
+
|
|
3617
|
+
### SimulationDcSweepCurrentGraph
|
|
3618
|
+
|
|
3619
|
+
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_dc_sweep_current_graph.ts)
|
|
3620
|
+
|
|
3621
|
+
```typescript
|
|
3622
|
+
interface SimulationDcSweepCurrentGraph {
|
|
3623
|
+
type: "simulation_dc_sweep_current_graph"
|
|
3624
|
+
simulation_dc_sweep_current_graph_id: string
|
|
3625
|
+
simulation_experiment_id: string
|
|
3626
|
+
simulation_parameter_sweep_coordinate?: SimulationParameterSweepCoordinate
|
|
3627
|
+
simulation_current_probe_id: string
|
|
3628
|
+
sweep_values: number[]
|
|
3629
|
+
sweep_unit: SimulationDcSweepUnit
|
|
3630
|
+
current_levels: number[]
|
|
3631
|
+
name?: string
|
|
3632
|
+
color?: string
|
|
3633
|
+
}
|
|
3634
|
+
```
|
|
3635
|
+
|
|
3636
|
+
### SimulationDcSweepVoltageGraph
|
|
3637
|
+
|
|
3638
|
+
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_dc_sweep_voltage_graph.ts)
|
|
3639
|
+
|
|
3640
|
+
```typescript
|
|
3641
|
+
interface SimulationDcSweepVoltageGraph {
|
|
3642
|
+
type: "simulation_dc_sweep_voltage_graph"
|
|
3643
|
+
simulation_dc_sweep_voltage_graph_id: string
|
|
3644
|
+
simulation_experiment_id: string
|
|
3645
|
+
simulation_parameter_sweep_coordinate?: SimulationParameterSweepCoordinate
|
|
3646
|
+
simulation_voltage_probe_id: string
|
|
3647
|
+
sweep_values: number[]
|
|
3648
|
+
sweep_unit: SimulationDcSweepUnit
|
|
3649
|
+
voltage_levels: number[]
|
|
3650
|
+
name?: string
|
|
3651
|
+
color?: string
|
|
3473
3652
|
}
|
|
3474
3653
|
```
|
|
3475
3654
|
|
|
@@ -3487,6 +3666,17 @@ interface SimulationExperiment {
|
|
|
3487
3666
|
start_time_ms?: number // ms
|
|
3488
3667
|
end_time_ms?: number // ms
|
|
3489
3668
|
spice_options?: SpiceSimulationOptions
|
|
3669
|
+
dc_sweep_voltage_source_id?: string
|
|
3670
|
+
dc_sweep_current_source_id?: string
|
|
3671
|
+
dc_sweep_start?: number
|
|
3672
|
+
dc_sweep_stop?: number
|
|
3673
|
+
dc_sweep_step?: number
|
|
3674
|
+
dc_sweep_unit?: "V" | "A"
|
|
3675
|
+
ac_sweep_type?: "linear" | "decade" | "octave"
|
|
3676
|
+
ac_samples_per_interval?: number
|
|
3677
|
+
ac_sample_count?: number
|
|
3678
|
+
ac_start_frequency_hz?: number
|
|
3679
|
+
ac_stop_frequency_hz?: number
|
|
3490
3680
|
}
|
|
3491
3681
|
|
|
3492
3682
|
interface SpiceSimulationOptions {
|
|
@@ -3545,6 +3735,60 @@ interface SimulationOscilloscopeTrace {
|
|
|
3545
3735
|
}
|
|
3546
3736
|
```
|
|
3547
3737
|
|
|
3738
|
+
### SimulationParameterSweep
|
|
3739
|
+
|
|
3740
|
+
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_parameter_sweep.ts)
|
|
3741
|
+
|
|
3742
|
+
```typescript
|
|
3743
|
+
type SimulationParameterSweep =
|
|
3744
|
+
| SimulationResistanceParameterSweep
|
|
3745
|
+
| SimulationCapacitanceParameterSweep
|
|
3746
|
+
| SimulationInductanceParameterSweep
|
|
3747
|
+
| SimulationVoltageParameterSweep
|
|
3748
|
+
| SimulationCurrentParameterSweep
|
|
3749
|
+
|
|
3750
|
+
interface SimulationResistanceParameterSweep
|
|
3751
|
+
extends SimulationParameterSweepBase {
|
|
3752
|
+
parameter_type: "resistance"
|
|
3753
|
+
resistor_source_component_id: string
|
|
3754
|
+
}
|
|
3755
|
+
|
|
3756
|
+
interface SimulationCapacitanceParameterSweep
|
|
3757
|
+
extends SimulationParameterSweepBase {
|
|
3758
|
+
parameter_type: "capacitance"
|
|
3759
|
+
capacitor_source_component_id: string
|
|
3760
|
+
}
|
|
3761
|
+
|
|
3762
|
+
interface SimulationInductanceParameterSweep
|
|
3763
|
+
extends SimulationParameterSweepBase {
|
|
3764
|
+
parameter_type: "inductance"
|
|
3765
|
+
inductor_source_component_id: string
|
|
3766
|
+
}
|
|
3767
|
+
|
|
3768
|
+
interface SimulationVoltageParameterSweep extends SimulationParameterSweepBase {
|
|
3769
|
+
parameter_type: "voltage"
|
|
3770
|
+
source_net_id: string
|
|
3771
|
+
}
|
|
3772
|
+
|
|
3773
|
+
interface SimulationCurrentParameterSweep extends SimulationParameterSweepBase {
|
|
3774
|
+
parameter_type: "current"
|
|
3775
|
+
current_source_component_id: string
|
|
3776
|
+
}
|
|
3777
|
+
```
|
|
3778
|
+
|
|
3779
|
+
### SimulationParameterSweepCoordinate
|
|
3780
|
+
|
|
3781
|
+
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_parameter_sweep_coordinate.ts)
|
|
3782
|
+
|
|
3783
|
+
```typescript
|
|
3784
|
+
interface SimulationParameterSweepCoordinate {
|
|
3785
|
+
simulation_parameter_sweep_id: string
|
|
3786
|
+
sweep_index: number
|
|
3787
|
+
parameter_value: number
|
|
3788
|
+
parameter_unit: SimulationParameterUnit
|
|
3789
|
+
}
|
|
3790
|
+
```
|
|
3791
|
+
|
|
3548
3792
|
### SimulationSpiceSubcircuit
|
|
3549
3793
|
|
|
3550
3794
|
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_spice_subcircuit.ts)
|
|
@@ -3593,6 +3837,7 @@ interface SimulationTransientCurrentGraph {
|
|
|
3593
3837
|
type: "simulation_transient_current_graph"
|
|
3594
3838
|
simulation_transient_current_graph_id: string
|
|
3595
3839
|
simulation_experiment_id: string
|
|
3840
|
+
simulation_parameter_sweep_coordinate?: SimulationParameterSweepCoordinate
|
|
3596
3841
|
timestamps_ms?: number[]
|
|
3597
3842
|
current_levels: number[]
|
|
3598
3843
|
source_component_id?: string
|
|
@@ -3614,6 +3859,7 @@ interface SimulationTransientVoltageGraph {
|
|
|
3614
3859
|
type: "simulation_transient_voltage_graph"
|
|
3615
3860
|
simulation_transient_voltage_graph_id: string
|
|
3616
3861
|
simulation_experiment_id: string
|
|
3862
|
+
simulation_parameter_sweep_coordinate?: SimulationParameterSweepCoordinate
|
|
3617
3863
|
timestamps_ms?: number[]
|
|
3618
3864
|
voltage_levels: number[]
|
|
3619
3865
|
source_component_id?: string
|
|
@@ -3685,6 +3931,8 @@ interface SimulationDcVoltageSource {
|
|
|
3685
3931
|
negative_source_port_id?: string
|
|
3686
3932
|
negative_source_net_id?: string
|
|
3687
3933
|
voltage: number
|
|
3934
|
+
ac_magnitude?: number
|
|
3935
|
+
ac_phase?: number
|
|
3688
3936
|
}
|
|
3689
3937
|
|
|
3690
3938
|
/** Defines an AC voltage source for simulation purposes. */
|
|
@@ -3707,6 +3955,8 @@ interface SimulationAcVoltageSource {
|
|
|
3707
3955
|
fall_time?: number // ms
|
|
3708
3956
|
pulse_width?: number // ms
|
|
3709
3957
|
period?: number // ms
|
|
3958
|
+
ac_magnitude?: number
|
|
3959
|
+
ac_phase?: number
|
|
3710
3960
|
}
|
|
3711
3961
|
```
|
|
3712
3962
|
|