feat(global): use geoEquirectangular

This commit is contained in:
hamster1963 2024-11-25 21:55:22 +08:00
parent 1306dbde80
commit dba1528116

View File

@ -1,7 +1,7 @@
"use client";
import { countryCodeMapping } from "@/lib/geo";
import { geoEqualEarth, geoPath } from "d3-geo";
import { geoEquirectangular, geoPath } from "d3-geo";
import { AnimatePresence, m } from "framer-motion";
import { useTranslations } from "next-intl";
import { useState } from "react";
@ -33,9 +33,10 @@ export function InteractiveMap({
.map((code) => countryCodeMapping[code])
.filter((code) => code !== undefined);
const projection = geoEqualEarth()
.scale(180)
.translate([width / 2, height / 2]);
const projection = geoEquirectangular()
.scale(140)
.translate([width / 2, height / 2])
.rotate([-12, 0, 0]);
const path = geoPath().projection(projection);