A demo of TopoJSON on a U.S. counties shapefile from the U.S. census bureau. The original GeoJSON file was 2.2M; the TopoJSON file is 660K, a reduction of 70.5%! (Or gzipped, a 71% reduction from 596K to 176K.)
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
<canvas id="canvas"></canvas> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
<script> | |
var num = 20000; | |
var canvas = document.getElementById("canvas"); | |
var width = canvas.width = 960; | |
var height = canvas.height = 500; | |
var ctx = canvas.getContext("2d"); |
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 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html> | |
<head> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script> | |
</head> | |
<body> | |
<script type="text/javascript"> | |
var data = [{value: 1}]; |
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
<html> | |
<head> | |
<script type="text/javascript" src="http://d3js.org/d3.v2.min.js"></script> | |
<style type="text/css" media="screen"> | |
.svg rect { | |
stroke: white; | |
fill: steelblue; | |
} | |
</style> | |
</head> |
Experiment to create 2 panel with d3js Force-Directed Layout.
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
/* | |
Copyright (c) 2012, Ger Hobbelt ([email protected]) | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are met: | |
* Redistributions of source code must retain the above copyright notice, this | |
list of conditions and the following disclaimer. |
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>Index of all bl.ocks.org pages owned by a github user</title> | |
<script type="text/javascript" src="http://d3js.org/d3.v2.js"></script> | |
<base target="_top"> | |
<style> | |
body { padding: 0.5em; margin: 0; } | |
h1 { padding: 0; margin: 0; } |
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>Pie Chart</title> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?2.3.0"></script> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js?2.3.0"></script> | |
<style type="text/css"> | |
body { | |
font: 10px sans-serif; |