(plot: &impl Plot)
| 137 | } |
| 138 | |
| 139 | pub fn render_to_svg_string(plot: &impl Plot) -> String { |
| 140 | let (w, h) = resolve_dimensions(plot.ir_layout()); |
| 141 | let mut svg_string = String::new(); |
| 142 | let dashes; |
| 143 | { |
| 144 | let root = SVGBackend::with_string(&mut svg_string, (w, h)).into_drawing_area(); |
| 145 | dashes = render_to_backend(plot, root); |
| 146 | } |
| 147 | smooth_svg_lines(&mut svg_string); |
| 148 | apply_svg_dash_patterns(&mut svg_string, &dashes); |
| 149 | svg_string |
| 150 | } |
| 151 | |
| 152 | /// Apply `stroke-dasharray` only to `<polyline>` elements whose stroke color |
| 153 | /// matches a dash entry. `<line>`, `<rect>`, and other elements are left untouched |
no test coverage detected