tooluniverse.visualization_tool moduleΒΆ

Visualization Tool Base Class for ToolUniverseΒΆ

This module provides the base VisualizationTool class that all visualization tools inherit from. It provides common functionality for HTML generation, image conversion, error handling, and output formatting.

class tooluniverse.visualization_tool.VisualizationTool[source]ΒΆ

Bases: BaseTool

Base class for all visualization tools in ToolUniverse.

Provides common functionality for: - HTML generation and embedding - Static image conversion - Error handling - Output formatting

__init__(tool_config)[source]ΒΆ
create_visualization_response(html_content, viz_type, data=None, static_image=None, metadata=None)[source]ΒΆ

Create a standardized visualization response.

create_error_response(error_message, error_type='VisualizationError')[source]ΒΆ

Create a standardized error response.

convert_to_base64_image(image_data, format='PNG')[source]ΒΆ

Convert image data to base64 string.

create_plotly_html(fig, width=None, height=None, include_plotlyjs='cdn')[source]ΒΆ

Create HTML from Plotly figure.

create_py3dmol_html(viewer_html, width=None, height=None, title=None, info_cards='', control_panel='', toolbar='')[source]ΒΆ

Create modern HTML wrapper for py3Dmol viewer.

add_3d_controls_script()[source]ΒΆ

Add JavaScript for 3D viewer controls.

create_molecule_2d_html(molecule_image, molecule_info, width=None, height=None, title=None)[source]ΒΆ

Create modern HTML for 2D molecule visualization.