Vector.js

Vector is an open source javascript library for creating interactive graphics. View the repository, run the tests, or meet the team.

Map Module

The Map Module is used to plot geographic data in SVG format. Our library supports GeoJson which is the most popular data standard for representing geographical data. GeoJson can be downloaded from a variety of places off of the internet, or it could be retrieved with a javascript promise. In order to make our examples work on our website, we host a small amount of GeoJson at GeoJson for every country and United States. Some helpful websites for editing and collecting GeoJson are: geojson.io, geojson-maps.

Just like every other element in our library, to create a map you must first create an Interactive object (more information on this).

map(externalData: GeoJSON,featureName:string = null,options: MapOptions = {})

Then you call the map method on that object, and pass in the GeoJson that you want plotted. The other two parameters are optional. The second paramter is featureName. If you only want to plot one specific feature from the data, then pass in that name and only that feature will be rendered. The last parameter is the options parameter. Here you can set some styling on all feature at the time the map is created. For more exact details see our API.

We recommend going to our examples page, and using the maps filter to see some examples of just exactly how our maps work.

We have a variety of helper methods that let you manipulate the paths, viewboxes, and elements of the Map. We do not currently support any form of 3D maps, or projections.