Maps · World: choropleths and the world's countries

ChoroplethLayer washes each area by its value, keyed by its id or a
property's text or number, on one hue's scale from its faintest at the
least value to its strongest at the most; an area without a value reads
as no data. ChoroplethMap lays it on the owner's map, with or without
tiles, and puts a legend of the scale and of no data in the corner; a
value that matches no area is logged once. WorldMap washes Natural
Earth's 110m countries, bundled trimmed by scripts/countries.py, by ISO
3166 alpha-2 code, and fails on a key that is no code. A shape now
paints as one fill and one edge path per world in view.
This commit is contained in:
ZacharyZhang-NY committed 2026-09-27 23:12:27 -04:00
1 parent a64b78b673
commit a4ca1f04d4
14 files changed
+612 -35

No files matched your search

+3 -1
View File
@@ -12,6 +12,7 @@ use gpui::{
};
mod layers;
mod world;
use super::Page;
use crate::probe::probe;
@@ -22,7 +23,7 @@ pub const PAGE: Page = Page {
number: 41,
slug: "maps",
title: "Maps",
summary: "Tiles the host supplies, pins with a popup, a picker's crosshair, routes, GeoJSON, heat and clusters. The land is Natural Earth's.",
summary: "Tiles the host supplies, pins with a popup, a picker's crosshair, routes, GeoJSON, heat, clusters and choropleths. The land is Natural Earth's.",
render,
script: &[
Step::Click("world-map"),
@@ -72,6 +73,7 @@ fn render(window: &mut Window, cx: &mut App) -> AnyElement {
.child(layers::routes(cx))
.child(layers::heat(cx))
.child(layers::clusters(cx))
.child(world::world(cx))
.into_any_element()
}