diff --git a/src/function.rs b/src/function.rs index 138c57e..27c6d3b 100644 --- a/src/function.rs +++ b/src/function.rs @@ -18,7 +18,7 @@ use std::f64; use svg; use axis; -use representation::Representation; +use representation::ContinuousRepresentation; use svg_render; use style; @@ -129,7 +129,7 @@ impl Function { } } -impl Representation for Function { +impl ContinuousRepresentation for Function { fn range(&self, dim: u32) -> (f64, f64) { match dim { 0 => self.x_range(), diff --git a/src/histogram.rs b/src/histogram.rs index 5b3085a..87a2adf 100644 --- a/src/histogram.rs +++ b/src/histogram.rs @@ -26,7 +26,7 @@ use axis; use utils::PairWise; use svg_render; use text_render; -use representation::Representation; +use representation::ContinuousRepresentation; use style; #[derive(Debug, Default)] @@ -147,7 +147,7 @@ impl Histogram { } } -impl Representation for Histogram { +impl ContinuousRepresentation for Histogram { fn range(&self, dim: u32) -> (f64, f64) { match dim { 0 => self.x_range(), diff --git a/src/line.rs b/src/line.rs index dd6a063..fd2b084 100644 --- a/src/line.rs +++ b/src/line.rs @@ -18,7 +18,7 @@ use std::f64; use svg; use axis; -use representation::Representation; +use representation::ContinuousRepresentation; use svg_render; use style; @@ -116,7 +116,7 @@ impl Line { } } -impl Representation for Line { +impl ContinuousRepresentation for Line { fn range(&self, dim: u32) -> (f64, f64) { match dim { 0 => self.x_range(), diff --git a/src/representation.rs b/src/representation.rs index ec5928d..01eef13 100644 --- a/src/representation.rs +++ b/src/representation.rs @@ -18,7 +18,7 @@ use axis; /** A representation of data that is continuous in two dimensions. */ -pub trait Representation { +pub trait ContinuousRepresentation { /// The maximum range in each dimension. Used for auto-scaling axes. fn range(&self, dim: u32) -> (f64, f64); diff --git a/src/scatter.rs b/src/scatter.rs index 388dadd..48c9615 100644 --- a/src/scatter.rs +++ b/src/scatter.rs @@ -5,7 +5,7 @@ use svg; use axis; use svg_render; use text_render; -use representation::Representation; +use representation::ContinuousRepresentation; use style; /// `Style` follows the 'optional builder' pattern @@ -133,7 +133,7 @@ impl Scatter { } } -impl Representation for Scatter { +impl ContinuousRepresentation for Scatter { fn range(&self, dim: u32) -> (f64, f64) { match dim { 0 => self.x_range(), diff --git a/src/view.rs b/src/view.rs index 0e5336a..ab0f441 100644 --- a/src/view.rs +++ b/src/view.rs @@ -12,7 +12,7 @@ use std::f64; use svg; use svg::Node; -use representation::{DiscreteRepresentation, Representation}; +use representation::{DiscreteRepresentation, ContinuousRepresentation}; use axis; use svg_render; use text_render; @@ -25,7 +25,7 @@ pub trait View { /// Standard 1-dimensional view with a continuous x-axis #[derive(Default)] pub struct ContinuousView<'a> { - representations: Vec<&'a Representation>, + representations: Vec<&'a ContinuousRepresentation>, x_range: Option, y_range: Option, x_label: Option, @@ -49,7 +49,7 @@ impl<'a> ContinuousView<'a> { /** Add a representation to the view */ - pub fn add(mut self, repr: &'a Representation) -> Self { + pub fn add(mut self, repr: &'a ContinuousRepresentation) -> Self { self.representations.push(repr); self }