Skip to content

Instantly share code, notes, and snippets.

@kenpenn
kenpenn / gangnam.js
Last active October 8, 2021 15:27
d3 gangnam style
/* d3 gangnam style!
* simplifed test case
* moving force-directed graph nodes via transform
* coded by Ken Penn
*/
(function () {
window.reqAniFrame = function(win, t) {
return win["r" + t] || win["webkitR" + t] || win["mozR" + t] || win["msR" + t] || function(fn) { setTimeout(fn, 60) }
} (window, "equestAnimationFrame");
@kenpenn
kenpenn / index.html
Last active January 31, 2016 01:37
styling SVG markers
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Styling SVG Markers</title>
<style id="styles">
html {
background: hsl(0, 0%, 0%);
-webkit-background-size: cover;
-moz-background-size: cover;
@kenpenn
kenpenn / adams-150x.png
Last active August 29, 2015 14:22
Good People to Follow
adams-150x.png
@kenpenn
kenpenn / adams-150x.png
Last active August 29, 2015 14:23
d3 to three
adams-150x.png
@kenpenn
kenpenn / globe-tour.css
Last active December 19, 2019 10:28
d3 with three world tour
* { box-sizing : border-box; }
body {
background: #111;
color: #fff;
font-family: sans-serif;
font-weight:normal;
font-size: 13px;
margin:0;
@kenpenn
kenpenn / README.md
Last active July 27, 2016 02:56
brush with scatterplots & sparklines

This example demonstrates how to use D3's brush component to implement focus + context zooming, with sparklines and scatterplots.

Click and drag in the small chart below to pan or zoom.

Sample data is blood pressure readings over time.

Averages for blood-pressure samples in a range are shown at the top.

Mousing over a systolic/diastolic pair highlights the pair.

@kenpenn
kenpenn / README.md
Last active June 29, 2016 08:30
Canvas Force-Directed Graph
@kenpenn
kenpenn / .block
Last active July 5, 2016 01:36
Self-adjusting setTimeout loop
license: gpl-3.0
height: 500
@kenpenn
kenpenn / .block
Last active June 4, 2018 04:57
D3 Gangnam Style! v4
license: gpl-3.0
height: 600
@kenpenn
kenpenn / .block
Last active July 5, 2016 01:47
disco lights
license: gpl-3.0
height: 500