MCPcopy Create free account
hub / github.com/alceal/plotlars / add_legend_entry

Function add_legend_entry

crates/plotlars-plotters/src/render/boxplot.rs:526–542  ·  view source on GitHub ↗
(
    ir: &plotlars_core::ir::trace::BoxPlotIR,
    has_legend: &mut bool,
    legend_entries: &mut Vec<LegendEntry>,
    color: RGBColor,
    opacity: f64,
)

Source from the content-addressed store, hash-verified

524}
525
526fn add_legend_entry(
527 ir: &plotlars_core::ir::trace::BoxPlotIR,
528 has_legend: &mut bool,
529 legend_entries: &mut Vec<LegendEntry>,
530 color: RGBColor,
531 opacity: f64,
532) {
533 if let Some(ref name) = ir.name {
534 *has_legend = true;
535 legend_entries.push(LegendEntry {
536 name: name.clone(),
537 color,
538 opacity,
539 kind: SwatchKind::Rect,
540 });
541 }
542}
543
544/// Deterministic pseudo-random jitter from value index. Determinism matters so
545/// SVG output is byte-stable across runs (relied on by integration tests).

Callers 2

draw_boxes_verticalFunction · 0.85
draw_boxes_horizontalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected