twopi
Calculate area and circumference of a circle
TLDR
Render a PNG image with a filename based on the input filename and output format (uppercase -O)
Render a SVG image with the specified output filename (lowercase -o)
Render the output in PS, PDF, SVG, Fig, PNG, GIF, JPEG, JSON, or DOT format
Render a GIF image using stdin and stdout
Display help
SYNOPSIS
twopi [options] [infile.dot]
twopi [options]
PARAMETERS
-T
Sets the output format. Common formats include dot (Graphviz native format with layout), png, svg, pdf, etc.
-o
Specifies the output file name. If omitted, output goes to standard output.
-V
Prints version information for twopi and exits.
-h
Prints a usage message (help) and exits.
-G
Sets a global graph attribute. For example, -Gbgcolor=lightgrey or -Goverlap=scale.
-N
Sets a default node attribute. For example, -Nshape=circle or -Ncolor=blue.
-E
Sets a default edge attribute. For example, -Ecolor=red or -Earrowhead=none.
-s[
Prints progress messages to standard error. An optional level can specify verbosity, e.g., -s2.
-v
Enables verbose output, showing more details about the layout process.
-q
Suppresses warning messages during processing.
DESCRIPTION
twopi is one of the specialized layout programs provided by the Graphviz graph visualization software suite. Its primary function is to lay out graphs in a radial fashion, arranging nodes on concentric circles. This makes it particularly effective for visualizing large, highly connected graphs where a central node or a set of central nodes connects to many others, creating a "star-like" or "wheel-like" structure.
twopi takes a graph description in the DOT language as input, either from a file or standard input, and produces output in various formats such as DOT (with layout coordinates), SVG, PNG, PDF, and others. Unlike some other Graphviz layout engines that optimize for minimizing edge crossings or uniform node distribution, twopi focuses on revealing hierarchical or central relationships through its circular arrangement, positioning nodes based on their distance from a designated root or central point within the graph.
CAVEATS
twopi is a component of the Graphviz suite, not a standard core Linux command. It must be installed separately as part of the Graphviz package. Its radial layout algorithm is specifically designed for graphs with a clear central node or a hub-and-spoke structure, and may not yield optimal or intuitive layouts for all types of graphs, particularly those requiring strict hierarchical or orthogonal representations. Input graphs must be provided in the DOT language format.
While efficient for its intended purpose, performance for extremely dense or massive graphs might require significant computational resources.
INPUT AND OUTPUT FORMATS
twopi primarily takes graph descriptions in the DOT language as input, which can be provided via standard input or a specified file. For output, it can generate a wide range of formats, including but not limited to, postscript (ps), portable document format (pdf), scalable vector graphics (svg), and various bitmap formats like png and jpeg. It can also output a DOT file with layout coordinates embedded, allowing further processing by other Graphviz tools or for inspection of the computed layout.
LAYOUT ALGORITHM PRINCIPLES
The core of twopi's algorithm involves positioning nodes on concentric circles. The placement is often determined by the distance of nodes from a designated 'root' node (or set of roots) in the graph, with nodes at similar distances placed on the same circle. This radial approach is highly effective for emphasizing centrality and relationships radiating outwards, making it suitable for tree-like structures, hub-and-spoke models, or network graphs where the notion of 'distance from center' is a meaningful aspect of the data.
HISTORY
twopi is one of the several specialized layout engines developed as part of the Graphviz (Graph Visualization Software) project, which originated at AT&T Labs Research. Graphviz itself emerged from pioneering research into graph drawing algorithms and has been under continuous development since the late 1990s.
The twopi algorithm was specifically designed to address the visualization challenges of graphs where a radial or concentric arrangement best illustrates relationships, often involving a central node or a set of highly connected 'hub' nodes. Its inclusion broadened the capabilities of Graphviz, providing a dedicated tool for radial layouts alongside other engines like dot (hierarchical), neato (force-directed), and circo (circular layouts), allowing users to choose the most appropriate layout style for their specific graph data.