Skip to main content

optionstratlib_visualization/visualization/
interface.rs

1use crate::visualization::styles::PlotType;
2
3/// A trait defining the type of graph or plot used for visualization purposes.
4///
5/// The `GraphType` trait is designed to provide a standardized way to determine
6/// the visualization type for a given data representation. Implementors of this
7/// trait should define the specific plot type that suits their data or visualization needs.
8///
9/// # Usage
10/// Implement this trait for any data structure or context that requires a
11/// well-defined graph type for displaying data.
12///
13pub trait GraphType {
14    /// Returns the type of plot to be used for visualization.
15    ///
16    /// # Description
17    /// The `plot_type` function determines and returns the type of plot that should
18    /// be used. This information can be useful when configuring or rendering visual
19    /// data representations. The returned `PlotType` is typically an enum or specific
20    /// type representing various available plot types (e.g., line plot, bar chart, scatter plot, etc.).
21    ///
22    /// # Returns
23    /// * `PlotType` - The specific type of plot identified for use.
24    ///
25    fn plot_type() -> PlotType;
26}