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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@spice-ts/ui

v0.3.0

Published

Waveform viewer for spice-ts simulation results

Readme

@spice-ts/ui

npm

Waveform viewer, Bode plot, DC sweep plot, and schematic renderer for spice-ts simulation results. Ships framework-agnostic Canvas renderers plus a thin React wrapper.

Live showcase — interactive demos with streaming parametric sweeps running in your browser.

Install

npm install @spice-ts/ui @spice-ts/core
# React bindings are optional — only needed for the `/react` subpath
npm install react react-dom

Requires Node.js ≥ 20.

Two entry points

  • @spice-ts/ui — framework-agnostic Canvas renderers (TransientRenderer, BodeRenderer, DCSweepRenderer), layout helpers (layoutSchematic), themes, scales, and formatters. Use these directly if you're building your own UI layer.
  • @spice-ts/ui/react — React components (TransientPlot, BodePlot, DCSweepPlot, WaveformViewer, SchematicView) built on top of the renderers. Auto-resize, cursor tracking, legend toggling, and streaming updates are handled for you.

React components

Transient plot

import { simulate } from '@spice-ts/core';
import { TransientPlot } from '@spice-ts/ui/react';

const result = await simulate(netlist);

<TransientPlot
  data={result.transient}
  signals={['in', 'out']}
  theme="dark"
  height={300}
/>

Bode plot (AC magnitude + phase)

import { BodePlot } from '@spice-ts/ui/react';

<BodePlot
  data={result.ac}
  signals={['out']}
  theme="dark"
/>

DC sweep plot

import { DCSweepPlot } from '@spice-ts/ui/react';

<DCSweepPlot
  data={result.dcSweep}
  signals={['out']}
  theme="dark"
/>

Schematic view

Renders a CircuitIR as a vector schematic with automatic node ranking, column packing, and orthogonal wire routing.

import { parse } from '@spice-ts/core';
import { SchematicView } from '@spice-ts/ui/react';

const circuit = parse(netlist).toIR();

<SchematicView
  circuit={circuit}
  theme="dark"
  height={400}
  onNodeClick={(net) => console.log('clicked net', net)}
/>

Supported symbols: V, I, R, C, L, D (horizontal and vertical with rank-aware triangle direction), M (N/PMOS), Q (NPN/PNP), E/G (opamp), F/H (dependent sources). Feedback caps draw as arches above opamp loops; series output caps in inverting buck-boost converters get a dedicated rank rail.

Waveform viewer (multi-analysis container)

Combines transient + AC + DC sweep plots with a shared legend, cursor, and theme.

import { WaveformViewer } from '@spice-ts/ui/react';

<WaveformViewer
  result={simulationResult}
  theme="dark"
/>

Themes

'dark' and 'light' presets ship out of the box. For custom colours, pass a ThemeConfig object or spread over a preset with mergeTheme:

import { mergeTheme, DARK_THEME } from '@spice-ts/ui';

const myTheme = mergeTheme(DARK_THEME, {
  background: '#0a1628',
  signals: ['#00ff88', '#ff6b9d', '#4dabf7'],
});

Framework-agnostic renderers

If you're not using React, drive the Canvas directly:

import { TransientRenderer, resolveTheme } from '@spice-ts/ui';

const canvas = document.getElementById('plot') as HTMLCanvasElement;
const renderer = new TransientRenderer(canvas, {
  theme: resolveTheme('dark'),
  data: result.transient,
  signals: ['out'],
});

renderer.draw();
// later, on resize or data update:
renderer.resize(newWidth, newHeight);
renderer.update({ data: newData });

Same pattern for BodeRenderer and DCSweepRenderer. The React components are thin wrappers around these.

Streaming

StreamingController and ACStreamingController buffer incoming points from simulateStream() and incrementally update the renderer:

import { simulateStream } from '@spice-ts/core';
import { StreamingController } from '@spice-ts/ui';

const controller = new StreamingController(renderer);

for await (const step of simulateStream(netlist)) {
  controller.push(step);
}

License

MIT · See the spice-ts monorepo for the full project.