Liking cljdoc? Tell your friends :D
All platforms.

b1.layout.histogram


histogramclj/s

(histogram
  data
  &
  {:keys [value index range bins]
   :or {value :value
        range (fn [xs _] ((juxt (partial reduce min) (partial reduce max)) xs))
        bins (fn [r xs _] (fixed-size-bins r (sturges xs)))}})

The histogram layout transforms data by grouping descrete data points into bins. Returns a collection of values with the following metadata set:

:x the lower bound of the bin (inclusive).

:dx the width of the bin; x + dx is the upper bound (exclusive).

:y the count

Kwargs:

:value fn that calculates value of node, defaults to :value

:index opaque value passed to :bins and :range

:range fn which calculates the minimum and maximum values given the array of values

:bins Number of bins /or/ fn that takes the range, array of values, and current index

The histogram layout transforms data by grouping descrete data points into
bins. Returns a collection of values with the following metadata set:

> *:x* the lower bound of the bin (inclusive).

> *:dx* the width of the bin; x + dx is the upper bound (exclusive).

> *:y* the count

 Kwargs:

 > *:value* fn that calculates value of node, defaults to `:value`

 > *:index* opaque value passed to `:bins` and `:range`

 > *:range* fn which calculates the minimum and maximum values given the array of values

 > *:bins* Number of bins /or/ fn that takes the range, array of values, and current index
sourceraw docstring

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

× close