From e5e6097bdfcf507cd08f188e81394a1ce0bafc55 Mon Sep 17 00:00:00 2001 From: Hoshea Date: Wed, 18 Nov 2020 17:22:49 +0800 Subject: [PATCH] Update comments --- widgets/heatmap/heatmap.go | 4 ++-- widgets/heatmap/internal/axes/label.go | 10 +++++----- widgets/heatmap/options.go | 3 ++- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/widgets/heatmap/heatmap.go b/widgets/heatmap/heatmap.go index 104121c..fcceba8 100644 --- a/widgets/heatmap/heatmap.go +++ b/widgets/heatmap/heatmap.go @@ -27,10 +27,10 @@ import ( "github.com/mum4k/termdash/widgets/heatmap/internal/axes" ) -// HeatMap draws heatmap charts. +// HeatMap draws heat map charts. // // Heatmap consists of several cells. Each cell represents a value. -// The larger the value, the darker the color of the cell (From white to black). +// The larger the value, the darker the color of the cell (from white to black). // // The two dimensions of the values (cells) array are determined by the length of // the XLabels and YLabels arrays respectively. diff --git a/widgets/heatmap/internal/axes/label.go b/widgets/heatmap/internal/axes/label.go index 9f11ded..fa816c2 100644 --- a/widgets/heatmap/internal/axes/label.go +++ b/widgets/heatmap/internal/axes/label.go @@ -53,12 +53,12 @@ func xLabels(yEnd image.Point, graphWidth int, stringLabels []string, cellWidth return nil, errors.New("not implemented") } -// paddedLabelLength calculates the length of the padded label and +// paddedLabelLength calculates the length of the padded X label and // the column index corresponding to the label. -// For example, the longest label's length is 5, like '12:34', and the cell's width is 3. -// So in order to better display, every three cells will display a label, -// the label belongs to the middle column of the three columns, -// and the padded length is 3*3, which is 9. +// For example, the longest X label's length is 5, like '12:34', and the cell's width is 3. +// So in order to better display, every three columns of cells will display a X label, +// the X label belongs to the middle column of the three columns, +// and the padded length is 3*3 (cellWidth multiplies the number of columns), which is 9. func paddedLabelLength(graphWidth, longest, cellWidth int) (l, index int) { return } diff --git a/widgets/heatmap/options.go b/widgets/heatmap/options.go index f8a28dc..19f11da 100644 --- a/widgets/heatmap/options.go +++ b/widgets/heatmap/options.go @@ -15,6 +15,7 @@ package heatmap import ( + "errors" "github.com/mum4k/termdash/cell" ) @@ -36,7 +37,7 @@ type options struct { // validate validates the provided options. func (o *options) validate() error { - return nil + return errors.New("not implemented") } // newOptions returns a new options instance.