Methods projection(data)

Creates a new projection.

Parameters:
data: Object
An object specifying the conversion functions.
Object structure:
to: function(coordinates)
The function that converts coordinates from data space to [-1, 1] * [-1, 1] space.
from: function(coordinates)
The function that converts coordinates from [-1, 1] * [-1, 1] space to data space.
aspectRatio: Number
The projection's aspect ratio.
Return Value: Object
The projection.

After creating the custom projection, you can add it to the projections storage or assign the returning object to the projection option of the dxVectorMap widget.

View Demo

add(name, projection)

Adds a new projection to the internal projections storage.

Parameters:
name: String
The projection name.
projection: Object
The projection returned by the projection(data) method.

get(name)

Gets the default or custom projection from the projection storage.

Parameters:
name: String
The projection name.
Return Value: Object
The projection.

By default you can get the following projections by their names.

You can also implement your own projection and add it to the projections storage. After that, the custom projection will be available to get using this method.

To apply the projection, assign the returning object to the projection option of the dxVectorMap widget.