#[non_exhaustive]pub enum PlotAnnotation {
Text {
at: [f64; 2],
text: String,
size: f32,
color: Option<Color32>,
},
Arrow {
from: [f64; 2],
to: [f64; 2],
color: Option<Color32>,
},
SpanX {
x0: f64,
x1: f64,
color: Option<Color32>,
},
SpanY {
y0: f64,
y1: f64,
color: Option<Color32>,
},
Rect {
min: [f64; 2],
max: [f64; 2],
color: Option<Color32>,
fill: Option<Color32>,
draggable: bool,
},
Ellipse {
center: [f64; 2],
radius: [f64; 2],
color: Option<Color32>,
fill: Option<Color32>,
draggable: bool,
},
Polygon {
points: Vec<[f64; 2]>,
color: Option<Color32>,
fill: Option<Color32>,
draggable: bool,
},
}Expand description
A text note, arrow, span, or region drawn in data coordinates.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Text
Text at a data point.
Fields
Arrow
An arrow from from to to.
SpanX
A vertical span between two x values.
SpanY
A horizontal span between two y values.
Rect
A rectangle region; draggable is honoured by the host editor.
Fields
Ellipse
An ellipse region.
Fields
Polygon
A polygon region.
Implementations§
Source§impl PlotAnnotation
impl PlotAnnotation
Sourcepub fn polygon(points: impl IntoIterator<Item = [f64; 2]>) -> Self
pub fn polygon(points: impl IntoIterator<Item = [f64; 2]>) -> Self
A polygon.
Trait Implementations§
Source§impl Clone for PlotAnnotation
impl Clone for PlotAnnotation
Source§impl Debug for PlotAnnotation
impl Debug for PlotAnnotation
Source§impl<'de> Deserialize<'de> for PlotAnnotation
Available on crate feature serde only.
impl<'de> Deserialize<'de> for PlotAnnotation
Available on crate feature
serde only.Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 PartialEq for PlotAnnotation
impl PartialEq for PlotAnnotation
Source§impl Serialize for PlotAnnotation
Available on crate feature serde only.
impl Serialize for PlotAnnotation
Available on crate feature
serde only.impl StructuralPartialEq for PlotAnnotation
Auto Trait Implementations§
impl Forget for PlotAnnotation
impl Freeze for PlotAnnotation
impl Move for PlotAnnotation
impl RefUnwindSafe for PlotAnnotation
impl Send for PlotAnnotationwhere
RawVecInner: Send,
impl Sync for PlotAnnotationwhere
RawVecInner: Sync,
impl Unpin for PlotAnnotation
impl UnsafeUnpin for PlotAnnotationwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<[f64; 2]>: UnsafeUnpin,
impl UnwindSafe for PlotAnnotationwhere
RawVecInner: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more