How to Code a Climate Spiral
Learn to create your own climate spiral using p5.js and temperature data. Originally designed by the climate scientist Ed Hawkins, the climate spiral is a visual representation of the changing temperatures over time, illustrating the urgent need to address climate change. Code: https://thecodingtrain.com/challenges/178-climate-spiral
๐ Watch this video ad-free on Nebula https://nebula.tv/videos/codingtrain-coding-challenge-178-visualizing-data
๐น๏ธ p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/sketches/r69De6khN
๐ฅ Previous video: https://youtu.be/IxdGyqhppis?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
๐ฅ All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
References:
๐ฅ๏ธ National Centre for Atmospheric Science: https://ncas.ac.uk
๐ฅ๏ธ Ed Hawkin's website: https://edhawkins.org
๐ NASA Earth Observatory - Global Temperatures: https://earthobservatory.nasa.gov/world-of-change/global-temperatures
๐ GISS Surface Temperature Analysis (GISTEMP v4): https://data.giss.nasa.gov/gistemp/
๐ GISS Surface Temperature Analysis FAQ: https://data.giss.nasa.gov/gistemp/faq/
๐ GLOBAL SURFACE TEMPERATURE CHANGE: https://pubs.giss.nasa.gov/docs/2010/2010_Hansen_ha00510u.pdf
๐ Improvements in the GISTEMP Uncertainty Model: https://agupubs.onlinelibrary.wiley.com/doi/10.1029/2018JD029522
๐ National Centers for Environmental Information: https://www.ncei.noaa.gov/access/metadata/landing-page/bin/iso?id=gov.noaa.ncdc:C00934
๐ Suggestion from ABohyn: https://github.com/CodingTrain/Suggestion-Box/issues/1789
๐ p5.loadTable: https://p5js.org/reference/#/p5/loadTable
๐ p5.TableRow: https://p5js.org/reference/#/p5.TableRow
๐ lerpColor(): https://p5js.org/reference/#/p5/lerpColor
Videos:
๐ฅ Climate Spiral: https://www.youtube.com/watch?v=jWoCXLuTIkI
๐ Polar Coordinates: https://youtu.be/O5wjXoFrau4
๐ Translate, Rotate, Push/Pop: https://youtu.be/o9sgjuh-CBM
Related Coding Challenges:
๐ 48 White House Social Media Data Visualization: https://youtu.be/UrznYJltZrU
๐ 58 3D Earthquake Data Visualization: https://youtu.be/dbs4IYGfAXc
๐ 96 Visualizing the Digits of Pi: https://youtu.be/WEd_UIKG-uc
๐ 109 Visualizing 500,000 Subscribers: https://youtu.be/Ae73YY_GAU8
Timestamps:
0:00 Welcome to a special Earth Day Coding Challenge!
0:35 What is a temperature anomaly?
2:28 NASA Goddard Institute for Space Studies website
3:17 Preview the data
4:34 Upload the data
5:13 Use loadTable() to preload the data
7:01 Check out the data
9:28 Set up the base pattern
10:42 Polar Coordinates
12:36 Add the month labels
16:11 Time for the data!
17:05 Draw the spiral
18:09 Set up global variables
19:04 Map the x, y positions to the data
20:27 Loop through all of the data
21:57 Check for null values
22:43 Animate the spiral
25:17 Add one month at a time
28:47 Add color to the spiral
29:42 Connect the points with a line segment
34:45 Use lerpColor() to vary color
38:00 Use parseFloat() to convert a string to a float
38:40 We have the climate spiral
40:16 Suggestions for possible variations
40:42 Outro
Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound
๐ Website: https://thecodingtrain.com/
๐พ Share Your Creation! https://thecodingtrain.com/guides/passenger-showcase-guide
๐ฉ Suggest Topics: https://github.com/CodingTrain/Suggestion-Box
๐ก GitHub: https://github.com/CodingTrain
๐ฌ Discord: https://thecodingtrain.com/discord
๐ Membership: http://youtube.com/thecodingtrain/join
๐ Store: https://standard.tv/codingtrain
๐๏ธ Twitter: https://twitter.com/thecodingtrain
๐ธ Instagram: https://www.instagram.com/the.coding.train/
๐ฅ Coding Challenges: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
๐ฅ Intro to Programming: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA
๐ p5.js: https://p5js.org
๐ p5.js Web Editor: https://editor.p5js.org/
๐ Processing: https://processing.org
๐ Code of Conduct: https://github.com/CodingTrain/Code-of-Conduct
This description was auto-generated. If you see a problem, please open an issue: https://github.com/CodingTrain/thecodingtrain.com/issues/new
#data #visualization #datavisualization #climatespiral #climatechange #p5js #javascript