Skip to main content

Backend

Trait Backend 

Source
pub trait Backend {
    type SaveError;

Show 28 methods // Required methods fn add_curve(&mut self, curve: CurveSpec<'_>) -> ItemHandle; fn add_image(&mut self, image: ImageSpec<'_>) -> ItemHandle; fn add_triangles(&mut self, tris: TriangleSpec<'_>) -> ItemHandle; fn add_shape(&mut self, shape: ShapeSpec<'_>) -> ItemHandle; fn add_marker(&mut self, marker: MarkerSpec<'_>) -> ItemHandle; fn remove(&mut self, item: ItemHandle) -> bool; fn set_limits( &mut self, xmin: f64, xmax: f64, ymin: f64, ymax: f64, y2: Option<(f64, f64)>, ); fn x_limits(&self) -> (f64, f64); fn y_limits(&self, axis: YAxis) -> Option<(f64, f64)>; fn set_x_log(&mut self, on: bool); fn set_y_log(&mut self, on: bool); fn set_x_inverted(&mut self, on: bool); fn set_y_inverted(&mut self, on: bool); fn set_keep_data_aspect_ratio(&mut self, on: bool); fn data_to_pixel(&self, x: f64, y: f64, axis: YAxis) -> Option<Pos2>; fn pixel_to_data(&self, p: Pos2, axis: YAxis) -> Option<(f64, f64)>; fn plot_bounds_in_pixels(&self) -> Option<Rect>; fn set_axes_margins(&mut self, margins: Margins); fn set_title(&mut self, title: Option<&str>); fn set_x_label(&mut self, label: Option<&str>); fn set_y_label(&mut self, label: Option<&str>, axis: YAxis); fn set_foreground_colors(&mut self, foreground: Color32, grid: Color32); fn set_background_colors( &mut self, background: Color32, data_background: Color32, ); fn pick_item(&self, p: Pos2, item: ItemHandle) -> Option<PickResult>; fn items_back_to_front(&self) -> Vec<ItemHandle> ; fn replot(&mut self); fn save_graph( &self, path: &Path, size: (u32, u32), ) -> Result<(), Self::SaveError>; fn save_graph_with_format( &self, path: &Path, size: (u32, u32), format: SaveFormat, dpi: u32, ) -> Result<(), Self::SaveError>;
}
Expand description

Renderer boundary modeled after silx BackendBase.

Required Associated Types§

Required Methods§

Source

fn add_curve(&mut self, curve: CurveSpec<'_>) -> ItemHandle

Source

fn add_image(&mut self, image: ImageSpec<'_>) -> ItemHandle

Source

fn add_triangles(&mut self, tris: TriangleSpec<'_>) -> ItemHandle

Source

fn add_shape(&mut self, shape: ShapeSpec<'_>) -> ItemHandle

Source

fn add_marker(&mut self, marker: MarkerSpec<'_>) -> ItemHandle

Source

fn remove(&mut self, item: ItemHandle) -> bool

Source

fn set_limits( &mut self, xmin: f64, xmax: f64, ymin: f64, ymax: f64, y2: Option<(f64, f64)>, )

Source

fn x_limits(&self) -> (f64, f64)

Source

fn y_limits(&self, axis: YAxis) -> Option<(f64, f64)>

Source

fn set_x_log(&mut self, on: bool)

Source

fn set_y_log(&mut self, on: bool)

Source

fn set_x_inverted(&mut self, on: bool)

Source

fn set_y_inverted(&mut self, on: bool)

Source

fn set_keep_data_aspect_ratio(&mut self, on: bool)

Source

fn data_to_pixel(&self, x: f64, y: f64, axis: YAxis) -> Option<Pos2>

Source

fn pixel_to_data(&self, p: Pos2, axis: YAxis) -> Option<(f64, f64)>

Source

fn plot_bounds_in_pixels(&self) -> Option<Rect>

Source

fn set_axes_margins(&mut self, margins: Margins)

Source

fn set_title(&mut self, title: Option<&str>)

Source

fn set_x_label(&mut self, label: Option<&str>)

Source

fn set_y_label(&mut self, label: Option<&str>, axis: YAxis)

Source

fn set_foreground_colors(&mut self, foreground: Color32, grid: Color32)

Source

fn set_background_colors( &mut self, background: Color32, data_background: Color32, )

Source

fn pick_item(&self, p: Pos2, item: ItemHandle) -> Option<PickResult>

Source

fn items_back_to_front(&self) -> Vec<ItemHandle>

Source

fn replot(&mut self)

Source

fn save_graph( &self, path: &Path, size: (u32, u32), ) -> Result<(), Self::SaveError>

Source

fn save_graph_with_format( &self, path: &Path, size: (u32, u32), format: SaveFormat, dpi: u32, ) -> Result<(), Self::SaveError>

Render the figure to path in the given SaveFormat at dpi.

Generalizes Self::save_graph (PNG-only) over silx’s raster save formats (PNG/PPM/SVG/TIFF) plus the raster-embedding EPS/PDF, faithful to silx BackendBase.saveGraph(fileName, fileFormat, dpi).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§