One colour and one tile per continent, which is the case patterns are actually for: the classes here are kinds, not amounts, so a sequential ramp would imply an order that is not in the data. The tile background is the colour the scale chose, so texture is added to the encoding rather than replacing it, and the ink is picked for contrast against that colour so every class stays legible without being configured one at a time.
Grouping. Natural Earth's own continent property, joined directly:
one data row colours every country in its continent.
Colour Okabe-Ito, the built-in okabeIto palette, which is engineered
to survive the common colour-vision deficiencies
Geometry Natural Earth 1:110m, built-in registry
size is the distance from one mark to the next, and the marks are deliberately
small against it: a dot covers about a twelfth of its tile, a bar a fifth of its width.
Tightening that is how a patterned map turns muddy, because the ink starts averaging with
the fill into a shade that is on no scale, and neighbouring classes stop being separable,
which is the job the texture was added to do. Defaults are 10px spacing and a fifth of that
for line weight; the slider below is the same option.
series: [{ data, fill: { pattern: { type: 'dots', size: 10 } } }]
// Eight tiles: dots, squares, checks, lines, grid, diagonal, crosshatch,
// and custom with your own path. Per feature, for the qualitative case:
fill: {
pattern: ({ classIndex, color, value, datum, key }) => ({ type: TILES[classIndex] }),
}
It holds its size on screen. Zoom in: the dots stay dots. A pattern resolves in the
user space of the shape referencing it, and shapes ride the camera, so an untouched tile
would grow with the zoom, on exactly the reasoning that gives borders
non-scaling-stroke. Texture that grows stops reading as a fill and starts
reading as geometry.
Legend swatches draw the real tile, off the same builder as the map, scaled to show two repeats. A patterned map with plain colour swatches tells the reader the texture means nothing, which is the opposite of the point when the tile is what separates two classes on a photocopy. Areas with no data are never textured, because an absence has to keep reading as an absence rather than as one more category.