dbs_annotator.utils.report_chart_utils

Shared chart utilities for report generation.

Provides reusable functions for building matplotlib-based scale timeline charts used by both the session and longitudinal exporters. Centralising the chart logic avoids code duplication and guarantees consistent styling across report types.

Functions

add_chart_to_doc(doc, png_bytes, *[, ...])

Insert a PNG chart into a Word document.

build_scales_chart(scale_data, scale_prefs, *)

Build a scale-trend chart and return it as PNG bytes.

compute_aggregate_index(scale_data, ...)

Compute a weighted aggregate-index value per x-point.

find_best_and_second(index_vals)

Return the x-points with the best and second-best aggregate-index scores.

get_declared_scale_range(scale_targets)

Return overall (min, max) from declared per-scale ranges.

parse_scale_targets(prefs)

Convert user preference tuples into a look-up dict.