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 ], }