npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

circuit-to-canvas

v0.0.34

Published

Draw [Circuit JSON](https://github.com/tscircuit/circuit-json) into a Canvas- works with any canvas object (Node/Vanilla)

Readme

circuit-to-canvas

Draw Circuit JSON into a Canvas- works with any canvas object (Node/Vanilla)

NPM Version

const drawer = new CircuitToCanvasDrawer(canvasOrCanvasRenderingContext2d)

// Sets the internal transformation matrix for all operations
drawer.setCameraBounds({ minX: 0, maxX: 100, minY: 0, maxY: 100 })

drawer.configure({
  colorOverrides: {
    topCopper: "#ff0000"
  }
})

// Accepts a circuit json array, by default draws on all layers
drawer.drawElements([pcbPlatedHole], {
  layers: ["top_copper"]
})

Implementation Notes

There are two "types" of layers:

  • Specific drawing layers e.g. "top_copper"
  • Layer groups "top" (includes "top_copper", "top_soldermask")

inner layers go by the name inner1, inner2 etc.

Feature Parity with circuit-to-svg

This checklist tracks PCB drawing features from circuit-to-svg that are implemented in circuit-to-canvas.

PCB Elements

  • [x] pcb_board - Board outline with center/width/height or custom outline
  • [x] pcb_trace - PCB traces with route points
  • [x] pcb_via - Via holes
  • [x] pcb_plated_hole - Plated through-holes (circular, pill, oval shapes)
  • [x] pcb_hole - Non-plated holes (circular, square, oval shapes)
  • [x] pcb_smtpad - SMT pads (rect, circle, rotated_rect, pill shapes)
  • [x] pcb_copper_pour - Copper pour areas (rect, polygon shapes)
  • [x] pcb_cutout - Board cutouts (rect, circle, polygon shapes)

Silkscreen Elements

  • [x] pcb_silkscreen_text - Text on silkscreen layer
  • [x] pcb_silkscreen_rect - Rectangles on silkscreen
  • [x] pcb_silkscreen_circle - Circles on silkscreen
  • [x] pcb_silkscreen_line - Lines on silkscreen
  • [x] pcb_silkscreen_path - Paths/routes on silkscreen
  • [x] pcb_silkscreen_pill - Pill shapes (rounded rectangles) on silkscreen

Copper Text

  • [x] pcb_copper_text - Text rendered on copper layers (supports knockout mode, mirroring)

Error Visualization

  • [ ] pcb_trace_error - Trace routing error indicators
  • [ ] pcb_footprint_overlap_error - Footprint overlap error indicators

Debug/Development Features

  • [ ] pcb_component - Component bounding box visualization
  • [ ] pcb_group - PCB group visualization with dashed outlines
  • [ ] pcb_courtyard_rect - Component courtyard rectangles

Fabrication Notes

  • [x] pcb_fabrication_note_text - Fabrication note text
  • [x] pcb_fabrication_note_rect - Fabrication note rectangles
  • [x] pcb_fabrication_note_path - Fabrication note paths
  • [ ] pcb_fabrication_note_dimension - Fabrication dimension annotations

Annotation/Notes

  • [x] pcb_note_text - General note text
  • [x] pcb_note_rect - Note rectangles
  • [x] pcb_note_path - Note paths
  • [x] pcb_note_line - Note lines
  • [x] pcb_note_dimension - Dimension annotations

Panel Support

  • [ ] pcb_panel - PCB panel outlines for panelization

Visualization Features

  • [ ] Rats nest visualization - Unrouted connection indicators
  • [ ] PCB grid overlay - Configurable grid with major/minor lines
  • [ ] Soldermask rendering - Soldermask layer visualization
  • [ ] Anchor offset indicators - Debug indicators for relative positioning