+
+ let header ?(graph_type = "digraph") ?(name = "g") ?(graph_attrs = []) ?node_attrs ?edge_attrs fmt =
+ fprintf fmt "@[<hv2>%s %s {@," graph_type name;
+ List.iter (fun (k, v) -> fprintf fmt "@[<hv2>%s=@,%s;@]@," k v)
+ graph_attrs;
+ (match node_attrs with
+ | Some attrs -> node "node" ~quote:false ~attrs fmt
+ | None -> ());
+ (match edge_attrs with
+ | Some attrs -> node "edge" ~quote:false ~attrs fmt
+ | None -> ())
+
+ let node = node ~quote:true
+ let edge = edge ~quote:true