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
- @setkernel/dotted-map-next returns an SVG string of dots or hexagons: the world, a box of latitude and longitude, or any countries, with pins. Each country's dots are in a group of their own for CSS, the types ship with it, and a light entry draws precomputed maps. It runs in Node.js, edge functions and browsers.
- dotted-map is the library this one is forked from. It draws the same kinds of SVG maps, and has a light entry for precomputed maps too.
- svg-dotted-map returns an array of points and leaves drawing them to you: it makes no SVG and has no precomputed map.
- cobe draws a WebGL globe on a canvas, in the browser: it makes no SVG and builds no grid of this kind.
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.0 | svg-dotted-map 2.1.0 | cobe 2.1.0 | |
|---|---|---|---|---|
| ESM entry file | index.mjs | dist/index.mjs | dist/index.mjs | dist/index.esm.js |
| entry: bytes | 57348 | 351598 | 50130 | 14271 |
| entry: gzip bytes | 41808 | 111389 | 14111 | 6580 |
| entry: brotli bytes | 38356 | 73284 | 11241 | 5799 |
| main entry bundled with its dependencies, minified: bytes | 61930 | 403488 | 50084 | 14329 |
| main entry bundled with its dependencies, minified: gzip bytes | 43699 | 154820 | 14075 | 6640 |
| light entry with a precomputed world map at height 60, bundled: gzip bytes | 7680 | 61881 | n/a | n/a |
| runtime dependencies in package.json | 1 | 2 | 0 | 0 |
| packages installed with it (dependencies of dependencies too) | 7 | 10 | 0 | 0 |
| types ship | yes | yes | yes | yes |
| licence field | MIT | MIT | not set in package.json | MIT |
| SVG, world, height 60, circles: points | 3085 | 2659 | n/a | n/a |
| SVG, world, height 60, circles: bytes | 120218 | 132612 | n/a | n/a |
| SVG, world, height 60, circles: gzip bytes | 10350 | 6603 | n/a | n/a |
| SVG, world, height 60, hexagons: points | 3085 | 2659 | n/a | n/a |
| SVG, world, height 60, hexagons: bytes | 274358 | 374119 | n/a | n/a |
| SVG, world, height 60, hexagons: gzip bytes | 49965 | 43918 | n/a | n/a |
| SVG, one country (FRA), height 60, circles: points | 1982 | 1718 | n/a | n/a |
| SVG, one country (FRA), height 60, circles: bytes | 75219 | 85869 | n/a | n/a |
| SVG, one country (FRA), height 60, circles: gzip bytes | 4902 | 3904 | n/a | n/a |
| world grid, height 60: fresh process (median of 5) | 39.6 ms | 308.7 ms | n/a | n/a |
| world grid, height 60: cached second call (median of 5) | 0.043 ms | 0.027 ms | n/a | n/a |
| world grid, height 100: fresh process (median of 5) | 65.6 ms | 632.6 ms | n/a | n/a |
| world grid, height 100: cached second call (median of 5) | 0.045 ms | 0.026 ms | n/a | n/a |
- svg-dotted-map 2.1.0: "n/a" because it returns an array of points and leaves drawing them to the caller: it makes no SVG and has no precomputed map.
- cobe 2.1.0: "n/a" because it draws a WebGL globe on a canvas: it makes no SVG and builds no grid of this kind.
Where an alternative is better
On size, dependencies and SVG output:
- dotted-map 3.1.0 is better on SVG, world, height 60, circles: gzip bytes: 6603 against our 10350.
- dotted-map 3.1.0 is better on SVG, world, height 60, hexagons: gzip bytes: 43918 against our 49965.
- dotted-map 3.1.0 is better on SVG, one country (FRA), height 60, circles: gzip bytes: 3904 against our 4902.
- svg-dotted-map 2.1.0 is better on entry: bytes: 50130 against our 57348.
- svg-dotted-map 2.1.0 is better on entry: gzip bytes: 14111 against our 41808.
- svg-dotted-map 2.1.0 is better on entry: brotli bytes: 11241 against our 38356.
- svg-dotted-map 2.1.0 is better on main entry bundled with its dependencies, minified: bytes: 50084 against our 61930.
- svg-dotted-map 2.1.0 is better on main entry bundled with its dependencies, minified: gzip bytes: 14075 against our 43699.
- svg-dotted-map 2.1.0 is better on runtime dependencies in package.json: 0 against our 1.
- svg-dotted-map 2.1.0 is better on packages installed with it (dependencies of dependencies too): 0 against our 7.
- cobe 2.1.0 is better on entry: bytes: 14271 against our 57348.
- cobe 2.1.0 is better on entry: gzip bytes: 6580 against our 41808.
- cobe 2.1.0 is better on entry: brotli bytes: 5799 against our 38356.
- cobe 2.1.0 is better on main entry bundled with its dependencies, minified: bytes: 14329 against our 61930.
- cobe 2.1.0 is better on main entry bundled with its dependencies, minified: gzip bytes: 6640 against our 43699.
- cobe 2.1.0 is better on runtime dependencies in package.json: 0 against our 1.
- cobe 2.1.0 is better on packages installed with it (dependencies of dependencies too): 0 against our 7.
On time, from the timing cells above, which vary between runs and machines:
- dotted-map 3.1.0 is better on world grid, height 60: cached second call (median of 5): 0.027 ms against our 0.043 ms.
- dotted-map 3.1.0 is better on world grid, height 100: cached second call (median of 5): 0.026 ms against our 0.045 ms.