D3js Map

Component ID

2041529

Component name

D3js Map

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Component created

Component changed

Component body

This is a module I created as a feature for a project; a feature that was cut out from release. It parses a JSON file created by the module and outputs an SVG map of the United States.

Some currently implemented features include:

- Ability to color each state individually, or in groups
- A map key that links to the smaller states in the northeast
- Clickable SVG elements that take you to another location (currently, to a site for each state's anti-bullying website)
- Completely scalable, as it is an SVG
- Fallback to r2d3 library, for IE8 and those other browsers and devices that give us headaches

My plans for the future include:

- Breaking up the JSON file into a minimum of two separate files: One for drawing the map, and another for actual data pertaining to each element
- Refactoring the code so that it will easily be able to draw any set of coordinates (not just the USA).
- Standardizing the default JSON structure

My primary job has moved away from Drupal, so I am not as invested in keeping this up to date. If you're interested in becoming a co-maintainer, please contact me.

Special thanks goes to Ben Tesser, a former colleague who helped me iron out some of the more annoying features (like the map key), and to Wes and Sean, who turned my original standalone code into a module. Thanks!