- let last_round = try fst (M.max_binding m) with Not_found -> 0 in
- let s_node = "node" ^ (string_of_int (T.preorder tree node)) in
- fprintf odot "%s[ id=\"%s\" label=\"%s\" style=filled fillcolor=\"%f,1.0,1.0\"];\n"
- s_node s_node (QName.to_string (T.tag tree node))
- (0.2 *. (1.0 -. (float last_round /. float !max_round))) ;
+ let node_id = T.preorder tree node in
+ let marked, last_round = try Hashtbl.find final node_id with Not_found ->
+ Printf.eprintf ">>> %i\n%!" node_id; false, !max_round;
+ in
+ let pc = if !max_round == 0 then 1. else float_of_int last_round /. float_of_int !max_round in
+ let scolor, tcolor =
+ let { sat ; todo; _ } = List.hd(M.find last_round m) in
+ let c = (last_round, sat, todo) in color c, text_color c
+ in
+ let tag = QName.to_string (T.tag tree node) in
+ let lbox = (String.length tag + 2) * 10 in
+ let s_node = "node" ^ (string_of_int node_id) in
+ fprintf osvg "<rect id=\"%s\" onclick=\"activate(\'%s\');\" x=\"%i\" y=\"%i\" width=\"%i\" height=\"20\" style=\"fill:%s;stroke:rgb(0,0,0)%s\"/>\n%!"
+ s_node s_node x y lbox scolor (if marked then ";stroke-width:4" else ";stroke-width:2;stroke-dasharray:2,2");
+ fprintf osvg "<text x=\"%i\" y=\"%i\" style=\"fill:%s;font-size:17;font-family:typewriter;\" onclick=\"activate(\'%s\');\" >%s</text>\n" (x+10) (y+15) tcolor s_node tag;