Skip to content

Instantly share code, notes, and snippets.

@phil-pedruco
phil-pedruco / d3.min3.1.5.js
Last active January 2, 2016 21:29
Map with Voronio Polygons for Tooltip
d3=function(){function n(n){return null!=n&&!isNaN(n)}function t(n){return n.length}function e(n){for(var t=1;n*t%1;)t*=10;return t}function r(n,t){try{for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}catch(r){n.prototype=t}}function u(){}function i(){}function a(n,t,e){return function(){var r=e.apply(t,arguments);return r===t?n:r}}function o(){}function c(n){function t(){for(var t,r=e,u=-1,i=r.length;++u<i;)(t=r[u].on)&&t.apply(this,arguments);return n}var e=[],r=new u;return t.on=function(t,u){var i,a=r.get(t);return arguments.length<2?a&&a.on:(a&&(a.on=null,e=e.slice(0,i=e.indexOf(a)).concat(e.slice(i+1)),r.remove(t)),u&&e.push(r.set(t,{on:u})),n)},t}function l(){ca.event.stopPropagation(),ca.event.preventDefault()}function f(){for(var n,t=ca.event;n=t.sourceEvent;)t=n;return t}function s(n,t){function e(){n.on(t,null)}n.on(t,function(){l(),e()},!0),setTimeout(e,0)}function h(n){for(var t=new o,e=0,r=arguments.length;++e<r;)t[arguments[e]]=c(t);return t.of=function(e,r){return
@phil-pedruco
phil-pedruco / index.html
Last active September 9, 2018 12:23
Plotting points on a map in D3
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Point on a map D3</title>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<script src="http://d3js.org/topojson.v1.min.js"></script>
<style type="text/css">
@phil-pedruco
phil-pedruco / index.html
Last active January 30, 2017 02:04
Click to zoom with table and map in D3
<!DOCTYPE html>
<meta charset="utf-8">
<style>
@import url(mapStyle.css);
</style>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<body>
@phil-pedruco
phil-pedruco / 004.json
Last active December 27, 2015 19:59 — forked from pere/004.json
D3.js and Leaflet with a simple json overlay
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@phil-pedruco
phil-pedruco / fun.csv
Last active December 27, 2015 01:19
Reading csv for nvd3
label value
Fun 50
Stupid -20
Yes 100
No 70
@phil-pedruco
phil-pedruco / README.md
Last active December 26, 2015 17:49 — forked from mbostock/.block
Symbol Map with Text

This this a variation of this bl.ock by Mike Bostock to demostrate the appending text to a map in response to this stack overflow question. The area of each circle in this symbol map is proportional to the population of the associated state.

@phil-pedruco
phil-pedruco / index.html
Last active December 25, 2015 22:39
Disable zoom on scrollwheel but retain the ability to pan #2
<!DOCTYPE html>
<meta charset="utf-8">
<style>
#boroughs {
stroke: grey;
stroke-width: 2px;
fill: steelblue;
}
</style>
@phil-pedruco
phil-pedruco / index.html
Last active December 25, 2015 22:39
Disable zoom on scrollwheel but retain the ability to pan #1
<!DOCTYPE html>
<meta charset="utf-8">
<style>
#boroughs {
stroke: grey;
stroke-width: 2px;
fill: steelblue;
}
</style>
@phil-pedruco
phil-pedruco / index.html
Last active December 25, 2015 04:28
Histogram with Chauvenet's criterion for outliers
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
<script src="http://d3js.org/d3.v3.min.js"></script>
<style type="text/css">
body {
font: 10px sans-serif;
}
{
"name": "flare",
"children": [
{
"name": "analytics",
"children": [
{
"name": "cluster",
"children": [
{"name": "AgglomerativeCluster", "size": 3938},