Published unlisted
Edited
Aug 18, 2019
Fork of Asia Map
1 fork
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
{
var svg = d3.select(DOM.svg(width, height));

svg.selectAll(".subunit")
.data(ne_10m_admin_0_sovereignty_south_asia)
.enter()
.append("path")
.attr("class", function(d) { return "subunit " + d.id; })
.attr("d", path);
return svg.node();
}
Insert cell
Insert cell
height = 590;
Insert cell
projection = d3.geoPatterson()
.center([c1,c2])
.scale(s)
.translate([0,0])
.precision(.1);
Insert cell
path = d3.geoPath()
.projection(projection);
Insert cell
subunits = topojson.feature(asia, asia.objects.subunits);
Insert cell
asia = fetch("https://gist.githubusercontent.com/dhoboy/ff8448ace9d5d567390a/raw/f98a7b12ec0005f72641696752a96d1ccd73ed22/asia.json").then(response => response.json())
Insert cell
ne_10m_admin_0_sovereignty_south_asia = ne_10m_admin_0_sovereignty.features.filter(f =>
f.properties.SOVEREIGNT === "India" ||
f.properties.SOVEREIGNT === "Bangladesh" ||
f.properties.SOVEREIGNT === "Nepal" ||
f.properties.SOVEREIGNT === "Bhutan" ||
f.properties.SOVEREIGNT === "Sri Lanka" ||
f.properties.SOVEREIGNT === "Maldives"
);
Insert cell
ne_10m_admin_0_sovereignty = d3.json(`https://raw.githubusercontent.com/aaronkyle/geospatial-data/master/ne_10m_admin_0_sovereignty_simple.geojson`)
Insert cell
topojson = require('topojson')
Insert cell
d3 = require('d3', 'd3-geo', 'd3-geo-projection')
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more