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)#
投影配置架构包装。
- Parameters:
- centerdict, Sequence[float],
ExprRef,Vector2number 投影中心,一个包含经度和纬度的两个元素数组,单位为度。
默认值:
[0, 0]- clipAngledict, float,
ExprRef 投影的剪裁圆半径到指定的角度(以度为单位)。如果
null,则切换到反子午线切割而不是小圆剪裁。- clipExtentdict,
ExprRef,向量2向量2数字, 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)转换为度数。如果还应用了倾斜,则可能需要更保守的裁剪。默认值:
2.0- extentdict,
ExprRef,向量2向量2数字, 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,gingery, 或healpix。默认值根据投影类型而变化。- paralleldict, float,
ExprRef 支持并行参数的投影:
armadillo,bonne,craig,cylindricalEqualArea,cylindricalStereographic,hammerRetroazimuthal,loximuthal, 或rectangularPolyconic。默认值取决于投影类型。- parallelsdict, Sequence[float],
ExprRef 对于锥形投影,定义地图布局的 两个标准平行线。默认值取决于使用的特定锥形投影。
- pointRadiusdict, float,
ExprRef 绘制 GeoJSON
Point和MultiPoint几何图形时使用的默认半径(以像素为单位)。该参数设置了一个常量默认值。要根据数据修改点半径,请参见 GeoPath 和 GeoShape 转换的相应参数。默认值:
4.5- precisiondict, float,
ExprRef 投影的自适应重采样到指定像素值的阈值。这个值对应于道格拉斯-普克距离。如果未指定精度,则返回投影当前的重采样精度,默认为
√0.5 ≅ 0.70710…。- radiusdict, float,
ExprRef airy或gingery投影的半径参数。默认值依据投影类型而异。- ratiodict, float,
ExprRef 用于
hill、hufnagel或wagner投影的比例参数。默认值根据投影类型而有所不同。- reflectXbool, dict,
ExprRef 设置x维度是否在输出中被反射(否定)。
- reflectYbool, dict,
ExprRef 设置y维度是否在输出中被反射(取反)。
- rotatedict, Sequence[float],
ExprRef,Vector2number,Vector3number 投影的三轴旋转到指定的角度,这些角度必须是一个包含两个或三个元素的数字数组 [
lambda,phi,gamma],指定关于每个球面轴的旋转角度(以度为单位)。 (这些对应于偏航、俯仰和滚转。)默认值:
[0, 0, 0]- scaledict, float,
ExprRef 投影的缩放因子,覆盖自动适应。默认缩放因子是特定于投影的。缩放因子与投影点之间的距离成线性对应;然而,不同投影的缩放因子值并不等同。
- 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
- centerdict, Sequence[float],
- __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__([中心, 裁剪角度, 裁剪范围, …])copy([深度, 忽略])返回对象的副本。
from_dict(dct[, validate])从字典表示构造类。
from_json(json_string[, validate])从有效的 JSON 字符串实例化对象。
resolve_references([schema])解析此对象的架构或根架构中的引用。
to_dict([validate, ignore, context])返回对象的字典表示。
to_json([validate, indent, sort_keys, ...])以字符串形式输出该对象的 JSON 表示。
validate(instance[, schema])在rootschema的上下文中验证实例是否符合类模式。
validate_property(name, value[, schema])在根架构的上下文中,根据属性架构验证一个属性。