An angle scale: a cyclic domain — bearing, hour of day, day of year — to radians (spec/03 §14, D-30).
The mapping is Visualize.Scale.Linear's with a range in radians, one full turn by
default; angles follow Visualize.Shape.Arc's convention, clockwise from 12 o'clock, so a
bearing domain [0, 360] needs no offset. ticks/2 returns count equal divisions of
the domain — exact, not the nice-step sequence — and nice/1 is identity: the domain of
a cyclic quantity is its period.
bearing = Visualize.Scale.radial() |> Visualize.Scale.domain([0, 360])
Visualize.Scale.apply(bearing, 90) # => π/2
Visualize.Scale.ticks(bearing, 4) # => [0.0, 90.0, 180.0, 270.0]
Summary
Functions
Maps a domain value to radians
Returns 0: a radial scale has no bandwidth
Enables or disables clamping
Sets the domain
Maps radians back to the domain; never clamps
Creates a radial scale: domain [0, 1], range [0, 2π]
Identity: the domain of a cyclic quantity is its period
Identity: a radial scale has no padding
Sets the range, in radians
Returns count equal divisions of the domain from d0.
Types
Functions
Maps a domain value to radians
@spec bandwidth(t()) :: 0
Returns 0: a radial scale has no bandwidth
Enables or disables clamping
Sets the domain
Maps radians back to the domain; never clamps
@spec new() :: t()
Creates a radial scale: domain [0, 1], range [0, 2π]
Identity: the domain of a cyclic quantity is its period
Identity: a radial scale has no padding
Sets the range, in radians
Returns count equal divisions of the domain from d0.
The last division, d1, is dropped when the range is a full turn — it coincides with
the first on the circle — and kept otherwise. count <= 0 yields [].