Rose generator: one Visualize.Shape.Arc sector per datum, centred on its angle and
as long as its value (spec/04 §15, D-31).
angle/2 and width/2 are in the domain units of the radial scale given to scale/2
(radians without one); the radii are pixels. Each datum's path is exactly the Arc
call with the same numbers, so a stacked wind rose is several roses with rising inner
radii.
Examples
bearing = Visualize.Scale.radial() |> Visualize.Scale.domain([0, 360])
radius = Visualize.Scale.sqrt() |> Visualize.Scale.domain([0, 40]) |> Visualize.Scale.range([0, 120])
rose =
Visualize.Shape.Rose.new()
|> Visualize.Shape.Rose.scale(bearing)
|> Visualize.Shape.Rose.angle(:bearing)
|> Visualize.Shape.Rose.width(45)
|> Visualize.Shape.Rose.outer_radius(fn d -> Visualize.Scale.apply(radius, d.count) end)
|> Visualize.Shape.Rose.pad_angle(0.02)
paths = Visualize.Shape.Rose.generate(rose, bins)
Summary
Functions
Sets the sector-centre accessor, in the scale's domain units
Returns one SVG path-data string per datum
Returns one IR.Path per datum: the Arc sector centred on its angle
Sets the inner radius accessor, in pixels
Creates a rose generator reading tuple elements 0 and 1 as angle and outer radius
Sets the outer radius accessor, in pixels
Sets the pad angle accessor, radians, as Visualize.Shape.Arc.pad_angle/2
Sets the radial scale the angles map through; nil means radians
Sets the sector-width accessor, in the scale's domain units
Types
Functions
Sets the sector-centre accessor, in the scale's domain units
@spec generate(t(), Visualize.Data.Table.source()) :: [String.t()]
Returns one SVG path-data string per datum
@spec generate_path(t(), Visualize.Data.Table.source()) :: [Visualize.IR.Path.t()]
Returns one IR.Path per datum: the Arc sector centred on its angle
Sets the inner radius accessor, in pixels
@spec new() :: t()
Creates a rose generator reading tuple elements 0 and 1 as angle and outer radius
Sets the outer radius accessor, in pixels
Sets the pad angle accessor, radians, as Visualize.Shape.Arc.pad_angle/2
Sets the radial scale the angles map through; nil means radians
Sets the sector-width accessor, in the scale's domain units