vuecore.schemas.basic.histogram module#

class vuecore.schemas.basic.histogram.HistogramConfig(*, x: str | None = None, y: str | None = None, color: str | None = None, hover_name: str | None = None, hover_data: List[str] = [], facet_row: str | None = None, facet_col: str | None = None, labels: Dict[str, str] | None = None, color_discrete_map: Dict[str, str] | None = None, category_orders: Dict[str, List[str]] | None = None, log_x: bool = False, log_y: bool = False, range_x: List[float] | None = None, range_y: List[float] | None = None, title: str = 'Plotly Plot', x_title: str | None = None, y_title: str | None = None, subtitle: str | None = None, template: str = 'plotly_white', width: int | None = 800, height: int | None = 600, pattern_shape: str | None = None, pattern_shape_map: Dict[str, str] | None = None, marginal: str | None = None, opacity: float = 0.8, orientation: str | None = None, barmode: str = 'relative', barnorm: str | None = None, histnorm: str | None = None, histfunc: str | None = 'count', cumulative: bool = False, nbins: int | None = None, text_auto: bool = False, **extra_data: Any)[source]#

Bases: PlotlyBaseConfig

Pydantic model for validating and managing histogram plot configurations, which extends PlotlyBaseConfig.

This model serves as a curated API for the most relevant parameters for histogram plots, closely aligned with the plotly.express.histogram API (https://plotly.com/python-api-reference/generated/plotly.express.histogram.html).

This model includes the most relevant parameters for data mapping, styling, and layout. It ensures that user-provided configurations are type-safe and adhere to the expected structure. The plotting function handles parameters defined here, and also accepts additional Plotly keyword arguments, forwarding them to the appropriate plotly.express.histogram or plotly.graph_objects.Figure call.

attribute pattern_shape: str | None = None#

Column to assign pattern shapes to bars.

attribute pattern_shape_map: Dict[str, str] | None = None#

Map values to specific pattern shapes.

attribute marginal: str | None = None#

Adds a marginal subplot (‘rug’, ‘box’, ‘violin’, ‘histogram’).

attribute opacity: float = 0.8#

Overall opacity of the bars.

attribute orientation: str | None = None#

Orientation of the bars (‘v’ for vertical, ‘h’ for horizontal).

attribute barmode: str = 'relative'#

Mode for grouping bars.

attribute barnorm: str | None = None#

Normalization mode for stacked bars (‘fraction’, ‘percent’).

attribute histnorm: str | None = None#

Normalization mode for the histogram (‘percent’, ‘probability’, ‘density’, ‘probability density’).

attribute histfunc: str | None = 'count'#

Function used to aggregate values (‘count’, ‘sum’, ‘avg’, ‘min’, ‘max’).

attribute cumulative: bool = False#

If True, histogram values are cumulative.

attribute nbins: int | None = None#

Sets the number of bins.

attribute text_auto: bool = False#

If True, displays text labels on bars.

validator validate_x_or_y_provided  »  all fields#

Ensure at least one of x or y is provided for the plot.

attribute x: str | None = None#

Column for x-axis values.

attribute y: str | None = None#

Column for y-axis values.

attribute color: str | None = None#

Column to assign color to plot elements.

attribute hover_name: str | None = None#

Column to appear in bold in the hover tooltip.

attribute hover_data: List[str] = []#

Additional columns for the hover tooltip.

attribute facet_row: str | None = None#

Column to create vertical subplots (facets).

attribute facet_col: str | None = None#

Column to create horizontal subplots (facets).

attribute labels: Dict[str, str] | None = None#

Dictionary to override column names for titles, legends, etc.

attribute color_discrete_map: Dict[str, str] | None = None#

Specific color mappings for values in the color column.

attribute category_orders: Dict[str, List[str]] | None = None#

Dictionary to specify the order of categorical values.

attribute log_x: bool = False#

If True, use a logarithmic x-axis.

attribute log_y: bool = False#

If True, use a logarithmic y-axis.

attribute range_x: List[float] | None = None#

Range for the x-axis, e.g., [0, 100].

attribute range_y: List[float] | None = None#

Range for the y-axis, e.g., [0, 100].

attribute title: str = 'Plotly Plot'#

The main title of the plot.

attribute x_title: str | None = None#

Custom title for the x-axis.

attribute y_title: str | None = None#

Custom title for the y-axis.

attribute subtitle: str | None = None#

The subtitle of the plot.

attribute template: str = 'plotly_white'#

Plotly template for styling.

attribute width: int | None = 800#

Width of the plot in pixels.

attribute height: int | None = 600#

Height of the plot in pixels.