From 9b4af7cfd4797423a4668d94d11b378208291e1e Mon Sep 17 00:00:00 2001 From: rand00 Date: Mon, 21 Mar 2022 10:49:21 +0100 Subject: [PATCH] Opam_graph: Scaled new sharing-color brightness to fit the counts better --- src/opam_graph.ml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/opam_graph.ml b/src/opam_graph.ml index df36bd1..b9b2a88 100644 --- a/src/opam_graph.ml +++ b/src/opam_graph.ml @@ -773,16 +773,15 @@ svg { let make_deps_sharing_css (sharing_stats:assoc_stats) = let max_count = + (*> todo; would be more correct to use the count of nodes in dep-graph*) 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) sharing_stats 0 - |> float + |> float + |> ( *. ) 0.2 in 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 "\ .%s.%s {\ filter: brightness(%f);\