(
plot: &impl Plot,
root: DrawingArea<DB, plotters::coord::Shift>,
)
| 63 | } |
| 64 | |
| 65 | fn render_to_backend<DB: DrawingBackend>( |
| 66 | plot: &impl Plot, |
| 67 | root: DrawingArea<DB, plotters::coord::Shift>, |
| 68 | ) -> Vec<numeric::DashEntry> { |
| 69 | let layout = plot.ir_layout(); |
| 70 | let traces = plot.ir_traces(); |
| 71 | |
| 72 | root.fill(&WHITE).unwrap(); |
| 73 | |
| 74 | let mut unsupported = Vec::new(); |
| 75 | let mut dash_entries = Vec::new(); |
| 76 | |
| 77 | if traces.is_empty() { |
| 78 | root.present().unwrap(); |
| 79 | return dash_entries; |
| 80 | } |
| 81 | |
| 82 | match &traces[0] { |
| 83 | TraceIR::BarPlot(_) => { |
| 84 | if is_horizontal_bar(traces) { |
| 85 | bar::render_bar_horizontal(&root, layout, traces, &mut unsupported); |
| 86 | } else { |
| 87 | bar::render_bar_vertical(&root, layout, traces, &mut unsupported); |
| 88 | } |
| 89 | } |
| 90 | TraceIR::BoxPlot(_) => { |
| 91 | boxplot::render_boxplot(&root, layout, traces, &mut unsupported); |
| 92 | } |
| 93 | TraceIR::HeatMap(_) => { |
| 94 | heatmap::render_heatmap(&root, layout, traces, &mut unsupported); |
| 95 | } |
| 96 | _ => numeric::render_numeric(&root, layout, traces, &mut unsupported, &mut dash_entries), |
| 97 | } |
| 98 | |
| 99 | enforce_strict("plotters", &unsupported); |
| 100 | root.present().unwrap(); |
| 101 | dash_entries |
| 102 | } |
| 103 | |
| 104 | pub fn plot_interactive(plot: &impl Plot) { |
| 105 | if std::env::var("EVCXR_IS_RUNTIME").is_ok() { |
no test coverage detected