Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,21 +1,29 @@
|
|
1 |
import streamlit as st
|
2 |
import plotly.express as px
|
3 |
-
import
|
|
|
4 |
|
5 |
-
# Define
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
# Define the Streamlit app
|
12 |
def app():
|
13 |
-
st.title("
|
14 |
-
st.write("This app
|
15 |
-
|
16 |
-
data = generate_data()
|
17 |
-
fig = px.treemap(data, path=["labels"], values="values")
|
18 |
-
st.plotly_chart(fig)
|
19 |
|
20 |
-
|
21 |
-
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
import plotly.express as px
|
3 |
+
import pandas as pd
|
4 |
+
import numpy as np
|
5 |
|
6 |
+
# Define the list of game mechanics
|
7 |
+
game_mechanics = ["Action Queue", "Action Retrieval", "Campaign / Battle Card Driven",
|
8 |
+
"Card Play Conflict Resolution", "Communication Limits",
|
9 |
+
"Cooperative Game", "Critical Hits and Failures", "Deck Construction",
|
10 |
+
"Grid Movement", "Hand Management", "Hexagon Grid", "Legacy Game",
|
11 |
+
"Line of Sight", "Modular Board", "Once-Per-Game Abilities", "Role Playing",
|
12 |
+
"Scenario / Mission / Campaign Game", "Simultaneous Action Selection",
|
13 |
+
"Solo / Solitaire Game", "Storytelling", "Variable Player Powers"]
|
14 |
+
|
15 |
+
# Define a function to generate random values for each game mechanic
|
16 |
+
def generate_values():
|
17 |
+
health_points = np.random.randint(50, 100, size=len(game_mechanics))
|
18 |
+
coins = np.random.randint(10, 50, size=len(game_mechanics))
|
19 |
+
return {"HealthPoints": health_points, "Coins": coins}
|
20 |
|
21 |
# Define the Streamlit app
|
22 |
def app():
|
23 |
+
st.title("Game Mechanics Treemap Chart")
|
24 |
+
st.write("This app displays a Treemap chart of game mechanics.")
|
|
|
|
|
|
|
|
|
25 |
|
26 |
+
# Generate the data for the chart
|
27 |
+
values = generate_values()
|
28 |
+
data = pd.DataFrame({
|
29 |
+
"category": ["Category
|