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

@nelson-5553/nodegraph-react

v1.1.0

Published

An interactive, force-directed graph visualization component for React with advanced physics simulation and real-time rendering capabilities powered by D3.js.

Readme

NodeGraph React Component

An interactive, force-directed graph visualization component for React with advanced physics simulation and real-time rendering capabilities powered by D3.js.

Features

  • Interactive Visualization: Real-time graph rendering with D3 force simulation
  • Physics Engine: Customizable force-directed layout with node repulsion, link attraction, and more
  • Responsive Design: Works seamlessly on desktop and mobile devices
  • Controlled Interaction: Full control over node positioning, styling, and behavior
  • Advanced Customization: Label rendering, custom styling, and flexible API
  • Performance Optimized: Efficient canvas rendering for smooth animations

Installation

npm install @nelson-5553/nodegraph-react

or with pnpm:

pnpm install @nelson-5553/nodegraph-react

Quick Start

import { NodeGraph } from '@nelson-5553/nodegraph-react';

const nodes = [
  { id: '1', label: 'Node 1' },
  { id: '2', label: 'Node 2' },
];

const links = [
  { source: '1', target: '2' }
];

export default function App() {
  return (
    <NodeGraph 
      nodes={nodes} 
      links={links}
      width={800}
      height={600}
    />
  );
}

API

Props

| Prop | Type | Description | Default | |------|------|-------------|---------| | nodes | Array<{id: string, name: string, group?: number}> | Array of node objects | Required | | links | Array<[string, string]> | Array of link pairs [source, target] | Required | | width | string \| number | Canvas width (e.g., "100%" or 800) | "100%" | | height | string \| number | Canvas height (e.g., "100%" or 600) | "100%" | | colors | string[] | Array of hex colors for node groups | ['#3b82f6', '#8b5cf6', '#ec4899'] | | viewGuide | boolean | Show/hide control panel for physics adjustments | false | | repulsion | number | Force repulsion between nodes | 150 | | linkDistance | number | Desired distance between connected nodes | 65 | | className | string | CSS classes for the container | "bg-white" | | linkColor | string | Color of link lines (hex or rgba) | "rgba(59,130,246,0.5)" | | linkWidth | number | Width of link lines in pixels | 1.5 | | linkHoverColor | string | Color of links on hover | "#0369a1" | | linkHoverWidth | number | Width of links on hover | 2.2 | | nodeHoverColor | string | Color of nodes on hover | "#0369a1" | | nodeLabelColor | string | Color of node labels text | "#1e293b" | | nodeLabelHoverColor | string | Color of node labels on hover | "#0369a1" | | nodeLabelFontSize | number | Font size of node labels in pixels | 11 | | nodeLabelShowOnHover | boolean | Show labels only on hover | false | | nodeLabelMinDegree | number | Minimum node degree to display label | 4 | | nodeLabelMinScale | number | Minimum zoom scale to display labels | 0.5 |

Usage Examples

The component supports:

  • Basic Visualization: Simple graph rendering
  • Controlled Interaction: Drag nodes and interact with the graph
  • Custom Styling: Style nodes, links, and labels
  • Physics Control: Configure force simulation parameters
  • Label Customization: Custom label rendering and positioning

Peer Dependencies

  • React >= 18.0.0
  • React DOM >= 18.0.0

License

MIT License - see the LICENSE file for details.

Support

For issues, feature requests, or questions, please open an issue on the repository.