Skip to content

feat: Add support for transistors#27

Merged
ShiboSoftwareDev merged 3 commits intotscircuit:mainfrom
ShiboSoftwareDev:main
Nov 30, 2025
Merged

feat: Add support for transistors#27
ShiboSoftwareDev merged 3 commits intotscircuit:mainfrom
ShiboSoftwareDev:main

Conversation

@ShiboSoftwareDev
Copy link
Copy Markdown
Contributor

This pull request introduces support for simple_transistor components within the
circuit-json-to-spice library. These components are now converted into SPICE BJT
(Q) elements.

Key changes:

• Implemented the logic for simple_transistor in lib/circuitJsonToSpice.ts.
• Added a new test file, tests/examples/switch.test.tsx, to validate the
transistor and switch functionality using the switch.json circuit.
• Updated README.md to include transistors in the list of supported components.

ShiboSoftwareDev and others added 2 commits November 30, 2025 21:59
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>

- **Resistors** (`simple_resistor`) - Converted to SPICE R components
- **Capacitors** (`simple_capacitor`) - Converted to SPICE C components
- **Transistors** (`simple_transistor`) - Converted to SPICE Q components (BJT)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BJTs are just one of hundreds of types of transistors, we need more data in the circuit json

Copy link
Copy Markdown
Contributor

@seveibar seveibar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note my comment, mosfets, pnp, npn, n-channel, p-channel resistors all work totally differently, we need to support all of them! Lets make a checklist issue and test…

@ShiboSoftwareDev ShiboSoftwareDev merged commit 619e239 into tscircuit:main Nov 30, 2025
5 checks passed
@tscircuitbot
Copy link
Copy Markdown
Contributor


Thank you for your contribution! 🎉

PR Rating: ⭐⭐
Impact: Minor

Track your contributions and see the leaderboard at: tscircuit Contribution Tracker


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants