Skip to main content
100%

D3 Marker Clustering - Shipwrecks

✓ Published0🌍 Public
Aandrew-reid
Last edited Jul 23, 2018
Created on Jul 22, 2018

This visualization displays shipwreck locations as clustered markers on a zoomable map of the Atlantic coast. It combines a Mercator tile basemap (rendered in SVG) with a force-directed clustering algorithm that merges nearby markers into larger circles as the view zooms out, and splits them apart when zooming in. The cluster force is implemented in a custom module (d3-cluster.js) that extends D3's force simulation to absorb overlapping nodes into weighted aggregates, with circle sizes proportional to cluster member counts. An invisible SVG overlay uses D3's quadtree-based collide detection on canvas-rendered markers, which lets the visualization handle large datasets efficiently while preserving geographic context through d3-tile map tiles.

AI-generated description

A more practical geographic use of a clustering module than my initial demonstration.

Each shipwreck is represented with a circle 2 px in radius. Overlapping circles are combined and new centroids are calculated based on a weighted average of their areas. Because of the wandering centroid, the merger of larger circles can result in the clearing of a neighborhood around larger circles - this effect is most noticeable when combining thousands of circles.

Scroll to zoom in/out. Drag to pan.

I'm working on developing the clusterer a bit more, but you can find some initial documentation and source on github.

Shipwreck data hosted by ESRI here.

Similar vizzes