Skip to content

Instantly share code, notes, and snippets.

View chitacan's full-sized avatar

Bret Kim chitacan

View GitHub Profile
@chitacan
chitacan / README.md
Created November 7, 2015 06:15 — forked from mbostock/.block
Tree of Life

A re-implementation of Jason Davies’ Phylogenetic Tree of Life, with faded gray lines to connect the leaf nodes of the tree to their corresponding labels inspired by a figure from Nature.

This implementation modifies the depth of interior nodes in a cluster layout to show branch lengths. Toggle the checkbox in the top-left corner to show or hide branch lengths, and mouseover a label to highlight its path to the root.

@chitacan
chitacan / README.md
Created October 19, 2015 14:29 — forked from nbremer/.block
Radar Chart Redesign

Still a secret for now, but it's not hard to guess what it will be used for...

console.clear()
# Recipes from "RXJS Lessons"
# (https://www.youtube.com/playlist?list=PLX7ZnQs0Gb1pc1vNduNaIgFiyQ3THgymv)
# (https://jsbin.com/garaci/31/edit)
# ----------------------------------------------
# 1. creating an observable
src_1 = Rx.Observable.create (observer) ->
id = setTimeout () ->
@chitacan
chitacan / README.md
Last active August 28, 2015 05:58 — forked from mbostock/.block
Smooth Scrolling

This example uses a custom tween that interpolates the window’s vertical scroll offset.

@chitacan
chitacan / README.md
Last active August 28, 2015 00:53 — forked from syntagmatic/README.md
Comparing Map Projections

A mashup of Map Projection Distortions and transitions using the D3.js extended geographic projections plugin.

A comparison of map projections by four different types of distortion:

  • Acc. 40° 150% – The Acceptance index is a numerical measure that summarizes overall projection distortion, in this case with a maximum angular distortion of 40° and areal distortion of up to 150%.
  • Scale – The weighted mean error for overall scale distortion.
  • Areal – The weighted mean error for areal distortion.
  • Angular – The mean angular deformation index.

Lower is better. Data transcribed from the Natural Earth Projection by @mbostock.

@chitacan
chitacan / README.md
Last active December 16, 2016 21:39 — forked from mbostock/.block
Voronoi Arc Map

Mouseover to see flights originating at the specified airport. The cool thing about this technique is that the interaction requires zero JavaScript — it’s all done in CSS using the :hover state to toggle visibility of an airport’s associated outgoing flight routes.

@chitacan
chitacan / README.md
Last active August 29, 2015 14:27 — forked from mbostock/.block
Radial Reingold–Tilford Tree

The tree layout implements the Reingold-Tilford algorithm for efficient, tidy arrangement of layered nodes. The depth of nodes is computed by distance from the root, leading to a ragged appearance. Cartesian orientations are also supported. Implementation based on work by Jeff Heer and Jason Davies using Buchheim et al.'s linear-time variant of the Reingold-Tilford algorithm. Data shows the Flare class hierarchy, also courtesy Jeff Heer.

Compare to this Cartesian layout.

@chitacan
chitacan / index.html
Last active August 29, 2015 14:27 — forked from mbostock/.block
Hierarchical Edge Bundling
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.node {
font: 300 11px "Helvetica Neue", Helvetica, Arial, sans-serif;
fill: #bbb;
}
.node:hover {
@chitacan
chitacan / underscore_vs_lodash.md
Last active August 29, 2015 14:27
underscore vs lodash
_.chain()
  .filter()
  .map()
  .flatten()
  .value()

for > 800 items

@chitacan
chitacan / d3-zoom-pan-extent.js
Last active August 29, 2015 14:26 — forked from mhsmith/d3-zoom-pan-extent.js
Pan+Zoom within limits
d3 = function() {
var d3 = {
version: "3.1.10-xsystem"
};
if (!Date.now) Date.now = function() {
return +new Date();
};
var d3_document = document, d3_window = window;
try {
d3_document.createElement("div").style.setProperty("opacity", 0, "");