Spaces:
Sleeping
Sleeping
Update pages/1player_information.py
Browse files- pages/1player_information.py +15 -12
pages/1player_information.py
CHANGED
@@ -4,27 +4,30 @@ import matplotlib.pyplot as plt
|
|
4 |
import seaborn as sns
|
5 |
|
6 |
# Set page configuration
|
7 |
-
st.set_page_config(page_title="Cricket Legends: Career Insights
|
8 |
|
9 |
-
#
|
10 |
page_bg = """
|
11 |
<style>
|
12 |
-
|
13 |
-
background:
|
14 |
-
background-size: cover;
|
15 |
}
|
16 |
-
[data-testid="
|
17 |
-
background:
|
18 |
}
|
19 |
[data-testid="stSidebar"] {
|
20 |
-
background:
|
|
|
21 |
}
|
22 |
h1, h2, h3, h4, h5, h6 {
|
23 |
-
color:
|
24 |
}
|
25 |
.stTextInput>div>div>input {
|
26 |
-
background-color:
|
27 |
color: black;
|
|
|
|
|
|
|
28 |
}
|
29 |
</style>
|
30 |
"""
|
@@ -57,7 +60,7 @@ if player_input:
|
|
57 |
|
58 |
fig, ax = plt.subplots()
|
59 |
ax.pie(matches, labels=labels, autopct="%1.1f%%", startangle=90,
|
60 |
-
colors=["#
|
61 |
ax.set_title(f"Matches Played by {selected_player}", fontsize=14)
|
62 |
st.pyplot(fig)
|
63 |
|
@@ -76,7 +79,7 @@ if player_input:
|
|
76 |
|
77 |
# Scatter Plot - Matches vs Runs (ODIs)
|
78 |
fig, ax = plt.subplots()
|
79 |
-
sns.scatterplot(x=df["Matches_ODI"], y=df["batting_Runs_ODI"], ax=ax, color="#
|
80 |
ax.set_xlabel("Matches Played", fontsize=12)
|
81 |
ax.set_ylabel("Runs Scored", fontsize=12)
|
82 |
ax.set_title("Matches vs Runs in ODIs (All Players)", fontsize=14)
|
|
|
4 |
import seaborn as sns
|
5 |
|
6 |
# Set page configuration
|
7 |
+
st.set_page_config(page_title="Cricket Legends: Career Insights", layout="wide")
|
8 |
|
9 |
+
# Light-Themed Background
|
10 |
page_bg = """
|
11 |
<style>
|
12 |
+
body {
|
13 |
+
background-color: #f5f7fa;
|
|
|
14 |
}
|
15 |
+
[data-testid="stAppViewContainer"] {
|
16 |
+
background-color: #f5f7fa;
|
17 |
}
|
18 |
[data-testid="stSidebar"] {
|
19 |
+
background-color: #ffffff;
|
20 |
+
border-right: 1px solid #ddd;
|
21 |
}
|
22 |
h1, h2, h3, h4, h5, h6 {
|
23 |
+
color: #333333 !important;
|
24 |
}
|
25 |
.stTextInput>div>div>input {
|
26 |
+
background-color: white;
|
27 |
color: black;
|
28 |
+
border-radius: 5px;
|
29 |
+
padding: 10px;
|
30 |
+
border: 1px solid #ccc;
|
31 |
}
|
32 |
</style>
|
33 |
"""
|
|
|
60 |
|
61 |
fig, ax = plt.subplots()
|
62 |
ax.pie(matches, labels=labels, autopct="%1.1f%%", startangle=90,
|
63 |
+
colors=["#87CEEB", "#90EE90", "#FFA07A", "#9370DB"])
|
64 |
ax.set_title(f"Matches Played by {selected_player}", fontsize=14)
|
65 |
st.pyplot(fig)
|
66 |
|
|
|
79 |
|
80 |
# Scatter Plot - Matches vs Runs (ODIs)
|
81 |
fig, ax = plt.subplots()
|
82 |
+
sns.scatterplot(x=df["Matches_ODI"], y=df["batting_Runs_ODI"], ax=ax, color="#4682B4", edgecolor='black')
|
83 |
ax.set_xlabel("Matches Played", fontsize=12)
|
84 |
ax.set_ylabel("Runs Scored", fontsize=12)
|
85 |
ax.set_title("Matches vs Runs in ODIs (All Players)", fontsize=14)
|