let get_subgraph v =
let mk_subgraph name attrib =
let attrib = (`Style `Filled) :: attrib in
Some { Graph.Graphviz.DotAttributes.sg_name= name;
Graph.Graphviz.DotAttributes.sg_attributes = attrib }
in
let f_subgraph fi =
let name = M.fi_name fi in
let attrib = [`Label ""] in
let color = match fi_type fi with
| Undef -> (`Fillcolor color_medium_yellow)
| PersistSelect -> (`Fillcolor color_medium_orange)
| Other -> (`Fillcolor color_medium_green)
in let attrib = color :: attrib in
mk_subgraph name attrib
in
let rq_subgraph =
let name = "Requests" in
let attrib = [] in
let attrib = (`Fillcolor color_medium_pink) :: attrib in
let attrib = (`Label name) :: attrib in
mk_subgraph name attrib
in match v with
| Src fi -> f_subgraph fi
| Slice ff -> f_subgraph (M.ff_fi ff)
| Action _ -> rq_subgraph
| OptSlicingLevel _ | OptSliceCallers _ -> rq_subgraph