API reference — Manipulations¶
behaviz.manipulations.jitter ¶
BeeswarmJitter ¶
Bases: _JitterStrategy
Dot-swarm layout (replaces the free make_dot_swarm function).
Source code in behaviz/manipulations/jitter.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | |
behaviz.manipulations.smoother ¶
behaviz.manipulations.normaliser ¶
behaviz.manipulations.binner ¶
behaviz.manipulations.dodger ¶
Dodging: arrange side-by-side categories that share an x position.
A deterministic positioning transform (no RNG/state) used to place grouped bars
or error bars relative to each other instead of on top of one another. Like the
other manipulations it is a small strategy family — but with its own contract
(n_levels → placement rather than (x, y) → (x, y)), so it is not wired
into VisualManipulator; the grouping engine selects a strategy by name.
Strategies¶
centered side-by-side: tile n equal slots centered on each x.
stacked each level sits on the cumulative height of the levels below it.
DodgePlacement
dataclass
¶
How one level should be drawn. None fields leave the default in place.
Source code in behaviz/manipulations/dodger.py
41 42 43 44 45 46 47 | |
CenteredDodge ¶
Bases: _DodgeStrategy
Side-by-side bars/markers: equal slots tiled and centered on each x.
Source code in behaviz/manipulations/dodger.py
76 77 78 79 80 81 | |
StackedDodge ¶
Bases: _DodgeStrategy
Stacked bars: levels share x, each sitting on the cumulative height below.
Source code in behaviz/manipulations/dodger.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | |
dodge_offsets ¶
dodge_offsets(n_levels, total_width=0.8)
Tile n_levels slots, centered on each x position.
Returns (offsets, width) — the x offset per level (symmetric about 0)
and the per-level width (total_width / n_levels).
dodge_offsets(1) ([0.0], 0.8) dodge_offsets(2, total_width=0.8) ([-0.2, 0.2], 0.4)
Source code in behaviz/manipulations/dodger.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | |
get_dodge ¶
get_dodge(name)
Look up a dodge strategy by name.
Source code in behaviz/manipulations/dodger.py
121 122 123 124 125 126 | |