package matrix

  1. Overview
  2. Docs

Module Matrix_charts.ScaleSource

Axis scaling strategies.

Scales control how data values map to pixel positions.

Sourcetype numeric_domain = [
  1. | `Auto
  2. | `Domain of float * float
]

The type for domain specifications. `Auto infers bounds from the data.

Sourcetype t =
  1. | Auto
    (*

    Infer scale type from marks. Selects Band when bar marks are present, Numeric otherwise.

    *)
  2. | Numeric of {
    1. domain : numeric_domain;
    2. clamp : bool;
    }
    (*

    Linear numeric scale. When clamp is true, values outside the domain are clamped.

    *)
  3. | Log of {
    1. base : float;
    2. domain : numeric_domain;
    3. clamp : bool;
    }
    (*

    Logarithmic scale. Positive values only; values <= 0 are clamped to 1e-10.

    *)
  4. | Band of {
    1. categories : string list option;
    2. padding : float;
    }
    (*

    Categorical band scale. Each category gets an equal-width band. padding ([0, 0.95]) controls inter-band spacing.

    *)
Sourceval numeric : ?domain:numeric_domain -> ?clamp:bool -> unit -> t

numeric () is a linear numeric scale. domain defaults to `Auto. clamp defaults to true.

Sourceval log : ?base:float -> ?domain:numeric_domain -> ?clamp:bool -> unit -> t

log () is a logarithmic scale. base defaults to 10.0 and must be > 1 (values <= 1 fall back to 10). domain defaults to `Auto. clamp defaults to true.

Sourceval band : ?categories:string list -> ?padding:float -> unit -> t

band () is a categorical band scale. categories is an explicit category order; None infers from marks. padding defaults to 0.1, clamped to [0, 0.95].