Skip to content

Instantly share code, notes, and snippets.

View johan's full-sized avatar

Johan Sundström johan

View GitHub Profile
@johan
johan / .block
Created July 20, 2016 11:52 — forked from mbostock/.block
Sleep Cycles
license: gpl-3.0
@johan
johan / README.md
Last active March 1, 2024 05:26 — forked from mbostock/.block

Hourly solar analemmas (ignoring daylight savings time) as seen from San Francisco in 2014.

@johan
johan / README.md
Last active December 17, 2015 03:38 — forked from mbostock/.block

A recreation of E.J. Marey’s graphical train schedule. Stations are separated vertically in proportion to geography; thus, the slope of the line reflects the speed of the train: the steeper the line, the faster the train. This display also reveals when and where limited service trains (in orange) are passed by baby bullets (in red). This type of plot is sometimes called a “stringline chart”.

See also the earlier Protovis version by Vadim Ogievetsky.

@johan
johan / README.md
Last active November 6, 2021 14:09 — forked from NV/Readme.md
JS debug breakpoint / log snippets

stopBefore.js

2min screencast

These tools inject a breakpoint, console.log or console.count in any function you want to spy on via stopBefore('Element.prototype.removeChild') or ditto stopAfter, logBefore / logAfter / logAround / logCount.

Works in Chrome DevTools and Safari Inspector; Firefox dev tools reportedly less so.

@johan
johan / README.md
Last active December 12, 2015 06:08 — forked from mbostock/.block
The psy curve

This example demonstrates the construction of the psy curve.

@johan
johan / README.md
Last active December 11, 2015 19:08 — forked from johan/README.md
@johan
johan / README.md
Last active December 11, 2015 18:59 — forked from johan/README.md
Sunny side of the Earth, for any date and time.
@johan
johan / README.md
Last active December 11, 2015 18:59 — forked from mbostock/.block
Solar Terminator on Interrupted Mollweide
@johan
johan / README.md
Last active January 16, 2020 12:17 — forked from benelsen/README.md
Earth, night and day sides.
@johan
johan / README.md
Last active December 11, 2015 18:48 — forked from mbostock/.block
Why you arrive from the North when flying to the US from Iceland.

When flying to the US via Iceland, you never arrive from the East, but always cross the North US border. This two-point equidistant projection focused on Keflavik airport, Iceland (red) and San José airport, USA (blue) demonstrates why.

The circles are great circles centered on either airport spaced at 10° intervals.

The projection implementation is still a work in progress, hence the visual artifacts; it requires elliptical clipping. Based on a gist by Mike Bostock.