from typing import Optional

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


@define
class PercentageStackedBarChartPlotParameters(PlotParameters):
    variable_x_axis: str = field(validator=instance_of(str))
    variables_to_compare: list[str] = field(
        validator=deep_iterable(
            member_validator=instance_of(str), iterable_validator=instance_of(list)
        )
    )
    chart_orientation: str = field(validator=instance_of(str))
    sort_order: str = field(validator=instance_of(str))
