Created
February 28, 2013 19:58
Revisions
-
warrendunlop created this gist
Feb 28, 2013 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,37 @@ <div id="map_container" style="width:300px; height:117px;"></div> <script> (function(window) { var width = $('#map_container').width(); var height = $('#map_container').height(); var data, xy = d3 .geo .equirectangular() // .scale($('#map_container').width()) // .translate([$('#map_container').width() / 2, $('#map_container').height() / 2]), path = d3 .geo .path() .projection(xy), svg = d3 .select('#map_container') .append('svg:svg'), countries = svg .append('svg:g') .attr('id', 'countries') .attr('transform', "translate(" + (0-(width/2)) + ", " + (0-(height/2)) + ") scale(" + (width/503) + "," + (width/503) + ")"); /* World Map */ countries.selectAll('path') .data(window.countries_data.features) .enter() .append('svg:path') .attr('d', path) .attr('fill', '#ddd') .attr('stroke', '#fff') .attr('stroke-width', .5); }(this)); </script>