Created
December 15, 2016 15:06
-
-
Save ngunhaSO/11f36d25fd4f96d6afc90bc77e272345 to your computer and use it in GitHub Desktop.
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
[{"type":"Feature","properties":{"scalerank":3,"featurecla":"Admin-0 country","labelrank":6,"sovereignt":"Singapore","sov_a3":"SGP","adm0_dif":0,"level":2,"type":"Sovereign country","admin":"Singapore","adm0_a3":"SGP","geou_dif":0,"geounit":"Singapore","gu_a3":"SGP","su_dif":0,"subunit":"Singapore","su_a3":"SGP","brk_diff":0,"name":"Singapore","name_long":"Singapore","brk_a3":"SGP","brk_name":"Singapore","brk_group":null,"abbrev":"Sing.","postal":"SG","formal_en":"Republic of Singapore","formal_fr":null,"note_adm0":null,"note_brk":null,"name_sort":"Singapore","name_alt":null,"mapcolor7":5,"mapcolor8":3,"mapcolor9":7,"mapcolor13":3,"pop_est":4657542,"gdp_md_est":237300,"pop_year":-99,"lastcensus":2010,"gdp_year":-99,"economy":"6. Developing region","income_grp":"2. High income: nonOECD","wikipedia":-99,"fips_10":null,"iso_a2":"SG","iso_a3":"SGP","iso_n3":"702","un_a3":"702","wb_a2":"SG","wb_a3":"SGP","woe_id":-99,"adm0_a3_is":"SGP","adm0_a3_us":"SGP","adm0_a3_un":-99,"adm0_a3_wb":-99,"continent":"Asia","region_un":"Asia","subregion":"South-Eastern Asia","region_wb":"East Asia & Pacific","name_len":9,"long_len":9,"abbrev_len":5,"tiny":3,"homepart":1},"geometry":{"type":"Polygon","coordinates":[[[103.9697265625,1.331445312499994],[103.81992187500003,1.265380859375],[103.65019531249999,1.325537109374991],[103.70527343750001,1.4234375],[103.81796875000003,1.447070312499989],[103.90898437499999,1.415966796874997],[103.96083984375002,1.392236328124994],[103.99638671874999,1.365234375],[103.9697265625,1.331445312499994]]]}}] | |
<script> | |
var w = 1000; | |
var h = 500; | |
var path = d3.geo.path(); | |
var svg = d3.select('body').append('svg') | |
.attr('width', w) | |
.attr('height', h); | |
d3.json('sg.json', function (json) { | |
console.log('data ' + JSON.stringify(json)); | |
svg.selectAll('path') | |
.data(json) | |
.enter() | |
.append('path') | |
.attr('d', path) | |
.attr('fill', '#666666'); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment