@tscircuit/circuit-to-png is a TypeScript library that converts circuit "soup" (a JSON representation of circuit components) into PNG images. This library is part of the tscircuit ecosystem, which aims to provide tools for working with electronic circuits in a programmatic way.
- Convert circuit "soup" to PNG images
- Support for both schematic and PCB layouts
- TypeScript support for type safety and better developer experience
To install @tscircuit/circuit-to-png, use npm:
npm install @tscircuit/circuit-to-png
Here's a basic example of how to use @tscircuit/circuit-to-png:
import { soupToPng } from "@tscircuit/circuit-to-png";
const circuitSoup = {
// Your circuit soup JSON here
};
const pngBuffer = await soupToPng(circuitSoup);
For more detailed usage instructions and API documentation, please refer to the source code and tests in the src
directory.
To set up the project for development:
- Clone the repository
- Install dependencies:
npm install
- Run tests:
npm test
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.
- tscircuit - The main tscircuit project