2023-08-31 01:43:08 +08:00
|
|
|
|
---
|
|
|
|
|
title: README
|
|
|
|
|
---
|
|
|
|
|
|
2023-08-29 18:39:28 +08:00
|
|
|
|
Overview / [Modules](modules.en.md)
|
2023-08-29 15:38:07 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
# G6 API Core Modules
|
|
|
|
|
|
|
|
|
|
- [behaviors](modules/behaviors.en.md)
|
|
|
|
|
- [graph](modules/graph.en.md)
|
|
|
|
|
- [item](modules/item.en.md)
|
|
|
|
|
- [layout](modules/layout.en.md)
|
|
|
|
|
- [plugins](modules/plugins.en.md)
|
|
|
|
|
- [types](modules/types.en.md)
|
|
|
|
|
- [util](modules/util.en.md)
|
|
|
|
|
|
2023-08-29 15:38:07 +08:00
|
|
|
|
```jsx
|
|
|
|
|
import { Graph, Util } from '@antv/g6';
|
|
|
|
|
const data = Util.mock(6).circle();
|
|
|
|
|
|
|
|
|
|
const graph = new Graph({
|
|
|
|
|
container: 'container',
|
|
|
|
|
width: 500,
|
|
|
|
|
height: 500,
|
|
|
|
|
data,
|
|
|
|
|
layout: {
|
|
|
|
|
type: 'grid',
|
|
|
|
|
},
|
|
|
|
|
plugins: [
|
|
|
|
|
{
|
|
|
|
|
key: 'minimap',
|
|
|
|
|
type: 'minimap',
|
|
|
|
|
size: [300, 200],
|
|
|
|
|
mode: 'delegate',
|
|
|
|
|
delegateStyle: {
|
|
|
|
|
fill: 'red',
|
|
|
|
|
},
|
|
|
|
|
className: 'g6-minimap-2',
|
|
|
|
|
viewportClassName: 'g6-minimap-viewport-2',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const nodes = graph.getAllNodesData();
|
|
|
|
|
const nodes = graph.getAllNodesData();
|
|
|
|
|
|
|
|
|
|
graph.on('node:click', (e) => {});
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
# Introduce
|
|
|
|
|
|
|
|
|
|
In the above code snippet, we may want to know more about what G6 has to offer, in which case we will need the G6 API documentation
|
|
|
|
|
|
|
|
|
|
#### What types, methods and classes are exported in the '@antv/g6' package?
|
|
|
|
|
|
2023-08-29 18:39:28 +08:00
|
|
|
|
- [Graph](./classes/graph.Graph.en.md)
|
|
|
|
|
- [Util](./module/utils.en.md)
|
2023-08-29 15:38:07 +08:00
|
|
|
|
|
|
|
|
|
#### What is Specification which in `new Graph(Specification)`?
|
|
|
|
|
|
2023-08-29 18:39:28 +08:00
|
|
|
|
- [Specification](./interfaces/types.Specification.en.md)
|
2023-08-29 15:38:07 +08:00
|
|
|
|
|
|
|
|
|
#### What are the detailed parameters of the plugins ?
|
|
|
|
|
|
2023-08-29 18:39:28 +08:00
|
|
|
|
- [Plugins](./modules/plugins.en.md)
|