ICM Week 8: The Curse of the Broken JSON!

This week other than Serial/Synthesis week has been my worst. Literally nothing was working. My original data sheet (This guy right here)  was being very unforgiving to me. As I sat there trying everything I thought might work…alas with no avail. So I took inspiration from the Getting Started with p5.js book. I know, not the most creative piece I’ve done for class but in a time of vast unknowns, I figured I’d stick with the tried and true before experimenting again.  In the chapter, they list movies by a certain director by their ratings. I figured that was easy enough, just pick a director I know or liked, get a few films and make my own JSON to try that. So I decided to go with master of B and Z Movies, mister Edward D. Wood Jr. Himself!

One: Because I am a sucker for Ed Wood films, and Two: It’s that time of year– Halloween!

JSON can be found on my github!

So at first there was some issues– it wasn’t even showing up! So after much consultation with Dan O this weekend, and making friends with JSON Formatter , we managed to at least get it to show on the sketch. Buuuuuuuuut! The gradient color based on their IMDB rating wasn’t working. It should have– I typed it up exactly how it was in the book! I am a liar. I must have set it myself automatically, or something through the debug and forgot.

this.display = function(x, y) {
push();
var ratingGray = map(this.rating, 2.3, 4.3, 150, 255);
translate(x, y);
rotate(-QUARTER_PI);
fill(255);
text(this.title, 0, 0);
pop();

But after much trial and error, the simplest thought came to my mind– if it’s coloring the text, shouldn’t the fill be changed? So I made it look like so:

this.display = function(x, y) {
push();
var ratingGray = map(this.rating, 2.3, 4.3, 150, 255);
translate(x, y);
rotate(-QUARTER_PI);
fill(ratingGray);
text(this.title, 0, 0);
pop();

Et voila! The gradient started working!

So after a long weekend of nothing working, something came out right at least!

After the one on one sessions I feel little less leery on the periodic table, especially considering if it’s my approved final project– I can set little chunks week by week so I don’t freak out.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.