Assignment #4 – life.

For this assignment I decided to combine data visualization and text in a relatable, motivating and interesting theme. My project is called life and it shows the unpredictability of our everyday life as well as the highs and lows we all go through.

To make my idea come true, I created a .csv file which would interpret life as a line that goes up and down, representing the battles we fight. I later uploaded the csv file to my sketch and decided to add some effects.

When we hover over the lowest point, a text that says “It has its lows” appears. Similar to that when we hover over the highest point, a text that says “It has its highs” appears. Apart from those two effects, whenever u hover over the straight parts of the line (beginning and end) the line starts to wobble up and down, simulating the unpredictability of life. To add an artistic touch I filled the insides of the line with black.

The code that does all of this can be seen below:

if (x < 150 || x > 450) {
      if (dist(mouseX, mouseY, x, y) < 50)
        y += map(noise(frameCount * 0.01, i * 0.01), 1, 0, -400, 400);
    } else if (mouseX > 250 && mouseX < 330 && mouseY > 400 && mouseY < 550) {
      text("It has its lows", mouseX, mouseY);
    } else if (mouseX > 330 && mouseX < 410 && mouseY > 20 && mouseY < 150) {
      text("It has its highs", mouseX, mouseY);
    }

And finally, enjoy:

Leave a Reply