Okay... So I keep finding myself googling for these GraphViz templates. Here's the ones im using for my OpenStack Savanna preso this tuesday.
This should be interesting to anyone who is either (1) interested in giving an openstack savanna talk or (2) stealing my slides and modifying them or (3) needs to spice up their graphviz chops.
UML style diagrams
|
node_group_template_master -> cluster_template [arrowhead = diamond]; node_group_template_slave -> cluster_template [arrowhead = diamond]; cluster_template -> cluster
|
Subgraphs
Here's how to make subgraphs in. I've used this to show the three stages of oozie. In this case, a super distilled subgraph : Russian dolls of the oozie layers.
|
digraph G { subgraph cluster_a { Bundle; subgraph cluster_0 { coordinator; subgraph cluster_1 { workflow;}}}} |
Node Shapes
Node shapes are important when you want to show multiple attribtues of a node (i.e. describe internal data structure).
|
digraph e {
node [shape=record]; CUSTOMER_PAGE [label="CUSTOMER_PAGE|json"]; DIRTY_CSV [label="DIRTY_CSV|fname lname -prod , price ,prod,.."]; CSV [label="CSV|fname,lname,prod,price,date,xcoord,ycoord,..."]; PROD_REC [label="PROD_REC | jay vyas, dogfood, .6"]; MAHOUT_VIEW [label="CSV for MAHOUT | x,y,prob"]; Generate -> DIRTY_CSV ; DIRTY_CSV -> pig [label="apply hash for coords, clean"]; pig -> CSV [Shape="record"]; CSV -> hive ; hive -> MAHOUT_VIEW [label="select coordinates"]; MAHOUT_VIEW -> mahout -> PROD_REC ; PROD_REC -> crunch CSV -> crunch ; crunch -> CUSTOMER_PAGE [label="s|b"];
} |
So, in the above graph, we have NODE definitions (i.e. CUSTOMER_PAGE) which use a | separator to create two parts of a box. Then we reference those node defs later on. You can also use the "node" field for a general default node type (see node [shape=record] above, which makes all shapes into records).
ER type cardinality diagrams
And finally, you can use different "arrowhead" implementations "crow", "diamond", and "empty".
|
digraph cont {
cluster_group -> node_group [arrowhead = crow];
}
|
No comments:
Post a Comment