Some examples from Friday office hours

on 23|01|2015
Filled under: Uncategorized

During the office hours this afternoon (Friday Jan 23) in response to questions I made a few examples; these can be downloaded below. An earlier version of this post had a mistake in the first example; this has been corrected.

1) Example that loops through a table and selects rows based a conditional statement. Note: the key line in this example is this one, in the draw() loop: “if (myYear2005 >=colorThreshold )”. This checks whether the current value of the year is greater than or equal to the value in the slider, and if it is then it prints out the country.

2) Example with slider controlling an animation. This example uses the slider to control how many of the points are included in a looping animation.

3) Example with Unfolding library that uses a slider to select which column from a table to use in the visualization. Note: this example also shows one way to prevent scrolling of Unfolding maps when used with controlP5 elements.

Comments are closed.