From f5c23aff81824903be0af81ae876e4e015cc02d5 Mon Sep 17 00:00:00 2001 From: rht Date: Wed, 28 Feb 2024 21:32:35 -0500 Subject: [PATCH] Remove JupyterViz Altair marker overlap for huge grid size --- mesa/experimental/components/altair.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mesa/experimental/components/altair.py b/mesa/experimental/components/altair.py index 2b08485b848..a66e4ab09ae 100644 --- a/mesa/experimental/components/altair.py +++ b/mesa/experimental/components/altair.py @@ -56,5 +56,10 @@ def portray(g): .properties(width=280, height=280) # .configure_view(strokeOpacity=0) # hide grid/chart lines ) + # This is the default value for the marker size, which auto-scales + # according to the grid area. + if not has_size: + length = min(space.width, space.height) + chart = chart.mark_point(size=30000 / length**2, filled=True) return chart