Permalink
Browse files

Simple line viz for twitter text lengths.

  • Loading branch information...
1 parent b188b65 commit 6ae9ee8dfa8ebf9c4b70ca035721e65c21daca20 David Humphrey committed Oct 26, 2011
Showing with 9 additions and 2 deletions.
  1. +9 −2 examples/twitter/index2.html
@@ -7,14 +7,21 @@
</head>
<body>
<script id="sketch" type="application/processing">
+ int lineHeight = 3;
+
void setup() {
size(1024, 1024);
+ strokeWeight(lineHeight);
loadTweets('bacon');
}
void draw() {
- background(255);
- println(tweets.size());
+ background(121);
+ for (int i = 0; i < tweets.size(); i++) {
+ Tweet tweet = (tweet)tweets.get(i);
+ int w = map(tweet.text.length, 0, 140, 0, width);
+ line(0, i * lineHeight, w, i * lineHeight);
+ }
}
</script>
<canvas id="tweets"></canvas>

0 comments on commit 6ae9ee8

Please sign in to comment.