mirror of
https://github.com/mum4k/termdash.git
synced 2025-04-25 13:48:50 +08:00
Update comments
This commit is contained in:
parent
65debbb18f
commit
e5e6097bdf
@ -27,10 +27,10 @@ import (
|
|||||||
"github.com/mum4k/termdash/widgets/heatmap/internal/axes"
|
"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.
|
// 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 two dimensions of the values (cells) array are determined by the length of
|
||||||
// the XLabels and YLabels arrays respectively.
|
// the XLabels and YLabels arrays respectively.
|
||||||
|
@ -53,12 +53,12 @@ func xLabels(yEnd image.Point, graphWidth int, stringLabels []string, cellWidth
|
|||||||
return nil, errors.New("not implemented")
|
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.
|
// 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.
|
// 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 cells will display a label,
|
// So in order to better display, every three columns of cells will display a X label,
|
||||||
// the label belongs to the middle column of the three columns,
|
// the X label belongs to the middle column of the three columns,
|
||||||
// and the padded length is 3*3, which is 9.
|
// 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) {
|
func paddedLabelLength(graphWidth, longest, cellWidth int) (l, index int) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
package heatmap
|
package heatmap
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"github.com/mum4k/termdash/cell"
|
"github.com/mum4k/termdash/cell"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -36,7 +37,7 @@ type options struct {
|
|||||||
|
|
||||||
// validate validates the provided options.
|
// validate validates the provided options.
|
||||||
func (o *options) validate() error {
|
func (o *options) validate() error {
|
||||||
return nil
|
return errors.New("not implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
// newOptions returns a new options instance.
|
// newOptions returns a new options instance.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user