package matrix

  1. Overview
  2. Docs

Module Matrix_charts.ScaleSource

Sourcetype 'd t

The type for specifications of scales of values 'd.

Sourceval linear : ?domain:(float * float) -> ?nice:bool -> ?zero:bool -> ?reverse:bool -> ?ticks:float list -> ?colors:Ansi.Color.t list -> unit -> float t

linear () is a scale that maps values linearly. domain replaces the fitted domain. nice, true by default for position scales and false for color scales, rounds a fitted domain outward to multiples of the step 1, 2 or 5 times a power of ten nearest a tenth of its length. zero widens it to 0. reverse maps the domain from 1 to 0. ticks puts the axis's ticks at those of its values in the shown domain. colors are a color scale's colors, low to high.

Raises Invalid_argument if domain is not finite and increasing or colors is empty.

Sourceval log : ?base:float -> ?domain:(float * float) -> ?nice:bool -> ?reverse:bool -> ?ticks:float list -> ?colors:Ansi.Color.t list -> unit -> float t

log () is a scale that maps the logarithms of values in base, 10. by default, as linear maps values, and nice rounds to powers of base.

Raises Invalid_argument if base is not above 1, or as linear raises, or if domain starts at or below 0.

Sourceval time : ?domain:(float * float) -> ?nice:bool -> ?offset_s:int -> unit -> float t

time () is a scale that maps Unix seconds linearly, and ticks and labels them in the local time offset_s seconds from UTC, 0 by default (Guides). nice rounds to boundaries of the calendar interval nearest a tenth of the domain's length.

Raises Invalid_argument as linear raises.

Sourceval band : ?domain:string list -> ?padding:float -> ?step:int -> ?reverse:bool -> ?colors:Ansi.Color.t list -> unit -> string t

band () is a scale that gives each category an equal band, in the order of domain or else in the order the figure first gives them. With domain, the rows of other categories are dropped. A bar leaves padding of its band empty, 0.2 by default. With step, a band is step cells and the bands start at the start of the axis. colors gives a color scale's categories their colors, in domain order, cycled.

Raises Invalid_argument if padding is not in [0;1\) or step is below 1, or colors is empty.