Skip to content

Instantly share code, notes, and snippets.

@1wheel
1wheel / README.md
Created November 6, 2013 04:14 — forked from mbostock/.block

By adding transitions, we can more easily follow the elements as they are entered, updated and exited. Separate transitions are defined for each of the three states.

Note that no transition is applied to the merged enter + update selection; this is because it would supersede the transition already scheduled on entering and updating elements. It's possible to schedule concurrent elements by using transition.transition or by setting transition.id, but it's simpler here to only transition the x-position on update; for entering elements, the x-position is assigned statically.

Want to read more? Try these tutorials:

@1wheel
1wheel / index.html
Last active July 27, 2016 04:16 — forked from umcrcooke/index.html
<!DOCTYPE html>
<meta charset="utf-8">
<head>
</head>
<style>
.q0-11 {fill: rgb(215, 48, 39);}
.q1-11 {fill: rgb(244, 109, 67);}
.q2-11 {fill: rgb(253, 174, 97);}
.q3-11 {fill: rgb(254, 224, 144);}
@1wheel
1wheel / README.md
Last active August 22, 2016 02:18 — forked from mbostock/README.md
underscore-d3

Collections

each(array)

Underscore example:

_.each([1, 2, 3], function(num) { alert(num); });
@1wheel
1wheel / README.md
Last active August 22, 2016 02:25
tick-values

Is there a way to prevent the two subsequent odd-numbered days at the end of each year from generating adjacent ticks? In this case I would prefer a tick at Dec 29, Dec 31, Jan 2, Jan 4, etc.

@1wheel
1wheel / README.md
Last active April 16, 2018 02:27 — forked from mbostock/.block
Screen Recording to GIF
  1. If you haven’t already: brew install ffmpeg gifsicle imagemagick.
  2. Open QuickTime Player.
  3. File > New Screen Recording.
  4. Record.
  5. Save as recording.mov.
    ffmpeg -i recording.mov -r 24 recording-%03d.png &&
    convert recording-001.png palette.gif && 
 convert -dither none -remap palette.gif recording-*.png recording-uncompressed.gif &amp;&amp;
@1wheel
1wheel / MIT-License
Last active July 5, 2023 00:17 — forked from rwaldron/MIT-License
MIT-License
All public gists https://gist.github.com/1wheel
Copyright 2017, Adam Pearce
MIT License, http://www.opensource.org/licenses/mit-license.php