Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -12,19 +12,29 @@ def app():
|
|
12 |
st.title("Game Mechanics Treemap Chart")
|
13 |
st.write("This app displays a Treemap chart of game mechanics.")
|
14 |
|
15 |
-
|
|
|
16 |
"Campaign / Battle Card Driven ๐๏ธ", "Card Play Conflict Resolution ๐ณ๐ค",
|
17 |
"Communication Limits ๐", "Cooperative Game ๐ค๐ฅ", "Critical Hits and Failures ๐ฅ๐",
|
18 |
"Deck Construction ๐ด๐ ๏ธ", "Grid Movement ๐บ๏ธ", "Hand Management ๐๏ธ๐",
|
19 |
"Hexagon Grid ๐ณ", "Legacy Game ๐๐ฎ", "Line of Sight ๐", "Modular Board ๐งฉ",
|
20 |
"Once-Per-Game Abilities ๐", "Role Playing ๐ญ", "Scenario / Mission / Campaign Game ๐ฏ",
|
21 |
"Simultaneous Action Selection ๐ค๐ค", "Solo / Solitaire Game ๐บ", "Storytelling ๐",
|
22 |
-
"Variable Player Powers ๐ฆธโโ๏ธ๐ฆนโโ๏ธ"]
|
|
|
|
|
|
|
23 |
|
24 |
values = generate_values(n)
|
25 |
-
|
26 |
-
|
27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
data["value"] = data["value"].apply(lambda x: sum(x))
|
29 |
|
30 |
fig = px.treemap(data, path=["category", "mechanic"], values="value",
|
|
|
12 |
st.title("Game Mechanics Treemap Chart")
|
13 |
st.write("This app displays a Treemap chart of game mechanics.")
|
14 |
|
15 |
+
|
16 |
+
game_mechanics := ["Action Queue โฑ๏ธ", "Action Retrieval ๐",
|
17 |
"Campaign / Battle Card Driven ๐๏ธ", "Card Play Conflict Resolution ๐ณ๐ค",
|
18 |
"Communication Limits ๐", "Cooperative Game ๐ค๐ฅ", "Critical Hits and Failures ๐ฅ๐",
|
19 |
"Deck Construction ๐ด๐ ๏ธ", "Grid Movement ๐บ๏ธ", "Hand Management ๐๏ธ๐",
|
20 |
"Hexagon Grid ๐ณ", "Legacy Game ๐๐ฎ", "Line of Sight ๐", "Modular Board ๐งฉ",
|
21 |
"Once-Per-Game Abilities ๐", "Role Playing ๐ญ", "Scenario / Mission / Campaign Game ๐ฏ",
|
22 |
"Simultaneous Action Selection ๐ค๐ค", "Solo / Solitaire Game ๐บ", "Storytelling ๐",
|
23 |
+
"Variable Player Powers ๐ฆธโโ๏ธ๐ฆนโโ๏ธ"]
|
24 |
+
|
25 |
+
n = len(game_mechanics)
|
26 |
+
|
27 |
|
28 |
values = generate_values(n)
|
29 |
+
|
30 |
+
|
31 |
+
data = pd.DataFrame({"category": ["Category"] ,
|
32 |
+
"mechanic": game_mechanics,
|
33 |
+
"value": list(values.values()),
|
34 |
+
"HealthPoints": values["HealthPoints"],
|
35 |
+
"Coins": values["Coins"],
|
36 |
+
"description": ["Description"]})
|
37 |
+
|
38 |
data["value"] = data["value"].apply(lambda x: sum(x))
|
39 |
|
40 |
fig = px.treemap(data, path=["category", "mechanic"], values="value",
|