Skip to content

Latest commit

 

History

History

README.md

@visactor/vgraph

VGraph is the graph visualization and analysis engine of VisActor.

Installation

npm install @visactor/vgraph

Features

  • Canvas-based graph rendering and interaction
  • Built-in nodes, edges, groups, and layouts
  • Support for custom rendering, behaviors, and graph analysis scenarios
  • TypeScript declarations bundled with the package

Quick Start

import { Graph } from '@visactor/vgraph';

const graph = new Graph({
  container: 'graph-container',
  width: 800,
  height: 600,
  setDefaultNode(node) {
    return {
      label: node.id,
      width: 120,
      height: 40
    };
  }
});

graph.data({
  nodes: [
    { id: 'Hello', x: 100, y: 100 },
    { id: 'World', x: 320, y: 100 }
  ],
  edges: [{ source: 'Hello', target: 'World' }]
});

Documentation