charted.utils package¶
Submodules¶
charted.utils.colors module¶
- charted.utils.colors.complementary_color(hex_color: str) str¶
- charted.utils.colors.generate_complementary_colors(hex_colors: list[str]) Generator[str, None, None]¶
- charted.utils.colors.hex_to_rgb(hex: str) tuple[int, int, int]¶
- charted.utils.colors.rgb_to_hex(rgb: tuple[int, int, int]) str¶
charted.utils.defaults module¶
charted.utils.exceptions module¶
- exception charted.utils.exceptions.InvalidValue(name: str, value: float)¶
Bases:
Exception
charted.utils.helpers module¶
- charted.utils.helpers.calculate_rotation_angle(total_label_width: float, total_permissible_width: float) float | None¶
- charted.utils.helpers.calculate_text_dimensions(text: str, font: str = 'Helvetica', font_size: int = 12) MeasuredText¶
- charted.utils.helpers.common_denominators(a: float, b: float) list[float]¶
- charted.utils.helpers.get_coefficient_and_exponent(value: float) tuple[float, float]¶
- charted.utils.helpers.nested_defaultdict() defaultdict¶
- charted.utils.helpers.rotate_coordinate(x: float, y: float, angle_degrees: float) tuple[float, float]¶
- charted.utils.helpers.round_to_clean_number(value: float, round_down: bool = False) float¶
charted.utils.themes module¶
- class charted.utils.themes.GridConfig¶
Bases:
TypedDict- stroke: str | None¶
- stroke_dasharray: str | None¶
- class charted.utils.themes.LegendConfig¶
Bases:
TypedDict- font_size: str | None¶
- legend_padding: float | None¶
- position: str | None¶
- class charted.utils.themes.PaddingConfig¶
Bases:
TypedDict- h_padding: float | None¶
- v_padding: float | None¶
charted.utils.transform module¶
- charted.utils.transform.rotate(angle: float, width: float, height: float) str¶
- charted.utils.transform.scale(x: float, y: float) str¶
- charted.utils.transform.translate(x: float, y: float) str¶
charted.utils.types module¶
- class charted.utils.types.AxisDimension(min_value, max_value, count)¶
Bases:
NamedTuple- count: float¶
Alias for field number 2
- max_value: float¶
Alias for field number 1
- min_value: float¶
Alias for field number 0
- property value_range: float¶