Skip to content

Commit

Permalink
🚧 Add plot of size of value market
Browse files Browse the repository at this point in the history
  • Loading branch information
nepito committed Oct 11, 2023
1 parent 09f698b commit 8ff4c8a
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions streamlit_app.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import altair as alt
import pandas as pd
import numpy as np
import plotly.express as px
import streamlit as st
import hierarchical_review_plots as hrp
Expand All @@ -8,7 +8,7 @@
data = pd.read_csv("static/played_minutes.csv")
# ----------------- game start --------

team, player = st.tabs(["Team", "Player"])
team, player, groups = st.tabs(["Team", "Player", "Groups"])

with team:
st.subheader("Mapa de calor")
Expand Down Expand Up @@ -60,4 +60,20 @@
st.plotly_chart(fig_2)


df = pd.read_csv("static/champions_team_values.csv")
with groups:
fig = px.treemap(df, path=[px.Constant("Champions"), 'group', 'Team'], values='market_value',
color_continuous_scale='RdBu',
color_continuous_midpoint=np.average(df['market_value'], weights=df['market_value']))
fig.update_layout(margin = dict(t=50, l=25, r=25, b=25))
st.plotly_chart(fig)

fig_is = px.treemap(df, path=[px.Constant("Paridad en la Champions"), 'group', 'Team'], values='p2',
color='market_value',
color_continuous_scale='RdBu',
color_continuous_midpoint=np.average(df['market_value'], weights=df['market_value']))
fig_is.update_layout(margin = dict(t=50, l=25, r=25, b=25))
st.plotly_chart(fig_is)


st.markdown("Made with 💖 by [nies.futbol](https://nies.futbol)")

0 comments on commit 8ff4c8a

Please sign in to comment.