Week 4 – Data Viz Wind Turbines

Concept:
During class on Wednesday, one of the example datasets that was brought up in class was wind data as the professor played with the globe data visualization. When I saw the wind data, I immediately thought of drawing wind turbines that matched the wind speed data, and that’s what I ended up doing for this project.

Sketch:

While in the planning phase, I thought that this project would be just fun to look at and not a data-focused piece, but this had the unexpected result of being surprisingly insightful about wind speeds during the day. The wind is strongest during the day at about 14:00-17:00, and weakest around midnight to late morning.

Code: 
I was proud of my day/ night cycle code, as I thought it was clever. I drew a black box over the entire screen, and the opacity changes depending on the time of day so it is able to give off a feeling of ‘darkness’ during midnight hours, and it is fully transparent during the daytime.

// opacity of black screen over the screen to give illusion of day/night cycle
const darknessLevel = mapOfHourToDarkness[curHour - 1]
push()
fill(0, 0, 0, darknessLevel * 5)
square(0, 0, 400)
pop()

// complex math -- basically calculates the curSkyColor as an average of darkSky and brightSky, weighted towards darkSky based on the current darknessLevel
curSkyColor = p5.Vector.add(p5.Vector.mult(darkSkyColor, darknessLevel), p5.Vector.mult(brightSkyColor, 10 - darknessLevel)).div(10)

Improvements
There was more data in my .CSV file including wind direction, but I couldn’t think of a good way to implement but it would’ve been nice. I was also not able to find a free API for UAE wind data, and I had to manually scrape the data for a certain day. It would have been fun to be able to visualize the wind speeds of the current/previous day instead of being stuck on 27 Sept 2023.

One thought on “Week 4 – Data Viz Wind Turbines”

  1. Nicely done! The text overlaps with the background lines making it visually cluttered. An improvement would be to move the text or add something behind the text (like a shadow or blur) to make the text more clear. Have a look at lerp() for a way to smoothly transition between values (e.g. the brightness / color of the background). Nice visualization with a lot of character!

Leave a Reply