o
    xi                     @   s   d dl Z dd ZdS )    Nc                 C   s^   dd }|| }ddd|dgi}t |d}t|| W d   dS 1 s(w   Y  dS )	a  NOTE: To use this, you must modify your component to have an output called `mlpipeline_ui_metadata_path` AND call `wandb.init` yourself inside that component.

    Example usage:

    def my_component(..., mlpipeline_ui_metadata_path: OutputPath()):
        import wandb
        from wandb.integration.kfp.helpers import add_wandb_visualization

        with wandb.init() as run:
            add_wandb_visualization(run, mlpipeline_ui_metadata_path)

            ... # the rest of your code here
    c                 S   s   d| j  dS )Nz<iframe src="za?kfp=true" style="border:none;width:100%;height:100%;min-width:900px;min-height:600px;"></iframe>)url)run r   Q/home/ubuntu/.local/lib/python3.10/site-packages/wandb/integration/kfp/helpers.pyget_iframe_html   s   z0add_wandb_visualization.<locals>.get_iframe_htmloutputsmarkdowninline)typestoragesourcewN)openjsondump)r   mlpipeline_ui_metadata_pathr   iframe_htmlmetadatametadata_filer   r   r   add_wandb_visualization   s   "r   )r   r   r   r   r   r   <module>   s    