1.6.1 • Published 6 months ago

vega-projection v1.6.1

Weekly downloads
86,776
License
BSD-3-Clause
Repository
github
Last release
6 months ago

vega-projection

Projections for cartographic mapping.

This package provides a projection method for managing registered cartographic projections. By default, the projection registry includes all projection types provided by the 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 the d3-geo module. Projections created using the constructor returned by this method are augmented with the following additional properties:

  • type: A string value indicating the projection type.
  • path: A D3 geoPath instance configured to use the projection. When using this path instance, be sure to set the path context as needed.
  • copy: A zero-argument function the produces a copy of the projection.
// mercator projection
var mercator = vega.projection('mercator');
var proj = mercator().translate([400, 200]);
scale.type; // 'mercator'
scale([0, 0]); // [400, 200] center point
1.6.1

6 months ago

1.6.0

2 years ago

1.5.0

3 years ago

1.4.5

4 years ago

1.4.4

4 years ago

1.4.3

4 years ago

1.4.2

5 years ago

1.4.1

5 years ago

1.4.0

5 years ago

1.3.0

5 years ago

1.2.1

6 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago