All examples By author By category About

gallowayevan

North Carolina map with county name annotations

Simeple example of using d3-annotation to annotate a map with county names. There are a few ways to 'save' this map once you are done.

  1. Open the console (in Chrome) and enter makeAnnotations.json(). This will copy the annotation coordinates to your clipboard. You can then paste these into your code, replacing the dynamically created annotations, e.g.: d3.annotation().type(d3.annotationLabel).annotations(newStaticAnnotations).editMode(true);
  2. You could use something like SVG Crowbar: https://nytimes.github.io/svg-crowbar/
  3. You could just open the dev tools and copy the outer html for the svg element.

If you don't want the connector to appear, just move the subject circle first and align the corresponding label circle over the subject circle. The connector will disappear.