Skip to content

Commit

Permalink
Implemented dotted edge style in Mermaid
Browse files Browse the repository at this point in the history
  • Loading branch information
sim642 committed May 13, 2023
1 parent 55c2cd7 commit 2a00696
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ocamlgraph_extra/mermaid.ml
Expand Up @@ -92,12 +92,16 @@ struct
| Some (`Ltail x) -> x
| _ -> "id" ^ string_of_int (X.V.hash u)
in
let style = match List.find_opt (function `Style _ -> true | _ -> false) a with
| Some (`Style `Dotted) -> "-.->"
| _ -> "-->"
in
let vv =
match List.find_opt (function `Lhead _ -> true | _ -> false) a with
| Some (`Lhead x) -> x
| _ -> "id" ^ string_of_int (X.V.hash v)
in
fprintf ppf "%s-->%s@ " uu vv
fprintf ppf "%s%s%s@ " uu style vv
) g
in

Expand Down

0 comments on commit 2a00696

Please sign in to comment.