# Bento box

The bento box is a way for the user to group charts together with a more fine tuned way of managing the sizes of the components. To group the charts the function `s.plt.set_bentobox` must be used, and to stop grouping the elements the user has to call the function `s.plt.pop_out_of_bentobox`. When defining the bento box the cols size and rows size can be defined which will will set the size of the bentobox in the main grid.

**Some behavior considerations:**

* The bento box has it's own grid, and this grid has a different distribution to the main grid:
  * <mark style="color:green;">**24 columns**</mark> <mark style="color:green;"></mark><mark style="color:green;">- NO gap</mark>
  * <mark style="color:green;">**Row size 16 px height**</mark> <mark style="color:green;"></mark><mark style="color:green;">- NO gap</mark>
* If components do not define the `rows_size` parameter, they will have:
  * Indicators components will have, by default, eight rows.
  * Other components will have, by default, 14 rows.
* If components do not define the `cols_size` parameter, they will have:Indicators comps will have, by default, 12 cols.
  * Other components will have, by default, 24 cols.

Example:

```python
s.plt.set_bentobox(cols_size=8, rows_size=3)

indicator_data = {
    "description": "",
    "title": "State",
    "value": "Open",
}

s.plt.indicator(
    data=indicator_data, order=0,
    rows_size=8, cols_size=12,
)

s.plt.indicator(
    data=indicator_data, order=1,
    rows_size=8, cols_size=12,
)

s.plt.bar(
    data=[
        {'date': dt.date(2021, 1, 1), 'x': 5, 'y': 5},
        {'date': dt.date(2021, 1, 2), 'x': 6, 'y': 5},
        {'date': dt.date(2021, 1, 3), 'x': 4, 'y': 5},
        {'date': dt.date(2021, 1, 4), 'x': 7, 'y': 5},
        {'date': dt.date(2021, 1, 5), 'x': 3, 'y': 5},
    ],
    x='date', order=2, rows_size=24, cols_size=24,
)

s.plt.pop_out_of_bentobox()
```

And create stuff such as:

![Two indicators and a bar chart grouped by a bentobox](https://3782181538-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUlHTfmIZY46Z1EDfyGMz%2Fuploads%2FSL98U3H8eJY5O3zJURZl%2FBentoBox.png?alt=media\&token=004deb14-1c6f-4b20-ad96-99ed1b5a87dd)
