Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set JupyterViz as stable #2090

Merged
merged 3 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/mesa.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Subpackages

```{toctree}
mesa.visualization
mesa.visualization_old
```

## Submodules
Expand Down
46 changes: 0 additions & 46 deletions docs/mesa.visualization.md

This file was deleted.

76 changes: 0 additions & 76 deletions docs/mesa.visualization.modules.md

This file was deleted.

46 changes: 46 additions & 0 deletions docs/mesa.visualization_old.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# mesa.visualization_old package

## Subpackages

```{toctree}
mesa.visualization_old.modules
```

## Submodules

## mesa.visualization_old.ModularVisualization module

```{eval-rst}
.. automodule:: mesa.visualization_old.ModularVisualization
:members:
:undoc-members:
:show-inheritance:
```

## mesa.visualization_old.TextVisualization module

```{eval-rst}
.. automodule:: mesa.visualization_old.TextVisualization
:members:
:undoc-members:
:show-inheritance:
```

## mesa.visualization_old.UserParam module

```{eval-rst}
.. automodule:: mesa.visualization_old.UserParam
:members:
:undoc-members:
:show-inheritance:

```

## Module contents

```{eval-rst}
.. automodule:: mesa.visualization_old
:members:
:undoc-members:
:show-inheritance:
```
76 changes: 76 additions & 0 deletions docs/mesa.visualization_old.modules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# mesa.visualization_old.modules package

## Submodules

## mesa.visualization_old.modules.BarChartVisualization module

```{eval-rst}
.. automodule:: mesa.visualization_old.modules.BarChartVisualization
:members:
:undoc-members:
:show-inheritance:
```

## mesa.visualization_old.modules.CanvasGridVisualization module

```{eval-rst}
.. automodule:: mesa.visualization_old.modules.CanvasGridVisualization
:members:
:undoc-members:
:show-inheritance:
```

## mesa.visualization_old.modules.ChartVisualization module

```{eval-rst}
.. automodule:: mesa.visualization_old.modules.ChartVisualization
:members:
:undoc-members:
:show-inheritance:
```

## mesa.visualization_old.modules.HexGridVisualization module

```{eval-rst}
.. automodule:: mesa.visualization_old.modules.HexGridVisualization
:members:
:undoc-members:
:show-inheritance:
```

## mesa.visualization_old.modules.NetworkVisualization module

```{eval-rst}
.. automodule:: mesa.visualization_old.modules.NetworkVisualization
:members:
:undoc-members:
:show-inheritance:
```

## mesa.visualization_old.modules.PieChartVisualization module

```{eval-rst}
.. automodule:: mesa.visualization_old.modules.PieChartVisualization
:members:
:undoc-members:
:show-inheritance:
```

## mesa.visualization_old.modules.TextVisualization module

```{eval-rst}
.. automodule:: mesa.visualization_old.modules.TextVisualization
:members:
:undoc-members:
:show-inheritance:

```

## Module contents

```{eval-rst}
.. automodule:: mesa.visualization_old.modules
:members:
:undoc-members:
:show-inheritance:
```
10 changes: 5 additions & 5 deletions docs/modular-visualization.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Modular Visualization - An In-Depth Look
# Modular Visualization - An In-Depth Look (Deprecated)

Modular visualization is one of Mesa's core features. Mesa is designed
to provide predefined visualization modules, which can be easily
Expand Down Expand Up @@ -127,7 +127,7 @@ Suppose we want a module which can get an arbitrary variable out of a
model, and display its name and value. Let's create a new subclass:

```python
from mesa.visualization.ModularTextVisualization import TextElement
from mesa.visualization_old.ModularTextVisualization import TextElement

class AttributeElement(TextElement):
def __init__(self, attr_name):
Expand Down Expand Up @@ -205,7 +205,7 @@ Now let's take a look at the TextModule's Python counterpart,
here's the whole thing:

```python
from mesa.visualization.ModularVisualization import VisualizationElement
from mesa.visualization_old.ModularVisualization import VisualizationElement

class TextElement(VisualizationElement):
js_includes = ["TextModule.js"]
Expand Down Expand Up @@ -240,8 +240,8 @@ the list, the code passes that element of the data to the *render*
function of the corresponding element, in the elements array.

Currently, module JavaScript files live in the
*mesa/visualization/templates* directory, and the Python files live in
*mesa/visualization/modules*.
*mesa/visualization_old/templates* directory, and the Python files live in
*mesa/visualization_old/modules*.

When creating a new module, the Python and JavaScript code need to be
written in synch: the module Python-side **render** method needs to
Expand Down
8 changes: 4 additions & 4 deletions docs/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ batch_df = batch_run.get_model_vars_dataframe()

Finally, you may want to directly observe your model as it runs. Mesa's main visualization tool uses a small local web server to render the model in a browser, using JavaScript. There are different components for drawing different types of data: for example, grids for drawing agents moving around on a grid, or charts for showing how some data changes as the model runs. A few core modules are:

- mesa.visualization.ModularVisualization
- mesa.visualization.modules
- mesa.visualization_old.ModularVisualization
- mesa.visualization_old.modules

To quickly spin up a model visualization, you might do something like:

Expand All @@ -135,8 +135,8 @@ def agent_portrayal(agent):
"r": 0.5}
return portrayal

grid = mesa.visualization.CanvasGrid(agent_portrayal, 10, 10, 500, 500)
server = mesa.visualization.ModularServer(MyModel,
grid = mesa.visualization_old.CanvasGrid(agent_portrayal, 10, 10, 500, 500)
server = mesa.visualization_old.ModularServer(MyModel,
[grid],
"My Model",
{'n_agents': 10})
Expand Down
Loading
Loading