Skip to content

Commit

Permalink
Graph meter coloring (with GraphData structure rework)
Browse files Browse the repository at this point in the history
Rewrite the entire graph meter drawing code to support color graph
drawing in addition to the dynamic scaling (both can work together
because of the new GraphData structure design).

The colors of a graph are based on the percentages of item values of
the meter. The rounding differences of each terminal character are
addressed through the different numbers of braille dots.

Due to low resolution of the character terminal, the rasterized colors
may not look nice, but better than nothing. :)

The new GraphData structure design has two technical limitations:
* The height of a graph meter now has a limit of 8191 (terminal rows).
* If dynamic scaling is used, the "total" value or scale of a graph now
  has to align to a power of 2.

The code is designed with the anticipation that the graph height may
change at runtime. No UI or option has been implemented for that yet.

Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
  • Loading branch information
Explorer09 committed Dec 16, 2024
1 parent fd710ca commit 3d183bd
Show file tree
Hide file tree
Showing 2 changed files with 959 additions and 66 deletions.
Loading

0 comments on commit 3d183bd

Please sign in to comment.