Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: provide a static scale option #108

Open
danielhoherd opened this issue Apr 20, 2023 · 0 comments
Open

Feature request: provide a static scale option #108

danielhoherd opened this issue Apr 20, 2023 · 0 comments

Comments

@danielhoherd
Copy link
Contributor

danielhoherd commented Apr 20, 2023

Description

I would love to see a feature that lets the user specify a scale to use, rather than setting the max width.

Use cases

If a user does something like:

while sleep 1m ; do
  fetch-widely-variable-data | termgraph
done

The produced graph is always scaled to the max width no matter what the values are. For instance, on one run it might be:

▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 26
▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 37
▇▇▇▇▇▇▇▇ 6

But later on it may be:

▇▇▇▇▇▇ 12
▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 70
▇▇▇ 6

The numbers show the difference, but the horizontal line is the same length because the scale of units to ticks is different, which makes the data change over time difficult to visually parse at a glance.

Proposed solution

Implement a --scale option that allows the user to specify how many units should be represented in 1 tick. For instance --scale=4 could mean that the numbers 1-4 are always represented by , 5-8 as ▇▇, and so on.

The --scale=4 example here may not be the best that we can come up with, but is one possible solution.

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

No branches or pull requests

1 participant