Skip to content

Instantly share code, notes, and snippets.

View ckuijjer's full-sized avatar
💭
👻

Casper Kuijjer ckuijjer

💭
👻
View GitHub Profile
@ckuijjer
ckuijjer / README.md
Last active December 21, 2015 16:29
Hot Dog Eating

An implementation in D3 of Figure 4-5 "Bar graph showing results from Nathan's Hot Dog Eating Contest" in "Visualize This" by Nathan Yau.

The chart is implemented using SVG, and I've manually added the text boxes as HTML DIV elements. Likely it's better to also add the text boxes as SVG.

I've tried to make the chart as much like the one in the book, but there are at least two issues:

  1. The layout is off, the chart in the book looks way better (for example take a look at the distance between the text boxes or the start and end of the X-axis).
  2. The Y-axis looks different, I'm not sure how to fix this.
@ckuijjer
ckuijjer / README.md
Last active August 24, 2017 19:09
Top Three Hot Dog Eaters

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.

@ckuijjer
ckuijjer / README.md
Last active December 23, 2015 14:29
Increase in subscribers

An implementation in D3 of Figure 4-25 "Scatterplot created in R and designed in Illustrator" in "Visualize This" by Nathan Yau.

@ckuijjer
ckuijjer / README.md
Last active December 23, 2015 14:39
World population over the past five decades

An implementation in D3 of Figure 4-41 "World population over the past five decades" in "Visualize This" by Nathan Yau.

@ckuijjer
ckuijjer / README.md
Last active December 23, 2015 18:19
United States Postage Rate

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
@ckuijjer
ckuijjer / LICENSE
Last active December 24, 2015 17:59
Unemployment rates with fitted LOESS curve
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,
@ckuijjer
ckuijjer / README.md
Last active December 25, 2015 06:09
Donut chart using Protovis

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.

emojis=(🐶 🐺 🐱 🐭 🐹 🐰 🐸 🐯 🐨 🐻 🐷 🐮 🐵 🐼 🐧 🐍 🐢 🐙 🐠 🐳 🐬 🐥)
emoji='`echo ${emojis[$RANDOM % 22]}`'
PS1="\W $emoji > "
@ckuijjer
ckuijjer / .block
Last active August 28, 2017 10:05
Interactive stacked bar chart using Protoviz
license: mit
@ckuijjer
ckuijjer / .block
Created August 31, 2017 10:58
Revised treemap from R to Illustrator
license: mit