Module deeporigin.src.utilities.visualize

Functions

def jupyter_visualization(func)
Expand source code
def jupyter_visualization(func):
    """Decorator for rendering HTML visualizations in Jupyter notebooks.

    This decorator wraps functions that return HTML content and renders them 
    properly in Jupyter notebook cells using JupyterViewer.

    Args:
        func (callable): The function to be decorated. Should return HTML content as string.

    Returns:

    callable
        Wrapped function that renders the HTML visualization in Jupyter notebook.

    Examples:
    
    @jupyter_visualization
    def plot_graph():
        return "<div>Graph HTML</div>"
    """

    def wrapper(*args, **kwargs):
        html_visualization = func(*args, **kwargs)
        return JupyterViewer.visualize(html_visualization)
    return wrapper

Decorator for rendering HTML visualizations in Jupyter notebooks.

This decorator wraps functions that return HTML content and renders them properly in Jupyter notebook cells using JupyterViewer.

Args

func : callable
The function to be decorated. Should return HTML content as string.

Returns:

callable Wrapped function that renders the HTML visualization in Jupyter notebook.

Examples:

@jupyter_visualization def plot_graph(): return "

Graph HTML
"