import {
select,
json,
geoOrthographic,
geoPath,
zoom,
drag,
} from 'd3';
const svg = select('svg');
const path = svg.append('path');
const projection = geoOrthographic();
const initialScale = projection
.fitWidth(960, { type: 'Sphere' })
.scale();
const geo = geoPath().projection(projection);
const sensitivity = 58;
const jsonURL =
'https://unpkg.com/world-atlas@2.0.2/countries-110m.json';
const main = async () => {
const world = await json(jsonURL);
const land = topojson.feature(
world,
world.objects.land
);
const render = () => path.attr('d', geo(land));
render();
svg
.call(
drag().on('drag', (event) => {
const rotate = projection.rotate();
const scale = projection.scale();