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_circle

  • size (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.

../../_images/light_symbols_fill.svg ../../_images/dark_symbols_fill.svg
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.

../../_images/light_symbols_stroke.svg ../../_images/dark_symbols_stroke.svg
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_circle

  • size (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.

Parameters:

symbol_type (Callable[[Path, int | float], None]) – Symbol type

Returns:

Itself

Return type:

Symbol

set_size(size: Callable[[], int | float] | int | float) Symbol

Sets the size of the symbol and returns this symbol generator.

Parameters:

size (Callable[[], int | float] | int | float) – Size function or constant

Returns:

Itself

Return type:

Symbol

set_context(context: Path) Symbol

Sets the context and returns this symbol generator.

Parameters:

context (Path) – Context

Returns:

Itself

Return type:

Symbol

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