antv-g6-graph
Installation
SKILL.md
G6 v5 Graph Visualization
Overview
G6 v5 is AntV's graph visualization engine for network diagrams, tree graphs, and relationship visualizations. It uses a declarative configuration style where new Graph({...}) defines all nodes, edges, layouts, behaviors, and plugins in one constructor call.
import { Graph } from '@antv/g6';
const graph = new Graph({
container: 'container',
data: {
nodes: [{ id: 'node-1', style: { labelText: 'Node 1' } }],
edges: [{ source: 'node-1', target: 'node-2' }],
},
layout: { type: 'force' },
behaviors: ['drag-canvas', 'zoom-canvas', 'drag-element'],
});