| 417 | @pytest.mark.parametrize("facet_col", [0, 1, 2, -1]) |
| 418 | @pytest.mark.parametrize("binary_string", [False, True]) |
| 419 | def test_facet_col(facet_col, binary_string): |
| 420 | img = np.random.randint(255, size=(10, 9, 8)) |
| 421 | facet_col_wrap = 3 |
| 422 | fig = px.imshow( |
| 423 | img, |
| 424 | facet_col=facet_col, |
| 425 | facet_col_wrap=facet_col_wrap, |
| 426 | binary_string=binary_string, |
| 427 | ) |
| 428 | nslices = img.shape[facet_col] |
| 429 | ncols = int(facet_col_wrap) |
| 430 | nrows = nslices // ncols + 1 if nslices % ncols else nslices // ncols |
| 431 | nmax = ncols * nrows |
| 432 | assert "yaxis%d" % nmax in fig.layout |
| 433 | assert "yaxis%d" % (nmax + 1) not in fig.layout |
| 434 | assert len(fig.data) == nslices |
| 435 | |
| 436 | |
| 437 | @pytest.mark.parametrize("animation_frame", [0, 1, 2, -1]) |