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

Function test_histogram_to_json

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

Source from the content-addressed store, hash-verified

260
261 #[test]
262 fn test_histogram_to_json() {
263 let df = df!["x" => [1.0, 2.0, 2.0, 3.0, 3.0, 3.0]].unwrap();
264 let plot = Histogram::builder().data(&df).x("x").build();
265 let json = to_json_value(&plot);
266 assert_eq!(json["traces"].as_array().unwrap().len(), 1);
267 assert_eq!(json["traces"][0]["type"], "histogram");
268 }
269
270 #[test]
271 fn test_line_to_json() {

Callers

nothing calls this directly

Calls 2

to_json_valueFunction · 0.85
xMethod · 0.45

Tested by

no test coverage detected