wrap_label

Documentation for eth_defi.vault_report.charts.wrap_label function.

wrap_label(text, width)

Word-wrap a chart label to Plotly <br> lines without truncating it.

Plotly annotations do not wrap text by themselves. Used for the chain and protocol names in the left margin of the dot plots. Each line is escaped, see plain_text().

Parameters
  • text (str) – Label.

  • width (int) – Maximum characters per line.

Returns

Label with <br> line breaks.

Return type

str