Skip to main content
100%

d3fc-label-layout map example

✓ Published0🌍 Public
CColinEberhardt
Last edited Aug 9, 2018
Created on Mar 17, 2016

This example shows a labeled map of the United Kingdom, with city names positioned to avoid overlap and removed when they collide. It adapts Mike Bostock's map tutorial, using d3.geoPath and topojson to render the geography, while d3fc-label-layout's layoutLabel component, combined with layoutGreedy and layoutRemoveOverlaps strategies, places the SVG text labels. The code loads UK map data from a JSON TopoJSON file and uses the d3fc text label component for layout.

AI-generated description

This is a demonstration of the d3fc-label-layout component based on Mike Bostock's Let's Make a Map example. The label layout component provides an easy mechanism for labeling charts and maps in such a way that labels are positioned to avoid collisions, and (optionally) overlapping labels are removed.

mit Licensed

Similar vizzes