circuit-json 0.0.452 → 0.0.454
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 +255 -0
- package/dist/index.d.mts +2739 -40
- package/dist/index.mjs +1436 -1109
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -177,6 +177,7 @@ https://github.com/user-attachments/assets/2f28b7ba-689e-4d80-85b2-5bdef84b41f8
|
|
|
177
177
|
- [SchematicComponent](#schematiccomponent)
|
|
178
178
|
- [SchematicComponentOverlapWarning](#schematiccomponentoverlapwarning)
|
|
179
179
|
- [SchematicDebugObject](#schematicdebugobject)
|
|
180
|
+
- [SchematicElementOutsideSheetWarning](#schematicelementoutsidesheetwarning)
|
|
180
181
|
- [SchematicError](#schematicerror)
|
|
181
182
|
- [SchematicGroup](#schematicgroup)
|
|
182
183
|
- [SchematicLayoutError](#schematiclayouterror)
|
|
@@ -194,11 +195,21 @@ https://github.com/user-attachments/assets/2f28b7ba-689e-4d80-85b2-5bdef84b41f8
|
|
|
194
195
|
- [SchematicTrace](#schematictrace)
|
|
195
196
|
- [SchematicVoltageProbe](#schematicvoltageprobe)
|
|
196
197
|
- [Simulation Elements](#simulation-elements)
|
|
198
|
+
- [SimulationAcSweepCurrentGraph](#simulationacsweepcurrentgraph)
|
|
199
|
+
- [SimulationAcSweepVoltageGraph](#simulationacsweepvoltagegraph)
|
|
200
|
+
- [SimulationAnalysisResult](#simulationanalysisresult)
|
|
201
|
+
- [SimulationComplexSample](#simulationcomplexsample)
|
|
197
202
|
- [SimulationCurrentProbe](#simulationcurrentprobe)
|
|
198
203
|
- [SimulationCurrentSource](#simulationcurrentsource)
|
|
204
|
+
- [SimulationDcOperatingPointCurrent](#simulationdcoperatingpointcurrent)
|
|
205
|
+
- [SimulationDcOperatingPointVoltage](#simulationdcoperatingpointvoltage)
|
|
206
|
+
- [SimulationDcSweepCurrentGraph](#simulationdcsweepcurrentgraph)
|
|
207
|
+
- [SimulationDcSweepVoltageGraph](#simulationdcsweepvoltagegraph)
|
|
199
208
|
- [SimulationExperiment](#simulationexperiment)
|
|
200
209
|
- [SimulationOpAmp](#simulationopamp)
|
|
201
210
|
- [SimulationOscilloscopeTrace](#simulationoscilloscopetrace)
|
|
211
|
+
- [SimulationParameterSweep](#simulationparametersweep)
|
|
212
|
+
- [SimulationParameterSweepCoordinate](#simulationparametersweepcoordinate)
|
|
202
213
|
- [SimulationSpiceSubcircuit](#simulationspicesubcircuit)
|
|
203
214
|
- [SimulationSwitch](#simulationswitch)
|
|
204
215
|
- [SimulationTransientCurrentGraph](#simulationtransientcurrentgraph)
|
|
@@ -3038,6 +3049,28 @@ interface SchematicDebugPoint {
|
|
|
3038
3049
|
}
|
|
3039
3050
|
```
|
|
3040
3051
|
|
|
3052
|
+
### SchematicElementOutsideSheetWarning
|
|
3053
|
+
|
|
3054
|
+
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/schematic/schematic_element_outside_sheet_warning.ts)
|
|
3055
|
+
|
|
3056
|
+
Warning emitted when a schematic component, net label, or trace extends outside its schematic sheet
|
|
3057
|
+
|
|
3058
|
+
```typescript
|
|
3059
|
+
/** Warning emitted when a schematic component, net label, or trace extends outside its schematic sheet */
|
|
3060
|
+
interface SchematicElementOutsideSheetWarning {
|
|
3061
|
+
type: "schematic_element_outside_sheet_warning"
|
|
3062
|
+
schematic_element_outside_sheet_warning_id: string
|
|
3063
|
+
warning_type: "schematic_element_outside_sheet_warning"
|
|
3064
|
+
message: string
|
|
3065
|
+
schematic_sheet_id: string
|
|
3066
|
+
schematic_element_type:
|
|
3067
|
+
| "schematic_component"
|
|
3068
|
+
| "schematic_net_label"
|
|
3069
|
+
| "schematic_trace"
|
|
3070
|
+
schematic_element_id: string
|
|
3071
|
+
}
|
|
3072
|
+
```
|
|
3073
|
+
|
|
3041
3074
|
### SchematicError
|
|
3042
3075
|
|
|
3043
3076
|
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/schematic/schematic_error.ts)
|
|
@@ -3389,6 +3422,81 @@ interface SchematicVoltageProbe {
|
|
|
3389
3422
|
|
|
3390
3423
|
## Simulation Elements
|
|
3391
3424
|
|
|
3425
|
+
### SimulationAcSweepCurrentGraph
|
|
3426
|
+
|
|
3427
|
+
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_ac_sweep_current_graph.ts)
|
|
3428
|
+
|
|
3429
|
+
```typescript
|
|
3430
|
+
interface SimulationAcSweepCurrentGraph {
|
|
3431
|
+
type: "simulation_ac_sweep_current_graph"
|
|
3432
|
+
simulation_ac_sweep_current_graph_id: string
|
|
3433
|
+
simulation_experiment_id: string
|
|
3434
|
+
simulation_parameter_sweep_coordinate?: SimulationParameterSweepCoordinate
|
|
3435
|
+
simulation_current_probe_id: string
|
|
3436
|
+
frequencies_hz: number[]
|
|
3437
|
+
complex_currents: SimulationComplexSample[]
|
|
3438
|
+
name?: string
|
|
3439
|
+
color?: string
|
|
3440
|
+
}
|
|
3441
|
+
```
|
|
3442
|
+
|
|
3443
|
+
### SimulationAcSweepVoltageGraph
|
|
3444
|
+
|
|
3445
|
+
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_ac_sweep_voltage_graph.ts)
|
|
3446
|
+
|
|
3447
|
+
```typescript
|
|
3448
|
+
interface SimulationAcSweepVoltageGraph {
|
|
3449
|
+
type: "simulation_ac_sweep_voltage_graph"
|
|
3450
|
+
simulation_ac_sweep_voltage_graph_id: string
|
|
3451
|
+
simulation_experiment_id: string
|
|
3452
|
+
simulation_parameter_sweep_coordinate?: SimulationParameterSweepCoordinate
|
|
3453
|
+
simulation_voltage_probe_id: string
|
|
3454
|
+
frequencies_hz: number[]
|
|
3455
|
+
complex_voltages: SimulationComplexSample[]
|
|
3456
|
+
name?: string
|
|
3457
|
+
color?: string
|
|
3458
|
+
}
|
|
3459
|
+
```
|
|
3460
|
+
|
|
3461
|
+
### SimulationAnalysisResult
|
|
3462
|
+
|
|
3463
|
+
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_analysis_result.ts)
|
|
3464
|
+
|
|
3465
|
+
```typescript
|
|
3466
|
+
type SimulationAnalysisResult =
|
|
3467
|
+
| SimulationVoltageAnalysisResult
|
|
3468
|
+
| SimulationCurrentAnalysisResult
|
|
3469
|
+
|
|
3470
|
+
type SimulationNonTransientVoltageAnalysisResult =
|
|
3471
|
+
| SimulationDcOperatingPointVoltage
|
|
3472
|
+
| SimulationDcSweepVoltageGraph
|
|
3473
|
+
| SimulationAcSweepVoltageGraph
|
|
3474
|
+
|
|
3475
|
+
type SimulationNonTransientCurrentAnalysisResult =
|
|
3476
|
+
| SimulationDcOperatingPointCurrent
|
|
3477
|
+
| SimulationDcSweepCurrentGraph
|
|
3478
|
+
| SimulationAcSweepCurrentGraph
|
|
3479
|
+
|
|
3480
|
+
type SimulationVoltageAnalysisResult =
|
|
3481
|
+
| SimulationTransientVoltageGraph
|
|
3482
|
+
| SimulationNonTransientVoltageAnalysisResult
|
|
3483
|
+
|
|
3484
|
+
type SimulationCurrentAnalysisResult =
|
|
3485
|
+
| SimulationTransientCurrentGraph
|
|
3486
|
+
| SimulationNonTransientCurrentAnalysisResult
|
|
3487
|
+
```
|
|
3488
|
+
|
|
3489
|
+
### SimulationComplexSample
|
|
3490
|
+
|
|
3491
|
+
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_complex_sample.ts)
|
|
3492
|
+
|
|
3493
|
+
```typescript
|
|
3494
|
+
interface SimulationComplexSample {
|
|
3495
|
+
re: number
|
|
3496
|
+
im: number
|
|
3497
|
+
}
|
|
3498
|
+
```
|
|
3499
|
+
|
|
3392
3500
|
### SimulationCurrentProbe
|
|
3393
3501
|
|
|
3394
3502
|
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_current_probe.ts)
|
|
@@ -3430,6 +3538,8 @@ interface SimulationDcCurrentSource {
|
|
|
3430
3538
|
negative_source_port_id?: string
|
|
3431
3539
|
negative_source_net_id?: string
|
|
3432
3540
|
current: number
|
|
3541
|
+
ac_magnitude?: number
|
|
3542
|
+
ac_phase?: number
|
|
3433
3543
|
}
|
|
3434
3544
|
|
|
3435
3545
|
/** Defines an AC current source for simulation purposes. */
|
|
@@ -3447,6 +3557,80 @@ interface SimulationAcCurrentSource {
|
|
|
3447
3557
|
wave_shape?: WaveShape
|
|
3448
3558
|
phase?: number
|
|
3449
3559
|
duty_cycle?: number
|
|
3560
|
+
ac_magnitude?: number
|
|
3561
|
+
ac_phase?: number
|
|
3562
|
+
}
|
|
3563
|
+
```
|
|
3564
|
+
|
|
3565
|
+
### SimulationDcOperatingPointCurrent
|
|
3566
|
+
|
|
3567
|
+
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_dc_operating_point_current.ts)
|
|
3568
|
+
|
|
3569
|
+
```typescript
|
|
3570
|
+
interface SimulationDcOperatingPointCurrent {
|
|
3571
|
+
type: "simulation_dc_operating_point_current"
|
|
3572
|
+
simulation_dc_operating_point_current_id: string
|
|
3573
|
+
simulation_experiment_id: string
|
|
3574
|
+
simulation_parameter_sweep_coordinate?: SimulationParameterSweepCoordinate
|
|
3575
|
+
simulation_current_probe_id: string
|
|
3576
|
+
current: number
|
|
3577
|
+
name?: string
|
|
3578
|
+
color?: string
|
|
3579
|
+
}
|
|
3580
|
+
```
|
|
3581
|
+
|
|
3582
|
+
### SimulationDcOperatingPointVoltage
|
|
3583
|
+
|
|
3584
|
+
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_dc_operating_point_voltage.ts)
|
|
3585
|
+
|
|
3586
|
+
```typescript
|
|
3587
|
+
interface SimulationDcOperatingPointVoltage {
|
|
3588
|
+
type: "simulation_dc_operating_point_voltage"
|
|
3589
|
+
simulation_dc_operating_point_voltage_id: string
|
|
3590
|
+
simulation_experiment_id: string
|
|
3591
|
+
simulation_parameter_sweep_coordinate?: SimulationParameterSweepCoordinate
|
|
3592
|
+
simulation_voltage_probe_id: string
|
|
3593
|
+
voltage: number
|
|
3594
|
+
name?: string
|
|
3595
|
+
color?: string
|
|
3596
|
+
}
|
|
3597
|
+
```
|
|
3598
|
+
|
|
3599
|
+
### SimulationDcSweepCurrentGraph
|
|
3600
|
+
|
|
3601
|
+
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_dc_sweep_current_graph.ts)
|
|
3602
|
+
|
|
3603
|
+
```typescript
|
|
3604
|
+
interface SimulationDcSweepCurrentGraph {
|
|
3605
|
+
type: "simulation_dc_sweep_current_graph"
|
|
3606
|
+
simulation_dc_sweep_current_graph_id: string
|
|
3607
|
+
simulation_experiment_id: string
|
|
3608
|
+
simulation_parameter_sweep_coordinate?: SimulationParameterSweepCoordinate
|
|
3609
|
+
simulation_current_probe_id: string
|
|
3610
|
+
sweep_values: number[]
|
|
3611
|
+
sweep_unit: SimulationDcSweepUnit
|
|
3612
|
+
current_levels: number[]
|
|
3613
|
+
name?: string
|
|
3614
|
+
color?: string
|
|
3615
|
+
}
|
|
3616
|
+
```
|
|
3617
|
+
|
|
3618
|
+
### SimulationDcSweepVoltageGraph
|
|
3619
|
+
|
|
3620
|
+
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_dc_sweep_voltage_graph.ts)
|
|
3621
|
+
|
|
3622
|
+
```typescript
|
|
3623
|
+
interface SimulationDcSweepVoltageGraph {
|
|
3624
|
+
type: "simulation_dc_sweep_voltage_graph"
|
|
3625
|
+
simulation_dc_sweep_voltage_graph_id: string
|
|
3626
|
+
simulation_experiment_id: string
|
|
3627
|
+
simulation_parameter_sweep_coordinate?: SimulationParameterSweepCoordinate
|
|
3628
|
+
simulation_voltage_probe_id: string
|
|
3629
|
+
sweep_values: number[]
|
|
3630
|
+
sweep_unit: SimulationDcSweepUnit
|
|
3631
|
+
voltage_levels: number[]
|
|
3632
|
+
name?: string
|
|
3633
|
+
color?: string
|
|
3450
3634
|
}
|
|
3451
3635
|
```
|
|
3452
3636
|
|
|
@@ -3464,6 +3648,17 @@ interface SimulationExperiment {
|
|
|
3464
3648
|
start_time_ms?: number // ms
|
|
3465
3649
|
end_time_ms?: number // ms
|
|
3466
3650
|
spice_options?: SpiceSimulationOptions
|
|
3651
|
+
dc_sweep_voltage_source_id?: string
|
|
3652
|
+
dc_sweep_current_source_id?: string
|
|
3653
|
+
dc_sweep_start?: number
|
|
3654
|
+
dc_sweep_stop?: number
|
|
3655
|
+
dc_sweep_step?: number
|
|
3656
|
+
dc_sweep_unit?: "V" | "A"
|
|
3657
|
+
ac_sweep_type?: "linear" | "decade" | "octave"
|
|
3658
|
+
ac_samples_per_interval?: number
|
|
3659
|
+
ac_sample_count?: number
|
|
3660
|
+
ac_start_frequency_hz?: number
|
|
3661
|
+
ac_stop_frequency_hz?: number
|
|
3467
3662
|
}
|
|
3468
3663
|
|
|
3469
3664
|
interface SpiceSimulationOptions {
|
|
@@ -3522,6 +3717,60 @@ interface SimulationOscilloscopeTrace {
|
|
|
3522
3717
|
}
|
|
3523
3718
|
```
|
|
3524
3719
|
|
|
3720
|
+
### SimulationParameterSweep
|
|
3721
|
+
|
|
3722
|
+
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_parameter_sweep.ts)
|
|
3723
|
+
|
|
3724
|
+
```typescript
|
|
3725
|
+
type SimulationParameterSweep =
|
|
3726
|
+
| SimulationResistanceParameterSweep
|
|
3727
|
+
| SimulationCapacitanceParameterSweep
|
|
3728
|
+
| SimulationInductanceParameterSweep
|
|
3729
|
+
| SimulationVoltageParameterSweep
|
|
3730
|
+
| SimulationCurrentParameterSweep
|
|
3731
|
+
|
|
3732
|
+
interface SimulationResistanceParameterSweep
|
|
3733
|
+
extends SimulationParameterSweepBase {
|
|
3734
|
+
parameter_type: "resistance"
|
|
3735
|
+
resistor_source_component_id: string
|
|
3736
|
+
}
|
|
3737
|
+
|
|
3738
|
+
interface SimulationCapacitanceParameterSweep
|
|
3739
|
+
extends SimulationParameterSweepBase {
|
|
3740
|
+
parameter_type: "capacitance"
|
|
3741
|
+
capacitor_source_component_id: string
|
|
3742
|
+
}
|
|
3743
|
+
|
|
3744
|
+
interface SimulationInductanceParameterSweep
|
|
3745
|
+
extends SimulationParameterSweepBase {
|
|
3746
|
+
parameter_type: "inductance"
|
|
3747
|
+
inductor_source_component_id: string
|
|
3748
|
+
}
|
|
3749
|
+
|
|
3750
|
+
interface SimulationVoltageParameterSweep extends SimulationParameterSweepBase {
|
|
3751
|
+
parameter_type: "voltage"
|
|
3752
|
+
source_net_id: string
|
|
3753
|
+
}
|
|
3754
|
+
|
|
3755
|
+
interface SimulationCurrentParameterSweep extends SimulationParameterSweepBase {
|
|
3756
|
+
parameter_type: "current"
|
|
3757
|
+
current_source_component_id: string
|
|
3758
|
+
}
|
|
3759
|
+
```
|
|
3760
|
+
|
|
3761
|
+
### SimulationParameterSweepCoordinate
|
|
3762
|
+
|
|
3763
|
+
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_parameter_sweep_coordinate.ts)
|
|
3764
|
+
|
|
3765
|
+
```typescript
|
|
3766
|
+
interface SimulationParameterSweepCoordinate {
|
|
3767
|
+
simulation_parameter_sweep_id: string
|
|
3768
|
+
sweep_index: number
|
|
3769
|
+
parameter_value: number
|
|
3770
|
+
parameter_unit: SimulationParameterUnit
|
|
3771
|
+
}
|
|
3772
|
+
```
|
|
3773
|
+
|
|
3525
3774
|
### SimulationSpiceSubcircuit
|
|
3526
3775
|
|
|
3527
3776
|
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_spice_subcircuit.ts)
|
|
@@ -3570,6 +3819,7 @@ interface SimulationTransientCurrentGraph {
|
|
|
3570
3819
|
type: "simulation_transient_current_graph"
|
|
3571
3820
|
simulation_transient_current_graph_id: string
|
|
3572
3821
|
simulation_experiment_id: string
|
|
3822
|
+
simulation_parameter_sweep_coordinate?: SimulationParameterSweepCoordinate
|
|
3573
3823
|
timestamps_ms?: number[]
|
|
3574
3824
|
current_levels: number[]
|
|
3575
3825
|
source_component_id?: string
|
|
@@ -3591,6 +3841,7 @@ interface SimulationTransientVoltageGraph {
|
|
|
3591
3841
|
type: "simulation_transient_voltage_graph"
|
|
3592
3842
|
simulation_transient_voltage_graph_id: string
|
|
3593
3843
|
simulation_experiment_id: string
|
|
3844
|
+
simulation_parameter_sweep_coordinate?: SimulationParameterSweepCoordinate
|
|
3594
3845
|
timestamps_ms?: number[]
|
|
3595
3846
|
voltage_levels: number[]
|
|
3596
3847
|
source_component_id?: string
|
|
@@ -3662,6 +3913,8 @@ interface SimulationDcVoltageSource {
|
|
|
3662
3913
|
negative_source_port_id?: string
|
|
3663
3914
|
negative_source_net_id?: string
|
|
3664
3915
|
voltage: number
|
|
3916
|
+
ac_magnitude?: number
|
|
3917
|
+
ac_phase?: number
|
|
3665
3918
|
}
|
|
3666
3919
|
|
|
3667
3920
|
/** Defines an AC voltage source for simulation purposes. */
|
|
@@ -3684,6 +3937,8 @@ interface SimulationAcVoltageSource {
|
|
|
3684
3937
|
fall_time?: number // ms
|
|
3685
3938
|
pulse_width?: number // ms
|
|
3686
3939
|
period?: number // ms
|
|
3940
|
+
ac_magnitude?: number
|
|
3941
|
+
ac_phase?: number
|
|
3687
3942
|
}
|
|
3688
3943
|
```
|
|
3689
3944
|
|