chart = {
style;
const svg = d3.create("svg").attr("width", width).attr("height", height);
const projection = d3.geoAlbers()
.translate([width / 2, height / 2])
.scale(width*1.2);
const radius = d3.scaleSqrt()
.domain([0, 100])
.range([0, 14]);
const path = d3.geoPath()
.projection(projection)
.pointRadius(2.5);
svg.append("path")
.datum(topojson.feature(us, us.objects.land))
.attr("class", "land")
.attr("d", path);
svg.append("path")
.datum(topojson.mesh(us, us.objects.states, (a, b) => a !== b ))
.attr("class", "state-borders")
.attr("d", path);
svg.append("path")
.datum({type: "MultiPoint", coordinates: airports})
.attr("class", "airport-dots")
.attr("d", path);
const airport = svg.selectAll(".airport")
.data(airports)
.join("g")
.attr("class", "airport");
airport.append("title")
.text((d) => `${d.iata}\n${d.arcs.coordinates.length} flights`);
airport.append("path")
.attr("class", "airport-arc")
.attr("d", d => path(d.arcs));
return svg.node();
}