Visualization¶
- mesa_geo.visualization.geojupyter_viz.Card(model, measures, agent_portrayal, map_drawer, center_default, zoom, current_step, color, layout_type)[source]¶
# ipyleaflet Map visualization using [ipyleaflet](https://ipyleaflet.readthedocs.io/), a ipywidgets wrapper for [leaflet.js](https://leafletjs.com/)
- class mesa_geo.visualization.leaflet_viz.LeafletViz(style: dict[str, str | bool | int | float] | None = None, popupProperties: dict[str, str | bool | int | float] | None = None)[source]¶
A dataclass defining the portrayal of a GeoAgent in Leaflet map.
The fields are defined to be consistent with GeoJSON options in Leaflet.js: https://leafletjs.com/reference.html#geojson
- popupProperties: dict[str, str | bool | int | float] | None = None¶
- style: dict[str, str | bool | int | float] | None = None¶
- class mesa_geo.visualization.leaflet_viz.MapModule(portrayal_method, view, zoom, scroll_wheel_zoom, tiles)[source]¶
A MapModule for Leaflet maps that uses a user-defined portrayal method to generate a portrayal of a raster Cell or a GeoAgent.
For a raster Cell, the portrayal method should return a (r, g, b, a) tuple.
- For a GeoAgent, the portrayal method should return a dictionary.
For a Line or a Polygon, the available options can be found at: https://leafletjs.com/reference.html#path-option
For a Point, the available options can be found at: https://leafletjs.com/reference.html#circlemarker-option
In addition, the portrayal dictionary can contain a “description” key, which will be used as the popup text.