Liking cljdoc? Tell your friends :D

b1.ticks


coverageclj/s

(coverage d-min d-max l-min l-max)

Objective function based on distances between extreme data and extreme labels

Objective function based on distances between extreme data and extreme labels
sourceraw docstring

densityclj/s

(density r rt)

Objective function for a candidate density r and desired density rt (e.g. labels-per-cm)

Objective function for a candidate density `r` and desired density `rt` (e.g. labels-per-cm)
sourceraw docstring

index-ofclj/s

(index-of x coll)

Index of x in coll

Index of x in coll
sourceraw docstring

label-range-contains-zero?clj/s

(label-range-contains-zero? l-min l-max l-step)
source

max-coverageclj/s

(max-coverage d-min d-max span)

When the label range is centered on the data range

When the label range is centered on the data range
sourceraw docstring

max-densityclj/s

(max-density r rt)
source

max-simplicityclj/s

(max-simplicity q j)
source

Qclj/s

Preference-ordered list of nice step sizes

Preference-ordered list of nice step sizes
sourceraw docstring

(search [d-min d-max]
        &
        {:keys [target-density length clamp?]
         :or {target-density 0.01 length 500 clamp? false}})

Find best ticks for the data range [d-min, d-max]. Returns a map with {:min :max :step :extent :ticks} of optimal labeling (if one is found). Returns an empty map if no labelings can be found.

Kwargs:

:target-density labels per length, defaults to 0.01 (one label per 100 units)

:length available label spacing

:clamp? don't return ticks outside of data range, defaults to false.

Since there are no test input/output datasets for the labeling algorithm, I played it safe and copied the imperative algorithm from the paper. If you rewrite it in an understandable and performant functional style, I'll accept a pull request and buy you a bottle of whiskey.

Find best ticks for the data range `[d-min, d-max]`.
 Returns a map with `{:min :max :step :extent :ticks}` of optimal labeling (if one is found).
 Returns an empty map if no labelings can be found.

 Kwargs:

 > *:target-density* labels per length, defaults to 0.01 (one label per 100 units)

 > *:length* available label spacing

 > *:clamp?* don't return ticks outside of data range, defaults to false.

Since there are no test input/output datasets for the labeling algorithm, I played it safe and copied the imperative algorithm from the paper.
If you rewrite it in an understandable and performant functional style, I'll accept a pull request and buy you a bottle of whiskey.
sourceraw docstring

simplicityclj/s

(simplicity q j label-range-contains-zero)

Objective function modeling niceness of step sizes and whether a range includes zero

Objective function modeling niceness of step sizes and whether a range includes zero
sourceraw docstring

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

× close