Liking cljdoc? Tell your friends :D

scicloj.plotje.impl.position

Position adjustment -- composable transforms on layer descriptors. Runs between extract-layer and build-panels in the plan pipeline.

Position types: :identity -- no adjustment (default) :dodge -- side-by-side within a categorical band (annotation) :stack -- cumulative y-values across groups (data transform) :fill -- normalized cumulative y, sums to 1.0 (data transform)

Position adjustment -- composable transforms on layer descriptors.
Runs between extract-layer and build-panels in the plan pipeline.

Position types:
  :identity -- no adjustment (default)
  :dodge    -- side-by-side within a categorical band (annotation)
  :stack    -- cumulative y-values across groups (data transform)
  :fill     -- normalized cumulative y, sums to 1.0 (data transform)
raw docstring

apply-positioncljmultimethod

Apply position adjustment to layers sharing a position type. Returns a vec of adjusted layers.

Apply position adjustment to layers sharing a position type.
Returns a vec of adjusted layers.
sourceraw docstring

apply-positionsclj

(apply-positions layers)
(apply-positions layers rank)

Apply position adjustments to all layers in a panel. Groups layers by position type and applies adjustments per group. Stack/fill: modifies y-values (data transform). Dodge: annotates groups with indices (layout annotation).

The returned layers are in the input (pose) order, which becomes the paint order downstream. Grouping by position type is only an internal step so stack/dodge can compute geometry shared across same-position layers; it must not leak into paint order. (It used to: emitting in the canonical position order meant text/label marks -- position :identity -- always painted before, and so under, bar marks -- position :dodge/:stack -- regardless of the order the author added them.)

rank, when given, maps a category's drawn label to its place in the order the plot settled on. It reaches :dodge on each layer and is stripped again here, the way :__layer-order is.

Apply position adjustments to all layers in a panel.
Groups layers by position type and applies adjustments per group.
Stack/fill: modifies y-values (data transform).
Dodge: annotates groups with indices (layout annotation).

The returned layers are in the input (pose) order, which becomes the
paint order downstream. Grouping by position type is only an internal
step so stack/dodge can compute geometry shared across same-position
layers; it must not leak into paint order. (It used to: emitting in
the canonical position order meant text/label marks -- position
:identity -- always painted before, and so under, bar marks -- position
:dodge/:stack -- regardless of the order the author added them.)

`rank`, when given, maps a category's drawn label to its place in
the order the plot settled on. It reaches `:dodge` on each layer and
is stripped again here, the way `:__layer-order` is.
sourceraw docstring

cohort-keyclj

(cohort-key g)

What tells one dodged group from another.

A group's :label is what the legend prints, and where the grouping unites several columns it is only the colour column's value -- so two groups that a compound key separated read as one label. :group-key is that key, kept whole. Reading the label instead gave {:color :part :group :dimension} two dodge slots for four groups, and the four bars were drawn at two places.

Boxes and violins carry no key of their own, so their category stands in, which is what they dodged by before.

What tells one dodged group from another.

A group's `:label` is what the legend prints, and where the
grouping unites several columns it is only the colour column's
value -- so two groups that a compound key separated read as one
label. `:group-key` is that key, kept whole. Reading the label
instead gave `{:color :part :group :dimension}` two dodge slots for
four groups, and the four bars were drawn at two places.

Boxes and violins carry no key of their own, so their category
stands in, which is what they dodged by before.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close