Skip to content

Installation

npm

# npm
npm install @antv/g6 --save

# pnpm
pnpm add @antv/g6

# yarn
yarn add @antv/g6

Import G6 in the code:

import { Graph } from '@antv/g6';

Visit G6 npm Example to view the complete example code.

CDN

@antv/g6 Available on multiple CDNs:

Import G6 using a script tag:

<script src="https://unpkg.com/@antv/g6@5/dist/g6.min.js"></script>

Visit G6 CDN Example to view the complete example code.

© Copyright 2026 Ant Group Co., Ltd..备案号:京ICP备15032932号-38
Site search
Documentation and examplesType to start searching

Search documentation, APIs, and examples

↑↓Select↵OpenEscClose