How to run graphviz on the Mac

Install graphviz for Mac from graphviz.org.

To check the installation, open a Terminal and type : dot -h


$ dot -h
dot: option -h unrecognized

Usage: dot [-Vv?] [-(GNE)name=val] [-(KTlso)<val>] <dot files>
...

OK, so dot was installed and added to your $PATH.

Next, create a dot source file and launch dot : dot -T png -O my1st.dot

For example :

digraph d {
 A [label="Hello"]
 B [label="World"]
 C [label="Everyone"]
 A -> { B C }
}

This will create a new file my1st.dot.png that looks like this :

For more about graphviz, look at the gallery and other resources on the graphviz website, or google for more.

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s