Library / SDK
dash14/v-network-graph avatar
dash14/v-network-graph

v-network-graph is an SVG network graph component built for Vue reactivity

An interactive network graph visualization component for Vue 3

646 stars50 forksTypeScriptMIT

At a glance

What is it?
v-network-graph is a Vue 3 component that renders a network graph as SVG, with pan and zoom, node dragging, multi-selection, multi-touch and SVG export, where the graph data lives outside the component and is driven reactively. The trade is that it is pre-1.0, with a roadmap of work still outstanding and a beta tag in place.
Who is it for?
v-network-graph suits a Vue 3 application that needs an interactive network graph and wants the graph state to live in the component's own reactive data rather than behind a separate graph library. It does not suit a project that needs a production-ready component today, since the package version is a beta and the README's own roadmap to v1.0 lists performance work on large graphs and more flexible edge and label handling as still to come.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository received new commits within the last day.
What is it written in?
Mainly TypeScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.

Editorial analysis

The whole component is SVG, and the graph is your data

The first decision to understand is that the rendering is SVG rather than canvas or WebGL, and the README lists SVG based as one of the features alongside a fully configurable appearance. SVG gives you crisp text and inspectable DOM at the cost of a performance ceiling on very large graphs, and the roadmap acknowledges that ceiling as outstanding work. The second decision is where the data lives. The feature list says the graph is created according to your reactive data dynamically, and the basic usage example passes plain objects of nodes and edges straight into the component as props:

vue
<script setup lang="ts">
const nodes = {
  node1: { name: "Node 1" },
  node2: { name: "Node 2" },
  node3: { name: "Node 3" },
  node4: { name: "Node 4" },
}
const edges = {

@@C1@@The nodes carry a name and the edges carry a source and a target referring to node keys. There is no separate layout configuration object in the example, no adapter and no wrapper, which is the point of the design and the thing that makes the difference from older graph libraries.

Installation is an npm install and a plugin registration

The install path is short. The package is published on npm as v-network-graph and the README gives one command, and then the component is registered globally in main.ts alongside the stylesheet:

ts
// main.ts
import VNetworkGraph from "v-network-graph"
import { createApp } from "vue"
import "v-network-graph/lib/style.css"
import App from "./App.vue"

const app = createApp(App)

app.use(VNetworkGraph)
app.mount("#app")

@@C2@@The stylesheet import matters and is easy to miss, because the component ships CSS that the package marks as having side effects, so the style file has to be imported for the graph to look right. The main and module fields both point at lib/index.js and the types at lib/index.d.ts, with the package set to module, so it is an ES module distribution with TypeScript declarations included. The homepage for the package is the documentation site, which is where the Getting Started, Examples and Reference pages live, and there is a separate live examples page for seeing the component in action.

Nuxt 3 needs two files rather than one

The Nuxt 3 route is described separately, and it needs two changes rather than one. First the stylesheet goes into the css array of nuxt.config.ts, and second a plugin file is created under plugins that registers the component against the Vue app through defineNuxtPlugin. The plugin snippet is short enough to read in full:

ts
// plugins/v-network-graph.ts
import VNetworkGraph from "v-network-graph"
import { defineNuxtPlugin } from "#app"

export default defineNuxtPlugin(nuxtApp => {
  nuxtApp.vueApp.use(VNetworkGraph)
})

@@C3@@The reason the Nuxt path is a separate section rather than a note is that the registration target differs. In a plain Vite Vue app you call app.use on the application instance, and in Nuxt you get that instance from the plugin hook instead, so the same registration is expressed in a different shape. The nuxt.config.ts snippet also carries a link to the Nuxt directory structure documentation, which is a small sign of the intended audience.

Why a new component rather than wrapping an existing graph library

The README explains the motivation at length, and the argument is about programming model rather than about rendering. It says the requirements for visualizing network graphs are various, including the design and user actions for each component such as nodes, edges and paths, and that many libraries have been made to flexibly achieve those numerous requirements. The problem the author identifies is age: many of these libraries have been around since before Vue was launched, so there are not many that can be used with the concept of reactive programming. The stated cost of using one anyway is that you have to learn how to use the graph library as well as Vue, and you have to design the integration with Vue yourself, which the README puts as a lot of efforts. The aim is stated as keeping the simplicity and reactive programming style of Vue, with less code and lower learning costs.

Three design policies: reactive, customisable, extendable

The design policy section lists three commitments and each one has a consequence. Reactive means all primitive data such as nodes, edges, node positions and their styles are provided from outside the component, and the component handles them reactively with Vue, so a developer can modify the data at any time to perform manipulations such as adding or removing objects, moving node positions or changing appearance. Highly customizable means a variety of customizations are available, and that in addition to static specifications it also supports dynamic changes based on the values of fields contained in node and edge data, which is what makes a node change colour when its own data changes. Extendable covers the long tail of application-specific requirements, and the mechanism is that the project implements a way for developers to add their own SVG elements and actions as needed. That third policy is the escape hatch, and it is the one that decides whether a missing built-in feature is a blocker.

What the feature list actually promises

The feature list is short enough to be worth reading in full, because it defines the boundary of the component. You get a graph created from reactive data, a fully configurable appearance, SVG rendering, a pan and zoom viewport, draggable nodes, multiple node selection, multiple edge selection, multi-touch support, various events, and export as SVG text. Two of those are worth dwelling on. Multi-touch support means the component is built for tablets and phones rather than only for a desktop mouse, which is a design constraint that shows up in the drag and pan implementation. Export as SVG text is the reason the SVG choice pays off, since the graph can be handed to a document or a design tool rather than only rasterised on screen. The events are the integration surface for the rest of your application, and the reference page is where their names are.

The roadmap to v1.0 is long, and the author says so

The README is candid about the state of the project, and the section headed as a roadmap to v1.0 lists what is still in progress. Performance improvement when using large network graphs is the first item, which follows from the SVG decision. More flexible edge enhancement comes next, described as enabling flexible replacement of straight lines and bezier curves and whether animation specifications are used, with support for self-loop edges partly done. Label display customisation is on the same list, with some items marked as already achieved, such as automatic node label position adjustment and changing the z-order between labels and other objects, and items still open, such as labels on self-loop edges. Simpler CSS class name specification overall is marked as done, and the list ends with other minor improvements and enriching the related documentation. The author then explains the constraint: since this is a personal project worked on alongside other commercial work, a detailed timeline cannot be given.

MIT licensed, pnpm based, with Docker-backed visual tests

The packaging and tooling are modern, and the package.json shows the shape of the project. It is an ES module package with a single runtime dependency set of three: @dash14/svg-pan-zoom for the viewport, lodash-es for utility functions and mitt for a tiny event emitter. The layout engine is d3-force, present as a dev dependency, which points at how the graph is positioned. The build runs vue-tsc for type checking before vite build produces the lib directory, and the lint and format setup uses oxlint, oxfmt and eslint, with lefthook installed through a prepare script. Tests run under vitest, and the contributing section explains that pnpm test runs them except those in test/docker/ whose results depend on the fonts, while pnpm test:docker runs all of them in the Playwright Docker image and can update snapshots and screenshots with the -u flag. That split is the clearest signal about what the test suite is: visual regression on rendered graphs, which is why font rendering has to be pinned. The licence is MIT, and the repository also carries a RELEASING.md, a BACKERS.md and a pnpm-workspace.yaml.

Editorial conclusion

v-network-graph suits a Vue 3 application that needs an interactive network graph and wants the graph state to live in the component's own reactive data rather than behind a separate graph library. It does not suit a project that needs a production-ready component today, since the package version is a beta and the README's own roadmap to v1.0 lists performance work on large graphs and more flexible edge and label handling as still to come. Before adopting, install it with npm and register the plugin in main.ts, check that your graph sizes are within what the current renderer handles, and note that the last push to the repository was on 2026-10-22 with v0.9.23 from 2026-06-21 as the last non-beta tag.

Frequently asked questions

How do I install v-network-graph in a Vue 3 project?

Run `npm install v-network-graph`, then in main.ts import VNetworkGraph from v-network-graph, import the stylesheet from v-network-graph/lib/style.css, and call app.use(VNetworkGraph) before mounting the app. The stylesheet import is required for the graph to render with the intended appearance.

How do I use v-network-graph in a Nuxt 3 project?

Two changes. Add the stylesheet to the css array in nuxt.config.ts, and create a plugin under plugins that calls defineNuxtPlugin and registers VNetworkGraph against nuxtApp.vueApp. The README gives both snippets explicitly.

What data does v-network-graph expect for nodes and edges?

Nodes are keyed objects with fields such as a name, and edges are keyed objects with a source and a target naming node keys. The data is passed straight into the component as props and is handled reactively, so you can add or remove objects, move node positions and change appearance by changing the data.

Is v-network-graph ready for production?

The current package version is 0.10.0-beta.0, and the README lists a roadmap to v1.0 covering performance improvement on large network graphs, more flexible edge and label customisation, and enriched documentation. The last non-beta tag was v0.9.23 from 2026-06-21, and the last push to the repository was on 2026-10-22.

How do I run the v-network-graph tests?

`pnpm test` runs the vitest suite except for the tests in test/docker/, whose results depend on the fonts. `pnpm test:docker` runs all of them in the Playwright Docker image, and `pnpm test:docker -u` updates their snapshots and screenshots.

Official sources

  1. dash14/v-network-graph on GitHub
  2. License: MIT
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/dash14-v-network-graph.svg)](https://hysenlabs.com/projects/dash14-v-network-graph)

Was this useful?