vega/vega-projection

Name: vega-projection

Owner: Vega

Description: Projections for cartographic mapping.

Created: 2017-08-04 19:44:59.0

Updated: 2017-08-05 04:44:05.0

Pushed: 2017-08-05 04:45:25.0

Homepage: null

Size: 3

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

vega-projection

Projections for cartographic mapping.

This module provides a projection method for managing registered cartographic projections. By default, the projection registry include all projection types provided by the D3 4.0 d3-geo module.

API Reference

# vega.projection(type[, projection]) <>

Registry function for adding and accessing projection constructor functions. The type argument is a String indicating the name of the projection type. If the projection argument is not specified, this method returns the matching projection constructor in the registry, or null if not found. If the projection argument is provided, it must be a projection constructor function to add to the registry under the given type name.

By default, the projection registry includes entries for all projection types provided by D3 4.0's d3-geo module. Projections created using the constructor returned by this method are augmented with the following additional properties:

ercator projection
mercator = vega.projection('mercator');
proj = mercator().translate([400, 200]);
e.type; // 'mercator'
e([0, 0]); // [400, 200] center point

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.