> For the complete documentation index, see [llms.txt](https://b-hub.gitbook.io/faze/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://b-hub.gitbook.io/faze/v2.0.0/rendering/tree-renderers/squaretreerenderer.md).

# SquareTreeRenderer

Draws a tree by uniformly subdividing an image into squares. The number of branches at each depth is assumed to be constant and equal to: `SquareTreeRendererOptions.Size * SquareTreeRendererOptions.Size`

### Options

`SquareTreeRendererOptions`

```
    public int Size { get; }
    public int ImageSize { get; }
    public float BorderProportion { get; set; }
    public float MinChildDrawSize { get; set; }

    public IViewport Viewport { get; set; }
    public int? MaxDepth { get; set; }
```

| Property         | Type      | Description                                                                |
| ---------------- | --------- | -------------------------------------------------------------------------- |
| Size             | int       | Square size. E.g. a Size=2 for 2x2 grid                                    |
| ImageSize        | int       | Width and Height of the image in pixels                                    |
| BorderProportion | float     | Border size at each depth as a fraction of the parent's size               |
| MinChildDrawSize | float     | Nodes under this pixel size will be ignored by the renderer                |
| Viewport         | IViewport | Renders only a sub-portion of the image. Used for zooming                  |
| MaxDepth         | int?      | If a value is set, the renderer will ignore nodes past the specified depth |

### Examples

For more applied examples see [8 Queens Problem](/faze/v2.0.0/examples/8-queens-problem.md) and [Chess Pieces](/faze/v2.0.0/examples/chess-pieces.md)

#### Changing BorderProportion

![](https://2502734374-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MdM8iXEiSa6vIC3EFqT%2F-MejLh5ePta587Ay_MxH%2F-MejQID_786gJ94Drp_d%2Fchanging_border_2_3.gif?alt=media\&token=af9d66b5-166d-4bad-9cb0-a83adfec3993)
