pub struct Annotation {Show 13 fields
pub kind: AnnotationType,
pub x: Option<f64>,
pub y: Option<f64>,
pub x2: Option<f64>,
pub y2: Option<f64>,
pub width: Option<f64>,
pub height: Option<f64>,
pub points: Vec<[f64; 2]>,
pub label: Option<String>,
pub color: Option<String>,
pub channel: Option<u32>,
pub well: Option<String>,
pub facet: Option<String>,
}Expand description
One annotation, in the coordinates the picture shows: full-resolution pixels on images (as on the rulers), axis units on plots (as on the tick labels), and on plate curve grids the time and value axes every card shares.
Fields§
§kind: AnnotationTypeWhat to draw.
x: Option<f64>point, text: position; box: corner; arrow: tail; vline, vband: x (vband from x to x2).
y: Option<f64>point, text: position; box: corner; arrow: tail; hline, hband: y (hband from y to y2).
x2: Option<f64>arrow: head; vband: other edge.
y2: Option<f64>arrow: head; hband: other edge.
width: Option<f64>box: width.
height: Option<f64>box: height.
points: Vec<[f64; 2]>polygon, line: the vertices, [[x, y], ...].
label: Option<String>Text drawn with the mark (the text itself for type text).
color: Option<String>accent (default, warm red), ink, muted, white, another colour name or #RRGGBB.
channel: Option<u32>Trace previews with several panels: the channel whose panel it goes in (default: the first panel).
well: Option<String>Plate previews: the well (e.g. B3) for type well, or the one card a mark goes in on a
curve grid (default: every card).
facet: Option<String>Plots with small multiples: the one small plot it goes in, by its title (e.g. B3 or
sweep 6; default: every one).
Implementations§
Source§impl Annotation
impl Annotation
Sourcepub fn new(kind: AnnotationType) -> Annotation
pub fn new(kind: AnnotationType) -> Annotation
An annotation of kind with nothing set.
Sourcepub fn rect(x: f64, y: f64, width: f64, height: f64) -> Annotation
pub fn rect(x: f64, y: f64, width: f64, height: f64) -> Annotation
A rectangle with its corner at (x, y).
Trait Implementations§
Source§impl Clone for Annotation
impl Clone for Annotation
Source§fn clone(&self) -> Annotation
fn clone(&self) -> Annotation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Annotation
impl Debug for Annotation
Source§impl<'de> Deserialize<'de> for Annotation
impl<'de> Deserialize<'de> for Annotation
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Annotation, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Annotation, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Annotation
impl JsonSchema for Annotation
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for Annotation
impl PartialEq for Annotation
Source§impl Serialize for Annotation
impl Serialize for Annotation
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for Annotation
Auto Trait Implementations§
impl Freeze for Annotation
impl RefUnwindSafe for Annotation
impl Send for Annotation
impl Sync for Annotation
impl Unpin for Annotation
impl UnsafeUnpin for Annotation
impl UnwindSafe for Annotation
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
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>,
impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
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> ⓘ
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