World Map with Different Projections in MUI X Charts (JavaScript)

The same plot in 14 other libraries — JavaScript: Chart.js, D3.js, Apache ECharts, Highcharts; Python: Altair, Bokeh, lets-plot, Matplotlib, Plotly, plotnine, Pygal, Seaborn; R: ggplot2; Julia: Makie.jl. Compare all 15 side by side: World Map with Different Projections in Python, R, Julia and JavaScript.

A world map demonstrating different cartographic projections and their distortion characteristics. This visualization showcases how the same geographic data appears under various map projections (Mercator, Robinson, Mollweide, Orthographic, etc.), revealing how each projection preserves or distorts area, shape, distance, or direction. The plot includes graticule (latitude/longitude grid lines) and optionally Tissot indicatrices to illustrate projection distortion patterns.

World Map with Different Projections rendered with MUI X Charts

Renders

JavaScript source (MUI X Charts)

// anyplot.ai
// map-projections: World Map with Different Projections
// Library: muix 9.16.0 | JavaScript 22.23.3
// Quality: 88/100 | Updated: 2026-10-24

import { ChartsContainer } from "@mui/x-charts/ChartsContainer";
import { useXScale, useYScale } from "@mui/x-charts/hooks";

const t = window.ANYPLOT_TOKENS;

// Constants
const TITLE = "map-projections · javascript · muix · anyplot.ai";
const SUBTITLE = "The same coastlines, borders, graticule and Tissot circles — only the projection changes";
const TITLE_BLOCK_HEIGHT = 72;
const LEGEND_HEIGHT = 32;
const BLOCK_GAP = 22;
const PANEL_HEADER_HEIGHT = 60;
const PANEL_NOTE_HEIGHT = 34;
const PANEL_GAP = 20;
const OUTER_PAD_X = 20;
const MAP_MARGIN = 3;
const DOMAIN_PAD_SHARE = 0.015;
const WIDTH_WEIGHT_EXP = 0.35;
const DEG2RAD = Math.PI / 180;
const SQRT2 = Math.SQRT2;
const MAX_STEP_DEG = 2;
const LIMB_STEP_RAD = 3 * DEG2RAD;
const MERCATOR_LAT_CLIP = 85;
const ORTHO_LON0 = 0;
const ORTHO_LAT0 = 20;
const TISSOT_RADIUS_KM = 550;
const EARTH_RADIUS_KM = 6371;
const TISSOT_RADIUS_RAD = TISSOT_RADIUS_KM / EARTH_RADIUS_KM;
const TISSOT_STEPS = 48;
const GRATICULE_STEP_DEG = 30;

// Columns: set these to your data's column names
const FEATURE_KIND = "Feature kind"; // role: kind (land, lake or border)
const FEATURE_NAME = "Country / landmass"; // role: country
const VERTICES = "Boundary coordinates (lon, lat)"; // role: coordinates

// Data: replace this block with your own records
const PROJECTIONS = [
  {
    id: "Mercator",
    title: "Mercator (Cylindrical)",
    subtitle: "Conformal — angles preserved",
    note: "Area inflates as sec²(φ) toward the poles",
  },
  {
    id: "Mollweide",
    title: "Mollweide (Pseudocylindrical)",
    subtitle: "Equal-area — true relative size",
    note: "Shapes shear toward the outer limb",
  },
  {
    id: "Orthographic",
    title: "Orthographic (Azimuthal)",
    subtitle: `Globe view centered at ${ORTHO_LAT0}°N, ${ORTHO_LON0}°E`,
    note: "Foreshortened to zero at the horizon",
  },
];

type LonLat = [number, number];
type Feature = { [FEATURE_KIND]: "land" | "lake" | "border"; [FEATURE_NAME]: string; [VERTICES]: LonLat[] };

const land = (name: string, pts: LonLat[]): Feature => ({ [FEATURE_KIND]: "land", [FEATURE_NAME]: name, [VERTICES]: pts });
const lake = (name: string, pts: LonLat[]): Feature => ({ [FEATURE_KIND]: "lake", [FEATURE_NAME]: name, [VERTICES]: pts });
const border = (name: string, pts: LonLat[]): Feature => ({ [FEATURE_KIND]: "border", [FEATURE_NAME]: name, [VERTICES]: pts });

const data: Feature[] = [
  // Coastlines (simplified; rings close automatically)
  land("North America", [
    [-166, 68.5], [-163, 70], [-156, 71.3], [-148, 70.3], [-141, 69.6], [-133, 69.5], [-128, 70], [-115, 68.5],
    [-108, 68], [-98, 67.8], [-94, 69], [-90, 68.5], [-85, 69.5], [-82, 67], [-86, 64], [-93, 61.5], [-94, 58.8],
    [-90, 57], [-82, 55], [-80, 51.5], [-79, 55], [-77, 60], [-78, 62.5], [-72, 62], [-65, 60], [-62, 57], [-58, 54],
    [-56, 52], [-60, 50], [-65, 49], [-64, 47], [-61, 45.5], [-66, 44], [-70, 43.5], [-70, 41.8], [-74, 40.5],
    [-76, 38], [-76, 35], [-78.5, 33.8], [-81, 31.5], [-80, 27], [-80.5, 25.2], [-82, 26.5], [-82.8, 28], [-84, 30],
    [-86, 30.4], [-89, 30.2], [-90, 29], [-94, 29.7], [-97.2, 27.5], [-97.5, 24], [-97.8, 22], [-96, 19],
    [-94.5, 18.2], [-91, 18.7], [-90.5, 21], [-87, 21.5], [-87.5, 18.5], [-88.5, 16], [-86, 15.8], [-83.3, 15],
    [-83.5, 11], [-81.5, 9], [-79.5, 9.5], [-77.4, 8.6], [-77.9, 7.2], [-80, 7.3], [-82.5, 8.2], [-85.7, 10],
    [-86, 11.5], [-87.5, 13], [-91.5, 14], [-94.5, 16], [-96.5, 15.7], [-99.7, 16.8], [-103.5, 18.3], [-105.5, 20.5],
    [-105.3, 22.5], [-108, 25.5], [-112.7, 31.5], [-114.8, 31.8], [-112.5, 28.5], [-110, 24], [-109.5, 23],
    [-112, 24.8], [-114.2, 28], [-115.8, 30.4], [-117.1, 32.5], [-118.5, 34], [-120.6, 34.6], [-122.5, 37.7],
    [-124, 40.4], [-124.2, 43], [-124, 46.2], [-124.7, 48.4], [-123, 49], [-127.5, 50.5], [-130, 54.5],
    [-133, 57.5], [-137, 58.8], [-140, 59.8], [-146, 60.8], [-150, 59.5], [-152, 60.5], [-154, 58.5], [-158, 56.7],
    [-162, 55], [-164.5, 54.5], [-158, 58.7], [-162, 59.8], [-165, 60.5], [-164.8, 63], [-161, 64.5], [-166, 65.3],
    [-168, 65.6], [-164, 67],
  ]),
  land("Baffin Island", [
    [-62, 66.5], [-66, 68.5], [-70, 70.5], [-78, 72.8], [-88, 73.5], [-84, 70], [-80, 69], [-73, 68], [-77, 65.5],
    [-73, 64], [-66, 62], [-64, 64],
  ]),
  land("Victoria Island", [[-118, 72.8], [-110, 73], [-102, 72.5], [-101, 69.5], [-108, 68.8], [-117, 69.5]]),
  land("Ellesmere Island", [[-90, 76.5], [-78, 76.5], [-74, 79], [-62, 82], [-70, 83], [-88, 81.5], [-92, 79.5]]),
  land("Greenland", [
    [-45, 60], [-43, 60], [-38, 65.5], [-32, 68], [-22, 70.5], [-21.5, 74], [-18, 77], [-19, 80], [-12, 81.5],
    [-20, 82.5], [-32, 83.5], [-45, 82.7], [-60, 82], [-65, 80.5], [-73, 78.5], [-66, 76], [-58, 75.8], [-55, 72],
    [-53, 69], [-51.5, 64], [-48, 61],
  ]),
  land("Iceland", [[-24, 65.5], [-22, 66.4], [-16, 66.5], [-13.6, 65.2], [-15, 64.3], [-18.5, 63.4], [-22.5, 63.8]]),
  land("Cuba", [[-85, 21.9], [-82, 23.2], [-77.2, 22.2], [-74.2, 20.3], [-77.7, 19.9], [-80.5, 21.7], [-83.5, 22]]),
  land("Hispaniola", [[-74.4, 18.5], [-72.7, 19.9], [-69.6, 19.7], [-68.4, 18.6], [-71.5, 17.6]]),
  land("South America", [
    [-77.4, 8.6], [-76, 9.5], [-75.5, 10.8], [-73, 11.5], [-71.5, 12.4], [-71.5, 10.8], [-68, 10.5], [-64, 10.6],
    [-61.8, 10.7], [-60.5, 8.5], [-57, 6], [-54, 5.8], [-51.5, 4.5], [-50, 1.8], [-48.5, -1.2], [-44.5, -2.5],
    [-40, -3], [-35.2, -5.5], [-35, -9], [-38.5, -13], [-39, -17.5], [-40.8, -22], [-44, -23], [-48.5, -26],
    [-48.8, -28.5], [-51, -31], [-53.5, -34], [-56, -34.9], [-57.5, -36.2], [-57.5, -38.2], [-62.2, -38.8],
    [-62.3, -40.6], [-65, -41], [-64.5, -42.5], [-67.5, -46], [-65.8, -47.8], [-69, -51], [-68.5, -52.4],
    [-68.6, -54.8], [-67.5, -54.8], [-71, -55], [-74.5, -52.5], [-75.5, -48], [-74, -44], [-73.5, -40],
    [-73.5, -37], [-71.6, -33], [-71.4, -28], [-70.4, -23.5], [-70.3, -18.4], [-71.4, -17.5], [-76.2, -14],
    [-78.5, -10], [-79.9, -7], [-81.2, -5.5], [-80.4, -3.4], [-80.9, -1], [-80, 0.8], [-79, 1.7], [-77.8, 4],
    [-77.4, 7],
  ]),
  land("Eurasia", [
    [-5.6, 36], [-6.4, 36.8], [-7.4, 37.2], [-8.9, 37], [-8.8, 38.7], [-9.5, 39.4], [-8.7, 41.2], [-8.9, 42.6],
    [-9.3, 43], [-7.7, 43.7], [-4.5, 43.4], [-1.8, 43.4], [-1.2, 44.6], [-1.2, 46.2], [-2.3, 47.2], [-4.6, 48],
    [-3, 48.8], [-1.6, 48.6], [-1.4, 49.7], [0.2, 49.5], [1.6, 50.2], [2.5, 51.1], [3.6, 51.5], [4.6, 52.9],
    [5.9, 53.4], [8, 53.6], [8.6, 54.9], [8.1, 55.5], [8.2, 56.8], [10.6, 57.7], [10.3, 56.5], [10.9, 56.3],
    [9.9, 55], [10.9, 54], [12.5, 54.4], [14.2, 53.9], [16.5, 54.5], [18.6, 54.7], [19.6, 54.4], [21.1, 55.2],
    [21, 56.8], [21.6, 57.4], [23.4, 59.1], [24, 59.3], [28, 59.5], [29.9, 59.9], [28, 60.5], [25, 60.2],
    [22.9, 59.8], [21.4, 60.8], [21.6, 63.2], [23.5, 64.6], [25.3, 65.1], [24.6, 65.8], [22.3, 65.8], [21.2, 64.6],
    [19, 63.4], [17.4, 62.4], [17.2, 61], [18.6, 60.2], [18.9, 59.4], [17, 57.5], [16.4, 56.5], [14.7, 56],
    [13, 55.4], [12.8, 56.6], [11.8, 58.1], [10.9, 59], [10.6, 59.9], [9.8, 59], [8.1, 58.1], [6.6, 58.1],
    [5.6, 58.9], [5, 60.5], [5.1, 61.9], [6.5, 62.7], [9, 63.7], [10.8, 64.8], [12.6, 66.1], [14.2, 67.5],
    [16, 68.5], [18.8, 69.8], [22.5, 70.6], [25.8, 71.1], [28.5, 70.9], [31, 70], [33, 69.3], [36.5, 69],
    [41, 67], [38, 66], [35, 64.5], [37.5, 63.8], [40.5, 64.6], [44, 66.3], [44.2, 68.3], [46.5, 68], [53, 68.6],
    [59, 68.6], [61, 69.8], [66, 69.3], [68.5, 71], [70.5, 73.2], [73, 71.5], [73.5, 68.5], [76.5, 72],
    [80.5, 73.6], [86.5, 74.5], [87.5, 75.5], [95, 76.1], [104, 77.7], [108, 76.7], [113, 75.9], [113.5, 73.5],
    [119, 73], [127, 73.5], [129, 72], [132.5, 71.6], [139, 72.3], [146, 72.3], [152, 70.9], [160, 70],
    [161.5, 69.4], [167, 69.7], [170.5, 70.1], [176, 69.6], [179.9, 68.9], [179.9, 65], [177, 64.7],
    [174.5, 61.8], [170.5, 60], [166, 60.3], [163.5, 59.8], [162, 56.2], [160, 54], [158.3, 53], [156.7, 51],
    [156, 52.8], [155.5, 55.5], [156.8, 57.8], [161, 60.5], [159.5, 61.7], [154, 59.3], [151, 59.2], [143, 59.4],
    [140, 58], [137, 54], [140.5, 53], [141.3, 51.5], [140.5, 50], [140, 48], [138.5, 46.5], [135.5, 43.8],
    [132, 43.1], [130.7, 42.3], [129.7, 41], [128, 39.5], [129.4, 37.5], [129.4, 35.4], [127.5, 34.6],
    [126.3, 34.7], [126.6, 37.2], [125.2, 37.7], [125.2, 39.5], [124.4, 40], [122.2, 40.5], [121, 40.8],
    [119, 39.2], [118, 39.2], [117.7, 38.5], [118.9, 37.3], [120.5, 37.8], [122.5, 37.4], [120.5, 36],
    [119.4, 35], [120.3, 34.3], [121.8, 31.8], [121.5, 30.8], [122, 29.9], [120.5, 27.2], [119.5, 25.6],
    [117.5, 23.6], [114.2, 22.3], [111, 21.5], [110.3, 20.3], [109.7, 21.6], [108, 21.6], [106.7, 20.5],
    [105.8, 19], [106.5, 17.6], [108.8, 15.2], [109.3, 12.5], [109, 11.4], [106.8, 10.4], [104.8, 8.6],
    [105, 10], [104.4, 10.4], [103, 11.6], [101, 12.7], [100, 13.5], [99.2, 10.5], [100.4, 8], [101.3, 6.9],
    [103.4, 4], [104.2, 1.4], [103.5, 1.3], [101.3, 2.8], [100.3, 5.5], [98.3, 8.2], [98.5, 10.5], [97.8, 14.9],
    [97.6, 16.5], [95.3, 15.8], [94.3, 16.4], [94.4, 19], [92.3, 20.7], [91.8, 22.4], [90.3, 21.9], [88.5, 21.7],
    [86.9, 20.8], [86, 19.9], [84.2, 18.3], [82.3, 16.6], [80.3, 15.5], [80.1, 13.3], [79.8, 11], [79.3, 10.3],
    [78.2, 8.9], [77.5, 8.1], [76.4, 9.5], [75.6, 11.6], [74.4, 14.6], [73.4, 16.5], [72.8, 19.2], [72.6, 21.3],
    [70.4, 20.9], [69, 22.3], [68.4, 23.6], [67.3, 24.7], [66.7, 25.4], [64, 25.3], [61.5, 25.1], [58.8, 25.5],
    [57.3, 26.9], [56.4, 27.1], [54.7, 26.5], [51.5, 27.9], [50.2, 29.9], [48.5, 30], [48, 29.2], [48.5, 28],
    [49.6, 26.8], [50.2, 26], [50.8, 24.8], [51.6, 24.2], [52, 24], [54, 24.2], [55.8, 25.3], [56.3, 26.3],
    [56.4, 24.9], [57.8, 23.7], [59.8, 22.4], [58.5, 20.5], [57.8, 18.9], [55.4, 17.7], [52.2, 15.6], [48.8, 14],
    [45, 12.8], [43.5, 12.7], [42.7, 15.6], [41.2, 19], [39.2, 21.5], [38.5, 23.6], [36.5, 26], [35, 28.1],
    [34.9, 29.5], [34.3, 28], [32.6, 29.9], [32.3, 31.2], [34.2, 31.3], [35, 32.8], [35.9, 34.6], [36.1, 36.8],
    [34.6, 36.8], [32.5, 36.1], [30.5, 36.4], [28, 36.7], [27.3, 37.5], [26.3, 38.3], [26.6, 39.5], [26.2, 40.1],
    [29, 41.1], [31.5, 41.2], [34, 42], [35.2, 42], [37.5, 41], [40, 41], [41.6, 41.5], [41.5, 42.6], [39.5, 44],
    [37.4, 44.8], [38.3, 47.2], [36.6, 45.3], [35, 45], [33.5, 44.5], [32.5, 45.4], [33.6, 46.1], [31.7, 46.6],
    [30.7, 46.4], [29.6, 45.4], [28.7, 44.4], [28, 43.3], [27.9, 42], [28.9, 41.3], [28, 41], [26.2, 40.6],
    [24, 40.9], [23.5, 40.2], [22.6, 40.5], [22.8, 39.3], [23.3, 38.2], [24, 38], [22.9, 37], [22.6, 36.4],
    [21.7, 36.8], [21.1, 37.8], [21.4, 38.5], [20.7, 39.1], [20, 39.7], [19.4, 40.3], [19.5, 41.8], [18.5, 42.4],
    [17, 43.2], [15.9, 43.6], [15.2, 44.3], [14.3, 45.3], [13.6, 45.7], [12.4, 45.4], [12.3, 44.6], [13.6, 43.5],
    [14.6, 42.1], [16, 41.4], [18.5, 40.1], [17, 39.4], [16.6, 38.4], [16.1, 37.9], [15.7, 38.2], [15.6, 40.1],
    [14.4, 40.6], [12.6, 41.4], [11.2, 42.4], [10.5, 43], [10.2, 43.9], [8.8, 44.4], [7.6, 43.8], [6.2, 43.1],
    [4.6, 43.4], [3.1, 43.1], [3.2, 42], [2.1, 41.2], [0.8, 41], [0, 39.9], [-0.3, 39.4], [0.2, 38.7],
    [-0.7, 37.6], [-2.1, 36.7], [-4.4, 36.7],
  ]),
  lake("Caspian Sea", [
    [46.8, 44.6], [48.5, 46.2], [51, 47], [53.2, 46.6], [52.8, 45.2], [51, 44.4], [52.5, 42], [53.9, 40.6],
    [53, 39.2], [53.9, 37.3], [51, 36.7], [49, 37.6], [48.9, 38.6], [49.5, 40.2], [48, 42], [47.5, 43],
  ]),
  land("Great Britain", [
    [-5.7, 50.1], [-3, 50.7], [1.4, 51.2], [1.7, 52.7], [0.3, 53.4], [-0.1, 54.5], [-1.6, 55.6], [-2.1, 57.1],
    [-1.8, 57.6], [-4, 57.6], [-3.1, 58.6], [-5, 58.6], [-6.2, 56.8], [-5.6, 55.3], [-4.9, 54.8], [-3.2, 54.6],
    [-3, 53.4], [-4.6, 53.3], [-4, 52.3], [-5.1, 51.8], [-3.2, 51.4],
  ]),
  land("Ireland", [[-6, 52.2], [-6.2, 53.9], [-5.8, 54.6], [-7.3, 55.3], [-8.5, 54.4], [-10, 54.2], [-9.6, 53.3], [-10.3, 52], [-9, 51.6], [-7.5, 52]]),
  land("Novaya Zemlya", [[52, 71.5], [56, 73], [60, 75.5], [68, 76.8], [64, 75.2], [57, 72.5], [55, 70.6]]),
  land("Africa", [
    [32.3, 31.2], [31, 31.6], [29.8, 31.1], [27.3, 31.4], [25.1, 31.6], [23, 32.6], [21, 32.8], [20, 30.8],
    [18.5, 30.4], [15.5, 31.6], [13, 32.9], [11.1, 33.3], [10.1, 34.3], [11, 35.6], [10.2, 37.2], [8.6, 36.9],
    [5, 36.8], [1, 36.5], [-1.3, 35.3], [-3, 35.3], [-5.9, 35.8], [-6.5, 34.2], [-9, 32.6], [-9.8, 30.6],
    [-11.5, 28.2], [-13.2, 27.6], [-14.5, 26.2], [-16, 23.8], [-17.1, 21], [-16, 19.5], [-16.5, 16.6],
    [-17.5, 14.7], [-16.7, 13.1], [-16.7, 12.3], [-15.1, 11.2], [-13.7, 9.8], [-13.2, 8.9], [-12.2, 7.4],
    [-10.5, 6.2], [-7.6, 4.4], [-5, 5.1], [-2, 4.8], [1, 6.1], [2.7, 6.4], [4.4, 6.3], [5.9, 4.3], [7.1, 4.4],
    [8.5, 4.6], [9.6, 3.6], [9.4, 2.2], [9.6, 1], [9.3, -0.8], [10.1, -2.8], [11.8, -4.4], [12.3, -6.1],
    [13.4, -8.6], [13.6, -11.3], [12, -15], [11.8, -17.3], [13.4, -21], [14.5, -22.9], [15.2, -26.6],
    [16.5, -28.6], [17.9, -31.5], [18.4, -34], [20, -34.8], [22.5, -34], [25.6, -34], [27.8, -33.2], [30, -31.3],
    [32.6, -28.6], [32.9, -26], [35.4, -24.1], [35.5, -21.3], [34.7, -19.8], [36.9, -17.6], [40.6, -14],
    [40.5, -10.5], [39, -6.5], [39.8, -3.8], [41, -2], [43.5, 0.5], [46, 2], [48, 4.5], [49.8, 7.5], [51.2, 10.5],
    [51.3, 11.8], [49, 11.3], [45.5, 10.6], [43.4, 11.5], [42.8, 12.5], [41.2, 14], [39.3, 15.9], [38.5, 18],
    [37.3, 22], [35.8, 23.9], [35.1, 24.8], [33.9, 27], [32.6, 29.9],
  ]),
  land("Madagascar", [
    [49.3, -12], [50.3, -15.4], [49.9, -17], [48.4, -21.5], [47.1, -24.9], [45.2, -25.6], [43.7, -23.5],
    [43.3, -21.5], [44.4, -19], [44, -17], [46.3, -15.8], [48, -13.6],
  ]),
  land("Sri Lanka", [[79.9, 6], [79.7, 8.2], [80.1, 9.8], [81.2, 8.5], [81.9, 7.2], [80.6, 5.9]]),
  land("Taiwan", [[120.1, 23], [121, 25], [121.9, 25], [121.5, 23], [120.8, 21.9]]),
  land("Honshu, Kyushu & Shikoku", [
    [130.2, 31.3], [131.4, 31.4], [132, 33], [133, 33.3], [134.7, 33.8], [135.8, 33.5], [136.9, 34.3],
    [138.8, 34.6], [139.8, 35], [140.9, 36.3], [141, 38.3], [142, 39.6], [141.5, 40.5], [141.4, 41.4], [140, 40.8],
    [139.9, 39.5], [139.5, 38.2], [138.5, 37.4], [137, 36.8], [136, 35.7], [133, 35.5], [131.5, 34.6],
    [130.9, 34], [129.7, 33.2],
  ]),
  land("Hokkaido", [[140, 41.5], [141.3, 42.4], [143.3, 42], [145.5, 43.3], [144.5, 44], [142, 45.5], [141.6, 44.3], [140.3, 43.2]]),
  land("Sakhalin", [[142, 46], [143.5, 46.8], [142.7, 49.5], [143.2, 51.5], [142.5, 54.2], [141.7, 52], [142.2, 49]]),
  land("Luzon", [[120.6, 18.5], [122.2, 18.5], [121.5, 15.5], [124.2, 12.6], [123.2, 13.5], [120.6, 14.2], [119.8, 16.3]]),
  land("Mindanao", [[122, 7], [123.6, 8.6], [125.4, 9.8], [126.6, 7.3], [125.5, 5.6], [124, 6.4]]),
  land("Borneo", [
    [109, 1.5], [109.6, 2], [111.3, 2.7], [113, 3.2], [115.4, 5], [116.8, 7], [119.3, 5.4], [118, 4.3],
    [117.6, 0.8], [116.5, -1.5], [116.4, -3.5], [114.5, -4], [111.7, -3], [110.2, -2.9], [109.5, -0.5],
  ]),
  land("Sumatra", [[95.3, 5.6], [97.5, 5.2], [100.4, 2.3], [103.7, -0.8], [106, -3.2], [105.8, -5.8], [104.5, -5.9], [102.3, -4], [100.4, -0.8], [98.6, 1.8]]),
  land("Java", [[105.2, -6.8], [106.5, -6], [108.5, -6.4], [110.4, -6.9], [112.6, -6.9], [114.4, -7.8], [112, -8.4], [108.8, -7.8], [106.4, -7.4]]),
  land("Sulawesi", [[119.4, -5.5], [118.8, -2.8], [119.9, 0.6], [124.9, 1.5], [121, 0.3], [123.3, -0.9], [121.3, -1.9], [122.8, -4.6], [121, -4.8], [120.4, -5.6]]),
  land("New Guinea", [
    [131, -1.2], [134, -0.9], [135, -3.3], [138, -1.6], [141, -2.6], [144.5, -3.8], [146, -5.5], [147.6, -6.1],
    [147.2, -7.4], [148.4, -8.6], [150, -10.4], [147, -10.1], [144, -7.6], [142.6, -9.3], [141, -9.1], [139, -8.1],
    [138, -8.4], [137.6, -5.2], [134.4, -3.9], [132, -2.8],
  ]),
  land("Australia", [
    [113.4, -22], [114.2, -21.8], [116.7, -20.6], [119, -20], [121, -19.5], [122.3, -17.2], [124, -16.3],
    [125.8, -14.2], [127.8, -14.3], [129.6, -15], [130.4, -12.7], [132.6, -12.1], [136.7, -12.2], [135.9, -15.1],
    [139.2, -17.4], [140.8, -17.4], [141.6, -15], [141.5, -12.6], [142.5, -10.7], [143.5, -12.8], [145.3, -14.9],
    [146.3, -19], [149.3, -21.7], [150.9, -23.5], [153.1, -25.6], [153.6, -28.8], [153, -31], [151.3, -33.9],
    [150.1, -36.3], [149.9, -37.6], [147, -38.6], [144.6, -38.2], [143.5, -38.8], [140.6, -38], [139.6, -36.9],
    [138.1, -35.4], [138.5, -34.4], [137.8, -33], [137.4, -34.5], [136, -34.9], [134.2, -32.8], [131.1, -31.5],
    [128, -32.2], [124, -33], [121.2, -33.9], [118, -35.1], [115, -34.3], [115.6, -31.6], [114.9, -29.1],
    [113.4, -26.3], [114, -24.9],
  ]),
  land("Tasmania", [[144.6, -40.7], [148.3, -40.9], [148, -43.2], [146.6, -43.6], [145.2, -42.2]]),
  land("New Zealand North Island", [
    [172.7, -34.4], [174.6, -35.8], [175.9, -37.5], [178.5, -37.7], [177.9, -39.2], [176.9, -39.6], [175.3, -41.6],
    [174.6, -41.2], [175, -39.9], [173.8, -39.3], [174.6, -38], [174.3, -36.6],
  ]),
  land("New Zealand South Island", [
    [172.6, -40.5], [174.2, -41.6], [173.3, -43], [172.7, -43.8], [171.2, -44.4], [170.6, -45.9], [169, -46.6],
    [166.5, -46], [168.4, -44], [170.6, -42.9], [172.1, -41],
  ]),
  land("Antarctica", [
    [-180, -78], [-160, -78.5], [-150, -77], [-140, -75.2], [-120, -73.8], [-100, -72.5], [-80, -73.2], [-75, -71],
    [-68, -67.5], [-63, -64.5], [-57, -63.3], [-60, -66], [-62, -70], [-61, -74.5], [-50, -77.8], [-35, -78],
    [-28, -76], [-15, -72.5], [0, -70.5], [15, -70], [30, -69.5], [40, -68.5], [55, -66.5], [70, -68.2],
    [75, -69.5], [88, -66.5], [100, -66], [115, -66.8], [130, -66.2], [145, -67], [160, -69.5], [170, -71.5],
    [167, -77.5], [180, -78], [180, -89.9], [-180, -89.9],
  ]),

  // Country borders (simplified)
  border("Canada–United States", [
    [-123.3, 49], [-95.2, 49], [-89.6, 48], [-84.5, 46.5], [-82.4, 45], [-82.5, 43], [-83.1, 42], [-79, 42.8],
    [-79, 43.3], [-76.3, 44.2], [-74.7, 45], [-71.5, 45], [-70, 46.7], [-69.2, 47.4], [-68, 47.3], [-67.8, 45.7],
    [-67, 44.9],
  ]),
  border("Alaska–Canada", [[-141, 69.6], [-141, 60.3], [-137.5, 59], [-133.5, 57.5], [-130, 55.9], [-130, 54.7]]),
  border("United States–Mexico", [
    [-117.1, 32.5], [-114.7, 32.7], [-111, 31.3], [-108.2, 31.3], [-106.5, 31.8], [-104.5, 29.6], [-103, 29],
    [-101.4, 29.8], [-99.5, 27.5], [-97.2, 25.9],
  ]),
  border("Mexico–Guatemala–Belize", [[-92.2, 14.5], [-92.2, 15.3], [-91.4, 16], [-90.4, 16], [-90.4, 17.8], [-89.1, 17.8], [-88.3, 18.5]]),
  border("Guatemala–Honduras–El Salvador", [[-89.1, 17.8], [-89.2, 15.9], [-89.2, 14.4], [-90.1, 13.7]]),
  border("El Salvador–Honduras", [[-89.2, 14.4], [-87.8, 13.4]]),
  border("Honduras–Nicaragua", [[-83.2, 15], [-85, 14.2], [-87, 13]]),
  border("Nicaragua–Costa Rica", [[-83.7, 11], [-85.7, 11.1]]),
  border("Costa Rica–Panama", [[-82.6, 9.6], [-82.9, 8.1]]),
  border("Panama–Colombia", [[-77.9, 7.2], [-77.2, 8.7]]),
  border("Colombia–Venezuela", [[-72.4, 11.1], [-73, 9.3], [-72.4, 8], [-70.1, 6.9], [-67.6, 6.2], [-67.8, 4.5], [-67.3, 2]]),
  border("Colombia–Brazil", [[-67.3, 2], [-69.9, 1.7], [-69.4, -1.1], [-70, -4.2]]),
  border("Colombia–Peru–Ecuador", [[-70, -4.2], [-72.9, -2.4], [-75.2, -0.1], [-77.5, 0.8], [-78.8, 1.4]]),
  border("Ecuador–Peru", [[-75.2, -0.1], [-75.6, -1.6], [-78.4, -3.4], [-80.3, -3.4]]),
  border("Venezuela–Guyana–Brazil", [[-60, 8.5], [-61.4, 5.9], [-60.7, 5.2], [-64, 4], [-64.8, 2], [-67.3, 2]]),
  border("Guianas–Brazil", [[-60.7, 5.2], [-59.8, 1.3], [-56.5, 1.9], [-54, 2.2], [-51.6, 4.2]]),
  border("Guyana–Suriname", [[-57.1, 5.9], [-56.5, 1.9]]),
  border("Suriname–French Guiana", [[-54, 5.7], [-54, 2.2]]),
  border("Brazil–Peru–Bolivia", [
    [-70, -4.2], [-73, -7.3], [-72.4, -9.5], [-69.6, -11], [-65.4, -9.8], [-63.4, -12.6], [-61, -13.5],
    [-60.2, -15], [-58.4, -16.3], [-57.5, -18.2],
  ]),
  border("Peru–Bolivia", [[-69.6, -11], [-68.7, -12.6], [-69.4, -15.3], [-69.5, -17.6]]),
  border("Peru–Chile", [[-69.5, -17.6], [-70.4, -18.4]]),
  border("Bolivia–Chile", [[-69.5, -17.6], [-68.2, -21.5], [-67.8, -22.8]]),
  border("Bolivia–Argentina", [[-67.8, -22.8], [-65, -22.1], [-62.6, -22.2]]),
  border("Bolivia–Paraguay", [[-62.6, -22.2], [-61, -19.6], [-58.2, -19.8], [-57.5, -18.2]]),
  border("Paraguay–Brazil", [[-58.2, -19.8], [-57.9, -22.1], [-55.6, -22.6], [-54.6, -25.6]]),
  border("Paraguay–Argentina", [[-62.6, -22.2], [-60, -24], [-57.6, -25.4], [-54.6, -25.6]]),
  border("Argentina–Brazil", [[-54.6, -25.6], [-53.7, -26.2], [-55.8, -28], [-57.6, -30.2]]),
  border("Brazil–Uruguay", [[-57.6, -30.2], [-56, -31], [-53.4, -33.7]]),
  border("Argentina–Uruguay", [[-57.6, -30.2], [-58.4, -33.9]]),
  border("Argentina–Chile", [
    [-67.8, -22.8], [-68.3, -24.5], [-68.5, -27], [-69.8, -30], [-70, -33], [-71, -36], [-71.2, -39.5],
    [-71.8, -42], [-71.7, -45], [-72.6, -48.5], [-73.4, -50], [-72, -51.7], [-68.6, -52.3],
  ]),
  border("Spain–Portugal", [[-8.9, 41.9], [-6.6, 41.9], [-6.9, 40.2], [-7, 39], [-7.4, 37.2]]),
  border("Spain–France", [[-1.8, 43.4], [0.5, 42.7], [3.2, 42.4]]),
  border("France–Benelux–Germany–Switzerland–Italy", [[2.5, 51.1], [4.2, 50.3], [5.8, 49.5], [8.2, 49], [7.6, 47.6], [6.1, 46.3], [7, 45.9], [6.6, 45.1], [7, 44.2], [7.5, 43.8]]),
  border("Belgium–Netherlands–Luxembourg", [[3.4, 51.4], [4.7, 51.4], [5.9, 50.8], [6.1, 50.1], [6.4, 49.5]]),
  border("Netherlands–Germany", [[5.9, 50.8], [6, 51.8], [7, 52.2], [7.2, 53.2]]),
  border("Germany–Denmark", [[8.6, 54.9], [9.9, 54.8]]),
  border("Germany–Poland", [[14.2, 53.9], [14.4, 53.2], [14.6, 52.5], [15, 51.1]]),
  border("Germany–Czechia–Austria–Switzerland", [[15, 51.1], [12.1, 50.3], [13.8, 48.8], [13, 47.5], [10.5, 47.6], [9.6, 47.5], [7.6, 47.6]]),
  border("Switzerland–Italy–Austria", [[7, 45.9], [8.4, 46.4], [9, 45.8], [10.4, 46.6], [9.6, 47.5]]),
  border("Austria–Italy–Slovenia", [[10.4, 46.6], [12.4, 47], [13.7, 46.5], [13.6, 45.7]]),
  border("Poland–Czechia–Slovakia", [[15, 51.1], [16.6, 50.2], [18.8, 49.5], [22.6, 49.1]]),
  border("Czechia–Austria–Slovakia", [[13.8, 48.8], [15, 49], [16.9, 48.6], [18.8, 49.5]]),
  border("Austria–Hungary", [[16.9, 48.6], [17.2, 48], [16.1, 46.9], [13.7, 46.5]]),
  border("Slovakia–Hungary", [[17.2, 48], [18.8, 47.8], [20.5, 48.5], [22.2, 48.4]]),
  border("Hungary–Romania–Ukraine", [[20.3, 46.1], [21.3, 46.8], [22.9, 47.9], [22.2, 48.4]]),
  border("Hungary–Croatia–Serbia", [[16.1, 46.9], [17.6, 45.9], [18.8, 45.9], [20.3, 46.1]]),
  border("Poland–Russia–Lithuania–Belarus–Ukraine", [[19.6, 54.4], [22.8, 54.4], [23.5, 53.9], [23.9, 52.7], [23.6, 52], [24.1, 50.8], [22.7, 49.6], [22.6, 49.1]]),
  border("Lithuania–Latvia", [[21.1, 56.1], [24.5, 56.3], [26.6, 55.7]]),
  border("Latvia–Estonia", [[24.3, 57.9], [27.5, 57.6]]),
  border("Estonia–Latvia–Russia", [[28, 59.5], [27.4, 58], [28.2, 56.2]]),
  border("Belarus–Lithuania–Latvia", [[23.5, 53.9], [25.8, 54.2], [26.6, 55.7], [28.2, 56.2]]),
  border("Belarus–Russia", [[28.2, 56.2], [30.9, 55.6], [31.8, 53.8], [31.6, 52.1]]),
  border("Belarus–Ukraine", [[23.6, 52], [27, 51.6], [30.5, 51.4], [31.6, 52.1]]),
  border("Ukraine–Russia", [[31.6, 52.1], [34.4, 51.8], [35.6, 50.4], [38, 49.9], [40, 49.6], [39.7, 47.8], [38.3, 47.2]]),
  border("Ukraine–Moldova–Romania", [[22.2, 48.4], [24.9, 47.7], [26.6, 48.3], [29.2, 47.4], [30.1, 46.4], [29.6, 45.4]]),
  border("Moldova–Romania", [[26.6, 48.3], [28.1, 46.6], [28.2, 45.5]]),
  border("Romania–Serbia", [[20.3, 46.1], [21.4, 45.2], [22.7, 44.5]]),
  border("Romania–Bulgaria", [[22.7, 44.5], [24.5, 43.7], [27, 44.1], [28.6, 43.7]]),
  border("Bulgaria–Serbia–Greece–Turkey", [[22.7, 44.5], [22.4, 43.5], [22.4, 42.3], [22.9, 41.3], [25.3, 41.2], [26.4, 41.7], [28, 42]]),
  border("Greece–Albania–North Macedonia", [[20, 39.7], [21, 40.6], [22.9, 41.3]]),
  border("Greece–Turkey", [[26.4, 41.7], [26, 40.8]]),
  border("Croatia–Slovenia–Hungary", [[13.6, 45.5], [15.7, 46.2], [16.6, 46.5]]),
  border("Bosnia–Croatia–Serbia", [[15.8, 45.2], [16.6, 45.2], [19, 45], [19.4, 44], [18.5, 42.5]]),
  border("Serbia–Kosovo–North Macedonia", [[19.4, 44], [20.2, 42.9], [21.5, 42.3], [22.4, 42.3]]),
  border("Albania–Montenegro–North Macedonia", [[19.5, 41.8], [20.6, 41.9], [21, 40.6]]),
  border("Norway–Sweden", [[11.5, 59], [12.5, 61], [12.1, 63.5], [14.5, 65.5], [16.3, 67.9], [20, 69]]),
  border("Sweden–Finland", [[24.1, 65.8], [23.6, 67.5], [20.6, 69]]),
  border("Norway–Finland", [[20.6, 69], [25.5, 68.9], [26.9, 70], [28.8, 69]]),
  border("Finland–Russia", [[27.8, 60.5], [30, 61.5], [31.5, 62.9], [29.6, 64.5], [30.1, 65.8], [29, 67.6], [28.8, 69], [30.9, 69.6]]),
  border("Russia–Kazakhstan", [
    [49.2, 46.5], [46.8, 48.4], [47.2, 50.2], [50.5, 51.5], [55.5, 50.7], [61.5, 51], [61, 54], [65.5, 54.8],
    [70.5, 55.2], [73.4, 53.5], [76.5, 54], [80, 51], [83, 51], [87.4, 49.2],
  ]),
  border("Russia–Mongolia", [[87.4, 49.2], [91.5, 50.5], [98, 52], [102, 51.5], [106.5, 50.3], [112, 49.5], [116, 50]]),
  border("Russia–China", [[116, 50], [119.5, 52.6], [123.5, 53.5], [127.5, 49.8], [131, 47.7], [134.7, 48.3], [133.1, 45.1], [131, 44.9], [130.6, 42.4]]),
  border("China–Mongolia", [[87.4, 49.2], [90, 47.8], [90.8, 45.3], [96.4, 42.7], [101, 42.5], [106, 41.6], [111, 43.2], [112, 44.8], [116.5, 45], [119.8, 47], [116, 50]]),
  border("Kazakhstan–China", [[87.4, 49.2], [85.6, 47], [82.6, 45.4], [80.2, 45], [80.2, 42.9]]),
  border("Kazakhstan–Kyrgyzstan–Uzbekistan–Turkmenistan", [[80.2, 42.9], [74.5, 43.2], [71, 42.3], [68.5, 40.9], [66, 42.9], [61, 44.4], [58.5, 45.6], [56, 45], [55.9, 41.3], [52.9, 41.7]]),
  border("Uzbekistan–Turkmenistan", [[55.9, 41.3], [58.5, 42.6], [61, 41.2], [62.4, 39.7], [65.6, 37.4]]),
  border("Turkmenistan–Iran–Afghanistan", [[53.9, 37.3], [57, 38.1], [60.5, 36.6], [61.2, 35.6], [64, 36], [65.6, 37.4], [67.8, 37.2]]),
  border("Afghanistan–Uzbekistan–Tajikistan", [[67.8, 37.2], [70, 37.5], [71.5, 37.9], [74.9, 37.2]]),
  border("China–South & Central Asia", [
    [80.2, 42.9], [80.2, 42.2], [76, 40.5], [73.6, 39.5], [74.9, 37.2], [77.8, 35.5], [79, 32.5], [78.8, 31],
    [81.5, 30.3], [83.5, 29.2], [86, 27.9], [88.1, 27.8], [89, 28], [92, 27.8], [95.5, 29.2], [97.2, 28.3],
    [98.7, 25.9], [98, 24], [99.6, 22.1], [101.2, 21.4], [102.2, 22.4], [103.3, 22.8], [105.3, 23.3],
    [106.7, 22.8], [108, 21.6],
  ]),
  border("India–Pakistan", [[77.8, 35.5], [74.5, 34], [74.6, 31.1], [72, 28], [70.4, 27.8], [70.7, 25.3], [68.2, 23.7]]),
  border("Afghanistan–Pakistan", [[74.9, 37.2], [71.5, 36.4], [70.9, 34], [69.5, 33.8], [69.3, 31.5], [66.4, 29.9], [62.5, 29.4], [60.9, 29.8]]),
  border("Iran–Afghanistan", [[60.9, 29.8], [61.6, 31.4], [60.6, 33.2], [61.2, 35.6]]),
  border("Iran–Pakistan", [[60.9, 29.8], [62.8, 28], [61.6, 25.2]]),
  border("India–Nepal", [[81.5, 30.3], [80.1, 28.8], [83.3, 27.4], [86, 26.6], [88.1, 26.4], [88.1, 27.8]]),
  border("India–Bhutan", [[89, 28], [89, 26.8], [92, 26.8], [92, 27.8]]),
  border("India–Bangladesh", [[89.1, 22], [88.7, 24.3], [88, 24.5], [89, 25.3], [88.5, 26.4], [89.9, 26], [92.4, 25.1], [92, 24], [92.6, 21.3]]),
  border("Bangladesh–Myanmar", [[92.6, 21.3], [92.3, 20.7]]),
  border("India–Myanmar", [[97.2, 28.3], [95.2, 26.6], [94.2, 23.8], [92.6, 21.3]]),
  border("Myanmar–Thailand", [[100.1, 20.4], [98, 18.6], [98.9, 16.2], [98.2, 15], [99.3, 10.9], [98.6, 10]]),
  border("Myanmar–Laos", [[99.6, 22.1], [101.2, 21.4], [100.1, 20.4]]),
  border("Laos–Thailand", [[100.1, 20.4], [101, 17.8], [104, 17.8], [105.6, 15.6], [105.5, 14.3]]),
  border("Thailand–Cambodia", [[105.5, 14.3], [103, 14.4], [102.6, 12.6], [102.9, 11.6]]),
  border("Laos–Cambodia–Vietnam", [[102.2, 22.4], [104, 20.9], [104.6, 18.5], [106.5, 16.6], [107.6, 15], [106.6, 11.9], [104.6, 10.5]]),
  border("Laos–Cambodia", [[105.5, 14.3], [107.6, 14.6]]),
  border("Malaysia–Thailand", [[100.2, 6.6], [102.1, 6.2]]),
  border("China–North Korea", [[124.4, 40], [126.8, 41.7], [128.2, 42], [130.6, 42.4]]),
  border("North Korea–South Korea", [[126.1, 37.7], [127.5, 38.3], [128.4, 38.6]]),
  border("Turkey–Syria", [[36.2, 36], [36.6, 36.8], [38, 36.8], [40.8, 37.1], [42.4, 37.1]]),
  border("Turkey–Iraq–Iran", [[42.4, 37.1], [44.8, 37.2], [44.2, 39], [44.8, 39.7]]),
  border("Turkey–Georgia–Armenia", [[41.6, 41.5], [43.4, 41.1], [43.6, 40.1], [44.8, 39.7]]),
  border("Russia–Georgia–Azerbaijan", [[40, 43.4], [42.5, 43.2], [44.6, 42.7], [46.5, 41.9], [48.6, 41.8]]),
  border("Georgia–Armenia–Azerbaijan", [[43.4, 41.1], [45, 41.2], [46.5, 41.9]]),
  border("Armenia–Azerbaijan–Iran", [[44.8, 39.7], [46.5, 38.9], [48, 39.6], [48.9, 38.4]]),
  border("Syria–Iraq", [[42.4, 37.1], [41.2, 34.4], [38.8, 33.4]]),
  border("Iraq–Jordan–Saudi Arabia–Kuwait", [[38.8, 33.4], [39.2, 32.2], [42, 31.1], [44.7, 29.2], [46.5, 29.1], [48, 29.2]]),
  border("Iraq–Iran", [[44.8, 37.2], [45.5, 35.3], [46.1, 33], [47.8, 31.5], [48, 30]]),
  border("Syria–Lebanon–Jordan", [[35.9, 34.6], [36.4, 34.6], [35.9, 33.4], [36, 32.7], [38.8, 33.4]]),
  border("Jordan–Saudi Arabia", [[39.2, 32.2], [37, 31.5], [38, 30.5], [36.8, 29.9], [35, 29.3]]),
  border("Israel–Egypt", [[34.2, 31.3], [34.9, 29.5]]),
  border("Israel–Jordan", [[35.6, 33], [35.5, 31.5], [35, 29.5]]),
  border("Saudi Arabia–Yemen–Oman–UAE", [[42.8, 16.4], [44, 17.4], [47, 17], [48.8, 18.2], [52, 19], [55.6, 20], [55.4, 22.7], [56, 24.1]]),
  border("Yemen–Oman", [[52, 19], [53.1, 16.6]]),
  border("Saudi Arabia–UAE", [[51.6, 24.2], [52.5, 22.9], [55.4, 22.7]]),
  border("Morocco–Algeria", [[-1.8, 35.1], [-1.7, 32.5], [-3.7, 30.7], [-8.7, 28.3], [-8.7, 27.7]]),
  border("Morocco–Western Sahara", [[-13.2, 27.7], [-8.7, 27.7]]),
  border("Western Sahara–Mauritania", [[-8.7, 27.3], [-8.7, 25.9], [-12, 26], [-12, 23.4], [-13.1, 22.8], [-13, 21.3], [-17.1, 21]]),
  border("Algeria–Mauritania–Mali–Niger", [[-8.7, 27.3], [-4.8, 25], [1.2, 21], [3.3, 19], [4.2, 19.2], [5.8, 19.4], [7.5, 20.9], [11.9, 23.5]]),
  border("Algeria–Tunisia", [[8.6, 36.9], [8.2, 34.6], [9.5, 32], [10, 30.2]]),
  border("Tunisia–Libya", [[11.5, 33.1], [10.3, 31.7], [10, 30.2]]),
  border("Algeria–Libya", [[10, 30.2], [9.5, 28.6], [10, 25.3], [11.9, 23.5]]),
  border("Libya–Niger–Chad", [[11.9, 23.5], [14, 23], [15.9, 23.4], [24, 19.5]]),
  border("Libya–Egypt–Sudan", [[25.1, 31.6], [25, 22], [24, 20], [24, 19.5]]),
  border("Egypt–Sudan", [[25, 22], [36.9, 22]]),
  border("Mauritania–Mali", [[-4.8, 25], [-6, 21.3], [-5.5, 16.4], [-11.4, 15.4], [-12.2, 14.7]]),
  border("Senegal–Mali–Guinea", [[-12.2, 14.7], [-11.4, 12.4], [-13.7, 12.6], [-16.7, 12.3]]),
  border("Mali–Niger–Burkina Faso", [[4.2, 19.2], [4.2, 16.8], [0.4, 14.9], [-2, 14.8], [-4, 13], [-5.4, 11]]),
  border("Mali–Guinea–Côte d'Ivoire", [[-5.4, 11], [-8, 10.2], [-11.4, 12.4]]),
  border("Niger–Nigeria–Chad", [[3.6, 11.7], [7, 13], [10, 13.3], [13.6, 13.7], [15.5, 16.9], [15.9, 23.4]]),
  border("Niger–Burkina Faso–Benin", [[0.4, 14.9], [1, 13.3], [3.6, 11.7]]),
  border("Ghana–Côte d'Ivoire", [[-3, 5], [-2.7, 9.6], [-2.8, 11]]),
  border("Ghana–Togo", [[1.2, 6.1], [0.2, 11]]),
  border("Benin–Nigeria", [[2.7, 6.4], [3.6, 11.7]]),
  border("Burkina Faso–Ghana–Togo", [[-2.8, 11], [1, 11]]),
  border("Côte d'Ivoire–Liberia–Guinea", [[-7.5, 4.4], [-8.5, 7.5], [-8, 10.2]]),
  border("Sierra Leone–Liberia", [[-11.4, 6.9], [-10.3, 8.4], [-10.7, 9.3]]),
  border("Guinea–Sierra Leone", [[-13.2, 9.1], [-11.2, 10], [-10.3, 8.4]]),
  border("Nigeria–Cameroon", [[8.5, 4.6], [9, 6.5], [11.5, 7], [13.6, 10.6], [14.6, 13], [13.6, 13.7]]),
  border("Chad–Cameroon–CAR–Sudan", [[14.6, 13], [15.1, 10.5], [16.8, 7.6], [18.6, 8], [22, 9], [22.5, 10.9], [22.9, 13], [24, 15.7], [24, 19.5]]),
  border("CAR–Cameroon–Congo", [[14.4, 6], [16.2, 2.2]]),
  border("CAR–DR Congo", [[16.2, 2.2], [18.5, 3.6], [22.4, 4.1], [25.3, 5], [27.4, 5.1]]),
  border("CAR–South Sudan", [[27.4, 5.1], [24, 8.5], [22.5, 10.9]]),
  border("Sudan–South Sudan", [[23.9, 8.6], [26.5, 9.5], [29.6, 9.8], [32, 12.2], [33.2, 12.2], [34.1, 9.5]]),
  border("Sudan–Ethiopia–Eritrea", [[34.1, 9.5], [35.1, 11.7], [36.1, 12.7], [36.4, 14.4], [38, 17.6], [38.6, 18]]),
  border("Eritrea–Ethiopia–Djibouti", [[36.4, 14.4], [38.5, 14.5], [40.2, 14.4], [41.8, 12.8], [42.5, 12.5]]),
  border("Djibouti–Ethiopia", [[41.8, 11.6], [43.2, 11.5]]),
  border("Somalia–Ethiopia", [[43, 11], [44, 9], [47.9, 8], [45, 5], [42, 4], [41, 4]]),
  border("Kenya–Ethiopia–South Sudan", [[33.9, 4.6], [36, 4.4], [39, 3.5], [41, 4]]),
  border("Kenya–Somalia", [[41, 4], [41, -1.6], [41.6, -1.7]]),
  border("South Sudan–Ethiopia", [[34.1, 9.5], [34, 8.2], [33, 7.8], [35, 5]]),
  border("South Sudan–Uganda–DR Congo", [[27.4, 5.1], [30.8, 3.5], [33.9, 3.8]]),
  border("Uganda–Kenya", [[33.9, 3.8], [35, 1.5], [34, 0.2], [33.9, -1]]),
  border("Kenya–Tanzania", [[33.9, -1], [37.6, -3], [39.2, -4.7]]),
  border("DR Congo–East Africa", [[30.8, 3.5], [29.6, -1.4], [29.1, -4], [30.4, -7.8]]),
  border("DR Congo–Angola–Zambia", [[12.2, -5.8], [16.5, -5.9], [18, -8], [21.8, -7.3], [22.2, -11], [24, -11], [25.5, -11.9], [27.5, -12], [29, -13.4], [29.6, -12.2], [28.4, -9.3], [30.4, -7.8]]),
  border("Congo–DR Congo", [[15.3, -4.3], [16.2, -2], [17.7, -0.4], [18, 2.2], [18.5, 3.6]]),
  border("Gabon–Congo", [[11.1, -3.9], [13, -2.3], [14, -2.4], [14.5, -0.6], [13.2, 1.2], [14.2, 2.2]]),
  border("Cameroon–Gabon–Congo", [[9.8, 2.3], [11.3, 2.2], [13.3, 2.2], [16.2, 2.2]]),
  border("Congo–Angola (Cabinda)", [[11.8, -4.4], [13, -4.8], [15.3, -4.3]]),
  border("Tanzania–Mozambique", [[40.4, -10.5], [37.9, -11.3], [34.6, -11.5]]),
  border("Malawi", [[33, -9.6], [32.7, -13.6], [34.4, -14.4], [35.3, -17.1], [35.9, -14.9], [34.6, -11.5]]),
  border("Tanzania–Zambia", [[31, -8.6], [33, -9.6]]),
  border("Zambia–Angola", [[24, -13], [22, -13], [22, -16.2], [23.4, -17.6]]),
  border("Angola–Namibia", [[11.8, -17.3], [13.9, -17.4], [18.5, -17.4], [21, -18], [25.3, -17.8]]),
  border("Zambia–Zimbabwe–Mozambique", [[25.3, -17.8], [28, -16.4], [30.4, -15.6], [32.7, -13.6]]),
  border("Zimbabwe–Mozambique", [[30.4, -15.6], [33, -16.4], [32.8, -19], [32.4, -21.3], [31.3, -22.4]]),
  border("Zimbabwe–Botswana–South Africa", [[25.3, -17.8], [26, -18.8], [27.5, -20.4], [29.4, -22.1], [31.3, -22.4]]),
  border("Botswana–Namibia", [[21, -18], [20.9, -22], [20, -22], [20, -24.8]]),
  border("Botswana–South Africa", [[20, -24.8], [20.6, -26.8], [22.8, -25.7], [25.5, -25.6], [27, -24], [29.4, -22.1]]),
  border("Namibia–South Africa", [[20, -24.8], [20, -28.4], [16.5, -28.6]]),
  border("South Africa–Mozambique", [[31.3, -22.4], [32, -25], [32.9, -26.9]]),
];

// Plot: reads only data and the constants above
type XY = [number, number];
type Vec3 = [number, number, number];

const sinLat0 = Math.sin(ORTHO_LAT0 * DEG2RAD);
const cosLat0 = Math.cos(ORTHO_LAT0 * DEG2RAD);

// Insert vertices so that no segment spans more than MAX_STEP_DEG; straight edges then curve with the projection
function densify(pts: LonLat[]): LonLat[] {
  const out: LonLat[] = [pts[0]];
  for (let i = 1; i < pts.length; i++) {
    const [lon0, lat0] = pts[i - 1];
    const [lon1, lat1] = pts[i];
    const n = Math.ceil(Math.max(Math.abs(lon1 - lon0), Math.abs(lat1 - lat0)) / MAX_STEP_DEG);
    for (let k = 1; k <= n; k++) out.push([lon0 + ((lon1 - lon0) * k) / n, lat0 + ((lat1 - lat0) * k) / n]);
  }
  return out;
}

// Auxiliary angle θ of Mollweide: 2θ + sin 2θ = π sin φ (Newton iteration)
function mollweideTheta(phi: number): number {
  if (Math.abs(Math.abs(phi) - Math.PI / 2) < 1e-7) return Math.sign(phi) * (Math.PI / 2);
  let theta = phi;
  const target = Math.PI * Math.sin(phi);
  for (let it = 0; it < 12; it++) {
    const d = (2 * theta + Math.sin(2 * theta) - target) / (2 + 2 * Math.cos(2 * theta));
    theta -= d;
    if (Math.abs(d) < 1e-9) break;
  }
  return theta;
}

const flatProjections: Record<string, (p: LonLat) => XY> = {
  Mercator: ([lon, lat]) => {
    const phi = Math.max(-MERCATOR_LAT_CLIP, Math.min(MERCATOR_LAT_CLIP, lat)) * DEG2RAD;
    return [lon * DEG2RAD, Math.log(Math.tan(Math.PI / 4 + phi / 2))];
  },
  Mollweide: ([lon, lat]) => {
    const theta = mollweideTheta(lat * DEG2RAD);
    return [((2 * SQRT2) / Math.PI) * lon * DEG2RAD * Math.cos(theta), SQRT2 * Math.sin(theta)];
  },
};

// Orthographic point as a unit vector: x, y on the image plane, z ≥ 0 on the visible hemisphere
function orthoVec([lon, lat]: LonLat): Vec3 {
  const lam = (lon - ORTHO_LON0) * DEG2RAD;
  const phi = lat * DEG2RAD;
  return [
    Math.cos(phi) * Math.sin(lam),
    cosLat0 * Math.sin(phi) - sinLat0 * Math.cos(phi) * Math.cos(lam),
    sinLat0 * Math.sin(phi) + cosLat0 * Math.cos(phi) * Math.cos(lam),
  ];
}

// Where segment a→b crosses the horizon, pushed out onto the limb circle
function limbPoint(a: Vec3, b: Vec3): XY {
  const s = a[2] / (a[2] - b[2]);
  const x = a[0] + s * (b[0] - a[0]);
  const y = a[1] + s * (b[1] - a[1]);
  const r = Math.hypot(x, y);
  return [x / r, y / r];
}

// Intermediate points along the limb from p to q, the short way round
function limbArc(p: XY, q: XY): XY[] {
  const a0 = Math.atan2(p[1], p[0]);
  let d = Math.atan2(q[1], q[0]) - a0;
  d -= 2 * Math.PI * Math.round(d / (2 * Math.PI));
  const n = Math.ceil(Math.abs(d) / LIMB_STEP_RAD);
  const arc: XY[] = [];
  for (let k = 1; k < n; k++) arc.push([Math.cos(a0 + (d * k) / n), Math.sin(a0 + (d * k) / n)]);
  return arc;
}

// Polyline → projected runs; on the globe a line is cut where it passes behind the horizon
function projectLine(projId: string, pts: LonLat[]): XY[][] {
  const dense = densify(pts);
  if (projId !== "Orthographic") return [dense.map(flatProjections[projId])];
  const v = dense.map(orthoVec);
  const runs: XY[][] = [];
  let cur: XY[] = [];
  for (let i = 0; i < v.length; i++) {
    const p = v[i];
    const prev = v[i - 1];
    if (p[2] >= 0) {
      if (prev && prev[2] < 0) cur.push(limbPoint(prev, p));
      cur.push([p[0], p[1]]);
    } else if (prev && prev[2] >= 0) {
      cur.push(limbPoint(prev, p));
      runs.push(cur);
      cur = [];
    }
  }
  runs.push(cur);
  return runs.filter((r) => r.length > 1);
}

// Closed ring → projected ring; on the globe it is clipped to the visible hemisphere (Sutherland–Hodgman)
// and every stretch that runs behind the horizon is closed along the limb arc instead of a chord
function projectRing(projId: string, pts: LonLat[]): XY[] {
  const dense = densify([...pts, pts[0]]);
  if (projId !== "Orthographic") return dense.map(flatProjections[projId]);
  const v = dense.map(orthoVec);
  const out: Array<{ p: XY; onLimb: boolean }> = [];
  for (let i = 1; i < v.length; i++) {
    const a = v[i - 1];
    const b = v[i];
    if (b[2] >= 0) {
      if (a[2] < 0) out.push({ p: limbPoint(a, b), onLimb: true });
      out.push({ p: [b[0], b[1]], onLimb: false });
    } else if (a[2] >= 0) {
      out.push({ p: limbPoint(a, b), onLimb: true });
    }
  }
  return out.flatMap((cur, i) => {
    const next = out[(i + 1) % out.length];
    return cur.onLimb && next.onLimb ? [cur.p, ...limbArc(cur.p, next.p)] : [cur.p];
  });
}

// Graticule, equator, prime meridian and Tissot circles (geodesic circles of equal radius)
const graticule: LonLat[][] = [];
for (let lat = -60; lat <= 60; lat += GRATICULE_STEP_DEG) {
  if (lat !== 0) graticule.push([[-180, lat], [180, lat]]);
}
for (let lon = -150; lon <= 150; lon += GRATICULE_STEP_DEG) {
  if (lon !== 0) graticule.push([[lon, -90], [lon, 90]]);
}
const equator: LonLat[] = [[-180, 0], [180, 0]];
const primeMeridian: LonLat[] = [[0, -90], [0, 90]];

const tissotRings: LonLat[][] = [];
for (let latC = -60; latC <= 60; latC += GRATICULE_STEP_DEG) {
  for (let lonC = -120; lonC <= 120; lonC += GRATICULE_STEP_DEG * 2) {
    const phi1 = latC * DEG2RAD;
    const ring: LonLat[] = [];
    for (let i = 0; i < TISSOT_STEPS; i++) {
      const brng = (i / TISSOT_STEPS) * 2 * Math.PI;
      const phi2 = Math.asin(
        Math.sin(phi1) * Math.cos(TISSOT_RADIUS_RAD) + Math.cos(phi1) * Math.sin(TISSOT_RADIUS_RAD) * Math.cos(brng),
      );
      const dLam = Math.atan2(
        Math.sin(brng) * Math.sin(TISSOT_RADIUS_RAD) * Math.cos(phi1),
        Math.cos(TISSOT_RADIUS_RAD) - Math.sin(phi1) * Math.sin(phi2),
      );
      ring.push([lonC + dLam / DEG2RAD, phi2 / DEG2RAD]);
    }
    tissotRings.push(ring);
  }
}

const areas = data.filter((d) => d[FEATURE_KIND] !== "border");
const borders = data.filter((d) => d[FEATURE_KIND] === "border");

function outlineOf(projId: string): XY[] {
  const steps = 120;
  if (projId === "Mercator") {
    const yMax = flatProjections.Mercator([0, MERCATOR_LAT_CLIP])[1];
    return [[-Math.PI, -yMax], [Math.PI, -yMax], [Math.PI, yMax], [-Math.PI, yMax]];
  }
  const [rx, ry] = projId === "Mollweide" ? [2 * SQRT2, SQRT2] : [1, 1];
  return Array.from({ length: steps }, (_, i) => [rx * Math.cos((i / steps) * 2 * Math.PI), ry * Math.sin((i / steps) * 2 * Math.PI)]);
}

const bundles = PROJECTIONS.map((meta) => {
  const id = meta.id;
  const outline = outlineOf(id);
  const xs = outline.map((p) => p[0]);
  const ys = outline.map((p) => p[1]);
  return {
    ...meta,
    outline,
    bboxMin: [Math.min(...xs), Math.min(...ys)],
    bboxMax: [Math.max(...xs), Math.max(...ys)],
    // Land and lakes share one even-odd fill, so a lake inside a landmass reads as water
    landFill: areas.map((d) => projectRing(id, d[VERTICES])).filter((r) => r.length > 2),
    coastlines: areas.flatMap((d) => projectLine(id, [...d[VERTICES], d[VERTICES][0]])),
    borders: borders.flatMap((d) => projectLine(id, d[VERTICES])),
    graticule: graticule.flatMap((line) => projectLine(id, line)),
    equator: projectLine(id, equator),
    primeMeridian: projectLine(id, primeMeridian),
    tissot: tissotRings.map((ring) => projectRing(id, ring)).filter((r) => r.length > 2),
  };
});

function GeoOverlay({ bundleIndex }: { bundleIndex: number }) {
  const xScale = useXScale() as (v: number) => number;
  const yScale = useYScale() as (v: number) => number;
  const b = bundles[bundleIndex];
  const clipId = `proj-clip-${b.id}`;
  const pathOf = (runs: XY[][], close: boolean) =>
    runs
      .map((run) => run.map(([x, y], i) => `${i ? "L" : "M"}${xScale(x).toFixed(1)},${yScale(y).toFixed(1)}`).join("") + (close ? "Z" : ""))
      .join("");
  const outlineD = pathOf([b.outline], true);
  const guide = { fill: "none", stroke: t.inkSoft };

  return (
    <g>
      <defs>
        <clipPath id={clipId}>
          <path d={outlineD} />
        </clipPath>
      </defs>
      <path d={outlineD} fill={t.elevatedBg} />
      <g clipPath={`url(#${clipId})`}>
        <path d={pathOf(b.graticule, false)} {...guide} strokeOpacity={0.28} strokeWidth={0.8} />
        <path d={pathOf(b.equator, false)} {...guide} strokeOpacity={0.6} strokeWidth={1.2} strokeDasharray="4 3" />
        <path d={pathOf(b.primeMeridian, false)} {...guide} strokeOpacity={0.6} strokeWidth={1.2} strokeDasharray="4 3" />
        <path d={pathOf(b.landFill, true)} fill={t.inkSoft} fillOpacity={0.26} fillRule="evenodd" />
        <path d={pathOf(b.borders, false)} fill="none" stroke={t.inkSoft} strokeOpacity={0.7} strokeWidth={0.6} strokeLinejoin="round" />
        <path d={pathOf(b.coastlines, false)} fill="none" stroke={t.inkSoft} strokeOpacity={0.95} strokeWidth={0.9} strokeLinejoin="round" />
        <path d={pathOf(b.tissot, true)} fill={t.palette[0]} fillOpacity={0.3} stroke={t.palette[0]} strokeWidth={1.1} />
      </g>
      <path d={outlineD} fill="none" stroke={t.inkSoft} strokeOpacity={0.75} strokeWidth={1.5} />
    </g>
  );
}

function LegendItem({ swatch, label }: { swatch: React.CSSProperties; label: string }) {
  return (
    <span style={{ display: "inline-flex", alignItems: "center", gap: 8 }}>
      <span style={{ display: "inline-block", ...swatch }} />
      {label}
    </span>
  );
}

export default function Chart() {
  const { width, height } = window.ANYPLOT_SIZE;
  const maxMapH =
    height - TITLE_BLOCK_HEIGHT - LEGEND_HEIGHT - 2 * BLOCK_GAP - PANEL_HEADER_HEIGHT - PANEL_NOTE_HEIGHT;
  const rowWidth = width - OUTER_PAD_X * 2 - PANEL_GAP * (bundles.length - 1);
  const aspects = bundles.map((b) => (b.bboxMax[0] - b.bboxMin[0]) / (b.bboxMax[1] - b.bboxMin[1]));
  const weights = aspects.map((a) => Math.pow(a, WIDTH_WEIGHT_EXP));
  const weightSum = weights.reduce((s, w) => s + w, 0);
  // Each map takes its full panel width; its height follows from the projection's aspect ratio
  const layouts = bundles.map((b, idx) => {
    const panelW = Math.floor((rowWidth * weights[idx]) / weightSum);
    const dx = (b.bboxMax[0] - b.bboxMin[0]) * (1 + DOMAIN_PAD_SHARE);
    const dy = (b.bboxMax[1] - b.bboxMin[1]) * (1 + DOMAIN_PAD_SHARE);
    const mapH = Math.min(maxMapH, Math.round(((panelW - 2 * MAP_MARGIN) * dy) / dx + 2 * MAP_MARGIN));
    const drawAspect = (panelW - 2 * MAP_MARGIN) / (mapH - 2 * MAP_MARGIN);
    const halfW = Math.max(dx, dy * drawAspect) / 2;
    return { panelW, mapH, halfW, halfH: halfW / drawAspect };
  });
  const mapBandH = Math.max(...layouts.map((l) => l.mapH)) + PANEL_NOTE_HEIGHT;

  return (
    <div
      style={{
        width,
        height,
        backgroundColor: t.pageBg,
        display: "flex",
        flexDirection: "column",
        justifyContent: "center",
        gap: BLOCK_GAP,
        fontFamily: "Inter, system-ui, sans-serif",
      }}
    >
      <div
        style={{
          height: TITLE_BLOCK_HEIGHT,
          display: "flex",
          flexDirection: "column",
          alignItems: "center",
          justifyContent: "center",
        }}
      >
        <div style={{ fontSize: 26, fontWeight: 600, color: t.ink }}>{TITLE}</div>
        <div style={{ fontSize: 17, color: t.inkSoft, marginTop: 6 }}>{SUBTITLE}</div>
      </div>
      <div style={{ padding: `0 ${OUTER_PAD_X}px`, display: "flex", gap: PANEL_GAP }}>
        {bundles.map((b, idx) => {
          const { panelW, mapH, halfW, halfH } = layouts[idx];
          const cx = (b.bboxMin[0] + b.bboxMax[0]) / 2;
          const cy = (b.bboxMin[1] + b.bboxMax[1]) / 2;

          return (
            <div key={b.id} style={{ width: panelW, display: "flex", flexDirection: "column", alignItems: "center" }}>
              <div
                style={{
                  height: PANEL_HEADER_HEIGHT,
                  display: "flex",
                  flexDirection: "column",
                  alignItems: "center",
                  justifyContent: "flex-end",
                  paddingBottom: 8,
                }}
              >
                <div style={{ fontSize: 20, fontWeight: 600, color: t.ink, lineHeight: 1.25 }}>{b.title}</div>
                <div style={{ fontSize: 16, color: t.inkSoft, marginTop: 2 }}>{b.subtitle}</div>
              </div>
              {/* Maps share one center line; each note sits directly under its own map */}
              <div style={{ height: mapBandH, display: "flex", flexDirection: "column", justifyContent: "center", alignItems: "center" }}>
                <ChartsContainer
                  width={panelW}
                  height={mapH}
                  margin={MAP_MARGIN}
                  skipAnimation
                  series={[]}
                  xAxis={[{ position: "none", scaleType: "linear", min: cx - halfW, max: cx + halfW }]}
                  yAxis={[{ position: "none", scaleType: "linear", min: cy - halfH, max: cy + halfH }]}
                >
                  <GeoOverlay bundleIndex={idx} />
                </ChartsContainer>
                <div
                  style={{
                    height: PANEL_NOTE_HEIGHT,
                    display: "flex",
                    alignItems: "center",
                    fontSize: 16,
                    fontStyle: "italic",
                    color: t.inkSoft,
                  }}
                >
                  {b.note}
                </div>
              </div>
            </div>
          );
        })}
      </div>
      <div
        style={{
          height: LEGEND_HEIGHT,
          display: "flex",
          alignItems: "center",
          justifyContent: "center",
          gap: 32,
          fontSize: 15,
          color: t.inkSoft,
        }}
      >
        <LegendItem
          swatch={{ width: 16, height: 14, borderRadius: 3, background: t.inkSoft, opacity: 0.45, border: `1.5px solid ${t.inkSoft}` }}
          label="Land & coastline"
        />
        <LegendItem swatch={{ width: 20, height: 0, borderTop: `1px solid ${t.inkSoft}` }} label="Country border" />
        <LegendItem
          swatch={{ width: 14, height: 14, borderRadius: "50%", background: t.palette[0], opacity: 0.6, border: `1.5px solid ${t.palette[0]}` }}
          label={`Tissot indicatrix — circles of equal ${TISSOT_RADIUS_KM} km radius on the globe`}
        />
        <LegendItem
          swatch={{ width: 20, height: 0, borderTop: `1.5px dashed ${t.inkSoft}` }}
          label={`${GRATICULE_STEP_DEG}° graticule (equator & prime meridian dashed)`}
        />
      </div>
    </div>
  );
}

Retrieve this implementation

Runnable source as JSON, for any HTTP client: https://api.anyplot.ai/specs/map-projections/muix/code. Any spec id and library id listed in llms-full.txt fit the same URL shape; every URL below is complete and callable.

{
  "spec_id": "map-projections",
  "language": "javascript",
  "library": "muix",
  "page": "https://anyplot.ai/map-projections/javascript/muix",
  "hub": "https://anyplot.ai/map-projections",
  "code_json": "https://api.anyplot.ai/specs/map-projections/muix/code",
  "spec_json": "https://api.anyplot.ai/specs/map-projections",
  "render_light_png": "https://storage.googleapis.com/anyplot-images/plots/map-projections/javascript/muix/plot-light.png",
  "render_dark_png": "https://storage.googleapis.com/anyplot-images/plots/map-projections/javascript/muix/plot-dark.png",
  "interactive_light_html": "https://storage.googleapis.com/anyplot-images/plots/map-projections/javascript/muix/plot-light.html",
  "interactive_dark_html": "https://storage.googleapis.com/anyplot-images/plots/map-projections/javascript/muix/plot-dark.html",
  "quality_score": 88.0,
  "license": "MIT",
  "guide": "https://anyplot.ai/llms.txt"
}

Part of World Map with Different Projections on anyplot.ai.

Other implementations