[**BlockSuite API Documentation**](../../../../README.md) *** [BlockSuite API Documentation](../../../../README.md) / [@blocksuite/std](../../README.md) / [gfx](../README.md) / compareLayer # Function: compareLayer() > **compareLayer**(`a`, `b`): `SortOrder` A comparator function for sorting elements in the surface. SortOrder.AFTER means a should be rendered after b and so on. ## Parameters ### a `GfxModel` | `GfxLocalElementModel` ### b `GfxModel` | `GfxLocalElementModel` ## Returns `SortOrder`