(
node_id: Sequence[str],
parent_id: Sequence[str | None],
height: Sequence[float] | None = None,
)
| 109 | return { |
| 110 | "chart": "grouped_bar", |
| 111 | "left": {"name": left_name, "labels": list(left_labels), "values": list(left_values)}, |
| 112 | "right": {"name": right_name, "labels": list(right_labels), "values": list(right_values)}, |
| 113 | } |
| 114 | |
| 115 | |
| 116 | def prepare_drawdown_payload( |
| 117 | timestamps: Sequence[str], equity_curve: Sequence[float] |
| 118 | ) -> dict[str, Any]: |
| 119 | """Build a line-chart payload of an equity curve and its drawdown. |
| 120 | |
| 121 | Drawdown is `equity / running_max(equity) - 1`, so it is 0 at each new high and |
| 122 | negative below it; it assumes a positive equity curve. Timestamps are parsed and |
| 123 | re-rendered with `str`, so a timestamp that fails to parse comes out as `"None"`. |
| 124 | |
| 125 | Parameters |
| 126 | ---------- |
nothing calls this directly
no outgoing calls
no test coverage detected