scotthmurray / d3-book

Code examples for “Interactive Data Visualization for the Web”
http://d3book.com
Other
2.4k stars 1.79k forks source link

Incorrect code listing on page 202 of book (2nd Edition) #28

Closed Selbosh closed 6 years ago

Selbosh commented 6 years ago

In the box Pointer Events on Overlapping Elements on pages 201–2, Chapter 10 (2nd Edition), one of the blocks of code seems to be misplaced. At the start of page 202, the text reads:

For example, this would apply to all SVG text elements:

svg
rect
rect
rect
...
text
text
text
...

But this doesn't make sense in context and looks like it has been mistakenly copied and pasted from exactly the same code block, printed further down the same page, where the section Grouping SVG Elements describes the element hierarchy.

I suspect that the block at the start of page 202 should instead be something like the following.

For example, this would apply to all SVG text elements:

text {
pointer-events: none;
}

Or possibly

svg text {
    pointer-events: none;
}
scotthmurray commented 6 years ago

Arrrrrrrrrgggggggghhhh!

You are exactly right, of course. Thank you for reporting this! This is the first verified, known typo in the book. You win a… a… well, you win something. Maybe a corrected copy? I should have a typo bounty program.

I've fixed this in the source, so it will be corrected in future printings and ebook releases — though that doesn't help for the copies already out there.

Selbosh commented 6 years ago

No worries! A corrected copy sounds like a disproportionate reward, which I will grudgingly accept...