Tuesday, February 26, 2019

Working with API's and JSON

This has been a pretty amazing journey. I had a heck of a time getting this example to work! I think there was a corrupt character in my original URL. However, I got it to work now!

This is a basic graphical visualization of data using the current temperature (on the left) and the current humidity (on the right).

The big questions here are, How can we be more visual with data? How can we make the "particles" move based on other API data?



What follows is all of the code that allows this to work! in p5 you will need:

  • First I would watch the p5.js Working with Data videos by Daniel Shiffman. This incredible educator is one of my heroes! When I was in Texas in early February, someone asked me if I was Daniel Shiffman... I was deeply honored, but well... I'm not. 
  • The wind map had me at the press of the start button! I must know how to do this! 
  • Next what follows are the files I created using p5.js:
    • sketch.js
    • index.html
    • style.css
  • The other file is a look into a JSON (JavaScript Object Notation) file.  There is a ton of information out there stored inside API's  (Application Programming Interface). There are so many websites that aggregate and package data!
  • As a student or as an adult, how can you use big data and make it easier to understand visually? By the way this isn't a future occupation, this is the here and now! Take a risk, and try to code, I'm happy to help in any way!