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

cluster-graph-3d

v1.1.0

Published

contains a component to render node/edge data with threejs and different distribution algorithms like force graph

Readme

cluster-graph-3d

A 3D force-directed graph component using ThreeJS/WebGL. Renders large graphs (50k+ nodes, 200k+ edges) in 3D with force-simulation layout, sub-clustering, convex hull grouping, and post-processing effects.

| Clamped offscreen node navigation | Full graph with box hull clusters | |---|---| | Clamped offscreen node navigation — selected node's connections and neighbours are pinned to the screen edges when the node itself is out of view | Full graph rendered with country-level clusters and semi-transparent box hulls |

Install

npm install cluster-graph-3d

Peer dependencies you must also install:

npm install lodash

Quick Start

import GraphView3D from 'cluster-graph-3d/graph'
import Default3DGraphConfig from 'cluster-graph-3d/config'

const container = document.getElementById('graph')

const graph = new GraphView3D(container)
const config = new Default3DGraphConfig(graph)

graph.setSpeccs(config.getSpeccs())

graph.setData({
  nodes: {
    '1': { id: '1', name: 'Alice', group: 'A' },
    '2': { id: '2', name: 'Bob',   group: 'A' },
    '3': { id: '3', name: 'Carol', group: 'B' },
  },
  links: [
    { source: '1', target: '2' },
    { source: '2', target: '3' },
  ]
})
<div id="graph" style="width: 100vw; height: 100vh;"></div>

Load from CSV

import GraphView3D from 'cluster-graph-3d/graph'
import Default3DGraphConfig from 'cluster-graph-3d/config'

const graph = new GraphView3D(document.getElementById('graph'))
const config = new Default3DGraphConfig(graph)
graph.setSpeccs(config.getSpeccs())

graph.loadDatasource(new CsvDatasource('nodes.csv', 'edges.csv'))

CSV format — nodes:

id,name,group,industry
1,Alice,GroupA,Tech
2,Bob,GroupA,Tech
3,Carol,GroupB,Finance

CSV format — edges:

SourceID,TargetID,Relationship Strenght
1,2,0.8
2,3,0.5

API

new GraphView3D(domElement)

| Method | Description | |---|---| | setData(graphData) | Load graph from a plain object { nodes: {}, links: [] } | | loadDatasource(datasource) | Load graph from a Datasource instance (replaces current graph) | | loadDataSet(fn) | Load graph via a callback fn(null, onSuccess) | | setSpeccs(speccs) | Set clustering/layout configuration from Default3DGraphConfig | | setTextVisible(bool) | Show or hide node text labels | | resizeCanvas() | Trigger a canvas resize manually | | start() / stop() | Start or stop the render loop |

Inherited from View3D:

| Method | Description | |---|---| | set2D() / set3D() | Switch between orthographic and perspective camera | | add(object3D) | Add a raw Three.js object to the scene | | maximise() / undoMaximise() | Expand/collapse the canvas within its container |

| scene() | Access the internal THREE.Scene | | camera() | Access the internal camera | | renderer() | Access the internal WebGLRenderer |

new Default3DGraphConfig(graphView, backgroundColor?, cssClass?)

| Method | Description | |---|---| | getSpeccs() | Returns the clustering spec array to pass to graph.setSpeccs() | | setMode(onComplete?) | Switch layout mode | | doZoomToRelevant() | Zoom camera to the relevant portion of the graph | | zoomToPosition(position, onComplete) | Animate camera to a THREE.Vector3 position | | restartGraph() | Re-run the force simulation from scratch |

Data Format

{
  nodes: {
    'id1': { id: 'id1', name: 'Node 1', group: 'GroupA', industry: 'Tech', color: 0xff0000 },
    'id2': { id: 'id2', name: 'Node 2', group: 'GroupB' },
  },
  links: [
    { source: 'id1', target: 'id2', strength: 0.5 }
  ]
}

| Field | Description | |---|---| | id | Unique node identifier (string) | | name | Display label | | group | Primary clustering key | | industry | Secondary clustering key | | color | Hex color (optional) | | source / target | Node ids for links | | strength | Link weight (optional, 0–1) |

Build

# dev server
npm run dev

# build the app (vite)
npm run build:app

# build the library for publishing (tsup)
npm run build:lib

License

Proprietary — see LICENSE.md.