pub struct GeoLayout {
pub name: String,
pub regions: Vec<GeoRegionLayout>,
pub transform: Transform2D,
}Expand description
A map, in pixel space.
Fields§
§name: StringThe name of the map.
regions: Vec<GeoRegionLayout>The regions of the map, projected into the chart.
transform: Transform2DThe transform that takes a longitude and a latitude to a point of the chart.
Implementations§
Source§impl GeoLayout
Inherent implementation of GeoLayout.
impl GeoLayout
Inherent implementation of GeoLayout.
Sourcepub fn compute(data: &MapData, rect: BBox, aspect_scale: f64) -> Self
pub fn compute(data: &MapData, rect: BBox, aspect_scale: f64) -> Self
Projects a map into a rectangle of the chart.
The projection is the one ECharts uses: the longitude and the latitude are scaled evenly, and the height of the map is shortened by the aspect scale so that a map of the mid-latitudes does not look stretched sideways. The map is centred in the rectangle and takes most of it.
§Arguments
&MapData- Shared reference to aMapData.BBox- ABBoxparameter.f64- A 64-bit float (f64).
Source§impl GeoLayout
impl GeoLayout
pub fn get_name(&self) -> &String
pub fn get_mut_name(&mut self) -> &mut String
pub fn set_name(&mut self, val: String) -> &mut Self
pub fn get_regions(&self) -> &Vec<GeoRegionLayout>
pub fn get_mut_regions(&mut self) -> &mut Vec<GeoRegionLayout>
pub fn set_regions(&mut self, val: Vec<GeoRegionLayout>) -> &mut Self
pub fn get_transform(&self) -> &Transform2D
pub fn get_mut_transform(&mut self) -> &mut Transform2D
pub fn set_transform(&mut self, val: Transform2D) -> &mut Self
Trait Implementations§
impl StructuralPartialEq for GeoLayout
Auto Trait Implementations§
impl Freeze for GeoLayout
impl RefUnwindSafe for GeoLayout
impl Send for GeoLayout
impl Sync for GeoLayout
impl Unpin for GeoLayout
impl UnsafeUnpin for GeoLayout
impl UnwindSafe for GeoLayout
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more