from typing import Union, Optional

from attrs import field, define
from attrs.validators import instance_of, optional
from src.data_classes.parameters_visualization import PlotParameters


@define
class HexbinPlotParameters(PlotParameters):
    variable_x_axis: str = field(validator=instance_of(str))
    variable_y_axis: str = field(validator=instance_of(str))
    x_axis_maximum: Optional[Union[int, float]] = field(
        default=None, validator=optional(instance_of((int, float))), kw_only=True
    )
    y_axis_maximum: Optional[Union[int, float]] = field(
        default=None, validator=optional(instance_of((int, float))), kw_only=True
    )
    trendline: bool = field(validator=instance_of(bool))
    logarithmic_hex_scaling: bool = field(validator=instance_of(bool))
