Radial Areas¶
- detroit.area_radial() AreaRadial¶
A radial area generator is like the Cartesian area generator except the x and y accessors are replaced with angle and radius accessors. Radial areas are positioned relative to the origin; use a transform to change the origin.
- Returns:
Radial area generator
- Return type:
- class detroit.shape.area_radial.AreaRadial¶
- __call__(data: Iterable[T]) str | None¶
Generates an area for the given array of data.
- Parameters:
data (Iterable[T]) – Data values
- Returns:
Generated area if the area is not associated to a context
- Return type:
str | None
Examples
>>> svg.append("path").attr("d", area(data))
- angle(angle: Callable[[T], float] | Callable[[T, int], float] | Callable[[T, int, list[Element]], float] | int | float) AreaRadial¶
Sets angle accessor function
- Parameters:
angle (Accessor[T, float] | Number) – angle accessor function
- Returns:
Itself
- Return type:
- start_angle(start_angle: Callable[[T], float] | Callable[[T, int], float] | Callable[[T, int, list[Element]], float] | int | float) AreaRadial¶
Sets start angle accessor function
- Parameters:
start_angle (Accessor[T, float] | Number) – angle accessor function
- Returns:
Itself
- Return type:
- end_angle(end_angle: Callable[[T], float] | Callable[[T, int], float] | Callable[[T, int, list[Element]], float] | int | float) AreaRadial¶
Sets start angle accessor function
- Parameters:
end_angle (Accessor[T, float] | Number) – angle accessor function
- Returns:
Itself
- Return type:
- radius(radius: Callable[[T], float] | Callable[[T, int], float] | Callable[[T, int, list[Element]], float] | int | float) AreaRadial¶
Sets radius accessor function
- Parameters:
radius (Accessor[T, float] | Number) – radius accessor function
- Returns:
Itself
- Return type:
- inner_radius(inner_radius: Callable[[T], float] | Callable[[T, int], float] | Callable[[T, int, list[Element]], float] | int | float) AreaRadial¶
Sets inner radius accessor function
- Parameters:
inner_radius (Accessor[T, float] | Number) – radius accessor function
- Returns:
Itself
- Return type:
- outer_radius(outer_radius: Callable[[T], float] | Callable[[T, int], float] | Callable[[T, int, list[Element]], float] | int | float) AreaRadial¶
Sets outer radius accessor function
- Parameters:
outer_radius (Accessor[T, float] | Number) – radius accessor function
- Returns:
Itself
- Return type:
- line_inner_radius() LineRadial¶
Returns a new radial line generator that has this radial area generator’s current defined accessor, curve and context. The line’s angle accessor is this area’s start angle accessor, and the line’s radius accessor is this area’s inner radius accessor.
- Returns:
Radial line generator based on the area parameters
- Return type:
- line_outer_radius() LineRadial¶
Returns a new radial line generator that has this radial area generator’s current defined accessor, curve and context. The line’s angle accessor is this area’s start angle accessor, and the line’s radius accessor is this area’s outer radius accessor.
- Returns:
Radial line generator based on the area parameters
- Return type:
- line_start_angle() LineRadial¶
Returns a new radial line generator that has this radial area generator’s current defined accessor, curve and context. The line’s angle accessor is this area’s start angle accessor, and the line’s radius accessor is this area’s inner radius accessor.
- Returns:
Radial line generator based on the area parameters
- Return type:
- line_end_angle() LineRadial¶
Returns a new radial line generator that has this radial area generator’s current defined accessor, curve and context. The line’s angle accessor is this area’s end angle accessor, and the line’s radius accessor is this area’s inner radius accessor.
- Returns:
Radial line generator based on the area parameters
- Return type:
- set_defined(defined: Callable[[T], bool] | Callable[[T, int], bool] | Callable[[T, int, list[Element]], bool] | int | float) Area¶
Sets defined accessor
When an area is generated, the defined accessor will be invoked for each element in the input data array, being passed the element
d, the indexi, and the arraydataas three arguments. If the given element is defined (i.e., if the defined accessor returns a truthy value for this element), thex0,x1,y0andy1accessors will subsequently be evaluated and the point will be added to the current area segment. Otherwise, the element will be skipped, the current area segment will be ended, and a new area segment will be generated for the next defined point. As a result, the generated area may have several discrete segments.
- set_curve(curve: Callable[[Path], Curve]) AreaRadial¶
Sets curve.
- Parameters:
- Returns:
Itself
- Return type: