Go to file
2023-06-19 18:58:33 -07:00
cmd Expand the palette flag explanation. 2023-06-19 18:58:33 -07:00
.gitignore Initial commit 2023-06-17 00:21:30 -07:00
go.mod Rudimentary support for drawing labels along the x and y axes. 2023-06-18 15:32:10 -07:00
go.sum Rudimentary support for drawing labels along the x and y axes. 2023-06-18 15:32:10 -07:00
lagrange-2023-06-17.png Opaque background by default for now. 2023-06-18 23:53:14 -07:00
LICENSE Initial commit 2023-06-17 00:21:30 -07:00
main.go Correct copyright notice email. 2023-06-17 13:09:09 -07:00
README.md Expand the palette flag explanation. 2023-06-19 18:58:33 -07:00

date-heatmap

Generates a Github-like heatmap graphic from a list of tab-separated numbers and dates.

Writes a PNG to stdout.

Example:

Running the following command in the Lagrange Gemini browser's repository...

git shortlog --group='%cd' --date='format:%Y-%m-%d' -s | date-heatmap --origin-dow sunday --cols 52 --labels --until 2023-06-17 > 2023-06-17-lagrange.png

...produces this image summarizing the commit frequency of the past 52 weeks as of 2023-06-17:

A 692x94 pixel graph of 10 pixel boxes spaced 3 pixels apart in 7 rows of 52 boxes each. Each box ranges in color from almost-black-green to bright green.

Usage:

  date-heatmap [flags]

Flags:
      --cols int            how many columns of squares. (automatically calculated from days and rows if omitted.)
      --days int            number of days to render (must be <= rows*cols) (automatically calculated from columns and rows if omitted.)
  -h, --help                help for date-heatmap
      --labels              whether to draw day of week and month labels
      --origin-dow string   day of week with which to align the graph's origin. (optional)
      --padding int         padding between the squares (default 3)
      --palette string      list of threshold values and their associated colors, with special "bg", "fg", and "df" thresholds for the background, font, and default square colors, respectively. colors must be specified as 6 or 8 digit RGB or RGBA hexadecimal strings. (default "bg:000000;fg:FFFFFF;df:161B22;2:0E4429;4:006D32;6:26A641;8:39D353")
      --rows int            how many rows of squares (default 7)
      --size int            pixel size of the squares (default 10)
      --until string        end date for the heat map. defaults to the current date.
hex@reform:~/extramuros/src/lagrange$

TODO

  • Custom font faces, sizes, and spacing