Struct plotly::traces::contour::Contour

source ·
pub struct Contour<Z, X = f64, Y = f64>where
    X: Serialize + Clone,
    Y: Serialize + Clone,
    Z: Serialize + Clone,{ /* private fields */ }
Expand description

Construct a contour trace.

Examples

use plotly::Contour;

let trace = Contour::new(
    vec![0.0, 2.5, 5.0],
    vec![0.0, 7.5, 15.0],
    vec![
        vec![0.0, 5.0, 10.0],
        vec![5.0, 2.5, 0.0],
        vec![10.0, 5.0, 0.0],
    ],
);

let expected = serde_json::json!({
    "type": "contour",
    "x": [0.0, 2.5, 5.0],
    "y": [0.0, 7.5, 15.0],
    "z": [[0.0, 5.0, 10.0], [5.0, 2.5, 0.0], [10.0, 5.0, 0.0]]
});

assert_eq!(serde_json::to_value(trace).unwrap(), expected);

Implementations§

source§

impl<Z> Contour<Z, f64, f64>where Z: Serialize + Clone,

source

pub fn new_z(z: Vec<Z>) -> Box<Self>

source§

impl<Z, X, Y> Contour<Z, X, Y>where X: Serialize + Clone, Y: Serialize + Clone, Z: Serialize + Clone,

source

pub fn new(x: Vec<X>, y: Vec<Y>, z: Vec<Z>) -> Box<Self>

source

pub fn auto_color_scale(self, auto_color_scale: bool) -> Box<Self>

source

pub fn auto_contour(self, auto_contour: bool) -> Box<Self>

source

pub fn color_bar(self, color_bar: ColorBar) -> Box<Self>

source

pub fn color_scale(self, color_scale: ColorScale) -> Box<Self>

source

pub fn connect_gaps(self, connect_gaps: bool) -> Box<Self>

source

pub fn contours(self, contours: Contours) -> Box<Self>

source

pub fn dx(self, dx: X) -> Box<Self>

source

pub fn dy(self, dy: Y) -> Box<Self>

source

pub fn fill_color<C: Color>(self, fill_color: C) -> Box<Self>

source

pub fn hover_info(self, hover_info: HoverInfo) -> Box<Self>

source

pub fn hover_label(self, hover_label: Label) -> Box<Self>

source

pub fn hover_on_gaps(self, hover_on_gaps: bool) -> Box<Self>

source

pub fn hover_template(self, hover_template: &str) -> Box<Self>

source

pub fn hover_template_array<S: AsRef<str>>( self, hover_template: Vec<S> ) -> Box<Self>

source

pub fn hover_text<S: AsRef<str>>(self, hover_text: Vec<S>) -> Box<Self>

source

pub fn legend_group(self, legend_group: &str) -> Box<Self>

source

pub fn legend_group_title( self, legend_group_title: LegendGroupTitle ) -> Box<Self>

source

pub fn line(self, line: Line) -> Box<Self>

source

pub fn name(self, name: &str) -> Box<Self>

source

pub fn n_contours(self, n_contours: usize) -> Box<Self>

source

pub fn opacity(self, opacity: f64) -> Box<Self>

source

pub fn reverse_scale(self, reverse_scale: bool) -> Box<Self>

source

pub fn show_legend(self, show_legend: bool) -> Box<Self>

source

pub fn show_scale(self, show_scale: bool) -> Box<Self>

source

pub fn text<S: AsRef<str>>(self, text: Vec<S>) -> Box<Self>

source

pub fn transpose(self, transpose: bool) -> Box<Self>

source

pub fn visible(self, visible: Visible) -> Box<Self>

source

pub fn x(self, x: Vec<X>) -> Box<Self>

source

pub fn x_axis(self, axis: &str) -> Box<Self>

source

pub fn x_calendar(self, x_calendar: Calendar) -> Box<Self>

source

pub fn x0(self, x0: X) -> Box<Self>

source

pub fn y_axis(self, axis: &str) -> Box<Self>

source

pub fn y(self, y: Vec<Y>) -> Box<Self>

source

pub fn y_calendar(self, y_calendar: Calendar) -> Box<Self>

source

pub fn y0(self, y0: Y) -> Box<Self>

source

pub fn zauto(self, zauto: bool) -> Box<Self>

source

pub fn zhover_format(self, zhover_format: &str) -> Box<Self>

source

pub fn zmax(self, zmax: Z) -> Box<Self>

source

pub fn zmid(self, zmid: Z) -> Box<Self>

source

pub fn zmin(self, zmin: Z) -> Box<Self>

Trait Implementations§

source§

impl<Z, X, Y> Clone for Contour<Z, X, Y>where X: Serialize + Clone + Clone, Y: Serialize + Clone + Clone, Z: Serialize + Clone + Clone,

source§

fn clone(&self) -> Contour<Z, X, Y>

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<Z, X, Y> Debug for Contour<Z, X, Y>where X: Serialize + Clone + Debug, Y: Serialize + Clone + Debug, Z: Serialize + Clone + Debug,

source§

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

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

impl<Z, X, Y> Default for Contour<Z, X, Y>where X: Serialize + Clone, Y: Serialize + Clone, Z: Serialize + Clone,

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<Z, X, Y> Serialize for Contour<Z, X, Y>where X: Serialize + Clone + Serialize, Y: Serialize + Clone + Serialize, Z: Serialize + Clone + Serialize,

source§

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

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

impl<X, Y, Z> Trace for Contour<X, Y, Z>where X: Serialize + Clone, Y: Serialize + Clone, Z: Serialize + Clone,

source§

fn to_json(&self) -> String

Auto Trait Implementations§

§

impl<Z, X = f64, Y = f64> !RefUnwindSafe for Contour<Z, X, Y>

§

impl<Z, X, Y> Send for Contour<Z, X, Y>where X: Send, Y: Send, Z: Send,

§

impl<Z, X, Y> Sync for Contour<Z, X, Y>where X: Sync, Y: Sync, Z: Sync,

§

impl<Z, X, Y> Unpin for Contour<Z, X, Y>where X: Unpin, Y: Unpin, Z: Unpin,

§

impl<Z, X = f64, Y = f64> !UnwindSafe for Contour<Z, X, Y>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> DynClone for Twhere T: Clone,

source§

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

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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> Serialize for Twhere T: Serialize + ?Sized,

source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>

source§

impl<T> ToOwned for Twhere T: Clone,

§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V