[][src]Trait preexplorer::traits::Configurable

pub trait Configurable {
    fn configuration(&mut self) -> &mut Configuration;
fn configuration_as_ref(&self) -> &Configuration; fn title<S: Display>(&mut self, title: S) -> &mut Self { ... }
fn logx<N: Into<f64>>(&mut self, logx: N) -> &mut Self { ... }
fn logy<N: Into<f64>>(&mut self, logy: N) -> &mut Self { ... }
fn xlog<N: Into<f64>>(&mut self, logx: N) -> &mut Self { ... }
fn ylog<N: Into<f64>>(&mut self, logy: N) -> &mut Self { ... }
fn labelx<S: Display>(&mut self, labelx: S) -> &mut Self { ... }
fn labely<S: Display>(&mut self, labely: S) -> &mut Self { ... }
fn xlabel<S: Display>(&mut self, labelx: S) -> &mut Self { ... }
fn ylabel<S: Display>(&mut self, labely: S) -> &mut Self { ... }
fn rangex<S, T>(&mut self, left: S, right: T) -> &mut Self
    where
        f64: From<S>,
        f64: From<T>
, { ... }
fn rangey<S, T>(&mut self, down: S, up: T) -> &mut Self
    where
        f64: From<S>,
        f64: From<T>
, { ... }
fn xrange<S, T>(&mut self, left: S, right: T) -> &mut Self
    where
        f64: From<S>,
        f64: From<T>
, { ... }
fn yrange<S, T>(&mut self, down: S, up: T) -> &mut Self
    where
        f64: From<S>,
        f64: From<T>
, { ... }
fn data_extension<S: AsRef<OsStr>>(&mut self, extension: S) -> &mut Self { ... }
fn plot_extension<S: AsRef<OsStr>>(&mut self, extension: S) -> &mut Self { ... }
fn header(&mut self, header: bool) -> &mut Self { ... }
fn style<S>(&mut self, style: S) -> &mut Self
    where
        Style: From<S>
, { ... }
fn dashtype(&mut self, dashtype: usize) -> &mut Self { ... }
fn date(&mut self, date: DateTime<Local>) -> &mut Self { ... }
fn id<S: Display>(&mut self, id: S) -> &mut Self { ... }
fn custom<S: Display, T: Display>(&mut self, key: S, value: T) -> &mut Self { ... }
fn ticsx<T, S>(&mut self, ticsx: T) -> &mut Self
    where
        T: Into<Option<S>>,
        S: Display
, { ... }
fn ticsy<T, S>(&mut self, ticsy: T) -> &mut Self
    where
        T: Into<Option<S>>,
        S: Display
, { ... }
fn xtics<T, S>(&mut self, ticsx: T) -> &mut Self
    where
        T: Into<Option<S>>,
        S: Display
, { ... }
fn ytics<T, S>(&mut self, ticsy: T) -> &mut Self
    where
        T: Into<Option<S>>,
        S: Display
, { ... }
fn pause<T, S>(&mut self, pause: T) -> &mut Self
    where
        T: Into<Option<S>>,
        f64: From<S>
, { ... }
fn get_title(&self) -> Option<&String> { ... }
fn get_logx(&self) -> Option<f64> { ... }
fn get_logy(&self) -> Option<f64> { ... }
fn get_xlog(&self) -> Option<f64> { ... }
fn get_ylog(&self) -> Option<f64> { ... }
fn get_labelx(&self) -> Option<&String> { ... }
fn get_labely(&self) -> Option<&String> { ... }
fn get_xlabel(&self) -> Option<&String> { ... }
fn get_ylabel(&self) -> Option<&String> { ... }
fn get_rangex(&self) -> Option<(f64, f64)> { ... }
fn get_rangey(&self) -> Option<(f64, f64)> { ... }
fn get_xrange(&self) -> Option<(f64, f64)> { ... }
fn get_yrange(&self) -> Option<(f64, f64)> { ... }
fn get_plot_extension(&self) -> Option<&OsStr> { ... }
fn get_data_extension(&self) -> Option<&OsStr> { ... }
fn get_plot_path(&self) -> &Path { ... }
fn get_data_path(&self) -> &Path { ... }
fn get_header(&self) -> bool { ... }
fn get_style(&self) -> &Style { ... }
fn get_dashtype(&self) -> Option<usize> { ... }
fn get_date(&self) -> &DateTime<Local> { ... }
fn get_id(&self) -> Option<&String> { ... }
fn get_checked_id(&self) -> &String { ... }
fn get_custom<S: Display>(&self, key: S) -> Option<&String> { ... }
fn get_ticsx(&self) -> Option<&String> { ... }
fn get_xtics(&self) -> Option<&String> { ... }
fn get_ticsy(&self) -> Option<&String> { ... }
fn get_ytics(&self) -> Option<&String> { ... }
fn get_pause(&self) -> Option<f64> { ... } }

Allows basic saving and plotting configuration.

Remarks

It is meant to be a black box for all configuration throught the Configuration struct, which is pursposely kept hidden.

Implementation

See traits module level documentation.

Required methods

fn configuration(&mut self) -> &mut Configuration

Mutable access to Configuration.

fn configuration_as_ref(&self) -> &Configuration

Reference access to Configuration.

Loading content...

Provided methods

fn title<S: Display>(&mut self, title: S) -> &mut Self

Set title, which in comparisons correspond to legends.

fn logx<N: Into<f64>>(&mut self, logx: N) -> &mut Self

Set logaritmic scale in the x axis.

Remark

The x axis that will be ploted should not include zero.

fn logy<N: Into<f64>>(&mut self, logy: N) -> &mut Self

Set logaritmic scale in the y axis.

Remark

The y axis that will be ploted should not include zero.

fn xlog<N: Into<f64>>(&mut self, logx: N) -> &mut Self

Set logaritmic scale in the x axis.

Remark

The x axis that will be ploted should not include zero. This is a mirror method of logx, for convinience.

fn ylog<N: Into<f64>>(&mut self, logy: N) -> &mut Self

Set logaritmic scale in the y axis.

Remark

The y axis that will be ploted should not include zero. This is a mirror method of logy, for convinience.

fn labelx<S: Display>(&mut self, labelx: S) -> &mut Self

Set a label in the x axis.

fn labely<S: Display>(&mut self, labely: S) -> &mut Self

Set a label in the y axis.

fn xlabel<S: Display>(&mut self, labelx: S) -> &mut Self

Set a label in the x axis.

Remarks

This is a mirror method of labelx, for convinience.

fn ylabel<S: Display>(&mut self, labely: S) -> &mut Self

Set a label in the y axis.

Remarks

This is a mirror method of labely, for convinience.

fn rangex<S, T>(&mut self, left: S, right: T) -> &mut Self where
    f64: From<S>,
    f64: From<T>, 

Set the range in the x axis. If left > right, then the x axis is inverted.

fn rangey<S, T>(&mut self, down: S, up: T) -> &mut Self where
    f64: From<S>,
    f64: From<T>, 

Set the range in the y axis. If down > up, then the y axis is inverted.

fn xrange<S, T>(&mut self, left: S, right: T) -> &mut Self where
    f64: From<S>,
    f64: From<T>, 

Set the range in the x axis. If left > right, then the x axis is inverted.

Remarks

This is a mirror method of rangex, for convinience.

fn yrange<S, T>(&mut self, down: S, up: T) -> &mut Self where
    f64: From<S>,
    f64: From<T>, 

Set the range in the y axis. If down > up, then the y axis is inverted.

Remarks

This is a mirror method of rangey, for convinience.

fn data_extension<S: AsRef<OsStr>>(&mut self, extension: S) -> &mut Self

Set an extension for the data file.

Default

The default value is txt.

let seq = (0..10).preexplore();
assert_eq!(seq.get_data_extension().unwrap().to_str(), Some("txt"));

fn plot_extension<S: AsRef<OsStr>>(&mut self, extension: S) -> &mut Self

Set an extension for the data file.

Default

The default value is gnu.

let seq = (0..10).preexplore();
assert_eq!(seq.get_plot_extension().unwrap().to_str(), Some("gnu"));

fn header(&mut self, header: bool) -> &mut Self

Decide the presence of headers in the data file. If activated, then title, date and other information are included as a comment in the data file.

Default

The default value is true.

let seq = (0..10).preexplore();
assert_eq!(seq.get_header(), true);

fn style<S>(&mut self, style: S) -> &mut Self where
    Style: From<S>, 

Choose the style for the plot. Too see all options, go to Style struct. If you set a style and then compare with other structs, then in the joint plot, the style shall be mantained for those structs that had a style not setted by default.

Default

The default value is default, which is read as lines.

let seq = (0..10).preexplore();
assert_eq!(seq.get_style().to_string().as_str(), "lines");

fn dashtype(&mut self, dashtype: usize) -> &mut Self

Choose the dashtype for the plot. Following the gnuplot standar, it has a cyclic behaviour.

fn date(&mut self, date: DateTime<Local>) -> &mut Self

Choose the date used when saving files.

Default

Time upon creation.

let seq = (0..10).preexplore();
println!("{}", seq.get_date());

fn id<S: Display>(&mut self, id: S) -> &mut Self

Set the unique id or file name with which both data and plot script will be saved. There is no default value and one must set it before plotting or saving.

When only saving data, prefer saving_with_id method.

Remarks

Commonly used methods like plot and plot_later internally call this method for ease of use.

Examples

Correctly identifying before saving.

let mut seq = (0..10).preexplore();
seq.id("my_id").save().unwrap();

Incorrectly identifying before saving. This panics.

(0..10).preexplore().save().unwrap();

fn custom<S: Display, T: Display>(&mut self, key: S, value: T) -> &mut Self

Include custom configuration fields into the Configuration struct. This is intended for all new configurations you want, specially if you are implementing the traits.

Examples

Setting a subtitle option.

let mut seq = (0..10).preexplore();
seq.custom("subtitle", "My subtitle");
assert_eq!(seq.get_custom("subtitle").unwrap().as_str(), "My subtitle");

fn ticsx<T, S>(&mut self, ticsx: T) -> &mut Self where
    T: Into<Option<S>>,
    S: Display

Control tics in the x axis. Passing "" shows no tics. See gnuplot documentation for a correct format.

Examples

Showing only from 0 to 10, at a step of 0.35.

let mut seq = (0..10).preexplore();
seq.ticsx("0, 1.35, 10");
assert_eq!(seq.get_ticsx().unwrap().as_str(), "0, 1.35, 10");

Showing no tics.

let mut seq = (0..10).preexplore();
seq.ticsx("");
assert_eq!(seq.get_ticsx().unwrap().as_str(), "");

fn ticsy<T, S>(&mut self, ticsy: T) -> &mut Self where
    T: Into<Option<S>>,
    S: Display

Control tics in the y axis. Passing "" shows no tics. See gnuplot documentation for a correct format.

Examples

Showing only from 0 to 10, at a step of 0.35.

let mut seq = (0..10).preexplore();
seq.ticsy("0, 1.35, 10");
assert_eq!(seq.get_ticsy().unwrap().as_str(), "0, 1.35, 10");

Showing no tics.

let mut seq = (0..10).preexplore();
seq.ticsy("");
assert_eq!(seq.get_ticsx().unwrap().as_str(), "");

fn xtics<T, S>(&mut self, ticsx: T) -> &mut Self where
    T: Into<Option<S>>,
    S: Display

Control tics in the x axis. See gnuplot documentation for a correct format.

Remarks

This is a mirror method of ticsx, for convinience.

fn ytics<T, S>(&mut self, ticsy: T) -> &mut Self where
    T: Into<Option<S>>,
    S: Display

Control tics in the y axis. See gnuplot documentation for a correct format.

Remarks

This is a mirror method of ticsy, for convinience.

fn pause<T, S>(&mut self, pause: T) -> &mut Self where
    T: Into<Option<S>>,
    f64: From<S>, 

Control the time for which the plot is in the screen. The unit is seconds. Any negative number means "until a key is pressed". To have no pause, pass 0, instead of None.

Default

The default value is -1.

let seq = (0..10).preexplore();
assert_eq!(seq.get_pause(), Some(-1.0));

Examples

This plot will wait two seconds before closing.

let mut seq = (0..10).preexplore();
seq.pause(2);
assert_eq!(seq.get_pause(), Some(2.0));
seq.plot("two_seconds_test").unwrap();

This plot will have no pause before closing.

let mut seq = (0..10).preexplore();
seq.pause(0);
assert_eq!(seq.get_pause(), Some(0.0));
seq.plot("silent_plot").unwrap();

fn get_title(&self) -> Option<&String>

fn get_logx(&self) -> Option<f64>

fn get_logy(&self) -> Option<f64>

fn get_xlog(&self) -> Option<f64>

fn get_ylog(&self) -> Option<f64>

fn get_labelx(&self) -> Option<&String>

fn get_labely(&self) -> Option<&String>

fn get_xlabel(&self) -> Option<&String>

fn get_ylabel(&self) -> Option<&String>

fn get_rangex(&self) -> Option<(f64, f64)>

fn get_rangey(&self) -> Option<(f64, f64)>

fn get_xrange(&self) -> Option<(f64, f64)>

fn get_yrange(&self) -> Option<(f64, f64)>

fn get_plot_extension(&self) -> Option<&OsStr>

fn get_data_extension(&self) -> Option<&OsStr>

fn get_plot_path(&self) -> &Path

fn get_data_path(&self) -> &Path

fn get_header(&self) -> bool

fn get_style(&self) -> &Style

fn get_dashtype(&self) -> Option<usize>

fn get_date(&self) -> &DateTime<Local>

fn get_id(&self) -> Option<&String>

fn get_checked_id(&self) -> &String

fn get_custom<S: Display>(&self, key: S) -> Option<&String>

fn get_ticsx(&self) -> Option<&String>

fn get_xtics(&self) -> Option<&String>

fn get_ticsy(&self) -> Option<&String>

fn get_ytics(&self) -> Option<&String>

fn get_pause(&self) -> Option<f64>

Loading content...

Implementors

impl Configurable for Configuration[src]

impl<T> Configurable for Data<T> where
    T: Display
[src]

impl<T> Configurable for Densities<T> where
    T: PartialOrd + Display + Clone
[src]

impl<T> Configurable for Density<T> where
    T: PartialOrd + Display + Clone
[src]

impl<T> Configurable for Sequences<T> where
    T: Display + Clone
[src]

impl<T> Configurable for Sequence<T> where
    T: Display + Clone
[src]

impl<T, S> Configurable for Processes<T, S> where
    T: Display + Clone,
    S: Display + Clone
[src]

impl<T, S> Configurable for Process<T, S> where
    T: Display + Clone,
    S: Display + Clone
[src]

Loading content...