Builder-viz: Passing transitive deps stats for coloring of nodes in opam-graph

This commit is contained in:
rand00 2022-03-17 16:31:07 +01:00
parent 7356950897
commit 34a8bf9160

View file

@ -72,19 +72,23 @@ let print_treemap_html elf_path elf_size =
* |> Fmt.to_to_string (Tyxml.Svg.pp ()) *) * |> Fmt.to_to_string (Tyxml.Svg.pp ()) *)
let print_dependencies_html file = let print_dependencies_html file =
let open Opam_graph in let module G = Opam_graph in
let switch = read_file file in let switch = read_file file in
let data = OpamFile.SwitchExport.read_from_string switch in let data = OpamFile.SwitchExport.read_from_string switch in
let transitive = false in let transitive = false in
let graph = Ui.dependencies ~transitive data in let graph = G.Ui.dependencies ~transitive data in
let sharing_stats =
data
|> G.dependencies ~transitive:true
|> G.calc_sharing_stats in
let override_css = {| let override_css = {|
.deps-svg-wrap { .deps-svg-wrap {
background: rgb(60, 60, 87); background: rgb(60, 60, 87);
} }
|} |}
in in
let html = Render.Html.of_assoc ~override_css graph in let html = G.Render.Html.of_assoc ~override_css ~sharing_stats graph in
Format.printf "%a" Render.Html.pp html Format.printf "%a" G.Render.Html.pp html
module Cmd_aux = struct module Cmd_aux = struct