from typing import Iterable, Union

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


@define
class HeatmapParameters(PlotParameters):
    axis_variables: list[str] = field(
        validator=deep_iterable(
            member_validator=instance_of(str), iterable_validator=instance_of(Iterable)
        ),
    )
    heat_variable: str = field(validator=instance_of(str))
    axis_maxima: list[Union[int, float]] = field(
        validator=deep_iterable(
            member_validator=instance_of((int, float)),
            iterable_validator=instance_of(Iterable),
        ),
    )
    axis_minima: list[Union[int, float]] = field(
        validator=deep_iterable(
            member_validator=instance_of((int, float)),
            iterable_validator=instance_of(Iterable),
        ),
    )
    logarithmic_heat_scaling: str = field(validator=instance_of(str))
