Opam_graph: Scaled new sharing-color brightness to fit the counts better

This commit is contained in:
rand00 2022-03-21 10:49:21 +01:00
parent 1f3513e1ee
commit 9b4af7cfd4

View file

@ -773,16 +773,15 @@ svg {
let make_deps_sharing_css (sharing_stats:assoc_stats) = let make_deps_sharing_css (sharing_stats:assoc_stats) =
let max_count = let max_count =
(*> todo; would be more correct to use the count of nodes in dep-graph*)
SMap.fold SMap.fold
(*> todo: exclude a certain set of pkgs from being taken into consideration here
.. and remember to limit their following pct-count too
*)
(fun _pkg count max_count -> Int.max max_count count) (fun _pkg count max_count -> Int.max max_count count)
sharing_stats 0 sharing_stats 0
|> float |> float
|> ( *. ) 0.2
in in
SMap.fold (fun pkg count acc -> SMap.fold (fun pkg count acc ->
let pct_count = float count /. max_count in (*goo*) let pct_count = Float.min 1. (float count /. max_count) in
let css = sprintf "\ let css = sprintf "\
.%s.%s {\ .%s.%s {\
filter: brightness(%f);\ filter: brightness(%f);\