mesa / mesa/mesa-examples

Fix hex_snowflake, shape_example, charts: mesa.visualization no longer exists in Mesa 3.x

Open
#358 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
252
Forks
279
Avg merge
8d 9h
Merged PRs (30d)
2

Description

## 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:**
1. cd examples/hex_snowflake
2. python run.py

**shape_example:**
1. cd examples/shape_example
2. python run.py

**charts:**
1. cd examples/charts
2. 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.

Contributor guide

Open the contributing guide

Research direction

Start with run.py in examples/hex_snowflake, examples/shape_example, and examples/charts, then compare their visualization setup with working Solara-based examples in the repository. Run each example to reproduce the AttributeError and verify that all three launch without errors after migration to SolaraViz, make_space_component, and make_plot_component.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.