Update comments

This commit is contained in:
Hoshea 2020-11-18 17:22:49 +08:00
parent 65debbb18f
commit e5e6097bdf
3 changed files with 9 additions and 8 deletions

View File

@ -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.

View File

@ -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
}

View File

@ -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.