Dotted Map

Create stylized dotted world maps with customizable pins and regions.

Render geographic data as a dot-matrix style map. Add pins to highlight locations, filter by country or region, and customize dot appearance. Ideal for showing global presence, office locations, or geographic distributions.

Basic Usage

Diagonal Grid

The grid prop defines how dots are aligned in the matrix. By default, dots are aligned in a regular vertical grid. Setting it to diagonal creates a staggered, honeycomb-like arrangement.

Grid Configuration

The map uses a grid of dots to represent geographic data. You can control the density and appearance of the grid using mapWidth, mapHeight, and dotSize.

  • Density: Provide either mapHeight or mapWidth to define the number of dots in the grid. The other dimension is calculated automatically to preserve the map's aspect ratio.
  • Dot Size: Use dotSize to control the radius of individual dots. A value of 0.5 creates a grid where dots are perfectly adjacent without overlapping.

Resolution

By adjusting these values together, you can achieve the exact grid layout you want. For example, a larger mapWidth with a smaller dotSize will result in a more detailed, high-resolution map.

<!-- Big dots touching each other -->
<DottedMap
  :map-height="50"
  :dot-size="0.3"
/>

Props

PropTypeDefaultDescription
mapHeightnumberundefinedHeight of the map in dots. Width is calculated automatically to preserve aspect ratio.
mapWidthnumberundefinedWidth of the map in dots. Height is calculated automatically to preserve aspect ratio.
countriesstring[]undefinedArray of ISO 3166-1 alpha-3 country codes to include. If omitted, shows the whole world.
regionMapRegionundefinedSpecific region to display (lat/lng bounds).
grid'vertical' | 'diagonal''vertical'How dots should be aligned.
avoidOuterPinsbooleanfalseIf true, prevents adding pins outside of region/countries.
pinsMapPin[]undefinedArray of pins to place on the map.
precomputedMapstring | objectundefinedPrecomputed map data (JSON) to skip map computation.
colorstring'#ffffff'Default color of the dots.
dotSizenumber0.5Default size (radius) of the dots.
strokeColorstringundefinedStroke color of the dots.
strokeWidthnumberundefinedStroke width of the dots.
strokeOpacitynumberundefinedStroke opacity of the dots.
shape'circle' | 'hexagon''circle'Shape of the dots.
countryColorsRecord<string, string>undefinedCustom colors for specific countries (keyed by ISO code).
backgroundColorstringundefinedBackground color of the map container.