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:

AreaRadial

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:

AreaRadial

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:

AreaRadial

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:

AreaRadial

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:

AreaRadial

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:

AreaRadial

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:

AreaRadial

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:

LineRadial

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:

LineRadial

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:

LineRadial

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:

LineRadial

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 index i, and the array data as three arguments. If the given element is defined (i.e., if the defined accessor returns a truthy value for this element), the x0, x1, y0 and y1 accessors 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.

Parameters:

defined (Accessor[T, bool] | Number) – defined accessor function

Returns:

Itself

Return type:

Area

set_curve(curve: Callable[[Path], Curve]) AreaRadial

Sets curve.

Parameters:

curve (Callable[[Path], Curve]) – Curve factory function

Returns:

Itself

Return type:

AreaRadial

set_context(context: Path | None = None) Area

Sets the context.

Parameters:

context (Path | None) – Path

Returns:

Itself

Return type:

Area