# 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 [![Build Status](https://github.com/antvis/layout/actions/workflows/build.yml/badge.svg)](https://github.com/antvis/layout/actions) [![Coverage](https://codecov.io/gh/antvis/layout/branch/v5/graph/badge.svg)](https://app.codecov.io/gh/antvis/layout/tree/v5) [![npm Version](https://img.shields.io/npm/v/@antv/layout.svg)](https://www.npmjs.com/package/@antv/layout) [![npm Download](https://img.shields.io/npm/dm/@antv/layout.svg)](https://www.npmjs.com/package/@antv/layout) [![npm License](https://img.shields.io/npm/l/@antv/layout.svg)](https://www.npmjs.com/package/@antv/layout) AntV Layout Preview
**@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.
Website Docs API Reference Benchmark
## ✨ 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 | | --- | --- | --- | | Force [ForceAtlas2](https://layout.antv.vision/guide/api/force/force-atlas2) | ForceAtlas2 | Force-directed layout for large graphs with acceleration options (e.g. Barnes–Hut). | | Force [Force](https://layout.antv.vision/guide/api/force/force) | Force | Highly configurable force model for fine-grained tuning and process control. | | Force [Fruchterman](https://layout.antv.vision/guide/api/force/fruchterman) | Fruchterman | Classic force-directed layout for small/medium graphs with balanced distribution. | | Force [D3Force](https://layout.antv.vision/guide/api/force/d3-force) | D3Force | d3-force style simulation wrapper for composing link/manyBody/collide forces. | | Force [D3Force3D](https://layout.antv.vision/guide/api/force/d3-force-3d) | D3Force3D | 3D force layout based on d3-force-3d with z-axis forces and z output. | | Hierarchy [Dagre](https://layout.antv.vision/guide/api/hierarchy/dagre) | Dagre | Layered directed layout for DAGs, workflows, and dependency graphs. | | Hierarchy [AntVDagre](https://layout.antv.vision/guide/api/hierarchy/antv-dagre) | AntVDagre | Production-oriented hierarchical layout with spacing, alignment, and path info. | | Radial [Circular](https://layout.antv.vision/guide/api/radial/circular) | Circular | Place nodes on a circle (or spiral) with ordering, angle, and radius controls. | | Radial [Concentric](https://layout.antv.vision/guide/api/radial/concentric) | Concentric | Layer nodes by an importance score (default: degree), pulling higher scores inward. | | Radial [Radial](https://layout.antv.vision/guide/api/radial/radial) | Radial | Focus-centered rings based on shortest-path distance for relationship exploration. | | Regular [Grid](https://layout.antv.vision/guide/api/regular/grid) | Grid | Stable grid placement for predictable layouts like cards, lists, and matrices. | | Others [MDS](https://layout.antv.vision/guide/api/others/mds) | MDS | Multidimensional scaling to match ideal distances and produce a balanced global structure. | | Combo [ComboCombined](https://layout.antv.vision/guide/api/combo/combo-combined) | ComboCombined | 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.