Skip to main content

Module analytics_charts

Module analytics_charts 

Source
Expand description

Analytics chart rendering for the ftui analytics views.

Provides AnalyticsChartData (pre-computed chart data) and rendering functions that turn analytics query results into terminal-native visualizations using ftui-extras charts and canvas widgets.

Chart data is loaded via load_chart_data(db, filters, group_by) — a single DB query path that all 8 analytics views share. Views consume pre-computed data during view() without further DB access. The Explorer view layer adds dimension overlays via build_dimension_overlay() for proportional breakdowns by agent/workspace/source.

Structs§

AnalyticsChartData
Pre-computed chart data for the analytics views.
ExplorerState
Explorer view state passed to the render function.

Functions§

breakdown_rows
Number of selectable rows in the Breakdowns view for the given tab.
coverage_row_count
Number of visible rows in the Coverage view (for selection bounds).
load_chart_data
Load analytics data from the database, returning an AnalyticsChartData.
plans_rows
Number of selectable rows in the Plans view (per-agent plan breakdown).
render_analytics_content
Dispatch rendering to the appropriate view function.
render_breakdowns
Render the Breakdowns view: tabbed agent/workspace/source/model bar charts.
render_coverage
Render the Coverage view: overall bar + per-agent breakdown + daily sparkline.
render_dashboard
Render the Dashboard view: KPI tile wall with sparklines + top agents.
render_explorer
Render the Explorer view: interactive metric selector + line area/scatter charts.
render_heatmap
Render the Heatmap view: GitHub-contributions-style calendar with metric selector, day-of-week labels, month headers, selection highlight, and legend.
render_tools
Render the Tools view: per-agent table with calls, messages, tokens, calls/1K, and trend.
tools_row_count
Number of visible rows in the Tools view (for selection bounds).