Profile
Back to NewsBack
GitHub Trending 22 min
Reader Mode
tscircuit/circuit-json: Circuit JSON a low-level circuit representation. Visually represent schematic, PCB, produce Gerber files, produce bill of materials, run SPICE simulations, view warnings and more.

tscircuit/circuit-json: Circuit JSON a low-level circuit representation. Visually represent schematic, PCB, produce Gerber files, produce bill of materials, run SPICE simulations, view warnings and more.

Circuit JSON Specification circuit-json

Circuit JSON a low-level JSON-array circuit representation. It contains all the information needed to visually represent a schematic, PCB, produce Gerber files, produce bill of materials, run SPICE simulations, view warnings and more. It is designed to easily interoperate with a SQL database.

tscircuit · discord · online circuit json viewer · example.json · Introduction to Circuit JSON Video

npm version</a>

You can think of Circuit JSON as a big JSON array of "Circuit Elements", each element can have references to other elements, for example a source_component has a corresponding pcb_component representation, which has a corresponding set of pcb_ports and is connected via pcb_traces.

If you generated Circuit JSON, you can use a wide range of utilities and libraries provided by tscircuit. For example, if you want to autoroute a PCB, you could use Circuit JSON as an input to the tscircuit dsn-converter to generate a DSN file for freerouting, you could then read the DSN file back to Circuit JSON.

This module has the zod definitions and conversion functions for using circuit json, and is the primary way that Circuit JSON is defined and maintained.

https://github.com/user-attachments/assets/2f28b7ba-689e-4d80-85b2-5bdef84b41f8

To quickly generate Circuit JSON with tscircuit, use tscircuit/eval

Things You Can Do With Circuit JSON

Table of Contents

- Things You Can Do With Circuit JSON - Typescript Usage

- Source Components - SourceAmbiguousPortReference - SourceBoard - SourceBus - SourceComponentAvailabilityWarning - SourceComponentBase - SourceComponentInternalConnection - SourceComponentMisconfiguredError - SourceComponentPinsUnderspecifiedWarning - SourceConfusingNetNameWarning - SourceDatasheet - SourceFailedToCreateComponentError - SourceGroup - SourceI2cMisconfiguredError - SourceInterconnect - SourceInvalidComponentPropertyError - SourceManuallyPlacedVia - SourceMissingManufacturerPartNumberWarning - SourceMissingPropertyError - SourceMotor - SourceNet - SourceNoGroundPinDefinedWarning - SourceNoPowerPinDefinedWarning - SourcePartNotFoundWarning - SourcePcbGroundPlane - SourcePinAttributes - SourcePinMissingTraceWarning - SourcePinMustBeConnectedError - SourcePort - SourcePrintedPart - SourceProjectMetadata - SourcePropertyIgnoredWarning - SourceRefdesConventionWarning - SourceRuntimeError - SourceSimpleAmmeter - SourceSimpleBattery - SourceSimpleCapacitor - SourceSimpleChip - SourceSimpleConnector - SourceSimpleCrystal - SourceSimpleCurrentSource - SourceSimpleDiode - SourceSimpleFiducial - SourceSimpleFuse - SourceSimpleGround - SourceSimpleInductor - SourceSimpleLed - SourceSimpleMosfet - SourceSimpleOpAmp - SourceSimplePinHeader - SourceSimplePinout - SourceSimplePotentiometer - SourceSimplePowerSource - SourceSimplePushButton - SourceSimpleResistor - SourceSimpleResonator - SourceSimpleSwitch - SourceSimpleTestPoint - SourceSimpleTransistor - SourceSimpleVoltageProbe - SourceSimpleVoltageSource - SourceSubassembly - SourceTrace - SourceTraceNotConnectedError - SourceUnnamedTraceWarning - UnknownErrorFindingPart - CAD Components - CadAssemblyBomItem - CadCable - CadCollisionError - CadComponent - CadExplosionMove - CadExplosionStage - CadReferenceSurface - PCB Elements - PcbAutoroutingError - PcbBend - PcbBoard - PcbBreakoutPoint - PcbBusLengthSkewError - PcbBusRoutingConstraintError - PcbBusRoutingConstraintWarning - PcbComponent - PcbComponentInvalidLayerError - PcbComponentMissingCourtyardWarning - PcbComponentNotOnBoardEdgeError - PcbComponentOutsideBoardError - PcbConnectorNotInAccessibleOrientationWarning - PcbCopperPour - PcbCopperText - PcbCourtyardCircle - PcbCourtyardOutline - PcbCourtyardOverlapError - PcbCourtyardPill - PcbCourtyardPolygon - PcbCourtyardRect - PcbCutout - PcbDebugObject - PcbFabricationNoteDimension - PcbFabricationNotePath - PcbFabricationNoteRect - PcbFabricationNoteText - PcbFabricatorExtraChargeWarning - PcbFootprintOverlapError - PcbGroundPlane - PcbGroundPlaneRegion - PcbGroup - PcbHole - PcbKeepout - PcbKeepoutOverlapWarning - PcbManualEditConflictWarning - PcbMissingFootprintError - PcbNet - PcbNoteDimension - PcbNoteLine - PcbNotePath - PcbNoteRect - PcbNoteText - PcbPackingError - PcbPadPadClearanceError - PcbPadTraceClearanceError - PcbPanel - PcbPanelizationPlacementError - PcbPin1Location - PcbPlacementError - PcbPlatedHole - PcbPort - PcbPortNotConnectedError - PcbPortNotMatchedError - PcbPreflightRoutingError - PcbQuoteEstimate - PcbRouteHints - PcbSilkscreenCircle - PcbSilkscreenGraphic - PcbSilkscreenLine - PcbSilkscreenOval - PcbSilkscreenPath - PcbSilkscreenPill - PcbSilkscreenRect - PcbSilkscreenText - PcbSoldermaskOpening - PcbSolderPaste - PcbStackup - PcbStiffener - PcbText - PcbThermalSpoke - PcbTrace - PcbTraceError - PcbTraceHint - PcbTraceMissingError - PcbTraceStyleWarning - PcbTraceTooLongError - PcbTraceTooLongWarning - PcbTraceTooManyViasWarning - PcbTraceWarning - PcbVia - PcbViaClearanceError - PcbViaTraceClearanceError - Schematic Elements - SchematicArc - SchematicBox - SchematicCircle - SchematicComponent - SchematicComponentOverlapWarning - SchematicComponentStylingWarning - SchematicDebugObject - SchematicElementOutsideSheetWarning - SchematicError - SchematicGraphic - SchematicGroup - SchematicLayoutError - SchematicLine - SchematicManualEditConflictWarning - SchematicMissingSheetWarning - SchematicNetLabel - SchematicPath - SchematicPort - SchematicRect - SchematicSheet - SchematicSheetStylingWarning - SchematicSymbol - SchematicTable - SchematicTableCell - SchematicText - SchematicTextPart - SchematicTrace - SchematicVoltageProbe - Simulation Elements - SimulationAcSweepCurrentGraph - SimulationAcSweepVoltageGraph - SimulationAnalysisResult - SimulationComplexSample - SimulationCurrentProbe - SimulationCurrentSource - SimulationDcOperatingPointCurrent - SimulationDcOperatingPointVoltage - SimulationDcSweepCurrentGraph - SimulationDcSweepVoltageGraph - SimulationExperiment - SimulationOpAmp - SimulationOscilloscopeTrace - SimulationParameterSweep - SimulationParameterSweepCoordinate - SimulationPcbReturnCurrentField - SimulationPcbReturnCurrentHeatmap - SimulationPcbReturnCurrentMarker - SimulationPcbReturnCurrentResult - SimulationReturnCurrentContact - SimulationReturnCurrentExcitation - SimulationReturnCurrentGridJson - SimulationSpiceSubcircuit - SimulationSwitch - SimulationTerminalPort - SimulationTransientCurrentGraph - SimulationTransientVoltageGraph - SimulationUnknownExperimentError - SimulationVoltageProbe - SimulationVoltageSource - Drawing Elements - DrawingDimensionLine - DrawingPage - DrawingPageTitleBlock - DrawingPartView

- System Block Elements - SystemBlockComponent - SystemBlockConnection - SystemBlockGroup - SystemBlockPage - SystemBlockRoutePoint

Typescript Usage

import { any_circuit_element, simple_source_resistor } from "circuit-json"
import type { SourceSimpleResistor } from "circuit-json"

const resistor: SourceSimpleResistor = simple_source_resistor.parse({ type: "source_component", ftype: "simple_resistor", source_component_id: "source_component_1", name: "R1", resistane: "1k", })

console.log(resistor.resistance) // 1000

// This is the common way to parse/transform any element any_circuit_element.parse({/ ... /})

Base Units

When there is not a string unit provided, tscircuit assumes the a "base unit" is used.

You can specify circuit json with string units to avoid ambiguity around units, for example by specifying { max_trace_length: "100mm" } avoids needing to know the base unit. However if a number is specified, it should be in the base units in the table below. In this case { max_trace_length: 100 } is equivalent.

The default units when reading a number are defined as follows:

| Measurement Type | Base Unit | Description | | ---------------- | --------- | ------------------ | | Length | mm | Millimeters | | Duration | ms | Milliseconds | | Timestamp | string | ISO 8601 Timestamp | | Mass | g | Grams | | Angle | deg | Degrees | | Frequency | Hz | Hertz | | Volume | ml | Milliliters | | Voltage | V | Volts | | Current | A | Amperes | | Resistance | Ω | Ohms | | Capacitance | F | Farads | | Inductance | H | Henries |

Element Prefixes

Element prefixes are used to separate data that's used in different contexts. This allows developers who use Circuit JSON to develop partial implementations with smaller targets in mind. It can also help simplify JSON elements because schematic and pcb information is not contained in the same object.

A single (in tscircuit) will have a corresponding source_component, schematic_component and pcb_component, as well as other elements that may be necessary to represent it.

There are 3 main element prefixes:

  • source_ - e.g. source_component An element that contains information from whatever originally defined the entity. You can think of this as a non-target representations.
- For example, you might have supplier_part_numbers as a property here, since that is not strictly related to the pcb or the schematic. - This category sometimes contains information that is relevant to both the pcb and the schematic - This is a somewhat a "Miscellaneous" category, because it contains things from the source definition that we wouldn't want to lose.
  • pcb_ - e.g. pcb_component, pcb_port. Anything required to render the PCB
  • schematic_ - e.g. schematic_component. Anything required to render the Schematic
The system_block_ prefix describes resolved system block diagrams, including page bounds, block/group geometry, and routed logical connections.

Source Components

SourceAmbiguousPortReference

Source

/** Error emitted when a port hint matches multiple non-overlapping pads,
  making the port reference ambiguous (e.g. multiple pads all named "SH" /
interface SourceAmbiguousPortReference extends BaseCircuitJsonError {
  type: "source_ambiguous_port_reference"
  source_ambiguous_port_reference_id: string
  error_type: "source_ambiguous_port_reference"
  source_port_id?: string
  source_component_id?: string
}

SourceBoard

Source

Defines a board in the source domain

/* Defines a board in the source domain /
interface SourceBoard {
  type: "source_board"
  source_board_id: string
  source_group_id: string
  title?: string
}

SourceBus

Source

A group of resolved source traces with a maximum routed-length difference.

/* A group of resolved source traces with a maximum routed-length difference. /
interface SourceBus {
  type: "source_bus"
  source_bus_id: string
  name?: string
  source_trace_ids: string[]
  /* Maximum difference between the longest and shortest member, in millimeters. /
  max_length_skew?: number
  /* Intended single-ended characteristic impedance, in ohms. /
  target_impedance?: number
  /* Intended differential characteristic impedance, in ohms. /
  target_differential_impedance?: number
  /* Ordered polarity for a resolved point-to-point differential pair. /
  differential_pair?: {
    positive_source_trace_id: string
    negative_source_trace_id: string
    trace_gap?: number
    max_uncoupled_length?: number
  }
  /* Additional traces for length comparison, without changing electrical membership. /
  length_match_source_trace_ids?: string[]
  min_length?: SourceBusRouteLength
  max_length?: SourceBusRouteLength
  target_length?: SourceBusRouteLength
  length_tolerance?: number
  /* Within this bus, excluding declared differential partners. /
  pcb_trace_spacing?: SourceBusTraceSpacing
  /* To all signals outside this bus or pair. /
  pcb_spacing_to_other_signals?: SourceBusTraceSpacing
  target_impedance_min?: number
  target_impedance_max?: number
  target_differential_impedance_min?: number
  target_differential_impedance_max?: number
  subcircuit_id?: string
}

/** A routed length in mm, or an offset from the longest endpoint Manhattan distance. * Explicit references are resolved source traces; omitted references use the bus members and length_match_source_trace_ids. / type SourceBusRouteLength = | number | { reference: "longest_manhattan" source_trace_ids?: string[] offset?: number }

/* Centerline separation in mm or a multiple of the larger local trace width. / type SourceBusTraceSpacing = number | { width_multiplier: number }

SourceComponentAvailabilityWarning

Source

Warning emitted when no supplier alternative can be confirmed in stock.

/* Warning emitted when no supplier alternative can be confirmed in stock. /
interface SourceComponentAvailabilityWarning {
  type: "source_component_availability_warning"
  source_component_availability_warning_id: string
  warning_type: "source_component_availability_warning"
  message: string
  source_component_id: string
  subcircuit_id?: string
  supplier_name: SupplierName
  supplier_part_numbers: [string, ...string[]]
}

SourceComponentBase

Source

interface SourceComponentBase {
  type: "source_component"
  ftype?: string
  source_component_id: string
  name: string
  manufacturer_part_number?: string
  supplier_part_numbers?: Partial<Record<SupplierName, string[]>>
  display_value?: string
  display_name?: string
  are_pins_interchangeable?: boolean
  internally_connected_source_port_ids?: string[][]
  source_group_id?: string
  subcircuit_id?: string
}

SourceComponentInternalConnection

Source

interface SourceComponentInternalConnection {
  type: "source_component_internal_connection"
  source_component_internal_connection_id: string
  source_component_id: string
  source_port_ids: string[]
  subcircuit_id?: string
}

SourceComponentMisconfiguredError

Source

Error emitted when one or more source components have an invalid or conflicting configuration

/* Error emitted when one or more source components have an invalid or conflicting configuration /
interface SourceComponentMisconfiguredError extends BaseCircuitJsonError {
  type: "source_component_misconfigured_error"
  source_component_misconfigured_error_id: string
  error_type: "source_component_misconfigured_error"
  source_component_ids: string[]
  source_port_ids?: string[]
}

SourceComponentPinsUnderspecifiedWarning

Source

Warning emitted when all ports on a source component are underspecified

/* Warning emitted when all ports on a source component are underspecified /
interface SourceComponentPinsUnderspecifiedWarning {
  type: "source_component_pins_underspecified_warning"
  source_component_pins_underspecified_warning_id: string
  warning_type: "source_component_pins_underspecified_warning"
  message: string
  source_component_id: string
  source_port_ids: string[]
  subcircuit_id?: string
}

SourceConfusingNetNameWarning

Source

Warning emitted when electrically disconnected source nets share a name

/* Warning emitted when electrically disconnected source nets share a name /
interface SourceConfusingNetNameWarning {
  type: "source_confusing_net_name_warning"
  source_confusing_net_name_warning_id: string
  warning_type: "source_confusing_net_name_warning"
  message: string
  source_net_ids: string[]
  net_name: string
  subcircuit_id?: string
}

SourceDatasheet

Source

Datasheet information for a manufacturer part number, supplied with Circuit JSON.

/* Datasheet information for a manufacturer part number, supplied with Circuit JSON. /
interface SourceDatasheet {
  type: "source_datasheet"
  source_datasheet_id: string
  manufacturer_part_number: string
  datasheet_pdf_urls: string[]
  description?: string
}

SourceFailedToCreateComponentError

Source

/** Error emitted when a component fails to be constructed.
  Contains details about the failure and prevents the component from being rendered. /
interface SourceFailedToCreateComponentError extends BaseCircuitJsonError {
  type: "source_failed_to_create_component_error"
  source_failed_to_create_component_error_id: string
  error_type: "source_failed_to_create_component_error"
  component_name?: string
  subcircuit_id?: string
  parent_source_component_id?: string
  pcb_center?: {
    x?: number
    y?: number
  }
  schematic_center?: {
    x?: number
    y?: number
  }
}

SourceGroup

Source

interface SourceGroup {
  type: "source_group"
  source_group_id: string
  subcircuit_id?: string
  parent_subcircuit_id?: string
  parent_source_group_id?: string
  is_subcircuit?: boolean
  show_as_schematic_box?: boolean
  name?: string
  was_automatically_named?: boolean
}

SourceI2cMisconfiguredError

Source

Error emitted when incompatible I2C pins (e.g. SDA and SCL) are connected to the same net

/* Error emitted when incompatible I2C pins (e.g. SDA and SCL) are connected to the same net /
interface SourceI2cMisconfiguredError extends BaseCircuitJsonError {
  type: "source_i2c_misconfigured_error"
  source_i2c_misconfigured_error_id: string
  error_type: "source_i2c_misconfigured_error"
  source_port_ids: string[]
}

SourceInterconnect

Source

Defines a generic interconnect component

/* Defines a generic interconnect component /
interface SourceInterconnect extends SourceComponentBase {
  ftype: "interconnect"
}

SourceInvalidComponentPropertyError

Source

The source component property is invalid

/* The source component property is invalid /
interface SourceInvalidComponentPropertyError extends BaseCircuitJsonError {
  type: "source_invalid_component_property_error"
  source_invalid_component_property_error_id: string
  source_component_id: string
  property_name: string
  property_value?: unknown
  expected_format?: string
  subcircuit_id?: string
  error_type: "source_invalid_component_property_error"
}

SourceManuallyPlacedVia

Source

Defines a via that is manually placed in the source domain

/* Defines a via that is manually placed in the source domain /
interface SourceManuallyPlacedVia {
  type: "source_manually_placed_via"
  source_manually_placed_via_id: string
  source_group_id: string
  source_net_id?: string
  subcircuit_id?: string
  source_trace_id?: string
}

SourceMissingManufacturerPartNumberWarning

Source

Warning emitted when a source component is missing its manufacturer part number

/* Warning emitted when a source component is missing its manufacturer part number /
interface SourceMissingManufacturerPartNumberWarning {
  type: "source_missing_manufacturer_part_number_warning"
  source_missing_manufacturer_part_number_warning_id: string
  warning_type: "source_missing_manufacturer_part_number_warning"
  message: string
  source_component_id: string
  standard?: string
  subcircuit_id?: string
}

SourceMissingPropertyError

Source

The source code is missing a property

/* The source code is missing a property /
interface SourceMissingPropertyError extends BaseCircuitJsonError {
  type: "source_missing_property_error"
  source_missing_property_error_id: string
  source_component_id: string
  property_name: string
  subcircuit_id?: string
  error_type: "source_missing_property_error"
}

SourceMotor

Source

Defines a motor component.

/* Defines a motor component. /
interface SourceMotor extends SourceComponentBase {
  ftype: "motor"
}

SourceNet

Source

interface SourceNet {
  type: "source_net"
  source_net_id: string
  name: string
  member_source_group_ids: string[]
  is_power?: boolean
  is_ground?: boolean
  is_digital_signal?: boolean
  is_analog_signal?: boolean
  is_positive_voltage_source?: boolean
  trace_width?: number
  subcircuit_id?: string
  subcircuit_connectivity_map_key?: string
}

SourceNoGroundPinDefinedWarning

Source

Warning emitted when a chip has no source ports marked as ground pins

/* Warning emitted when a chip has no source ports marked as ground pins /
interface SourceNoGroundPinDefinedWarning {
  type: "source_no_ground_pin_defined_warning"
  source_no_ground_pin_defined_warning_id: string
  warning_type: "source_no_ground_pin_defined_warning"
  message: string
  source_component_id: string
  source_port_ids: string[]
  subcircuit_id?: string
}

SourceNoPowerPinDefinedWarning

Source

Warning emitted when a chip has no source ports with requires_power=true

/* Warning emitted when a chip has no source ports with requires_power=true /
interface SourceNoPowerPinDefinedWarning {
  type: "source_no_power_pin_defined_warning"
  source_no_power_pin_defined_warning_id: string
  warning_type: "source_no_power_pin_defined_warning"
  message: string
  source_component_id: string
  source_port_ids: string[]
  subcircuit_id?: string
}

SourcePartNotFoundWarning

Source

Warning emitted when a requested part can not be found

/* Warning emitted when a requested part can not be found /
interface SourcePartNotFoundWarning {
  type: "source_part_not_found_warning"
  source_part_not_found_warning_id: string
  warning_type: "source_part_not_found_warning"
  message: string
  source_component_id?: string
  subcircuit_id?: string
  supplier_name?: SupplierName
  manufacturer_part_number?: string
  supplier_part_number?: string
  part_name?: string
}

SourcePcbGroundPlane

Source

Defines a ground plane in the source domain

/* Defines a ground plane in the source domain /
interface SourcePcbGroundPlane {
  type: "source_pcb_ground_plane"
  source_pcb_ground_plane_id: string
  source_group_id: string
  source_net_id: string
  subcircuit_id?: string
}

SourcePinAttributes

Source

Allowed relative deviation from requires_voltage, e.g. 0.05 for ±5%.

interface SourcePinAttributes {
  is_input?: boolean
  is_output?: boolean
  is_bidirectional?: boolean
  is_passive?: boolean
  can_use_tri_state?: boolean
  is_using_tri_state?: boolean
  can_use_open_collector?: boolean
  is_using_open_collector?: boolean
  can_use_open_emitter?: boolean
  is_using_open_emitter?: boolean
  is_gpio?: boolean
  highlight_color?: string
  must_be_connected?: boolean
  provides_power?: boolean
  requires_power?: boolean
  provides_ground?: boolean
  requires_ground?: boolean
  provides_voltage?: number
  requires_voltage?: number
  /* Allowed relative deviation from requires_voltage, e.g. 0.05 for ±5%. /
  required_voltage_tolerance?: number
  do_not_connect?: boolean
  include_in_board_pinout?: boolean
  can_use_internal_pullup?: boolean
  is_using_internal_pullup?: boolean
  needs_external_pullup?: boolean
  can_use_internal_pulldown?: boolean
  is_using_internal_pulldown?: boolean
  needs_external_pulldown?: boolean
  can_use_open_drain?: boolean
  is_using_open_drain?: boolean
  can_use_push_pull?: boolean
  is_using_push_pull?: boolean
  should_have_decoupling_capacitor?: boolean
  recommended_decoupling_capacitor_capacitance?: string | number
  is_configured_for_i2c_sda?: boolean
  is_configured_for_i2c_scl?: boolean
  is_configured_for_spi_mosi?: boolean
  is_configured_for_spi_miso?: boolean
  is_configured_for_spi_sck?: boolean
  is_configured_for_spi_cs?: boolean
  is_configured_for_uart_tx?: boolean
  is_configured_for_uart_rx?: boolean
  supports_i2c_sda?: boolean
  supports_i2c_scl?: boolean
  supports_spi_mosi?: boolean
  supports_spi_miso?: boolean
  supports_spi_sck?: boolean
  supports_spi_cs?: boolean
  supports_uart_tx?: boolean
  supports_uart_rx?: boolean
}

SourcePinMissingTraceWarning

Source

Warning emitted when a source component pin is missing a trace connection

/* Warning emitted when a source component pin is missing a trace connection /
interface SourcePinMissingTraceWarning {
  type: "source_pin_missing_trace_warning"
  source_pin_missing_trace_warning_id: string
  warning_type: "source_pin_missing_trace_warning"
  message: string
  source_component_id: string
  source_port_id: string
  subcircuit_id?: string
}

SourcePinMustBeConnectedError

Source

Error emitted when a pin with mustBeConnected attribute is not connected to any trace

/* Error emitted when a pin with mustBeConnected attribute is not connected to any trace /
interface SourcePinMustBeConnectedError extends BaseCircuitJsonError {
  type: "source_pin_must_be_connected_error"
  source_pin_must_be_connected_error_id: string
  error_type: "source_pin_must_be_connected_error"
  source_component_id: string
  source_port_id: string
  subcircuit_id?: string
}

SourcePort

Source

Defines a source port that can be connected to other components

/* Defines a source port that can be connected to other components /
interface SourcePort extends SourcePinAttributes {
  type: "source_port"
  pin_number?: number
  port_hints?: string[]
  name: string
  source_port_id: string
  source_component_id?: string
  source_group_id?: string
  most_frequently_referenced_by_name?: string
  subcircuit_id?: string
  subcircuit_connectivity_map_key?: string
}

SourcePrintedPart

Source

Defines a 3D-printed part in an assembly.

/* Defines a 3D-printed part in an assembly. /
interface SourcePrintedPart extends SourceComponentBase {
  ftype: "printedpart"
  /* Printable material, when specified by the author. /
  material?: "pla" | "petg" | "nylon"
  /* Author-specified print color; also carried on the CAD geometry. /
  color?: string
}

SourceProjectMetadata

Source

interface SourceProjectMetadata {
  type: "source_project_metadata"
  name?: string
  software_used_string?: string
  project_url?: string
  source_filesystem_md5_hash?: string
  created_at?: string // ISO8601 timestamp
}

SourcePropertyIgnoredWarning

Source

The source property was ignored

/* The source property was ignored /
interface SourcePropertyIgnoredWarning {
  type: "source_property_ignored_warning"
  source_property_ignored_warning_id: string
  source_component_id: string
  property_name: string
  subcircuit_id?: string
  error_type: "source_property_ignored_warning"
  message: string
}

SourceRefdesConventionWarning

Source

Warning emitted when a source component reference designator does not match the component type convention

/* Warning emitted when a source component reference designator does not match the component type convention /
interface SourceRefdesConventionWarning {
  type: "source_refdes_convention_warning"
  source_refdes_convention_warning_id: string
  warning_type: "source_refdes_convention_warning"
  message: string
  source_component_id: string
  refdes: string
  source_component_ftype: string
  expected_prefixes: string[]
  actual_prefix?: string
  subcircuit_id?: string
}

SourceRuntimeError

Source

interface SourceRuntimeError extends Pick<
  BaseCircuitJsonError,
  "message" | "error_type"
> {
  type: "source_runtime_error"
  source_runtime_error_id: string
  error_type: "source_runtime_error"
  phase_name?: string
}

SourceSimpleAmmeter

Source

Defines a simple ammeter component for simulation and measurement

/* Defines a simple ammeter component for simulation and measurement /
interface SourceSimpleAmmeter extends SourceComponentBase {
  ftype: "simple_ammeter"
}

SourceSimpleBattery

Source

Defines a simple battery component

/* Defines a simple battery component /
interface SourceSimpleBattery extends SourceComponentBase {
  ftype: "simple_battery"
  capacity: number
}

SourceSimpleCapacitor

Source

Defines a simple capacitor component

/* Defines a simple capacitor component /
interface SourceSimpleCapacitor extends SourceComponentBase {
  ftype: "simple_capacitor"
  capacitance: number
  max_voltage_rating?: number
  display_capacitance?: string
  max_decoupling_trace_length?: number
}

SourceSimpleChip

Source

Defines a simple integrated circuit component

/* Defines a simple integrated circuit component /
interface SourceSimpleChip extends SourceComponentBase {
  ftype: "simple_chip"
}

SourceSimpleConnector

Source

Defines a simple connector component

/* Defines a simple connector component /
interface SourceSimpleConnector extends SourceComponentBase {
  ftype: "simple_connector"
  /* Connector interface or product family, such as usb_c, m2, or jst_ph /
  standard?: SourceSimpleConnectorStandard
  /* Number of electrical circuits in the connector /
  pin_count?: number
}

type SourceSimpleConnectorStandard = (typeof source_simple_connector_standards)[number]

SourceSimpleCrystal

Source

Defines a simple crystal oscillator component

/* Defines a simple crystal oscillator component /
interface SourceSimpleCrystal extends SourceComponentBase {
  ftype: "simple_crystal"
  frequency: number
  display_frequency?: string
  load_capacitance?: number
  display_load_capacitance?: string
  pin_variant?: "two_pin" | "four_pin"
}

SourceSimpleCurrentSource

Source

Defines a simple current source component

/* Defines a simple current source component /
interface SourceSimpleCurrentSource extends SourceComponentBase {
  ftype: "simple_current_source"
  current: number
  frequency?: number
  peak_to_peak_current?: number
  wave_shape: "sine" | "square" | "triangle" | "sawtooth" | "dc"
  phase?: number
  duty_cycle?: number
}

SourceSimpleDiode

Source

Defines a simple diode component

/* Defines a simple diode component /
interface SourceSimpleDiode extends SourceComponentBase {
  ftype: "simple_diode"
}

SourceSimpleFiducial

Source

Defines a simple fiducial component

/* Defines a simple fiducial component /
interface SourceSimpleFiducial extends SourceComponentBase {
  ftype: "simple_fiducial"
}

SourceSimpleFuse

Source

interface SourceSimpleFuse extends SourceComponentBase {
  ftype: "simple_fuse"
  current_rating_amps: number
  voltage_rating_volts: number
}

SourceSimpleGround

Source

Defines a simple ground component

/* Defines a simple ground component /
interface SourceSimpleGround extends SourceComponentBase {
  ftype: "simple_ground"
}

SourceSimpleInductor

Source

Defines a simple inductor component

/* Defines a simple inductor component /
interface SourceSimpleInductor extends SourceComponentBase {
  ftype: "simple_inductor"
  inductance: number
  display_inductance?: string
  max_current_rating?: number
}

SourceSimpleLed

Source

Defines a simple led component

/* Defines a simple led component /
interface SourceSimpleLed extends Omit<SourceSimpleDiode, "ftype"> {
  ftype: "simple_led"
  color?: string
  wavelength?: string
}

SourceSimpleMosfet

Source

/** Defines a simple mosfet component
 * This is a three-pin semiconductor device (source, gate, drain)
  Pin configuration is handled by the schematic port system /
interface SourceSimpleMosfet extends SourceComponentBase {
  ftype: "simple_mosfet"
  channel_type: "n" | "p"
  mosfet_mode: "enhancement" | "depletion"
}

SourceSimpleOpAmp

Source

Defines a simple op-amp component

/* Defines a simple op-amp component /
interface SourceSimpleOpAmp extends SourceComponentBase {
  ftype: "simple_op_amp"
}

SourceSimplePinHeader

Source

interface SourceSimplePinHeader extends SourceComponentBase {
  ftype: "simple_pin_header"
  pin_count: number
  gender: "male" | "female"
}

SourceSimplePinout

Source

Defines a simple pinout component

/* Defines a simple pinout component /
interface SourceSimplePinout extends SourceComponentBase {
  ftype: "simple_pinout"
}

SourceSimplePotentiometer

Source

interface SourceSimplePotentiometer extends SourceComponentBase {
  ftype: "simple_potentiometer"
  max_resistance: number
  display_max_resistance?: string
}

SourceSimplePowerSource

Source

Defines a simple power source component

/* Defines a simple power source component /
interface SourceSimplePowerSource extends SourceComponentBase {
  ftype: "simple_power_source"
  voltage: number
}

SourceSimplePushButton

Source

Defines a simple push button component

/* Defines a simple push button component /
interface SourceSimplePushButton extends SourceComponentBase {
  ftype: "simple_push_button"
}

SourceSimpleResistor

Source

Defines a simple resistor component

/* Defines a simple resistor component /
interface SourceSimpleResistor extends SourceComponentBase {
  ftype: "simple_resistor"
  resistance: number
  display_resistance?: string
}

SourceSimpleResonator

Source

Defines a simple resonator component

/* Defines a simple resonator component /
interface SourceSimpleResonator extends SourceComponentBase {
  ftype: "simple_resonator"
  load_capacitance: number
  equivalent_series_resistance?: number
  frequency: number
}

SourceSimpleSwitch

Source

Defines a simple switch component

/* Defines a simple switch component /
interface SourceSimpleSwitch extends SourceComponentBase {
  ftype: "simple_switch"
}

SourceSimpleTestPoint

Source

/** Defines a simple test point component
 * Can be surface-mount or through-hole.
  Pad shape and dimensions configurable for different use cases. /
interface SourceSimpleTestPoint extends SourceComponentBase {
  ftype: "simple_test_point"
  footprint_variant?: "pad" | "through_hole"
  pad_shape?: "rect" | "circle"
  pad_diameter?: number | string
  hole_diameter?: number | string
  width?: number | string
  height?: number | string
}

SourceSimpleTransistor

Source

/** Defines a simple transistor component
 * This is a three-pin semiconductor device (emitter, base, collector)
  Pin configuration is handled by the schematic port system /
interface SourceSimpleTransistor extends SourceComponentBase {
  ftype: "simple_transistor"
  transistor_type: "npn" | "pnp"
}

SourceSimpleVoltageProbe

Source

Defines a simple voltage probe component for simulation and measurement

/* Defines a simple voltage probe component for simulation and measurement /
interface SourceSimpleVoltageProbe extends SourceComponentBase {
  ftype: "simple_voltage_probe"
}

SourceSimpleVoltageSource

Source

Defines a simple voltage source component

/* Defines a simple voltage source component /
interface SourceSimpleVoltageSource extends SourceComponentBase {
  ftype: "simple_voltage_source"
  voltage: number
  frequency?: number
  peak_to_peak_voltage?: number
  wave_shape?: "sinewave" | "square" | "triangle" | "sawtooth"
  phase?: number
  duty_cycle?: number
  pulse_delay?: number // ms
  rise_time?: number // ms
  fall_time?: number // ms
  pulse_width?: number // ms
  period?: number // ms
}

SourceSubassembly

Source

Defines a subassembly component.

/* Defines a subassembly component. /
interface SourceSubassembly extends SourceComponentBase {
  ftype: "subassembly"
}

SourceTrace

Source

Chat with me