circuit-to-svg
TypeScript icon, indicating that this package has built-in type declarations

0.0.84 • Public • Published

circuit-to-svg

A TypeScript library for converting circuit descriptions (soup) to SVG representations.

Overview

This library provides functionality to convert circuit descriptions, referred to as "soup", into SVG (Scalable Vector Graphics) representations. It supports both schematic and PCB (Printed Circuit Board) layouts.

Features

  • Convert schematic circuit descriptions to SVG
  • Convert PCB layouts to SVG
  • Support for various circuit elements:
    • Components
    • Traces
    • Text labels
    • Net labels
    • PCB boards
    • PCB components
    • PCB traces
    • PCB holes and pads

Installation

npm install circuit-to-svg

Usage

import { convertCircuitJsonToSchematicSvg, convertCircuitJsonToPcbSvg } from 'circuit-to-svg';

// For schematic circuits
const schematicCircuitJson = [...]; // Your schematic circuit description
const schematicSvg = convertCircuitJsonToSchematicSvg(schematicCircuitJson);

// For PCB layouts
const pcbCircuitJson = [...]; // Your PCB layout description
const pcbSvg = convertCircuitJsonToPcbSvg(pcbCircuitJson);

API

convertCircuitJsonToSchematicSvg(circuitJson: AnyCircuitElement[]): string

Converts a schematic circuit description to an SVG string.

convertCircuitJsonToPcbSvg(circuitJson: AnyCircuitElement[]): string

Converts a PCB layout description to an SVG string.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License.

Dependents (7)

Package Sidebar

Install

npm i circuit-to-svg

Weekly Downloads

9,341

Version

0.0.84

License

ISC

Unpacked Size

266 kB

Total Files

5

Last publish

Collaborators

  • seveibar