LinuxCommandLibrary

circo

Synthesize digital circuits into gate networks

TLDR

Render a PNG image with a filename based on the input filename and output format (uppercase -O)

$ circo -T [png] -O [path/to/input.gv]
copy

Render a SVG image with the specified output filename (lowercase -o)
$ circo -T [svg] -o [path/to/image.svg] [path/to/input.gv]
copy

Render the output in PS, PDF, SVG, Fig, PNG, GIF, JPEG, JSON, or DOT format
$ circo -T [format] -O [path/to/input.gv]
copy

Render a GIF image using stdin and stdout
$ echo "[digraph {this -> that} ]" | circo -T [gif] > [path/to/image.gif]
copy

Display help
$ circo -?
copy

SYNOPSIS

circo [options] [input_file(s)]

PARAMETERS

-T
    Specifies the output format. Common formats include 'png', 'svg', 'jpeg', 'pdf', 'ps'.

-o
    Writes the output to the specified file. If omitted, output goes to standard output (stdout).

-V
    Prints version information and exits.

-G=
    Sets a global graph attribute. For example, '-Gbgcolor=lightgrey'.

-N=
    Sets a default node attribute. For example, '-Nshape=circle'.

-E=
    Sets a default edge attribute. For example, '-Ecolor=blue'.

-s[]
    Scales the graph by the given factor. If no scale is given, it scales to fit the output page.

-y
    Inverts the y-coordinate in the output. Useful for systems with inverted y-axes.

-v
    Enables verbose mode, providing more detailed information during processing.

-L
    Sets the logging level (0=none, 1=errors, 2=warnings, 3=info, 4=debug).

DESCRIPTION

The circo command is a layout engine from the Graphviz suite of open-source graph visualization software. It is specifically designed to produce circular or radial layouts of graphs, making it suitable for visualizing network topologies, phylogenetic trees, or any structure where nodes are arranged around a central point or in concentric circles. Unlike general-purpose layout algorithms that might spread nodes out in a grid or force-directed manner, circo attempts to position nodes on circles, often based on their connectivity or structural properties.

It takes graph descriptions written in the DOT language as input and outputs a graph in various formats, such as images (PNG, SVG, JPEG) or document formats (PDF, PostScript). It is part of a family of Graphviz layout engines, each optimized for different graph characteristics and visualization goals.

CAVEATS

The circo command is not a standard standalone Linux utility but a specialized tool within the Graphviz package. It requires graph descriptions in the DOT language as input. If Graphviz is not installed, circo will not be available. Its primary function is graph layout, not general-purpose file processing.

USAGE WORKFLOW

The typical workflow for using circo involves creating a graph description in the DOT language (usually in a file with a .dot extension), then processing it with circo to generate an output image or document. For example, consider a simple graph:

digraph G {
  A -> B;
  B -> C;
  C -> A;
  D -> A;
  D -> E;
  E -> F;
  F -> D;
}


Save this content as mygraph.dot. To generate a PNG image with a circular layout, you would run:

circo -Tpng -o mygraph.png mygraph.dot

This command processes mygraph.dot using the circo layout engine and saves the resulting image to mygraph.png.

HISTORY

circo is an integral part of the Graphviz project, which was initially developed at AT&T Labs Research for various graph drawing applications. Graphviz, including circo, has been under continuous development since the late 1990s, evolving to support diverse graph visualization needs. circo specifically addresses the demand for circular or radial graph layouts, offering a unique perspective compared to other algorithms like force-directed or hierarchical layouts.

SEE ALSO

dot(1), neato(1), fdp(1), sfdp(1), twopi(1), gvpr(1), gvedit(1)

Copied to clipboard