package matrix

Build not checked
  1. Overview
  2. Docs
Fast, modern terminal toolkit for OCaml

Install

dune-project
 Dependency

Authors

Maintainers

Sources

mosaic-0.2.0.tbz
sha256=ab48bc02082f9c1deea0769a13c2935df529536630745ec3a3d718f59656109b
sha512=c0f3c490e13ca60217d9d59c9bfdf3ada12e1565f04fe2a623e7c94298d519393eabe404e2317726712bf5e7fa860780a07494e77994ac05032e71f535c56910

doc/matrix.charts/Matrix_charts/Layout/index.html

Module Matrix_charts.LayoutSource

Sourcetype t

The type for figures laid out in a region.

Sourcetype value =
  1. | Num of float
  2. | Cat of string
    (*

    The type for scale values.

    *)

plot l is l's plot.

Sourceval value : t -> string -> (int * int) -> value option

value l n c is the value of scale n at the middle of cell c, or the category whose band holds it, and None if c is outside the plot.

Raises Invalid_argument if n is not a position scale of l.

Sourceval position : t -> string -> value -> int

position l n v is the column, or for a y scale the row of cells, of v on scale n, clamped to the plot, and for a category its band's middle.

Raises Invalid_argument if n is not a position scale of l, or v is not one of its values.

Sourceval domain : t -> string -> value list

domain l n is the shown domain [Num lo; Num hi] of scale n, or its categories.

Raises Invalid_argument if n is not a position scale of l.

Sourceval zoom : ?axes:[ `X | `Y | `Both ] -> t -> at:(int * int) -> float -> View.t

zoom l ~at k is l's view with the shown domain of each continuous position scale on axes, `Both by default, k times narrower about its value at cell at, or at the plot's nearest cell if at is outside it. A layout of the new view whose plot has the same place shows that value at at.

Raises Invalid_argument if k is not finite and positive.

Sourceval pan : t -> by:(int * int) -> View.t

pan l ~by:(dx, dy) is l's view in which the data drawn at cell (x, y) is drawn at (x + dx, y + dy). For a drag, by is the pointer's move in cells since the previous event.

Sourceval hit : ?radius:float -> ?metric:[ `Euclidean | `X | `Y ] -> t -> (int * int) -> hit option

hit l c is the row whose mark inked cell c last. When no mark inked c, it is the row that inked last the nearest cell within radius, 3. by default, the later mark's of two at one distance, and None if there is none or c is outside the plot. Distances are in columns. `Euclidean, the default, counts a row of cells as Theme.t.aspect columns. `X keeps the cells within radius columns and adds a hundredth of the vertical distance, which breaks ties, and `Y the converse. It inks the marks again, so it costs about a draw.

Sourceval legend : t -> (string * Ansi.Color.t * string) list

legend l is the category, color and glyph of every legend entry of l, for a program that draws a legend itself.