join the Figure Friday session on April 11, at noon Eastern Time, to showcase your creation and receive feedback from the community.
In this week’s Figure Friday we will explore the Henley dataset.
“Henley Royal Regatta is a multi-day rowing competition that takes place in the town of Henley, England each year. It’s been running since 1839, with a few breaks for the world wars and covid. Each race is a head-to-head, knockout-style affair. Crews will race once a day, progressing to the next day if they win. The finals are always raced on Sunday.” (Dominic’s README)
Things to consider:
what can you improve in the app or sample figure below (bar chart)?
would you like to tell a different data story using a different graph?
from dash import Dash, dcc
import dash_ag_grid as dag
import pandas as pd
import plotly.express as px
# Download CSV sheet at: https://drive.google.com/file/d/1NyBhnTVVwWBblfeA_bifGR9DHuYpaGXu/view?usp=sharing
df = pd.read_csv('henley_results_cleaned.csv')
club_wins = df['winning_club'].value_counts().reset_index()
club_wins.columns = ['Club', 'Wins']
club_wins = club_wins.head(10)
fig = px.bar(club_wins,
x='Club',
y='Wins',
color='Wins',
color_continuous_scale='Viridis',
labels={'Club': 'Club', 'Wins': 'Number of Wins'},
text='Wins',
height=600)
grid = dag.AgGrid(
rowData=df.to_dict("records"),
columnDefs=[{"field": i, 'filter': True, 'sortable': True} for i in df.columns],
dashGridOptions={"pagination": True},
columnSize="sizeToFit"
)
app = Dash()
app.layout = [
grid,
dcc.Graph(figure=fig)
]
if __name__ == "__main__":
app.run(debug=True)
Participation Instructions:
Create - use the weekly data set to build your own Plotly visualization or Dash app. Or, enhance the sample figure provided in this post, using Plotly or Dash.
Submit - post your creation to LinkedIn or Twitter with the hashtags #FigureFriday and #plotly by midnight Thursday, your time zone. Please also submit your visualization as a new post in this thread.
Celebrate - join the Figure Friday sessions to showcase your creation and receive feedback from the community.
It is what it is since I wondered why all teams performed better or worser in certain years.
The line chart shows that best. It also showed some results which required miracles, the finish time was incorrect.
I first created the linechart, than the cards and than an animation (that was ChatGTP again) which showed the race when you clicked on the linechart. That was boring.
That’s when the heatmaps came in. It’s possible that only the heatmap part works, somehow I get sometimes errors on columnvalue.isin(list). Not local, on py.cafe.
So this week, I’m finally getting started on this dashboard project – kinda like throwing out the first pitch in baseball
This dashboard is intended for individuals with an interest in historical sporting events and data analysis, a domain I find particularly engaging.
The fundamental objectives of this dashboard are as follows:
To present the Henley Royal Regatta data in a visually appealing and interactive format, enabling users to explore the information through dynamic charts.
To facilitate the identification of temporal trends, such as shifts in winning teams and changes in race times over the years.
To determine key statistics, including the most successful clubs, the prevalent types of victories, and the significance of leading at various stages of the race.
To provide users with the ability to conduct focused analysis by filtering data based on specific year ranges, cup categories, and boat classes.
To offer relevant background information regarding the regatta, the different cups, boat classifications, and the terminology used to describe race outcomes, thereby enhancing data comprehension.
To ensure a user interface that is modern, intuitive, and aesthetically pleasing, employing a consistent visual style and appropriate design elements for optimal usability.
In essence, the aim of this project is to transform historical racing data into an accessible and informative tool, allowing users to explore and gain insights into the Henley Royal Regatta’s history and evolution in an engaging manner.
Funny how we all take a different viewpoint. I was curious what the difference was in the M8+ between all these cups, than I started to divide everything in these groups and wanted to know what kind of boats it were. That’s when I discovered that in the dataset the W8 were one time faster than the M8 and that there was a winner in M8 with a time nobody would win. Also interesting to see that the more people are in a boat the faster they go.
Another interesting thing was that slower times for winners mostly occur in the same year. That’s when I wanted to know the weather conditions, all summarized I built this for myself.
Not such a very clear goal and write up as you have and a more general dashboard which could be interesting for many more people.
Totally Marianne, that’s one of the things I enjoy most about these short challenges – everyone’s vision is so interesting. That insight is interesting to understand.
@marieanne I’m enjoying your app. Does the temperature heatmap show average temperature for the year or the maximum temp that year?
Great job with the rowing boat icons/images.
Your remark made me think of another interesting analysis we could do in this dataset. We could try to figure out how much value does one additional rower add in terms of time (assuming all of the competitions’ lengths are the same).
For example, if one additional rower makes the rowboat go 1.5x faster, do two additional rowers make the boat go 3x faster or 2x faster, etc.
We have to give ChatGTP some credits here for getting the images and descriptions following url’s. The temperature shown is the temperature at the moment of the race at the race location. I’ve converted date & time to one and this together with lat/long was the input to get the weather at the moment of the race.
The competition length is the same for all events. But some care must be taken when comparing, sometimes there’s also a coxswain on board, sometimes not. And although they are supposed to be as light and small as possible they count.
@Avacsiglo21 I really like the graphs that you chose for your data app. The area chart is helpful to use when comparing between clubs.
It doesn’t look like the dropdowns are connected, correct? When you select a cup from the left dropdown you get a set of charts, and when you select a boat class from the right dropdown you get a different set of charts.
I’m asking because sometimes I picked a club and a boat class that didn’t line up, which resulted in empty cards and graphs.
Correct Adam, the idea is that you choose either by selecting a cup, or by selecting a boat type. In fact, if you notice on the cards, when you choose a cup it gives you information on how many different boats participate in that cup. And vice versa, when you select a boat, it tells you how many cups and the other statistics.
In fact when you select the boat type the sunburt chart will dinamically shows the cups
That’s also what I thought. In that case, I would recommend putting the word Or between the two dropdowns. Then, I would recommend a change to the code so that if one drop has a value chosen, the other dropdown is disabled. Only when both dropdowns are empty, they are both enabled.
This Dash application is designed to visualize data from the Henley Regatta in an interactive and user-friendly format. The application features the following components:
Year Dropdown Filter:
The user can select a range of years, or choose “All” to view data for every year available in the dataset.
The dropdown allows for multiple year selections, making it possible to view and compare the data across various years.
Data Visualizations:
Bar Chart: Displays the number of races by year and winning club in a grouped bar chart format. Each club’s races are shown side by side for each selected year.
Treemap: A visual representation of the verdict distribution across the races. This chart displays the relative number of races for each verdict category in a color-coded treemap layout.
Donut Chart: Shows the distribution of races by destination (represented by the winner station). It uses a donut chart to represent the proportion of races by each station.
Dark Theme: The application is styled using the CYBORG theme from Dash Bootstrap Components, giving it a dark mode appearance for better visibility and aesthetic appeal.
Hi @Ester , I’m fascinated by your donut chart. I expected it to be 50/50, and googled the meaning:
" Each crew is assigned to row on either the ‘Bucks’ (Buckinghamshire) or ‘Berks’ (Berkshire) side of the race course . The coxswains or steersmen are expected to keep their crew on the allocated side of the course at all times during the race, else they risk disqualification."