pub struct RadialLine<T> { /* private fields */ }Expand description
A radial line generator, like d3.lineRadial.
Points are placed around the center of the plot bounds. The angle
accessor returns the angle in radians, with 0 at 12 o’clock and positive
angles proceeding clockwise. The radius accessor returns the distance
(in pixels) from the center.
Call RadialLine::closed to connect the last point back to the first
(like d3.curveLinearClosed), and RadialLine::fill to fill the
enclosed polygon, e.g. for radar charts.
Unlike Line, the accessors also receive the datum index,
matching d3’s (d, i) accessor form, since radial charts typically derive
the angle from the index (e.g. i * TAU / n).
Implementations§
Source§impl<T> RadialLine<T>
impl<T> RadialLine<T>
pub fn new() -> Self
Sourcepub fn data<I>(self, data: I) -> Selfwhere
I: IntoIterator<Item = T>,
pub fn data<I>(self, data: I) -> Selfwhere
I: IntoIterator<Item = T>,
Set the data of the RadialLine.
Sourcepub fn angle<F>(self, angle: F) -> Self
pub fn angle<F>(self, angle: F) -> Self
Set the angle accessor of the RadialLine.
The accessor is called with the datum and its index, and returns the angle in radians, with 0 at 12 o’clock and positive angles proceeding clockwise.
Sourcepub fn radius<F>(self, radius: F) -> Self
pub fn radius<F>(self, radius: F) -> Self
Set the radius accessor of the RadialLine.
The accessor is called with the datum and its index, and returns the distance (in pixels) from the center.
Sourcepub fn closed(self) -> Self
pub fn closed(self) -> Self
Connect the last point back to the first, like d3.curveLinearClosed.
Sourcepub fn fill(self, fill: impl Into<Background>) -> Self
pub fn fill(self, fill: impl Into<Background>) -> Self
Set the fill color of the polygon enclosed by the RadialLine.
The fill path is always closed, regardless of RadialLine::closed.
Sourcepub fn stroke(self, stroke: impl Into<Background>) -> Self
pub fn stroke(self, stroke: impl Into<Background>) -> Self
Set the stroke color of the RadialLine.
Sourcepub fn stroke_width(self, stroke_width: impl Into<Pixels>) -> Self
pub fn stroke_width(self, stroke_width: impl Into<Pixels>) -> Self
Set the stroke width of the RadialLine.
Sourcepub fn dot_size(self, dot_size: impl Into<Pixels>) -> Self
pub fn dot_size(self, dot_size: impl Into<Pixels>) -> Self
Set the size of the dots on the RadialLine.
Sourcepub fn dot_fill_color(self, dot_fill_color: impl Into<Hsla>) -> Self
pub fn dot_fill_color(self, dot_fill_color: impl Into<Hsla>) -> Self
Set the fill color of the dots on the RadialLine.
Sourcepub fn dot_stroke_color(self, dot_stroke_color: impl Into<Hsla>) -> Self
pub fn dot_stroke_color(self, dot_stroke_color: impl Into<Hsla>) -> Self
Set the stroke color of the dots on the RadialLine.
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for RadialLine<T>
impl<T> !Send for RadialLine<T>
impl<T> !Sync for RadialLine<T>
impl<T> !UnwindSafe for RadialLine<T>
impl<T> Freeze for RadialLine<T>
impl<T> Unpin for RadialLine<T>
impl<T> UnsafeUnpin for RadialLine<T>
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().