Advertisement
Guest User

Code

a guest
Sep 12th, 2014
300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.88 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3.     <head>
  4.         <meta charset="utf-8">
  5.         <title>D3 Page Template</title>
  6.         <script type="text/javascript" src="d3/d3.min.js"></script>
  7.     </head>
  8.     <body>
  9.         <script type="text/javascript">
  10.  
  11.  
  12.         var w = 1000
  13.         var h = 500
  14.  
  15.         var svg = d3.select("body")
  16.             .append("svg")
  17.             .attr( {
  18.                 "width" : w,
  19.                 "height" : h
  20.             });
  21.    
  22.         var path = d3.geo.path().projection(d3.geo.albers().center([-122.4192, 37.7793]).scale(180000).translate([-159700, -159300]));      
  23.         d3.json("bayArea.json", function(json) {
  24.         svg.selectAll("path")
  25.            .data(json.features)
  26.            .enter()
  27.            .append("path")
  28.            .attr("d", path)
  29.            .style("fill", "steelblue");
  30.  
  31.         });
  32.         </script>
  33.     </body>
  34. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement