Skip to content
Open
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
8 changes: 4 additions & 4 deletions mesa/visualization/solara_viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,10 @@ def ComponentsView(
components: List of (components, page) to display
model: Model instance to pass to each component
"""
# State for current tab and layouts
current_tab_index, set_current_tab_index = solara.use_state(0)
layouts, set_layouts = solara.use_state({})

if not components:
return

Expand All @@ -395,10 +399,6 @@ def ComponentsView(

sorted_page_indices = all_indices

# State for current tab and layouts
current_tab_index, set_current_tab_index = solara.use_state(0)
layouts, set_layouts = solara.use_state({})

# Keep layouts in sync with pages
def sync_layouts():
current_keys = set(pages.keys())
Expand Down