nodesByIsolation

fun nodesByIsolation(nodes: List<Node>, zoom: Int, radiusPx: Int): List<Node>(source)

nodes ordered by how alone each one is: fewest neighbours within radiusPx first.

This is the order to rasterize chips in. Clustering decides inside the source which nodes stand alone and there is no API that reports it back, but a node the source draws on its own has, by definition, few neighbours, so the ones that need a chip most sort to the front and the ones just past the cluster threshold come next rather than last. That makes the image budget run out on nodes buried mid-cluster, which are never drawn anyway.

Distances are measured in Web Mercator world pixels, the space clustering itself works in, rather than in degrees — a degree of longitude is a very different distance at the top of the map than at the equator.