From f5dc3335b305cf46b9fbd8f25429ba829ca160d0 Mon Sep 17 00:00:00 2001 From: Hoshea Date: Fri, 20 Nov 2020 20:17:24 +0800 Subject: [PATCH] dev --- widgets/heatmap/heatmap.go | 7 +++++-- widgets/heatmap/internal/axes/axes.go | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/widgets/heatmap/heatmap.go b/widgets/heatmap/heatmap.go index 79f8407..3a6d367 100644 --- a/widgets/heatmap/heatmap.go +++ b/widgets/heatmap/heatmap.go @@ -47,9 +47,9 @@ type HeatMap struct { // yLabels are the labels on the Y axis in an increasing order. yLabels []string - // MinValue and MaxValue are the Min and Max values in the values, + // minValue and maxValue are the Min and Max values in the values, // which will be used to calculate the color of each cell. - MinValue, MaxValue float64 + minValue, maxValue float64 // opts are the provided options. opts *options @@ -64,8 +64,11 @@ func New(opts ...Option) (*HeatMap, error) { } // Values sets the values to be displayed by the HeatMap. +// // Each value in values has a xLabel and a yLabel, which means // len(xLabels) == len(values) and len(yLabels) == len(values[i]). +// +// Each call to Values overwrites any previously provided values. // Provided options override values set when New() was called. func (hp *HeatMap) Values(xLabels []string, yLabels []string, values [][]float64, opts ...Option) error { return errors.New("not implemented") diff --git a/widgets/heatmap/internal/axes/axes.go b/widgets/heatmap/internal/axes/axes.go index e21f64c..e0dc9dc 100644 --- a/widgets/heatmap/internal/axes/axes.go +++ b/widgets/heatmap/internal/axes/axes.go @@ -79,7 +79,8 @@ type XDetails struct { } // NewXDetails retrieves details about the X axis required to draw it on a canvas -// of the provided area. The yEnd is the point where the Y axis ends. +// of the provided area. +// The yEnd is the point where the Y axis ends. func NewXDetails(cvsAr image.Rectangle, yEnd image.Point, labels []string, cellWidth int) (*XDetails, error) { return nil, errors.New("not implemented") }