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

Function test_scatter_grouped_to_json

crates/plotlars-plotly/src/ext.rs:233–248  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

231
232 #[test]
233 fn test_scatter_grouped_to_json() {
234 let df = df![
235 "x" => [1.0, 2.0, 3.0, 4.0],
236 "y" => [10.0, 20.0, 30.0, 40.0],
237 "g" => ["a", "b", "a", "b"]
238 ]
239 .unwrap();
240 let plot = ScatterPlot::builder()
241 .data(&df)
242 .x("x")
243 .y("y")
244 .group("g")
245 .build();
246 let json = to_json_value(&plot);
247 assert_eq!(json["traces"].as_array().unwrap().len(), 2);
248 }
249
250 #[test]
251 fn test_scatter_trace_has_x_and_y() {

Callers

nothing calls this directly

Calls 3

to_json_valueFunction · 0.85
yMethod · 0.45
xMethod · 0.45

Tested by

no test coverage detected