dotted‑world‑map

dotted-map, svg-dotted-map, cobe or this: which one?

Pick @setkernel/dotted-map-next for a world, region or country map as an SVG of dots or hexagons, with pins, drawn on the server, at the edge or in the browser. Pick cobe for a spinning globe drawn with WebGL, svg-dotted-map to get the dots' positions and draw them yourself with no dependencies, and dotted-map, which this library is forked from, when its smaller gzipped SVG matters more to you than its larger bundle and slower first map.

Measured on 2026-12-04 by scripts/measure.mjs: @setkernel/dotted-map-next 1.1.2, the build in the tree, against dotted-map 3.1.0, svg-dotted-map 2.1.0, cobe 2.1.0 from the npm registry at run time.

When to pick each

The numbers

Each library at its own defaults, with the same calls: new DottedMap({ height }), getSVG() and getMapJSON({ height: 60 }). dotted-map's default grid is vertical and ours is diagonal, so the points rows give the dot counts.

@setkernel/dotted-map-next 1.1.2 (ours)dotted-map 3.1.0svg-dotted-map 2.1.0cobe 2.1.0
ESM entry fileindex.mjsdist/index.mjsdist/index.mjsdist/index.esm.js
entry: bytes573483515985013014271
entry: gzip bytes41808111389141116580
entry: brotli bytes3835673284112415799
main entry bundled with its dependencies, minified: bytes619304034885008414329
main entry bundled with its dependencies, minified: gzip bytes43699154820140756640
light entry with a precomputed world map at height 60, bundled: gzip bytes768061881n/an/a
runtime dependencies in package.json1200
packages installed with it (dependencies of dependencies too)71000
types shipyesyesyesyes
licence fieldMITMITnot set in package.jsonMIT
SVG, world, height 60, circles: points30852659n/an/a
SVG, world, height 60, circles: bytes120218132612n/an/a
SVG, world, height 60, circles: gzip bytes103506603n/an/a
SVG, world, height 60, hexagons: points30852659n/an/a
SVG, world, height 60, hexagons: bytes274358374119n/an/a
SVG, world, height 60, hexagons: gzip bytes4996543918n/an/a
SVG, one country (FRA), height 60, circles: points19821718n/an/a
SVG, one country (FRA), height 60, circles: bytes7521985869n/an/a
SVG, one country (FRA), height 60, circles: gzip bytes49023904n/an/a
world grid, height 60: fresh process (median of 5)39.6 ms308.7 msn/an/a
world grid, height 60: cached second call (median of 5)0.043 ms0.027 msn/an/a
world grid, height 100: fresh process (median of 5)65.6 ms632.6 msn/an/a
world grid, height 100: cached second call (median of 5)0.045 ms0.026 msn/an/a

Where an alternative is better

On size, dependencies and SVG output:

On time, from the timing cells above, which vary between runs and machines: