Struct vega_lite_4::Projection

source ·
pub struct Projection {
Show 24 fields pub center: Option<Vec<f64>>, pub clip_angle: RemovableValue<f64>, pub clip_extent: RemovableValue<Vec<Vec<f64>>>, pub coefficient: Option<f64>, pub distance: Option<f64>, pub extent: Option<Vec<Vec<f64>>>, pub fit: Option<Value>, pub fraction: Option<f64>, pub lobes: Option<f64>, pub parallel: Option<f64>, pub parallels: Option<Vec<f64>>, pub point_radius: Option<f64>, pub precision: Option<f64>, pub radius: Option<f64>, pub ratio: Option<f64>, pub reflect_x: Option<bool>, pub reflect_y: Option<bool>, pub rotate: Option<Vec<f64>>, pub scale: Option<f64>, pub size: Option<Vec<f64>>, pub spacing: Option<f64>, pub tilt: Option<f64>, pub translate: Option<Vec<f64>>, pub projection_type: Option<ProjectionType>,
}
Expand description

Projection configuration, which determines default properties for all projections. For a full list of projection configuration options, please see the corresponding section of the projection documentation.

Any property of Projection can be in config

An object defining properties of geographic projection, which will be applied to shape path for "geoshape" marks and to latitude and "longitude" channels for other marks.

An object defining properties of the geographic projection shared by underlying layers.

Fields§

§center: Option<Vec<f64>>

The projection’s center, a two-element array of longitude and latitude in degrees.

Default value: [0, 0]

§clip_angle: RemovableValue<f64>

The projection’s clipping circle radius to the specified angle in degrees. If null, switches to antimeridian cutting rather than small-circle clipping.

§clip_extent: RemovableValue<Vec<Vec<f64>>>

The projection’s viewport clip extent to the specified bounds in pixels. The extent bounds are specified as an array [[x0, y0], [x1, y1]], where x0 is the left-side of the viewport, y0 is the top, x1 is the right and y1 is the bottom. If null, no viewport clipping is performed.

§coefficient: Option<f64>§distance: Option<f64>§extent: Option<Vec<Vec<f64>>>§fit: Option<Value>§fraction: Option<f64>§lobes: Option<f64>§parallel: Option<f64>§parallels: Option<Vec<f64>>

For conic projections, the two standard parallels that define the map layout. The default depends on the specific conic projection used.

§point_radius: Option<f64>

The default radius (in pixels) to use when drawing GeoJSON Point and MultiPoint geometries. This parameter sets a constant default value. To modify the point radius in response to data, see the corresponding parameter of the GeoPath and GeoShape transforms.

Default value: 4.5

§precision: Option<f64>

The threshold for the projection’s adaptive resampling to the specified value in pixels. This value corresponds to the Douglas–Peucker distance. If precision is not specified, returns the projection’s current resampling precision which defaults to √0.5 ≅ 0.70710….

§radius: Option<f64>§ratio: Option<f64>§reflect_x: Option<bool>§reflect_y: Option<bool>§rotate: Option<Vec<f64>>

The projection’s three-axis rotation to the specified angles, which must be a two- or three-element array of numbers [lambda, phi, gamma] specifying the rotation angles in degrees about each spherical axis. (These correspond to yaw, pitch and roll.)

Default value: [0, 0, 0]

§scale: Option<f64>

The projection’s scale (zoom) factor, overriding automatic fitting. The default scale is projection-specific. The scale factor corresponds linearly to the distance between projected points; however, scale factor values are not equivalent across projections.

§size: Option<Vec<f64>>§spacing: Option<f64>§tilt: Option<f64>§translate: Option<Vec<f64>>

The projection’s translation offset as a two-element array [tx, ty].

§projection_type: Option<ProjectionType>

The cartographic projection to use. This value is case-insensitive, for example "albers" and "Albers" indicate the same projection type. You can find all valid projection types in the documentation.

Default value: mercator

Trait Implementations§

source§

impl Clone for Projection

source§

fn clone(&self) -> Projection

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Projection

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Projection

source§

fn default() -> Projection

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for Projection

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for Projection

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,