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

@3plate/graph-vue

v0.1.18

Published

Vue 3 components for @3plate/graph visualization.

Downloads

116

Readme

@3plate/graph-vue

Vue 3 components for @3plate/graph visualization.

Installation

npm install @3plate/graph-vue

Usage

Basic Example

<script setup lang="ts">
import { Graph } from '@3plate/graph-vue'

const nodes = [
  { id: 'a', title: 'Start' },
  { id: 'b', title: 'Process' },
  { id: 'c', title: 'End' },
]

const edges = [
  { source: 'a', target: 'b' },
  { source: 'b', target: 'c' },
]
</script>

<template>
  <div style="width: 100%; height: 400px">
    <Graph :nodes="nodes" :edges="edges" />
  </div>
</template>

With Options

<script setup lang="ts">
import { Graph } from '@3plate/graph-vue'

const nodes = [
  { id: 'input', type: 'input', title: 'Input' },
  { id: 'process', type: 'process', title: 'Process' },
  { id: 'output', type: 'success', title: 'Output' },
]

const edges = [
  { source: 'input', target: 'process' },
  { source: 'process', target: 'output', type: 'success' },
]

const options = {
  graph: {
    orientation: 'LR',
  },
  canvas: {
    colorMode: 'dark',
    nodeTypes: {
      input: { border: '#3b82f6' },
      process: { border: '#8b5cf6' },
      success: { bg: '#f0fdf4', border: '#22c55e', text: '#166534' },
    },
    edgeTypes: {
      success: { color: '#22c55e' },
    },
  },
}
</script>

<template>
  <div style="width: 100%; height: 400px">
    <Graph :nodes="nodes" :edges="edges" :options="options" />
  </div>
</template>

With Events

<script setup lang="ts">
import { Graph } from '@3plate/graph-vue'

const nodes = [
  { id: 'a', title: 'Node A' },
  { id: 'b', title: 'Node B' },
]

const edges = [{ source: 'a', target: 'b' }]

const events = {
  nodeClick: (node) => console.log('Clicked:', node),
  edgeClick: (edge) => console.log('Edge clicked:', edge),
  historyChange: (index, length) => {
    console.log(`Step ${index + 1} of ${length}`)
  },
}
</script>

<template>
  <div style="width: 100%; height: 400px">
    <Graph :nodes="nodes" :edges="edges" :events="events" />
  </div>
</template>

With Real-time Ingestion

<script setup lang="ts">
import { Graph } from '@3plate/graph-vue'

// WebSocket ingestion
const ingestion = {
  type: 'websocket' as const,
  url: 'ws://localhost:8787',
}
</script>

<template>
  <div style="width: 100%; height: 400px">
    <Graph :ingestion="ingestion" />
  </div>
</template>

Reactive Updates

The component automatically handles reactive prop changes:

<script setup lang="ts">
import { ref } from 'vue'
import { Graph } from '@3plate/graph-vue'

const nodes = ref([
  { id: 'a', title: 'Start' },
  { id: 'b', title: 'End' },
])

const edges = ref([{ source: 'a', target: 'b' }])

function addNode() {
  const id = `node-${Date.now()}`
  nodes.value = [...nodes.value, { id, title: `Node ${id}` }]
  edges.value = [...edges.value, { source: 'a', target: id }]
}
</script>

<template>
  <button @click="addNode">Add Node</button>
  <div style="width: 100%; height: 400px">
    <Graph :nodes="nodes" :edges="edges" />
  </div>
</template>

Props

| Prop | Type | Description | |-------------|-------------------|---------------------------------| | nodes | N[] | Array of node objects | | edges | E[] | Array of edge objects | | history | Update<N, E>[] | History updates for time-travel | | ingestion | IngestionConfig | WebSocket or file source config | | options | APIOptions | Graph and canvas options | | events | EventsOptions | Event handlers |

Playground Component

The Playground component provides a full-featured demo environment:

<script setup lang="ts">
import { Playground } from '@3plate/graph-vue'

const examples = {
  simple: {
    name: 'Simple Graph',
    description: 'A basic graph example',
    nodes: [
      { id: 'a', title: 'Start' },
      { id: 'b', title: 'End' },
    ],
    edges: [{ source: 'a', target: 'b' }],
  },
  complex: {
    name: 'Complex Graph',
    description: 'A more complex example',
    nodes: [
      { id: '1', title: 'Input' },
      { id: '2', title: 'Process A' },
      { id: '3', title: 'Process B' },
      { id: '4', title: 'Output' },
    ],
    edges: [
      { source: '1', target: '2' },
      { source: '1', target: '3' },
      { source: '2', target: '4' },
      { source: '3', target: '4' },
    ],
  },
}
</script>

<template>
  <div style="width: 100%; height: 600px">
    <Playground :examples="examples" default-example="simple" />
  </div>
</template>

Features

  • Reactive updates — Props changes are efficiently diffed and applied
  • Incremental history — Appended history updates are applied incrementally
  • Style updates — Theme and type changes are applied without re-render
  • Color mode — Light/dark mode changes are applied instantly
  • Cleanup — Resources are properly cleaned up on unmount
  • Playground — Full-featured demo environment with example switching