2019-11-20 10:47:11 +08:00
---
2019-12-02 19:58:02 +08:00
title: Introduction
2019-11-20 10:47:11 +08:00
order: 0
redirect_from:
- /en/docs/manual
---
< img src = 'https://user-images.githubusercontent.com/6113694/45008751-ea465300-b036-11e8-8e2a-166cbb338ce2.png' width = '750' height = '250' / >
[![ ](https://img.shields.io/travis/antvis/g6.svg )](https://travis-ci.org/antvis/g6)
2020-02-11 16:23:11 +08:00
[![Coverage Status ](https://coveralls.io/repos/github/antvis/G6/badge.svg )](https://coveralls.io/github/antvis/G6)
2019-11-20 10:47:11 +08:00
![](https://img.shields.io/badge/language-javascript-red.svg)
![](https://img.shields.io/badge/license-MIT-000000.svg)
[![npm package ](https://img.shields.io/npm/v/@antv/g6.svg )](https://www.npmjs.com/package/@antv/g6)
[![NPM downloads ](http://img.shields.io/npm/dm/@antv/g6.svg )](https://npmjs.org/package/@antv/g6)
[![Percentage of issues still open ](http://isitmaintained.com/badge/open/antvis/g6.svg )](http://isitmaintained.com/project/antvis/g6 "Percentage of issues still open")
2019-12-02 19:58:02 +08:00
[中文简介 ](/zh/docs/manual/introduction/ )
2019-11-20 10:47:11 +08:00
2019-12-02 19:58:02 +08:00
## What is G6
2020-01-13 20:36:19 +08:00
< a href = 'https://github.com/antvis/g6' target = '_blank' > G6< / a > is a graph visualization engine, which provides a set of basic mechanisms, including rendering, layout, analysis, interaction, animation, and other auxiliary tools. G6 aims to simplify the complex relationships, and help people to obtain the insight of relational data.
2019-11-20 10:47:11 +08:00
2019-12-02 19:58:02 +08:00
< img src = 'https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*zTjwQaXokeQAAAAAAAAAAABkARQnAQ' width = 550 / >
2019-11-20 10:47:11 +08:00
2019-12-02 19:58:02 +08:00
Developers are able to build graph visualization **analysis** applications or graph visualization **modeling** applications easily.
2019-11-20 10:47:11 +08:00
< img src = "https://user-images.githubusercontent.com/6113694/44995293-02858600-afd5-11e8-840c-349e4730d63d.gif" height = 150 > < img src = "https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*I9OdTbXJIi0AAAAAAAAAAABkARQnAQ" height = 150 > < img src = "https://user-images.githubusercontent.com/6113694/44995332-2ba61680-afd5-11e8-8cab-db0e9d08ceb7.gif" height = 150 >
< img src = "https://gw.alipayobjects.com/zos/rmsportal/HQxYguinFOMIXrGQOABY.gif" height = 150 > < img src = "https://gw.alipayobjects.com/zos/rmsportal/nAugyFgrbrUWPmDIDiQm.gif" height = 150 > < img src = "https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*xoufSYcjK2AAAAAAAAAAAABkARQnAQ" height = 150 >
2020-01-13 20:36:19 +08:00
> Powerful Layouts
< img src = 'https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*dJT3SIVta6QAAAAAAAAAAABkARQnAQ' width = 800 / >
> Powerful Animation and Interactions
2019-12-02 19:58:02 +08:00
## Features
2020-02-07 17:02:07 +08:00
- Excellent Perforamnce: Supports large graph visualization and interactive exploration;
2019-12-02 19:58:02 +08:00
- Abundant Built-in Items: Nodes and edges with free configurations;
- Steerable Interactions: More than 10 basic interaction behaviors ;
- Powerful Layouts: More than 10 layout algorithms;
- Convenient Components: Outstanding abilities and performance;
- Friendly User Experience: Complete documents for different levels of requirements. TypeScript supported.
2019-11-20 10:47:11 +08:00
2019-12-02 19:58:02 +08:00
G6 concentrates on the principle of 'good by default'. In addition, the custom mechanism of the item, interation behavior, and layout satisfies the customization requirements.
2019-11-20 10:47:11 +08:00
2019-12-02 19:58:02 +08:00
< img src = 'https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*Y0c6S7cxjVkAAAAAAAAAAABkARQnAQ' width = 800 / >
2019-11-20 10:47:11 +08:00
2019-12-02 19:58:02 +08:00
> Abundant Built-in Items
2019-11-20 10:47:11 +08:00
2019-12-02 19:58:02 +08:00
## Installation
```bash
$ npm install @antv/g6
```
## Usage
2019-11-20 10:47:11 +08:00
< img src = 'https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*srtDT5slbN8AAAAAAAAAAABkARQnAQ' width = 400 >
```javascript
2019-12-02 19:58:02 +08:00
// The source data
2019-11-20 10:47:11 +08:00
const data = {
2019-12-02 19:58:02 +08:00
// The array of nodes
2019-11-20 10:47:11 +08:00
nodes: [{
id: 'node1',
x: 100,
y: 200
},{
id: 'node2',
x: 300,
y: 200
}],
2019-12-02 19:58:02 +08:00
// The array of edges
2019-11-20 10:47:11 +08:00
edges: [
2019-12-02 19:58:02 +08:00
// An edge links from node1 to node2
2019-11-20 10:47:11 +08:00
{
source: 'node1',
target: 'node2'
}
]
};
2019-12-02 19:58:02 +08:00
// Instantiate the Graph
2019-11-20 10:47:11 +08:00
const graph = new G6.Graph({
2019-12-02 19:58:02 +08:00
container: 'mountNode', // The container id or HTML node of the graph canvas.
// The width and the height of graph canvas
2019-11-20 10:47:11 +08:00
width: 800,
height: 500
});
2019-12-02 19:58:02 +08:00
// Load the data
2019-11-20 10:47:11 +08:00
graph.data(data);
2019-12-02 19:58:02 +08:00
// Render the graph
2019-11-20 10:47:11 +08:00
graph.render();
```
2019-12-02 19:58:02 +08:00
[![Edit compassionate-lalande-5lxm7 ](https://codesandbox.io/static/img/play-codesandbox.svg )](https://codesandbox.io/s/compassionate-lalande-5lxm7?fontsize=14& hidenavigation=1& theme=dark)
2020-01-13 20:36:19 +08:00
For more information about the usage, please refer to [Getting Started ](/en/docs/manual/getting-started ).
2019-11-20 10:47:11 +08:00
2019-12-02 19:58:02 +08:00
## Documents
- [Tutorial ](/en/docs/manual/tutorial/preface )
2020-01-13 20:36:19 +08:00
- [Key Concepts ](/en/docs/manual/middle/graph )
- [Advanced Guides ](/en/docs/manual/advanced/keyconcept/shape-and-properties )
2019-12-02 19:58:02 +08:00
- [API Reference ](/en/docs/api/Graph )
2019-11-20 10:47:11 +08:00
2019-12-02 19:58:02 +08:00
## Links
Some implementations combined with front-end libraries from the third party:
2019-11-20 10:47:11 +08:00
2020-01-13 20:36:19 +08:00
- < a href = 'https://github.com/guozhaolong/wfd' target = '_blank' > Flow visualization editor powered by G6 and React - Workflow Designer</ a > ;
- < a href = 'https://github.com/caoyu48/vue-g6-editor' target = '_blank' > Visualization editor powered by G6 and Vue</ a > ;
- < a href = 'https://github.com/OXOYO/X-Flowchart-Vue' target = '_blank' > Visualization and graphics editor powered by G6 and Vue - A visual graph editor based on G6 and Vue</ a > .
2019-12-02 19:58:02 +08:00
## G6 Communication Group
Users are welcome to join the **G6 Communication Group** (It is a DingTalk group). We are also welcome the github issues.
2019-11-20 10:47:11 +08:00
< img src = 'https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*dsXsSpgynmUAAAAAAAAAAABkARQnAQ' width = 400 >
2019-12-02 19:58:02 +08:00
## How to Contribute
2019-11-20 10:47:11 +08:00
2020-01-13 20:36:19 +08:00
Please let us know what you are you going to help. Do check out < a href = 'https://github.com/antvis/g6/issues' target = '_blank' > issues< / a > for bug reports or suggestions first.
2019-12-02 19:58:02 +08:00
2020-01-13 20:36:19 +08:00
To become a contributor, please follow our < a href = 'https://github.com/antvis/g6/blob/master/CONTRIBUTING.md' target = '_blank' > Contributing Guide< / a > .
2019-11-20 10:47:11 +08:00
## License
2020-01-13 20:36:19 +08:00
< a href = 'https://github.com/antvis/g6/blob/master/LICENSE' target = '_blank' > MIT license< / a > .
2019-12-02 19:58:02 +08:00
2019-11-20 10:47:11 +08:00