package matrix

  1. Overview
  2. Docs

Module Matrix_charts.LegendSource

Chart legend rendering.

Sourcetype item = {
  1. label : string;
  2. style : Ansi.Style.t;
  3. marker : string;
}

The type for legend entries: coloured marker glyph followed by label text.

Sourceval 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.

Sourceval 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.