This examples demonstrates how to use D3's brush component to implement focus + context zooming. Click and drag in the small chart below to pan or zoom.
See Results at http://bl.ocks.org/1671866
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<!--<meta http-equiv="cache-control" content="no-cache" /> | |
<meta http-equiv="pragma" content="no-cache" /> | |
<meta http-equiv="expires" content="0" />--> | |
<title>Tutorial: introduction to D3</title> | |
<script type="text/javascript" src="array.js"></script> | |
<script type="text/javascript" src="string.js"></script> | |
<script type="text/javascript" src="jquery-1.4.4.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Simple d3.js barchart example to illustrate d3 selections | |
//other good related tutorials | |
//http://www.recursion.org/d3-for-mere-mortals/ | |
//http://mbostock.github.com/d3/tutorial/bar-1.html | |
var w = 850 | |
var h = 400 | |
var bars = function(data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> | |
<title>Force Layouts - Collision</title> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.geom.js"></script> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js"></script> | |
<link type="text/css" rel="stylesheet" href="http://mbostock.github.com/d3/talk/20110921/style.css"/> | |
<style type="text/css"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Force-Directed Layout</title> | |
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.7.4/d3.js"></script> | |
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.7.4/d3.geom.js"></script> | |
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.7.4/d3.jslayout.js"></script> | |
// https://cdnjs.cloudflare.com/ajax/libs/d3/4.7.4/d3.js // | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
date | value | undate | |
---|---|---|---|
4/1/2009 | 1.8 | 1990 | |
5/1/2009 | 1.9 | 1991 | |
6/1/2009 | 2.6 | 1992 | |
7/1/2009 | 2.9 | 1993 | |
8/1/2009 | 3.4 | 1994 | |
9/1/2009 | 3.1 | 1995 | |
10/1/2009 | 3.3 | 1996 | |
11/1/2009 | 3.3 | 1997 | |
12/1/2009 | 3.1 | 1998 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is a test treemap. See it live http://bl.ocks.org/1820583 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<!--<meta http-equiv="cache-control" content="no-cache" /> | |
<meta http-equiv="pragma" content="no-cache" /> | |
<meta http-equiv="expires" content="0" />--> | |
<title>Tutorial: introduction to D3</title> | |
<script type="text/javascript" src="array.js"></script> | |
<script type="text/javascript" src="string.js"></script> | |
<script type="text/javascript" src="jquery-1.4.4.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
date | Tenure | Age | Diag_Cat | State | CL_Number | TotalPTD | Division | |
---|---|---|---|---|---|---|---|---|
01020001 | 67 | 28 | Pregnancy | MN | 102499818 | 2838.65 | 24 | |
01030001 | 17 | 37 | Other | MN | 102512301 | 1273.3 | 73 | |
01030001 | 116 | 41 | Genitourinary | IN | 102515457 | 1232 | 37 | |
01030001 | 122 | 57 | Other | CA | 102519957 | 0 | 50 | |
01030001 | 127 | 35 | Nervous/Sensory | MN | 102521292 | 681.6 | 40 | |
01040001 | 78 | 45 | Digestive | IN | 102514388 | 1979.2 | 60 | |
01040001 | 182 | 43 | Injury/Poisoning | IN | 102518969 | 3922.24 | 4 | |
01040001 | 101 | 34 | Other | IN | 102550325 | 12708 | 75 | |
01050001 | 190 | 38 | Pregnancy | MN | 102424011 | 4432.32 | 14 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
date | wounds | other | disease | |
---|---|---|---|---|
5/1854 | 0 | 95 | 105 | |
6/1854 | 0 | 40 | 95 | |
7/1854 | 0 | 140 | 520 | |
8/1854 | 20 | 150 | 800 | |
9/1854 | 220 | 230 | 740 | |
10/1854 | 305 | 310 | 600 | |
11/1854 | 480 | 290 | 820 | |
12/1854 | 295 | 310 | 1100 | |
1/1855 | 230 | 460 | 1440 |
OlderNewer