From 7c3f84a1187f62f0b02cd2c676c2bd32525582bf Mon Sep 17 00:00:00 2001 From: Christian Diener Date: Thu, 12 Sep 2024 15:07:28 +0200 Subject: [PATCH] conditional legend on growth rates --- micom/data/templates/growth.html | 2 +- tests/test_viz.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/micom/data/templates/growth.html b/micom/data/templates/growth.html index d56962cf..014be9d5 100644 --- a/micom/data/templates/growth.html +++ b/micom/data/templates/growth.html @@ -84,7 +84,7 @@

selection: "pts", field: "{{ color }}", type: "nominal", - legend: null + {% if color == "taxon" %}legend: null{% endif %} }, value: "lightgrey" }, diff --git a/tests/test_viz.py b/tests/test_viz.py index ba01e5a5..e11d3940 100644 --- a/tests/test_viz.py +++ b/tests/test_viz.py @@ -10,9 +10,10 @@ def random_groups(res): """Create some random groups for samples.""" + sids = res.growth_rates.sample_id.unique() groups = pd.Series( - random.choices(["a", "b"], k=4), - index=res.growth_rates.sample_id.unique(), + random.choices(["a", "b"], k=len(sids)), + index=sids, name="random", ) return groups