awacke1 commited on
Commit
48cf4d2
ยท
1 Parent(s): 767a074

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -5
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
- n = len(game_mechanics := ["Action Queue โฑ๏ธ", "Action Retrieval ๐Ÿ”",
 
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
- data = pd.DataFrame({"category": ["Category 1"] * n, "mechanic": game_mechanics,
26
- "value": list(values.values()), "HealthPoints": values["HealthPoints"],
27
- "Coins": values["Coins"], "description": ["Description"] * n})
 
 
 
 
 
 
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",