Skip to content

Instantly share code, notes, and snippets.


Chas Jhin cjhin

View GitHub Profile
cjhin /
Last active Sep 29, 2021
D3 Day/Week/Month Line Chart

D3 Time Series Day/Week/Month

Wanted to create a (daily) time series chart with automatic rollups to weekly/monthly lines AND nice transitions


The solution I ended up going with is a bit of an optical illusion.

All three views are technically backed by "daily" data.

cjhin / .block
Last active Jun 13, 2021 — forked from mbostock/.block
Org Chart (Radial -> Dendrogram Transition)
View .block
license: gpl-3.0
height: 950
border: no
View hello.json
const data = {
cameos: [
duration: 10,
reviewStars: 4,
likes: 102,
talentUserId: "1",
consumerUserId: "3",
cjhin /
Last active May 24, 2018
Happy Town
cjhin /
Last active Nov 24, 2017
Bump Chart (Major League Soccer v3)
cjhin /
Last active Jun 26, 2017
American Pie
cjhin /
Last active Apr 23, 2017
Major League Soccer v2

Major League Soccer season data (2006 - 2016)

Slight riff on

This version uses d3 force layouts (and d3v4) to make it easier to read the nodes/circles. The catch is that b/c the force layout pushes the nodes horizontally, it's no longer possible to show as many years.

For now, this just shows a condensed chart of the past 10 years, theoretically at least one solution would be to make the chart "horizontally" scrollable"

cjhin / billionaire.csv
Last active Apr 21, 2017
Table CSS Black Magic
View billionaire.csv
name age children marital-status country gender industry source net-worth
charlene-de-carvalho-heineken 60 5 Married Netherlands Female Food & Beverage Inherited 9.8
beny-steinmetz 58 4 Married Israel Male Metals & Mining Self-made 2.7
lee-shau-kee 86 5 Divorced Hong Kong Male Real Estate Self-made 22.1
david-thomson 57 4 Divorced Canada Male Media Inherited 24.3
bidzina-ivanishvili 58 4 Married Georgia Male Diversified Self-made 5.2
budi-hartono 3 Married Indonesia Male Manufacturing Inherited 8.6
silvio-berlusconi 78 5 Married Italy Male Media Self-made 6.8
robert-kuok 91 8 Married Malaysia Male Diversified Self-made 16.1
andrey-melnichenko 42 0 Married Russia Male Diversified Self-made 10.1
cjhin / data.csv
Last active Mar 6, 2017
D3-Force: Split Continuous
View data.csv
country continent gdp
Egypt Africa 330765
South Africa Africa 312957
Malaysia Asia 296219
Israel Asia 296073
Denmark Europe 294951
Colombia South America 293243
Singapore Asia 292734
Philippines Asia 291965
Pakistan Asia 269971