pub struct Plot3D<'a> { /* private fields */ }Expand description
The 3D plot builder. Add series, then call show with the icon cache and a
Plot3DState.
Implementations§
Source§impl<'a> Plot3D<'a>
impl<'a> Plot3D<'a>
Sourcepub fn config(self, config: Plot3DConfig) -> Self
pub fn config(self, config: Plot3DConfig) -> Self
Replace the whole appearance.
Sourcepub fn current_config(&self) -> &Plot3DConfig
pub fn current_config(&self) -> &Plot3DConfig
The current appearance.
Sourcepub fn series_names(&self) -> Vec<String>
pub fn series_names(&self) -> Vec<String>
The names of the series, in drawing order.
Sourcepub fn series(self, series: Series3D<'a>) -> Self
pub fn series(self, series: Series3D<'a>) -> Self
Add a series. Series draw in order; the palette color follows the order too.
Sourcepub fn x_limits(self, min: Option<f64>, max: Option<f64>) -> Self
pub fn x_limits(self, min: Option<f64>, max: Option<f64>) -> Self
Fixed x limits in data units.
Sourcepub fn y_limits(self, min: Option<f64>, max: Option<f64>) -> Self
pub fn y_limits(self, min: Option<f64>, max: Option<f64>) -> Self
Fixed y limits in data units.
Sourcepub fn z_limits(self, min: Option<f64>, max: Option<f64>) -> Self
pub fn z_limits(self, min: Option<f64>, max: Option<f64>) -> Self
Fixed z limits in data units.
Sourcepub fn height(self, height: f32) -> Self
pub fn height(self, height: f32) -> Self
Fixed height; fills the available height otherwise (320 pt in scroll areas).
Sourcepub fn legend(self, legend: LegendPosition) -> Self
pub fn legend(self, legend: LegendPosition) -> Self
Legend corner, or LegendPosition::Hidden.
Sourcepub fn legend_hover(self, config: LegendHoverConfig) -> Self
pub fn legend_hover(self, config: LegendHoverConfig) -> Self
Replace the legend hover animation settings.
Sourcepub fn legend_animation(self, animation: LegendAnimation) -> Self
pub fn legend_animation(self, animation: LegendAnimation) -> Self
The animation played while the pointer rests on a legend row.
Sourcepub fn direction(self, config: DirectionArrowConfig) -> Self
pub fn direction(self, config: DirectionArrowConfig) -> Self
Replace the direction-arrow settings.
Sourcepub fn direction_arrow(self, show: bool) -> Self
pub fn direction_arrow(self, show: bool) -> Self
Show or hide the direction arrow beside the newest line point.
Sourcepub fn direction_points(self, points: usize) -> Self
pub fn direction_points(self, points: usize) -> Self
How many trailing samples measure the direction arrow.
Sourcepub fn projection(self, projection: Projection) -> Self
pub fn projection(self, projection: Projection) -> Self
Perspective or orthographic.
Sourcepub fn camera_angles(self, yaw: f32, pitch: f32) -> Self
pub fn camera_angles(self, yaw: f32, pitch: f32) -> Self
Initial yaw and pitch in radians.
Sourcepub fn surface(self, config: Surface3DConfig) -> Self
pub fn surface(self, config: Surface3DConfig) -> Self
Replace the surface fill and wireframe settings.
Sourcepub fn toolbar(self, toolbar: bool) -> Self
pub fn toolbar(self, toolbar: bool) -> Self
Show the tool buttons in the top-right corner (on by default).
Show a settings button in the toolbar.
Show an SVG/PNG export menu in the toolbar.
Source§impl Plot3D<'_>
impl Plot3D<'_>
Sourcepub fn to_svg(
&self,
ctx: &Context,
state: &Plot3DState,
options: &ExportOptions,
) -> String
pub fn to_svg( &self, ctx: &Context, state: &Plot3DState, options: &ExportOptions, ) -> String
The 3D plot as a standalone SVG document.
Sourcepub fn to_png(
&self,
ctx: &Context,
state: &Plot3DState,
options: &ExportOptions,
) -> Result<Vec<u8>, String>
pub fn to_png( &self, ctx: &Context, state: &Plot3DState, options: &ExportOptions, ) -> Result<Vec<u8>, String>
The 3D plot as PNG bytes at options.scale pixels per point.
§Errors
When the image is too large to allocate or encoding fails.
Source§impl<'a> Plot3D<'a>
impl<'a> Plot3D<'a>
Sourcepub fn show(
self,
ui: &mut Ui,
icons: &mut Icons,
state: &mut Plot3DState,
) -> Plot3DResponse
pub fn show( self, ui: &mut Ui, icons: &mut Icons, state: &mut Plot3DState, ) -> Plot3DResponse
Paint the plot and handle its interaction.
Trait Implementations§
Source§impl IconComponent for Plot3D<'_>
impl IconComponent for Plot3D<'_>
Source§type Output = Plot3DResponse
type Output = Plot3DResponse
Auto Trait Implementations§
impl<'a> Forget for Plot3D<'a>
impl<'a> Freeze for Plot3D<'a>where
NonZero<u64>: Freeze,
*const u8 is !null: Freeze,
PhantomData<Series3D<'a>>: Freeze,
PhantomData<u8>: Freeze,
PhantomData<String>: Freeze,
PhantomData<Series3DStyle>: Freeze,
impl<'a> Move for Plot3D<'a>
impl<'a> RefUnwindSafe for Plot3D<'a>
impl<'a> Send for Plot3D<'a>
impl<'a> Sync for Plot3D<'a>
impl<'a> Unpin for Plot3D<'a>
impl<'a> UnsafeUnpin for Plot3D<'a>where
NonZeroU64Inner: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<Series3D<'a>>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<Series3DStyle>: UnsafeUnpin,
impl<'a> UnwindSafe for Plot3D<'a>where
NonZero<u64>: UnwindSafe,
RawVecInner: UnwindSafe,
&'a [[f64; 3]]: UnwindSafe,
Vec<[f64; 3]>: UnwindSafe,
&'a [f64]: UnwindSafe,
Vec<f64>: 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
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,
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