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

@cocorof/graphier

v1.3.1

Published

High-performance 3D/2D graph renderer for React — powered by Three.js and d3-force-3d

Readme

Graphier

High-performance 3D/2D graph renderer for React — powered by Three.js and d3-force-3d.

License

Features

  • 2 GPU draw calls — InstancedMesh (nodes) + LineSegments (edges) for maximum performance
  • Web Worker layout — Force-directed simulation off the main thread (d3-force-3d)
  • Custom GLSL shaders — Fresnel rim glow + subsurface scatter on every node
  • Post-processing — UnrealBloomPass glow with adaptive resolution
  • Auto-adaptive — Layout, LOD, bloom, and fog scale automatically with graph size
  • 360 keyboard camera — Full spherical rotation with quaternion-based controls, no gimbal lock
  • Incremental updatesappendData() adds nodes/links without full rebuild
  • Position preservation — Existing node positions survive data changes
  • Theme system — 3 built-in presets (celestial, neon, minimal) + fully customizable
  • Node Detail Panel — Modal with navigation history, connections list, and 3D subgraph
  • 2D Subgraph View — Lightweight canvas-based neighborhood renderer
  • Graph Analysis — Tree-shakeable analytics module (graphier/analysis), zero Three.js dependency
  • TypeScript — Full type safety with exported types
  • Dual ESM/CJS — Works in all bundler configurations

Install

npm install @cocorof/graphier three react react-dom

Peer dependencies: react >= 18, react-dom >= 18, three >= 0.150

Quick Start

import { NetworkGraph3D } from "@cocorof/graphier";

const data = {
  nodes: [
    { id: "alice", type: "person", label: "Alice", val: 10 },
    { id: "bob", type: "person", label: "Bob", val: 5 },
    { id: "project-x", type: "repo", label: "Project X", val: 20 },
  ],
  links: [
    { source: "alice", target: "project-x", type: "owns" },
    { source: "bob", target: "project-x", type: "contributes" },
    { source: "alice", target: "bob", type: "follows" },
  ],
};

export default function App() {
  return (
    <div style={{ width: "100vw", height: "100vh" }}>
      <NetworkGraph3D data={data} />
    </div>
  );
}

Ref API

const graphRef = useRef<NetworkGraph3DRef>(null);

graphRef.current?.focusNode("alice", 1200);
graphRef.current?.zoomToFit(800, 100);
graphRef.current?.zoomIn();
graphRef.current?.zoomOut();
graphRef.current?.appendData(newNodes, newLinks);
graphRef.current?.screenshot();

Theme & Style

<NetworkGraph3D
  data={data}
  theme="celestial"              // or "neon", "minimal", or a ThemeConfig object
  style={{
    bloomStrength: 0.7,
    fogDensity: 0.0004,
    nodeMinSize: 2,
    nodeMaxSize: 18,
    showLabels: true,
    maxLabels: 200,
  }}
/>

Analysis Module

import { analyzeGraph } from "@cocorof/graphier/analysis";

const stats = analyzeGraph(data);
// stats.nodeCount, stats.density, stats.avgDegree, stats.topByDegree(10), ...

Keyboard Controls

| Key | Action | |-----|--------| | Z / X | Zoom in / out | | Arrow keys | 360 camera rotation | | Escape | Deselect |

Documentation

Next.js / SSR

// app/page.tsx
"use client";
import dynamic from "next/dynamic";
const GraphView = dynamic(() => import("./GraphView"), { ssr: false });
// next.config.js
const nextConfig = { transpilePackages: ["@cocorof/graphier"] };

Architecture

NetworkGraph3D
├── InstancedMesh        (all nodes → 1 draw call)
├── LineSegments          (all edges → 1 draw call)
├── Web Worker            (d3-force-3d layout, off main thread)
├── UnrealBloomPass       (post-processing glow)
├── Sprite labels         (distance-culled, texture-cached)
└── Keyboard controls     (quaternion-based 360 rotation)

License

MIT