awacke1 commited on
Commit
455480a
·
1 Parent(s): 56570c8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -14
app.py CHANGED
@@ -1,21 +1,29 @@
1
  import streamlit as st
2
  import plotly.express as px
3
- import random
 
4
 
5
- # Define a function to generate random data
6
- def generate_data():
7
- labels = [f"Category {i}" for i in range(1, 11)]
8
- values = [random.randint(1, 100) for _ in range(10)]
9
- return {"labels": labels, "values": values}
 
 
 
 
 
 
 
 
 
10
 
11
  # Define the Streamlit app
12
  def app():
13
- st.title("Random Treemap Chart")
14
- st.write("This app generates a random Treemap chart using Plotly.")
15
-
16
- data = generate_data()
17
- fig = px.treemap(data, path=["labels"], values="values")
18
- st.plotly_chart(fig)
19
 
20
- if __name__ == '__main__':
21
- app()
 
 
 
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