Public
Edited
Jan 13, 2024
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import { chart, circle } with {
points,
projection
} from "@fil/spherical-smallest-circle-problem"
Insert cell
projection = d3
.geoOrthographic()
.fitExtent([[2, 2], [width - 2, 498]], { type: "Sphere" })
.rotate([-d3.geoCentroid(country)[0], -0.6 * d3.geoCentroid(country)[1]])
Insert cell
drawCountries = {
const context = chart.getContext("2d"),
path = d3.geoPath(projection, context);
context.beginPath();
path(countries);
context.fillStyle = "rgba(0,0,0,.1)";
context.fill();
}
Insert cell
Insert cell
d3 = require("d3-geo@2")
Insert cell
import { select } from "@jashkenas/inputs"
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more