()
| 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() { |
nothing calls this directly
no test coverage detected