Skip to content

Instantly share code, notes, and snippets.

@weibeld
Last active October 31, 2017 22:27
Show Gist options
  • Save weibeld/1b8d88256c4f204c1a11fcdf4c5e5286 to your computer and use it in GitHub Desktop.
Save weibeld/1b8d88256c4f204c1a11fcdf4c5e5286 to your computer and use it in GitHub Desktop.
A small Graphviz "Hello World" program
// A small Graphviz "Hello World" program
//
// Usage:
//
// dot -Tpdf graphviz.dot >out.pdf
//
// See all supported output formats with:
//
// dot -Txxx
//
// Alternative layout algorithms: neato, fdp, twopi, circo (instead of dot)
//
// Daniel Weibel <danielmweibel@gmail.com> 14 March 2014
//----------------------------------------------------------------------------//
// A small finite state machine (FSM)
digraph fsm {
// Graph attributes
rankdir=LR;
// Node attributes
start [shape=plaintext];
1 [shape=doublecircle];
0 [label="¬p\n¬q"];
node [shape=circle];
// Edges and edge attributes
start -> 0;
0 -> 0 [label = "a,b"];
0 -> 1 [label = "b"];
1 -> 1 [label = "b"];
1 -> 2 [label = "a"];
2 -> 2 [label = "a,b"];
}
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment