scotthmurray / d3-book

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

New labels should start 1/2 a bar-width to right #27

Open Selbosh opened 6 years ago

Selbosh commented 6 years ago

Line 192 should add half a bar width to the horizontal starting position of labels in the enter() selection, otherwise they are incorrectly aligned with the bar during the transition.

scotthmurray commented 6 years ago

Ah, thank you! Very good catch, and I expect you're the first person to notice this very small and fast-moving discrepancy. :-)

I'm going to leave this PR open for now; I'd like to apply this, but not until the code excerpts and explanations in the book can be updated at the same time.