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

inet-henge-react

v0.1.0

Published

React component for inet-henge network diagrams.

Readme

inet-henge-react

React component for inet-henge network diagrams.

Getting Started

npm install inet-henge-react inet-henge

inet-henge is a peer dependency. Install it alongside. d3 and cola come with this package.

"use client";

import { InetHenge } from "inet-henge-react";

export function Diagram() {
  return (
    <div style={{ height: "100vh" }}>
      <InetHenge data="/network.json" meta={["interface"]} />
    </div>
  );
}

The component renders a <div>. inet-henge draws an SVG inside it. It runs in the browser only. Keep it in a client component.

Sizing

Without width and height the component measures its own container once, when it mounts. The container fills its parent unless style says otherwise. The diagram therefore takes the size of the parent. Give the parent a height. An element with no height measures zero, and inet-henge falls back to its own default.

Pass width and height to size the diagram yourself. The component does not follow later resizes.

Props

| Prop | Type | Description | | ------------------------ | ---------------------------- | ---------------------------------------------------------- | | data | string \| { nodes, links } | URL to fetch, or the data itself | | meta | string[] | Metadata keys to render as labels | | width height | number | Diagram size in px, measured from the container if omitted | | nodeWidth nodeHeight | number | Node size in px | | groupPadding | number | Padding around groups | | initialTicks ticks | number | Layout iterations | | positionCache | boolean \| "fixed" | Remember node positions in localStorage | | positionHint | { nodeCallback } | Initial position of each node | | positionConstraints | { axis, nodesCallback }[] | Alignment constraints | | distance | number \| (cola) => number | Link distance | | bundle | boolean | Draw tie marks over bundled links | | pop | RegExp | Group nodes by the matched part of their name | | tooltip | "click" \| "hover" | What opens a tooltip | | href | (object, type) => string | Link target of a tooltip | | onRendered | () => void | Called once the diagram is drawn | | className style | | Applied to the container |

Every prop but onRendered, className and style goes to the Diagram constructor. The inet-henge README describes what each one does.

Changing a prop rebuilds the diagram, which recalculates the layout. Keep data referentially stable. A new object on every render redraws the diagram every time.

Styling

inet-henge draws with presentation attributes. A plain stylesheet overrides them.

.node rect {
  fill: #1f77b4;
}

Copyright and License

Copyright (c) 2016-2026 Shintaro Kojima. Code released under the MIT license.