1
use crate::scatter;
2
use crate::repr;
3
use crate::text_render;
4
use crate::svg_render;
5

6
pub trait Render {
7
    fn to_svg(&self) -> svg_render::SVG;
8
    fn to_text(&self) -> text_render::Text;
9
}
10

11
impl Render for scatter::Scatter {
12 0
    fn to_text(&self) -> text_render::Text {
13 0
        text_render::Text {data: text_render::draw_scatter(self)}
14
    }
15

16 0
    fn to_svg(&self) -> svg_render::SVG {
17 0
        svg_render::draw_scatter(self)
18
    }
19
}
20

21
impl Render for repr::Histogram {
22 0
    fn to_text(&self) -> text_render::Text {
23 0
        text_render::Text {data: text_render::draw_histogram(self)}
24
    }
25

26 0
    fn to_svg(&self) -> svg_render::SVG {
27 0
        svg_render::draw_histogram(self)
28
    }
29
}

Read our documentation on viewing source code .

Loading