Radial Lines¶
- detroit.line_radial() LineRadial¶
A radial line generator is like the Cartesian line generator except the x and y accessors are replaced with angle and radius accessors. Radial lines are positioned relative to the origin; use a transform to change the origin.
- Returns:
Radial line generator
- Return type:
- class detroit.shape.line_radial.LineRadial¶
- __call__(data: Iterable[T]) str | None¶
Generate a line for the given list of data
- Parameters:
data (Iterable[T]) – Data values
- Returns:
Generated line if the line is not associated to a context
- Return type:
str | None
Examples
>>> svg.append("path").attr("d", line(data)).attr("stroke", "currentColor")
- angle(angle: Callable[[T], float] | Callable[[T, int], float] | Callable[[T, int, list[Element]], float] | int | float) LineRadial¶
Sets angle accessor function
- Parameters:
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) LineRadial¶
Sets radius accessor function
- Parameters:
radius (Accessor[T, float] | Number) – radius accessor function
- Returns:
Itself
- Return type:
- set_defined(defined: Callable[[T], bool] | Callable[[T, int], bool] | Callable[[T, int, list[Element]], bool] | int | float) Line¶
Sets defined accessor
When a line 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), the x and y accessors will subsequently be evaluated and the point will be added to the current line segment. Otherwise, the element will be skipped, the current line segment will be ended, and a new line segment will be generated for the next defined point.
- set_curve(curve: Callable[[Path], Curve]) LineRadial¶
Sets curve.
- Parameters:
- Returns:
Itself
- Return type: