Scripts2026年7月21日·1 分钟阅读

Graphviz — Open-Source Graph Visualization Software

A mature open-source graph visualization toolkit that renders structural information as diagrams from a simple text-based DOT language description.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
Graphviz Overview
直接安装命令
npx -y tokrepo@latest install f9566caf-84c1-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

Introduction

Graphviz is an open-source graph visualization toolkit originally developed at AT&T Labs. It takes descriptions of graphs in the DOT text language and automatically computes layouts, rendering them as SVG, PNG, PDF, and other formats. It has been a standard tool in software engineering, networking, and data science for over two decades.

What Graphviz Does

  • Renders directed and undirected graphs from DOT language descriptions
  • Automatically computes node positions using multiple layout algorithms
  • Outputs to SVG, PNG, PDF, PostScript, and other image formats
  • Provides programmatic APIs for C, Python, Java, and other languages
  • Supports subgraphs, clusters, custom node shapes, and edge styling

Architecture Overview

Graphviz consists of several layout engines, each implementing a different graph drawing algorithm. The dot engine handles hierarchical directed graphs using a layered approach. neato and fdp use force-directed placement for undirected graphs. circo creates circular layouts and twopi produces radial layouts. All engines read the same DOT input format and share the same rendering backend.

Self-Hosting & Configuration

  • Install from system package managers on Linux, macOS, or Windows
  • Use the command-line tools directly: dot, neato, fdp, circo, twopi, sfdp
  • Integrate via Python bindings (graphviz package on PyPI)
  • Customize graph appearance with DOT attributes for nodes, edges, and clusters
  • Generate DOT files programmatically from any language and pipe to Graphviz

Key Features

  • Multiple layout algorithms for different graph topologies
  • DOT language provides a readable text-based graph description format
  • Extensive output format support including SVG and PDF
  • Language bindings for Python, C, Java, and more
  • Battle-tested reliability across decades of production use

Comparison with Similar Tools

  • Mermaid — Markdown-embedded diagrams rendered in browsers; Graphviz provides more layout algorithms and output formats
  • D2 — Modern declarative diagram language; Graphviz has broader ecosystem support and more layout engines
  • PlantUML — UML-focused diagramming; Graphviz handles arbitrary graph structures beyond UML
  • draw.io — Interactive visual editor; Graphviz is code-first with automatic layout computation

FAQ

Q: What is the DOT language? A: DOT is a plain-text graph description language. You define nodes and edges, and Graphviz computes the layout automatically.

Q: Can Graphviz handle large graphs? A: Yes. The sfdp engine is designed for graphs with thousands of nodes. For very large graphs, use sfdp or the sparse mode in neato.

Q: Is Graphviz still maintained? A: Yes. Graphviz is actively maintained on GitLab and GitHub with regular releases.

Q: Can I use Graphviz in a web application? A: Yes. Use the Viz.js or @hpcc-js/wasm libraries that compile Graphviz to WebAssembly for in-browser rendering.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产