A newer version of this page is available. Switch to the current version.

jQuery Common - Utils - viz - map

An object that serves as a namespace for the VectorMap widget.

projection

A namespace with methods that manipulate map projections.

import { projection } from "devextreme/viz/vector_map/projection"

projection(data)

Creates a new projection.

import { projection } from "devextreme/viz/vector_map/projection"
Parameters:
data:

Object

An object specifying the conversion functions.

Object structure:
Name Type Description
aspectRatio

Number

The projection's aspect ratio.

from

Function

The function that converts coordinates from the [-1, 1] * [-1, 1] space to the data space.

to

Function

The function that converts coordinates from a data space to [-1, 1] * [-1, 1] space.

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 widget.

View Demo