graph LR
ItermplotFigureManager["ItermplotFigureManager"]
FigureCanvasItermplotPng["FigureCanvasItermplotPng"]
FigureCanvasItermplotPdf["FigureCanvasItermplotPdf"]
imgcat["imgcat"]
ItermplotImageMagickWriter["ItermplotImageMagickWriter"]
ItermplotFigureManager -- "uses" --> FigureCanvasItermplotPng
ItermplotFigureManager -- "uses" --> FigureCanvasItermplotPdf
ItermplotFigureManager -- "delegates to" --> imgcat
ItermplotFigureManager -- "delegates to" --> ItermplotImageMagickWriter
The itermplot subsystem primarily facilitates the display of Matplotlib plots within the iTerm2 terminal. The central orchestrator is ItermplotFigureManager, which manages the overall plot display process, deciding whether to render a static image or an animation. For static image display, ItermplotFigureManager delegates to either FigureCanvasItermplotPng or FigureCanvasItermplotPdf to render the plot into an image buffer, which is then passed to the imgcat utility for direct display in iTerm2. For animated plots, ItermplotFigureManager utilizes ItermplotImageMagickWriter to process and convert image frames into an animated format (e.g., GIF), which is then also displayed via imgcat. This architecture effectively separates the concerns of plot rendering, image processing, and iTerm2 integration.
Acts as the primary coordinator for displaying plots. It determines whether to render a static image or an animation based on plot characteristics or configuration, and manages the display loop for animated sequences. This component embodies the "Backend/Library" aspect, serving as the main entry point for plot display.
Related Classes/Methods:
Integrates directly with Matplotlib's rendering pipeline for PNG output. Its responsibility is to capture the rendered plot output as a PNG image buffer from Matplotlib and make it available for subsequent display operations. This component functions as a "Plugin" or "Adapter" for Matplotlib's Agg backend.
Related Classes/Methods:
Integrates directly with Matplotlib's rendering pipeline for PDF output. Its responsibility is to capture the rendered plot output as a PDF image buffer from Matplotlib and make it available for subsequent display operations. This component functions as a "Plugin" or "Adapter" for Matplotlib's PDF backend.
Related Classes/Methods:
A utility component specifically designed to handle the direct display of a single static image within the iTerm2 terminal. It achieves this by sending the appropriate iTerm2 escape codes. This is a specialized "iTerm2 Integration Module" utility.
Related Classes/Methods:
Responsible for processing and preparing image data, particularly for animated sequences. This involves tasks such as format conversions (e.g., to GIF) or optimizations using the ImageMagick library. This component aligns with the "Image Processing/Conversion Module" pattern.
Related Classes/Methods: