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

Function test_line_to_json

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

Source from the content-addressed store, hash-verified

269
270 #[test]
271 fn test_line_to_json() {
272 let df = df!["x" => [1.0, 2.0, 3.0], "y" => [4.0, 5.0, 6.0]].unwrap();
273 let plot = LinePlot::builder().data(&df).x("x").y("y").build();
274 let json = to_json_value(&plot);
275 assert_eq!(json["traces"].as_array().unwrap().len(), 1);
276 assert_eq!(json["traces"][0]["type"], "scatter");
277 }
278
279 // ---- E2E scatter tests ----
280

Callers

nothing calls this directly

Calls 3

to_json_valueFunction · 0.85
yMethod · 0.45
xMethod · 0.45

Tested by

no test coverage detected