← 返回命令列表

Linux command

xdot 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Open a dot file

xdot [path/to/graph.dot]

Open with a specific filter

xdot -f [neato] [path/to/graph.dot]

Read a graph from stdin

[command] | xdot

Open with a custom window size

xdot -g [800x600] [path/to/graph.dot]

Use circo layout

xdot -f circo [path/to/graph.dot]

Generate and view

echo "digraph { A -> B -> C }" | xdot

说明

xdot is an interactive viewer for graphs written in Graphviz's DOT language. It provides a GTK-based graphical interface for exploring graph visualizations with smooth zooming and panning capabilities. Unlike static image exports, xdot renders graphs interactively, allowing users to zoom in on complex graphs, pan across large diagrams, and explore node relationships. The viewer supports mouse wheel zooming, click-and-drag panning, and keyboard navigation. Clicking on nodes or edges with URL attributes opens the associated links. The tool supports all standard Graphviz layout engines through the -f option, making it suitable for various graph types: hierarchical (dot), undirected spring models (neato, fdp), radial (twopi), circular (circo), and clustered layouts (osage, patchwork). Xdot can read from files or stdin, making it useful in pipelines where graphs are generated dynamically. It automatically reloads the file when changes are detected, useful during iterative graph development.

参数

-f _filter_
Use the specified Graphviz filter (dot, neato, twopi, circo, fdp, sfdp, osage, patchwork). Default is dot.
-n
Assume the input is already laid out (no layout computation).
-g _WxH_
Set the initial window geometry (width x height).
--help
Display help information.
--version
Display version information.

FAQ

What is the xdot command used for?

xdot is an interactive viewer for graphs written in Graphviz's DOT language. It provides a GTK-based graphical interface for exploring graph visualizations with smooth zooming and panning capabilities. Unlike static image exports, xdot renders graphs interactively, allowing users to zoom in on complex graphs, pan across large diagrams, and explore node relationships. The viewer supports mouse wheel zooming, click-and-drag panning, and keyboard navigation. Clicking on nodes or edges with URL attributes opens the associated links. The tool supports all standard Graphviz layout engines through the -f option, making it suitable for various graph types: hierarchical (dot), undirected spring models (neato, fdp), radial (twopi), circular (circo), and clustered layouts (osage, patchwork). Xdot can read from files or stdin, making it useful in pipelines where graphs are generated dynamically. It automatically reloads the file when changes are detected, useful during iterative graph development.

How do I run a basic xdot example?

Run `xdot [path/to/graph.dot]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -f _filter_ do in xdot?

Use the specified Graphviz filter (dot, neato, twopi, circo, fdp, sfdp, osage, patchwork). Default is dot.