Spaces:
Runtime error
Runtime error
import streamlit as st | |
import plotly.express as px | |
import pandas as pd | |
import numpy as np | |
# Define the list of game mechanics | |
game_mechanics = ["Action Queue", "Action Retrieval", "Campaign / Battle Card Driven", | |
"Card Play Conflict Resolution", "Communication Limits", | |
"Cooperative Game", "Critical Hits and Failures", "Deck Construction", | |
"Grid Movement", "Hand Management", "Hexagon Grid", "Legacy Game", | |
"Line of Sight", "Modular Board", "Once-Per-Game Abilities", "Role Playing", | |
"Scenario / Mission / Campaign Game", "Simultaneous Action Selection", | |
"Solo / Solitaire Game", "Storytelling", "Variable Player Powers"] | |
# Define a function to generate random values for each game mechanic | |
def generate_values(): | |
health_points = np.random.randint(50, 100, size=len(game_mechanics)) | |
coins = np.random.randint(10, 50, size=len(game_mechanics)) | |
return {"HealthPoints": health_points, "Coins": coins} | |
# Define the Streamlit app | |
def app(): | |
st.title("Game Mechanics Treemap Chart") | |
st.write("This app displays a Treemap chart of game mechanics.") | |
# Generate the data for the chart | |
values = generate_values() | |
data = pd.DataFrame({ | |
"category": ["Category | |