o
    xi                     @  sP   d dl mZ d dlmZ d dlmZ erd dlZd dlmZ 		ddddZdS )    )annotations)TYPE_CHECKING
plot_tableN)CustomChart Ftablewandb.Tablevaluestrtitlesplit_tableboolreturnr   c                 C  s   t | dd|id|i|dS )a  Constructs a histogram chart from a W&B Table.

    Args:
        table: The W&B Table containing the data for the histogram.
        value: The label for the bin axis (x-axis).
        title: The title of the histogram plot.
        split_table: Whether the table should be split into a separate section
            in the W&B UI. If `True`, the table will be displayed in a section named
            "Custom Chart Tables". Default is `False`.

    Returns:
        CustomChart: A custom chart object that can be logged to W&B. To log the
            chart, pass it to `wandb.log()`.

    Example:

    ```python
    import math
    import random
    import wandb

    # Generate random data
    data = [[i, random.random() + math.sin(i / 10)] for i in range(100)]

    # Create a W&B Table
    table = wandb.Table(
        data=data,
        columns=["step", "height"],
    )

    # Create a histogram plot
    histogram = wandb.plot.histogram(
        table,
        value="height",
        title="My Histogram",
    )

    # Log the histogram plot to W&B
    with wandb.init(...) as run:
        run.log({"histogram-plot1": histogram})
    ```
    zwandb/histogram/v0r
   r   )
data_tablevega_spec_namefieldsstring_fieldsr   r   )r   r
   r   r    r   H/home/ubuntu/.local/lib/python3.10/site-packages/wandb/plot/histogram.py	histogram   s   0r   )r   F)
r   r	   r
   r   r   r   r   r   r   r   )	
__future__r   typingr   wandb.plot.custom_chartr   wandbr   r   r   r   r   r   <module>   s    