plot_backend
Abstract base class for visualization backends.
Defines the common interface that all visualization backends (matplotlib, TikZ, d3.js, manim) must implement. Handles plot data extraction and provides standardized save/show methods.
Example
PlotBackend
¶
Abstract base class for all visualization backends.
Provides common interface for matplotlib, TikZ, d3.js, and manim backends. Extracts plot data and configuration for backend-specific rendering.
Source code in src/pathpyG/visualisations/plot_backend.py
__init__
¶
Initialize backend with plot data and configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plot
|
pathpyG.visualisations.pathpy_plot.PathPyPlot
|
PathPyPlot instance containing network data |
required |
show_labels
|
bool
|
Whether to display node labels |
required |
Source code in src/pathpyG/visualisations/plot_backend.py
save
¶
Save plot to file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
str
|
Output file path |
required |
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
Must be implemented by subclasses |
Source code in src/pathpyG/visualisations/plot_backend.py
show
¶
Display plot on screen.
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
Must be implemented by subclasses |