Skip to content

feat(plotting): percentage point primitive and centralized theme defaults#89

Open
acere wants to merge 2 commits into
awslabs:mainfrom
acere:feat/plotting-percentage-primitive
Open

feat(plotting): percentage point primitive and centralized theme defaults#89
acere wants to merge 2 commits into
awslabs:mainfrom
acere:feat/plotting-percentage-primitive

Conversation

@acere

@acere acere commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Closes #88

Summary

  • Percentage point visualization: a new chart type for rate metrics (fractions of a total). Each value is rendered as a dot on a 0%–100% line with a colored fill segment, giving immediate spatial context. Supports single or multiple stacked metrics, optional actual/total counts in tooltips.
  • Centralized theme defaults: introduces llmeter.plotting.defaults with DEFAULT_TEMPLATE and get_colorway(). All existing plotting functions now reference these instead of hardcoding "plotly_white". Users can switch the global theme in one place.

What was tested

  • Ruff lint passes on all modified/new files
  • Import smoke tests and assertion checks for both new functions
  • Existing test suite passes (13/13 unit tests; 1 pre-existing integ failure unrelated to this change)
  • Docs build cleanly with zensical build --clean

New public API

from llmeter.plotting import (
    DEFAULT_TEMPLATE,
    get_colorway,
    percentage_point,
    percentage_points,
)

…efaults

Add a standard visualization for percentage metrics (fractions of a total)
rendered as a point on a [0%, 100%] line with a colored fill segment.

Changes:
- Add llmeter/plotting/defaults.py: centralize DEFAULT_TEMPLATE and
  get_colorway() so all charts share consistent theme and color management
- Add llmeter/plotting/percentage.py: percentage_point() and
  percentage_points() functions for visualizing rate metrics
- Migrate all hardcoded "plotly_white" in plotting.py to DEFAULT_TEMPLATE
- Add user guide page (docs/user_guide/plotting.md) covering theme
  management and the percentage primitive with usage examples
- Add API reference pages for the new modules
- Update mkdocs.yml navigation
@athewsey
athewsey force-pushed the feat/plotting-percentage-primitive branch from 595f09b to 3f59d34 Compare June 24, 2026 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plotting: no standard way to visualize percentage/rate metrics, and template is hardcoded

2 participants