This is a fork of Mike Bostock's Block/Gist showing how to wrap long labels in D3. However, I've adapted it to use D3 v4 (latest version of D3 at time of writing).
This demonstration uses satirical data from The Onion.
The changes to Bostock's code are not substantial.
- Some method names and usages had to change to be compatible with D3 v4.
- I decluttered most of the JavaScript semicolons.
- I replaced many of the pure
function
declarations with easier-to-read arrow functions.