Skip to content

Add fixed units-per-tick scaling for bar charts - #130

Open
GreedyC wants to merge 2 commits into
mkaz:mainfrom
GreedyC:codex/fixed-bar-scale
Open

GreedyC wants to merge 2 commits into
mkaz:mainfrom
GreedyC:codex/fixed-bar-scale

Conversation

@GreedyC

@GreedyC GreedyC commented Sep 29, 2026

Copy link
Copy Markdown

Summary

Termgraph currently rescales every chart to the current dataset maximum, making repeated command outputs hard to compare. This adds fixed units-per-tick scaling requested in #108.

  • Add --scale N and Args(scale=N) for horizontal, stacked, and vertical bar charts. Each positive value rounds up to a whole tick; zero stays empty.
  • Keep existing automatic scaling when the option is absent. Reject non-finite or negative data and incompatible chart modes instead of silently changing the baseline.
  • Document the CLI and Python API. Explicitly retain Ruff's established E4/E7/E9/F rule set so current Ruff releases do not add unrelated default-rule failures.
  • In a separate commit, make two existing file-input tests portable on Windows: those tests reopened a still-open NamedTemporaryFile, which failed in the preflight run.

Verification

  • 71 tests, Ruff, and mypy pass locally on Python 3.9 and 3.14.
  • The fork-only cross-platform preflight passes on Linux, Windows, and macOS with both Python versions (6/6). Its branch has the same project files as this PR; only its workflow file differs.
  • The repository's existing CI passes.
  • Built and checked the source distribution and wheel.

Code and tests were prepared with Codex assistance.

Closes #108.

Copilot AI balanced review requested due to automatic review settings September 29, 2026 16:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

Feature request: provide a static scale option

2 participants