Errata

Visualizing Data

Errata for Visualizing Data

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

Color key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted By Date submitted Date corrected
Printed
Page 23
line 5

"Help -> Getting Started" should be "Help -> Environment"

Note from the Author or Editor:
Confirmed, the menu item has been renamed in more recent releases.

Anonymous  Dec 03, 2008  Mar 02, 2012
Printed
Page 37
12th line down; Shouldn't the percentage be a number between 0.0 and 1.0 rather than 0.0 and 0.1?

confirmed, should read "(a number between 0.0 and 1.0)"

Anonymous    Jun 01, 2008
Other Digital Version
37
12th line down; Shouldn't the percentage be a number between 0.0 and 1.0 rather than 0.0 and 0.1?

confirmed, should read "(a number between 0.0 and 1.0)"

Anonymous    Jun 01, 2008
Printed
Page 55
last paragraph and code

- end of paragraph tells me about the importance of comments
- the first comment tells me m is set "arbitrarily high"; followed by a contradictory phrase
- the first line of code appears to set m very low (MIN_FLOAT)

Note from the Author or Editor:
The comment is incorrect, but the code is correct. It should read:

// Set the value of m to the lowest possible value,
// so that the first value found will automatically be larger.
float m = MIN_FLOAT;

Anonymous  Jun 17, 2008  Mar 02, 2012
Printed
Page 59
First paragraph; The line

PFont plotFont;

should really be bold, as it is a new addition.

confirmed.

Anonymous    Jun 01, 2008
Other Digital Version
59
First paragraph; The line

PFont plotFont;

should really be bold, as it is a new addition.

confirmed.

Anonymous    Jun 01, 2008
Printed
Page 63
code examples in 1st and 2nd paragraphs

The following should be added to the code example after paragraph 1:
int rowCount;

And the following line of code needs to be added to the setup() method:
rowCount = data.getRowCount();

And finally, this line of code needs to be added to the draw() method:
drawYearLabels();

With these modifications the year labels show up as described in the text.

Anonymous   
Printed
Page 65/66
(tbd - missing instruction)

Need instruction to add line of code:

drawVolumeLabels();

to the draw() method.

Note from the Author or Editor:
Please insert the following before the sentence on page 66 that begins "When you're drawing the text label":

Add a drawVolumeLabels() call to the draw() method, next to drawTitle().

(If this causes pagination problems, I can shorten the "note" insert found on that page so avoid pagination issues.)

Anonymous  Jun 20, 2008  Mar 02, 2012
Printed
Page 66
2nd code segment

the conditional of the for loop is shown as "v < dataMax". But the text on the bottom of the page
indicates that v should be drawn when it EQUALS dataMax (50). It's then suggested that we should ALTER "v
<= dataMax" to "v < dataMax". But, of course, it was always < and never <=.

confirmed. change "v < dataMax" to "v <= dataMax" on the 12th line of the page.

Anonymous    Jun 01, 2008
Other Digital Version
66
2nd code segment

the conditional of the for loop is shown as "v < dataMax". But the text on the bottom of the page
indicates that v should be drawn when it EQUALS dataMax (50). It's then suggested that we should ALTER "v
<= dataMax" to "v < dataMax". But, of course, it was always < and never <=.

confirmed. change "v < dataMax" to "v <= dataMax" on the 12th line of the page.

Anonymous    Jun 01, 2008
Printed
Page 68
4th line of code

It doesn't make sense to have the if statement testing "v % volumeIntervalMinor == 0" in the for loop.
The loop starts v at dataMin (set to be 0) and increments by volumeIntervalMinor. So the modulo operation
will always equal 0. If dataMin wasn't set at 0 and was some value not a multiple of volumeIntervalMinor,
no ticks or text would be drawn along the y-axis. That doesn't seem to be something we would want either.

confirmed.. so the code at the top of 68, remove the line that ends "if a tick mark". then remove 2 spaces of indent for all the lines that follow. finally, remove the final }

and the code at the top of p. 72 needs the same treatment. (remove the "if a tick mark" line, remove the indent caused by it, and remove the extra squiggle)

the same code is toward the end of p. 91, and needs the same fix.

Anonymous    Jun 01, 2008
Other Digital Version
68
4th line of code

It doesn't make sense to have the if statement testing "v % volumeIntervalMinor == 0" in the for loop.
The loop starts v at dataMin (set to be 0) and increments by volumeIntervalMinor. So the modulo operation
will always equal 0. If dataMin wasn't set at 0 and was some value not a multiple of volumeIntervalMinor,
no ticks or text would be drawn along the y-axis. That doesn't seem to be something we would want either.

confirmed.. so the code at the top of 68, remove the line that ends "if a tick mark". then remove 2 spaces of indent for all the lines that follow. finally, remove the final }

and the code at the top of p. 72 needs the same treatment. (remove the "if a tick mark" line, remove the indent caused by it, and remove the extra squiggle)

the same code is toward the end of p. 91, and needs the same fix.

Anonymous    Jun 01, 2008
Printed
Page 82
code example in 2nd paragraph

Replace:
float barWidth = 4; // Add to the end of setup()

With:
float barWidth = 4; // Add to the top of the page, before setup()

confirmed.

Anonymous    Jun 01, 2008
Other Digital Version
82
code example in 2nd paragraph

Replace:
float barWidth = 4; // Add to the end of setup()

With:
float barWidth = 4; // Add to the top of the page, before setup()

confirmed.

Anonymous    Jun 01, 2008
Printed
Page 88
4th paragraph; There's a sudden change in then name of a function. The books says, "Finally, modify

setCurrent() to set..." On previous pages, this function was called setColumn(). This may be a little
confusing.

confirmed, change the two references to setCurrent() on p.88, and on the bottom half of p.90 to use setColumn() instead.

Anonymous    Jun 01, 2008
Other Digital Version
88
4th paragraph; There's a sudden change in then name of a function. The books says, "Finally, modify

setCurrent() to set..." On previous pages, this function was called setColumn(). This may be a little
confusing.

confirmed, change the two references to setCurrent() on p.88, and on the bottom half of p.90 to use setColumn() instead.

Anonymous    Jun 01, 2008
Printed
Page 153
6.1.3. Building the Preprocessor sample code; This piece of sample code

cleaned[placeCount++] = data[ZIP_CODE] + " " +
x + " "
y + " "
placeName;

should read...

cleaned[placeCount++] = data[ZIP_CODE] + " " + x + " "+ y + " "+ placeName;

confirmed.. add a + to the end of the 'x' and 'y' lines so it reads:

cleaned[placeCount++] = data[ZIP_CODE] + " " +
x + " " +
y + " " +
placeName;

Anonymous    Jun 01, 2008
Other Digital Version
153
6.1.3. Building the Preprocessor sample code; This piece of sample code

cleaned[placeCount++] = data[ZIP_CODE] + " " +
x + " "
y + " "
placeName;

should read...

cleaned[placeCount++] = data[ZIP_CODE] + " " + x + " "+ y + " "+ placeName;

confirmed.. add a + to the end of the 'x' and 'y' lines so it reads:

cleaned[placeCount++] = data[ZIP_CODE] + " " +
x + " " +
y + " " +
placeName;

Anonymous    Jun 01, 2008
Printed
Page 159
6.4. Highlighting Points While Typing (Refine and Interact)

On the online Safari version of this section: 6.4. Highlighting Points While Typing (Refine and Interact)

Shortly after this sample code...

color backgroundColor = #333333; // dark background color
color dormantColor = #999966; // initial color of the map
color highlightedColor = #CBCBCB; // color for selected points
color unhighlightedColor = #66664C; // color for points that are not selected
color badColor = #FFFF66; // text color when nothing found

you should instruct people to change their code from...

public void draw( ) {
background(255);

change to

public void draw( ) {
background(backgroundColor);

because if they don't do this they will end up with white background which is not what is shown on the
bottom of the page.

confirmed, so at the bottom of page 161, before the paragraph that reads "the new version of the code", add a new paragraph that reads:

And finally, change the {{background(255)}} inside {{setup()}} to {{background(backgroundColor}}, to use the new color background color.

(i'm using {{ and }} to mark the monospace/code font)

Anonymous    Jun 01, 2008
Other Digital Version
159
6.4. Highlighting Points While Typing (Refine and Interact)

On the online Safari version of this section: 6.4. Highlighting Points While Typing (Refine and Interact)

Shortly after this sample code...

color backgroundColor = #333333; // dark background color
color dormantColor = #999966; // initial color of the map
color highlightedColor = #CBCBCB; // color for selected points
color unhighlightedColor = #66664C; // color for points that are not selected
color badColor = #FFFF66; // text color when nothing found

you should instruct people to change their code from...

public void draw( ) {
background(255);

change to

public void draw( ) {
background(backgroundColor);

because if they don't do this they will end up with white background which is not what is shown on the
bottom of the page.

confirmed, so at the bottom of page 161, before the paragraph that reads "the new version of the code", add a new paragraph that reads:

And finally, change the {{background(255)}} inside {{setup()}} to {{background(backgroundColor}}, to use the new color background color.

(i'm using {{ and }} to mark the monospace/code font)

Anonymous    Jun 01, 2008
Printed
Page 162-3
6.5. Show the Currently Selected Point (Refine); Show the Currently Selected Point (Refine) in

the sample code there are three instances of

fill(highlightColor);

which should be

fill(highlightedColor);

If they are to correctly match the variable set in the previous section 6.4. Highlighting Points While
Typing (Refine and Interact)
top of page.

color highlightedColor = #CBCBCB; // color for selected points

confirmed, though the other way around: all instances of highlightedColor and unhighlightedColor should be changed to highlightColor and unhighlightColor. (just removing the 'ed' in the middle.) this is the case for the entire chapter.

In Chapter 6, every instance of highlightedColor was changed to highlightColor
and every instance of unhighlightedColor was changed to unhighlightColor.

Anonymous    Jun 01, 2008
Other Digital Version
162-3
6.5. Show the Currently Selected Point (Refine); Show the Currently Selected Point (Refine) in

the sample code there are three instances of

fill(highlightColor);

which should be

fill(highlightedColor);

If they are to correctly match the variable set in the previous section 6.4. Highlighting Points While
Typing (Refine and Interact)
top of page.

color highlightedColor = #CBCBCB; // color for selected points

confirmed, though the other way around: all instances of highlightedColor and unhighlightedColor should be changed to highlightColor and unhighlightColor. (just removing the 'ed' in the middle.) this is the case for the entire chapter.

In Chapter 6, every instance of highlightedColor was changed to highlightColor
and every instance of unhighlightedColor was changed to unhighlightColor.

Anonymous    Jun 01, 2008
Printed
Page 163
The "chosen" variable is meant to hold the currently selected Place, but it is not set anywhere

in the code. (On p. 164, it's checked to see if it's not null, which it always is).

*confirmed*, though the remedy cited is incorrect. on page 164, a paragraph needs to be added before the "And in updateTyped()" paragraph to read:

The {{chosen}} value is set by adding the following to the end of the {{check()}} method:
if ((matchDepth == typedCount) && (typedCount == 5))
chosen = this;
}

[fry] also in that section--at the bottom of 175, the
//if (partial[typedCount] == partialCode) {
line should be removed entirely. it's non-functional.

Anonymous    Jun 01, 2008
Other Digital Version
163
The "chosen" variable is meant to hold the currently selected Place, but it is not set anywhere

in the code. (On p. 164, it's checked to see if it's not null, which it always is).

*confirmed*, though the remedy cited is incorrect. on page 164, a paragraph needs to be added before the "And in updateTyped()" paragraph to read:

The {{chosen}} value is set by adding the following to the end of the {{check()}} method:
if ((matchDepth == typedCount) && (typedCount == 5))
chosen = this;
}

[fry] also in that section--at the bottom of 175, the
//if (partial[typedCount] == partialCode) {
line should be removed entirely. it's non-functional.

Anonymous    Jun 01, 2008
Printed
Page 190
2nd paragraph under "A Simple Treemap Library"

For installing libraries, the text says to install the treemap folder into the sketchbook folder. Really, this should say into the 'libraries' folder inside the sketchbook folder. The paragraph tells the reader to read more about libraries in chapter 2, but this subdirectory is not covered there. Instead, I ended up having to find this subfolder instruction on http://processing.org/reference/libraries/

It says:

Note from the Author or Editor:
Yes, you are correct. This was one thing that we changed between the book's publication two years ago, and the final Processing 1.0 release. We'll no doubt include the changes in the next edition. Thanks!

Megan Squire  Jul 12, 2009  Mar 02, 2012
Printed
Page 223
Top code example

The fifth line -- addEdges("plate", "fork") -- is incorrect. It should read addEdge("plate", "fork"); like its surrounding lines.

Anonymous  Nov 20, 2008  Mar 02, 2012
Printed
Page 278
1st line of code on that page

code has reverse behaviour of that described

//Skip hidden files and folders starting with a period.
if (names[i].charAt(0) != '.') continue;

continues if that array member doesn't start with . (is a hidden file) -
so it continues (skips that one) every time it finds a visible file and processes hidden files

it should be

if (names[i].charAt(0) == '.') continue;

*confirmed* should be == instead of !=

Anonymous    Jun 01, 2008
Other Digital Version
278
1st line of code on that page

code has reverse behaviour of that described

//Skip hidden files and folders starting with a period.
if (names[i].charAt(0) != '.') continue;

continues if that array member doesn't start with . (is a hidden file) -
so it continues (skips that one) every time it finds a visible file and processes hidden files

it should be

if (names[i].charAt(0) == '.') continue;

*confirmed* should be == instead of !=

Anonymous    Jun 01, 2008