Vz.DomDomains.
Domains describe sets of continuous or discrete values and how to inject them on the unit interval [0; 1.] and project them back.
Domains are also always equipped with a comparison function, a formatter and a function to select values for tick marks.
type piecewise_proj = | ProportionalThe bounds of the pieces are proportionally projected on the unit space. For example the bounds of the pieces [0.; 8.; 10.] are mapped on [0.; 0.8; 1.].
| UniformThe bounds of the pieces are uniformly projected on the unit space. For example [0.; 2.; 10.] are mapped on [0.; 0.5; 1.].
The type for projections on the unit interval for piecewise continuous domains.
type kind = | DiscreteFinite and ordered list of values.
*)| Continuous of piecewise_projPiecewise continuous domain.
*)The kind of domain, either discrete or continuous.
module Shape : sig ... endDomain shaping.
val inj : 'a t -> 'a -> floatinj d v maps value v of the domain in the unit interval [0; 1.]. If clamped d is false the resulting value can lie outisde the unit interval. If v cannot be mapped it maps to Float.nan.
val proj : 'a t -> float -> 'ainj d t is the inverse of proj, it maps t back to the domain value, if possible. If clamped d is true t is clamped to [0;1.]. If t cannot be mapped back it maps to none d.
val proj_extents : 'a t -> float -> 'a * 'ainv_map d t is the inverse of map, but maps back to a range of the original domain. This is useful if inv_map is a quantization of the unit interval. If it's not this returns the point range inv_map d t.
val values : 'a t -> 'a listvalues d is the list of values defining the domain. The semantics of which depends on kind.
val none : 'a t -> 'anone d is the value returned by invert map when the value cannot be mapped back.
val linear : ?nice:bool -> ?clamp:bool -> float -> float -> float tval log : ?base:float -> ?nice:bool -> ?clamp:bool -> float -> float -> float tval pow : ?exp:float -> ?nice:bool -> ?clamp:bool -> float -> float -> float tval sqrt : ?nice:bool -> ?clamp:bool -> float -> float -> float tdiscrete vs is a discrete domain with values vs. Given n values the ith zero-based position in the order is injected to i/n. The projection maps any value in the interval [i/n; (i+1)/n[ back to i. 1. maps to none which by default is the last n-1th element.