Skip to content

Commit e7156ca

Browse files
committed
Dynamic scaling & Graph meter coloring
This patch adds dynamic scaling to the Bar and Graph meter, and color for Graph meter. Details of the features: 1. Dynamic scaling is enabled by setting a negative "total" value to the meter. It's useful for meter like Load Average and Tasks where a fixed maximum value doesn't make sense. For Bar meter a dynamic "total" will be computed when drawing. For Graph meter, the "total" will align to a power of 2 to ease the management of internal data structures. 2. Colors on the graph will base on items of the (stacked) bars. The colors are picked to match the percentage of the items as close as possible, while the rounding differences (for each 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 it's better than nothing. :) [v2: Graph captions now printed above units. v3: Correction on the "top cell" visuals of the graph, and the character in no-unicode mode drawing. v4: GraphData->cell now allocated separately from GraphData.] Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
1 parent c10eea8 commit e7156ca

2 files changed

Lines changed: 618 additions & 64 deletions

File tree

0 commit comments

Comments
 (0)