Skip to main content

Annotation

Struct Annotation 

Source
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: AnnotationType

What 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

Source

pub fn new(kind: AnnotationType) -> Annotation

An annotation of kind with nothing set.

Source

pub fn point(x: f64, y: f64, label: &str) -> Annotation

A point with a label.

Source

pub fn text(x: f64, y: f64, label: &str) -> Annotation

A label alone at (x, y).

Source

pub fn rect(x: f64, y: f64, width: f64, height: f64) -> Annotation

A rectangle with its corner at (x, y).

Source

pub fn segment(x0: f64, y0: f64, x1: f64, y1: f64) -> Annotation

A straight line from (x0, y0) to (x1, y1).

Source

pub fn check(&self) -> Result<(), Error>

Check that the annotation has what its type needs (a usage error naming what is missing).

Trait Implementations§

Source§

impl Clone for Annotation

Source§

fn clone(&self) -> Annotation

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Annotation

Source§

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

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

impl<'de> Deserialize<'de> for Annotation

Source§

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

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

impl JsonSchema for Annotation

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl PartialEq for Annotation

Source§

fn eq(&self, other: &Annotation) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Annotation

Source§

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

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Annotation

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

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

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where 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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.