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

Function horizontal_legend_border_debug

crates/plotlars-plotters/src/ext.rs:121–146  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

119
120 #[test]
121 fn horizontal_legend_border_debug() {
122 use plotlars_core::components::{Legend, Orientation};
123 let df = df![
124 "x" => [1.0, 2.0, 3.0],
125 "y" => [4.0, 5.0, 6.0],
126 "g" => ["a", "b", "c"]
127 ]
128 .unwrap();
129 let plot = ScatterPlot::builder()
130 .data(&df)
131 .x("x")
132 .y("y")
133 .group("g")
134 .legend_title("test")
135 .legend(
136 &Legend::new()
137 .orientation(Orientation::Horizontal)
138 .border_width(50),
139 )
140 .build();
141 let svg = plot.to_svg();
142 assert!(
143 svg.contains("stroke-width=\"50\""),
144 "SVG should contain stroke-width=50"
145 );
146 }
147
148 #[test]
149 fn line_plot_renders_to_svg() {

Callers

nothing calls this directly

Calls 5

to_svgMethod · 0.80
yMethod · 0.45
xMethod · 0.45
border_widthMethod · 0.45
orientationMethod · 0.45

Tested by

no test coverage detected