Skip to main content

Plot3D

Struct Plot3D 

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

Source

pub fn new(id: impl Hash + Debug) -> Self

A 3D plot with a stable id.

Source

pub fn renderer(self, renderer: Renderer) -> Self

Select the CPU or GPU filled-surface layer.

Source

pub fn config(self, config: Plot3DConfig) -> Self

Replace the whole appearance.

Source

pub fn current_config(&self) -> &Plot3DConfig

The current appearance.

Source

pub fn series_names(&self) -> Vec<String>

The names of the series, in drawing order.

Source

pub fn series(self, series: Series3D<'a>) -> Self

Add a series. Series draw in order; the palette color follows the order too.

Source

pub fn title(self, title: impl Into<String>) -> Self

A title above the frame.

Source

pub fn x_label(self, label: impl Into<String>) -> Self

The x axis title.

Source

pub fn y_label(self, label: impl Into<String>) -> Self

The y axis title.

Source

pub fn z_label(self, label: impl Into<String>) -> Self

The z axis title.

Source

pub fn x_limits(self, min: Option<f64>, max: Option<f64>) -> Self

Fixed x limits in data units.

Source

pub fn y_limits(self, min: Option<f64>, max: Option<f64>) -> Self

Fixed y limits in data units.

Source

pub fn z_limits(self, min: Option<f64>, max: Option<f64>) -> Self

Fixed z limits in data units.

Source

pub fn x_scale(self, scale: Scale) -> Self

Linear or log10 x axis.

Source

pub fn y_scale(self, scale: Scale) -> Self

Linear or log10 y axis.

Source

pub fn z_scale(self, scale: Scale) -> Self

Linear or log10 z axis.

Source

pub fn width(self, width: f32) -> Self

Fixed width; fills the available width otherwise.

Source

pub fn height(self, height: f32) -> Self

Fixed height; fills the available height otherwise (320 pt in scroll areas).

Source

pub fn legend(self, legend: LegendPosition) -> Self

Legend corner, or LegendPosition::Hidden.

Source

pub fn legend_hover(self, config: LegendHoverConfig) -> Self

Replace the legend hover animation settings.

Source

pub fn legend_animation(self, animation: LegendAnimation) -> Self

The animation played while the pointer rests on a legend row.

Source

pub fn direction(self, config: DirectionArrowConfig) -> Self

Replace the direction-arrow settings.

Source

pub fn direction_arrow(self, show: bool) -> Self

Show or hide the direction arrow beside the newest line point.

Source

pub fn direction_points(self, points: usize) -> Self

How many trailing samples measure the direction arrow.

Source

pub fn projection(self, projection: Projection) -> Self

Perspective or orthographic.

Source

pub fn camera_angles(self, yaw: f32, pitch: f32) -> Self

Initial yaw and pitch in radians.

Source

pub fn fov(self, fov: f32) -> Self

Vertical field of view in degrees.

Source

pub fn surface(self, config: Surface3DConfig) -> Self

Replace the surface fill and wireframe settings.

Source

pub fn grid(self, grid: bool) -> Self

Draw the grid (on by default).

Source

pub fn toolbar(self, toolbar: bool) -> Self

Show the tool buttons in the top-right corner (on by default).

Source

pub fn include(self, point: [f64; 3]) -> Self

Keep point inside the automatic view.

Source

pub fn settings_button(self, show: bool) -> Self

Show a settings button in the toolbar.

Source

pub fn export_button(self, show: bool) -> Self

Show an SVG/PNG export menu in the toolbar.

Source§

impl Plot3D<'_>

Source

pub fn to_svg( &self, ctx: &Context, state: &Plot3DState, options: &ExportOptions, ) -> String

The 3D plot as a standalone SVG document.

Source

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>

Source

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<'a> Clone for Plot3D<'a>

Source§

fn clone(&self) -> Self

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 IconComponent for Plot3D<'_>

Source§

type Output = Plot3DResponse

What the component returns after painting.
Source§

fn show(self, ui: &mut Ui, icons: &mut Icons) -> Plot3DResponse

Paint the component with the application’s icon cache.

Auto Trait Implementations§

§

impl<'a> Forget for Plot3D<'a>

§

impl<'a> Freeze for Plot3D<'a>

§

impl<'a> Move for Plot3D<'a>

§

impl<'a> RefUnwindSafe for Plot3D<'a>

§

impl<'a> Send for Plot3D<'a>
where NonZero<u64>: Send, RawVecInner: Send, &'a [[f64; 3]]: Send, Vec<[f64; 3]>: Send, &'a [f64]: Send, Vec<f64>: Send,

§

impl<'a> Sync for Plot3D<'a>
where NonZero<u64>: Sync, RawVecInner: Sync, Vec<[f64; 3]>: Sync, Vec<f64>: Sync,

§

impl<'a> Unpin for Plot3D<'a>
where NonZero<u64>: Unpin, *const u8 is !null: Unpin, &'a [[f64; 3]]: Unpin, Vec<[f64; 3]>: Unpin, &'a [f64]: Unpin, Vec<f64>: Unpin,

§

impl<'a> UnsafeUnpin for Plot3D<'a>

§

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> 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> 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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SerializableAny for T
where T: 'static + Any + Clone + for<'a> Send + Sync,

Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

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

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,