Skip to content

Instantly share code, notes, and snippets.

@milroc
milroc / EventEmitter.min.js
Last active September 15, 2016 08:56
bar + sum: d3.js, react.js, & Flux
/*!
* EventEmitter v4.2.7 - git.io/ee
* Oliver Caldwell
* MIT license
* @preserve
*/
(function(){"use strict";function t(){}function r(t,n){for(var e=t.length;e--;)if(t[e].listener===n)return e;return-1}function n(e){return function(){return this[e].apply(this,arguments)}}var e=t.prototype,i=this,s=i.EventEmitter;e.getListeners=function(n){var r,e,t=this._getEvents();if(n instanceof RegExp){r={};for(e in t)t.hasOwnProperty(e)&&n.test(e)&&(r[e]=t[e])}else r=t[n]||(t[n]=[]);return r},e.flattenListeners=function(t){var e,n=[];for(e=0;e<t.length;e+=1)n.push(t[e].listener);return n},e.getListenersAsObject=function(n){var e,t=this.getListeners(n);return t instanceof Array&&(e={},e[n]=t),e||t},e.addListener=function(i,e){var t,n=this.getListenersAsObject(i),s="object"==typeof e;for(t in n)n.hasOwnProperty(t)&&-1===r(n[t],e)&&n[t].push(s?e:{listener:e,once:!1});return this},e.on=n("addListener"),e.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},e.once=n("addOnceListener"),e.defineE
@milroc
milroc / README.md
Last active September 15, 2016 08:48
bar + sum: reusable d3.js
@milroc
milroc / .block
Last active August 12, 2016 18:28
t-SNE mock
license: gpl-3.0
@milroc
milroc / README.md
Last active June 29, 2016 20:03
A quick React + D3 sparkline

Just a quick example of how I use React + d3 now a days.

@milroc
milroc / README.md
Last active June 5, 2016 22:01
GooeySpinner Trippy (React + d3)

I had wanted to play with the Gooey Effect for some time. I decided to use React for this so I rewrote some of the code from the below forks.

Once the rewrite was complete, I played with some numbers and found this interesting aesthetic effect. The spinner I think is rather compelling. Would probably do a couple more iterations on it before I considered using it in a product though.

The things that are important to take note of in the rewrite is how you use could refs to manage what portion of the UI is handled with d3 and what is managed with React.

--

forked from sxywu's block: Gooey Circle Effect with Colors

@milroc
milroc / README.md
Last active June 5, 2016 22:00
GooeySpinner (React + d3)

I had wanted to play with the Gooey Effect for some time. I decided to use React for this so I rewrote some of the code from the below forks.

Once the rewrite was complete, I played with some numbers and found this interesting aesthetic effect. The spinner I think is rather compelling. Would probably do a couple more iterations on it before I considered using it in a product though.

The things that are important to take note of in the rewrite is how you use could refs to manage what portion of the UI is handled with d3 and what is managed with React.

--

forked from sxywu's block: Gooey Circle Effect with Colors

@milroc
milroc / README.md
Last active June 4, 2016 23:40
fresh block
@milroc
milroc / README.md
Last active May 3, 2016 19:31
bar + sum: d3.js & backbone.js
@milroc
milroc / .block
Last active March 23, 2016 19:32 — forked from mbostock/.block
States & Provinces (warning may cause seizures)
license: gpl-3.0