Skip to content

Block 274 of 297

Density Map

A stylized where-we-work heat map: weighted places glow with contour bands, mirrored as an accessible list.

Puck key
DensityMapBlock
Export
densityMapBlock
React component
<DensityMap />
Files
components/puck/density-map-block.tsx
components/puck/density-map.client.tsx
Dependencies
vgpu
License
MIT

About this block

When to use it, how to write for it, and what to change in the code.

What it's for

A two-part section with a ranked list of up to eight places on the left and a schematic heat map on the right, where each place glows by its figure. Hovering sharpens nearby hotspots. It is a positioned diagram, not a geographic map. On phones the list stacks above the map and map labels shrink to numbered markers.

  • Showing where a city repair or service program reached
  • Neighborhood-level outreach or enrollment in a grant report
  • Comparing activity across sites, branches or campuses
Writing the content
  • Place each point with Across and Down (0 to 100 from the top left). Points past 70 across flip their label to the left.
  • Figure takes a number and accepts data-source tokens; the largest figure sets full intensity and others scale from it.
  • Fill in What the numbers count, such as "homes repaired"; it appears under the list and is read with each figure.
  • Places without a Name are dropped. Use the Source line to note that positions are schematic.
Accessibility
  • Every place is also an ordered list with its figure in text, so the map never carries information alone (WCAG 1.1.1).
  • The canvas and map markers are aria-hidden, and the figure carries a screen-reader caption pointing to the list.
  • Reduced motion gives a still map with no lens; the map pauses its animation when scrolled away.
Customizing the code
  • Requires vgpu and density-map.client.tsx. Glow size comes from sigma in the point loop, and the 10.0 in bands = v * 10.0 sets contour spacing.
  • Map shape is aspect-4/3, then sm:aspect-16/10; the list bars use bg-indigo-500 to match the default glow color.

Editor fields

What content editors see in the P1 sidebar when they select this block.

  • Eyebrowtext
  • Headingtextarea
  • Heading levelselect
  • Introtextarea
  • What the numbers counttext
  • Placesarray
  • Source linetext
  • Map colortext
  • Glow colortext
  • Hotspot colortext