layout_properties

Documentation for eth_defi.vault_report.charts.layout_properties function.

layout_properties(properties, width)

Flow vault properties into rows that fit a width.

A greedy line break: each property, icon plus text, goes on the current row if it fits, otherwise it starts a new row. A row always takes its first property, even if it is wider than width. Callers use the row count to size the label block before drawing it, and add_property_rows() draws the same rows.

Parameters
Returns

Rows of (property, x offset in pixels).

Return type

list[list[tuple[eth_defi.vault_report.charts.VaultProperty, float]]]