from typing import Union

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


@define
class DensityPlotParameters(PlotParameters):
    variable_x_axis: str = field(validator=instance_of(str))
    variable_y_axis: str = field(validator=instance_of(str))
    data_breakpoints: list[Union[int, float]] = field(
        validator=deep_iterable(
            member_validator=instance_of((int, float)),
            iterable_validator=instance_of(list),
        )
    )
