altair.ProjectionConfig#

class altair.ProjectionConfig(center=Undefined, clipAngle=Undefined, clipExtent=Undefined, coefficient=Undefined, distance=Undefined, extent=Undefined, fit=Undefined, fraction=Undefined, lobes=Undefined, parallel=Undefined, parallels=Undefined, pointRadius=Undefined, precision=Undefined, radius=Undefined, ratio=Undefined, reflectX=Undefined, reflectY=Undefined, rotate=Undefined, scale=Undefined, size=Undefined, spacing=Undefined, tilt=Undefined, translate=Undefined, type=Undefined, **kwds)#

ProjectionConfig schema 封装器。

参数:
centerdict, Sequence[float], ExprRef, Vector2number

投影的中心,一个包含经度和纬度(以度为单位)的双元素数组。

默认值: [0, 0]

clipAngledict, float, ExprRef

投影的裁剪圆半径到指定角度(以度为单位)。如果为 null,则切换到反子午线裁剪,而不是小圆裁剪。

clipExtentdict, ExprRef, Vector2Vector2number, Sequence[Sequence[float], Vector2number]

投影视口的裁剪范围,以像素为单位。范围边界指定为一个数组 [[x0, y0], [x1, y1]],其中 x0 是视口的左侧,y0 是顶部,x1 是右侧,y1 是底部。如果为 null,则不执行视口裁剪。

coefficientdict, float, ExprRef

hammer 投影的系数参数。

默认值: 2

distancedict, float, ExprRef

对于 satellite 投影,从球体中心到视点的距离,占球体半径的比例。给定 distance 推荐的最大裁剪角是 acos(1 / distance) 转换为度。如果也应用了 tilt,则可能需要更保守的裁剪。

默认值: 2.0

extentdict, ExprRef, Vector2Vector2number, Sequence[Sequence[float], Vector2number]
fitdict, Fit, ExprRef, GeoJsonFeature, GeoJsonFeatureCollection, Sequence[dict, GeoJsonFeature], Sequence[dict, Fit, GeoJsonFeature, GeoJsonFeatureCollection, Sequence[dict, GeoJsonFeature]]
fractiondict, float, ExprRef

bottomley 投影的分数参数。

默认值: 0.5,对应于 sin(ψ),其中 ψ = π/6。

lobesdict, float, ExprRef

支持多叶视图的投影中的叶数:berghaus, gingeryhealpix。默认值因投影类型而异。

paralleldict, float, ExprRef

支持此参数的投影的 parallel 参数:armadillo, bonne, craig, cylindricalEqualArea, cylindricalStereographic, hammerRetroazimuthal, loximuthalrectangularPolyconic。默认值因投影类型而异。

parallelsdict, Sequence[float], ExprRef

对于圆锥投影,定义地图布局的两个标准纬线。默认值取决于所使用的具体圆锥投影。

pointRadiusdict, float, ExprRef

绘制 GeoJSON PointMultiPoint 几何图形时使用的默认半径(以像素为单位)。此参数设置一个常量默认值。要根据数据修改点半径,请参阅 GeoPath 和 GeoShape 变换的相应参数。

默认值: 4.5

precisiondict, float, ExprRef

投影自适应重采样到指定像素值的阈值。此值对应于 Douglas-Peucker 距离。如果未指定精度,则返回投影当前重采样精度,默认为 √0.5 0.70710…

radiusdict, float, ExprRef

airygingery 投影的半径参数。默认值因投影类型而异。

ratiodict, float, ExprRef

hill, hufnagelwagner 投影的比例参数。默认值因投影类型而异。

reflectXbool, dict, ExprRef

设置输出中的 x 维度是否被翻转(取负)。

reflectYbool, dict, ExprRef

设置输出中的 y 维度是否被翻转(取负)。

rotatedict, Sequence[float], ExprRef, Vector2number, Vector3number

投影围绕三个球轴旋转到指定角度,必须是包含两个或三个数字的数组 [lambda, phi, gamma],以度为单位指定围绕每个球轴的旋转角度。(这些对应于偏航、俯仰和翻滚。)

默认值: [0, 0, 0]

scaledict, float, ExprRef

投影的缩放因子(zoom factor),覆盖自动适应。默认缩放比例因投影而异。缩放因子与投影点之间的距离线性相关;然而,缩放因子值在不同投影之间不等价。

sizedict, Sequence[float], ExprRef, Vector2number

与 fit 结合使用,提供投影应自动适应区域的宽度和高度(以像素为单位)。

spacingdict, float, ExprRef

lagrange 投影的间距参数。

默认值: 0.5

tiltdict, float, ExprRef

satellite 投影的倾斜角(以度为单位)。

默认值: 0

translatedict, Sequence[float], ExprRef, Vector2number

投影的平移偏移,表示为双元素数组 [tx, ty]

typedict, ExprRef, ProjectionType, Literal[‘albers’, ‘albersUsa’, ‘azimuthalEqualArea’, ‘azimuthalEquidistant’, ‘conicConformal’, ‘conicEqualArea’, ‘conicEquidistant’, ‘equalEarth’, ‘equirectangular’, ‘gnomonic’, ‘identity’, ‘mercator’, ‘naturalEarth1’, ‘orthographic’, ‘stereographic’, ‘transverseMercator’]

要使用的地图投影。此值不区分大小写,例如 "albers""Albers" 指示相同的投影类型。你可以在文档中找到所有有效的投影类型。

默认值: equalEarth

__init__(center=Undefined, clipAngle=Undefined, clipExtent=Undefined, coefficient=Undefined, distance=Undefined, extent=Undefined, fit=Undefined, fraction=Undefined, lobes=Undefined, parallel=Undefined, parallels=Undefined, pointRadius=Undefined, precision=Undefined, radius=Undefined, ratio=Undefined, reflectX=Undefined, reflectY=Undefined, rotate=Undefined, scale=Undefined, size=Undefined, spacing=Undefined, tilt=Undefined, translate=Undefined, type=Undefined, **kwds)#

方法

__init__([center, clipAngle, clipExtent, ...])

copy([deep, ignore])

返回对象的副本。

from_dict(dct[, validate])

从字典表示构建类。

from_json(json_string[, validate])

从有效的 JSON 字符串实例化对象。

resolve_references([schema])

在此对象 schema 或根 schema 的上下文中解析引用。

to_dict([validate, ignore, context])

返回对象的字典表示。

to_json([validate, indent, sort_keys, ...])

将此对象的 JSON 表示输出为字符串。

validate(instance[, schema])

在根 schema 的上下文中根据类 schema 验证实例。

validate_property(name, value[, schema])

在根 schema 的上下文中根据属性 schema 验证属性。