Students will be able to:
- Use ChatGPT to build something in a programming language they're not familiar with (D3) #learning-how-to-learn
This lesson assumes you are familiar with:
- Basic HTML, CSS and JavaScript
- Using GitHub
https://data.boston.gov/dataset/311-service-requests
Download data of all 311 calls in Boston from 2023
wget -O boston_311_2023_raw.csv https://data.boston.gov/dataset/8048697b-ad64-4bfc-b090-ee00169f2323/resource/e6013a93-1321-4f2a-bf91-8d8a02f1e62f/download/tmpc0m94i5x.csv
Run pivot.py
as shown below to make a new file that has the reasons for 311 calls and their counts
python pivot.py
this will output a file called `boston_311_2023.csv
Use your knowledge of the vocabulary of HTML, CSS and JS to prompt ChatGPT. Your goal is to, with it's help, make a D3 visualization of all of the 311 calls in Boston from 2023.
- Make a bar chart of the top 10 reasons for 311 calls in the past year (hint: use the
reason
column in the data) - The initial bar chart may not look quite right. With the help of ChatGPT, fix anything that looks immediately off (for example, sometimes the axis labels overlap or the bars are out of order etc...)
- Give the bar chart a good headline and subheadline
- Make the bar chart horizontal instead of vertical
- Change the default colors, text size, or anything else
- Add a citation for where the data comes from and give yourslves a chart authorship credit in the footnotes
Bonus: Create a button that shows an extended bar chart with all of the remaining counts of the reason
column.
What worked? What didn't? Review your classmates' conversations with ChatGPT in Slack. Fill out an AI reflection form about your experience today.