1
0
mirror of https://github.com/nikolaydubina/calendarheatmap.git synced 2025-03-04 16:15:45 +02:00

better readme

This commit is contained in:
Nikolay 2020-07-11 19:16:11 +08:00
parent 5eb73ee499
commit dd242befbd
6 changed files with 17 additions and 3 deletions

View File

@ -44,7 +44,13 @@ img := charts.NewHeatmap(charts.HeatmapConfig{
Example script, Example script,
``` ```
$ go build; ./calendarheatmap -h $ go build
$ ./calendarheatmap -input testdata/basic.json -output basicjson.png
$ ./calendarheatmap -input testdata/custom.txt -output custom.png -input-format row-day-seconds-count
$ ./calendarheatmap -h
Usage of ./calendarheatmap: Usage of ./calendarheatmap:
-colorscale string -colorscale string
@ -52,7 +58,7 @@ Usage of ./calendarheatmap:
-input string -input string
file should contain lines in format: 2020-05-16 20:43 PPPP (default "input.txt") file should contain lines in format: 2020-05-16 20:43 PPPP (default "input.txt")
-intput-format /parsers -intput-format /parsers
format of input file (json-basic) refer to /parsers for examples (default "row-day-seconds-count") format of input file refer to /parsers for examples (default "json-basic")
-labels -labels
labels for weekday and months (default true) labels for weekday and months (default true)
-monthsep -monthsep

Binary file not shown.

BIN
chart.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -25,7 +25,7 @@ func main() {
colorScale := flag.String("colorscale", "PuBu9", "refer to colorscales for examples") colorScale := flag.String("colorscale", "PuBu9", "refer to colorscales for examples")
labels := flag.Bool("labels", true, "labels for weekday and months") labels := flag.Bool("labels", true, "labels for weekday and months")
outputFormat := flag.String("output-format", "png", "output format (png, jpeg, gif)") outputFormat := flag.String("output-format", "png", "output format (png, jpeg, gif)")
inputFormat := flag.String("intput-format", "row-day-seconds-count", "format of input file (json-basic) refer to `/parsers` for examples") inputFormat := flag.String("input-format", "json-basic", "format of input file refer to `/parsers` for examples")
flag.Parse() flag.Parse()
data, err := ioutil.ReadFile(*filenameInput) data, err := ioutil.ReadFile(*filenameInput)

8
testdata/basic.json vendored Normal file
View File

@ -0,0 +1,8 @@
{
"2020-01-01": 1,
"2020-01-02": 2,
"2020-01-03": 3,
"2020-01-04": 4,
"2020-01-05": 5,
"2020-01-06": 6
}