Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -9,6 +9,29 @@ from streamlit_flow import streamlit_flow
|
|
9 |
from streamlit_flow.elements import StreamlitFlowNode, StreamlitFlowEdge
|
10 |
from streamlit_flow.layouts import TreeLayout
|
11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
# 🐱 Cat Rider and Gear Data
|
13 |
CAT_RIDERS = [
|
14 |
{"name": "Whiskers", "type": "Speed", "emoji": "🐾", "strength": 3, "skill": 7},
|
@@ -159,8 +182,8 @@ def create_heterogeneous_graph(history_df):
|
|
159 |
# Situation node
|
160 |
if situation_node_id not in node_ids:
|
161 |
situation_node = StreamlitFlowNode(
|
162 |
-
|
163 |
-
|
164 |
data={'content': f"{row['situation_emoji']} {row['situation_name']}"},
|
165 |
type='default',
|
166 |
sourcePosition='bottom',
|
@@ -172,8 +195,8 @@ def create_heterogeneous_graph(history_df):
|
|
172 |
|
173 |
# Action node
|
174 |
action_node = StreamlitFlowNode(
|
175 |
-
|
176 |
-
|
177 |
data={'content': f"{row['action_emoji']} {row['action_name']}"},
|
178 |
type='default',
|
179 |
sourcePosition='bottom',
|
@@ -186,8 +209,8 @@ def create_heterogeneous_graph(history_df):
|
|
186 |
outcome_content = '✅ Success' if row['outcome'] else '❌ Failure'
|
187 |
stars = '⭐' * int(row['score'])
|
188 |
outcome_node = StreamlitFlowNode(
|
189 |
-
|
190 |
-
|
191 |
data={'content': f"{row['conclusion']}\n{outcome_content}\n{stars}"},
|
192 |
type='default',
|
193 |
sourcePosition='bottom',
|
|
|
9 |
from streamlit_flow.elements import StreamlitFlowNode, StreamlitFlowEdge
|
10 |
from streamlit_flow.layouts import TreeLayout
|
11 |
|
12 |
+
# 1. Configuration
|
13 |
+
Site_Name = '🦁CatRider🐈'
|
14 |
+
title="🦁CatRider🐈by👤Aaron Wacker"
|
15 |
+
helpURL='https://huggingface.co/awacke1'
|
16 |
+
bugURL='https://huggingface.co/spaces/awacke1'
|
17 |
+
icons='🦁'
|
18 |
+
|
19 |
+
useConfig=True
|
20 |
+
if useConfig: # Component code - useConfig=False should allow it to work if re-evaluating UI elements due to code modify
|
21 |
+
st.set_page_config(
|
22 |
+
page_title=title,
|
23 |
+
page_icon=icons,
|
24 |
+
layout="wide",
|
25 |
+
#initial_sidebar_state="expanded",
|
26 |
+
initial_sidebar_state="auto",
|
27 |
+
menu_items={
|
28 |
+
'Get Help': helpURL,
|
29 |
+
'Report a bug': bugURL,
|
30 |
+
'About': title
|
31 |
+
}
|
32 |
+
)
|
33 |
+
|
34 |
+
|
35 |
# 🐱 Cat Rider and Gear Data
|
36 |
CAT_RIDERS = [
|
37 |
{"name": "Whiskers", "type": "Speed", "emoji": "🐾", "strength": 3, "skill": 7},
|
|
|
182 |
# Situation node
|
183 |
if situation_node_id not in node_ids:
|
184 |
situation_node = StreamlitFlowNode(
|
185 |
+
situation_node_id,
|
186 |
+
pos=(0, 0),
|
187 |
data={'content': f"{row['situation_emoji']} {row['situation_name']}"},
|
188 |
type='default',
|
189 |
sourcePosition='bottom',
|
|
|
195 |
|
196 |
# Action node
|
197 |
action_node = StreamlitFlowNode(
|
198 |
+
action_node_id,
|
199 |
+
pos=(0, 0),
|
200 |
data={'content': f"{row['action_emoji']} {row['action_name']}"},
|
201 |
type='default',
|
202 |
sourcePosition='bottom',
|
|
|
209 |
outcome_content = '✅ Success' if row['outcome'] else '❌ Failure'
|
210 |
stars = '⭐' * int(row['score'])
|
211 |
outcome_node = StreamlitFlowNode(
|
212 |
+
outcome_node_id,
|
213 |
+
pos=(0, 0),
|
214 |
data={'content': f"{row['conclusion']}\n{outcome_content}\n{stars}"},
|
215 |
type='default',
|
216 |
sourcePosition='bottom',
|