{
let width = 500;
let height = 500;
const sensitivity = 75;
let projection = d3
.geoOrthographic()
.scale(250)
.center([0, 0])
.rotate([0, -rotate])
.translate([width / 2, height / 2]);
const initialScale = projection.scale();
let path = d3.geoPath().projection(projection);
let svg = d3.create("svg").attr("width", width).attr("height", height);
let globe = svg
.append("circle")
.attr("fill", "none")
.attr("stroke", "#000")
.attr("stroke-width", "1")
.attr("cx", width / 2)
.attr("cy", height / 2)
.attr("r", initialScale);
let map = svg.append("g");
const s = 360 / step;
const data = d3.geoGraticule().stepMinor([s, s]).stepMajor([s, s]).lines();
map
.append("g")
.attr("class", "countries")
.selectAll("path")
.data(data)
.enter()
.append("path")
.attr("d", path)
.attr("fill", "none")
.style("stroke", "black")
.style("stroke-width", 1);
return svg.node();
}