# layout
**Repository Path**: mirrors_antvis/layout
## Basic Information
- **Project Name**: layout
- **Description**: Layout algorithms for graphs.
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: v5
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 1
- **Created**: 2020-12-03
- **Last Updated**: 2026-02-14
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# AntV Layout
Basic layout algorithms for visualization
[](https://github.com/antvis/layout/actions)
[](https://app.codecov.io/gh/antvis/layout/tree/v5)
[](https://www.npmjs.com/package/@antv/layout)
[](https://www.npmjs.com/package/@antv/layout)
[](https://www.npmjs.com/package/@antv/layout)
**@antv/layout** is a collection of basic layout algorithms. It ships with a wide range of layouts, unifies graph data and layout APIs, and turns graph structures into renderable coordinates.
## ✨ Highlights
- **Coverage**: common graph layouts (force, dagre, radial, grid, combo)
- **Built for visualization**: real-world scenarios and workflows
- **Performance**: fast defaults + optional WebWorker offloading
- **Integration**: easy to plug into your rendering pipeline
- **TypeScript & docs**: typed APIs with complete documentation
## 🧩 Layouts
| Layout | Preview | Description |
| --- | --- | --- |
|
[ForceAtlas2](https://layout.antv.vision/guide/api/force/force-atlas2) |
| Force-directed layout for large graphs with acceleration options (e.g. Barnes–Hut). |
|
[Force](https://layout.antv.vision/guide/api/force/force) |
| Highly configurable force model for fine-grained tuning and process control. |
|
[Fruchterman](https://layout.antv.vision/guide/api/force/fruchterman) |
| Classic force-directed layout for small/medium graphs with balanced distribution. |
|
[D3Force](https://layout.antv.vision/guide/api/force/d3-force) |
| d3-force style simulation wrapper for composing link/manyBody/collide forces. |
|
[D3Force3D](https://layout.antv.vision/guide/api/force/d3-force-3d) |
| 3D force layout based on d3-force-3d with z-axis forces and z output. |
|
[Dagre](https://layout.antv.vision/guide/api/hierarchy/dagre) |
| Layered directed layout for DAGs, workflows, and dependency graphs. |
|
[AntVDagre](https://layout.antv.vision/guide/api/hierarchy/antv-dagre) |
| Production-oriented hierarchical layout with spacing, alignment, and path info. |
|
[Circular](https://layout.antv.vision/guide/api/radial/circular) |
| Place nodes on a circle (or spiral) with ordering, angle, and radius controls. |
|
[Concentric](https://layout.antv.vision/guide/api/radial/concentric) |
| Layer nodes by an importance score (default: degree), pulling higher scores inward. |
|
[Radial](https://layout.antv.vision/guide/api/radial/radial) |
| Focus-centered rings based on shortest-path distance for relationship exploration. |
|
[Grid](https://layout.antv.vision/guide/api/regular/grid) |
| Stable grid placement for predictable layouts like cards, lists, and matrices. |
|
[MDS](https://layout.antv.vision/guide/api/others/mds) |
| Multidimensional scaling to match ideal distances and produce a balanced global structure. |
|
[ComboCombined](https://layout.antv.vision/guide/api/combo/combo-combined) |
| Composite layout for combos/subgraphs with per-level strategies and consistent bounds/spacing. |
## 🚀 Installation
```bash
npm install @antv/layout
```
## 📝 Quick Start
```ts
import { CircularLayout } from '@antv/layout';
const data = {
nodes: [{ id: 'node1' }, { id: 'node2' }, { id: 'node3' }],
edges: [
{ source: 'node1', target: 'node2' },
{ source: 'node2', target: 'node3' },
],
};
async function run() {
const layout = new CircularLayout({ center: [200, 200], radius: 150 });
await layout.execute(data);
layout.forEachNode((node) => {
console.log(node.id, node.x, node.y);
});
}
run();
```
## 🧵 Worker support
Set `enableWorker: true` to run layouts in a WebWorker when supported. See the docs for worker setup and layout configuration details.
## 🤝 Contributing
Contributions are welcome. See `CONTRIBUTING.md` for guidelines and local workflows.
## 📄 License
MIT licensed. See `LICENSE` for details.