awacke1 commited on
Commit
8e4c37b
ยท
1 Parent(s): c646f73

Delete app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -51
app.py DELETED
@@ -1,51 +0,0 @@
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(n):
17
- health_points = np.random.randint(50, 100, size=n)
18
- coins = np.random.randint(10, 50, size=n)
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
- n = len(game_mechanics)
28
- values = generate_values(n)
29
- data = pd.DataFrame({
30
- "category": ["Category 1"] * n,
31
- "mechanic": game_mechanics,
32
- "value": list(values.values()),
33
- "HealthPoints": values["HealthPoints"],
34
- "Coins": values["Coins"],
35
- "description": ["Description"] * n
36
- })
37
- data["value"] = data["value"].apply(lambda x: sum(x))
38
-
39
- # Draw the chart
40
- fig = px.treemap(data, path=["category", "mechanic"], values="value",
41
- color="HealthPoints", hover_data=["Coins"])
42
- st.plotly_chart(fig)
43
-
44
- # Display a download link for the data
45
- csv = data.to_csv(index=False)
46
- b64 = base64.b64encode(csv.encode()).decode()
47
- href = f'<a href="data:file/csv;base64,{b64}" download="game_mechanics.csv">Download CSV</a>'
48
- st.markdown(href, unsafe_allow_html=True)
49
-
50
- if __name__ == '__main__':
51
- app()