Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -21,30 +21,7 @@ def app():
|
|
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",
|
41 |
-
color="HealthPoints", hover_data=["Coins"])
|
42 |
-
st.plotly_chart(fig)
|
43 |
-
|
44 |
-
csv = data.to_csv(index=False)
|
45 |
-
b64 = base64.b64encode(csv.encode()).decode()
|
46 |
-
href = f'<a href="data:file/csv;base64,{b64}" download="game_mechanics.csv">Download CSV</a>'
|
47 |
-
st.markdown(href, unsafe_allow_html=True)
|
48 |
|
49 |
if __name__ == '__main__':
|
50 |
app()
|
|
|
21 |
"Once-Per-Game Abilities 🌟", "Role Playing 🎭", "Scenario / Mission / Campaign Game 🎯",
|
22 |
"Simultaneous Action Selection 🤜🤛", "Solo / Solitaire Game 🕺", "Storytelling 📖",
|
23 |
"Variable Player Powers 🦸♂️🦹♀️"]
|
24 |
+
st.write(game_mechanics)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
if __name__ == '__main__':
|
27 |
app()
|