Liking cljdoc? Tell your friends :D
ClojureScript only.

active-viz.ticks


nice-tickscljs

(nice-ticks dmin dmax m)
(nice-ticks dmin dmax m q)
(nice-ticks dmin dmax m q min-coverage mrange)

Calculates an interval for ticks and a step-width. Uses the Wilkinson Labelling Algorithm as defined in "Wilkinson, L. (2005) The Grammar of Graphics, Springer-Verlag New York, Inc."

Takes

  • dmin, a lower bound of the value range
  • dmax, an upper bound of the value range
  • m is the target number of ticks in value range. This is a rough suggestion and will the real number of ticks is determined in the range mrange
  • q (optional), a vector of nice values, which are used to calculate intra-tick distance
  • min-coverage (optional) as a algorithm parameter, determining a minimum of interval coverage, defaults to 0.8
  • mrange (optional) the range in which the number of ticks is determined. This defaults to (/ m 2) and (* m 3)

Returns a map containing :lmin, :lmax and :lstep, where lmin is the lower bound of the interval lmax the upperbound and lstep the step-width. Also returns a score value in :score. The higher the score the better the result.

Calculates an interval for ticks and a step-width.
Uses the Wilkinson Labelling Algorithm as defined in
"Wilkinson, L. (2005) The Grammar of Graphics, Springer-Verlag New York, Inc."

Takes

* `dmin`, a lower bound of the value range
* `dmax`, an upper bound of the value range
* `m` is the target number of ticks in value range. This is a rough suggestion and will the real number of ticks is determined in the range `mrange`
* `q` (optional), a vector of nice values, which are used to calculate intra-tick distance
* `min-coverage` (optional) as a algorithm parameter, determining a minimum of interval coverage, defaults to 0.8
* `mrange` (optional) the range in which the number of ticks is determined. This defaults to `(/ m 2)` and `(* m 3)`


Returns a map containing `:lmin`, `:lmax` and `:lstep`, where lmin is the lower bound of
the interval lmax the upperbound and lstep the step-width.
Also returns a score value in `:score`. The higher the score the better the result. 
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close