MapChart

Type module

Sources

Items from MapChart can be imported/included and used via following ways.

/**
 * --------------------------------------------------------
 * Import via: MapChart.ts
 * Access items like: $mapchart.myVariable
 *                    $mapchart.myFunction()
 * --------------------------------------------------------
 */
import * as $mapchart from "@amcharts/amcharts5/MapChart";

Variables

projectionRegistry
#

Type object

Registry of projections that can be looked up by name via the projectionName setting on MapChart. The am5map entry point populates this with all bundled d3-geo projections. Custom projections can be added via registerProjection().

Functions

registerProjection(

name: string,
factory: () => GeoProjection

)

#

Returns void

Registers a projection factory under the given name so it can be referenced by MapChart's projectionName setting.

Returns a name-tagged factory: use its return value (e.g. const cc = registerProjection("geoConicConformal", geoConicConformal)) as projection: cc() and the chart will round-trip through serialization the same way the bundled projections do.

tagProjection(

name: string,
factory: () => GeoProjection

)

#

Returns void

Wraps a projection factory so the projections it produces carry their registered name. The tag lets ChartSerializer emit a matching projectionName even for charts that set projection directly in code.