Skip to content

Instantly share code, notes, and snippets.

@yonester
yonester / .block
Last active March 7, 2016 03:26
7th Grade Graphs with D3
license: gpl-3.0
@yonester
yonester / config.json
Last active December 23, 2015 09:49
ezsync config file concept
{
"excludes": [
"$RECYCLE.BIN",
"RECYCLER",
"RecoveryBin",
"System Volume Information",
"Thumbs.db",
"desktop.ini",
"Desktop.ini",
"*.SYS",
@yonester
yonester / .block
Last active March 7, 2016 03:23
Draggable Cluster Dendrogram
license: gpl-3.0
@yonester
yonester / pprint.js
Created October 6, 2014 21:06
Super simple pretty print
var _ = require('lodash');
// Pretty print for JSON-style objects.
function pprint(obj) {
if (!pprint.indent) pprint.indent = '';
if (_.isPlainObject(obj)) {
_.forOwn(obj, function(v, k) {
if (_.isArray(v) || _.isPlainObject(v)) {
console.log(pprint.indent + k + ':');
pprint.indent += ' ';
gistup
gistup
@yonester
yonester / .block
Last active March 9, 2016 19:12
Next Greater Numbers
license: gpl-3.0
height: 400
@yonester
yonester / example.js
Last active November 4, 2016 15:05
Can we interpolate "transform" in jsdom?
var jsdom = require('jsdom'),
d3 = require('d3');
var document = jsdom.jsdom();
var rect = d3.select(document.body).append('svg').append('rect');
// This works...
rect
.attr('width', 0)
@yonester
yonester / Readme.md
Last active August 16, 2017 18:02
Canvas vs. SVG Test

A comparison between rendering circles in SVG and canvas. The functions are purposely written separately but similarly to show some key differences. Notably, SVG's structure allows us to take advantage of D3's wonderful data binding capabilities, which makes diffing new data against present data expressive and easy. Canvas will perform better when animating many nodes (not shown here) and makes styling more succinct, but try zooming in a couple of steps (Cmd-plus in OSX, Ctrl-plus in Windows) to see the difference between rendering pixels and vectors.

@yonester
yonester / .block
Created August 23, 2017 03:17 — forked from mbostock/.block
Zoom Transitions
license: gpl-3.0