Skip to content

Commit

Permalink
Unexport heatMapGrid
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Valdes <[email protected]>
  • Loading branch information
ivanvc committed Feb 4, 2024
1 parent 5ea9bb7 commit 43cb329
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tools/rw-heatmaps/pkg/chart/heatmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func plotIndividualHeatMap(title, plotType string, records []dataset.DataRecord)
// Populate X and Y axis data from records
xCoords, yCoords := populateGridAxes(records)

gridData := &HeatMapGrid{
gridData := &heatMapGrid{
x: xCoords,
y: yCoords,
z: make([][]float64, len(yCoords)),
Expand Down
12 changes: 6 additions & 6 deletions tools/rw-heatmaps/pkg/chart/heatmap_grid.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,27 @@

package chart

// HeatMapGrid holds X, Y, Z values for a heatmap.
type HeatMapGrid struct {
// heatMapGrid holds X, Y, Z values for a heatmap.
type heatMapGrid struct {
x, y []float64
z [][]float64 // The Z values should be arranged in a 2D slice.
}

// Dims returns the number of elements in the grid.
// It implements the plotter.GridXYZ interface.
func (h *HeatMapGrid) Dims() (int, int) {
func (h *heatMapGrid) Dims() (int, int) {
return len(h.x), len(h.y)
}

// Z returns the value of a grid cell at (c, r).
// It implements the plotter.GridXYZ interface.
func (h *HeatMapGrid) Z(c, r int) float64 {
func (h *heatMapGrid) Z(c, r int) float64 {
return h.z[r][c]
}

// X returns the coordinate for the column at index c.
// It implements the plotter.GridXYZ interface.
func (h *HeatMapGrid) X(c int) float64 {
func (h *heatMapGrid) X(c int) float64 {
if c >= len(h.x) {
panic("index out of range")
}
Expand All @@ -43,7 +43,7 @@ func (h *HeatMapGrid) X(c int) float64 {

// Y returns the coordinate for the row at index r.
// It implements the plotter.GridXYZ interface.
func (h *HeatMapGrid) Y(r int) float64 {
func (h *heatMapGrid) Y(r int) float64 {
if r >= len(h.y) {
panic("index out of range")
}
Expand Down

0 comments on commit 43cb329

Please sign in to comment.