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

@tscircuit/schematic-match-adapt

v0.0.22

Published

An automatic layout system for schematics that uses the **PMARS** pattern:

Readme

@tscircuit/schematic-match-adapt

An automatic layout system for schematics that uses the PMARS pattern:

  • Partition the input schematic
  • Match partitions with close, pregenerated templates
  • Adapt the template until the netlist matches the partition
  • Refine the layout to fix overlapping or clutter caused by adaptation
  • Stitch the laid-out partitions together

Test Online · tscircuit

Motivation

Creating a schematic layout algorithm is difficult. Schematics can't easily use existing flow-diagram layout algorithms because readable schematics require using common conventions, such as orienting ground net labels down and V+ labels up.

The PMARS layout system is designed to be an extensible way to build a complex layout system that adheres to common conventions. We do this by pre-processing a large set of schematic templates that represent many common scenarios for partial or full representation of a schematic to create a large lookup table of schematic layouts. We then process a netlist against this lookup table to find the closest layout for a given netlist, considering factors such as the net labels and passive components.

Because the algorithm is extended by adding new templates, it is simple to extend to algorithm to handle new scenarios as users need them or as edge cases are found.

Usage

You should create an InputNetlist to describe your schematic input. You can then call getLayoutForNetlist to get CircuitBuilder instance with the layout applied.

import { SchematicLayoutPipelineSolver } from "@tscircuit/pmars-layout"

const solver = new SchematicLayoutPipelineSolver({
  inputNetlist: {
    boxes: [
      {
        boxId: "U1",
        leftPinCount: 2,
        rightPinCount: 2,
        topPinCount: 0,
        bottomPinCount: 0,
      },
      {
        boxId: "R1",
        leftPinCount: 1,
        rightPinCount: 1,
        topPinCount: 0,
        bottomPinCount: 0,
      },
    ],
    connections: [
      {
        connectedPorts: [
          { boxId: "U1", pinNumber: 1 },
          { boxId: "R1", pinNumber: 1 },
        ],
      },
      {
        connectedPorts: [{ boxId: "U1", pinNumber: 4 }, { netId: "VCC" }],
      },
    ],
    nets: [{ netId: "VCC" }, { netId: "GND" }],
  },
})

solver.solve()

console.log(solver.toAsciiString())

// You can access the position of each box via circuitBuilder.chips

Great Reference Schematics

  • https://cdn.sparkfun.com/assets/7/7/2/1/9/SparkFun_STM32_Thing_Plus.pdf