Fix hex_snowflake, shape_example, charts: mesa.visualization no longer exists in Mesa 3.x
Describe the bug
Three examples are broken because they use mesa.visualization which was removed in Mesa 3.x.
Affected examples:
- hex_snowflake
- shape_example
- charts
To Reproduce
hex_snowflake:
- cd examples/hex_snowflake
- python run.py
shape_example:
- cd examples/shape_example
- python run.py
charts:
- cd examples/charts
- python run.py
Error
AttributeError: module 'mesa' has no attribute 'visualization'
Expected behavior
All three examples should run without errors.
Environment
- Mesa version: 3.5.0
- Python version: 3.x
- OS: Windows
Possible fix
Migrate visualization from deprecated mesa.visualization (ModularServer, CanvasGrid, Slider) to the modern Solara-based approach using SolaraViz, make_space_component, and make_plot_component as used in other working examples in the repo.
Hi, I'd like to work on this issue. Can I be assigned?
@quaquel
- What should replace BarChartModule and PieChartModule in Mesa 3.x? Should they be removed or reimplemented?
- Does Mesa 3.x support hex grid visualization? Also does it support arrowHead shape portrayal?
I can confirm this on Mesa 3.5.0, Python 3.13, Ubuntu. I am currently doing a broader audit of all examples — tracking issue coming soon. I can take a fix PR for one of these if no one is working on it yet.