Struct plotly::layout::Annotation [−][src]
pub struct Annotation { /* fields omitted */ }
Implementations
Determines whether or not this annotation is visible.
Sets the angle at which the text
is drawn with respect to the horizontal.
Sets the annotation text font.
Sets an explicit width for the text box. null (default) lets the text set the box width.
Wider text will be clipped. There is no automatic wrapping; use
to start a new line.
Sets an explicit height for the text box. null (default) lets the text set the box height. Taller text will be clipped.
Sets the opacity of the annotation (text + arrow).
Sets the horizontal alignment of the text
within the box. Has an effect only if text
spans two or more lines (i.e. text
contains one or more
HTML tags) or if an explicit
width is set to override the text width.
Sets the vertical alignment of the text
within the box. Has an effect only if an explicit
height is set to override the text height.
Sets the background color of the annotation.
Sets the color of the border enclosing the annotation text
.
Sets the padding (in px) between the text
and the enclosing border.
Sets the width (in px) of the border enclosing the annotation text
.
Determines whether or not the annotation is drawn with an arrow. If “True”, text
is
placed near the arrow’s tail. If “False”, text
lines up with the x
and y
provided.
Sets the color of the annotation arrow.
Sets the end annotation arrow head style. Integer between or equal to 0 and 8.
Sets the start annotation arrow head style. Integer between or equal to 0 and 8.
Sets the annotation arrow head position.
Sets the size of the end annotation arrow head, relative to arrowwidth
. A value of 1
(default) gives a head about 3x as wide as the line.
Sets the size of the start annotation arrow head, relative to arrowwidth
. A value of 1
(default) gives a head about 3x as wide as the line.
Sets the width (in px) of annotation arrow line.
Sets a distance, in pixels, to move the end arrowhead away from the position it is pointing
at, for example to point at the edge of a marker independent of zoom. Note that this
shortens the arrow from the ax
/ ay
vector, in contrast to xshift
/ yshift
which
moves everything by this amount.
Sets a distance, in pixels, to move the start arrowhead away from the position it is
pointing at, for example to point at the edge of a marker independent of zoom. Note that
this shortens the arrow from the ax
/ ay
vector, in contrast to xshift
/ yshift
which moves everything by this amount.
Sets the x component of the arrow tail about the arrow head. If axref
is pixel
, a
positive (negative) component corresponds to an arrow pointing from right to left (left
to right). If axref
is an axis, this is an absolute value on that axis, like x
, NOT a
relative value.
Sets the y component of the arrow tail about the arrow head. If ayref
is pixel
, a
positive (negative) component corresponds to an arrow pointing from bottom to top (top to
bottom). If ayref
is an axis, this is an absolute value on that axis, like y
, NOT a
relative value.
Indicates in what terms the tail of the annotation (ax,ay) is specified. If pixel
, ax
is a relative offset in pixels from x
. If set to an x axis id (e.g. “x” or “x2”), ax
is
specified in the same terms as that axis. This is useful for trendline annotations which
should continue to indicate the correct trend when zoomed.
Indicates in what terms the tail of the annotation (ax,ay) is specified. If pixel
, ay
is a relative offset in pixels from y
. If set to a y axis id (e.g. “y” or “y2”), ay
is
specified in the same terms as that axis. This is useful for trendline annotations which
should continue to indicate the correct trend when zoomed.
Sets the annotation’s x coordinate axis. If set to an x axis id (e.g. “x” or “x2”), the x
position refers to an x coordinate If set to “paper”, the x
position refers to the
distance from the left side of the plotting area in normalized coordinates where 0 (1)
corresponds to the left (right) side.
Sets the annotation’s x position. If the axis type
is “log”, then you must take the log
of your desired range. If the axis type
is “date”, it should be date strings, like date
data, though Date objects and unix milliseconds will be accepted and converted to strings.
If the axis type
is “category”, it should be numbers, using the scale where each category
is assigned a serial number from zero in the order it appears.
Sets the text box’s horizontal position anchor This anchor binds the x
position to the
“left”, “center” or “right” of the annotation. For example, if x
is set to 1, xref
to
“paper” and xanchor
to “right” then the right-most portion of the annotation lines up with
the right-most edge of the plotting area. If “auto”, the anchor is equivalent to “center”
for data-referenced annotations or if there is an arrow, whereas for paper-referenced with
no arrow, the anchor picked corresponds to the closest side.
Shifts the position of the whole annotation and arrow to the right (positive) or left (negative) by this many pixels.
Sets the annotation’s y coordinate axis. If set to an y axis id (e.g. “y” or “y2”), the y
position refers to an y coordinate If set to “paper”, the y
position refers to the
distance from the bottom of the plotting area in normalized coordinates where 0 (1)
corresponds to the bottom (top).
Sets the annotation’s y position. If the axis type
is “log”, then you must take the log of
your desired range. If the axis type
is “date”, it should be date strings, like date data,
though Date objects and unix milliseconds will be accepted and converted to strings. If the
axis type
is “category”, it should be numbers, using the scale where each category is
assigned a serial number from zero in the order it appears.
Sets the text box’s vertical position anchor This anchor binds the y
position to the
“top”, “middle” or “bottom” of the annotation. For example, if y
is set to 1, yref
to
“paper” and yanchor
to “top” then the top-most portion of the annotation lines up with the
top-most edge of the plotting area. If “auto”, the anchor is equivalent to “middle” for
data-referenced annotations or if there is an arrow, whereas for paper-referenced with no
arrow, the anchor picked corresponds to the closest side.
Shifts the position of the whole annotation and arrow up (positive) or down (negative) by this many pixels.
Makes this annotation respond to clicks on the plot. If you click a data point that exactly
matches the x
and y
values of this annotation, and it is hidden (visible: false), it
will appear. In “onoff” mode, you must click the same point again to make it disappear, so
if you click multiple points, you can show multiple annotations. In “onout” mode, a click
anywhere else in the plot (on another data point or not) will hide this annotation. If you
need to show/hide this annotation in response to different x
or y
values, you can set
xclick
and/or yclick
. This is useful for example to label the side of a bar. To label
markers though, standoff
is preferred over xclick
and yclick
.
Toggle this annotation when clicking a data point whose x
value is xclick
rather than
the annotation’s x
value.
Toggle this annotation when clicking a data point whose y
value is yclick
rather than
the annotation’s y
value.
Sets text to appear when hovering over this annotation. If omitted or blank, no hover label will appear.
Label displayed on mouse hover.
Determines whether the annotation text box captures mouse move and click events, or allows
those events to pass through to data points in the plot that may be behind the annotation.
By default captureevents
is “false” unless hovertext
is provided. If you use the event
plotly_clickannotation
without hovertext
you must explicitly enable captureevents
.
When used in a template, named items are created in the output figure in addition to any
items the figure already has in this array. You can modify these items in the output figure
by making your own item with templateitemname
matching this name
alongside your
modifications (including visible: false
or enabled: false
to hide it). Has no effect
outside of a template.
Used to refer to a named item in this array in the template. Named items from the template
will be created even without a matching item in the input figure, but you can modify one by
making an item with templateitemname
matching its name
, alongside your modifications
(including visible: false
or enabled: false
to hide it). If there is no template or no
matching item, this item will be hidden unless you explicitly show it with visible: true
.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Annotation
impl Send for Annotation
impl Sync for Annotation
impl Unpin for Annotation
impl UnwindSafe for Annotation
Blanket Implementations
Mutably borrows from an owned value. Read more
fn fmt_binary(self) -> FmtBinary<Self> where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self> where
Self: Binary,
Causes self
to use its Binary
implementation when Debug
-formatted.
fn fmt_display(self) -> FmtDisplay<Self> where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self> where
Self: Display,
Causes self
to use its Display
implementation when
Debug
-formatted. Read more
fn fmt_lower_exp(self) -> FmtLowerExp<Self> where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self> where
Self: LowerExp,
Causes self
to use its LowerExp
implementation when
Debug
-formatted. Read more
fn fmt_lower_hex(self) -> FmtLowerHex<Self> where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self> where
Self: LowerHex,
Causes self
to use its LowerHex
implementation when
Debug
-formatted. Read more
Causes self
to use its Octal
implementation when Debug
-formatted.
fn fmt_pointer(self) -> FmtPointer<Self> where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self> where
Self: Pointer,
Causes self
to use its Pointer
implementation when
Debug
-formatted. Read more
fn fmt_upper_exp(self) -> FmtUpperExp<Self> where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self> where
Self: UpperExp,
Causes self
to use its UpperExp
implementation when
Debug
-formatted. Read more
fn fmt_upper_hex(self) -> FmtUpperHex<Self> where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self> where
Self: UpperHex,
Causes self
to use its UpperHex
implementation when
Debug
-formatted. Read more
impl<T> Pipe for T where
T: ?Sized,
impl<T> Pipe for T where
T: ?Sized,
Pipes by value. This is generally the method you want to use. Read more
Borrows self
and passes that borrow into the pipe function. Read more
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R where
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R where
R: 'a,
Mutably borrows self
and passes that borrow into the pipe function. Read more
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R where
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R where
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
Borrows self
, then passes self.borrow()
into the pipe function. Read more
fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R where
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R where
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
Mutably borrows self
, then passes self.borrow_mut()
into the pipe
function. Read more
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R where
Self: AsRef<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R where
Self: AsRef<U>,
U: 'a + ?Sized,
R: 'a,
Borrows self
, then passes self.as_ref()
into the pipe function.
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R where
Self: AsMut<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R where
Self: AsMut<U>,
U: 'a + ?Sized,
R: 'a,
Mutably borrows self
, then passes self.as_mut()
into the pipe
function. Read more
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Deref<Target = T>,
T: 'a + ?Sized,
R: 'a,
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Deref<Target = T>,
T: 'a + ?Sized,
R: 'a,
Borrows self
, then passes self.deref()
into the pipe function.
fn pipe_as_ref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: AsRef<T>,
T: 'a,
R: 'a,
fn pipe_as_ref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: AsRef<T>,
T: 'a,
R: 'a,
Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more
fn pipe_as_mut<'a, T, R>(&'a mut self, func: impl FnOnce(&'a mut T) -> R) -> R where
Self: AsMut<T>,
T: 'a,
R: 'a,
fn pipe_as_mut<'a, T, R>(&'a mut self, func: impl FnOnce(&'a mut T) -> R) -> R where
Self: AsMut<T>,
T: 'a,
R: 'a,
Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more
fn pipe_borrow<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Borrow<T>,
T: 'a,
R: 'a,
fn pipe_borrow<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Borrow<T>,
T: 'a,
R: 'a,
Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more
fn pipe_borrow_mut<'a, T, R>(
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: BorrowMut<T>,
T: 'a,
R: 'a,
fn pipe_borrow_mut<'a, T, R>(
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: BorrowMut<T>,
T: 'a,
R: 'a,
Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more
fn pipe_deref<'a, R>(&'a self, func: impl FnOnce(&'a Self::Target) -> R) -> R where
Self: Deref,
R: 'a,
fn pipe_deref<'a, R>(&'a self, func: impl FnOnce(&'a Self::Target) -> R) -> R where
Self: Deref,
R: 'a,
Pipes a dereference into a function that cannot normally be called in suffix position. Read more
fn pipe_deref_mut<'a, R>(
&'a mut self,
func: impl FnOnce(&'a mut Self::Target) -> R
) -> R where
Self: DerefMut,
R: 'a,
fn pipe_deref_mut<'a, R>(
&'a mut self,
func: impl FnOnce(&'a mut Self::Target) -> R
) -> R where
Self: DerefMut,
R: 'a,
Pipes a mutable dereference into a function that cannot normally be called in suffix position. Read more
Pipes a reference into a function that cannot ordinarily be called in suffix position. Read more
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
Immutable access to the Borrow<B>
of a value. Read more
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
Mutable access to the BorrowMut<B>
of a value. Read more
Immutable access to the AsRef<R>
view of a value. Read more
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
Mutable access to the AsMut<R>
view of a value. Read more
Immutable access to the Deref::Target
of a value. Read more
Mutable access to the Deref::Target
of a value. Read more
Calls .tap()
only in debug builds, and is erased in release builds.
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls .tap_mut()
only in debug builds, and is erased in release
builds. Read more
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
Calls .tap_borrow()
only in debug builds, and is erased in release
builds. Read more
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
Calls .tap_borrow_mut()
only in debug builds, and is erased in release
builds. Read more
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized,
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized,
Calls .tap_ref()
only in debug builds, and is erased in release
builds. Read more
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
Calls .tap_ref_mut()
only in debug builds, and is erased in release
builds. Read more
Provides immutable access for inspection. Read more
Calls tap
in debug builds, and does nothing in release builds.
Provides mutable access for modification. Read more
fn tap_mut_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
fn tap_mut_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
Calls tap_mut
in debug builds, and does nothing in release builds.
impl<T, U> TapAsRef<U> for T where
U: ?Sized,
impl<T, U> TapAsRef<U> for T where
U: ?Sized,
Provides immutable access to the reference for inspection.
fn tap_ref_dbg<F, R>(self, func: F) -> Self where
Self: AsRef<T>,
F: FnOnce(&T) -> R,
fn tap_ref_dbg<F, R>(self, func: F) -> Self where
Self: AsRef<T>,
F: FnOnce(&T) -> R,
Calls tap_ref
in debug builds, and does nothing in release builds.
fn tap_ref_mut<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
fn tap_ref_mut<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
Provides mutable access to the reference for modification.
fn tap_ref_mut_dbg<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
fn tap_ref_mut_dbg<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
Calls tap_ref_mut
in debug builds, and does nothing in release builds.
impl<T, U> TapBorrow<U> for T where
U: ?Sized,
impl<T, U> TapBorrow<U> for T where
U: ?Sized,
fn tap_borrow<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
fn tap_borrow<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
Provides immutable access to the borrow for inspection. Read more
fn tap_borrow_dbg<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
fn tap_borrow_dbg<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
Calls tap_borrow
in debug builds, and does nothing in release builds.
fn tap_borrow_mut<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
fn tap_borrow_mut<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
Provides mutable access to the borrow for modification.
fn tap_borrow_mut_dbg<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
fn tap_borrow_mut_dbg<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
Calls tap_borrow_mut
in debug builds, and does nothing in release
builds. Read more
Immutably dereferences self
for inspection.
fn tap_deref_dbg<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
fn tap_deref_dbg<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
Calls tap_deref
in debug builds, and does nothing in release builds.
fn tap_deref_mut<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
fn tap_deref_mut<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
Mutably dereferences self
for modification.
fn tap_deref_mut_dbg<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
fn tap_deref_mut_dbg<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
Calls tap_deref_mut
in debug builds, and does nothing in release
builds. Read more