Skip to content

Commit

Permalink
tweak values
Browse files Browse the repository at this point in the history
  • Loading branch information
Lendemor committed May 21, 2024
1 parent f6cac91 commit 065f0c1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions traversal/traversal/traversal.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ def set_initial_values(self):

def path_found(self, i, j):
if self.colored_graph[i][j] == "green":
return rx._x.toast.success(f"Path found to [{i},{j}]", position="top-center")
return rx._x.toast.success(
f"Path found to [{i},{j}]", position="top-center"
)

def path_not_found(self):
return rx._x.toast.error("No path found", position="top-center")
Expand All @@ -122,7 +124,7 @@ def explore_neighbors(self, i, j, mode=None):

async def run_dfs(self):
"""DFS algorithm on a 1d array."""
await asyncio.sleep(1)
await asyncio.sleep(0.01)

if self.s:
i, j = self.s.pop()
Expand All @@ -137,7 +139,7 @@ async def run_dfs(self):
return self.path_not_found()

async def run_bfs(self):
await asyncio.sleep(1)
await asyncio.sleep(0.01)

if self.q:
i, j = self.q.popleft()
Expand Down Expand Up @@ -200,7 +202,7 @@ def algorithm_selector():

@rx.page(route="/", title="Graph Traversal - Reflex")
def index() -> rx.Component:
return rx.color_mode.button(), rx._x.toast.provider(rich_colors=True), rx.center(
return rx.center(
rx.vstack(
rx.heading("Graph Traversal", size="8"),
rx.divider(),
Expand All @@ -212,7 +214,7 @@ def index() -> rx.Component:
),
bg=page_background,
height="100vh",
)
), rx.color_mode.button(position="top-right")


app = rx.App()

0 comments on commit 065f0c1

Please sign in to comment.