Skip to content

Commit

Permalink
add default SolaraViz
Browse files Browse the repository at this point in the history
  • Loading branch information
Corvince committed Sep 5, 2024
1 parent 725143f commit 113680d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions mesa/visualization/solara_viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

import copy
import threading
from typing import TYPE_CHECKING
from typing import TYPE_CHECKING, Literal

import reacton.ipywidgets as widgets
import solara
Expand Down Expand Up @@ -93,15 +93,16 @@ def Card(
@solara.component
def SolaraViz(
model: "Model" | solara.Reactive["Model"],
components: list[solara.component] | None = None,
components: list[solara.component] | Literal["default"] = "default",
*args,
play_interval=150,
model_params=None,
seed=0,
name: str | None = None,
):
if components is None:
components = []
update_counter.get()
if components == "default":
components = [components_altair.make_space_altair()]

# Convert model to reactive
if not isinstance(model, solara.Reactive):
Expand Down

0 comments on commit 113680d

Please sign in to comment.