matrix.charts
Matrix_charts.Legend
Chart legend rendering.
matrix
matrix.ansi
matrix.glyph
matrix.grid
matrix.input
matrix.pty
matrix.screen
matrix.terminal
matrix.terminfo
matrix.vte
type item = {
label : string;
style : Ansi.Style.t;
marker : string;
}
The type for legend entries: coloured marker glyph followed by label text.
marker
label
val draw : ?direction:[ `Horizontal | `Vertical ] -> ?gap:int -> item list -> Grid.t -> width:int -> height:int -> unit
draw items grid ~width ~height renders legend items. direction defaults to `Vertical. gap defaults to 0 for vertical, 2 for horizontal.
draw items grid ~width ~height
direction
`Vertical
gap
0
2
val items_of_layout : Layout.t -> item list
items_of_layout layout extracts legend items from all marks that have a label. Mark types without legend support (rules, shades) are excluded.
items_of_layout layout