Proyectos
Ver en GitHub
antvis/layout
Acerca de
A connection of basic layout algorithms for graphs.
Herramientas de desarrolloWhat you can do
- 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
Crecimiento de estrellas medido
- in 24h
- 0
- in 7 days
- -1
- in 15 days
- +1
- in 1 month
- Recopilando historial
Cambios netos en períodos que se solapan, no totales diarios. Los datos no disponibles se dejan en blanco. Las estrellas indican interés, no calidad.
README.md
Original@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 | Description |
|---|---|
| Force-directed layout for large graphs with acceleration options (e.g. Barnes–Hut). | |
| Highly configurable force model for fine-grained tuning and process control. | |
| Classic force-directed layout for small/medium graphs with balanced distribution. | |
| d3-force style simulation wrapper for composing link/manyBody/collide forces. | |
| 3D force layout based on d3-force-3d with z-axis forces and z output. | |
| Layered directed layout for DAGs, workflows, and dependency graphs. | |
| Production-oriented hierarchical layout with spacing, alignment, and path info. | |
| Arrange root, categories, and items in a fishbone diagram. | |
| Display tree nodes in DFS order with depth-based indentation. | |
| Arrange branches on one or both sides of a central root. | |
| Place nodes on a circle (or spiral) with ordering, angle, and radius controls. | |
| Layer nodes by an importance score (default: degree), pulling higher scores inward. | |
| Focus-centered rings based on shortest-path distance for relationship exploration. | |
| Stable grid placement for predictable layouts like cards, lists, and matrices. | |
| Multidimensional scaling to match ideal distances and produce a balanced global structure. | |
| Composite layout for combos/subgraphs with per-level strategies and consistent bounds/spacing. |
🚀 Installation
npm install @antv/layout
📝 Quick Start
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.
Explorar proyectos relacionados
Cargando…