Skip to content

Instantly share code, notes, and snippets.

@mbostock
mbostock / .block
Last active March 30, 2023 20:59
Dispatching Events
license: gpl-3.0
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active March 27, 2024 06:36
A badass list of frontend development resources I collected over time.
@mbostock
mbostock / .block
Last active September 12, 2018 10:49
TopoJSON Parallax
license: gpl-3.0
@biovisualize
biovisualize / index.html
Last active October 15, 2018 01:29
D3.js Reusable Bar Chart with Angularjs
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
body {
font: 14px sans-serif;
}
.axis path, .axis line {
fill: none;
@mbostock
mbostock / .block
Last active September 3, 2017 11:18
Concurrent Transitions
license: gpl-3.0
@mbostock
mbostock / .block
Last active June 17, 2017 12:10
Stacked-to-Multiples
license: gpl-3.0
@mbostock
mbostock / README.md
Last active June 7, 2023 18:33
Underscore’s Equivalents in D3

Collections

each(array)

Underscore example:

_.each([1, 2, 3], function(num) { alert(num); });
@avibryant
avibryant / loess.js
Created August 17, 2011 15:45
Loess smoothing
//adapted from the LoessInterpolator in org.apache.commons.math
function loess_pairs(pairs, bandwidth)
{
var xval = pairs.map(function(pair){return pair[0]});
var yval = pairs.map(function(pair){return pair[1]});
console.log(xval);
console.log(yval);
var res = loess(xval, yval, bandwidth);
console.log(res);
return xval.map(function(x,i){return [x, res[i]]});