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

flowrender

v1.0.4

Published

A lightweight TypeScript library for rendering clean SVG flowcharts with zoom and pan support.

Readme

FlowRender — Elegant SVG Flowchart Renderer

FlowRender is a lightweight, TypeScript library for rendering beautiful flowcharts and process diagrams directly into SVG — fully interactive with zoom, pan, hover states, and labeled connections.

It’s designed to provide the clean look of tools like Lucidchart or Miro, but with a lightweight footprint and easy integration in your own web apps.


Features

  • Supports all common flowchart node types:
    • start · end · process · decision · io · subflow
  • Direction control (TB, BT, LR, RL)
  • Beautiful, Lucidchart-inspired SVG rendering
  • Hover highlights & gradients
  • Zoom and pan interactions built-in
  • Scrollable and responsive container
  • Simple, zero-dependency API

Installation

npm install flowrender

Quick Start

Import and render a flowchart:

import { renderFlowToSVG } from "FlowRender";

const container = document.getElementById("flowchart");

const flowData = {
  id: "demo-flow",
  name: "User Input Process",
  nodes: [
    { id: "start", name: "Start", type: "start" },
    { id: "input", name: "Get User Input", type: "io" },
    { id: "process1", name: "Process Data", type: "process" },
    { id: "decision", name: "Valid?", type: "decision" },
    { id: "subflow", name: "Sub Process", type: "subflow" },
    { id: "process2", name: "Store Result", type: "process" },
    { id: "end", name: "End", type: "end" },
  ],
  edges: [
    { from: "start", to: "input" },
    { from: "input", to: "process1" },
    { from: "process1", to: "decision" },
    { from: "decision", to: "subflow", label: "Yes" },
    { from: "decision", to: "input", label: "No" },
    { from: "subflow", to: "process2" },
    { from: "process2", to: "end" },
  ],
};

renderFlowToSVG(flowData, container, { direction: "TB" });

This will automatically create a flowchart with zoom and pan support.

Data Model

A flow consists of nodes and edges, wrapped in a FlowData object.

export interface FlowData {
  id?: string;
  name?: string;
  nodes: { id: string; name: string; type?: string; width?: number; height?: number }[];
  edges: { from: string; to: string; label?: string }[];
}

Supported node type values:

| Type | Description | Shape Example | |----------|------------------------|-------------------| | start | Start node | Ellipse | | end | End node | Ellipse | | process | Standard step | Rounded Rect | | decision | Decision | Diamond | | io | Input/Output | Parallelogram | | subflow | Subprocess | Double Rect |

Options

renderFlowToSVG(flowData, container, {
  direction: "TB", // Layout direction: TB | BT | LR | RL
  fitToView: true, // Auto-fit (optional; currently the library computes viewBox automatically)
});

Layout direction meanings: TB: Top → Bottom BT: Bottom → Top LR: Left → Right RL: Right → Left

Interactions

The chart supports: Zooming: with the mouse wheel (centered on cursor) Panning: by dragging the background (mousedown + move)

Styling

All styles (both DOM and SVG) are injected automatically. Styles are namespaced with the sf- prefix, so they won’t interfere with your app. Class Purpose

.sf-flow-container	Main container for the chart
.sf-flow-title	Title above the chart
.sf-svg-wrapper	Scrollable SVG container
.sf-node	Generic node shape
.sf-edge	Connector line
.sf-label	Node text label
.sf-edge-label	Edge text label

You can override these CSS rules in your app's stylesheet.

Architecture Overview

src/
├── core/
│   └── types.ts          # FlowData and related interfaces (single source of truth)
├── layout/
│   └── dagreLayout.ts    # Computes positions for nodes and edges (dagre)
├── rendering/
│   ├── shapes.ts         # SVG shape creation (rect, diamond, ellipse, parallelogram, etc.)
│   ├── svgUtils.ts       # SVG helper functions (create, defs, gradients, markers)
│   └── style.ts          # Unified CSS injection for DOM + SVG
├── interactions/
│   └── zoomPan.ts        # Handles zooming and panning (wheel + drag)
└── renderFlowToSVG.ts    # Main high-level rendering entry point (glues everything)

Each layer is independent and can be swapped, tested, or extended.

Credits

Built by AmonMcDuul

Licence

MIT License — free to use in commercial or personal projects.

Acknowledgements & Notes

Layout is powered by dagre. The library is intentionally minimal — focused on readable SVG output and a modular codebase that’s easy to extend.