Symbols¶
- detroit.symbol(symbol_type: Callable[[Path, int | float], None] | None = None, size: Callable[[], int | float] | int | float | None = None)¶
Builds a new symbol generator of the specified symbol type and size.
- Parameters:
symbol_type (Callable[[Path, int | float], None] | None) – Symbol type - default
symbol_circlesize (Callable[[], int | float] | int | float | None) – Size - Default
64
- detroit.SYMBOLS_FILL = [<function symbol_circle>, <function symbol_cross>, <function symbol_diamond>, <function symbol_square>, <function symbol_star>, <function symbol_triangle>, <function symbol_wye>]¶
Built-in mutable sequence.
If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.
- detroit.SYMBOLS_STROKE = [<function symbol_asterisk>, <function symbol_circle>, <function symbol_diamond2>, <function symbol_plus>, <function symbol_square2>, <function symbol_times>, <function symbol_triangle2>]¶
Built-in mutable sequence.
If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.
- class detroit.shape.symbol.Symbol(symbol_type: Callable[[Path, int | float], None] | None = None, size: Callable[[], int | float] | int | float | None = None)¶
Builds a new symbol generator of the specified symbol type and size.
- Parameters:
symbol_type (Callable[[Path, int | float], None] | None) – Symbol type - default
symbol_circlesize (Callable[[], int | float] | int | float | None) – Size - Default
64
- __call__() str | None¶
Generates a symbol. With the default settings, invoking the symbol generator produces a circle of 64 square pixels.
- Returns:
Symbol path
- Return type:
str | None
- set_symbol_type(symbol_type: Callable[[Path, int | float], None]) Symbol¶
Sets the symbol type and returns this symbol generator.
- detroit.point_radial(angle: float, radius: float) tuple[float, float]¶
Returns the point
[x, y]for the given angle in radians, with 0 at -y (12 o’clock) and positive angles proceeding clockwise, and the given radius.- Parameters:
angle (float) – Angle value
radius (float) – Radius value
- Returns:
2D Point
- Return type:
Point2D