Skip to content

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

Merged
mkaz merged 2 commits into
mkaz:mainfrom
GreedyC:codex/fixed-bar-scale
Nov 7, 2026
Merged

mkaz merged 2 commits into
mkaz:mainfrom
GreedyC:codex/fixed-bar-scale

Conversation

@GreedyC

@GreedyC GreedyC commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

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.

@GreedyC

GreedyC commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

Following up on fixed units-per-tick scaling. I am still following this PR and am available to address feedback on the option or its behavior. Thanks for your time.

Posted with Codex assistance.

@mkaz
mkaz force-pushed the codex/fixed-bar-scale branch from d12f77a to 7b5cf37 Compare November 7, 2026 16:32
@mkaz
mkaz merged commit 0eaf572 into mkaz:main Nov 7, 2026
1 check passed
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

3 participants