online_trace_visualizer
Online trace visualizer implementation.
This module provides concrete visualizer for rendering online detection traces including detection function values and processing times.
- class pysatl_cpd.analysis.visualization.online.online_trace_visualizer.OnlineTraceVisualizer(backend, state_visualizer)[source]
Bases:
ITraceVisualizer[OnlineDetectionTrace],GenericVisualizer for online detection trace results.
This visualizer renders detection function values and processing times. Annotations such as change points, learning periods, and skip periods should be added by the caller using separate visual components.
- Parameters:
backend (
DrawBackend) – Plotting backend to use for rendering.state_visualizer (
IOnlineStateVisualizer[TypeVar(StateT, bound=OnlineAlgorithmState)]) – Visualizer for algorithm state evolution.
- __init__(backend, state_visualizer)[source]
- Parameters:
backend (DrawBackend)
state_visualizer (IOnlineStateVisualizer)
- Return type:
None
- set_trace(trace)[source]
Set the detection trace to visualize.
- Parameters:
trace (
OnlineDetectionTrace[TypeVar(StateT, bound=OnlineAlgorithmState)]) – Detection results containing detection function values, processing times, and algorithm states.- Returns:
Returns self to allow method chaining.
- Return type:
Self
- property backend: DrawBackend
Current drawing backend.
- Return type:
DrawBackend
- set_state_visualizer(state_visualizer)[source]
Replace the state visualizer used by this trace visualizer.
- Parameters:
state_visualizer (
IOnlineStateVisualizer[TypeVar(StateT, bound=OnlineAlgorithmState)]) – New state visualizer instance.- Return type:
Self
- set_detection_func_plot_opts(**options)[source]
Set general plot options for detection function subplot.
- Parameters:
**options (
Unpack[PlotSpec]) –- xlabelstr
X-axis label.
- ylabelstr
Y-axis label.
- gridbool
Whether to show grid lines.
- Returns:
Returns self to allow method chaining.
- Return type:
Self
- set_detection_func_draw_opts(**options)[source]
Set drawing options for detection function line.
- Parameters:
**options (
Unpack[LineSpec]) –- colorstr
Line color.
- linewidthfloat
Line width in points.
- labelstr
Legend label for the detection function line.
- Returns:
Returns self to allow method chaining.
- Return type:
Self
- set_threshold_draw_opts(**options)[source]
Set drawing options for threshold line.
- Parameters:
**options (
Unpack[LineSpec]) –- colorstr
Line color.
- linestylestr
Line style (‘solid’, ‘dash’, etc.).
- linewidthfloat
Line width in points.
- alphafloat
Line opacity between 0 and 1.
- labelstr
Legend label for the threshold line.
- Returns:
Returns self to allow method chaining.
- Return type:
Self
- set_processing_time_plot_opts(**options)[source]
Set general plot options for processing time subplot.
- Parameters:
**options (
Unpack[PlotSpec]) –- xlabelstr
X-axis label.
- ylabelstr
Y-axis label.
- gridbool
Whether to show grid lines.
- Returns:
Returns self to allow method chaining.
- Return type:
Self
- set_processing_time_draw_opts(**options)[source]
Set drawing options for processing time line.
- Parameters:
**options (
Unpack[FilledLineSpec]) –- colorstr
Line color.
- linewidthfloat
Line width in points.
- fill_alphafloat
Opacity of fill under the line between 0 and 1.
- labelstr
Legend label for the processing time line.
- Returns:
Returns self to allow method chaining.
- Return type:
Self