(
traces_list: &[Vec<Box<dyn Trace + 'static>>],
)
| 626 | } |
| 627 | |
| 628 | pub(super) fn determine_bar_mode( |
| 629 | traces_list: &[Vec<Box<dyn Trace + 'static>>], |
| 630 | ) -> Option<plotly::layout::BarMode> { |
| 631 | let mut has_histogram = false; |
| 632 | let mut has_barplot = false; |
| 633 | |
| 634 | for traces in traces_list { |
| 635 | for trace in traces { |
| 636 | let json_str = trace.to_json(); |
| 637 | if let Ok(json) = serde_json::from_str::<Value>(&json_str) { |
| 638 | if let Some(trace_type) = json.get("type").and_then(|v| v.as_str()) { |
| 639 | match trace_type { |
| 640 | "histogram" => has_histogram = true, |
| 641 | "bar" => has_barplot = true, |
| 642 | _ => {} |
| 643 | } |
| 644 | } |
| 645 | } |
| 646 | } |
| 647 | } |
| 648 | |
| 649 | if has_histogram { |
| 650 | Some(plotly::layout::BarMode::Overlay) |
| 651 | } else if has_barplot { |
| 652 | Some(plotly::layout::BarMode::Group) |
| 653 | } else { |
| 654 | None |
| 655 | } |
| 656 | } |
| 657 | |
| 658 | pub(super) fn determine_box_mode( |
| 659 | traces_list: &[Vec<Box<dyn Trace + 'static>>], |
no test coverage detected