An implementation in D3 of Figure 4-21 "Stacked bar chart showing top three eaters from 2000 to 2010" in "Visualize This" by Nathan Yau.
{ | |
"scripts": [ | |
"https://cdnjs.cloudflare.com/ajax/libs/uuid/8.3.2/uuid.min.js" | |
], | |
"styles": [], | |
"showConsole": true | |
} |
git config --global alias.dance '!git stash && git pull && git push && git stash pop' |
license: mit |
license: mit |
emojis=(🐶 🐺 🐱 🐭 🐹 🐰 🐸 🐯 🐨 🐻 🐷 🐮 🐵 🐼 🐧 🐍 🐢 🐙 🐠 🐳 🐬 🐥) | |
emoji='`echo ${emojis[$RANDOM % 22]}`' | |
PS1="\W $emoji > " |
An implementation in D3 of Figure 5-10 "Donut chart using Protovis" in "Visualize This" by Nathan Yau.
The implementation of this chart is quite like the one in the book, as both Protovis and D3 were created by Mike Bostock.
Copyright (c) 2011, Jason Davies | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are met: | |
* Redistributions of source code must retain the above copyright notice, this | |
list of conditions and the following disclaimer. | |
* Redistributions in binary form must reproduce the above copyright notice, |
An implementation in D3 of Figure 4-42 "Step chart showing change in postage rate" in "Visualize This" by Nathan Yau.
Both the tickFormat function used for the x axis and the function used to render the amounts use a directly executed JavaScript function. This function returns another JavaScript function and creates a closure on the first variable, allowing them to have a specific format for the first option in the dataset.
Issues:
- The tickmark for 2001 renders as '01 instead of 2001
An implementation in D3 of Figure 4-41 "World population over the past five decades" in "Visualize This" by Nathan Yau.