1
0
mirror of https://github.com/nikolaydubina/calendarheatmap.git synced 2025-01-31 11:05:13 +02:00
calendarheatmap/README.md
2020-07-04 12:18:57 +08:00

1.7 KiB

Go Report Card GoDev codecov Awesome

Self-contained, plain Go implementation of calendar heatmap inspired by Github contribution activity.

Basic basic

Colorscales col1 col2

Without month separator nosep

Without labels nolab

Without labels, without separator nosep_nolab

Example module, save output in formats supported by image module (PNG, JPEG, GIF).

countByDayOfYear := map[int]int{
    1: 10,
    22: 15,
    150: 22,
    366: 55,
    ...
}

img := charts.NewHeatmap(charts.HeatmapConfig{
    Year:               2020,
    CountByDay:         countByDay,
    ColorScale:         colorscales.PuBu9,
    DrawMonthSeparator: true,
    DrawLabels:         true,
    ...
})

Example script, output as PNG.

go run main.go -h

TODO:

  • SVG support
  • select start and end date
  • JPEG, GIF in script output
  • CSV, JSON in script input