From 82c56144406ab85b17306d64ccd7e0ae6aca12bd Mon Sep 17 00:00:00 2001 From: rand00 Date: Thu, 16 Dec 2021 12:38:31 +0100 Subject: [PATCH] Builder_web.job_build_treemap: Calculating extra chunks inserted in treemap-scale --- lib/builder_web.ml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/builder_web.ml b/lib/builder_web.ml index a7f9bf4..1306a76 100644 --- a/lib/builder_web.ml +++ b/lib/builder_web.ml @@ -212,7 +212,7 @@ let add_routes datadir = m "Error reading ELF file %a" Fpath.pp path)) >>= fun infos -> let svg_html = - let info, excluded = + let info, excluded_minors = let size, info = infos |> Info.import @@ -231,9 +231,19 @@ let add_routes datadir = |> Info.cut 2 |> Info.partition_subtrees node_big_enough in + let scale_chunks = + let excluded_minors_size = + excluded_minors + |> List.map Info.compute_area + |> List.fold_left Int64.add 0L + in + [ + "Minor subtrees", excluded_minors_size + ] + in info |> Treemap.of_tree - |> Treemap.to_html_with_scale ~binary_size (*goto add 'excluded' via some new param*) + |> Treemap.to_html_with_scale ~binary_size ~scale_chunks |> Fmt.to_to_string (Tyxml.Html.pp ()) (* |> Treemap.svg * |> Fmt.to_to_string (Tyxml.Svg.pp ()) *)