I'm new at the language and just began working with the Visualizing Data book written by Ben.
On page 33, I have typed the code into the Processing window and when I click run, I receive this message:
Cannot find a class or type named "Table"
The code is as it is in the book - no typos. Here is the code - if someone can help me out, I'd be grateful.
Thanks - Brian
PImage mapImage;
Table locationTable;
int rowCount;
void setup(){
size(640,400);
mapImage = loadImage("map.png");
//Make a data table from a file that contains
//the coordinates of each state
locationTable = new Table("locations.tsv");
//The row count will be used a lot, so store it globally
rowCount = locationTable.getRowCount();
}
void draw(){
background(255);
image(mapImage,0,0);
//Drawing attributes for the ellipses
smooth();
fill(192,0,0);
noStroke();
//Loop through the rows of the locations file and draw the points
for(int row = 0; row < rowCount; row++){
float x = locationTable.getFloat(row, 1); //column 1
float y = locationTable.getFloat(row, 2); //column 2
ellipse(x,y,9,9);
}
}