package matrix

  1. Overview
  2. Docs

Module Matrix_charts.ViewSource

Sourcetype t

The type for views.

Sourceval empty : t

empty is the view without windows.

Sourceval window : string -> t -> (float * float) option

window n v is the window of scale n in v.

Sourceval set : string -> (float * float) option -> t -> t

set n w v is v with window w for scale n, or none.

Raises Invalid_argument if w is not finite and increasing.

Sourceval zoom : ?axes:[ `X | `Y | `Both ] -> figure -> float -> t -> t

zoom f k v is v with the shown domain of each continuous position scale of f on axes, `Both by default, k times narrower about its middle, in the space of the logarithms on a log scale. A window too narrow for floating-point numbers to narrow it further, or one that would pass the floats' range, is left unchanged.

Raises Invalid_argument if k is not finite and positive.

Sourceval pan : figure -> by:(float * float) -> t -> t

pan f ~by:(dx, dy) v is v with the shown domain of each continuous x scale of f moved dx times its length toward greater values, and of each y scale dy times. A window that would pass the floats' range is left unchanged.

Sourceval clamp : figure -> t -> t

clamp f v is v with each window moved inside its scale's domain in f, and removed where it is as wide as the domain or wider.