From 9baf66e31feaef74956e5e2fc9f60d5f04e7470a Mon Sep 17 00:00:00 2001 From: Federico Date: Fri, 15 Mar 2024 23:45:53 +0100 Subject: [PATCH] tooltip semplification --- mesa/experimental/components/altair.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mesa/experimental/components/altair.py b/mesa/experimental/components/altair.py index c4ba2fe6f38..6952c03f336 100644 --- a/mesa/experimental/components/altair.py +++ b/mesa/experimental/components/altair.py @@ -43,10 +43,8 @@ def portray(g): # no y-axis label "y": alt.Y("y", axis=None, type="ordinal"), "tooltip": [ - alt.Tooltip( - key, type=alt.utils.infer_vegalite_type([all_agent_data[0][key]]) - ) - for key in all_agent_data[0] + alt.Tooltip(key, type=alt.utils.infer_vegalite_type([value])) + for key, value in all_agent_data[0].items() if key not in invalid_tooltips ], }