Skip to content

Instantly share code, notes, and snippets.

@ilyabo
ilyabo / index.html
Created November 17, 2011 14:29
D3 tooltip using jQuery tipsy
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="jquery.tipsy.js"></script>
<link href="tipsy.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="chart"></div>
@enjalot
enjalot / index.html
Created December 20, 2011 21:53
masking with external svg elements
<html>
<head>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?2.6.0"></script>
</head>
<body>
<svg>
<defs>
<mask id="rekt">
<g id="rrr">
@mourner
mourner / TileLayer.Common.js
Created February 11, 2012 23:11
Leaflet shortcuts for common tile providers
// Lefalet shortcuts for common tile providers - is it worth adding such 1.5kb to Leaflet core?
L.TileLayer.Common = L.TileLayer.extend({
initialize: function (options) {
L.TileLayer.prototype.initialize.call(this, this.url, options);
}
});
(function () {
@mbostock
mbostock / .block
Last active February 9, 2016 01:16 — forked from mbostock/.block
click-to-center
license: gpl-3.0
@mbostock
mbostock / .block
Last active October 19, 2021 16:36 — forked from mbostock/.block
click-to-zoom via transform
license: gpl-3.0
@jasondavies
jasondavies / index.html
Created May 8, 2012 08:16 — forked from mbostock/.block
OMG Particles! (D3)
<!DOCTYPE html>
<meta charset="utf-8">
<title>OMG Particles!</title>
<script src="http://mbostock.github.com/d3/d3.v2.min.js?2.9.1"></script>
<style>
body {
background: #222;
}
@ns-1m
ns-1m / leaflet-button-control.js
Created June 15, 2012 09:07 — forked from ejh/leaflet-button-control.js
Leaflet control button example
// How to use it?
// OnAdd() is called when you use:
// var footButton = new L.Control.Button(footButtonOpts).addTo(map);
// It is passed the map object to which your control is being added.
// The third parameter passed to L.DomEvent.addListener is the context ('this' keyword) which
// you wish to have in the callback (second parameter).
// I still don't know how to use it.
@mbostock
mbostock / .block
Last active March 1, 2019 04:57
Albers Equal-Area Conic
license: gpl-3.0
redirect: https://observablehq.com/@d3/conic-equal-area
@mbostock
mbostock / .block
Last active October 21, 2018 21:14 — forked from mbostock/.block
Gnomonic
license: gpl-3.0
redirect: https://beta.observablehq.com/@mbostock/d3-gnomonic
@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); });