Skip to main content

Mesarcade

Mesa + Arcade

Mesarcade is a Python package that provides fast, interactive visualizations of Mesa agent-based models using Python Arcade.

⚠️ Mesarcade is under active development. APIs may change.

Gallery

Schelling

Virus on network

Sugarscape

Components

Mesarcade follows a compositional design: you define how agents are drawn (Artists), where they are drawn (SpacePlots), what is tracked over time (HistoryPlots), and how parameters can be changed (Controllers), all embedded in a Canvas.

Artists

Artists are the visual representations of the entities in a mesa model.

  • CellArtists: A visual representation for entities of type Cell.
  • CellAgentArtists: A visual representation for a set of entities of type CellAgent.
  • ContinuousSpaceAgentArtists: A visual representation for a set of entities of type mesa.ContinuousSpaceAgents.
  • NetworkCellArtists: A visual representation for cells in a Network.
  • NetworkAgentArtists: A visual representation for agents on a Network.

Example:

Let's create a visual representation for our CellAgents. We map the agent attribute type to the colors blue and red.

agents = mesar.CellAgentArtists(
    color_attribute="type",
    color_map={0: "blue", 1: "red"},
)

SpacePlots

SpacePlots are visual representations of certain space types in Mesa and plot the corresponding Artists at their position. You can add/layer as many artists as you want to.

  • GridSpacePlot: Visualizes a grid.
  • ContinuousSpacePlot: Visualizes a continuous space.
  • NetworkPlot: A space in which networks are visualized.

Example:

Let's create a visual representation of a grid and add our agent artists. We could add other artists, too.

grid_space = mesar.GridSpacePlot(artists=[agents])

HistoryPlots

Line plots that plot (multiple) values as a function of the simulated time steps.

  • ModelHistoryPlot: Plots model attributes or data that is collected using the model's datacollector as a function of the simulated time steps.

  • AgentHistoryPlot: On the ToDo-List.

Example

Let's add a ModelHistoryPlot that visualizes the model attribute happy over time:

happy_plot = mesar.ModelHistoryPlot(model_attributes=["happy"], labels=["Happy agents"])

ValueDisplay

Text-based display for showing a single value of a model attribute.

Example

Let's add a ValueDisplay that shows the current value of the model attribute happy:

happy_value = mesar.ValueDisplay(model_attribute="happy", label="Happy agents")

Controllers

Interactive controllers of model attributes and parameters.

  • NumController: A controller for numeric parameters.
  • CatController: A controller for categorical parameters.

Example

Let's add a controller that determines the value of the model parameter homophily:

homophily = mesar.NumController(
    parameter_name="homophily", 
    parameter_value=0.4, 
    min_value=0,
    max_value=1,
    step=0.125,
    )

Canvas

The Canvas is the main window in which all components are placed.

Example

canvas = mesar.Canvas(
    model_class=Schelling, # the mesa model
    plots=[space, happy_plot], # all plots
    controllers=[density, minority_pc, homophily, width, height], # all controllers
)

# start the visualization
canvas.show()

Full example

More examples can be found in "/mesarcade/examples".

import mesarcade as mesar
from mesa.examples.basic.schelling.model import Schelling

# artists
agents = mesar.CellAgentArtists(
    color_attribute="type",
    color_map={0: "blue", 1: "red"},
    shape="circle",
)

# space plot
space = mesar.GridSpacePlot(artists=agents)

# line plot
happy_plot = mesar.ModelHistoryPlot(model_attributes=["happy"], labels=["Happy agents"])

# value display
happy_value = mesar.ValueDisplay(model_attribute="happy", label="Happy agents")

# controllers
density = mesar.NumController("density", 0.8, 0.1, 0.9, 0.1)
minority_pc = mesar.NumController("minority_pc", 0.2, 0.0, 1.0, 0.05)
homophily = mesar.NumController("homophily", 0.4, 0.0, 1.0, 0.125)
width = mesar.NumController("width", 100, 10, 200, 10)
height = mesar.NumController("height", 100, 10, 200, 10)

# gui window
canvas = mesar.Canvas(
    model_class=Schelling,
    plots=[space, happy_plot],
    value_displays=[happy_value],
    controllers=[density, minority_pc, homophily, width, height],
)

# show gui window
canvas.show()

Metadata

Release files for mesarcade 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mesarcade 0.1.3
File Size Uploaded Provenance
mesarcade-0.1.3.tar.gz 21.9 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mesarcade 0.1.3
File Interpreter ABI Platform
mesarcade-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 47.0 kB

Release files / mesarcade-0.1.3.tar.gz

Download URL mesarcade-0.1.3.tar.gz
Size 21.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4e80f2d92774476e6d50bed9c41e93b4c2573129f0de982f232b4d2d39b2e39d
BLAKE2b-256 checksum
How to use checksums
017f3fdd8daedc397f24c91e885e60d0a86806e6a9e61fddaf63a879b4add120
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 11, 2026.

Transparency log

Release files / mesarcade-0.1.3-py3-none-any.whl

Download URL mesarcade-0.1.3-py3-none-any.whl
Size 25.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3746a77558298f182f3779fa377cc9f60d4d5892a718c9292a203eef2b176fc6
BLAKE2b-256 checksum
How to use checksums
a5f5f148ea12b0acb419e2fe6f2ccbc1b2acd09f14fb73871acae673e3a99c30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 11, 2026.

Transparency log

Security for mesarcade 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mesarcade-0.1.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 11, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page