@d3-maps/core / map
map
Table of contents
Functions
makeMapContext()
ts
function makeMapContext(__namedParameters?: MapProps): MapContext;Creates a full MapContext from a MapProps
Parameters
| Parameter | Type |
|---|---|
__namedParameters | MapProps |
Returns
makeProjection()
ts
function makeProjection(__namedParameters: MapProjectionProps): GeoProjection;Creates a configured projection and resolves its fit target.
Parameters
| Parameter | Type |
|---|---|
__namedParameters | MapProjectionProps |
Returns
GeoProjection
Variables
SPHERE
ts
const SPHERE: {
type: "Sphere";
};Type Declaration
type
ts
readonly type: "Sphere" = 'Sphere';Interfaces
MapContext
Fully computed, framework-agnostic map context. Adapters provide this context to child layers.
Properties
MapProjectionProps
Properties
| Property | Type | Description |
|---|---|---|
config? | ProjectionConfig | Projection method arguments passed to the created projection |
fit? | MapFit | Built-in fit source. Defaults to sphere. |
fitObjectKey? | string | TopoJSON object key used when fit is an explicit topology. |
height | number | - |
padding? | number | Padding used by the built-in fit when explicit fit methods are not provided. |
projection | () => GeoProjection | Projection factory from d3-geo (or a compatible implementation). Example: geoNaturalEarth1. |
width | number | - |
MapProps
Shared props contract for the Map component.
Extends
Partial<MapProjectionProps>
Properties
| Property | Type | Description | Inherited from |
|---|---|---|---|
aspectRatio? | number | - | - |
config? | ProjectionConfig | Projection method arguments passed to the created projection | MapProjectionProps.config |
fit? | MapFit | Built-in fit source. Defaults to sphere. | MapProjectionProps.fit |
fitObjectKey? | string | TopoJSON object key used when fit is an explicit topology. | MapProjectionProps.fitObjectKey |
height? | number | - | MapProjectionProps.height |
padding? | number | Padding used by the built-in fit when explicit fit methods are not provided. | MapProjectionProps.padding |
projection? | () => GeoProjection | Projection factory from d3-geo (or a compatible implementation). Example: geoNaturalEarth1. | MapProjectionProps.projection |
projectionConfig? | ProjectionConfig | - | - |
width? | number | - | MapProjectionProps.width |
ProjectionConfig
Extra projection method calls to apply before rendering. Use projection method names as keys and method arguments as values.
Example: { center: [[0, 20]], rotate: [[0, 0, 0]], scale: 160 }
See
https://d3js.org/d3-geo/projection
Extends
Omit<MethodsToModifiers<GeoProjection>,"invert"|"stream">
Properties
| Property | Type | Inherited from |
|---|---|---|
angle? | number | [number] |
center? | [[number, number]] | ProjectionConfig.center |
clipAngle? | number | [number] |
clipExtent? | [[[number, number], [number, number]]] | [null] |
fitExtent? | [[[number, number], [number, number]], | GeoGeometryObjects |
fitHeight? | [number, | GeoGeometryObjects |
fitSize? | [[number, number], | GeoGeometryObjects |
fitWidth? | [number, | GeoGeometryObjects |
postclip? | ((stream: GeoStream) => GeoStream) | |
precision? | number | [number] |
preclip? | ((stream: GeoStream) => GeoStream) | |
reflectX? | boolean | [false] |
reflectY? | boolean | [false] |
rotate? | [[number, number]] | [[number, number, number]] |
scale? | number | [number] |
translate? | [[number, number]] | ProjectionConfig.translate |
Type Aliases
MapFit
ts
type MapFit = "sphere" | "manual" | MapData;