This had got lost while being ported to Plot
Showing 2 of 3 files from the diff.
src/page.rs
changed.
src/repr/plot.rs
changed.
Other files ignored by Codecov
examples/scatter_text.rs
has changed.
@@ -20,6 +20,7 @@
Loading
20 | 20 | use crate::repr::ContinuousRepresentation; |
|
21 | 21 | use crate::style::*; |
|
22 | 22 | use crate::svg_render; |
|
23 | + | use crate::text_render; |
|
23 | 24 | ||
24 | 25 | /// Representation of any plot with points in the XY plane, visualized as points and/or with lines |
|
25 | 26 | /// in-between. |
@@ -173,11 +174,34 @@
Loading
173 | 174 | ||
174 | 175 | fn to_text( |
|
175 | 176 | &self, |
|
176 | - | _x_axis: &axis::ContinuousAxis, |
|
177 | - | _y_axis: &axis::ContinuousAxis, |
|
178 | - | _face_width: u32, |
|
179 | - | _face_height: u32, |
|
177 | + | x_axis: &axis::ContinuousAxis, |
|
178 | + | y_axis: &axis::ContinuousAxis, |
|
179 | + | face_width: u32, |
|
180 | + | face_height: u32, |
|
180 | 181 | ) -> String { |
|
181 | - | "".into() |
|
182 | + | let face_lines = if let Some(line_style) = &self.line_style { |
|
183 | + | unimplemented!("Text rendering does not yet support line plots") |
|
184 | + | } else { |
|
185 | + | (0..face_height) |
|
186 | + | .map(|_| " ".repeat(face_width as usize)) |
|
187 | + | .collect::<Vec<String>>() |
|
188 | + | .join("\n") |
|
189 | + | }; |
|
190 | + | let face_points = if let Some(point_style) = &self.point_style { |
|
191 | + | text_render::render_face_points( |
|
192 | + | &self.data, |
|
193 | + | x_axis, |
|
194 | + | y_axis, |
|
195 | + | face_width, |
|
196 | + | face_height, |
|
197 | + | &point_style, |
|
198 | + | ) |
|
199 | + | } else { |
|
200 | + | (0..face_height) |
|
201 | + | .map(|_| " ".repeat(face_width as usize)) |
|
202 | + | .collect::<Vec<String>>() |
|
203 | + | .join("\n") |
|
204 | + | }; |
|
205 | + | text_render::overlay(&face_lines, &face_points, 0, 0) |
|
182 | 206 | } |
|
183 | 207 | } |
Files | Coverage |
---|---|
src | 61.94% |
tests/test_no_data.rs | 100.00% |
Project Totals (14 files) | 62.68% |
57097345
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file.
The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files.
The size and color of each slice is representing the number of statements and the coverage, respectively.