Skip to content

Instantly share code, notes, and snippets.

@kdctran
kdctran / d3.sankey.js
Created January 7, 2019 23:48 — forked from emeeks/d3.sankey.js
Sankey Particles
d3.sankey = function() {
var sankey = {},
nodeWidth = 24,
nodePadding = 8,
size = [1, 1],
nodes = [],
links = [];
sankey.nodeWidth = function(_) {
if (!arguments.length) return nodeWidth;
@kdctran
kdctran / humanity_globe.R
Last active November 23, 2023 21:35 — forked from tylermorganwall/humanity_globe.R
3D Humanity Globe
# data: https://sedac.ciesin.columbia.edu/data/collection/gpw-v4
library(rayshader)
library(rayrender)
popdata = raster::raster("gpw_v4_population_density_rev11_2020_15_min.tif")
population_mat = rayshader:::flipud(raster_to_matrix(popdata))
above1 = population_mat > 1