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

neo-vue3-d3-network

v0.1.0

Published

A Vue 3 force-directed graph component powered by d3-force. Renders network graphs as SVG with support for zoom, pan, drag, selection, labels, curved links, custom node icons, and screenshots.

Downloads

112

Readme

neo-vue3-d3-network

A Vue 3 force-directed graph component powered by d3-force. Renders network graphs as SVG with support for zoom, pan, drag, selection, labels, curved links, custom node icons, and screenshots.

Install

bun add neo-vue3-d3-network

Quick start

<script setup>
import { ForceGraph } from 'neo-vue3-d3-network'
import 'neo-vue3-d3-network/style.css'

const nodes = [
  { id: 1, name: 'Node 1' },
  { id: 2, name: 'Node 2' },
  { id: 3, name: 'Node 3' },
]

const links = [
  { source: 1, target: 2 },
  { source: 2, target: 3 },
]
</script>

<template>
  <ForceGraph :nodes="nodes" :links="links" :node-labels="true" />
</template>

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | nodes | GraphNode[] | required | Array of nodes | | links | GraphLink[] | required | Array of links | | nodeSize | number | 5 | Default node radius | | linkWidth | number | 1 | Default link stroke width | | force | number | 500 | Force simulation strength | | forces | ForcesConfig | — | Enable/disable individual forces (center, x, y, manyBody, link, collide) | | customForces | Record<string, Force> | — | Custom d3 forces | | nodeLabels | boolean | false | Show node labels | | linkLabels | boolean | false | Show link labels | | fontSize | number | 10 | Label font size | | curvedLinks | boolean | false | Use curved link paths | | draggable | boolean | true | Enable node dragging | | zoomable | boolean | true | Enable zoom and pan | | selectable | boolean | true | Enable node/link selection | | nodeFormatter | (node) => node | — | Transform nodes before rendering | | linkFormatter | (link) => link | — | Transform links before rendering | | simulationFormatter | (sim) => sim | — | Configure the d3 simulation directly |

Events

| Event | Payload | Description | |-------|---------|-------------| | node-click | (node, event) | Node clicked | | link-click | (link, event) | Link clicked | | node-double-click | (node, event) | Node double-clicked | | node-context-menu | (node, event) | Node right-clicked | | link-double-click | (link, event) | Link double-clicked | | link-context-menu | (link, event) | Link right-clicked | | node-drag-start | (node, event) | Node drag started | | node-drag-end | (node, event) | Node drag ended | | zoom-change | (transform) | Zoom/pan changed |

Exposed methods

Access via template ref:

<script setup>
const graph = ref()
</script>

<template>
  <ForceGraph ref="graph" :nodes="nodes" :links="links" />
</template>
  • selectNode(id) / deselectNode(id) / toggleNodeSelection(id)
  • selectLink(id) / deselectLink(id) / toggleLinkSelection(id)
  • clearSelection()
  • pinNode(id) / unpinNode(id)
  • zoomTo(transform) / zoomToFit() / resetZoom()
  • restart()
  • screenshot(options?) — export as PNG or SVG

Slots

  • #node="{ node, selected, pinned }" — custom node rendering
  • #link="{ link, selected }" — custom link rendering
  • #node-label="{ node }" — custom node label
  • #overlay="{ transform, nodes, links }" — SVG overlay layer

Composables

For more control, use the composables directly instead of the component:

import { useForceGraph } from 'neo-vue3-d3-network'

Available composables: useForceGraph, useForceSimulation, useGraphData, useNodeDrag, useScreenshot, useSelection, useZoom.

Development

bun install
bun run dev        # run showcase app
bun run build      # build library
bun run typecheck  # type check
bun run lint       # lint

License

MIT